Skip to content

Commit

Permalink
Changes for XHTML and accessibility compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Nov 11, 2004
1 parent 44e7949 commit 7c6c30e
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 170 deletions.
6 changes: 3 additions & 3 deletions mod/quiz/attempt.php
Expand Up @@ -82,7 +82,7 @@
print_heading($quiz->name);
print_heading(get_string("attempt", "quiz", $attemptnumber));
if (trim(strip_tags($quiz->intro))) {
print_simple_box(format_text($quiz->intro), "CENTER");
print_simple_box(format_text($quiz->intro), "center");
}
echo "<br />\n";

Expand All @@ -92,7 +92,7 @@
echo "<div align=\"center\">\n";
print_string("requirepasswordmessage", "quiz");
echo "<br /><br />\n";
echo " <input name=\"quizpassword\" type=\"password\" value=\"\" />";
echo " <input name=\"quizpassword\" type=\"password\" value=\"\" alt=\"password\" />";
echo " <input type=\"submit\" value=\"".get_string("ok")."\" />\n";
echo "</div>\n";

Expand Down Expand Up @@ -247,7 +247,7 @@

print_heading(get_string("attempt", "quiz", $attemptnumber));
if (trim(strip_tags($quiz->intro))) {
print_simple_box(format_text($quiz->intro), "CENTER");
print_simple_box(format_text($quiz->intro), "center");
}


Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/category.php
Expand Up @@ -146,7 +146,7 @@

/// Print the table of all categories
$table->head = array ($strcategory, $strcategoryinfo, $strpublish, $strquestions, $straction);
$table->align = array ("LEFT", "LEFT", "CENTER", "CENTER", "CENTER");
$table->align = array ("left", "left", "center", "center", "center");
$table->size = array ("80", "80", "40", "40", "50");
$table->width = 200;
$table->nowrap = true;
Expand Down
11 changes: 6 additions & 5 deletions mod/quiz/lib.php
Expand Up @@ -208,14 +208,15 @@ function print_question_number_and_grading_details

/// Print question number and grade:

echo '<p align="center"><b>' . $number . '</b></p>';
echo '<center><b>' . $number . '</b></center>';
if (false !== $grade) {
$strmarks = get_string("marks", "quiz");
echo '<p align="center"><font size="1">';
//echo '<p align="center"><font size="1">';
echo '<br /><center><font size="1">';
if (false !== $actualgrade) {
echo "$strmarks: $actualgrade/$grade</font></p>";
echo "$strmarks: $actualgrade/$grade</font></center>";
} else {
echo "$grade $strmarks</font></p>";
echo "$grade $strmarks</font></center>";
}
}
print_spacer(1,100);
Expand Down Expand Up @@ -1172,7 +1173,7 @@ function quiz_category_select_menu($courseid,$published=false,$only_editable=fal
$cname = quiz_get_category_coursename( $category );
$seltxt = "";
if ($cid==$selected) {
$seltxt = "selected=\"true\"";
$seltxt = "selected=\"selected\"";
}
if ((!$only_editable) || isteacheredit($category->course)) {
echo " <option value=\"$cid\" $seltxt>$cname</option>\n";
Expand Down
36 changes: 18 additions & 18 deletions mod/quiz/mod.html
Expand Up @@ -63,15 +63,15 @@
<center>
<table cellpadding="5">
<tr valign="top">
<td align="right"><p><b><?php print_string("name") ?>:</b></p></td>
<td align="right"><b><?php print_string("name") ?>:</b></td>
<td>
<input type="text" name="name" size="40" value="<?php p($form->name) ?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("introduction", "quiz") ?>:</b></p>
<td align="right"><b><?php print_string("introduction", "quiz") ?>:</b>
<br />
<font size="1">
<span class="editorhelptext">
<?php
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
Expand All @@ -83,7 +83,7 @@
}
?>
<br />
</font>
</span>
</td>
<td>
<?php
Expand All @@ -92,7 +92,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("quizopen", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("quizopen", "quiz") ?>:</b></td>
<td>
<?php
if (!$form->timeopen and $course->format == "weeks") {
Expand All @@ -105,7 +105,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("quizclose", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("quizclose", "quiz") ?>:</b></td>
<td>
<?php
if (!$form->timeclose and $course->format == "weeks") {
Expand All @@ -119,7 +119,7 @@
</tr>
<!-- BEGIN EDIT -->
<tr valign="top">
<td align="right"><p><b><?php print_string("timelimit", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("timelimit", "quiz") ?>:</b></td>
<td>
<?php
print_timer_selector($form->timelimit, get_string("minutes","quiz"));
Expand All @@ -129,7 +129,7 @@
</tr>
<!-- END EDIT -->
<tr valign="top">
<td align="right"><p><b><?php print_string("shufflequestions", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("shufflequestions", "quiz") ?>:</b></td>
<td>
<?php
$options = array();
Expand All @@ -141,7 +141,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("shuffleanswers", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("shuffleanswers", "quiz") ?>:</b></td>
<td>
<?php
$options = array();
Expand All @@ -153,7 +153,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("attemptsallowed", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("attemptsallowed", "quiz") ?>:</b></td>
<td>
<?php
$options = array();
Expand All @@ -168,7 +168,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("eachattemptbuildsonthelast", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("eachattemptbuildsonthelast", "quiz") ?>:</b></td>
<td>
<?php
$options = array();
Expand All @@ -183,7 +183,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("grademethod", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("grademethod", "quiz") ?>:</b></td>
<td>
<?php
$options = array();
Expand All @@ -197,7 +197,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("showfeedback", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("showfeedback", "quiz") ?>:</b></td>
<td>
<?php
$options = array();
Expand All @@ -209,7 +209,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("showcorrectanswer", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("showcorrectanswer", "quiz") ?>:</b></td>
<td>
<?php
$options = array();
Expand All @@ -221,7 +221,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("allowreview", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("allowreview", "quiz") ?>:</b></td>
<td>
<?php
$options = array();
Expand All @@ -233,7 +233,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("maximumgrade") ?>:</b></p></td>
<td align="right"><b><?php print_string("maximumgrade") ?>:</b></td>
<td>
<?php
for ($i=100; $i>=1; $i--) {
Expand All @@ -247,14 +247,14 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("requirepassword", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("requirepassword", "quiz") ?>:</b></td>
<td>
<input type="text" name="password" size="40" value="<?php p($form->password) ?>" />
<?php helpbutton("requirepassword", get_string("requirepassword", "quiz"), "quiz"); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("requiresubnet", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("requiresubnet", "quiz") ?>:</b></td>
<td>
<input type="text" name="subnet" size="40" value="<?php p($form->subnet) ?>" />
<?php helpbutton("requiresubnet", get_string("requiresubnet", "quiz"), "quiz"); ?>
Expand Down
61 changes: 32 additions & 29 deletions mod/quiz/questiontypes/calculated/calculated.html
Expand Up @@ -4,32 +4,32 @@
<?php foreach ($calculatedmessages as $message) {formerr("$message<br/>");} ?>
<table cellpadding="5">
<tr valign="top">
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("category", "quiz") ?>:</b></td>
<td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("questionname", "quiz") ?>:</b></td>
<td>
<input type="text" name="name" size="50" value="<?php p($question->name) ?>" />
<input type="text" name="name" size="50" value="<?php p($question->name) ?>" alt="<?php print_string("questionname", "quiz") ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
<td align="right"><b><?php print_string("question", "quiz") ?>:</b>
<br />
<br />
<br />
<p><font size="1">
<span class="editorhelptext">
<?php
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
helpbutton("text", get_string("helptext"), "moodle", true, true);
}
?>
</font></p>
</span>
</td>
<td>
<?php if (isset($err["questiontext"])) {
Expand All @@ -42,7 +42,7 @@
if ($usehtmleditor) { /// Trying this out for a while
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
} else {
echo "<div align=\"right\">";
echo '<div align="right">';
print_string("formattexttype");
echo ":&nbsp;";
if (!isset($question->questiontextformat)) {
Expand All @@ -56,7 +56,7 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("imagedisplay", "quiz") ?>:</b></td>
<td>
<?php if (empty($images)) {
print_string("noimagesyet");
Expand All @@ -68,27 +68,27 @@
</tr>

<tr valign="top">
<td align="right"><p><b><?php print_string("correctanswerformula", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("correctanswerformula", "quiz") ?>:</b></td>
<td>
<input align="LEFT" type="text" id="formula0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>" />&nbsp;&nbsp;
<input align="left" type="text" id="formula0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>" alt="<?php print_string("correctanswerformula", "quiz") ?>" />&nbsp;&nbsp;
<input type="hidden" name="fraction[]" value="1.0" />
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("tolerance", "quiz"); ?>:</b></p></td>
<td align="right"><b><?php print_string("tolerance", "quiz"); ?>:</b></td>
<td>
<input align="LEFT" type="text" id="tolerance0" name="tolerance[]" size="15" value="<?php p($answers[0]->tolerance) ?>" />&plusmn;
<input align="left" type="text" id="tolerance0" name="tolerance[]" size="15" value="<?php p($answers[0]->tolerance) ?>" alt="<?php print_string("tolerance", "quiz"); ?>" />&plusmn;
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("tolerancetype", "quiz"); ?>:</b></p></td>
<td align="right"><b><?php print_string("tolerancetype", "quiz"); ?>:</b></td>
<td>
<?php choose_from_menu($qtypeobj->tolerance_types(),
'tolerancetype[]', $answers[0]->tolerancetype, false); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("correctanswerlength", "quiz"); ?>:</b></p></td>
<td align="right"><b><?php print_string("correctanswerlength", "quiz"); ?>:</b></td>
<td>
<?php choose_from_menu(array('1' => '1', '2' => '2', '3' => '3',
'4' => '4', '5' => '5', '6' => '6',
Expand All @@ -99,23 +99,24 @@
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("feedback", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("feedback", "quiz") ?>:</b></td>
<td>
<textarea name="feedback[]" rows="2" cols="50" wrap="virtual"><?php p($answers[0]->feedback) ?></textarea>
<textarea name="feedback[]" rows="2" cols="50"><?php p($answers[0]->feedback) ?></textarea>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("unit", "quiz") ?>:</b></p></td>
<td align="right"><b><?php print_string("unit", "quiz") ?>:</b></td>
<td>
<p><input type="HIDDEN" name="multiplier[]" value="1.0" />
<input align="LEFT" type="text" id="defaultunit" name="unit[]"
size="5" value="<?php p($units[0]->unit) ?>" />
<b>(<?php print_string("optional", "quiz") ?>)</b></p>
<input type="hidden" name="multiplier[]" value="1.0" />
<input align="left" type="text" id="defaultunit" name="unit[]"
size="5" value="<?php p($units[0]->unit) ?>"
alt="<?php print_string("unit", "quiz") ?>" />
<b>(<?php print_string("optional", "quiz") ?>)</b>
</td>
</tr>
<tr valign="top">
<td></td>
<td align="left"><p><b><?php print_string("alternativeunits", "quiz") ?>:</b></p></td>
<td align="left"><b><?php print_string("alternativeunits", "quiz") ?>:</b></td>
<td></td>
</tr>
<?php
Expand All @@ -125,14 +126,16 @@
<tr valign="top">
<td></td>
<td align="left">
<p><b><?php print_string("multiplier", "quiz") ?>:</b>
<b><?php print_string("multiplier", "quiz") ?>:</b>
<input type="text" id="<?php p("multiplier$i") ?>" size="10"
align="RIGHT" name="multiplier[]"
value="<?php p($unit->multiplier) ?>" />
align="right" name="multiplier[]"
value="<?php p($unit->multiplier) ?>"
alt="<?php print_string("multiplier", "quiz") ?>" />
<b>&nbsp;&nbsp;&nbsp;<?php print_string("unit", "quiz") ?>:</b>
<input align="LEFT" type="text" id="<?php p("unit$i") ?>"
<input align="left" type="text" id="<?php p("unit$i") ?>"
name="unit[]"
size="5" value="<?php p($unit->unit) ?>" /></p>
size="5" value="<?php p($unit->unit) ?>"
alt="<?php print_string("unit", "quiz") ?>" />
</td>
</tr>
<?php
Expand All @@ -142,10 +145,10 @@

<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<input type="submit" onClick="return determineMinAndMax();" value="<?php print_string("savechanges") ?>" />
<input type="submit" onclick="return determineMinAndMax();" value="<?php print_string("savechanges") ?>" />
</center>
</form>
<script language="javascript">
<script language="javascript" type="text/javascript">
function determineMinAndMax() {
// This client-side script will determine the values for min and max
// based on the input for answer and acceptederror.
Expand Down

0 comments on commit 7c6c30e

Please sign in to comment.