MDL-57362 assignlib: Check for sep groups edge case

This commit is contained in:
Ankit Agarwal
2017-02-28 10:34:41 +05:30
parent d0209e611f
commit 5b7356cdde
+5 -1
View File
@@ -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;
}