mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-31510 grade: made the user report observe $cm->uservisible so that activities not available to a student because of groups do not appear on their user report
This commit is contained in:
parent
93fb7b528b
commit
79c0996c64
1 changed files with 13 additions and 0 deletions
|
@ -345,6 +345,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').']';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue