From: Sam Hemelryk Date: Mon, 30 Apr 2012 00:11:23 +0000 (+1200) Subject: Merge branch 'MDL-31510_group_activities' of git://github.com/andyjdavis/moodle X-Git-Tag: v2.3.0-beta~659 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=e074f9763b7cca8b1eacbe1de6ff6f32ae4d13f8;hp=b5aa51419abf65004973e5083f667ffa171a7518 Merge branch 'MDL-31510_group_activities' of git://github.com/andyjdavis/moodle --- diff --git a/grade/report/user/lib.php b/grade/report/user/lib.php index b57e8a1c251..d7073ea781c 100644 --- a/grade/report/user/lib.php +++ b/grade/report/user/lib.php @@ -347,6 +347,19 @@ class grade_report_user extends grade_report { ($this->showhiddenitems == GRADE_REPORT_USER_HIDE_UNTIL && !$grade_grade->is_hiddenuntil()))) { // return false; } 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 if ($grade_grade->is_excluded()) { $fullname .= ' ['.get_string('excluded', 'grades').']';