MDL-47637 core_grades: Outcomes must not be weighted when non aggregated

This commit is contained in:
Frederic Massart 2014-10-15 15:49:55 +08:00
parent 7a61e645c3
commit 6aeebc259a
3 changed files with 16 additions and 5 deletions

View file

@ -1436,6 +1436,9 @@ class grade_category extends grade_object {
if ($gradeitem->gradetype == GRADE_TYPE_NONE || $gradeitem->gradetype == GRADE_TYPE_TEXT) {
// Text items and none items do not have a weight.
continue;
} else if (!$this->aggregateoutcomes && $gradeitem->is_outcome_item()) {
// We will not aggregate outcome items, so we can ignore them.
continue;
}
// Record the ID and the weight for this grade item.
@ -1506,6 +1509,9 @@ class grade_category extends grade_object {
// Text items and none items do not have a weight, no need to set their weight to
// zero as they must never be used during aggregation.
continue;
} else if (!$this->aggregateoutcomes && $gradeitem->is_outcome_item()) {
// We will not aggregate outcome items, so we can ignore updating their weights.
continue;
}
if (!$gradeitem->weightoverride) {