mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 14:02:32 +02:00
MDL-43412 quiz with grade period and password did not work.
Once the attempt became overdue, it was impossible to get in to submit it because of a redirect loop. This fix resovles that loop, so the student can enter their password and get in.
This commit is contained in:
parent
bbb291b7b7
commit
1f8ff396d2
@ -93,9 +93,7 @@ if ($lastattempt && ($lastattempt->state == quiz_attempt::IN_PROGRESS ||
|
||||
$quizobj->create_attempt_object($lastattempt)->handle_if_time_expired($timenow, true);
|
||||
|
||||
// And, if the attempt is now no longer in progress, redirect to the appropriate place.
|
||||
if ($lastattempt->state == quiz_attempt::OVERDUE) {
|
||||
redirect($quizobj->summary_url($lastattempt->id));
|
||||
} else if ($lastattempt->state != quiz_attempt::IN_PROGRESS) {
|
||||
if ($lastattempt->state == quiz_attempt::ABANDONED || $lastattempt->state == quiz_attempt::FINISHED) {
|
||||
redirect($quizobj->review_url($lastattempt->id));
|
||||
}
|
||||
|
||||
@ -159,7 +157,11 @@ if ($accessmanager->is_preflight_check_required($currentattemptid)) {
|
||||
$accessmanager->notify_preflight_check_passed($currentattemptid);
|
||||
}
|
||||
if ($currentattemptid) {
|
||||
redirect($quizobj->attempt_url($currentattemptid, $page));
|
||||
if ($lastattempt->state == quiz_attempt::OVERDUE) {
|
||||
redirect($quizobj->summary_url($lastattempt->id));
|
||||
} else {
|
||||
redirect($quizobj->attempt_url($currentattemptid, $page));
|
||||
}
|
||||
}
|
||||
|
||||
// Delete any previous preview attempts belonging to this user.
|
||||
|
@ -64,7 +64,7 @@ if (!$attemptobj->is_preview_user() && $messages) {
|
||||
$output->access_messages($messages));
|
||||
}
|
||||
if ($accessmanager->is_preflight_check_required($attemptobj->get_attemptid())) {
|
||||
redirect($attemptobj->start_attempt_url(null, $page));
|
||||
redirect($attemptobj->start_attempt_url(null));
|
||||
}
|
||||
|
||||
$displayoptions = $attemptobj->get_display_options(false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user