mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-82695' of https://github.com/andrewhancox/moodle
This commit is contained in:
commit
c1f92c7170
@ -365,6 +365,9 @@ class qtype_multianswer_question extends question_graded_automatically_with_coun
|
||||
|
||||
$fractionsum += $subq->defaultmark * max(0, $subfraction - $lastchange * $this->penalty);
|
||||
}
|
||||
if (empty($fractionsum)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $fractionsum / $fractionmax;
|
||||
}
|
||||
|
@ -367,6 +367,8 @@ class question_test extends \advanced_testcase {
|
||||
|
||||
$this->assertEquals(1, $question->get_max_fraction());
|
||||
$this->assertEquals(0, $question->get_min_fraction());
|
||||
$this->assertNull($question->compute_final_grade([['sub1_answer' => 'Something']], 1));
|
||||
$this->assertNull($question->grade_response([['sub1_answer' => 'Something']])[0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user