Moodle core gradebook 1.95 or greater
Try out this scenario (my actual scenario in a production course site):
- course category set to SWM
- three subcategories (for organizational purposes) set to SWM
- gradebook set to aggregate non-empty grades only
- 1st category has four grade items marked (so far) representing 85 points.
2nd category has three items marked (so far) representing 50 points
3rd category has one item marked (so far) for 90 points.
The wrong total will be computed (real, percentage or letter) because...
If you leave the category totals at the default (probably 100) SWM takes the percentage correct for three categories valued at 100 and averages them, disregarding the "imputed weights" of 85, 50, and 90.
Potential Solutions?
- Sum of grades, except it doesn't exclude ungraded items, just takes the sum of grades and is therefore unusable for translating to accurate percentage or letter
- Change the category total to represent the actual total points of the grades marked so far, except you have to mark all your grades and change the total in one fell-swoop, probably making the gradebook unavailable to students in the mean time and you have to do all this each time you mark another grade. You'd also need to go through and exclude (and possibly later re-include) all those students who haven't turned in their grades yet.
- Alternatively to #2, you could use Weighted Mean of Grades agg method for the course category and assign weights to each subcategory that represent the proportioned weights of the marked items to-date. Like #2, all three weight proportions would slide every time a new grade is marked.
- Disallow the display of the course grade until all grades have been marked and implement #2 or #3 above to accurately weight the subcategories' contributions to the final grade. A disappointing workaround at best. Hope you have your version patched because most instances still hide the whole gradebook when the course total is hidden. Some will also claim that "Hide totals if they contain hidden items" might get us some leverage here, but it really won't (IMO).
- A calculation for the final total? Give this a try but don't waste too much time on it before you remove it from the list of candidates -- you'd be revising the calculation as often as #2 and #3 above.
Moodle's help documentaiton's explanation for SWM is:
"The difference from Weighted mean is that weight is calculated as Maximum grade - Minimum grade for each item. 100 point assignment has weight 100, 10 point assignment has weight 10.
A1 70/100, A2 20/80, A3 10/10, category max 100:"
As we have now found out, this of course does not actually hold true for nested SWM categories because we're locked into that category total that needs to move around.
A REAL SOLUTION:
The rawgrademax field in each grade_grades record for category or course itemtypes should be maintained as the "maximum earnable". This would be the total of grademax for child items marked so far if aggregate only non-empty grades is on, and the total grademax for ALL child items if aggregate only non-empty items is turned off. Consequently the finalgrade field in grade_grades would then represent the accurate number of points EARNED. With this valuable information available the grade reports can calculate accurate category and course totals under all circumstances.
I've put in a tracker item MDL-24554. Please vote, vote early and vote often (under assumed names).