-
Improvement
-
Resolution: Fixed
-
Minor
-
2.7
-
MOODLE_27_STABLE
-
MDL-46139-master -
-
40
-
BACKEND Sprint 17
- calculate up each container’s (category or course items) adjusted weight percentage and grademax associated with the items adjusted (need this for weighting, so could be done here or after the next step)
- calculate points (must be first, you cannot calculate weights until you have the finalgrade and grademax for categories). For each gtree->levels starting with highest (items) to lowest (course) for both finalgrade and grademax
- include hidden only if hidetotalsifcontainhiddenitems is set to GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN
- ignore ungraded items if aggregateonlygraded is set, does not apply when calculating total points for Setup (Categories and items) screen
- include extra credit items in finalgrade calculations only, not grademax
- ignore items that have been dropped from drop low or keep high
- accumulate all other finalgrades and grademaxes into parent category finalgrade and grademaxes
- calculate weights (must be done before calculating contributions). For each gtree->levels starting with highest (items) to lowest (course)
- weight is always percentage grade * weight... in this case PERCENTAGE:[item grademax / (container grademax - adjusted grademax for the container from step 1)] * WEIGHT:[(100 - adjusted weight for the container from step 1)]
- Adjust weights in a container to always equal 100
- calculate contributions (needed in order to accurately drop lowest, keep highest. Also needed to provide the most percentages). For each gtree->levels starting with highest (items) to lowest (course)
- contribution is always the item’s percentage * the item’s weight * the container’s weight… so (finalgrade / grademax) * item weight * container weight
- limit categories - drop lowest, keep highest (need to have contributions in order to accurately drop low and keep high)
- remove contribs
- remove finalgrades from parent finalgrade
- remove maxgrade from parent maxgrade