| Línea 35... |
Línea 35... |
| 35 |
* @copyright 2009 The Open University
|
35 |
* @copyright 2009 The Open University
|
| 36 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
36 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 37 |
*/
|
37 |
*/
|
| 38 |
class walkthrough_test extends \qbehaviour_walkthrough_test_base {
|
38 |
class walkthrough_test extends \qbehaviour_walkthrough_test_base {
|
| Línea 39... |
Línea 39... |
| 39 |
|
39 |
|
| Línea 40... |
Línea 40... |
| 40 |
public function test_interactive_feedback_multichoice_right() {
|
40 |
public function test_interactive_feedback_multichoice_right(): void {
|
| 41 |
|
41 |
|
| 42 |
// Create a multichoice single question.
|
42 |
// Create a multichoice single question.
|
| 43 |
$mc = \test_question_maker::make_a_multichoice_single_question();
|
43 |
$mc = \test_question_maker::make_a_multichoice_single_question();
|
| Línea 175... |
Línea 175... |
| 175 |
|
175 |
|
| 176 |
$autogradedstep = $this->get_step($this->get_step_count() - 2);
|
176 |
$autogradedstep = $this->get_step($this->get_step_count() - 2);
|
| 177 |
$this->assertEqualsWithDelta($autogradedstep->get_fraction(), 0.6666667, 0.0000001);
|
177 |
$this->assertEqualsWithDelta($autogradedstep->get_fraction(), 0.6666667, 0.0000001);
|
| Línea 178... |
Línea 178... |
| 178 |
}
|
178 |
}
|
| Línea 179... |
Línea 179... |
| 179 |
|
179 |
|
| 180 |
public function test_interactive_finish_when_try_again_showing() {
|
180 |
public function test_interactive_finish_when_try_again_showing(): void {
|
| 181 |
|
181 |
|
| 182 |
// Create a multichoice single question.
|
182 |
// Create a multichoice single question.
|
| Línea 236... |
Línea 236... |
| 236 |
$this->get_contains_mc_radio_expectation(($wrongindex + 1) % 3, false, false),
|
236 |
$this->get_contains_mc_radio_expectation(($wrongindex + 1) % 3, false, false),
|
| 237 |
$this->get_contains_incorrect_expectation(),
|
237 |
$this->get_contains_incorrect_expectation(),
|
| 238 |
$this->get_no_hint_visible_expectation());
|
238 |
$this->get_no_hint_visible_expectation());
|
| 239 |
}
|
239 |
}
|
| Línea 240... |
Línea 240... |
| 240 |
|
240 |
|
| Línea 241... |
Línea 241... |
| 241 |
public function test_interactive_shortanswer_try_to_submit_blank() {
|
241 |
public function test_interactive_shortanswer_try_to_submit_blank(): void {
|
| 242 |
|
242 |
|
| 243 |
// Create a short answer question.
|
243 |
// Create a short answer question.
|
| 244 |
$sa = \test_question_maker::make_question('shortanswer');
|
244 |
$sa = \test_question_maker::make_question('shortanswer');
|
| Línea 331... |
Línea 331... |
| 331 |
$this->get_no_hint_visible_expectation());
|
331 |
$this->get_no_hint_visible_expectation());
|
| 332 |
$this->assertEquals('frog',
|
332 |
$this->assertEquals('frog',
|
| 333 |
$this->quba->get_response_summary($this->slot));
|
333 |
$this->quba->get_response_summary($this->slot));
|
| 334 |
}
|
334 |
}
|
| Línea 335... |
Línea 335... |
| 335 |
|
335 |
|
| Línea 336... |
Línea 336... |
| 336 |
public function test_interactive_feedback_multichoice_multiple_reset() {
|
336 |
public function test_interactive_feedback_multichoice_multiple_reset(): void {
|
| 337 |
|
337 |
|
| 338 |
// Create a multichoice multiple question.
|
338 |
// Create a multichoice multiple question.
|
| 339 |
$mc = \test_question_maker::make_a_multichoice_multi_question();
|
339 |
$mc = \test_question_maker::make_a_multichoice_multi_question();
|
| Línea 412... |
Línea 412... |
| 412 |
$this->get_does_not_contain_feedback_expectation(),
|
412 |
$this->get_does_not_contain_feedback_expectation(),
|
| 413 |
$this->get_tries_remaining_expectation(2),
|
413 |
$this->get_tries_remaining_expectation(2),
|
| 414 |
$this->get_no_hint_visible_expectation());
|
414 |
$this->get_no_hint_visible_expectation());
|
| 415 |
}
|
415 |
}
|
| Línea 416... |
Línea 416... |
| 416 |
|
416 |
|
| 417 |
public function test_interactive_regrade_changing_num_tries_leaving_open() {
|
417 |
public function test_interactive_regrade_changing_num_tries_leaving_open(): void {
|
| 418 |
// Create a multichoice multiple question.
|
418 |
// Create a multichoice multiple question.
|
| 419 |
$q = \test_question_maker::make_question('shortanswer');
|
419 |
$q = \test_question_maker::make_question('shortanswer');
|
| 420 |
$q->hints = array(
|
420 |
$q->hints = array(
|
| 421 |
new question_hint_with_parts(0, 'This is the first hint.', FORMAT_HTML, true, true),
|
421 |
new question_hint_with_parts(0, 'This is the first hint.', FORMAT_HTML, true, true),
|
| Línea 445... |
Línea 445... |
| 445 |
// Verify.
|
445 |
// Verify.
|
| 446 |
$this->check_current_state(question_state::$todo);
|
446 |
$this->check_current_state(question_state::$todo);
|
| 447 |
$this->check_current_mark(null);
|
447 |
$this->check_current_mark(null);
|
| 448 |
}
|
448 |
}
|
| Línea 449... |
Línea 449... |
| 449 |
|
449 |
|
| 450 |
public function test_interactive_regrade_changing_num_tries_finished() {
|
450 |
public function test_interactive_regrade_changing_num_tries_finished(): void {
|
| 451 |
// Create a multichoice multiple question.
|
451 |
// Create a multichoice multiple question.
|
| 452 |
$q = \test_question_maker::make_question('shortanswer');
|
452 |
$q = \test_question_maker::make_question('shortanswer');
|
| 453 |
$q->hints = array(
|
453 |
$q->hints = array(
|
| 454 |
new question_hint_with_parts(0, 'This is the first hint.', FORMAT_HTML, true, true),
|
454 |
new question_hint_with_parts(0, 'This is the first hint.', FORMAT_HTML, true, true),
|
| Línea 481... |
Línea 481... |
| 481 |
// you get attempting a question like this without regrading being involved,
|
481 |
// you get attempting a question like this without regrading being involved,
|
| 482 |
// and I am currently interested in testing regrading here.
|
482 |
// and I am currently interested in testing regrading here.
|
| 483 |
$this->check_current_mark(1);
|
483 |
$this->check_current_mark(1);
|
| 484 |
}
|
484 |
}
|
| Línea 485... |
Línea 485... |
| 485 |
|
485 |
|
| 486 |
public function test_review_of_interactive_questions_before_finished() {
|
486 |
public function test_review_of_interactive_questions_before_finished(): void {
|
| 487 |
// Create a multichoice multiple question.
|
487 |
// Create a multichoice multiple question.
|
| 488 |
$q = \test_question_maker::make_question('shortanswer');
|
488 |
$q = \test_question_maker::make_question('shortanswer');
|
| 489 |
$q->hints = array(
|
489 |
$q->hints = array(
|
| 490 |
new question_hint_with_parts(0, 'This is the first hint.', FORMAT_HTML, true, true),
|
490 |
new question_hint_with_parts(0, 'This is the first hint.', FORMAT_HTML, true, true),
|