mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-8850 hidden activities not shown in user activity reports anymore
This commit is contained in:
parent
5ff601c49e
commit
78ed8710e6
1 changed files with 12 additions and 1 deletions
|
@ -3044,7 +3044,18 @@ function print_student_grade($user, $course) {
|
|||
if (empty($mod->modname)) {
|
||||
continue; // Just in case, see MDL-7150
|
||||
}
|
||||
$instance = get_record($mod->modname, 'id', $mod->instance);
|
||||
if (!$instance = get_record($mod->modname, 'id', $mod->instance)) {
|
||||
continue;
|
||||
}
|
||||
if (!$cm = get_coursemodule_from_instance($mod->modname, $mod->instance)) {
|
||||
continue;
|
||||
}
|
||||
if (!$cm->visible) {
|
||||
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
if(!has_capability('moodle/course:viewhiddenactivities', $modcontext)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$libfile = "$CFG->dirroot/mod/$mod->modname/lib.php";
|
||||
|
||||
if (file_exists($libfile)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue