Commit 892ceeb7 authored by Dan Poltawski's avatar Dan Poltawski
Browse files

Merge branch 'MDL-57362-master' of git://github.com/ankitagarwal/moodle

parents 3c45d26f ca09e215
......@@ -3064,7 +3064,7 @@ class assign {
* Throw an error if the permissions to view this users submission are missing.
*
* @throws required_capability_exception
* @return none
* @return void
*/
public function require_view_submission($userid) {
if (!$this->can_view_submission($userid)) {
......@@ -3076,7 +3076,7 @@ class assign {
* Throw an error if the permissions to view grades in this assignment are missing.
*
* @throws required_capability_exception
* @return none
* @return void
*/
public function require_view_grades() {
if (!$this->can_view_grades()) {
......@@ -3094,7 +3094,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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment