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
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.


Description

Natural weighting is a modification to how grades are combined.

When 'Sum of Grades' aggregation is chosen (and natural weighting is active), there will be a weight column with form fields, looking exactly like "Weighted mean" is now. By default, the weight column shows the natural weights given to all categories and items based on gradebook structure (exactly as Simple weighted mean does now).

Weights can be overridden by modifying the values in the form fields. All the numbers in a category will be automatically normalised (on save) to add up to 100%.

A "Reset weights" button in each category resets the weights to their defaults.

Rationale

This interface is expected to suit the needs of most teachers, and will allow them to avoid using other aggregations. Admins can therefore hide the aggregation menu and simplify the interface. If it turns out that this is enough for everyone then we can potentially remove quite a lot of aggregation code from the gradebook at a later stage, improving speed and readability.

(Bob, we need a description here of how each of the old aggregations can be implemented, or not, in this new interface:).

  • Sum of grades -
  • Mean of grades -
  • Weighted mean of grades -
  • Simple weighted mean of grades -
  • Mean of grades (with extra credits) -
  • Median of grades - can't be done
  • Lowest grade - can't be done
  • Highest grade - can't be done
  • Mode of grades - can't be done

Implementation stages

To be safe, we plan to implement this in stages:

STAGE 1) Implement natural weighting as part of the Sum of Grades aggregation type, with admin settings that allow them to disable all other aggregations if they choose. (Moodle 2.8)

STAGE 2) Once people have been using this for a while, explore the possibility of removing other aggregation code or making them into optional plugins. (Moodle 3.0 perhaps)


Interfaces

Category editing

(We need a full mockup here)

Admin settings

New setting to "Force Natural Weighting" - this will hide the aggregation menu and all new categories will default to "Sum of grades" and natural weights. It will not affect existing gradebooks with other aggregations set, so we probably need some sort of upgrade script that can detect, display and optionally convert any other aggregations to this one as required.

Upgrade changes

None

Database changes

None?

Logic changes

  1. Sum of Grades aggregation must be fixed to respect hidden items setting and to Exclude non-graded items (new terminology)
  1. Natural weights must be saved and applied to the form.
  1. Results are stored directly into grade_grades table.


See also