Skip to content

Commit

Permalink
MDL-17248 fixed incorrect sum when scales involved
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Apr 27, 2009
1 parent bd2fb93 commit 0ba3cbe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/db/upgrade.php
Expand Up @@ -3147,6 +3147,11 @@ function xmldb_main_upgrade($oldversion=0) {
upgrade_main_savepoint($result, 2007101546.03);
}

if ($result && $oldversion < 2007101546.04) {
// force full regrading - the max grade for sum aggregation was not correct when scales involved
set_field('grade_items', 'needsupdate', 1, 'needsupdate', 0);
}

return $result;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/grade/grade_category.php
Expand Up @@ -725,7 +725,7 @@ function auto_update_max($items) {
if ($item->gradetype == GRADE_TYPE_VALUE) {
$max += $item->grademax;
} else if ($item->gradetype == GRADE_TYPE_SCALE) {
$max += $item->grademax - 1; // scales min is 1
$max += $item->grademax; // 0 = nograde, 1 = first scale item, 2 = second scale item
}
}

Expand Down
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)

$version = 2007101546.03; // YYYYMMDD = date of the 1.9 branch (don't change)
$version = 2007101546.04; // YYYYMMDD = date of the 1.9 branch (don't change)
// X = release number 1.9.[0,1,2,3,4,5...]
// Y.YY = micro-increments between releases

Expand Down

0 comments on commit 0ba3cbe

Please sign in to comment.