Navigation Menu

Skip to content

Commit

Permalink
quiz: Check this is the users own attempt before sending them to the …
Browse files Browse the repository at this point in the history
…attempt.php page.
  • Loading branch information
tjhunt committed Jul 22, 2009
1 parent 1ddfb91 commit 82fd2e8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mod/quiz/review.php
Expand Up @@ -27,14 +27,14 @@

/// Permissions checks for normal users who do not have quiz:viewreports capability.
if (!$attemptobj->has_capability('mod/quiz:viewreports')) {
/// Can't review other users' attempts.
if (!$attemptobj->is_own_attempt()) {
quiz_error($attemptobj->get_quiz(), 'notyourattempt');
}
/// Can't review during the attempt - send them back to the attempt page.
if (!$attemptobj->is_finished()) {
redirect($attemptobj->attempt_url(0, $page));
}
/// Can't review other users' attempts.
if (!$attemptobj->is_own_attempt()) {
quiz_error($quiz, 'notyourattempt');
}
/// Can't review unless Students may review -> Responses option is turned on.
if (!$options->responses) {
$accessmanager->back_to_view_page($attemptobj->is_preview_user(),
Expand Down Expand Up @@ -99,7 +99,6 @@
}

/// Print heading.
print_heading(format_string($attemptobj->get_quiz_name()));
if ($attemptobj->is_preview_user() && $attemptobj->is_own_attempt()) {
$attemptobj->print_restart_preview_button();
}
Expand Down

0 comments on commit 82fd2e8

Please sign in to comment.