MDL-57362 assignlib: Check for sep groups edge case

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