XHTML and accessibility compliance

This commit is contained in:
moodler 2004-10-22 07:45:58 +00:00
parent 4bab5275b2
commit d526e68ee7
4 changed files with 34 additions and 31 deletions

View file

@ -38,13 +38,13 @@
if ($course->format == "weeks") { if ($course->format == "weeks") {
$table->head = array (get_string("week"), get_string("question"), get_string("answer")); $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") { } else if ($course->format == "topics") {
$table->head = array (get_string("topic"), get_string("question"), get_string("answer")); $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 { } else {
$table->head = array (get_string("question"), get_string("answer")); $table->head = array (get_string("question"), get_string("answer"));
$table->align = array ("LEFT", "LEFT"); $table->align = array ("left", "left");
} }
$currentsection = ""; $currentsection = "";

View file

@ -54,14 +54,14 @@
<table cellpadding="5"> <table cellpadding="5">
<tr valign="top"> <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> <td>
<input type="text" name="name" size="30" value="<?php p($form->name) ?>" /> <input type="text" name="name" size="30" value="<?php p($form->name) ?>" />
</td> </td>
</tr> </tr>
<tr valign="top"> <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"> <font size="1">
<?php <?php
helpbutton("writing", get_string("helpwriting"), "moodle", true, true); helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
@ -99,7 +99,7 @@
</tr> </tr>
<tr valign="top"> <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> <td>
<input type="text" name="answer1" size="60" value="<?php p($form->answer1) ?>" /> <input type="text" name="answer1" size="60" value="<?php p($form->answer1) ?>" />
<?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?> <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
@ -107,7 +107,7 @@
</tr> </tr>
<tr valign="top"> <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> <td>
<input type="text" name="answer2" size="60" value="<?php p($form->answer2) ?>" /> <input type="text" name="answer2" size="60" value="<?php p($form->answer2) ?>" />
<?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?> <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
@ -115,28 +115,28 @@
</tr> </tr>
<tr valign="top"> <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> <td>
<input type="text" name="answer3" size="60" value="<?php p($form->answer3) ?>" /> <input type="text" name="answer3" size="60" value="<?php p($form->answer3) ?>" />
<?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?> <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
</td> </td>
</tr> </tr>
<tr valign="top"> <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> <td>
<input type="text" name="answer4" size="60" value="<?php p($form->answer4) ?>" /> <input type="text" name="answer4" size="60" value="<?php p($form->answer4) ?>" />
<?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?> <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
</td> </td>
</tr> </tr>
<tr valign="top"> <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> <td>
<input type="text" name="answer5" size="60" value="<?php p($form->answer5) ?>" /> <input type="text" name="answer5" size="60" value="<?php p($form->answer5) ?>" />
<?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?> <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
</td> </td>
</tr> </tr>
<tr valign="top"> <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> <td>
<input type="text" name="answer6" size="60" value="<?php p($form->answer6) ?>" /> <input type="text" name="answer6" size="60" value="<?php p($form->answer6) ?>" />
<?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?> <?php helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
@ -144,7 +144,7 @@
</tr> </tr>
<tr valign="top"> <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> <td>
<script type="text/javascript"> <script type="text/javascript">
var timeitems = ['openday','openmonth','openyear','openhour', 'openminute', 'closeday','closemonth','closeyear','closehour','closeminute']; var timeitems = ['openday','openmonth','openyear','openhour', 'openminute', 'closeday','closemonth','closeyear','closehour','closeminute'];
@ -157,12 +157,12 @@
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
<td><p>&nbsp;</p></td> <td>&nbsp;</td>
<td> <td>
<table> <table>
<tr> <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> <td>
<?php <?php
@ -181,7 +181,7 @@
</td> </td>
</tr> </tr>
<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> <td>
<?php <?php
@ -214,7 +214,7 @@
</tr> </tr>
<tr valign="top"> <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> <td>
<?php <?php
require_once("$CFG->dirroot/mod/choice/lib.php"); require_once("$CFG->dirroot/mod/choice/lib.php");
@ -225,7 +225,7 @@
</tr> </tr>
<tr valign="top"> <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> <td>
<?php <?php
require_once("$CFG->dirroot/mod/choice/lib.php"); require_once("$CFG->dirroot/mod/choice/lib.php");
@ -237,7 +237,7 @@
<tr valign="top"> <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> <td>
<?php <?php
$options[0] = get_string("no"); $options[0] = get_string("no");
@ -250,7 +250,7 @@
<tr valign="top"> <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> <td>
<?php <?php
$options[0] = get_string("no"); $options[0] = get_string("no");

View file

@ -97,19 +97,20 @@
foreach ($useranswer as $key => $answer) { foreach ($useranswer as $key => $answer) {
if ($key) { if ($key) {
echo "<td width=\"$tablewidth%\" valign=\"top\" nowrap bgcolor=\"$THEME->cellcontent\">"; echo "<td width=\"$tablewidth%\" valign=\"top\" nowrap=\"nowrap\" bgcolor=\"$THEME->cellcontent\">";
} else { } 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%\">"; echo "<table width=\"100%\">";
foreach ($answer as $user) { 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); 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 "<p>".fullname($user, true)."</p>";
echo "</td></tr>"; echo "</td></tr>";
} }
echo "<tr><td colspan=\"2\">&nbsp;</td></tr>"; /// need to have at least one row within table tags
echo "</table>"; echo "</table>";
echo "</td>"; echo "</td>";

View file

@ -99,26 +99,28 @@
if ( (!$current or $choice->allowupdate) and ($choice->timeclose >= time() or $choice->timeclose == 0) ) { 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 // 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 "<form name=\"form\" method=\"post\" action=\"view.php\">";
echo "<table cellpadding=\"20\" cellspacing=\"20\"><tr>"; echo "<table cellpadding=\"20\" cellspacing=\"20\" align=\"center\"><tr>";
foreach ($choice->answer as $key => $answer) { foreach ($choice->answer as $key => $answer) {
if ($answer) { if ($answer) {
echo "<td align=\"center\">"; 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); p($answer);
echo "</td>"; echo "</td>";
} }
} }
echo "</tr></table>"; echo "</tr></table>";
echo "<center>";
echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />"; echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />";
if (isstudent($course->id) or isteacher($course->id, 0, false)) { if (isstudent($course->id) or isteacher($course->id, 0, false)) {
echo "<input type=\"submit\" value=\"".get_string("savemychoice","choice")."\" />"; echo "<input type=\"submit\" value=\"".get_string("savemychoice","choice")."\" />";
} else { } else {
print_string('havetologin', 'choice'); print_string('havetologin', 'choice');
} }
echo "</p></form></center>"; echo "</center>";
echo "</form>";
} }
@ -196,18 +198,18 @@
foreach ($useranswer as $key => $answer) { foreach ($useranswer as $key => $answer) {
if ($key) { 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) { } 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 { } else {
continue; continue;
} }
echo "<table width=\"100%\">"; echo "<table width=\"100%\">";
foreach ($answer as $user) { 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); 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 "<p>".fullname($user, $isteacher)."</p>";
echo "</td></tr>"; echo "</td></tr>";
} }