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:
Andrew Davis
2010-09-14 08:43:50 +00:00
parent 3937443909
commit 8eabc1d8ef
+9
View File
@@ -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();