-
Bug
-
Resolution: Fixed
-
Major
-
2.8.9, 2.9.3, 3.0.1, 3.6, 3.8.3, 3.9
-
MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_36_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MOODLE_38_STABLE
-
MDL-52578-master -
MDL-50062 appears to have caused a regression: it's un-fixed MDL-45029 - new activities added to grade categories set to "Weighted mean of grades" once again default to a weight of 0 (at least in the case where the course aggregation method and chosen category aggregation method are both "weighted mean of grades").
The following block of code which was removed in MDL-50062 only applied when adding a new course module, so removing it doesn't seem relevant to the commit's stated objective of carrying the aggregation coefficient(s) between categories when possible:
- $gradecategory = $grade_item->get_parent_category();
|
- if (!empty($moduleinfo->add)) {
|
- if (grade_category::aggregation_uses_aggregationcoef($gradecategory->aggregation)) {
|
- $defaults = grade_category::get_default_aggregation_coefficient_values($gradecategory->aggregation);
|
- $grade_item->aggregationcoef = $defaults['aggregationcoefficient'];
|
- $grade_item->aggregationcoef2 = $default['aggregationcoefficient2'];
|
- $grade_item->update();
|
- }
|
- }
|
The other block removed from course/modlib.php by the same commit, which performed a similar task for outcome items, may or may not be needed (I haven't traced that yet); but as it only applied to new outcome items, it may still apply in some cases.
The removed code can't quite be simply added back in, as the array keys in the defaults have changed (and there's a typo which needs fixing - $default should be $defaults for coef2). Adding back the block quoted above with these tweaks appears to resolve the issue (though once again, I haven't tested with outcome items, so the second block of code may also need reinstating with tweaks).
- has a non-specific relationship to
-
MDL-51876 Weighted Grades: Default weight for new categories is 0 (zero) and not 1
- Reopened
- is a regression caused by
-
MDL-50062 grade items set as extra credit when category changed to natural from weighted mean
- Closed
- Testing discovered
-
MDL-68783 Outcomes used in course page's Add/Remove buttons not properly styled
- Closed