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

@ -61,7 +61,8 @@ $accessmanager->setup_attempt_page($PAGE);
$options = $attemptobj->get_display_options(true);
// Check permissions.
// Check permissions - warning there is similar code in reviewquestion.php and
// quiz_attempt::check_file_access. If you change on, change them all.
if ($attemptobj->is_own_attempt()) {
if (!$attemptobj->is_finished()) {
redirect($attemptobj->attempt_url(null, $page));
@ -91,7 +92,7 @@ if ($options->flags == question_display_options::EDITABLE && optional_param('sav
}
// Work out appropriate title and whether blocks should be shown.
if ($attemptobj->is_preview_user() && $attemptobj->is_own_attempt()) {
if ($attemptobj->is_own_preview()) {
$strreviewtitle = get_string('reviewofpreview', 'quiz');
navigation_node::override_active_url($attemptobj->start_attempt_url());