Commit Graph

4875 Commits

Author SHA1 Message Date
Ilya Tregubov 219510b7d9 Merge branch 'MDL-79527' of https://github.com/timhunt/moodle 2024-02-07 09:26:46 +08:00
Tim Hunt 049bff63bc MDL-79527 questions: category tree loading handling bad data
It should always be the case that a question category and its parent
category belong to the same context. However, over the years, we have
observed that this becomes violated by some data in some Moodle sites.
(The suspicion is that this is a backup/restor bug of some sort which
has never been tracked down.)

Since this happens, we should make the code robust to it, which is what
this change does. It ensure that when loading child categories, we only
consider ones in the same context.
2024-02-02 11:26:57 +00:00
Tim Hunt cefcedebcb MDL-80537 question bank: escape plain text display of question text 2024-02-01 16:15:04 +00:00
Sara Arjona 8b36abdb9d Merge branch 'MDL-80259-main' of https://github.com/roland04/moodle 2024-01-24 09:16:12 +01:00
Paul Holden d0cab9a4a0 MDL-79256 customfield: add new valuetrust to data table schema. 2024-01-23 08:18:58 +00:00
Mikel Martín a198884333 MDL-80259 theme_boost: Refactor badge helper classes for Bootstrap 5 2024-01-23 08:27:23 +01:00
Ilya Tregubov 1fdd34a08f MDL-67335 qtype_calculatedmulti: Fix upgrade query. 2024-01-17 17:22:30 +08:00
Jun Pataleta 06146da7cb Merge branch 'MDL-80005-main-squashed' of https://github.com/andrewnicols/moodle 2024-01-17 16:52:33 +08:00
Philipp Imhof cf62f5cc76 MDL-67335 qtype_calculatedmulti: allow HTML in answer options 2024-01-17 08:03:14 +01:00
Andrew Nicols b05fc42db9 MDL-80005 core: Emit deprecation notices for params
Most params are formally deprecated here. This was originally planned
for MDL-80042, but I realised that having an emit, and final param is a
very useful option going forward.

This patch also moves the is_deprecated(), and related methods to the
\core\deprecated attribute.
2024-01-17 12:19:45 +08:00
Jun Pataleta c67b184f4c Merge branch 'MDL-79780' of https://github.com/timhunt/moodle 2024-01-11 10:44:41 +08:00
Paul Holden b98fd96084 MDL-71733 behat: final removal of deprecated 400 step definitions. 2024-01-04 12:43:52 +00:00
Tim Hunt 9ee42d0a34 MDL-79780 quiz_statistics: take advantage of get_fieldset method
This updates the MDL-79639 code.
2023-12-22 12:09:42 +00:00
Ilya Tregubov b642d2710b MDL-79708 question_bank: Fix legacy filter condition.
build_query_from_filter method expects includesubcategories
to be inside filteroptions array
2023-12-11 11:27:21 +08:00
Huong Nguyen e1d02270eb Merge branch 'MDL-77136-main' of https://github.com/lucaboesch/moodle 2023-12-07 08:36:27 +07:00
Jun Pataleta a6ee7e7396 Merge branch 'MDL-80127' of https://github.com/timhunt/moodle 2023-12-06 22:12:25 +08:00
Jun Pataleta 030def7a46 Merge branch 'MDL-80079-master' of https://github.com/andrewnicols/moodle 2023-12-06 21:59:47 +08:00
Luca Bösch 9c2c8c63de MDL-77136 qtype_randomsamatch: Newest versions for shortanswer questions 2023-12-06 14:02:14 +01:00
Luca Bösch b53ab7e800 MDL-77136 core_question: Newest versions get_questions_from_categories 2023-12-06 14:02:14 +01:00
Jun Pataleta 04bc690557 Merge branch 'MDL-80221-main-enfix' of https://github.com/mudrd8mz/moodle 2023-12-04 16:12:07 +08:00
Ilya Tregubov 37737a92d6 Merge branch 'MDL-79890-master' of https://github.com/andrewnicols/moodle 2023-11-30 10:44:35 +08:00
Helen Foster de4f02d809 MDL-80221 lang: Import fixed English strings (en_fix) 2023-11-22 22:48:47 +01:00
Andrew Nicols 525212f2d2 MDL-78496 core: Address phpcs issues with upgrade.php files 2023-11-19 21:20:53 +08:00
Andrew Nicols 545b36cd4a MDL-78496 upgrade: remove all the < 4.1.0 upgrade steps
Also includes an upgrade step to prevent upgrading from any
version < 2021112802 (v4.1.0) as anti-cheating measure.
2023-11-17 23:25:36 +08:00
Tim Hunt 0336443db6 MDL-80127 question engine: prevent fatal errors from old bad data 2023-11-15 16:34:35 +00:00
Tim Hunt 64bac5f4cc MDL-80127 question engine: don't convert null to '' before storing 2023-11-15 16:34:35 +00:00
Andrew Nicols 75587e23c6 MDL-79890 core: Update uses of array_keys with multiple params
These now call the newly minted `moodle_array_keys_filter` method.
2023-11-15 09:14:40 +08:00
Andrew Nicols dab4a2b66f MDL-80079 core: Correct incorrect arg to format_string::$options 2023-11-14 22:28:55 +08:00
Mikel Martín 2ea44fb45e MDL-79629 core_question: Improve autocomplete categories UI 2023-11-02 14:50:10 +00:00
Mark Johnson 58c0f91375 MDL-79639 quiz_statistics: Prevent database deadlocks
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.
2023-10-19 08:59:07 +01:00
Paul Holden 9117e62a4d Merge branch 'MDL-79642-q_tags_off' of https://github.com/leonstr/moodle 2023-10-10 21:18:53 +01:00
Sara Arjona 7b83434dbf Merge branch 'MDL-79626-master' of https://github.com/junpataleta/moodle 2023-10-10 15:13:02 +02:00
Leon Stringer 35c7163184 MDL-79642 qbank_tagquestion: Fix Return type err
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.
2023-10-10 12:14:34 +01:00
Ilya Tregubov d79e8052fb Merge branch 'MDL-79279' of https://github.com/timhunt/moodle 2023-10-10 11:19:27 +08:00
Jun Pataleta 9beff03a96 MDL-79626 upgrade: add the 4.3.0 separation line to all upgrade scripts 2023-10-10 10:44:17 +08:00
Jun Pataleta 98ac14eecb Merge branch 'MDL-79531-master-1' of https://github.com/mihailges/moodle 2023-10-05 07:37:02 +08:00
Mihail Geshoski 451614016e MDL-79531 mod_quiz: Fix exception when adding random questions
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.
2023-10-04 12:31:12 +02:00
Sara Arjona 9877a06246 Merge branch 'MDL-79551-master-rc' of https://github.com/junpataleta/moodle 2023-10-04 12:28:14 +02:00
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
Sara Arjona 4101c5ee2a Merge branch 'MDL-69119_angle_bracket_character_in_answers_not_escaped_in_moodle_xml_export_of_multiple_choice_calculated_questions' of https://github.com/ziegenberg/moodle 2023-10-04 07:51:30 +02:00
Jake Dallimore e430e16c44 Merge branch 'MDL-79466_master' of https://github.com/marxjohnson/moodle 2023-10-04 10:21:08 +08:00
Daniel Ziegenberg 55ef05579b MDL-69119 qformat_xml: fix mc calculated export
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>
2023-10-03 12:18:11 +02: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 7daa40f468 MDL-79466 qbank_history: Filters not applied correctly in History view
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.
2023-10-02 13:30:33 +01: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