This changes the cache purge code to select IDs for deletion
first, rather than using a subquery in a DELETE, since this
risks causing a deadlock in MySQL.
Previously if $CFG->usetags was not enabled the course question bank
page would show:
Exception - qbank_tagquestion\plugin_feature::get_question_filters():
Return value must be of type array, none returned
This is now fixed.
Moves the data-filtercondition property to an element that always
exists regardless of whether the selected category from the filter
has questions or not. This will effectively solve the exception
that is being thrown due to the non-existing element and also
enable creation of random questions in a category that does not
have any questions yet. Also, the data-filtercondition attribute
is no longer used when creating a random question in a new category
as this value is not relevant in this case. Instead, a default
filter condition is generated in the webservice for the random
question based on the newly created category.
The Moodle XML export of multiple choice calculated questions was
missing proper escaping of answers. Also the indentation of the
generated xml was off.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Filters were not being passed from the question bank when viewing a question's history,
mearning that questions not visible with the default filters applied would not have
any version shown on this history view unless the required filters were re-applied manually.
This change ensures the filters are passed in the URL to history.php. It also removes the Filter
UI from the History view, since it doesn't make sense to change the filters that are passed.
The Binary datafilter was returning a single value where all parts of
the API expect an array of values. This was working in most places by
fluke as this value was a single-character string, so doing $value[0]
returned the value. However, it was not working when deciding which
option to mark as selected when re-displaying the filter.
This change makes the filter return an array containing a single integer
value to match the rest of the API, then internally selects that single
value for comparison when deciding if an option should be selected.
Previously, quiz statistics processing happened on a scheduled task.
This task looked for all quizzes with completed attempts, then
determined if those quizzes had a statistics calculation that's newer
than the most recent attempt, then ran the statistics calculation if
needed. It was hard coded to stop processing after 1 hour.
The queries involved in determining which quizzes needed processing
weren't terribly efficient, and combined with the 1 hour limit this made
the statistics unusable on large sites, where they are the most useful.
This converts the scheduled task to an ad-hoc task, and uses an event
observer for mod_quiz\event\attempt_submitted to queue a task when
it is needed. This removes the need for a query to work out what needs
processing, and allows the task processing to be scaled up as needed.
Chrome ignores min-width on table headers with table-layout:fixed,
meaning that question bank headers could be resized so that the controls
were overlapping, and could be too narrow by default.
This removes min-width: min-content in the headers and instead uses
Javascript to calculate a constrain a min width based on the content of
the headers.
This replaces the "Show question text in the question list?" filter, which was
never really a filter, with a new widget displayed alongside other question bank
controls like "Create a new question" and "Reset columns".
It also refactors the logic of displaying the question text field or not, so that
it is all handled within the qbank_viewquestiontext plugin rather than relying on
code in the view.
This modifies the question_data fragment used by the filter code to make its
parameters closer to the URL parameters of the question/edit.php page. This
Allows us to progressively enhance the add, remove and reset actions on the
question bank page, using this same fragment to reload the question table after
each change. This re-uses the same actions.js module used for enhancing these
actions on the qbank_columnsortorder admin screen.
This also resolves MDL-78829.
Some question bank plugins use a separate class for each plugin they
define. However, qbank_customfields (and potentially others in the
future) uses a single class to define multiple fields. Using the class
name as an ID for the column doesn't give us a way of reliable
instantiating an object for the column. Previously, qbank_customfields
appended the field name as though it was a namespaced class, but this
had to be manually constructed and deconstructed by detecting this
particular column class.
This change introduces a standard way of constructing a unique ID for
each question bank column, in the form
pluginname\columnclass-columnname. This ensures that the ID will be
unique for each column, and the ID can be used to instatiate the
column's object.
This changes the root element used by the fragment when
applying filters, so that the whole of display_question_list()
is reloaded.
This ensures that the returnurl will be updated correctly on the
question actions and bulk actions without manipulating then
further in Javascript.