Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-14022 - verifies that maxgrade is in fact a number before adding …

…grade_against to totalpoints
  • Loading branch information...
commit 970ea98196285325ec1c5a715dfc9a8e3a7d032e 1 parent ca4fc3a
arborrow authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 grade/lib.php
View
4 grade/lib.php
@@ -301,7 +301,9 @@ function grade_get_formatted_grades() {
else {
// make sure the current assignment is not extra credit and then add it to the totalpoints
if ($all_categories["$category"][$assignment]['extra_credit'] != 1) {
- $all_categories["$category"]['stats']['totalpoints'] = $all_categories["$category"]['stats']['totalpoints'] + $assignments["$assignment"]['grade_against'];
+ if (is_numeric($assignments["$assignment"]['maxgrade'])) {
+ $all_categories["$category"]['stats']['totalpoints'] = $all_categories["$category"]['stats']['totalpoints'] + $assignments["$assignment"]['grade_against'];
+ }
$all_categories["$category"]['stats']['grade_items'] = $all_categories["$category"]['stats']['grade_items'] + 1;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.