MDL-19407 Defaulting all grade items to non-extra-credit when moving to a SWM category, except if they originally come from a SWM category and were set as extra credit there. Merged from MOODLE_19_STABLE

This commit is contained in:
nicolasconnault
2009-09-17 07:16:51 +00:00
parent 438c2bfa68
commit bb55642327
+7
View File
@@ -1221,6 +1221,13 @@ class grade_item extends grade_object {
return false;
}
// MDL-19407 If moving from a non-SWM category to a SWM category, convert aggregationcoef to 0
$currentparent = $this->load_parent_category();
if ($currentparent->aggregation != GRADE_AGGREGATE_WEIGHTED_MEAN2 && $parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN2) {
$this->aggregationcoef = 0;
}
$this->force_regrading();
// set new parent