MDL-47676 core_grades: Negative positive weight combo working.

The combination of negative and positive weights was not normalising
properly.
This commit is contained in:
Adrian Greeve 2014-10-15 10:34:49 +08:00
parent 8950e7f535
commit cd5c7965e0

View File

@ -1478,7 +1478,9 @@ class grade_category extends grade_object {
if (!$gradeitemdetail['extracredit']) {
$normalisetotal += $gradeitemdetail['weight'];
}
if ($gradeitemdetail['weightoverride'] && !$gradeitemdetail['extracredit']) {
// The overridden total comprises of items that are set as overridden, that aren't extra credit and have a value
// greater than zero.
if ($gradeitemdetail['weightoverride'] && !$gradeitemdetail['extracredit'] && $gradeitemdetail['weight'] > 0) {
// Add overriden weights up to see if they are greater than 1.
$overriddentotal += $gradeitemdetail['weight'];
}