Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Natural weighting

From MoodleDocs
Revision as of 07:30, 11 July 2014 by Martin Dougiamas (talk | contribs) (Dougiamas moved page Natural weights to Natural weighting without leaving a redirect)
Natural Weighting
Project state Specification
Tracker issue https://tracker.moodle.org/browse/MDL-43378
Discussion https://moodle.org/mod/forum/discuss.php?d=245442
Assignee Moodle HQ

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.


  1. Sum of Grades aggregation fixed to respect hidden items setting and Exclude non-graded items (new terminology)
  2. Natural Weighting setting controlling aggregation and weight override behavior. (for 2.9 this could invert to make Optional Natural Weighting the default, and in 3.0, deprecate aggregation methods completely)
    1. Default: Disable Natural Weighting - legacy Cats and items behavior.
    2. Optional Natural Weighting - natural weights invoked if course has all categories set to Sum of grades
    3. Forced Natural Weighting - all categories forced to Sum of grades (aggregations dropdown disappears).
  3. Screen display for Natural Weighting (not available when Natural Weighting disabled)
    1. Weight column shows the natural weights accorded to all categories and items based on gradebook setup (same as Simple weighted mean)
    2. ‘Adjust weights’ button allows natural weights to be overridden (same as Weighted mean)
    3. ‘Reset weights’ button resets all adjusted weights to natural weights
    4. Aggregation method pulldown not available in Disabled Natural Weighting
  4. Special processing
    1. Special branching of code when using Natural Weighting saves execution of over 650 lines of code (much repeatedly executed). This code path is called 35 times from inside Moodle
  5. Will be storing the values generated from Natural Weighting into the grade_grades table
  6. Additional benefits
    1. Orients teachers to understanding gradebook math, recognizing natural weights, and the implication of the maximum points per item and its relation to other items in the same container. They begin to actually understand what’s going on in the calculations and can form a coherent strategy for how they want to implement grading in their courses
    2. Fully a third of the gradebook code could be removed, greatly simplifying the codebase
    3. Numerous issues mentioned in the gradebook forum would be resolved.

This would handle all but the utter-most edge cases