MDL-50996 quiz: fix review error with unusual permissions

This commit is contained in:
Tim Hunt 2015-08-04 17:26:12 +01:00
parent 6d392b3027
commit 857e2a6f8c
3 changed files with 27 additions and 11 deletions

View file

@ -52,7 +52,8 @@ $PAGE->set_pagelayout('popup');
$PAGE->set_heading($attemptobj->get_course()->fullname);
$output = $PAGE->get_renderer('mod_quiz');
// Check permissions.
// Check permissions - warning there is similar code in review.php and
// quiz_attempt::check_file_access. If you change on, change them all.
if ($attemptobj->is_own_attempt()) {
if (!$attemptobj->is_finished()) {
echo $output->review_question_not_allowed(get_string('cannotreviewopen', 'quiz'));