Moodle

Quiz calculating incorrectly when decimal item marks used.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.4
  • Fix Version/s: 1.9.6
  • Component/s: Quiz
  • Labels:
    None
  • Environment:
    All
  • Database:
    Any
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

Seen similar bugs listed in the tracker but none quite nail it, so please excuse (and merge) if I have missed the point and duplicated.

Having issues where Moodle will accept decimal values for items in a quiz, but then rounds them down AFTER students have attempted.

To replicate:

1. Create quiz with two (or more/less) questions,
2. In the quiz edit screen, make the item values for each question 1.5 as per the attached image - note that Moodle doesn't stop me doing this,
3. Open the quiz,
4. Student gets both questions right,
5. Student is shown 2/3 as their final mark because Moodle has rounded down the marks to 1 and added them together, without rounding down the total.

If I mess around re-setting the item marks and doing a regrade then it does correct itself, but really there should either be a trap to stop me entering decimals (note that I can also add decimal values as the default grade in the individual question, which is also permitted and subsequently rounded down), or it should just allow decimals and be done with it. Either one would be good, but the point at the moment is that it lets the user enter data with no errors until after (as happened with an irate customer this morning) the students have completed the quiz and found out that they have gotten less than they deserved.

Activity

Hide
Tim Hunt added a comment -

Ouch! that is a nasty bug.

In Moodle 2.0 decimal grades are fully supported.

It is not feasible to make that change in Moodle 1.9. I suppose the best we can do there is to round everything consistently.

Thank you for finding the bug and describing it so clearly.

Show
Tim Hunt added a comment - Ouch! that is a nasty bug. In Moodle 2.0 decimal grades are fully supported. It is not feasible to make that change in Moodle 1.9. I suppose the best we can do there is to round everything consistently. Thank you for finding the bug and describing it so clearly.
Hide
Tim Hunt added a comment -

Fixed. Thanks for your help.

Show
Tim Hunt added a comment - Fixed. Thanks for your help.
Hide
Sam Hemelryk added a comment -

Confirmed that rounding now occurs nicely, Thanks Tim

Show
Sam Hemelryk added a comment - Confirmed that rounding now occurs nicely, Thanks Tim

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: