From ca3e8022d17113967aa488ff3dbfcc7cfc6549f2 Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Mon, 2 Nov 2015 14:47:15 +0800 Subject: [PATCH] MDL-51486 mod_data: Can view rating information. When students are given the appropriate permissions to view ratings, in the situation where there are separate groups. The students can view the ratings of an entry that is in the all participants group. --- mod/data/lib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/data/lib.php b/mod/data/lib.php index 20079f2b01d..f4eaaa6f231 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -1566,6 +1566,11 @@ function mod_data_rating_can_see_item_ratings($params) { throw new rating_exception('invaliditemid'); } + // User can see ratings of all participants. + if ($info->groupid == 0) { + return true; + } + $course = $DB->get_record('course', array('id' => $info->course), '*', MUST_EXIST); $cm = get_coursemodule_from_instance('data', $info->dataid, $course->id, false, MUST_EXIST);