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:
Adrian Greeve 2015-11-02 14:47:15 +08:00
parent 4cef723c22
commit ca3e8022d1

View File

@ -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);