MDL-43089 quiz: improved interface for building quizzes
authorColin Chambers <c.chambers@open.ac.uk>
Thu, 5 Dec 2013 16:18:24 +0000 (16:18 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Thu, 2 Oct 2014 16:22:23 +0000 (17:22 +0100)
commite1a2d0d92d511e21884166a2aefdfe81f16aa4b6
treedc4563325149a83d077350cf7cb03dee178fbfd4
parent6597413d41fd3f47d078baa2152f0219f8a463f8
MDL-43089 quiz: improved interface for building quizzes

This commit is actually the joint work of Mahmoud Kassaei, Colin
Chambers and Tim Hunt from The Open University. We could only use one
persons name for the commit, and this time Colin gets the credit/blame.

The goal of this work was to increase usability, and also clean up
the page enough that it will be possible to add new features in future.

Display of mod/quiz/edit.php is now entirely generated by
mod_quiz\output\edit_renderer. This uses a helper class
mod_quiz\structure to provide details of the structure of the quiz, and
mod_quiz\repaginate to alter that structure. (Acutally, there are still
some modification methods on mod_quiz\structure. Expect that to be
cleaned up in future.)

The new code uses much more ajax, and there are new scripts
mod/quiz/edit_rest.php and mod/quiz/repaginate.php to handle this.
(Again, don't be surprised if those two scripts get merged in future.)
Also questionbank.ajax.php (which may, in future, be made more generic,
and moved into the core question bank code.)

Most of the new JavaScript code has intentionally copied the way things
are done when editing activities on the course page.

As a result of this, mod/quiz/editlib.php is now much shorter than it
was. (In future, expect the remaining code in here to move into
mod/quiz/classes.)
114 files changed:
mod/quiz/addrandom.php
mod/quiz/addrandomform.php
mod/quiz/attemptlib.php
mod/quiz/classes/admin_review_setting.php
mod/quiz/classes/output/edit_renderer.php [new file with mode: 0644]
mod/quiz/classes/repaginate.php [new file with mode: 0644]
mod/quiz/classes/structure.php [new file with mode: 0644]
mod/quiz/edit.js [deleted file]
mod/quiz/edit.php
mod/quiz/edit_rest.php [new file with mode: 0644]
mod/quiz/editlib.php
mod/quiz/lang/en/quiz.php
mod/quiz/lib.php
mod/quiz/locallib.php
mod/quiz/mod_form.php
mod/quiz/questionbank.ajax.php [new file with mode: 0644]
mod/quiz/renderer.php
mod/quiz/repaginate.php [new file with mode: 0644]
mod/quiz/styles.css
mod/quiz/tests/behat/behat_mod_quiz.php
mod/quiz/tests/behat/editing_add.feature [new file with mode: 0644]
mod/quiz/tests/behat/editing_click_move_icon.feature [new file with mode: 0644]
mod/quiz/tests/behat/editing_repaginate.feature [new file with mode: 0644]
mod/quiz/tests/behat/editing_set_marks.feature [new file with mode: 0644]
mod/quiz/tests/editlib_test.php [deleted file]
mod/quiz/tests/lib_test.php
mod/quiz/tests/locallib_test.php
mod/quiz/tests/repaginate_test.php [new file with mode: 0644]
mod/quiz/tests/structure_test.php [new file with mode: 0644]
mod/quiz/upgrade.txt
mod/quiz/version.php
mod/quiz/yui/build/moodle-mod_quiz-dragdrop/moodle-mod_quiz-dragdrop-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-dragdrop/moodle-mod_quiz-dragdrop-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-dragdrop/moodle-mod_quiz-dragdrop.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-modform/moodle-mod_quiz-modform-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-modform/moodle-mod_quiz-modform-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-modform/moodle-mod_quiz-modform.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-questionchooser/moodle-mod_quiz-questionchooser-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-questionchooser/moodle-mod_quiz-questionchooser-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-questionchooser/moodle-mod_quiz-questionchooser.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-quizbase/moodle-mod_quiz-quizbase-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-quizbase/moodle-mod_quiz-quizbase-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-quizbase/moodle-mod_quiz-quizbase.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-quizquestionbank/moodle-mod_quiz-quizquestionbank-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-quizquestionbank/moodle-mod_quiz-quizquestionbank-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-quizquestionbank/moodle-mod_quiz-quizquestionbank.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-randomquestion/moodle-mod_quiz-randomquestion-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-randomquestion/moodle-mod_quiz-randomquestion-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-randomquestion/moodle-mod_quiz-randomquestion.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-repaginate/moodle-mod_quiz-repaginate-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-repaginate/moodle-mod_quiz-repaginate-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-repaginate/moodle-mod_quiz-repaginate.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-toolboxes/moodle-mod_quiz-toolboxes.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-util-base/moodle-mod_quiz-util-base-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-util-base/moodle-mod_quiz-util-base-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-util-base/moodle-mod_quiz-util-base.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-util-page/moodle-mod_quiz-util-page.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-util-slot/moodle-mod_quiz-util-slot-debug.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-util-slot/moodle-mod_quiz-util-slot-min.js [new file with mode: 0644]
mod/quiz/yui/build/moodle-mod_quiz-util-slot/moodle-mod_quiz-util-slot.js [new file with mode: 0644]
mod/quiz/yui/src/dragdrop/build.json [new file with mode: 0644]
mod/quiz/yui/src/dragdrop/js/dragdrop.js [new file with mode: 0644]
mod/quiz/yui/src/dragdrop/js/resource.js [new file with mode: 0644]
mod/quiz/yui/src/dragdrop/js/section.js [new file with mode: 0644]
mod/quiz/yui/src/dragdrop/meta/dragdrop.json [new file with mode: 0644]
mod/quiz/yui/src/modform/build.json [new file with mode: 0644]
mod/quiz/yui/src/modform/js/modform.js [new file with mode: 0644]
mod/quiz/yui/src/modform/meta/modform.json [new file with mode: 0644]
mod/quiz/yui/src/questionchooser/build.json [new file with mode: 0644]
mod/quiz/yui/src/questionchooser/js/questionchooser.js [new file with mode: 0644]
mod/quiz/yui/src/questionchooser/meta/questionchooser.json [new file with mode: 0644]
mod/quiz/yui/src/quizbase/build.json [new file with mode: 0644]
mod/quiz/yui/src/quizbase/js/quizbase.js [new file with mode: 0644]
mod/quiz/yui/src/quizbase/meta/quizbase.json [new file with mode: 0644]
mod/quiz/yui/src/quizquestionbank/build.json [new file with mode: 0644]
mod/quiz/yui/src/quizquestionbank/js/quizquestionbank.js [new file with mode: 0644]
mod/quiz/yui/src/quizquestionbank/meta/quizquestionbank.json [new file with mode: 0644]
mod/quiz/yui/src/randomquestion/build.json [new file with mode: 0644]
mod/quiz/yui/src/randomquestion/js/randomquestion.js [new file with mode: 0644]
mod/quiz/yui/src/randomquestion/meta/randomquestion.json [new file with mode: 0644]
mod/quiz/yui/src/repaginate/build.json [new file with mode: 0644]
mod/quiz/yui/src/repaginate/js/repaginate.js [new file with mode: 0644]
mod/quiz/yui/src/repaginate/meta/repaginate.json [new file with mode: 0644]
mod/quiz/yui/src/toolboxes/build.json [new file with mode: 0644]
mod/quiz/yui/src/toolboxes/js/resource.js [new file with mode: 0644]
mod/quiz/yui/src/toolboxes/js/section.js [new file with mode: 0644]
mod/quiz/yui/src/toolboxes/js/toolbox.js [new file with mode: 0644]
mod/quiz/yui/src/toolboxes/meta/toolboxes.json [new file with mode: 0644]
mod/quiz/yui/src/util/build.json [new file with mode: 0644]
mod/quiz/yui/src/util/js/base.js [new file with mode: 0644]
mod/quiz/yui/src/util/js/page.js [new file with mode: 0644]
mod/quiz/yui/src/util/js/slot.js [new file with mode: 0644]
mod/quiz/yui/src/util/meta/util.json [new file with mode: 0644]
pix/e/insert_page_break.png [new file with mode: 0644]
pix/e/insert_page_break.svg [new file with mode: 0644]
pix/e/remove_page_break.png [new file with mode: 0644]
pix/e/remove_page_break.svg [new file with mode: 0644]
question/addquestion.php
question/classes/bank/checkbox_column.php
question/classes/bank/view.php
question/editlib.php
question/yui/build/moodle-question-qbankmanager/moodle-question-qbankmanager-debug.js
question/yui/build/moodle-question-qbankmanager/moodle-question-qbankmanager-min.js
question/yui/build/moodle-question-qbankmanager/moodle-question-qbankmanager.js
question/yui/build/moodle-question-questionbank/moodle-question-questionbank-debug.js [new file with mode: 0644]
question/yui/build/moodle-question-questionbank/moodle-question-questionbank.js [new file with mode: 0644]
question/yui/src/qbankmanager/js/qbankmanager.js
question/yui/src/questionbank/build.json [new file with mode: 0644]
question/yui/src/questionbank/js/questionbank.js [new file with mode: 0644]
question/yui/src/questionbank/meta/questionbank.json [new file with mode: 0644]