Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…ut text and select tag
  • Loading branch information...
commit 68ca508f0ccf74d87b9ba617e7e5113be4024f35 1 parent 470d47f
@rwijaya rwijaya authored
Showing with 7 additions and 3 deletions.
  1. +6 −3 mod/lesson/pagetypes/matching.php
  2. +1 −0  mod/lesson/report.php
View
9 mod/lesson/pagetypes/matching.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) {
View
1  mod/lesson/report.php
@@ -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');
Please sign in to comment.
Something went wrong with that request. Please try again.