Skip to content

Commit

Permalink
MDL-71728 mod_quiz: check if user can access this page
Browse files Browse the repository at this point in the history
  • Loading branch information
rjnl authored and Jenkins committed Aug 9, 2023
1 parent 3f435c0 commit 6cb39c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mod/quiz/processattempt.php
Expand Up @@ -85,6 +85,12 @@
'attemptalreadyclosed', null, $attemptobj->review_url());
}

// If this page cannot be accessed, notify user and send them to the correct page.
if (!$finishattempt && !$attemptobj->check_page_access($thispage)) {
throw new moodle_exception('submissionoutofsequencefriendlymessage', 'question',
$attemptobj->attempt_url(null, $attemptobj->get_currentpage()));
}

// Process the attempt, getting the new status for the attempt.
$status = $attemptobj->process_attempt($timenow, $finishattempt, $timeup, $thispage);

Expand Down

0 comments on commit 6cb39c5

Please sign in to comment.