Skip to content

Commit

Permalink
MDL-47494 gapselect: Blank menus should say 'Choose ...'.
Browse files Browse the repository at this point in the history
Also fix unit tests and import.
  • Loading branch information
timhunt committed Dec 6, 2011
1 parent afc0993 commit 5283ee0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion question/type/gapselect/questiontype.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public function import_from_xml($data, $question, $format, $extra=null) {
}

$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;
}
Expand Down
30 changes: 15 additions & 15 deletions question/type/gapselect/simpletest/testwalkthrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public function test_interactive_behaviour() {
$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',
array('' => ' ', '1' => 'fox', '2' => 'dog'), null, true),
array('' => get_string('choosedots'), '1' => 'fox', '2' => 'dog'), null, true),
$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),
Expand All @@ -72,11 +72,11 @@ public function test_interactive_behaviour() {
$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',
array('' => ' ', '1' => 'fox', '2' => 'dog'), 2, true),
array('' => get_string('choosedots'), '1' => 'fox', '2' => 'dog'), 2, true),
$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(),
Expand All @@ -91,11 +91,11 @@ public function test_interactive_behaviour() {
$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',
array('' => ' ', '1' => 'fox', '2' => 'dog'), 2, false),
array('' => get_string('choosedots'), '1' => 'fox', '2' => 'dog'), 2, false),
$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(),
Expand All @@ -111,11 +111,11 @@ public function test_interactive_behaviour() {
$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',
array('' => ' ', '1' => 'fox', '2' => 'dog'), 2, true),
array('' => get_string('choosedots'), '1' => 'fox', '2' => 'dog'), 2, true),
$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(),
Expand All @@ -130,11 +130,11 @@ public function test_interactive_behaviour() {
$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',
array('' => ' ', '1' => 'fox', '2' => 'dog'), 1, false),
array('' => get_string('choosedots'), '1' => 'fox', '2' => 'dog'), 1, false),
$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());
Expand Down

0 comments on commit 5283ee0

Please sign in to comment.