3249 Commits

Author SHA1 Message Date
Jun Pataleta
f679e7d07a
MDL-85186 backup: Bump release to 5.1 2025-04-13 18:31:09 +08:00
Jun Pataleta
f933606dec
NOBUG: Add upgrade notes 2025-04-13 09:54:13 +08:00
Huong Nguyen
7ac32003f7 NOBUG: Add upgrade notes 2025-04-11 22:03:06 +07:00
Jun Pataleta
91d2fa1ecb
MDL-85147 versions: Bump all versions and requires near release 2025-04-09 17:46:57 +08:00
Sara Arjona
6c326dd2de
NOBUG: Add upgrade notes 2025-04-08 17:06:38 +02:00
Huong Nguyen
8bcbf6e216 NOBUG: Add upgrade notes 2025-04-04 22:21:55 +07:00
Jun Pataleta
245d335ce2
Merge branch 'MDL-84907-main' of https://github.com/HuongNV13/moodle 2025-04-04 11:29:00 +08:00
Sara Arjona
bfe86e8fe6
NOBUG: Add upgrade notes 2025-04-01 16:35:07 +02:00
Huong Nguyen
4a31bf5628 Merge branch 'mdl-83479-restore-hooks' of https://github.com/jaypha/moodle 2025-04-01 09:51:51 +07:00
Mark Johnson
2841c53c7c
MDL-68806 backup: Fix faulty question attempt step restore test
Previously, the test was passing by fluke because all question attempt
steps had the same timecreated date. However, the $originaliterator only
contained the first step of the question, not all 3 attempts that were
being backed up and restored. This means we were comparing the
timecreated of the first backed-up step with the timecreated on the
third restored step. As of MDL-68806, the first step's timecreated is
question_attempt_step::TIMECREATED_ON_FIRST_RENDER, which shows up this
error.

This change gets the question_usage_by_activity object back from the
attempt object which contains all the attempt steps, rather than using
the one created in the test, which doesn't.
2025-03-28 09:34:59 +00:00
Mark Johnson
0ffcd115c6
MDL-68806 quiz: Add new "Not started" and "Submitted" states 2025-03-28 09:34:10 +00:00
Andrew Nicols
c8e4bbe938
Merge branch 'MDL-84555-main' of https://github.com/ferranrecio/moodle 2025-03-25 10:41:50 +08:00
ferran
ae22dea084 MDL-84555 backup: add activity_icons to the restore summary 2025-03-24 16:49:53 +01:00
Huong Nguyen
3bbc1af5bc Merge branch 'MDL-83499-main' of https://github.com/laurentdavid/moodle 2025-03-19 09:46:01 +07:00
Huong Nguyen
d3eef51ef7 MDL-84907 backup: Fix invalid CTRL characters regex 2025-03-19 09:22:36 +07:00
Jun Pataleta
56183c786e Merge branch 'MDL-81714_main' of https://github.com/marxjohnson/moodle 2025-03-18 12:57:55 +08:00
Mark Johnson
b746bcd186
MDL-81714 grades: Make large regrades asynchronous
Currently, large courses can take a long time to perform a full regrade.
This is currently handled with a progress bar to prevent frontend
timeouts while the regrade takes place. However, because it can take so
long a teacher may not want to wait with the page open for several
minutes, particularly if they are performing several operations that
trigger a regrade.

This adds a new async flag to grade_regrade_final_grades which is true
by default. Instead of performing the regrade immediately, this queues
an instance of \core\task\regrade_final_grades for the course, which
will be executed in the background.

It is advisable to always leave the async flag set true, except in the
following scenarios:
- Automated tests.
- The regrade_final_grades task which actually wants to do the
calculations immediately.
- When you have performed a check to determine that the regrade process
is unlikely to take a long time, for example there are only a small
number of grade items.
2025-03-14 16:01:04 +00:00
Huong Nguyen
d84b9f6fed Merge branch 'MDL-83541-main' of https://github.com/HuongNV13/moodle 2025-03-14 11:59:17 +07:00
Mark Johnson
c6f329808c MDL-83541 question/quiz: restoring questions with identical stamps
Historically it was possible, through a series of question restores,
moves and edits, to end up with multiple questions in the same
category with the same stamp, but differences in other question
or answer fields. This, combined with changes in versions, led
to errors when restoring or duplicating quizzes using these questions.

While recent changes have made it impossible to create this situation
in current Moodle versions, as any edits will create a new question
version with a new stamp, this situation may exist on long-standing
Moodle sites which have been upgraded since pre-4.0.

This change performs a much wider-ranging comparison of restored
existing questions, generating a hash of all the data for a question in
a backup file, and a corresponding hash for each question in the target
category, to decide if a restored question matches a question already in
the database.
2025-03-14 10:10:18 +07:00
Andrew Nicols
038eca190f
Merge branch 'MDL-84728_main' of https://github.com/marxjohnson/moodle 2025-03-11 22:43:51 +08:00
Mark Johnson
443bb137f7
MDL-84728 question: Map set references to original categories on restore
The restore process assumes all categories in the backup need restoring,
then sorts out which ones to keep later.

This caused issues with restoring set references that used categories
from a shared question bank, since the reference was updated to point to
a copy of the original category, which then got removed as it wasn't
needed.

This change checks whether we should keep the set reference pointing at
the original category, which it will unless:
- We are restoring to a different site (so the original category will
not exist)
- The context the original category belonged to no longer exists.
- The original category itself no longer exists
- The original category belonged to the same context as the original set
reference (in which case we are restoring a whole module, including a
copy of the category)
- We do not have permission to access questions in the original context.
If any of these are true, we should be keeping the restored copy of the
category, and the filter condition should point to it instead.
2025-03-11 14:28:25 +00:00
Sara Arjona
328b325fbc
MDL-84416 backup: Add backup_import_badges setting
While MDL-43938 introduced badge importing, two tasks were left incomplete.

1) Creating the backup_import_badges setting for default import behaviour.
2) Preventing the inclusion of badges during activity duplication.

This commit implements them.
2025-03-10 08:16:36 +01:00
Sara Arjona
4c2d8b0205
NOBUG: Add upgrade notes 2025-03-04 16:14:27 +01:00
Laurent David
91ea7e05e4 MDL-83499 core_courseformat: Fix section duplication
* When we duplicate a section with multiple subsections it
should increment the sectionum accordingly.
2025-03-04 09:07:09 +01:00
Jun Pataleta
7c86fa258a
Merge branch 'MDL-84267' of https://github.com/paulholden/moodle 2025-03-04 12:18:13 +08:00
Huong Nguyen
fd979ca30e Merge branch 'MDL-81759-main' of https://github.com/sarjona/moodle 2025-02-19 16:42:54 +07:00
Amaia Anabitarte
e29e633e16 MDL-75669 course_backup: Fixing behat issue 2025-02-17 08:13:48 +01:00
Mikel Martín
04975cd2b2 MDL-75669 theme_boost: Refactor custom form elements to BS5
- .custom-check is now .form-check.
- .custom-check.custom-switch is now .form-check.form-switch.
- .custom-select is now .form-select.
- .custom-file and .form-file have been replaced by custom styles on top of .form-control.
- .custom-range is now .form-range.
- Dropped .input-group-append and .input-group-prepend. You can now just add buttons
  and .input-group-text as direct children of the input groups.
2025-02-14 10:58:36 +01:00
Mikel Martín
5416483611 MDL-75669 theme_boost: Refactor BS5 data attributes
Data attributes for all Bootstrap5 JavaScript plugins are now namespaced
to help distinguish Bootstrap functionality from third parties and your own code.
For example, data-bs-toggle instead of data-toggle.
This commit refactor all old Bootstrap data-attributes to the new syntax.

Co-authored-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2025-02-14 09:10:33 +01:00
Jason Den Dulk
c4335a8e0e MDL-83479 backup: Added upgrade notes.
Also some small tweaks to address comments.
2025-02-13 12:39:11 +11:00
Jason Den Dulk
7eb9cd0e8b MDL-83479 backup: Add hooks to restore process.
- Place hooks inside backup/util/ui/classes/hooks, to be consistent with
other autoloaded classes.
2025-02-13 11:41:45 +11:00
Jason Den Dulk
a5de02a54c MDL-83479 backup: Add hooks to restore process.
- A hook to enable plugins to add extra settings to the restore task.
  This would be placed inside restore_root_task::define_settings()
- A hook to enable plugins to add extra fields to the copy course form. This would be done inside the copy_form class.
- An adjustment to add the restore plan settings to the course restored event data.
  This would be done inside restore_plan::execute().
- A hook to enable extra work inside the asynchronous copy task. To be placed inside asynchronous_copy_task::execute().
2025-02-13 11:41:45 +11:00
Brandon
3cfd1251fe
MDL-81759 backup: Change import page layout 2025-02-10 09:54:19 +01:00
Jun Pataleta
1fbe085b1a
Merge branch 'mdl-83695_main' of https://github.com/james-cnz/moodle 2025-02-05 18:05:40 +01:00
james-cnz
d7054236c4 MDL-83695 backup: Add space before course Restores in progress heading 2025-02-05 00:19:13 +13:00
Sara Arjona
a16934d66b
MDL-83909 core_badges: Remove author name, email and url fields
The fields imageauthorname, imageauthoremail, and imageauthorurl have
been removed from badges due to confusion and their absence from the
official specification. These fields also do not appear in OBv3.0.

Additionally, the image_author_json.php file has been removed as it
is no longer needed.
2025-01-31 15:28:30 +01:00
Sara Arjona
ff0e03ff56
Merge branch 'MDL-84264-main' of https://github.com/pmaneggia/moodle 2025-01-29 16:52:52 +01:00
Daniel Ziegenberg
1b8b1505e5
MDL-73700 backup: remove old PHP version check
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely remove this check.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2025-01-28 18:58:07 +01:00
Daniel Ziegenberg
161cf71a48
MDL-73700 backup: remove old PHP version check
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely switch to php_serialize as the serialize
handler.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2025-01-28 18:58:01 +01:00
Paul Holden
a2e8872367
MDL-84267 mod_data: deprecate unused comment related capabilities.
They were replaced with core comment API in, and have been unused
since, both 43110739 & e998effa.
2025-01-21 10:49:50 +00:00
Paola Maneggia
cb1c36f8b1 MDL-84264 backup: encode and decode urls for the new course section page 2025-01-20 18:49:42 +01:00
Huong Nguyen
e33a3f8bee
Merge branch 'MDL-84037_main' of https://github.com/marxjohnson/moodle 2024-12-24 15:22:47 +07:00
Mark Johnson
89b061a702
MDL-84037 quiz: Fix restore of shared questions
When a quiz that used shared questions was being restored without the
qbank the questions came from, if the qbank still existed on the target
site, the restored questions were being left in a category in an invalid
course context.

This changes the process so that if the original qbank does exist and
the user can access to it, we will find any references to the restored
copies of questions from that qbank, switch them to refer back to the
original qbank, then delete the category they were restored to from the
course context.

If the user does not have access to the qbank, a new one will be created
in the target course and the questions moved there, just as if the
original qbank did not exist.
2024-12-20 12:10:29 +00:00
Huong Nguyen
7befed22d0
Merge branch 'versionbump' of https://github.com/junpataleta/moodle 2024-12-19 10:03:51 +07:00
Jun Pataleta
1ff50ac088
NOBUG: Bump versions for main to the current date 2024-12-18 23:53:12 +08:00
Sara Arjona
65a4277f85
Merge branch 'MDL-83336-main' of https://github.com/andrewnicols/moodle 2024-12-17 10:54:29 +01:00
Sara Arjona
1420e2fb5d
Merge branch 'MDL-82457-main' of https://github.com/laurentdavid/moodle 2024-12-11 08:57:09 +01:00
Jun Pataleta
4929d6c3d1
Merge branch 'MDL-81520-main' of https://github.com/andrewnicols/moodle 2024-12-11 13:41:15 +08:00
Andrew Nicols
c2414e5a45
MDL-81520 core: Fix test finality 2024-12-11 12:30:23 +08:00
Mikel Martín
a973ea46d7 MDL-81825 core: Replace sr_text() with visually_hidden_text()
In core renderer, replace 'sr_text' method with 'visually_hidden_text' to be
consistent with Bootstrap 5 upgrade.
2024-12-10 14:02:34 +01:00