]> git.mjollnir.org Git - moodle.git/commitdiff
XHTML and accessibility compliance
authormoodler <moodler>
Fri, 22 Oct 2004 07:45:58 +0000 (07:45 +0000)
committermoodler <moodler>
Fri, 22 Oct 2004 07:45:58 +0000 (07:45 +0000)
mod/choice/index.php
mod/choice/mod.html
mod/choice/report.php
mod/choice/view.php

index aafcbb2f61cb8cc2e93947b8bfbf6ddc7d90a27e..ad0b16bff40feb575743cf2a1bc1a00e107e698e 100644 (file)
 
     if ($course->format == "weeks") {
         $table->head  = array (get_string("week"), get_string("question"), get_string("answer"));
-        $table->align = array ("CENTER", "LEFT", "LEFT");
+        $table->align = array ("center", "left", "left");
     } else if ($course->format == "topics") {
         $table->head  = array (get_string("topic"), get_string("question"), get_string("answer"));
-        $table->align = array ("CENTER", "LEFT", "LEFT");
+        $table->align = array ("center", "left", "left");
     } else {
         $table->head  = array (get_string("question"), get_string("answer"));
-        $table->align = array ("LEFT", "LEFT");
+        $table->align = array ("left", "left");
     }
 
     $currentsection = "";
index b9cef59428e2a58a2436140fe6df3ff355fdcd40..758940cf90c539f17be4b56b783471e373bc742d 100644 (file)
 <table cellpadding="5">
 
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("choicename","choice") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("choicename","choice") ?>:</b></td>
     <td>
         <input type="text" name="name" size="30" value="<?php p($form->name) ?>" />
     </td>
 </tr>
 
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("choicetext","choice") ?>:</b></p>
+    <td align="right"><b><?php print_string("choicetext","choice") ?>:</b>
     <font size="1">
      <?php
         helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
@@ -99,7 +99,7 @@
 </tr>
 
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("choice","choice","1") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("choice","choice","1") ?>:</b></td>
     <td>
         <input type="text" name="answer1" size="60" value="<?php p($form->answer1) ?>" />
         <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
 </tr>
 
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("choice","choice","2") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("choice","choice","2") ?>:</b></td>
     <td>
         <input type="text" name="answer2" size="60" value="<?php p($form->answer2) ?>" />
         <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
 </tr>
 
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("choice","choice","3") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("choice","choice","3") ?>:</b></td>
     <td>
         <input type="text" name="answer3" size="60" value="<?php p($form->answer3) ?>" />
         <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
     </td>
 </tr>
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("choice","choice","4") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("choice","choice","4") ?>:</b></td>
     <td>
         <input type="text" name="answer4" size="60" value="<?php p($form->answer4) ?>" />
         <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
     </td>
 </tr>
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("choice","choice","5") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("choice","choice","5") ?>:</b></td>
     <td>
         <input type="text" name="answer5" size="60" value="<?php p($form->answer5) ?>" />
         <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
     </td>
 </tr>
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("choice","choice","6") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("choice","choice","6") ?>:</b></td>
     <td>
         <input type="text" name="answer6" size="60" value="<?php p($form->answer6) ?>" />
         <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
 </tr>
 
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("timerestrict", "choice") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("timerestrict", "choice") ?>:</b></td>
     <td>
         <script type="text/javascript">
             var timeitems = ['openday','openmonth','openyear','openhour', 'openminute', 'closeday','closemonth','closeyear','closehour','closeminute'];
     </td>
 </tr>
 <tr valign="top">
-    <td><p>&nbsp;</p></td>
+    <td>&nbsp;</td>
     <td>
 
         <table>
             <tr>
-                <td align="right"><p><b><?php print_string("choiceopen", "choice") ?>:</b></p></td>
+                <td align="right"><b><?php print_string("choiceopen", "choice") ?>:</b></td>
                 <td>
                 
     <?php
                 </td>
             </tr>
             <tr>
-                <td align="right"><p><b><?php print_string("choiceclose", "choice") ?>:</b></p></td>
+                <td align="right"><b><?php print_string("choiceclose", "choice") ?>:</b></td>
                 <td>
                 
     <?php
 </tr>
 
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("publish","choice") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("publish","choice") ?>:</b></td>
     <td>
         <?php
         require_once("$CFG->dirroot/mod/choice/lib.php");
 </tr>
 
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("privacy","choice") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("privacy","choice") ?>:</b></td>
     <td>
         <?php
         require_once("$CFG->dirroot/mod/choice/lib.php");
 
 
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("allowupdate","choice") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("allowupdate","choice") ?>:</b></td>
     <td>
         <?php
         $options[0] = get_string("no");
 
 
 <tr valign="top">
-    <td align="right"><p><b><?php print_string("showunanswered","choice") ?>:</b></p></td>
+    <td align="right"><b><?php print_string("showunanswered","choice") ?>:</b></td>
     <td>
         <?php
         $options[0] = get_string("no");
index d5f5c33e100a0c7ab49d2932aabf373aee532bd7..8fa19f82bed759535f032cfe949e35eba46bbe9d 100644 (file)
 
     foreach ($useranswer as $key => $answer) {
         if ($key) {
-            echo "<td width=\"$tablewidth%\" valign=\"top\" nowrap bgcolor=\"$THEME->cellcontent\">";
+            echo "<td width=\"$tablewidth%\" valign=\"top\" nowrap=\"nowrap\" bgcolor=\"$THEME->cellcontent\">";
         } else {
-            echo "<td width=\"$tablewidth%\" valign=\"top\" nowrap bgcolor=\"$THEME->body\">";
+            echo "<td width=\"$tablewidth%\" valign=\"top\" nowrap=\"nowrap\" bgcolor=\"$THEME->body\">";
         }
 
         echo "<table width=\"100%\">";
         foreach ($answer as $user) {
-            echo "<tr><td width=\"10\" nowrap>";
+            echo "<tr><td width=\"10\" nowrap=\"nowrap\">";
             print_user_picture($user->id, $course->id, $user->picture);
-            echo "</td><td width=\"100%\" nowrap>";
+            echo "</td><td width=\"100%\" nowrap=\"nowrap\">";
             echo "<p>".fullname($user, true)."</p>";
             echo "</td></tr>";
         }
+        echo "<tr><td colspan=\"2\">&nbsp;</td></tr>"; /// need to have at least one row within table tags
         echo "</table>";
 
         echo "</td>";
index 86f35ee9b178008dfe2239bf0b71a91d57311500..65523fbdaa135845c45f06c557672886bdcbe676 100644 (file)
     if ( (!$current or $choice->allowupdate) and ($choice->timeclose >= time() or $choice->timeclose == 0) ) { 
     // They haven't made their choice yet or updates allowed and choice is open
     
-        echo "<center><p><form name=\"form\" method=\"post\" action=\"view.php\">";
-        echo "<table cellpadding=\"20\" cellspacing=\"20\"><tr>";
+        echo "<form name=\"form\" method=\"post\" action=\"view.php\">";
+        echo "<table cellpadding=\"20\" cellspacing=\"20\" align=\"center\"><tr>";
 
         foreach ($choice->answer as $key => $answer) {
             if ($answer) {
                 echo "<td align=\"center\">";
-                echo "<input type=\"radio\" name=\"answer\" value=\"$key\" ".$answerchecked[$key]." />";
+                echo "<input type=\"radio\" name=\"answer\" value=\"$key\" ".$answerchecked[$key]." alt=\"$answer\" />";
                 p($answer);
                 echo "</td>";
             }
         }
     
         echo "</tr></table>";
+        echo "<center>";
         echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />";
         if (isstudent($course->id) or isteacher($course->id, 0, false)) {
             echo "<input type=\"submit\" value=\"".get_string("savemychoice","choice")."\" />";
         } else {
             print_string('havetologin', 'choice');
         }
-        echo "</p></form></center>";
+        echo "</center>";
+        echo "</form>";
 
     }
 
         
             foreach ($useranswer as $key => $answer) {
                 if ($key) {
-                    echo "<td width=\"$tablewidth%\" valign=\"top\" nowrap bgcolor=\"$THEME->cellcontent\">";
+                    echo "<td width=\"$tablewidth%\" valign=\"top\" nowrap=\"nowrap\" bgcolor=\"$THEME->cellcontent\">";
                 } else if ($choice->showunanswered) {
-                    echo "<td width=\"$tablewidth%\" valign=\"top\" nowrap bgcolor=\"$THEME->body\">";
+                    echo "<td width=\"$tablewidth%\" valign=\"top\" nowrap=\"nowrap\" bgcolor=\"$THEME->body\">";
                 } else {
                     continue;
                 }
     
                 echo "<table width=\"100%\">";
                 foreach ($answer as $user) {
-                    echo "<tr><td width=\"10\" nowrap>";
+                    echo "<tr><td width=\"10\" nowrap=\"nowrap\">";
                     print_user_picture($user->id, $course->id, $user->picture);
-                    echo "</td><td width=\"100%\" nowrap>";
+                    echo "</td><td width=\"100%\" nowrap=\"nowrap\">";
                     echo "<p>".fullname($user, $isteacher)."</p>";
                     echo "</td></tr>";
                 }