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) {
$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.
$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.
$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));
$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(),
$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(),
$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.