]> git.mjollnir.org Git - moodle.git/commitdiff
fix for MDL-7494, add information to help screen readers deal with cloze questions
authortoyomoyo <toyomoyo>
Tue, 28 Nov 2006 08:53:13 +0000 (08:53 +0000)
committertoyomoyo <toyomoyo>
Tue, 28 Nov 2006 08:53:13 +0000 (08:53 +0000)
lang/en_utf8/qtype_multichoice.php
question/type/multianswer/questiontype.php

index 938f5b38d774cdf5486371494c539dbbb46f4ffa..ab23104a5e3ee03c1e7d83a0f4586b77737207fb 100644 (file)
@@ -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.';
index 8eb07552fa7c60428d13277878e38a832602f72f..e3e546ce1fe5ff8067ef18a49a7b2732b3a96d19 100644 (file)
@@ -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 "<img src=\"$CFG->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('<img class="qimage" src="' . $image . '" alt="" /><br />');
         }
-
+        
         $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 "<label>"; // MDL-7497
             echo $qtextsplits[0];
             $qtextremaining = $qtextsplits[1];
 
@@ -315,6 +323,7 @@ class embedded_cloze_qtype extends default_questiontype {
                           question part $positionkey.");
                    break;
            }
+           echo "</label>"; // MDL-7497
         }
 
         // Print the final piece of question text: