mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 03:46:42 +02:00
MDL-37475 core_grade:fixed the handling of show totals
This commit is contained in:
parent
4ce97aed0d
commit
5df9bc3998
5 changed files with 27 additions and 12 deletions
|
@ -358,7 +358,12 @@ abstract class grade_report {
|
|||
// 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 ) {
|
||||
if (!is_array($this->showtotalsifcontainhidden)) {
|
||||
debugging('showtotalsifcontainhidden should be an array', DEBUG_DEVELOPER);
|
||||
$this->showtotalsifcontainhidden = array($courseid => $this->showtotalsifcontainhidden);
|
||||
}
|
||||
|
||||
if ($this->showtotalsifcontainhidden[$courseid] == GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN) {
|
||||
return $finalgrade;
|
||||
}
|
||||
|
||||
|
@ -396,7 +401,7 @@ abstract class grade_report {
|
|||
|
||||
//if the item definitely depends on a hidden item
|
||||
if (array_key_exists($course_item->id, $hiding_affected['altered'])) {
|
||||
if( !$this->showtotalsifcontainhidden ) {
|
||||
if( !$this->showtotalsifcontainhidden[$courseid] ) {
|
||||
//hide the grade
|
||||
$finalgrade = null;
|
||||
}
|
||||
|
@ -406,7 +411,7 @@ abstract class grade_report {
|
|||
}
|
||||
} else if (!empty($hiding_affected['unknown'][$course_item->id])) {
|
||||
//not sure whether or not this item depends on a hidden item
|
||||
if( !$this->showtotalsifcontainhidden ) {
|
||||
if( !$this->showtotalsifcontainhidden[$courseid] ) {
|
||||
//hide the grade
|
||||
$finalgrade = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue