Línea 33... |
Línea 33... |
33 |
* @package qtype_multianswer
|
33 |
* @package qtype_multianswer
|
34 |
* @copyright 2011 The Open University
|
34 |
* @copyright 2011 The Open University
|
35 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
35 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
36 |
* @covers \qtype_multianswer_question
|
36 |
* @covers \qtype_multianswer_question
|
37 |
*/
|
37 |
*/
|
38 |
class question_test extends \advanced_testcase {
|
38 |
final class question_test extends \advanced_testcase {
|
39 |
public function test_get_expected_data(): void {
|
39 |
public function test_get_expected_data(): void {
|
40 |
$question = \test_question_maker::make_question('multianswer');
|
40 |
$question = \test_question_maker::make_question('multianswer');
|
41 |
$this->assertEquals(array('sub1_answer' => PARAM_RAW_TRIMMED,
|
41 |
$this->assertEquals(array('sub1_answer' => PARAM_RAW_TRIMMED,
|
42 |
'sub2_answer' => PARAM_RAW), $question->get_expected_data());
|
42 |
'sub2_answer' => PARAM_RAW), $question->get_expected_data());
|
43 |
}
|
43 |
}
|
Línea 365... |
Línea 365... |
365 |
$this->assertEquals([null, question_state::$gradedwrong], $question->grade_response(
|
365 |
$this->assertEquals([null, question_state::$gradedwrong], $question->grade_response(
|
366 |
['sub1_answer' => 'Input box']));
|
366 |
['sub1_answer' => 'Input box']));
|
Línea 367... |
Línea 367... |
367 |
|
367 |
|
368 |
$this->assertEquals(1, $question->get_max_fraction());
|
368 |
$this->assertEquals(1, $question->get_max_fraction());
|
- |
|
369 |
$this->assertEquals(0, $question->get_min_fraction());
|
- |
|
370 |
$this->assertNull($question->compute_final_grade([['sub1_answer' => 'Something']], 1));
|
369 |
$this->assertEquals(0, $question->get_min_fraction());
|
371 |
$this->assertNull($question->grade_response([['sub1_answer' => 'Something']])[0]);
|
Línea 370... |
Línea 372... |
370 |
}
|
372 |
}
|