2 * The modform class has all the JavaScript specific to mod/quiz/mod_form.php.
4 * @module moodle-mod_quiz-modform
7 var MODFORM = function() {
8 MODFORM.superclass.constructor.apply(this, arguments);
12 * The coursebase class to provide shared functionality to Modules within
15 * @class M.course.coursebase
18 Y.extend(MODFORM, Y.Base, {
19 repaginateCheckbox: null,
23 initializer: function () {
24 this.repaginateCheckbox = Y.one('#id_repaginatenow');
25 if (!this.repaginateCheckbox) {
26 // The checkbox only appears when editing an existing quiz.
30 this.qppSelect = Y.one('#id_questionsperpage');
31 this.qppInitialValue = this.qppSelect.get('value');
32 this.qppSelect.on('change', this.qppChanged, this);
35 qppChanged: function() {
36 Y.later(50, this, function() {
37 if (!this.repaginateCheckbox.get('disabled')) {
38 this.repaginateCheckbox.set('checked', this.qppSelect.get('value') !== this.qppInitialValue);
45 // Ensure that M.mod_quiz exists and that coursebase is initialised correctly
46 M.mod_quiz = M.mod_quiz || {};
47 M.mod_quiz.modform = M.mod_quiz.modform || new MODFORM();
48 M.mod_quiz.modform.init = function() {