684 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
361dfe8145
MDL-75952 general: Since php81, refection->setAccessible() is no-op
Refereces:
- https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
- https://www.php.net/manual/en/reflectionproperty.setaccessible.php
- https://www.php.net/manual/en/reflectionmethod.setaccessible.php

As of PHP 8.1.0, calling this method has no effect; all methods are
invokable by default. So, let's remove all uses from core, they are
no-op.
2024-03-10 21:15:00 +01:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Stefan Hanauska
a0d501463a MDL-69656 backup: Replace urlencoded pluginfile urls 2024-03-06 07:37:17 +01:00
Sara Arjona
b25d295d3a
Merge branch 'MDL-80553-main' of https://github.com/ferranrecio/moodle 2024-03-04 16:13:11 +01:00
Eloy Lafuente (stronk7)
29a541724f
MDL-65292 style: Fix all the function declaration ordering
This has been generated running the following Sniff,
part of the Moodle's CodeSniffer standard:
- PSR2.Methods.MethodDeclaration

It just ensures all the function declarations have
the correct order for:
- abstract and final.
- visibility (public, protected, private).
- static.

So, all the lines modified by this commit are function declarations
and the only changes are in the positions of those keywords.
2024-02-28 23:47:47 +01:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Alexander Van der Bellen
0aea55c3e6 MDL-79151 backup: Add custom field backup and restore API 2024-02-20 15:28:28 +08:00
Ferran Recio
15eda1d56a MDL-80553 backup: fix section backup step phpunit 2024-01-30 16:30:03 +01:00
Paul Holden
d0cab9a4a0
MDL-79256 customfield: add new valuetrust to data table schema. 2024-01-23 08:18:58 +00:00
Ferran Recio
837dc7e852 MDL-80186 course: adding new fields to delegate sections logic 2023-12-20 12:02:51 +01:00
Paul Holden
0f3e5df4b5 MDL-79797 backup: ensure block config is safely unserialized. 2023-12-06 03:54:20 +01:00
Sara Arjona
9e3acd9f06
MDL-79915 backup: Improve the Restore main page
Júlia, from the PX team, has suggested a few improvements to make it easier to
understand the Restore main page:

- Displaying a notification instead of the empty table when there are no files
in an area.
- Improve the copy, removing the help buttons and moving this information to the
main page.
- Replacing "Import a backup file" with "Upload a backup file".
- Adding some space between the different areas.
- Displaying a different text in the different "Manage backup files" buttons.
2023-11-29 09:19:46 +01: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
Tomo Tsuyuki
d8a4cc9533 MDL-67186 group: add custom fields 2023-08-09 11:02:49 +10:00
Damian Hippisley
faa41cd791 MDL-73325 core_badges: Add tags field to BadgeClass 2023-06-09 13:41:07 +01:00
Andrew Nicols
9f5d56b7c3
Merge branch 'MDL-75696_master' of https://github.com/marxjohnson/moodle 2023-06-08 12:30:49 +08:00
Mark Johnson
b6b48be55d MDL-75696 backup: Fix backup version checks
Several version checks were incorrectly using
restore_controller::info::moodle_release instead of moodle_version as a
version number. This replaces all of those checks with a common pair of
methods to make the checks clearer and more maintainable.
2023-05-18 15:53:35 +01:00
Ilya Tregubov
38230b57e4
Merge branch 'MDL-77840-master' of https://github.com/davewoloszyn/moodle 2023-05-16 09:46:05 +08:00
Ilya Tregubov
954e523be8
Merge branch 'MDL-75623-master' of https://github.com/sh-csg/moodle 2023-05-10 11:42:56 +08:00
David Woloszyn
e364489007 MDL-77840 backup: Avoid passing nulls to base64_encode 2023-05-02 13:46:41 +10:00
Anupama Sarjoshi
55dffbe6cb MDL-77987 Backup: add progress tracking to some slow steps 2023-04-24 11:09:21 +01:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Paul Holden
1f6722e696
Merge branch 'MDL-77254-master' of https://github.com/sarjona/moodle 2023-04-04 17:36:51 +01:00
Sara Arjona
1996a7cfbf MDL-77254 backup: Backup/restore xAPI state 2023-04-04 17:23:43 +02:00
Meirza
8a5485a714 MDL-77338 backup: Added class properties that are not declared.
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-04-03 22:39:39 +07:00
Stefan Hanauska
93a9baadf8 MDL-75623 backup: Encode pluginfile URLs 2023-04-01 09:09:43 +02:00
Mark Johnson
958da5b67e MDL-68093 groups: Add visibility and participation settings
These new settings are designed to enchance user privacy surrounding
groups. They allow groups to be configured so that users outside the
group cannot see the group, so that users in the group cannot see each
other, or so that users cannot see the group at all, even if they are in
it. This avoids issues where a group may be assigned based on sensitive
personal information (such as a person requiring special arrangements
due to a disability).

By default, groups are visible to all and available for participation in
activities, which maintains the current behaviour.

For performance, a new cache has been added to track the number of
groups on a course that are not visible to non-members. This allows us
to revert to the existing behaviour if the new features are not being
used at all on a course, and only apply the new visibility conditions if
they are.

Users who have the moodle/course:viewhiddengroups capability should be
concious of exposing hidden groups when showing their screen to other
users. The "Switch role to..." feature can be used to show a course page
on screen without exposing private availability conditions, for example.

The changes cover several specific areas:
* grouplib functions, which most code should use to get lists of groups
  and members (this includes the participants page).
* Activities supporting group overrides will not allow overrides for
  groups that are hidden from all users.
* Activities supporting separate/visible groups modes will only allow
  groups with the new "participation" flag enabled to be selected.
* Group messaging will be disabled for groups where members cannot see
  each other, or cannot see the group at all.
2023-03-14 08:52:25 +00:00
Andrew Nicols
5ae44ff9d3 Merge branch 'MDL-77467' of https://github.com/timhunt/moodle 2023-03-09 10:46:36 +08:00
Tim Hunt
497c527e98 MDL-77467 retore: add progress tracking to potentially slow steps 2023-03-02 15:36:28 +00:00
Jun Pataleta
6802f6b7f4 Merge branch 'MDL-76938_restore_comments' of https://github.com/davosmith/moodle 2023-03-02 08:42:15 +08:00
Tim Hunt
1ee7f41762 MDL-76897 quiz: streamline initalisation of $quiz, $cm, $course 2023-02-27 18:41:55 +00:00
Ilya Tregubov
414d3cdd5f Merge branch 'MDL-68347-master-2' of https://github.com/marinaglancy/moodle 2023-02-21 10:06:39 +08:00
Marina Glancy
c184b2d284 MDL-68347 course: trigger event if user was created during restore 2023-02-20 10:20:00 +00:00
Tomo Tsuyuki
9e725bc168 MDL-45301 assign: Add font options for EditPDF 2023-02-17 15:30:25 +11:00
Jonathon Fowler
d9bc9af91a MDL-74698 backup: correctly restore course format options
Old-version backups (< 3.11.7, < 4.0.1) lose their course-level format
options when restoring into newer versions after the backup structure
was changed.

Also, course-level format options were not accurately restored against
the appropriate format type. And section-level format options were
redundantly stored at course-level and restored without mapping their
sectionids, thus creating lint.
2023-02-03 10:17:05 +10:00
Davo Smith
b395c3f63b MDL-76938 backup: fix restore of comments linked to a course format 2023-01-26 12:31:13 +00:00
Marina Glancy
b0a83aa7bd MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:15:54 +08:00
Tim Hunt
a9f8547599 MDL-76614 quiz: rename quiz => mod_quiz\quiz_settings 2023-01-06 14:35:54 +00:00
Tim Hunt
5682c8c70e MDL-76614 quiz: move class quiz_attempt => mod_quiz\quiz_attempt
I thought about renaming the class to just plain attempt, but I
acutally think quiz_attempt makes it clearer what this is. Also
not changing the name massively reduces the pain for everyone
updating their code (including me right now!)
2023-01-06 14:35:51 +00:00
Thong Bui
79d1b45ba7 MDL-76193 Questions: Backup and Restore with tags fails 2022-12-05 10:00:37 +07:00
Frédéric Massart
3345519b48 MDL-74201 backup: Restore reference to content bank files 2022-11-08 20:13:14 +01:00
Ilya Tregubov
057f732bf1 Merge branch 'MDL-58266-master' of https://github.com/JBThong/moodle 2022-10-17 12:51:59 +03:00
Matthew Hilton
cfb643293c MDL-56567 competency: Course module competency option to override grade
Previously, if a course module had already been graded, course module
completion linked to the course module would not update. This
commit adds the option to enable overriding the grade at the course
module competency level.

This ensures that if enabled and a user completes a module associated
with a competency, that competency will be graded appropriately.
2022-10-17 08:00:20 +10:00
hieuvu
c6e018e04e MDL-58266 core_completion: Add new view table. 2022-10-14 00:30:28 +07:00
Dan Marsden
ddcd4de74d MDL-75668 backup: Save context mapping of duplicate blocks. 2022-09-07 12:38:56 +12:00
Tim Hunt
8babdbd396 MDL-74608 activities: a new option to force the activity language
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.

The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
2022-08-15 22:15:52 +01:00
Eloy Lafuente (stronk7)
9f53b0e965 MDL-73971 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- Some fixtures, initially defined in the test files have been
  moved to new files in fixtures subdirectory, leaving the unit
  test files clearer:
  - moodle2_course_format_test.php
- Rename wrong named test:
  - baseoptiogroup_test = baseoptigroup_test
2022-05-06 18:29:11 +02:00
Jason den Dulk
ba53ec733a MDL-65478 backup, course format: Handle editor elements in course format
Modified course format options reading and writing to be able to handle Editor elements by enabling them to split array values into
multiple values before inserting into database, and combining multiple values into an array when reading from the database.
Modified backup and restore code to use backup_nested_elements, and to interact directly with the database.

Co-authored-by: Jason den Dulk <jasondendulk@catalyst-au.net>
Co-authored-by: Matthew Hilton <matthewhilton@catalyst-au.net>
2022-05-03 14:23:37 +10:00
Andrew Nicols
4b388fc239 MDL-74235 core: Update core uses of activity icons to monologo 2022-04-07 12:56:14 +08:00