Permalink
Browse files

Merge branch 'MDL-37146_22' of git://github.com/andyjdavis/moodle int…

…o MOODLE_22_STABLE
  • Loading branch information...
danpoltawski committed Dec 24, 2012
2 parents 1453ae5 + 6a69966 commit f7128b89bfb3090bbbe4f68c1445a11f3420ab0b
Showing with 7 additions and 3 deletions.
  1. +7 −3 grade/report/lib.php
View
@@ -350,17 +350,21 @@ protected function blank_hidden_total($courseid, $course_item, $finalgrade) {
global $CFG, $DB;
static $hiding_affected = null;//array of items in this course affected by hiding
- //if we're dealing with multiple users we need to know when we've moved on to a new user
+ // If we're dealing with multiple users we need to know when we've moved on to a new user.
static $previous_userid = null;
+
+ // If we're dealing with multiple courses we need to know when we've moved on to a new course.
+ static $previous_courseid = null;
if( $this->showtotalsifcontainhidden==GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN ) {
return $finalgrade;
}
- //if we've moved on to another user don't return the previous user's affected grades
- if ($previous_userid!=$this->user->id) {
+ // If we've moved on to another course or user, reload the grades.
+ if ($previous_userid != $this->user->id || $previous_courseid != $courseid) {
$hiding_affected = null;
$previous_userid = $this->user->id;
+ $previous_courseid = $courseid;
}
if( !$hiding_affected ) {

0 comments on commit f7128b8

Please sign in to comment.