moodle.git
3 days agoweekly release 5.1dev main
Michael Hawkins [Fri, 11 Jul 2025 04:48:28 +0000 (12:48 +0800)]
weekly release 5.1dev

3 days agoNOBUG: Add upgrade notes
Michael Hawkins [Fri, 11 Jul 2025 04:48:27 +0000 (12:48 +0800)]
NOBUG: Add upgrade notes

4 days agoMerge branch 'MDL-85863-main' of https://github.com/yusufwib01/moodle
Huong Nguyen [Thu, 10 Jul 2025 03:46:33 +0000 (10:46 +0700)]
Merge branch 'MDL-85863-main' of https://github.com/yusufwib01/moodle

4 days agoMerge branch 'MDL-84399-main' of https://github.com/dpfahl-ms/moodle
Huong Nguyen [Thu, 10 Jul 2025 03:41:55 +0000 (10:41 +0700)]
Merge branch 'MDL-84399-main' of https://github.com/dpfahl-ms/moodle

4 days agoMerge branch 'MDL-85689-main' of https://github.com/andelacruz/moodle into main
Mihail Geshoski [Thu, 10 Jul 2025 03:39:24 +0000 (11:39 +0800)]
Merge branch 'MDL-85689-main' of https://github.com/andelacruz/moodle into main

4 days agoMDL-85721 qtype_multianswer: Update find_duplicated_subquestions for Oracle compatibility
Mark Johnson [Wed, 9 Jul 2025 10:09:44 +0000 (11:09 +0100)]
MDL-85721 qtype_multianswer: Update find_duplicated_subquestions for Oracle compatibility

4 days agoMDL-84695 mod_qbank: Fix illegal whitespace
Mihail Geshoski [Thu, 10 Jul 2025 03:07:25 +0000 (11:07 +0800)]
MDL-84695 mod_qbank: Fix illegal whitespace

4 days agoMDL-84695 mod_qbank: Fix unit tests for MS SQL server
Mark Johnson [Thu, 3 Jul 2025 14:51:29 +0000 (15:51 +0100)]
MDL-84695 mod_qbank: Fix unit tests for MS SQL server

4 days agoMerge branch 'MDL-85262' of https://github.com/paulholden/moodle
Huong Nguyen [Thu, 10 Jul 2025 01:33:24 +0000 (08:33 +0700)]
Merge branch 'MDL-85262' of https://github.com/paulholden/moodle

4 days agoMerge branch 'MDL-84901' of https://github.com/paulholden/moodle
Huong Nguyen [Thu, 10 Jul 2025 01:25:31 +0000 (08:25 +0700)]
Merge branch 'MDL-84901' of https://github.com/paulholden/moodle

4 days agoMerge branch 'MDL-85939' of https://github.com/paulholden/moodle into main
Mihail Geshoski [Wed, 9 Jul 2025 15:26:29 +0000 (23:26 +0800)]
Merge branch 'MDL-85939' of https://github.com/paulholden/moodle into main

4 days agoMerge branch 'MDL-84255-main' of https://github.com/lucaboesch/moodle into main
Mihail Geshoski [Wed, 9 Jul 2025 15:18:45 +0000 (23:18 +0800)]
Merge branch 'MDL-84255-main' of https://github.com/lucaboesch/moodle into main

4 days agoMerge branch 'MDL-80327_remove-deprecated-class-callbacks-from-mod_quiz' of https...
Mihail Geshoski [Wed, 9 Jul 2025 15:12:19 +0000 (23:12 +0800)]
Merge branch 'MDL-80327_remove-deprecated-class-callbacks-from-mod_quiz' of https://github.com/ziegenberg/moodle into main

4 days agoMDL-80327 mod_quiz: Remove deprecated class callbacks from mod_quiz
Daniel Ziegenberg [Thu, 13 Feb 2025 14:49:06 +0000 (15:49 +0100)]
MDL-80327 mod_quiz: Remove deprecated class callbacks from mod_quiz

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
5 days agoMerge branch 'MDL-83890-main' of https://github.com/laurentdavid/moodle
Amaia Anabitarte [Wed, 9 Jul 2025 08:09:33 +0000 (10:09 +0200)]
Merge branch 'MDL-83890-main' of https://github.com/laurentdavid/moodle

5 days agoMerge branch 'MDL-85880' of https://github.com/paulholden/moodle
cescobedo [Wed, 9 Jul 2025 07:43:36 +0000 (09:43 +0200)]
Merge branch 'MDL-85880' of https://github.com/paulholden/moodle

5 days agoMerge branch 'MDL-83147-main' of https://github.com/meirzamoodle/moodle
Huong Nguyen [Wed, 9 Jul 2025 06:18:05 +0000 (13:18 +0700)]
Merge branch 'MDL-83147-main' of https://github.com/meirzamoodle/moodle

5 days agoMerge branch 'MDL-85721_main' of https://github.com/marxjohnson/moodle into main
Mihail Geshoski [Wed, 9 Jul 2025 02:21:01 +0000 (10:21 +0800)]
Merge branch 'MDL-85721_main' of https://github.com/marxjohnson/moodle into main

5 days agoMDL-85689 mod_quiz: Behat for adding and deleting page from quiz
andelacruz [Wed, 25 Jun 2025 07:27:12 +0000 (15:27 +0800)]
MDL-85689 mod_quiz: Behat for adding and deleting page from quiz

5 days agoMerge branch 'MDL-85697-main' of https://github.com/andelacruz/moodle
Huong Nguyen [Wed, 9 Jul 2025 02:10:31 +0000 (09:10 +0700)]
Merge branch 'MDL-85697-main' of https://github.com/andelacruz/moodle

5 days agoMerge branch 'MDL-85779' of https://github.com/paulholden/moodle
Huong Nguyen [Wed, 9 Jul 2025 02:05:56 +0000 (09:05 +0700)]
Merge branch 'MDL-85779' of https://github.com/paulholden/moodle

5 days agoMDL-85939 qbank_columnsortorder: improve preview page table alignment.
Paul Holden [Fri, 4 Jul 2025 01:49:38 +0000 (09:49 +0800)]
MDL-85939 qbank_columnsortorder: improve preview page table alignment.

5 days agoMerge branch 'MDL-85196' of https://github.com/paulholden/moodle into main
Mihail Geshoski [Tue, 8 Jul 2025 14:45:20 +0000 (22:45 +0800)]
Merge branch 'MDL-85196' of https://github.com/paulholden/moodle into main

5 days agoMDL-83890 mod_choice: Migrate index to course overview
Laurent David [Mon, 19 May 2025 09:53:09 +0000 (11:53 +0200)]
MDL-83890 mod_choice: Migrate index to course overview

* Index page for mod_choice should be consistent with
the overview page

5 days agoMDL-83890 mod_choice: Migrate to course overview page
Laurent David [Wed, 21 May 2025 05:34:07 +0000 (07:34 +0200)]
MDL-83890 mod_choice: Migrate to course overview page

* Add overview page renderer
* Add phpunit and behat test for new classes

5 days agoMDL-83890 mod_choice: Add manager class
Laurent David [Wed, 21 May 2025 05:30:18 +0000 (07:30 +0200)]
MDL-83890 mod_choice: Add manager class

* Add manager class to the mod_choice to avoid using
queries in output classes

5 days agoMerge branch 'MDL-85069_main' of https://github.com/marxjohnson/moodle into main
Mihail Geshoski [Tue, 8 Jul 2025 14:39:50 +0000 (22:39 +0800)]
Merge branch 'MDL-85069_main' of https://github.com/marxjohnson/moodle into main

5 days agoMerge branch 'MDL-84695-main' of https://github.com/lucaboesch/moodle into main
Mihail Geshoski [Tue, 8 Jul 2025 14:21:54 +0000 (22:21 +0800)]
Merge branch 'MDL-84695-main' of https://github.com/lucaboesch/moodle into main

5 days agoMerge branch 'MDL-85881_main' of https://github.com/marxjohnson/moodle into main
Mihail Geshoski [Tue, 8 Jul 2025 14:16:12 +0000 (22:16 +0800)]
Merge branch 'MDL-85881_main' of https://github.com/marxjohnson/moodle into main

5 days agoMerge branch 'MDL-85659-main' of https://github.com/roland04/moodle
Amaia Anabitarte [Tue, 8 Jul 2025 13:05:02 +0000 (15:05 +0200)]
Merge branch 'MDL-85659-main' of https://github.com/roland04/moodle

5 days agoMDL-84901 auth: specific session start error language string.
Paul Holden [Mon, 17 Mar 2025 18:13:35 +0000 (18:13 +0000)]
MDL-84901 auth: specific session start error language string.

6 days agoMerge branch 'MDL-84976-main' of https://github.com/rjnl/moodle
Huong Nguyen [Tue, 8 Jul 2025 11:13:31 +0000 (18:13 +0700)]
Merge branch 'MDL-84976-main' of https://github.com/rjnl/moodle

6 days agoMerge branch 'MDL-85037' of https://github.com/paulholden/moodle
Huong Nguyen [Tue, 8 Jul 2025 11:08:33 +0000 (18:08 +0700)]
Merge branch 'MDL-85037' of https://github.com/paulholden/moodle

6 days agoMerge branch 'MDL-85947_bump-GHA-ubuntu-24-04' of https://github.com/ziegenberg/moodle
Huong Nguyen [Tue, 8 Jul 2025 10:35:01 +0000 (17:35 +0700)]
Merge branch 'MDL-85947_bump-GHA-ubuntu-24-04' of https://github.com/ziegenberg/moodle

6 days agoMerge branch 'MDL-85654-main' of https://github.com/ferranrecio/moodle
cescobedo [Tue, 8 Jul 2025 09:19:54 +0000 (11:19 +0200)]
Merge branch 'MDL-85654-main' of https://github.com/ferranrecio/moodle

6 days agoMerge branch 'MDL-41924_main' of https://github.com/marxjohnson/moodle into main
Mihail Geshoski [Tue, 8 Jul 2025 09:07:53 +0000 (17:07 +0800)]
Merge branch 'MDL-41924_main' of https://github.com/marxjohnson/moodle into main

6 days agoMerge branch 'MDL-84779-main' of https://github.com/davewoloszyn/moodle
Huong Nguyen [Tue, 8 Jul 2025 08:19:12 +0000 (15:19 +0700)]
Merge branch 'MDL-84779-main' of https://github.com/davewoloszyn/moodle

6 days agoMDL-84255 quiz: Show quiz title in heading in accessrule_seb layout.
Luca Bösch [Wed, 23 Apr 2025 07:26:29 +0000 (09:26 +0200)]
MDL-84255 quiz: Show quiz title in heading in accessrule_seb layout.

6 days agoMDL-84779 core_ai: Convert model settings on upgrade
David Woloszyn [Tue, 8 Jul 2025 05:20:21 +0000 (15:20 +1000)]
MDL-84779 core_ai: Convert model settings on upgrade

6 days agoMDL-85697 mod_lesson: Behat for lesson group and user overrides
andelacruz [Tue, 1 Jul 2025 09:23:06 +0000 (17:23 +0800)]
MDL-85697 mod_lesson: Behat for lesson group and user overrides

6 days agoMDL-85697 mod_assign: Behat for assignment group and user overrides
andelacruz [Tue, 1 Jul 2025 08:10:05 +0000 (16:10 +0800)]
MDL-85697 mod_assign: Behat for assignment group and user overrides

6 days agoMDL-85697 mod_quiz: Behat for quiz group and user overrides
andelacruz [Tue, 24 Jun 2025 09:12:58 +0000 (17:12 +0800)]
MDL-85697 mod_quiz: Behat for quiz group and user overrides

6 days agoMDL-83147 AI: Implement detailed AI error messaging logic
meirzamoodle [Tue, 25 Feb 2025 05:31:19 +0000 (12:31 +0700)]
MDL-83147 AI: Implement detailed AI error messaging logic

6 days agoMDL-83147 AI: Introduce error message handler
meirzamoodle [Tue, 25 Feb 2025 05:31:19 +0000 (12:31 +0700)]
MDL-83147 AI: Introduce error message handler

6 days agoMerge branch 'MDL-83896-main' of https://github.com/roland04/moodle
Amaia Anabitarte [Mon, 7 Jul 2025 14:31:05 +0000 (16:31 +0200)]
Merge branch 'MDL-83896-main' of https://github.com/roland04/moodle

6 days agoMDL-85863 user: Defer new-password email until after transaction commit
yusufwib01 [Thu, 3 Jul 2025 16:32:50 +0000 (23:32 +0700)]
MDL-85863 user: Defer new-password email until after transaction commit

6 days agoMDL-85947 ci: Bump GHA to Ubuntu 24.04
Daniel Ziegenberg [Mon, 7 Jul 2025 13:57:39 +0000 (15:57 +0200)]
MDL-85947 ci: Bump GHA to Ubuntu 24.04

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
6 days agoMDL-84399 repository_nextcloud: Add search support using WebDAV
Dennis Pfahl [Tue, 27 May 2025 18:49:13 +0000 (20:49 +0200)]
MDL-84399 repository_nextcloud: Add search support using WebDAV

Co-authored-by: Lucas Gehrlein <lgehrlein@ssystems.de>
6 days agoMDL-84399 core: add WebDAV SEARCH support to webdavlib
Dennis Pfahl [Tue, 27 May 2025 18:43:54 +0000 (20:43 +0200)]
MDL-84399 core: add WebDAV SEARCH support to webdavlib

Co-authored-by: Lucas Gehrlein <lgehrlein@ssystems.de>
7 days agoMDL-85654 course: purpose categories in activity chooser
ferran [Wed, 4 Jun 2025 14:19:38 +0000 (16:19 +0200)]
MDL-85654 course: purpose categories in activity chooser

7 days agoMDL-85659 theme_boost: Fix editor generated tables styles
Mikel Martín [Thu, 3 Jul 2025 12:59:00 +0000 (14:59 +0200)]
MDL-85659 theme_boost: Fix editor generated tables styles

7 days agoMDL-84779 core_ai: Store individual model settings
David Woloszyn [Wed, 7 May 2025 01:05:57 +0000 (11:05 +1000)]
MDL-84779 core_ai: Store individual model settings

7 days agoMDL-84779 aiprovider_ollama: Configure individual model settings
David Woloszyn [Tue, 29 Apr 2025 02:35:00 +0000 (12:35 +1000)]
MDL-84779 aiprovider_ollama: Configure individual model settings

7 days agoMDL-84779 aiprovider_openai: Configure individual model settings
David Woloszyn [Mon, 28 Apr 2025 04:48:13 +0000 (14:48 +1000)]
MDL-84779 aiprovider_openai: Configure individual model settings

7 days agoMDL-84779 core_ai: Add method for getting model settings keys
David Woloszyn [Mon, 28 Apr 2025 03:16:24 +0000 (13:16 +1000)]
MDL-84779 core_ai: Add method for getting model settings keys

7 days agoMDL-81702 core_message: Add focustrap and backdrop
Laurent David [Mon, 7 Apr 2025 09:21:45 +0000 (11:21 +0200)]
MDL-81702 core_message: Add focustrap and backdrop

* Add focustrap and backdrop to message drawer.

7 days agoMDL-81702 theme_boost: Add focus lock to drawers
Laurent David [Mon, 7 Apr 2025 07:33:42 +0000 (09:33 +0200)]
MDL-81702 theme_boost: Add focus lock to drawers

* Add focus lock to drawers for small screens

7 days agoMDL-81702 theme_boost: Remove site home link from drawers
Laurent David [Mon, 7 Apr 2025 05:19:22 +0000 (07:19 +0200)]
MDL-81702 theme_boost: Remove site home link from drawers

* The site-home-link was added to all menu drawers and should
only be added to the main menu drawer (mobile version)

8 days agoMDL-84695 mod_qbank: More precise get_qbank_ids_of_type_in_course query.
Luca Bösch [Fri, 28 Feb 2025 13:43:18 +0000 (14:43 +0100)]
MDL-84695 mod_qbank: More precise get_qbank_ids_of_type_in_course query.

8 days agoweekly release 5.1dev
Mihail Geshoski [Sun, 6 Jul 2025 01:25:26 +0000 (09:25 +0800)]
weekly release 5.1dev

8 days agoNOBUG: Add upgrade notes
Mihail Geshoski [Sun, 6 Jul 2025 01:25:25 +0000 (09:25 +0800)]
NOBUG: Add upgrade notes

8 days agoMerge branch 'install_main' of https://git.in.moodle.com/amosbot/moodle-install into...
Mihail Geshoski [Sun, 6 Jul 2025 01:25:02 +0000 (09:25 +0800)]
Merge branch 'install_main' of https://git.in.moodle.com/amosbot/moodle-install into main

8 days agoMerge branch 'MDL-85350_main' of https://github.com/PhilippImhof/moodle into main
Mihail Geshoski [Thu, 3 Jul 2025 03:42:18 +0000 (11:42 +0800)]
Merge branch 'MDL-85350_main' of https://github.com/PhilippImhof/moodle into main

8 days agoMerge branch 'MDL-84487_main' of https://github.com/marxjohnson/moodle into main
Mihail Geshoski [Thu, 3 Jul 2025 03:28:10 +0000 (11:28 +0800)]
Merge branch 'MDL-84487_main' of https://github.com/marxjohnson/moodle into main

8 days agoMerge branch 'MDL-85200_main' of https://github.com/marxjohnson/moodle into main
Mihail Geshoski [Thu, 3 Jul 2025 03:21:41 +0000 (11:21 +0800)]
Merge branch 'MDL-85200_main' of https://github.com/marxjohnson/moodle into main

8 days agoMerge branch 'MDL-85563' of https://github.com/NeillM/moodle into main
Mihail Geshoski [Thu, 3 Jul 2025 03:07:24 +0000 (11:07 +0800)]
Merge branch 'MDL-85563' of https://github.com/NeillM/moodle into main

8 days agoMerge branch 'MDL-85210_main' of https://github.com/marxjohnson/moodle into main
Mihail Geshoski [Thu, 3 Jul 2025 02:52:30 +0000 (10:52 +0800)]
Merge branch 'MDL-85210_main' of https://github.com/marxjohnson/moodle into main

8 days agoMerge branch 'MDL-85432-main' of https://github.com/sh-csg/moodle into main
Mihail Geshoski [Thu, 3 Jul 2025 02:25:18 +0000 (10:25 +0800)]
Merge branch 'MDL-85432-main' of https://github.com/sh-csg/moodle into main

10 days agoMDL-85037 block_html: correct access checks for plugin file serving.
Paul Holden [Tue, 1 Apr 2025 13:54:19 +0000 (14:54 +0100)]
MDL-85037 block_html: correct access checks for plugin file serving.

10 days agoMDL-41924 quiz: Annotate questions for backups
Mark Johnson [Fri, 28 Feb 2025 09:59:30 +0000 (09:59 +0000)]
MDL-41924 quiz: Annotate questions for backups

Find question bank entries for all questions referenced by a question
slot, and for all questions matching a question bank referenced used for
a random question, and record their IDs so they can be included in
backups.

10 days agoMDL-41924 backup: Reduce questions included in backups
Mark Johnson [Thu, 13 Feb 2025 09:31:11 +0000 (09:31 +0000)]
MDL-41924 backup: Reduce questions included in backups

Historically, backups of an activity using questions would include all
questions for the entire context, where any question had been used. This
could lead to very large backup files, and exacerbated problems with
question duplication.

This changes the process for annotating categories to include in the
backup to find specific categories, rather than whole contexts. It
includes 3 groups of categories:
1. Those that belong to the backed up activity's context.
2. Those that contain a question used directly in a question_reference
belonging to the activity.
3. Those that contain a question used via a question_set_reference
belonging to the activity.
It also adds in any parent categories that are not included by the
above, so we have a complete hierarchy.

For group 1, the backup will include all questions belonging to these
categories, as before. For groups 2 and 3, it will only include
questions for question bank entries that have been annotated by the
activity.

10 days agoMDL-83896 mod_lesson: Add course overview integration
Mikel Martín [Wed, 28 May 2025 06:53:16 +0000 (08:53 +0200)]
MDL-83896 mod_lesson: Add course overview integration

- Implement course overview integration
- Redirect index.php to course overview

10 days agoMDL-83896 mod_lesson: Add new methods to lesson class
Mikel Martín [Wed, 18 Jun 2025 12:52:40 +0000 (14:52 +0200)]
MDL-83896 mod_lesson: Add new methods to lesson class

Add new methods to the lesson class that will be needed by
the overview page.

11 days agoMerge branch 'MDL-76342-main' of https://github.com/yusufwib01/moodle
Huong Nguyen [Thu, 3 Jul 2025 02:07:20 +0000 (09:07 +0700)]
Merge branch 'MDL-76342-main' of https://github.com/yusufwib01/moodle

11 days agoMerge branch 'MDL-85769-main' of https://github.com/meirzamoodle/moodle
Huong Nguyen [Thu, 3 Jul 2025 02:05:06 +0000 (09:05 +0700)]
Merge branch 'MDL-85769-main' of https://github.com/meirzamoodle/moodle

11 days agoMerge branch 'patch/MDL-85666-main' of https://github.com/skodak/moodle into main
Mihail Geshoski [Thu, 3 Jul 2025 01:56:06 +0000 (09:56 +0800)]
Merge branch 'patch/MDL-85666-main' of https://github.com/skodak/moodle into main

11 days agoMerge branch 'MDL-85725' of https://github.com/paulholden/moodle into main
Mihail Geshoski [Thu, 3 Jul 2025 01:42:53 +0000 (09:42 +0800)]
Merge branch 'MDL-85725' of https://github.com/paulholden/moodle into main

11 days agoMDL-83896 mod_lesson: Add generators for lesson submissions
Mikel Martín [Wed, 18 Jun 2025 12:49:22 +0000 (14:49 +0200)]
MDL-83896 mod_lesson: Add generators for lesson submissions

11 days agoMDL-83896 mod_lesson: Update strings to improve consistency
Mikel Martín [Tue, 17 Jun 2025 14:11:34 +0000 (16:11 +0200)]
MDL-83896 mod_lesson: Update strings to improve consistency

Update how the word ‘attempts’ is used to  make the terminology more consistent
within Lesson and better aligned with how ‘attempts’ is used in other activities.

12 days agoMDL-85069 qbank_bulkmove: Load banks and categories dynamically
Mark Johnson [Mon, 2 Jun 2025 12:49:28 +0000 (13:49 +0100)]
MDL-85069 qbank_bulkmove: Load banks and categories dynamically

The bulk move question dialogue presents 2 autocomplete fields for
selection of the target bank and category to move questions to. This was
loading all banks and categories the user could access, and filtering
categories based on the selected bank.

On large sites, this was not usable as there were too many banks and
categories to load leading to timeouts.

This refactors the dialogue to load just the current bank and cagtegory
initially, then load other options on demand via AJAX.

12 days agoMDL-85069 question: Services for question bank and category search
Mark Johnson [Thu, 29 May 2025 14:09:12 +0000 (15:09 +0100)]
MDL-85069 question: Services for question bank and category search

This updates the core_question_search_shared_banks external function
with additional parameters to make it applicable outside of the "Switch
bank" dialogue in the quiz, with the corresponding changes to the
question_banks_datasource Javascript module, and unit test coverage.

It also adds a new \core_question\output\question_category_selector
class for rendering a select list of question categories, migrating
the logic used in qbank_managecategories to a core namespace. There
is a fragment callback for rendering this via AJAX.

12 days agoMerge branch 'MDL-83891-main' of https://github.com/aanabit/moodle
Amaia Anabitarte [Wed, 2 Jul 2025 06:56:44 +0000 (08:56 +0200)]
Merge branch 'MDL-83891-main' of https://github.com/aanabit/moodle

12 days agoAutomatically generated installer lang files
AMOS bot [Wed, 2 Jul 2025 00:10:02 +0000 (00:10 +0000)]
Automatically generated installer lang files

13 days agoMDL-85721 qtype_numerical: Prevent duplication on restore
Mark Johnson [Thu, 12 Jun 2025 12:37:35 +0000 (13:37 +0100)]
MDL-85721 qtype_numerical: Prevent duplication on restore

If question_numerical record for a question has been deleted, when its
options are loaded its answers will not have a tolerance property. This
can lead to duplication.

Also, older questions may not have a question_numerical_options record.

To avoid this, we use 0 as a default tolerance for all answers if there
is no matching record, and do the same when reading the question
structure from backups. We also generate default values for the rest of
the options.

13 days agoMDL-85721 qtype: Cope with missing options records
Mark Johnson [Thu, 12 Jun 2025 12:32:20 +0000 (13:32 +0100)]
MDL-85721 qtype: Cope with missing options records

If we restore a question (or any other) which has had its
qtype_xxx_options record deleted, we get a notification output when we
try to build the options.

This may be called from an AJAX request (such as when we duplicate a
quiz), and outputting the notification breaks the AJAX response.
Returning false also means we don't get the answers attached to the
questiondata options, so the structure doesn't match the restored data,
and we get duplication.

This emits the errors via debugging instead, which allows it to be
supressed or logged, and allows get_question_options() to continue
running.

13 days agoMDL-85721 qtype_multianswer: Clean up duplicate subquestions
Mark Johnson [Tue, 10 Jun 2025 13:09:30 +0000 (14:09 +0100)]
MDL-85721 qtype_multianswer: Clean up duplicate subquestions

This adds an ad-hoc task to clean up duplicate subquestions created by
the bug.

When the upgrade is run, it will run a query to check if any
subquestions have been duplicated (if there are multiple questions with
the same parent, text and stamp), and queue the cleanup task if there
are.

For each stamp identified, the task will find instances of the question
that are not referred to in their parent's sequence field, confirm that
they have 0 usages, and delete them.

13 days agoMDL-85721 qtype_multichoice: Generate default options on restore
Mark Johnson [Mon, 9 Jun 2025 14:40:21 +0000 (15:40 +0100)]
MDL-85721 qtype_multichoice: Generate default options on restore

qtype_multichoice::get_question_options() will create a default options
object if no qtype_multichoice_options record exists. This means if we
restore a backup containing a multichoice question without any options
(see previous commit), it will always create a duplicate.

This change generates a default set of options for the backupdata if
none exists, so the identity hash will match if the same question exists
in the database without options, and we dont get duplicates.

13 days agoMDL-85721 qtype_multianswer: Don't delete qtype data for subquestions
Mark Johnson [Mon, 9 Jun 2025 14:37:16 +0000 (15:37 +0100)]
MDL-85721 qtype_multianswer: Don't delete qtype data for subquestions

Historically, multianswer would re-use question IDs from subquestions,
so it was necessary to delete qtype-specific data if the qtype changed.
Since versioning was introduced, editing creates new versions of the
qtype and subquestions. Deleting the data means the original versions of
the subquestions cannot function correctly, so we shouldn't do that
anymore.

13 days agoMerge branch 'MDL-84531' of https://github.com/paulholden/moodle
Andrew Nicols [Tue, 1 Jul 2025 09:33:38 +0000 (17:33 +0800)]
Merge branch 'MDL-84531' of https://github.com/paulholden/moodle

13 days agoMDL-85666 phpunit: add general plugin tests
Petr Skoda [Tue, 10 Jun 2025 09:12:27 +0000 (11:12 +0200)]
MDL-85666 phpunit: add general plugin tests

This defines new group which can be used
to limit execution of these tests to one plugin only.

For example to execute all tests for Label module use:

phpunit --testsuite=mod_label_testsuite
phpunit --group=plugin_checks --filter=mod_label

or

phpunit --filter=mod_label

13 days agoMDL-85069 question: Fix return URL parameters after moving questions
Mark Johnson [Thu, 29 May 2025 14:04:13 +0000 (15:04 +0100)]
MDL-85069 question: Fix return URL parameters after moving questions

When calling the core_question_move_questions external function, the
returned $returnurl paramater kept the original `cat`, `category` and
`lastchanged` parameters.

If the question was moved to another question bank, this meant the user
would be redirected to that bank, but the URL would still refer to the
category in the original bank. Opening the bulk move dialogue again
would then show the original bank and category selected by default, not
the current one.

This change ensures the cat parameter is updated to match the new
category, unsets the `category` parameter as it is redundant. If a single
question is moved, "lastchanged" is updated to that question, otherwise
it is unset.

13 days agoMDL-85069 qbank: Add tool_generator callback
Mark Johnson [Thu, 29 May 2025 13:59:07 +0000 (14:59 +0100)]
MDL-85069 qbank: Add tool_generator callback

This adds a callback for tool_generator and the required lang strings to
allow qbanks to be generated as part of test courses, by passing the
--additionalmodules=qbank argument to maketestcourse.php.

2 weeks agoMDL-85563 phpunit: Clock API should always use Moodle system time
Neill Magill [Thu, 22 May 2025 09:17:37 +0000 (10:17 +0100)]
MDL-85563 phpunit: Clock API should always use Moodle system time

When using `clock::now()` the frozen cloxk and incrementing clock will now
always return a `DateTimeImmutable` that uses the configured Moodle system
time. In unit tests this will be Australia/Perth.

Before this change, it would sometimes be UCT.

2 weeks agoMDL-85881 questions: Handle multi-byte names during migration
Mark Johnson [Mon, 30 Jun 2025 10:07:14 +0000 (11:07 +0100)]
MDL-85881 questions: Handle multi-byte names during migration

We were using strlen() instead of core_text::strlen() when checking the
length of a question bank name created during the migration. This meant
that multibyte strings were counted as being too long, even though they
were within the character limit.

2 weeks agoMDL-85880 reportbuilder: replace jQuery usage for parsing Javascript.
Paul Holden [Thu, 5 Jun 2025 20:15:58 +0000 (21:15 +0100)]
MDL-85880 reportbuilder: replace jQuery usage for parsing Javascript.

2 weeks agoMerge branch 'MDL-85533-main-v03' of https://github.com/ferranrecio/moodle
cescobedo [Mon, 30 Jun 2025 07:12:54 +0000 (09:12 +0200)]
Merge branch 'MDL-85533-main-v03' of https://github.com/ferranrecio/moodle

2 weeks agoMDL-85533 course: activity chooser full refactor
ferran [Mon, 19 May 2025 16:17:22 +0000 (18:17 +0200)]
MDL-85533 course: activity chooser full refactor

2 weeks agoMDL-85533 course: remove activitychoosertabmode setting
ferran [Thu, 22 May 2025 14:00:31 +0000 (16:00 +0200)]
MDL-85533 course: remove activitychoosertabmode setting

2 weeks agoMerge branch 'MDL-79319-main' of https://github.com/laurentdavid/moodle
cescobedo [Mon, 30 Jun 2025 06:24:55 +0000 (08:24 +0200)]
Merge branch 'MDL-79319-main' of https://github.com/laurentdavid/moodle

2 weeks agoMDL-85779 block_timeline: fix/restore sort toggle dropdown behaviour.
Paul Holden [Sun, 29 Jun 2025 15:06:09 +0000 (23:06 +0800)]
MDL-85779 block_timeline: fix/restore sort toggle dropdown behaviour.

Changes during Bootstrap upgrade, in conjunction with both 8a8c8ab2 and
0c586b41, caused the layout to deviate from that expected elsewhere for
managing of Bootstrap dropdown elements. Thus the dynamically chosen
item was no longer being shown as selected. Fix that here.