4832 Commits

Author SHA1 Message Date
Jun Pataleta
d5d7835a0a
MDL-79551 versions: Make CiBoT happy
* Use array short syntax for $plugin->dependencies
* Add trailing comma for multi-line $plugin->dependencies array
2023-10-04 14:04:29 +08:00
Jun Pataleta
94bc2cd38b
MDL-79551 versions: bump all versions and requires near release 2023-10-04 13:57:17 +08:00
Andrew Nicols
be8093e2c7
Merge branch 'MDL-78580_master' of https://github.com/marxjohnson/moodle 2023-10-03 11:05:42 +08:00
Huong Nguyen
4a7259f236
Merge branch 'MDL-79224_master' of https://github.com/marxjohnson/moodle 2023-10-03 09:38:53 +07:00
Jun Pataleta
6ee9522dfa
Merge branch 'MDL-79254_master' of https://github.com/marxjohnson/moodle 2023-10-03 09:42:25 +08:00
Mark Johnson
6401ca4959 MDL-79224 core: Make Binary datafilter redisplay selected value
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.
2023-10-02 11:50:44 +01:00
Sara Arjona
3839d226ca
Merge branch 'MDL-79482' of https://github.com/paulholden/moodle 2023-09-28 13:33:20 +02:00
Mark Johnson
e5a7a18ae2 MDL-79254 quiz_statistics: Convert recalculate task to ad-hoc
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.
2023-09-27 15:43:15 +01:00
Shamim Rezaie
d22da878f1 MDL-79486 qbank_columnsortorder: Document get_data_from_datamethod 2023-09-27 22:59:04 +10:00
Shamim Rezaie
1ecb374344 Merge branch 'MDL-79486-master' of https://github.com/andrewnicols/moodle 2023-09-27 22:57:46 +10:00
Paul Holden
4fd6045c2a
MDL-79482 qbank_columnsortorder: improve resize column modal header. 2023-09-26 16:20:10 +01:00
Jun Pataleta
535747fbc7
Merge branch 'MDL-79481' of https://github.com/paulholden/moodle 2023-09-26 12:06:16 +08:00
Andrew Nicols
9c07defb77
MDL-79486 qbank_columnsortorder: Data providers must not create data 2023-09-25 14:34:56 +08:00
Paul Holden
bf6dcc5779
MDL-79483 qbank_columnsortorder: set pix_icon for each column action. 2023-09-24 16:54:20 +01:00
Paul Holden
76a0561f91
MDL-79481 question: replace hard-coded template language strings. 2023-09-24 16:09:40 +01:00
Andrew Nicols
b9172e35e7
MDL-74054 qbank_columnsortorder: Rebuild amd 2023-09-22 23:13:06 +08:00
Mark Johnson
0ac2936c11
MDL-74054 questions: Fix question bank header widths
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.
2023-09-22 22:52:36 +08:00
Mark Johnson
4630043f46
MDL-74054 qbank_columnsortorder: Improve and expand unit tests 2023-09-22 10:53:54 +08:00
Mark Johnson
330908868b
MDL-74054 qbank_columnsortorder: Fix column reset by allowing null values 2023-09-22 10:53:54 +08:00
Andrew Nicols
697ac9b913
MDL-74054 qbank_customfields: Fix behat tests 2023-09-22 10:53:54 +08:00
Andrew Nicols
a3cfd50482
MDL-74054 qbank: Miscellaneous coding style fixes 2023-09-22 10:53:53 +08:00
Andrew Nicols
813c2441a1
MDL-74054 qbank_columnsortorder: Correct dataProvider name 2023-09-22 10:53:53 +08:00
Andrew Nicols
94de1567c3
MDL-74054 qbank_columnsortorder: Move away from ModalFactory 2023-09-22 10:53:53 +08:00
Mark Johnson
33e52fe4ed
MDL-74054 qbank_viewquestiontext: Convert from filter to question bank control
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.
2023-09-22 10:53:53 +08:00
Mark Johnson
63894ec2fe
MDL-74054 qbank_columnsortorder: Progressively enhance question bank actions
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.
2023-09-22 10:53:52 +08:00
Mark Johnson
3685a3355f
MDL-74054 qbank: Updates to plugins to support qbank customisation 2023-09-22 10:53:52 +08:00
Mark Johnson
93ca1cdc32
MDL-74054 theme: Style changes to support question bank UI cusomisation 2023-09-22 10:53:52 +08:00
Mark Johnson
37d69fff6b
MDL-74054 qbank_columnsortorder: Implement add, remove and resize
This updates the admin interface, and hooks into the question bank view
for users to override admin defaults with their preferences.
2023-09-22 10:53:52 +08:00
Mark Johnson
6001ee3dfd
MDL-74054 core_question: Define unique question bank column IDs
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.
2023-09-22 10:53:51 +08:00
Nathan Nguyen
2be0e10a80
MDL-74054 core_question: Add additional plugin points
This refactors the question bank view class to support new plugin points
required for the question bank UI customisation features.
2023-09-22 10:53:51 +08:00
Mark Johnson
feef716c91
MDL-74054 core_question: Re-apply filters when performing a qbank action
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.
2023-09-22 10:53:46 +08:00
Huong Nguyen
1ed52c0019
Merge branch 'MDL-79332' of https://github.com/timhunt/moodle 2023-09-18 18:55:53 +07:00
Sara Arjona
3079511dc7
NOBUG: Fixed SVG browser compatibility 2023-09-15 17:33:23 +02:00
Mark Johnson
a92e5c5770 MDL-78580 report_statistics: Prevent database deadlocks when viewing
If a quiz had a long job to calculate statstics running, this would
cause pages that may also attempt a recalculation (the statistics report
page or question bank) to load very slowly, and possibly result in a
database deadlock.

This change will firstly prevent the question bank page performing
analysis calculations at all, since these are not required for this
page, which will speed up loading and prevent deadlocks on this page.

Secondly, this adds a lock to the recalcuation process so that it cannot
run twice concurrently. This will present the user with a message to
indicate that it is waiting for a running calculation until it is
complete, and eventually it will timeout with a message and debugging.
2023-09-15 15:16:52 +01:00
Ilya Tregubov
259ec50af6
Merge branch 'luca-branch' of https://github.com/ilyatregubov/moodle 2023-09-15 17:05:27 +08:00
Huong Nguyen
50a74f6a2d
Merge branch 'MDL-67271-master' of https://github.com/sarjona/moodle 2023-09-13 11:15:22 +07:00
Luca Bösch
c37a4ba29a MDL-79226 questions: check for UTF-8 encoding of the import file 2023-09-12 20:39:42 +02:00
Tim Hunt
a047d2f8b4 MDL-79332 Question stats: make loading robust to bad data
We were experiencing problems caused by old stats analysis in our
database, computed when there was a bug, causing fatal errors
when they were displayed. Therefore, this code needs to be robust to that.
2023-09-12 16:58:25 +01:00
Sara Arjona
87589e07fc
MDL-67271 pix: Add missing SVG files
The absence of SVG files has been addressed by including them,
sourced from the respective FontAwesome versions available for
download at https://fontawesome.com/icons
2023-09-12 10:54:15 +02:00
Andrew Nicols
48bc688ccd
MDL-78324 core: Convert modals to use new static methods
This commit takes all modals which were not using the legacy
ModalFactory.create triggers and migrates them to the new Modal.create
method.
2023-09-09 00:04:11 +08:00
Jun Pataleta
8edafd35d8
MDL-78549 multianswer: Prevent default when clicking feedback trigger 2023-09-08 22:14:35 +08:00
Huong Nguyen
0a9eaa50e4
Merge branch 'MDL-78549-master' of https://github.com/junpataleta/moodle 2023-09-08 22:14:35 +08:00
Jun Pataleta
f566bf4601
Merge branch 'MDL-78874-master' of https://github.com/danghieu1407/moodle 2023-09-05 12:05:59 +08:00
Jun Pataleta
b5b63270c5
MDL-78549 qtype_multianswer: Configure feedback popover trigger via JS
* For some reason, the `data-trigger="hover focus"` does not work when
rendering the popover via HTML. It just defaults to click, so the
feedback popover for qtype_multianswer questions does not show on hover.
Configuring the feedback popover's trigger via JS seems to work.
2023-09-05 09:34:33 +08:00
Mark Johnson
4f07ff98f4
MDL-72321 question bank: Only update edit switch URL if present 2023-09-01 23:43:20 +08:00
Andrew Nicols
47cc73fe1a
MDL-72321 question: Ensure that all instance props are defined
Since PHP 8.2, all properties on a class must be defined as the PHP
Dynamic Property feature has been deprecated.

This commit goes one step further and switches this class to using
constructor property promotion. This language feature has been available
since PHP 8.0 and allows for simplified creation of class properties
which are initially defined in the constructor.
2023-09-01 09:52:33 +08:00
Andrew Nicols
1ce54ee87e
Merge branch 'MDL-72321_master-squashed' of https://github.com/marxjohnson/moodle 2023-08-31 23:02:35 +08:00
Nathan Nguyen
d9a75f5315 MDL-72321 core: backup/restore filter condition 2023-08-31 15:00:39 +01:00
Nathan Nguyen
e3bd166b3d MDL-72321 mod_quiz: Use new datafilters for random questions 2023-08-31 15:00:39 +01:00
Mark Johnson
823af3a8f1 MDL-72321 core_question: Replace old conditions with new datafilters 2023-08-31 15:00:39 +01:00