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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user