diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index e28217b3fe5..dea1f255b64 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -3081,7 +3081,11 @@ class assign { if (!has_any_capability(array('mod/assign:viewgrades', 'mod/assign:grade'), $this->context)) { return false; } - + // Checks for the edge case when user belongs to no groups and groupmode is sep. + if ($this->get_course_module()->effectivegroupmode == SEPARATEGROUPS) { + $groupflag = !empty(groups_get_activity_allowed_groups($this->get_course_module())); + return (bool)$groupflag; + } return true; }