Index: lang/en_utf8/survey.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/survey.php,v
retrieving revision 1.5
diff -u -r1.5 survey.php
--- lang/en_utf8/survey.php	27 Mar 2007 22:01:17 -0000	1.5
+++ lang/en_utf8/survey.php	21 Nov 2007 14:41:32 -0000
@@ -193,6 +193,7 @@
 $string['questions'] = 'Questions';
 $string['questionsnotanswered'] = 'Some of the multiple choice questions have not been answered.';
 $string['report'] = 'Survey report';
+$string['responses'] = 'Responses';
 $string['savednotes'] = 'Your notes were saved';
 $string['scaleagree5'] = 'Strongly disagree,Somewhat disagree,Neither agree nor disagree,Somewhat agree,Strongly agree';
 $string['scales'] = 'Scales';
Index: mod/survey/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/survey/lib.php,v
retrieving revision 1.63
diff -u -r1.63 lib.php
--- mod/survey/lib.php	28 Aug 2007 00:12:03 -0000	1.63
+++ mod/survey/lib.php	21 Nov 2007 14:41:32 -0000
@@ -349,14 +349,15 @@
 
 
 function survey_print_multi($question) {
-    GLOBAL $USER, $db, $qnum, $checklist;
+    global $USER, $db, $qnum, $checklist;
 
     $stripreferthat = get_string("ipreferthat", "survey");
     $strifoundthat = get_string("ifoundthat", "survey");
-    echo "<br />\n";
-    echo "<span class='questiontext'><b>$question->text</b></span><br />";
-    echo "<div style=\"text-align:center\">";
-    echo "<table width=\"90%\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\">";
+    $strdefault    = get_string('default');
+    $strresponses  = get_string('responses', 'survey');
+
+    print_heading($question->text, null, 3, 'questiontext');
+    echo "\n<table width=\"90%\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\">";
 
     $options = explode( ",", $question->options);
     $numoptions = count($options);
@@ -367,20 +368,21 @@
     } else {
         $P = "";
     }
-   
-    if ($oneanswer) { 
-        echo "<tr><td colspan=\"2\">$question->intro</td>";
-    } else {
-        echo "<tr><td colspan=\"3\">$question->intro</td>"; 
-    }
 
+    echo "<tr class=\"smalltext\"><th scope=\"row\">$strresponses</th>";
     while (list ($key, $val) = each ($options)) {
-        echo "<td class=\"smalltextcell\"><span class='smalltext'>$val</span></td>\n";
+        echo "<th scope=\"col\" class=\"hresponse\">$val</th>\n";
+    }
+    echo "<th>&nbsp;</th></tr>\n";
+
+    if ($oneanswer) {
+        echo "<tr><th scope=\"col\" colspan=\"6\">$question->intro</th></tr>\n";
+    } else {
+        echo "<tr><th scope=\"col\" colspan=\"7\">$question->intro</th></tr>\n"; 
     }
-    echo "<td align=\"center\">&nbsp;</td></tr>\n";
 
     $subquestions = get_records_list("survey_questions", "id", $question->multi);
-    
+
     foreach ($subquestions as $q) {
         $qnum++;
         $rowclass = survey_question_rowclass($qnum);
@@ -388,54 +390,61 @@
             $q->text = get_string($q->text, "survey");
         }
 
-        echo "<tr class=\"$rowclass\">";
+        echo "<tr class=\"$rowclass rblock\">";
         if ($oneanswer) {
 
-            echo "<td class=\"qnumtopcell\"><b>$qnum</b></td>";
-            echo "<td valign=\"top\">$q->text</td>";
-            for ($i=1;$i<=$numoptions;$i++) {            
-                $screenreader = !empty($USER->screenreader)?"<label for=\"q$P" . $q->id . "_$i\">".$options[$i-1]."</label><br/>":'';
-                echo "<td class=\"screenreadertext\">".$screenreader."<input type=\"radio\" name=\"q$P$q->id\" id=\"q$P" . $q->id . "_$i\" value=\"$i\" alt=\"$i\" /></td>";
+            echo "<th scope=\"row\" class=\"optioncell\">";
+            echo "<b class=\"qnumtopcell\">$qnum</b> &nbsp; ";
+            echo $q->text ."</th>\n";
+            for ($i=1;$i<=$numoptions;$i++) {
+                $hiddentext = get_accesshide($options[$i-1]);
+                $id = "q$P" . $q->id . "_$i";
+                echo "<td><label for=\"$id\"><input type=\"radio\" name=\"q$P$q->id\" id=\"$id\" value=\"$i\" />$hiddentext</label></td>";
             }
-            echo "<td class=\"whitecell\"><input type=\"radio\" name=\"q$P$q->id\" value=\"0\" checked=\"checked\" alt=\"0\" /></td>";
+            $default = get_accesshide($strdefault, 'label', '', "for=\"q$P$q->id\"");
+            echo "<td class=\"whitecell\"><input type=\"radio\" name=\"q$P$q->id\" id=\"q$P" . $q->id . "_D\" value=\"0\" checked=\"checked\" />$default</td>";
             $checklist["q$P$q->id"] = $numoptions;
         
         } else { 
             // yu : fix for MDL-7501, possibly need to use user flag as this is quite ugly.
-            echo "<td class=\"qnummiddlecell\"><b>$qnum</b></td>";
+            echo "<th scope=\"row\" class=\"optioncell\">";
+            echo "<b class=\"qnumtopcell\">$qnum</b> &nbsp; ";
             $qnum++;
-            echo "<td class=\"preferthat\"><span class='smalltext'>$stripreferthat&nbsp;</span></td>";
-            echo "<td class=\"optioncell\">$q->text</td>";
+            echo "<span class=\"preferthat smalltext\">$stripreferthat</span> &nbsp; ";
+            echo "<span class=\"option\">$q->text</span></th>\n";
             for ($i=1;$i<=$numoptions;$i++) {
-                $screenreader = !empty($USER->screenreader)?"<label for=\"qP" . $q->id . "_$i\">".$options[$i-1]."</label><br/>":'';
-                echo "<td class=\"screenreadertext\">".$screenreader."<input type=\"radio\" name=\"qP$q->id\" id=\"qP" . $q->id . "_$i\" value=\"$i\" alt=\"$i\"/></td>";
+                $hiddentext = get_accesshide($options[$i-1]);
+                $id = "qP" . $q->id . "_$i";
+                echo "<td><label for=\"$id\"><input type=\"radio\" name=\"qP$q->id\" id=\"$id\" value=\"$i\" />$hiddentext</label></td>";
             }
-            echo "<td><input type=\"radio\" name=\"qP$q->id\" value=\"0\" checked=\"checked\" alt=\"0\" /></td>";
+            $default = get_accesshide($strdefault, 'label', '', "for=\"qP$q->id\"");
+            echo "<td><input type=\"radio\" name=\"qP$q->id\" id=\"qP$q->id\" value=\"0\" checked=\"checked\" />$default</td>";
             echo "</tr>";
 
-            echo "<tr class=\"$rowclass\">";
-            echo "<td class=\"qnumtopcell\"><b>$qnum</b></td>";
-            echo "<td class=\"foundthat\"><span class='smalltext'>$strifoundthat&nbsp;</span></td>";
-            echo "<td class=\"optioncell\">$q->text</td>";
+            echo "<tr class=\"$rowclass rblock\">";
+            echo "<th scope=\"row\" class=\"optioncell\">";
+            echo "<b class=\"qnumtopcell\">$qnum</b> &nbsp; ";
+            echo "<span class=\"foundthat smalltext\">$strifoundthat</span> &nbsp; ";
+            echo "<span class=\"option\">$q->text</span></th>\n";
             for ($i=1;$i<=$numoptions;$i++) {
-                $screenreader = !empty($USER->screenreader)?"<label for=\"q" . $q->id . "_$i\">".$options[$i-1]."</label><br/>":'';
-                echo "<td class=\"screenreadertext\">".$screenreader."<input type=\"radio\" name=\"q$q->id\" id=\"q" . $q->id . "_$i\" value=\"$i\" alt=\"$i\" /></td>";
+                $hiddentext = get_accesshide($options[$i-1]);
+                $id = "q" . $q->id . "_$i";
+                echo "<td><label for=\"$id\"><input type=\"radio\" name=\"q$q->id\" id=\"$id\" value=\"$i\" />$hiddentext</label></td>";
             }
-            echo "<td class=\"buttoncell\"><input type=\"radio\" name=\"q$q->id\" value=\"0\" checked=\"checked\" alt=\"0\" /></td>";
+            $default = get_accesshide($strdefault, 'label', '', "for=\"q$q->id\"");
+            echo "<td class=\"buttoncell\"><input type=\"radio\" name=\"q$q->id\" id=\"q$q->id\" value=\"0\" checked=\"checked\" />$default</td>";
             $checklist["qP$q->id"] = $numoptions;
             $checklist["q$q->id"] = $numoptions;            
         }
         echo "</tr>\n";
-        
     }
     echo "</table>";
-    echo "</div>";
 }
 
 
 
 function survey_print_single($question) {
-    GLOBAL $db, $qnum;
+    global $db, $qnum;
 
     $rowclass = survey_question_rowclass(0);
 
@@ -444,17 +453,17 @@
     echo "<br />\n";
     echo "<table width=\"90%\" cellpadding=\"4\" cellspacing=\"0\">\n";
     echo "<tr class=\"$rowclass\">";
-    echo "<td valign=\"top\"><b>$qnum</b></td>";
-    echo "<td class=\"questioncell\">$question->text</td>\n";
-    echo "<td class=\"questioncell\"><span class='smalltext'>\n";
+    echo "<th scope=\"row\" class=\"optioncell\"><label for=\"q$question->id\"><b class=\"qnumtopcell\">$qnum</b> &nbsp; ";
+    echo "<span class=\"questioncell\">$question->text</span></label></th>\n";
+    echo "<td class=\"questioncell smalltext\">\n";
 
 
     if ($question->type == 0) {           // Plain text field
-        echo "<textarea rows=\"3\" cols=\"30\" name=\"q$question->id\">$question->options</textarea>";
+        echo "<textarea rows=\"3\" cols=\"30\" name=\"q$question->id\" id=\"q$question->id\">$question->options</textarea>";
 
     } else if ($question->type > 0) {     // Choose one of a number
         $strchoose = get_string("choose");
-        echo "<select name=\"q$question->id\">";
+        echo "<select name=\"q$question->id\" id=\"q$question->id\">";
         echo "<option value=\"0\" selected=\"selected\">$strchoose...</option>";
         $options = explode( ",", $question->options);
         foreach ($options as $key => $val) {
@@ -468,7 +477,7 @@
         notify("This question type not supported yet");
     }
 
-    echo "</span></td></tr></table>";
+    echo "</td></tr></table>";
 
 }
 
Index: theme/standard/styles_layout.css
===================================================================
RCS file: /cvsroot/moodle/moodle/theme/standard/styles_layout.css,v
retrieving revision 1.535
diff -u -r1.535 styles_layout.css
--- theme/standard/styles_layout.css	19 Nov 2007 20:31:58 -0000	1.535
+++ theme/standard/styles_layout.css	21 Nov 2007 14:41:33 -0000
@@ -4023,34 +4023,35 @@
 }
 
 .smalltext {
-  font-size:0.6em;
+  font-size: 0.75em;
 }
 
-.smalltextcell,
-.screenreadertext {
-  width:10%;
-  text-align:center;
+#surveyform th {
+  font-weight: normal;
+  text-align: left;
+}
+#surveyform th.hresponse {
+  text-align: center;
+  width: 9%;
+}
+
+.rblock label {
+  display: block;
+  text-align: center;
 }
 
 .foundthat,
 .preferthat {
-  width:10%;
   white-space: nowrap;
 }
 
-.qnumtopcell {
-  width:10px;
-  vertical-align:top;
-}
-
 .qnummiddlecell {
-  width:10px;
   vertical-align:middle;
 }
 
 .optioncell {
-  width:40%;
-  vertical-align:middle;
+  width: 50%;
+  vertical-align: top;
 }
 
 .buttoncell {
