Línea 40... |
Línea 40... |
40 |
* @copyright 2009 The Open University
|
40 |
* @copyright 2009 The Open University
|
41 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
41 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
42 |
*/
|
42 |
*/
|
43 |
class missingbehaviour_test extends \advanced_testcase {
|
43 |
class missingbehaviour_test extends \advanced_testcase {
|
Línea 44... |
Línea 44... |
44 |
|
44 |
|
45 |
public function test_missing_cannot_start() {
|
45 |
public function test_missing_cannot_start(): void {
|
46 |
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
46 |
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
47 |
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
47 |
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
48 |
$this->expectException(\moodle_exception::class);
|
48 |
$this->expectException(\moodle_exception::class);
|
49 |
$behaviour->init_first_step(new question_attempt_step(array()), 1);
|
49 |
$behaviour->init_first_step(new question_attempt_step(array()), 1);
|
Línea 50... |
Línea 50... |
50 |
}
|
50 |
}
|
51 |
|
51 |
|
52 |
public function test_missing_cannot_process() {
|
52 |
public function test_missing_cannot_process(): void {
|
53 |
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
53 |
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
54 |
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
54 |
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
55 |
$this->expectException(\moodle_exception::class);
|
55 |
$this->expectException(\moodle_exception::class);
|
Línea 56... |
Línea 56... |
56 |
$behaviour->process_action(new question_attempt_pending_step(array()));
|
56 |
$behaviour->process_action(new question_attempt_pending_step(array()));
|
57 |
}
|
57 |
}
|
58 |
|
58 |
|
59 |
public function test_missing_cannot_get_min_fraction() {
|
59 |
public function test_missing_cannot_get_min_fraction(): void {
|
60 |
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
60 |
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
61 |
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
61 |
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
Línea 62... |
Línea 62... |
62 |
$this->expectException(\moodle_exception::class);
|
62 |
$this->expectException(\moodle_exception::class);
|
63 |
$behaviour->get_min_fraction();
|
63 |
$behaviour->get_min_fraction();
|
64 |
}
|
64 |
}
|
65 |
|
65 |
|
66 |
public function test_missing_cannot_get_max_fraction() {
|
66 |
public function test_missing_cannot_get_max_fraction(): void {
|
67 |
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
67 |
$qa = new question_attempt(\test_question_maker::make_question('truefalse', 'true'), 0);
|
Línea 68... |
Línea 68... |
68 |
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
68 |
$behaviour = new qbehaviour_missing($qa, 'deferredfeedback');
|
69 |
$this->expectException(\moodle_exception::class);
|
69 |
$this->expectException(\moodle_exception::class);
|
70 |
$behaviour->get_max_fraction();
|
70 |
$behaviour->get_max_fraction();
|
71 |
}
|
71 |
}
|
72 |
|
72 |
|
73 |
public function test_render_missing() {
|
73 |
public function test_render_missing(): void {
|