This implementation will introduce a qbank plugin "previewquestion"
which will view the preview question action in the question bank
actions by replacing the core classes, scripts and yui modules.
This plugin will also replace the preview option in the edit
question form. Having this plugin will give users the
flexibility of enabling or disabling this feature from
the question bank view.
This change will also allow other qbank plugins to add
elements or information in the preview question page
by implementing a callback. It also changes the pop
up to page redirect from base view page to make sure
any changes in preview reflects in the base view, for
example, comments added and the number of comments in
the comments colum changes while back from the preview
page. Other locations like edit and qtype plugins where
the preview is implemented, stays the same.
Co-Authored-By: Guillermo Gomez Arias <guillermogomez@catalyst-au.net>
Co-Authored-By: Safat Shahin <safatshahin@catalyst-au.net>
This implementation will introduce a qbank plugin "editquestion"
which will implement the edit question, add question and copy
question actions in the question bank view by replacing the
core classes. Having this plugin will give users the
flexibility of enabling or disabling these actions.
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.)
Some browsers do not bubble form submission events to the window, and we
had more than one form on the page in certain conditions. We need to select
all of the forms on a page and then test the action.
This addresses issues discovered during testing, including:
* inclusion of the M.core_question_preview metadata;
* inclusion of required strings; and
* correcting a function signature.
Add new API for filtering questions, refactoring the options to display
old questions and include subcategories into new
question_bank_search_condition classes. Make the new API pluggable via
local_[pluginname]_get_question_bank_search_conditions.