MDL-77582 mod_quiz: Fix view_url() on null error

This commit is contained in:
Sara Arjona 2023-03-09 13:57:41 +01:00
parent 556208417d
commit 6c6adc462c

View File

@ -61,7 +61,7 @@ if ($attemptobj->get_userid() != $USER->id) {
if ($attemptobj->has_capability('mod/quiz:viewreports')) {
redirect($attemptobj->review_url(null, $page));
} else {
throw new moodle_exception('notyourattempt', 'quiz', $quizobj->view_url());
throw new moodle_exception('notyourattempt', 'quiz', $attemptobj->view_url());
}
}
@ -112,7 +112,7 @@ $slots = $attemptobj->get_slots($page);
// Check.
if (empty($slots)) {
throw new moodle_exception('noquestionsfound', 'quiz', $quizobj->view_url());
throw new moodle_exception('noquestionsfound', 'quiz', $attemptobj->view_url());
}
// Update attempt page, redirecting the user if $page is not valid.