Skip to content

Commit

Permalink
Merge branch 'MDL-29771' of git://github.com/timhunt/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jun 1, 2015
2 parents df0a584 + 3af05ae commit f0fa70d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 19 deletions.
8 changes: 2 additions & 6 deletions question/behaviour/interactive/behaviour.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,8 @@ public function get_state_string($showcorrectness) {
return parent::get_state_string($showcorrectness);
}

if ($this->is_try_again_state()) {
return get_string('notcomplete', 'qbehaviour_interactive');
} else {
return get_string('triesremaining', 'qbehaviour_interactive',
$this->qa->get_last_behaviour_var('_triesleft'));
}
return get_string('triesremaining', 'qbehaviour_interactive',
$this->qa->get_last_behaviour_var('_triesleft'));
}

public function init_first_step(question_attempt_step $step, $variant) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$string['notcomplete'] = 'Not complete';
$string['pluginname'] = 'Interactive with multiple tries';
$string['triesremaining'] = 'Tries remaining: {$a}';
$string['tryagain'] = 'Try again';
12 changes: 4 additions & 8 deletions question/behaviour/interactive/tests/walkthrough_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ public function test_interactive_feedback_multichoice_right() {
$this->get_contains_submit_button_expectation(false),
$this->get_contains_try_again_button_expectation(true),
$this->get_does_not_contain_correctness_expectation(),
new question_pattern_expectation('/' .
preg_quote(get_string('notcomplete', 'qbehaviour_interactive'), '/') . '/'),
new question_pattern_expectation('/Tries remaining: 2/'),
$this->get_contains_hint_expectation('This is the first hint'));

// Check that, if we review in this state, the try again button is disabled.
Expand Down Expand Up @@ -223,8 +222,7 @@ public function test_interactive_finish_when_try_again_showing() {
$this->get_contains_submit_button_expectation(false),
$this->get_contains_try_again_button_expectation(true),
$this->get_does_not_contain_correctness_expectation(),
new question_pattern_expectation('/' .
preg_quote(get_string('notcomplete', 'qbehaviour_interactive'), '/') . '/'),
new question_pattern_expectation('/Tries remaining: 1/'),
$this->get_contains_hint_expectation('This is the first hint'));

// Finish the attempt.
Expand Down Expand Up @@ -288,8 +286,7 @@ public function test_interactive_shortanswer_try_to_submit_blank() {
$this->get_contains_submit_button_expectation(false),
$this->get_does_not_contain_validation_error_expectation(),
$this->get_contains_try_again_button_expectation(true),
new question_pattern_expectation('/' .
preg_quote(get_string('notcomplete', 'qbehaviour_interactive'), '/') . '/'),
new question_pattern_expectation('/Tries remaining: 2/'),
$this->get_contains_hint_expectation('This is the first hint'));
$this->assertEquals('newt',
$this->quba->get_response_summary($this->slot));
Expand Down Expand Up @@ -386,8 +383,7 @@ public function test_interactive_feedback_multichoice_multiple_reset() {
$this->get_contains_submit_button_expectation(false),
$this->get_contains_try_again_button_expectation(true),
$this->get_does_not_contain_correctness_expectation(),
new question_pattern_expectation('/' .
preg_quote(get_string('notcomplete', 'qbehaviour_interactive'), '/') . '/'),
new question_pattern_expectation('/Tries remaining: 2/'),
$this->get_contains_hint_expectation('This is the first hint'),
$this->get_contains_num_parts_correct(1),
$this->get_contains_standard_incorrect_combined_feedback_expectation(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ public function test_interactive_feedback_match_reset() {
$this->get_contains_submit_button_expectation(false),
$this->get_contains_try_again_button_expectation(true),
$this->get_does_not_contain_correctness_expectation(),
new question_pattern_expectation('/' .
preg_quote(get_string('notcomplete', 'qbehaviour_interactive'), '/') . '/'),
new question_pattern_expectation('/Tries remaining: 2/'),
$this->get_contains_hint_expectation('This is the first hint'),
$this->get_contains_num_parts_correct(2),
$this->get_contains_standard_partiallycorrect_combined_feedback_expectation(),
Expand Down
3 changes: 1 addition & 2 deletions question/type/multianswer/tests/walkthrough_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,7 @@ public function test_interactivecountback_feedback() {
$this->get_contains_submit_button_expectation(false),
$this->get_contains_try_again_button_expectation(true),
$this->get_does_not_contain_correctness_expectation(),
new question_pattern_expectation('/' .
preg_quote(get_string('notcomplete', 'qbehaviour_interactive'), '/') . '/'),
new question_pattern_expectation('/Tries remaining: 2/'),
$this->get_contains_hint_expectation('This is the first hint.'));

// Check that extract responses will return the reset data.
Expand Down

0 comments on commit f0fa70d

Please sign in to comment.