MDL-47494 gapselect: Blank menus should say 'Choose ...'.
authorTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 6 Dec 2011 14:52:58 +0000 (14:52 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 6 Dec 2011 14:52:58 +0000 (14:52 +0000)
Also fix unit tests and import.

question/type/gapselect/questiontype.php
question/type/gapselect/simpletest/testwalkthrough.php

index 589a393..c3712e0 100644 (file)
@@ -94,7 +94,8 @@ class qtype_gapselect extends qtype_gapselect_base {
         }
 
         $format->import_combined_feedback($question, $data, true);
         }
 
         $format->import_combined_feedback($question, $data, true);
-        $format->import_hints($question, $data, true);
+        $format->import_hints($question, $data, true, false,
+                $format->get_format($question->questiontextformat));
 
         return $question;
     }
 
         return $question;
     }
index 42fd19b..c5d4a20 100644 (file)
@@ -54,11 +54,11 @@ class qtype_gapselect_walkthrough_test extends qbehaviour_walkthrough_test_base
         $this->check_current_mark(null);
         $this->check_current_output(
                 $this->get_contains_select_expectation('p1',
         $this->check_current_mark(null);
         $this->check_current_output(
                 $this->get_contains_select_expectation('p1',
-                                array('' => ' ', '1' => 'quick', '2' => 'slow'), null, true),
+                                array('' => get_string('choosedots'), '1' => 'quick', '2' => 'slow'), null, true),
                 $this->get_contains_select_expectation('p2',
                 $this->get_contains_select_expectation('p2',
-                                array('' => ' ', '1' => 'fox', '2' => 'dog'), null, true),
+                                array('' => get_string('choosedots'), '1' => 'fox', '2' => 'dog'), null, true),
                 $this->get_contains_select_expectation('p3',
                 $this->get_contains_select_expectation('p3',
-                                array('' => ' ', '1' => 'lazy', '2' => 'assiduous'), null, true),
+                                array('' => get_string('choosedots'), '1' => 'lazy', '2' => 'assiduous'), null, true),
                 $this->get_contains_submit_button_expectation(true),
                 $this->get_does_not_contain_feedback_expectation(),
                 $this->get_tries_remaining_expectation(3),
                 $this->get_contains_submit_button_expectation(true),
                 $this->get_does_not_contain_feedback_expectation(),
                 $this->get_tries_remaining_expectation(3),
@@ -72,11 +72,11 @@ class qtype_gapselect_walkthrough_test extends qbehaviour_walkthrough_test_base
         $this->check_current_mark(null);
         $this->check_current_output(
                 $this->get_contains_select_expectation('p1',
         $this->check_current_mark(null);
         $this->check_current_output(
                 $this->get_contains_select_expectation('p1',
-                                array('' => ' ', '1' => 'quick', '2' => 'slow'), 2, true),
+                                array('' => get_string('choosedots'), '1' => 'quick', '2' => 'slow'), 2, true),
                 $this->get_contains_select_expectation('p2',
                 $this->get_contains_select_expectation('p2',
-                                array('' => ' ', '1' => 'fox', '2' => 'dog'), 2, true),
+                                array('' => get_string('choosedots'), '1' => 'fox', '2' => 'dog'), 2, true),
                 $this->get_contains_select_expectation('p3',
                 $this->get_contains_select_expectation('p3',
-                                array('' => ' ', '1' => 'lazy', '2' => 'assiduous'), 2, true),
+                                array('' => get_string('choosedots'), '1' => 'lazy', '2' => 'assiduous'), 2, true),
                 $this->get_contains_submit_button_expectation(true),
                 $this->get_does_not_contain_correctness_expectation(),
                 $this->get_does_not_contain_feedback_expectation(),
                 $this->get_contains_submit_button_expectation(true),
                 $this->get_does_not_contain_correctness_expectation(),
                 $this->get_does_not_contain_feedback_expectation(),
@@ -91,11 +91,11 @@ class qtype_gapselect_walkthrough_test extends qbehaviour_walkthrough_test_base
         $this->check_current_mark(null);
         $this->check_current_output(
                 $this->get_contains_select_expectation('p1',
         $this->check_current_mark(null);
         $this->check_current_output(
                 $this->get_contains_select_expectation('p1',
-                                array('' => ' ', '1' => 'quick', '2' => 'slow'), 2, false),
+                                array('' => get_string('choosedots'), '1' => 'quick', '2' => 'slow'), 2, false),
                 $this->get_contains_select_expectation('p2',
                 $this->get_contains_select_expectation('p2',
-                                array('' => ' ', '1' => 'fox', '2' => 'dog'), 2, false),
+                                array('' => get_string('choosedots'), '1' => 'fox', '2' => 'dog'), 2, false),
                 $this->get_contains_select_expectation('p3',
                 $this->get_contains_select_expectation('p3',
-                                array('' => ' ', '1' => 'lazy', '2' => 'assiduous'), 2, false),
+                                array('' => get_string('choosedots'), '1' => 'lazy', '2' => 'assiduous'), 2, false),
                         $this->get_contains_submit_button_expectation(false),
                 $this->get_contains_try_again_button_expectation(true),
                 $this->get_does_not_contain_correctness_expectation(),
                         $this->get_contains_submit_button_expectation(false),
                 $this->get_contains_try_again_button_expectation(true),
                 $this->get_does_not_contain_correctness_expectation(),
@@ -111,11 +111,11 @@ class qtype_gapselect_walkthrough_test extends qbehaviour_walkthrough_test_base
         $this->check_current_mark(null);
         $this->check_current_output(
                 $this->get_contains_select_expectation('p1',
         $this->check_current_mark(null);
         $this->check_current_output(
                 $this->get_contains_select_expectation('p1',
-                                array('' => ' ', '1' => 'quick', '2' => 'slow'), 2, true),
+                                array('' => get_string('choosedots'), '1' => 'quick', '2' => 'slow'), 2, true),
                 $this->get_contains_select_expectation('p2',
                 $this->get_contains_select_expectation('p2',
-                                array('' => ' ', '1' => 'fox', '2' => 'dog'), 2, true),
+                                array('' => get_string('choosedots'), '1' => 'fox', '2' => 'dog'), 2, true),
                 $this->get_contains_select_expectation('p3',
                 $this->get_contains_select_expectation('p3',
-                                array('' => ' ', '1' => 'lazy', '2' => 'assiduous'), 2, true),
+                                array('' => get_string('choosedots'), '1' => 'lazy', '2' => 'assiduous'), 2, true),
                 $this->get_contains_submit_button_expectation(true),
                 $this->get_does_not_contain_correctness_expectation(),
                 $this->get_does_not_contain_feedback_expectation(),
                 $this->get_contains_submit_button_expectation(true),
                 $this->get_does_not_contain_correctness_expectation(),
                 $this->get_does_not_contain_feedback_expectation(),
@@ -130,11 +130,11 @@ class qtype_gapselect_walkthrough_test extends qbehaviour_walkthrough_test_base
         $this->check_current_mark(2);
         $this->check_current_output(
                 $this->get_contains_select_expectation('p1',
         $this->check_current_mark(2);
         $this->check_current_output(
                 $this->get_contains_select_expectation('p1',
-                                array('' => ' ', '1' => 'quick', '2' => 'slow'), 1, false),
+                                array('' => get_string('choosedots'), '1' => 'quick', '2' => 'slow'), 1, false),
                 $this->get_contains_select_expectation('p2',
                 $this->get_contains_select_expectation('p2',
-                                array('' => ' ', '1' => 'fox', '2' => 'dog'), 1, false),
+                                array('' => get_string('choosedots'), '1' => 'fox', '2' => 'dog'), 1, false),
                 $this->get_contains_select_expectation('p3',
                 $this->get_contains_select_expectation('p3',
-                                array('' => ' ', '1' => 'lazy', '2' => 'assiduous'), 1, false),
+                                array('' => get_string('choosedots'), '1' => 'lazy', '2' => 'assiduous'), 1, false),
                 $this->get_contains_submit_button_expectation(false),
                 $this->get_contains_correct_expectation(),
                 $this->get_no_hint_visible_expectation());
                 $this->get_contains_submit_button_expectation(false),
                 $this->get_contains_correct_expectation(),
                 $this->get_no_hint_visible_expectation());