Manual grading converts whole number to the one with decimals

Manual grading converts whole number to the one with decimals

by Elena Ivanova -
Number of replies: 9

Hi, smile
I cannot find anything related for this. Can you pelase let me know what can be the reason for this/what I am missing?

Scenario steps: 

  •  Add quiz that is worth 7 points (max grade)
  •  Add just one question to it, also worth 7 points.
  • Set quiz settings to show as much decimal points as possible in  "Decimal places in grades" and "Decimal places in question grades" to help to see the issue right away.

Try to give student 5 points manually by overriding answer grade (Make comment or override points).
See that the interface shows 4.999999 instead. 
Why? There is no rounding happening anywhere.

Total for the quiz still seems to calculate/display correctly as 5.

Tested for Essay and T/F questions. 

Tested on 2.8, 2.9, and 3.0 


Those screenshots are made at Moodle demo site: 

grade


max grade settings

Thank you!


Average of ratings: -
In reply to Elena Ivanova

Re: Manual grading converts whole number to the one with decimals

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

What is going on is that internally, question grades are stored out of 1.0. Then they later get multiplied by the number of marks that the questions is worth, 7.0 in this case. The reason we do this is in case you want to change 7 later.

Now, 5/7 does not have an exact representation in binary. Hence: 5 divide by 7, round to 7 decimal places, multiple by 7, at appears from your example, is 4.9999999

However, I am not yet convinced that is a real problem. We intentionally store question grades to 7 decimals, and then the final quiz grade to 5 decimals, to ensure that rounding makes this sort of problem go away. Just don't display all the possible decimals.

Do you have a real reason why you want grades with that much accuracy shown?

In reply to Tim Hunt

Re: Manual grading converts whole number to the one with decimals

by Elena Ivanova -

Thank you, Tim.

All decimals are always shown to the instructor on their manual grading interface, regardless of the quiz settings.
I started to test, and switching the quiz settings made things more obvious to pin point.

So, if one will set the quiz to 0 decimals and do the same:

 - Click "Make comment or override mark", enter 5, save. Pop-up will close. Click "Make comment or override mark" again to review. See 4.999999 there.
 - If there are essays, go to Manual Grading. Click Grade All. Enter 5 or 3, or 6. Save.
See 4.999999, 2.9999998, 6.0000003 instead.


example


In reply to Elena Ivanova

Re: Manual grading converts whole number to the one with decimals

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I see the problem now. Thank you for explaining.

I think the reason we display un-rounded grades there is so that people can put in exactly 1/3 as 0.3333333. If we later re-displayed that as 0.33, and then that page with that rounded grade was saved, then it would change the value in the database.

One suggestion is MDL-13922: use a drop-down menu instead of a text input. However, if we did that, it is not clearn what choices should be offered for a question graded out of 7.

So, I am not sure what we should do about this. I need to ponder it.

In reply to Tim Hunt

Re: Manual grading converts whole number to the one with decimals

by Dave Laurie -

Hi Tim,

I've had a user report this same issue and I was wondering where you had gotten to in your pondering? 

If there is a tracker item somewhere I should be following toward a fix let me know. Otherwise I'm feeling this is just something I should add to our known issues list...

Cheers,
Dave

In reply to Dave Laurie

Re: Manual grading converts whole number to the one with decimals

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I don't think there has been any progress on this.

In reply to Tim Hunt

Re: Manual grading converts whole number to the one with decimals

by Velson Horie -

Moodle 3.0

I did a foolish thing. I used the back arrow  when wanting to change a mark on a student's answer in a quiz.  I only use ordinal numbers for my marking, and never average to fractional marks.

Now the marks for all the students in this quiz question have been changed to say 1.0000002 or 4.9999998.  No matter what I do - remark the questions, or update grades, or close down and reopen Moodle - I am not able to change the marks back to ordinal numbers.  If I try to save and move to the next page, Moodle is unable to do this. It reloads the Grading Question page for that question number, with all the remembered decimal marks. 

It appears that these decimal marks have confused Moodle and it is stuck in a rabbit hole.

So I cannot move on and I am stuck.

In reply to Velson Horie

Re: Manual grading converts whole number to the one with decimals

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

1.  A back arrow is not going to cause this.

2.  What version of Moodle are you using?

3.  Have you looked at your gradebook settings?

4.  What aggregation method are you using?

5.  Have you tried clearing caches?

In reply to Emma Richardson

Re: Manual grading converts whole number to the one with decimals

by Velson Horie -

Thank you for the advice

I am using Moodle 3.0

The course grade settings are largely set at default. The "Range decimal points" is set to 0.

the "Aggregation position" is set to default, Last.

I have cleared the cache, and restarted the computer.

But the decimal marks are still there.

More importantly when I click "Save and go to next page", it reloads the same quiz page with the same marks.  All 7 of the attempts have a number in the appropriate box, some ordinal and some decimal.  If I change a mark on an attempt from 4.0000002 (out of 6) to 4, then click "Save and go to next page", the page reloads and the mark reverts to 4.0000002.

It appears that Moodle is expecting a further input from me.

PS in a recent upgrade of Moodle, the error trapping response to "Save and go to next page" changed. Previously, only the attempt with an incorrect or incomplete mark was returned. Now all attempts (good and bad) are returned, so it can be difficult  to discover the error.  This seems to be the case here. Perhaps one or more of these mark entries is wrong, and I have no way of identifying which one.

This does not seem to be catastrophic as I can close the Moodle page on my computer and restart, carefully avoiding this question.  When I look in grade report, the question grades are listed correctly (as ordinal numbers), and the quiz is correctly totaled.


In reply to Tim Hunt

Re: Manual grading converts whole number to the one with decimals

by Joshua Ebarvia -

Hi all,

I have lodged MDL-60139 for this. I have a patch for this and I have submitted it and waiting for peer review.

Regards,