From: toyomoyo Date: Tue, 28 Nov 2006 08:53:13 +0000 (+0000) Subject: fix for MDL-7494, add information to help screen readers deal with cloze questions X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=73ca1421cf730dd95f4ace5264684c09b31f437b;p=moodle.git fix for MDL-7494, add information to help screen readers deal with cloze questions --- diff --git a/lang/en_utf8/qtype_multichoice.php b/lang/en_utf8/qtype_multichoice.php index 938f5b38d7..ab23104a5e 100644 --- a/lang/en_utf8/qtype_multichoice.php +++ b/lang/en_utf8/qtype_multichoice.php @@ -7,6 +7,7 @@ $string['answersingleno'] = 'Multiple answers allowed'; $string['answersingleyes'] = 'One answer only'; $string['choiceno'] = 'Choice $a'; $string['choices'] = 'Available choices'; +$string['clozeaid'] = 'Enter missing word'; $string['editingmultichoice'] = 'Editing a Multiple Choice question'; $string['feedback'] = 'Feedback'; $string['fillouttwochoices'] = 'You must fill out at least two choices. Choices left blank will not be used.'; diff --git a/question/type/multianswer/questiontype.php b/question/type/multianswer/questiontype.php index 8eb07552fa..e3e546ce1f 100644 --- a/question/type/multianswer/questiontype.php +++ b/question/type/multianswer/questiontype.php @@ -189,6 +189,7 @@ class embedded_cloze_qtype extends default_questiontype { } function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) { + global $QTYPES, $CFG, $USER; $readonly = empty($options->readonly) ? '' : 'readonly="readonly"'; $disabled = empty($options->readonly) ? '' : 'disabled="disabled"'; @@ -196,12 +197,18 @@ class embedded_cloze_qtype extends default_questiontype { $formatoptions->noclean = true; $formatoptions->para = false; $nameprefix = $question->name_prefix; - + + // adding an icon with alt to warn user this is a fill in the gap question + // MDL-7497 + if ($USER->screenreader) { + echo "wwwroot/question/type/$question->qtype/icon.gif\" ". + "height=\"16\" width=\"16\" alt=\"".get_string('clozeaid','qtype_multichoice')."\" /> "; + } // For this question type, we better print the image on top: if ($image = get_question_image($question, $cmoptions->course)) { echo('
'); } - + $qtextremaining = format_text($question->questiontext, $question->questiontextformat, $formatoptions, $cmoptions->course); @@ -213,6 +220,7 @@ class embedded_cloze_qtype extends default_questiontype { while (ereg('\{#([^[:space:]}]*)}', $qtextremaining, $regs)) { $qtextsplits = explode($regs[0], $qtextremaining, 2); + echo ""; // MDL-7497 } // Print the final piece of question text: