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

This commit is contained in:
Dan Poltawski
2012-12-24 11:27:02 +08:00
+7 -3
View File
@@ -350,17 +350,21 @@ abstract class grade_report {
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 ) {