gradebook MDL-22841 fixed a bug where the user report when viewing multiple students would misreport student's course totals
This commit is contained in:
@@ -339,10 +339,19 @@ 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
|
||||
static $previous_userid = 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) {
|
||||
$hiding_affected = null;
|
||||
$previous_userid = $this->user->id;
|
||||
}
|
||||
|
||||
if( !$hiding_affected ) {
|
||||
$items = grade_item::fetch_all(array('courseid'=>$courseid));
|
||||
$grades = array();
|
||||
|
||||
Reference in New Issue
Block a user