Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

gradebook MDL-22841 fixed a bug where the user report when viewing mu…

…ltiple students would misreport student's course totals
  • Loading branch information...
commit 76fe2687d536a380849200faaad6cad728fff442 1 parent e14ee4c
Andrew Davis authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 grade/report/lib.php
View
9 grade/report/lib.php
@@ -333,11 +333,20 @@ function get_sort_arrow($direction='move', $sort_link=null) {
function blank_hidden_total($courseid, $course_item, $finalgrade) {
global $CFG;
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();
Please sign in to comment.
Something went wrong with that request. Please try again.