MDL-47494 gapselect: Review and fix the format parameter to all calls to format_text.
authorTim Hunt <T.J.Hunt@open.ac.uk>
Thu, 24 Feb 2011 20:18:16 +0000 (20:18 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Thu, 24 Feb 2011 20:18:16 +0000 (20:18 +0000)
question/type/gapselect/questionbase.php
question/type/gapselect/questiontypebase.php
question/type/gapselect/rendererbase.php

index 13c5d48..dee663b 100755 (executable)
@@ -97,12 +97,12 @@ abstract class qtype_gapselect_question_base extends question_graded_automatical
     }
 
     public function get_question_summary() {
-        $question = $this->html_to_text($this->questiontext);
+        $question = $this->html_to_text($this->questiontext, $this->questiontextformat);
         $groups = array();
         foreach ($this->choices as $group => $choices) {
             $cs = array();
             foreach ($choices as $choice) {
-                $cs[] = $this->html_to_text($choice->text);
+                $cs[] = html_to_text($choice->text, 0, false);
             }
             $groups[] = '[[' . $group . ']] -> {' . implode(' / ', $cs) . '}';
         }
@@ -120,8 +120,8 @@ abstract class qtype_gapselect_question_base extends question_graded_automatical
         foreach ($this->places as $place => $group) {
             if (array_key_exists($this->field($place), $response) &&
                     $response[$this->field($place)]) {
-                $choices[] = '{' . $this->html_to_text($this->get_selected_choice(
-                        $group, $response[$this->field($place)])->text) . '}';
+                $choices[] = '{' . html_to_text($this->get_selected_choice(
+                        $group, $response[$this->field($place)])->text, 0, false) . '}';
                 $allblank = false;
             } else {
                 $choices[] = '{}';
@@ -286,7 +286,7 @@ abstract class qtype_gapselect_question_base extends question_graded_automatical
             $choiceno = $this->choiceorder[$group][$response[$fieldname]];
             $choice = $this->choices[$group][$choiceno];
             $parts[$place] = new question_classified_response(
-                    $choiceno, $this->html_to_text($choice->text),
+                    $choiceno, html_to_text($choice->text, 0, false),
                     $this->get_right_choice_for($place) == $response[$fieldname]);
         }
         return $parts;
index 067c592..65662dc 100755 (executable)
@@ -297,7 +297,7 @@ abstract class qtype_gapselect_base extends question_type {
 
             foreach ($question->choices[$group] as $i => $choice) {
                 $choices[$i] = new question_possible_response(
-                        $question->html_to_text($choice->text),
+                        html_to_text($choice->text, 0, false),
                         $question->rightchoices[$place] == $i);
             }
             $choices[null] = question_possible_response::no_response();
index 7a8913f..c26c5e1 100755 (executable)
@@ -51,7 +51,7 @@ abstract class qtype_elements_embedded_in_question_text_renderer extends qtype_w
 
         $result = '';
         $result .= html_writer::tag('div', $question->format_text($questiontext,
-                $qa, 'question', 'questiontext', $question->id),
+                $question->questiontextformat, $qa, 'question', 'questiontext', $question->id),
                 array('class' => $this->qtext_classname(), 'id' => $qa->get_qt_field_name('')));
 
         $result .= $this->post_qtext_elements($qa, $options);