MDL-28976 quiz was passing 0 to ->attempt_url when it should have been null.
There was also one other incorrect call that is fixed in this commit.
This commit is contained in:
@@ -42,7 +42,7 @@ $attemptid = required_param('attempt', PARAM_INT);
|
||||
$page = optional_param('page', 0, PARAM_INT);
|
||||
|
||||
$attemptobj = quiz_attempt::create($attemptid);
|
||||
$PAGE->set_url($attemptobj->attempt_url(0, $page));
|
||||
$PAGE->set_url($attemptobj->attempt_url(null, $page));
|
||||
|
||||
// Check login.
|
||||
require_login($attemptobj->get_course(), false, $attemptobj->get_cm());
|
||||
|
||||
@@ -57,7 +57,7 @@ if ($next) {
|
||||
if ($page == -1) {
|
||||
$nexturl = $attemptobj->summary_url();
|
||||
} else {
|
||||
$nexturl = $attemptobj->attempt_url(0, $page);
|
||||
$nexturl = $attemptobj->attempt_url(null, $page);
|
||||
if ($scrollpos !== '') {
|
||||
$nexturl->param('scrollpos', $scrollpos);
|
||||
}
|
||||
@@ -96,7 +96,7 @@ if (!$finishattempt) {
|
||||
$attemptobj->process_all_actions($timenow);
|
||||
} catch (question_out_of_sequence_exception $e) {
|
||||
print_error('submissionoutofsequencefriendlymessage', 'question',
|
||||
$attemptobj->attempt_url(0, $thispage));
|
||||
$attemptobj->attempt_url(null, $thispage));
|
||||
}
|
||||
$transaction->allow_commit();
|
||||
redirect($nexturl);
|
||||
|
||||
@@ -417,8 +417,8 @@ class mod_quiz_renderer extends plugin_renderer_base {
|
||||
|
||||
// Print all the questions
|
||||
foreach ($slots as $slot) {
|
||||
$output .= $attemptobj->render_question($slot, false, $attemptobj->attempt_url($id,
|
||||
$page));
|
||||
$output .= $attemptobj->render_question($slot, false,
|
||||
$attemptobj->attempt_url($slot, $page));
|
||||
}
|
||||
|
||||
$output .= html_writer::start_tag('div', array('class' => 'submitbtns'));
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ $options = $attemptobj->get_display_options(true);
|
||||
// Check permissions.
|
||||
if ($attemptobj->is_own_attempt()) {
|
||||
if (!$attemptobj->is_finished()) {
|
||||
redirect($attemptobj->attempt_url(0, $page));
|
||||
redirect($attemptobj->attempt_url(null, $page));
|
||||
} else if (!$options->attempt) {
|
||||
$accessmanager->back_to_view_page($attemptobj->is_preview_user(),
|
||||
$accessmanager->cannot_review_message($attemptobj->get_attempt_state()));
|
||||
|
||||
Reference in New Issue
Block a user