Skip to content
Browse files

MDL-28976 quiz was passing 0 to ->attempt_url when it should have bee…

…n null.

There was also one other incorrect call that is fixed in this commit.
  • Loading branch information...
1 parent 24654d9 commit cb5a7bba89c46a83fa7924dc60c71c2470d496cc @timhunt timhunt committed
Showing with 6 additions and 6 deletions.
  1. +1 −1 mod/quiz/attempt.php
  2. +2 −2 mod/quiz/processattempt.php
  3. +2 −2 mod/quiz/renderer.php
  4. +1 −1 mod/quiz/review.php
View
2 mod/quiz/attempt.php
@@ -42,7 +42,7 @@
$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());
View
4 mod/quiz/processattempt.php
@@ -57,7 +57,7 @@
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 @@
$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);
View
4 mod/quiz/renderer.php
@@ -417,8 +417,8 @@ public function attempt_form($attemptobj, $page, $slots, $id, $nextpage) {
// 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'));
View
2 mod/quiz/review.php
@@ -57,7 +57,7 @@
// 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()));

0 comments on commit cb5a7bb

Please sign in to comment.
Something went wrong with that request. Please try again.