]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-7861, xhtml strict fixes for choice
authortoyomoyo <toyomoyo>
Tue, 9 Jan 2007 03:14:34 +0000 (03:14 +0000)
committertoyomoyo <toyomoyo>
Tue, 9 Jan 2007 03:14:34 +0000 (03:14 +0000)
mod/choice/lib.php
mod/choice/report.php
theme/standard/styles_layout.css

index bc13adc526c66f3ee16157a30668862c69658b00..ebd1118071186c67340feec78ecb2025205778ef 100644 (file)
@@ -350,7 +350,6 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') {
         }
     }
     ksort($useranswer);
-
     switch ($forcepublish) {
         case CHOICE_PUBLISH_NAMES:
 
@@ -358,6 +357,7 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') {
             if (has_capability('mod/choice:readresponses', $context)) {
                 echo '<div id="tablecontainer">';
                 echo '<form id="attemptsform" method="post" action="'.$_SERVER['PHP_SELF'].'" onsubmit="var menu = document.getElementById(\'menuaction\'); return (menu.options[menu.selectedIndex].value == \'delete\' ? \''.addslashes(get_string('deleteattemptcheck','quiz')).'\' : true);">';
+                echo '<div>';
                 echo '<input type="hidden" name="id" value="'.$cm->id.'" />';
                 echo '<input type="hidden" name="mode" value="overview" />';
             }
@@ -382,14 +382,17 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') {
             $count = 0;
             foreach ($useranswer as $optionid => $userlist) {
                 if ($optionid) {
-                    echo "<td class=\"col$count data\" style=\"width:$tablewidth%\" valign=\"top\" nowrap=\"nowrap\">";
+                    echo "<td class=\"col$count data\" style=\"width:$tablewidth%;\">";
                 } else if ($choice->showunanswered) {
-                    echo "<td class=\"col$count data\" style=\"width:$tablewidth%\" valign=\"top\" nowrap=\"nowrap\">";
+                    echo "<td class=\"col$count data\" style=\"width:$tablewidth%;\">";
                 } else {
                     continue;
                 }
 
-                echo "<table width=\"100%\">";
+                // added empty row so that when the next iteration is empty,
+                // we do not get <table></table> erro from w3c validator
+                // MDL-7861
+                echo "<table class=\"choiceresponse\"><tr><td></td></tr>";
                 foreach ($userlist as $user) {
                     // this needs to be fixed
                     // hide admin/editting teacher (users with editting privilages)
@@ -399,9 +402,9 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') {
                         if (has_capability('mod/choice:readresponses', $context) && $optionid!=0) {
                             echo '<td class="attemptcell"><input type="checkbox" name="attemptid[]" value="'. $answers[$user->id]->id. '" /></td>';
                         }
-                        echo "<td width=\"10\" nowrap=\"nowrap\" class=\"picture\">";
+                        echo "<td class=\"picture\">";
                         print_user_picture($user->id, $course->id, $user->picture);
-                        echo "</td><td width=\"100%\" nowrap=\"nowrap\" class=\"fullname\">";
+                        echo "</td><td class=\"fullname\">";
                         echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=$course->id\">";
                         echo fullname($user, has_capability('moodle/site:viewfullnames', $context));
                         echo "</a>";
@@ -451,14 +454,15 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') {
                 $options = array('delete' => get_string('delete'));
                 echo choose_from_menu($options, 'action', '', get_string('withselected', 'quiz'), 'if(this.selectedIndex > 0) submitFormById(\'attemptsform\');', '', true);
                 echo '<noscript id="noscriptmenuaction" style="display: inline;">';
-                echo '<input type="submit" value="'.get_string('go').'" /></noscript>';
+                echo '<div>';
+                echo '<input type="submit" value="'.get_string('go').'" /></div></noscript>';
                 echo '<script type="text/javascript">'."\n<!--\n".'document.getElementById("noscriptmenuaction").style.display = "none";'."\n-->\n".'</script>';
                 echo '</td><td></td></tr>';
             }
 
             echo "</table>";
             if (has_capability('mod/choice:readresponses', $context)) {
-                echo "</form></div>";
+                echo "</div></form></div>";
             }
             break;
 
@@ -482,7 +486,7 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') {
                 echo "</th>";
                 $count++;
             }
-            echo "</tr><tr>";
+            echo "</tr>";
 
             $maxcolumn = 0;
             foreach ($useranswer as $optionid => $userlist) {
@@ -500,7 +504,7 @@ function choice_show_results($choice, $course, $cm, $forcepublish='') {
                 }
             }
 
-            echo "</tr><tr>";
+            echo "<tr>";
             $count = 0;
             foreach ($useranswer as $optionid => $userlist) {
                 if (!$optionid and !$choice->showunanswered) {
index f54a7a4fdd34fd4bf2c03aa675939aa6178e2f4c..ac9355175da0dc7bdd67d403a7030c724863099e 100644 (file)
    
    //now give links for downloading spreadsheets. 
     echo "<br />\n";
-    echo "<table border=\"0\" align=\"center\"><tr>\n";
+    echo "<table class=\"downloadreport\"><tr>\n";
     echo "<td>";
     $options = array();
     $options["id"] = "$cm->id";   
index ad146fde7a0e646a8b10f63516566c64e80a51ec..a7164f7f7212343fbddc5ded7b61e9e5f876bec5 100644 (file)
@@ -2086,16 +2086,37 @@ body#user-index .rolesform {
   white-space: nowrap; 
 }
 
-.anonymous {
+.anonymous,
+.names {
   margin-left:auto;
   margin-right:auto;  
 }
 
-.names {
+.downloadreport {
+  border:0px;
   margin-left:auto;
   margin-right:auto;  
 }
 
+.choiceresponse {
+  width:100%;  
+}
+.choiceresponse .picture {
+  width:10px;
+  white-space: nowrap;
+}
+
+.choiceresponse .fullname {
+  width:100%;
+  white-space: nowrap;
+}
+
+
+.results.data {
+  vertical-align:top;
+  white-space: nowrap;
+}
+
 /***
  *** Modules: Data
  ***/