From ced9b94a04bfe07187c09efd72291b982f79bb71 Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Thu, 12 Jan 2017 15:56:40 +0530 Subject: [PATCH] MDL-57362 assignlib: Check for sep groups edge case --- mod/assign/locallib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index ddbfa74f9e2..7860857b270 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -2837,7 +2837,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; }