Wierdness with rounding quiz grades

Wierdness with rounding quiz grades

by Tim Hunt -
Number of replies: 1
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Three of the people testing the quiz here have got confused by one aspect of how the quiz works. So I thought I would explain the situation here and see what you all thought.

At the moment, individual attempt scores are stored in the database exactly, and only rounded when displayed to the student. However, when the quiz computes the student's final grade, it rounds it to the number of decimal points points specified in the quiz setting before the grade is stored in the database. Therefore the rounded grade is passed to the gradebook. In the words of one of the testers:
I actually scored 4.25 out of 7.
In the quiz definition form I have set 'Decimal digits in grades' to 0.
So the overall score is shown as '4 out of 7' 61%. 4.25/7 is 61%. So far, so
good.

But the value that is sent to the Gradebook is 57%. 4/7 is 57%.

I don't think that this is right. I think it should send 61% and that 'Decimal
digits in grades' should just give control over appearance, and have no effect
on the underlying calculation.
(The 61% figure appears on the attempt review page:
Grade 5 out of a maximum of 7 (61%))

I am inclined to agree with Phil, but I wondered what everyone else thought. I suppose the other option is to change the review page to show the percentage computing using the rounded grade.

(Interestingly, the code rounds the final grade again whenever it is read from the database, so it would be very easy to change it to store unrounded grades in the quiz_grades table.)
Average of ratings: -
In reply to Tim Hunt

Re: Wierdness with rounding quiz grades

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Also, it does not update the values in the database if a students have attempted the quiz, and then you change the quiz decimal points setting.