* Display "Top" categories in the category filter when listing questions in the question bank
* Prevent editing "Top" categories
* Prevent deleting "Top" categories
The new recordset support for Postgres requires transactions and
will cause errors if recordsets are not closed correctly. This
commit fixes problems that were identified during unit tests, and
via some basic code analysis, across all core code. Most of these
are incorrect usage of recordset (forgetting to close them).
Changes include:
* question: Add bootstrap classes to buttons and selects so they look consistent.
* mod_quiz: Add bootstrap styles to report form elements
* question: Add bootstrap classes to question form elements
* And remove the success/fail styles from boost because they conflict badly
with the quiz plugin styles (making unreadable text).
* quiz: nav block buttons had black background
* quiz: Add bootstrap styles to quiz navigation buttons
* qtype_ddmarker: Remove bullets from list
Edit form coordinates preview had list bullets for each coordinate.
* boost: Prevent menu scrolling on quiz edit
* mod_quiz: Add bootstrap styles to edit quiz fields
Pagination and max grades forms.
* quiz: Undo some custom styles on review options
These checkboxes were laid out in a fake grid with no responsiveness
that conflicts with the bootstrap form-inline templates. Reset the
custom style to bootstrap default.
* quiz: Fix unit tests for boost changes
* qtype_ddwtos: Accurate positioning of drop targets
* questions: Make the review page responsive
* question: bootstrap 4 compatibility
.alert in bs4 contains no colours by default, you need to mix it with
one of the context classes to get some change in colours, borders etc.
When selecting the variant of the new question, we need to add the
new question to the usage before trying to select a variant.
Also, we need to acutally use the selected variant number!
Rendering a large number of questions may be quite slow, so we want to
raise the limit.
We don’t call raise() in the loop because the quiz buffer captures this
function for a AJAX script, and we should only call raise if we expect
a corresponding output to the users browser. This helps to prevent
unexpected load balancer disconnects. See core_php_time_limit::raise()
for more details.
There are several improvements over what we had before:
1. We track all the questions seen in the the student's previous
quiz attempts, so that when they start a new quiz attempt, they get
questions they have not seen before if possible.
2. When there are no more unseen questions, we start repeating, but
always taking from the questions with the fewest attempts so far.
3. A similar logic is applied with variants within one question.
There is lots of credit to go around here. Oleg Sychev's students Alex
Shkarupa, Sergei Bastrykin and Darya Beda all worked on this over
several years, helping to clarify the problem and shape the best
solution. In the end, their various attempts were rewritten into this
final patch by me.
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.)