Note: You are currently viewing documentation for Moodle 3.1. Up-to-date documentation for the latest stable version of Moodle is probably available here: Grades min max.

Grades min max

From MoodleDocs
Revision as of 21:20, 7 June 2015 by Helen Foster (talk | contribs) (copying description from MDL-48618 as starting point)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.


Summary

If a grade item of has its max points changed after someone receives a grade, then the resulting computed grade becomes very different from previous version of Moodle. Steps to reproduce

You can recreate the problem in 2.8 without the upgrade step. You will need a course with two users, A and B.

  1. Go into your gradebook and create a new manual Grade Item, leave it at the default 100 points and change the display to 'Real (Percent)'
  2. Give User A a grade of '10' and save.
  3. You should see the user has a grade of '10 (10%)'.
  4. Edit the grade item and set the maximum points to 10.
  5. Go back to the gradebook and give User B a grade of 10 and save.
  6. You will now see that User A has a grade of '10 (10%)' while User B has a grade of '10 (100%)'
  7. If you did this under 2.7, both users would have '10 (100%)', but then when you upgrade the site to 2.8, the grades would change to how you see them in the above example.

Background/Cause

When a grade is entered for a user, it is recorded in the grade_grade table. We record various bits of data, include the then current maxgrade of the grade_item, but under rawgrademax. In versions of Moodle prior to 2.8, when making derivative computations off the grade, we would always fetch grade_item->maxgrade, which contains the now max grade for the grade_item, and use that as the number of available points.

After the gradebook changes, grade_grade->rawgrademax is now used for the computation, in large part to support the computation of grades for different users with different sets of hidden grades. This has lead to a number of side effects:

  • Percentages and any downstream computed grades (and number of points available) have changed for grade entries that have this problem.
  • Two users with the same number of points for an item can see different percentages.
  • Drop lowest/keep highest selections are wrong.
  • If you have the Range rows on in the gradebook, it will show the 'expanded' range. So in our above example it will show 0-100, even though 10 is the max points.
  • In the user report the user will see the expanded range.

How do users cause it

The most common thing we see is that teachers create a grade item for something, and forget to change the max points to what they want (usually 4 points). They then go and grade people. Then they see the mistake and change the max grade to be 4, with their intent (and the previous behavior being) that a user with a grade of 4 points has a 100%.