Skip to content

Commit

Permalink
MDL-31510 grade: made the user report observe $cm->uservisible so tha…
Browse files Browse the repository at this point in the history
…t activities not available to a student because of groups do not appear on their user report
  • Loading branch information
andyjdavis committed Apr 26, 2012
1 parent bd44a3b commit 52de453
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions grade/report/user/lib.php
Expand Up @@ -344,6 +344,19 @@ private function fill_table_recursive(&$element) {
($this->showhiddenitems == GRADE_REPORT_USER_HIDE_UNTIL && !$grade_grade->is_hiddenuntil()))) { ($this->showhiddenitems == GRADE_REPORT_USER_HIDE_UNTIL && !$grade_grade->is_hiddenuntil()))) {
// return false; // return false;
} else { } else {
// The grade object can be marked visible but still be hidden
// if "enablegroupmembersonly" is on and its an activity assigned to a grouping the user is not in
if (!empty($grade_object->itemmodule) && !empty($grade_object->iteminstance)) {

$instances = $this->gtree->modinfo->get_instances();
if (!empty($instances[$grade_object->itemmodule][$grade_object->iteminstance])) {
$cm = $instances[$grade_object->itemmodule][$grade_object->iteminstance];
if (!$cm->uservisible) {
return false;
}
}
}

/// Excluded Item /// Excluded Item
if ($grade_grade->is_excluded()) { if ($grade_grade->is_excluded()) {
$fullname .= ' ['.get_string('excluded', 'grades').']'; $fullname .= ' ['.get_string('excluded', 'grades').']';
Expand Down

0 comments on commit 52de453

Please sign in to comment.