MDL-72010 quiz: prevent session timeouts during attempts

This commit is contained in:
Tim Hunt
2021-06-24 12:25:36 +01:00
parent 10daae7ab7
commit dedfc451f3
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -116,6 +116,7 @@ if (!$attemptobj->set_currentpage($page)) {
// Initialise the JavaScript.
$headtags = $attemptobj->get_html_head_contributions($page);
$PAGE->requires->js_init_call('M.mod_quiz.init_attempt_form', null, false, quiz_get_js_module());
\core\session\manager::keepalive(); // Try to prevent sessions expiring during quiz attempts.
// Arrange for the navigation to be displayed in the first region on the page.
$navbc = $attemptobj->get_navigation_panel($output, 'quiz_attempt_nav_panel', $page);
+2
View File
@@ -79,6 +79,8 @@ if ($attemptobj->is_finished()) {
redirect($attemptobj->review_url());
}
\core\session\manager::keepalive(); // Try to prevent sessions expiring during quiz attempts.
// Arrange for the navigation to be displayed.
if (empty($attemptobj->get_quiz()->showblocks)) {
$PAGE->blocks->show_only_fake_blocks();