Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-30885 quiz: use formchangechecker during quiz attempts.

To avoid the possiblity of dataloss if a student tries to navigate away
having changed some answers.
  • Loading branch information...
commit 022a3555d1f92d4a63bdf159743f604277669243 1 parent 9273bd1
@timhunt timhunt authored
Showing with 3 additions and 1 deletion.
  1. +2 −1  mod/quiz/locallib.php
  2. +1 −0  mod/quiz/module.js
View
3  mod/quiz/locallib.php
@@ -1456,13 +1456,14 @@ function quiz_get_js_module() {
'name' => 'mod_quiz',
'fullpath' => '/mod/quiz/module.js',
'requires' => array('base', 'dom', 'event-delegate', 'event-key',
- 'core_question_engine'),
+ 'core_question_engine', 'moodle-core-formchangechecker'),
'strings' => array(
array('cancel', 'moodle'),
array('flagged', 'question'),
array('functiondisabledbysecuremode', 'quiz'),
array('startattempt', 'quiz'),
array('timesup', 'quiz'),
+ array('changesmadereallygoaway', 'moodle'),
),
);
}
View
1  mod/quiz/module.js
@@ -27,6 +27,7 @@ M.mod_quiz = M.mod_quiz || {};
M.mod_quiz.init_attempt_form = function(Y) {
M.core_question_engine.init_form(Y, '#responseform');
Y.on('submit', M.mod_quiz.timer.stop, '#responseform');
+ M.core_formchangechecker.init({formid: 'responseform'});
};
M.mod_quiz.init_review_form = function(Y) {
Please sign in to comment.
Something went wrong with that request. Please try again.