Resolution: Won't Fix
Affects Version/s: 1.9.13
Fix Version/s: None
When a multi choice question is created with 3 correct answers worth 33.333 each and the user gets all 3 correct, the value stored in mdl_question_states raw_grade and grade should be 1 instead of 0.9999 as this creates inconsistencies when using the data later on (for example the course completion block).
It is displayed correctly when viewing the 'Summary of your previous attempts' but only because it is rounded at the time of display.
Create a quiz with 1 multi choice question. Allow multiple answers.
Create 2 wrong answers.
Create 3 correct answers worth 33.333% each.
Complete the quiz correctly.
mdl_question_states raw_grade and grade show non-rounded values which I believe should be rounded. This also effects calculations of the overall quiz grade.
in grade_responses() in question/type/multichoice/questiontype.php just before the comment '// Make sure we don't assign negative or too high marks' (around line 368) do something along the lines of
if((int)$state->raw_grade == $state->raw_grade+0.00001)
$state->raw_grade = $state->raw_grade+0.00001;