Skip to content

Commit

Permalink
Merge branch 'MDL-57362-32' of git://github.com/ankitagarwal/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_32_STABLE
  • Loading branch information
danpoltawski committed Mar 6, 2017
2 parents 29cdf58 + 121d3e0 commit 188d41c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mod/assign/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3051,7 +3051,7 @@ protected function view_footer() {
* 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)) {
Expand All @@ -3063,7 +3063,7 @@ public function require_view_submission($userid) {
* 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()) {
Expand All @@ -3081,7 +3081,11 @@ public function can_view_grades() {
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;
}

Expand Down

0 comments on commit 188d41c

Please sign in to comment.