Permalink
Browse files

MDL-34567 accessibility compliance for lesson module: Add forform inp…

…ut text and select tag
  • Loading branch information...
1 parent 02814bf commit 077e06f6217ef371a4361ffb66eac171725f6aa4 @rwijaya rwijaya committed Jul 27, 2012
Showing with 7 additions and 3 deletions.
  1. +6 −3 mod/lesson/pagetypes/matching.php
  2. +1 −0 mod/lesson/report.php
@@ -400,16 +400,19 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
$answerdata->score = get_string("didnotreceivecredit", "lesson");
}
} elseif ($n > 1) {
- $data = "<select disabled=\"disabled\"><option selected=\"selected\">".strip_tags(format_string($answer->answer))."</option></select>";
+ $data = '<label class="accesshide" for="answer_' . $n . '">' . get_string('answer', 'lesson') . '</label>';
+ $data .= "<select id=\"answer_". $n ."\" disabled=\"disabled\"><option selected=\"selected\">".strip_tags(format_string($answer->answer))."</option></select>";
if ($useranswer != NULL) {
$userresponse = explode(",", $useranswer->useranswer);
- $data .= "<select disabled=\"disabled\"><option selected=\"selected\">";
+ $data .= '<label class="accesshide" for="stu_answer_response_' . $n . '">' . get_string('matchesanswer', 'lesson') . '</label>';
+ $data .= "<select id=\"stu_answer_response_" . $n . "\" disabled=\"disabled\"><option selected=\"selected\">";
if (array_key_exists($i, $userresponse)) {
$data .= strip_tags(format_string($answers[$userresponse[$i]]->response));
}
$data .= "</option></select>";
} else {
- $data .= "<select disabled=\"disabled\"><option selected=\"selected\">".strip_tags(format_string($answer->response))."</option></select>";
+ $data .= '<label class="accesshide" for="answer_response_' . $n . '">' . get_string('matchesanswer', 'lesson') . '</label>';
+ $data .= "<select id=\"answer_response_" . $n . "\" disabled=\"disabled\"><option selected=\"selected\">".strip_tags(format_string($answer->response))."</option></select>";
}
if ($n == 2) {
@@ -314,6 +314,7 @@
if (has_capability('mod/lesson:edit', $context)) {
$checklinks = '<a href="javascript: checkall();">'.get_string('selectall').'</a> / ';
$checklinks .= '<a href="javascript: checknone();">'.get_string('deselectall').'</a>';
+ $checklinks .= html_writer::label('action', 'menuaction', false, array('class' => 'accesshide'));
$checklinks .= html_writer::select(array('delete' => get_string('deleteselected')), 'action', 0, array(''=>'choosedots'), array('id'=>'actionid'));
$PAGE->requires->js_init_call('M.util.init_select_autosubmit', array('theform', 'actionid', ''));
echo $OUTPUT->box($checklinks, 'center');

0 comments on commit 077e06f

Please sign in to comment.