Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-65182

Gradebook incorrectly calculates letter grade

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 3.4.8, 4.1.2
    • Gradebook

    Description

      There is a bug where a letter grade is not calculated correctly due to floating point division. (floating point division by reciprocal multiplication).

      Reproduction Steps:

      1. Create a course with a total of 331 points.
      2. Assign a student points totaling 297.9.
      3. Make sure the grade scales is set to A- for a 90% or above.
      4. The 'real' grade value shows 90%, however the letter grade is B+.
      5. It appears PHP is calculating this similar to Python.
        >>> 297.9/331
        0.8999999999999999
      6. This should be .90. 
        1. 297.9 / 331 equals exactly 90%.

      There are a number of tracker issues open related to rounding decisions. However, this case seems to be a legitimate bug related to floating point division rather than a choice of rounding vs. truncating calculated values.

      Docs which need updating if this patch is accepted: https://docs.moodle.org/402/en/Gradebook_calculation_changes

       

      Attachments

        Issue Links

          Activity

            People

              jrchamp Jonathan Champ
              mikehas mikehas
              Luca Bösch Luca Bösch
              Jake Dallimore Jake Dallimore
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 36 minutes
                  36m

                  Clockify

                    Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.