Compare commits

...

1052 Commits

Author SHA1 Message Date
Huong Nguyen b5f4e0ce3d Moodle release 4.0.12 2023-12-08 09:21:28 +07:00
Sara Arjona 182db0699f weekly release 4.0.11+ 2023-12-07 16:22:18 +01:00
Paul Holden fd464742ea MDL-79980 mod_survey: remove responses link if user cannot access. 2023-12-07 12:09:39 +01:00
Brendan Heywood ccadbc0893 MDL-80309 tasks: Clean up mtrace logs 2023-12-07 12:07:35 +08:00
Paul Holden 85493f06d2 MDL-79980 mod_survey: respect activity group mode getting report. 2023-12-07 09:31:26 +08:00
Stephan Robotta 3bae360d11 MDL-41465 reports: In separate group mode, limit to same group users 2023-12-06 13:49:02 +07:00
Paul Holden c5f290abb9 MDL-79797 backup: ensure block config is safely unserialized. 2023-12-06 13:24:21 +07:00
Huong Nguyen e5b51a2e4b MDL-79759 repository_url: Remove types properties 2023-12-05 08:45:51 +07:00
David Woloszyn ea8fa7e8ac MDL-79759 repository_url: Limit css imports and remove fragments
There are checks to urls that attempt to limit recurrsion when
parse_file is called. This is problematic for css import urls that
can call an indefinite amount of nested import urls. An import limit
has been introduced to address this. Fragments have also been removed.
2023-12-04 15:08:34 +07:00
Stevani Andolo fae835d215 MDL-80174 tool_log: ensure "other" data is safely unserialized. 2023-12-04 13:41:16 +07:00
Paul Holden e72871579a MDL-80268 badges: require capability to view awarded badges. 2023-12-04 10:15:32 +07:00
Ilya Tregubov 55be12a221 weekly release 4.0.11+ 2023-12-01 13:12:42 +08:00
Sara Arjona d254764656 Merge branch 'MDL-79275-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-11-29 16:44:27 +01:00
Ilya Tregubov 1b9891dff5 Merge branch 'MDL-79603-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-11-28 13:54:42 +08:00
Simey Lameze 0761f9e45d MDL-79275 behat: add one second wait to avoid random 2023-11-28 11:07:30 +08:00
Huong Nguyen d0f1ebd072 weekly release 4.0.11+ 2023-11-24 12:23:44 +07:00
Huong Nguyen 9aba7d704e Merge branch 'MDL-78496-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-11-23 09:24:06 +07:00
Sara Arjona d7685d56d3 weekly release 4.0.11+ 2023-11-16 16:22:54 +01:00
Sara Arjona 0976bde187 Merge branch 'MDL-79981-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-11-15 17:10:36 +01:00
Angelia Dela Cruz 859051c304 MDL-79603 mod_scorm: Behat coverage for Scorm package display options 2023-11-15 11:28:28 +08:00
Andrew Nicols 769cdff139 MDL-78496 environment: Moodle 4.4 requirements
The only changes to requirements since Moodle 4.3 are increases to:

* the minimum PHP version required; and
* the minimum required Moodle version.
2023-11-14 22:48:04 +08:00
Ilya Tregubov 6ffde95a56 weekly release 4.0.11+ 2023-11-10 09:17:29 +08:00
Ilya Tregubov bf167fd4f0 Merge branch 'MDL-80029-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-11-09 09:36:24 +08:00
Andrew Nicols a0acf2b8e5 MDL-79981 core: Add ability to manually run and filter phpunit on GHA 2023-11-08 12:54:12 +08:00
Jun Pataleta 51340445df MDL-80029 grade: Behat test fixes
* Feature: We can use a minimum grade different than zero
  - Use correct minimum input values.
  - Use data generators for faster test execution.
* Scenario: Disable category overriding
  - Use the field name to ensure that the correct field is being tested.

Cherry-picked from MDL-79062.
2023-11-07 20:46:14 +08:00
Jun Pataleta db759e7126 weekly release 4.0.11+ 2023-10-27 09:43:17 +08:00
Jun Pataleta 2728b6d4e4 Merge branch 'MDL-79768-400-fix' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-10-26 23:05:21 +08:00
Angelia Dela Cruz bec4ef8a13 MDL-79768 fix: Fixed random failing Behat due to time difference 2023-10-26 17:39:15 +08:00
Jun Pataleta 285ddabc19 Merge branch 'MDL-79768-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-10-26 10:46:59 +08:00
Angelia Dela Cruz afe29e3665 MDL-79768 mod_data: Test for student can see upcoming data activity 2023-10-23 08:44:52 +08:00
Sara Arjona d0c3bf9897 weekly release 4.0.11+ 2023-10-20 12:16:39 +02:00
Huong Nguyen a6ccf907bc Merge branch 'MDL-79689-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-10-19 10:06:00 +07:00
Angelia Dela Cruz eaad28749f MDL-79689 mod_assign: Behat for enabling anonymous submissions 2023-10-18 11:06:14 +08:00
Ilya Tregubov 53f4d3e1d5 Merge branch 'MDL-79691-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-10-17 10:29:31 +08:00
Angelia Dela Cruz 62d17a7ab3 MDL-79691 mod_h5pactivity: Behat coverage for H5P activity grades reset 2023-10-16 17:18:55 +08:00
Huong Nguyen c2b7d5cfca Merge branch 'MDL-79698-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-10-16 11:40:58 +07:00
Huong Nguyen 2ba7c8797b Merge branch 'MDL-79653-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-10-16 10:55:46 +07:00
Andrew Nicols 86c984c612 MDL-79698 core: Correct duplicate array key in test provider 2023-10-13 15:44:40 +08:00
Ilya Tregubov d5f45b29e3 weekly release 4.0.11+ 2023-10-13 13:39:38 +08:00
Angelia Dela Cruz 44bee8c4cf MDL-79653 gradingform_guide: Behat coverage for deleting marking guide 2023-10-13 11:23:52 +08:00
Huong Nguyen b4d7cc89ba Merge branch 'MDL-79638-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-10-12 11:08:42 +07:00
Andrew Nicols 6ce2eab547 MDL-79638 phpunit: Add unit test for increment resets 2023-10-11 00:10:33 +08:00
Andrew Nicols a941d93de1 MDL-79638 phpunit: Adjust version checks for mysql/mariadb hack
This hack was introduced to work around a bug in MySQL 5.6.14 and
MariaDB at the time.

https://bugs.mysql.com/bug.php?id=69882

It was addressed a few months later in 5.6.16, and 5.7.4.
MariaDB merged version 5.6.16 of MySQL's InnoDB engine in MariaDB
10.0.11 and got the patch from there.

Moodle has required MySQL 5.7, and MariaDB 10.2.29 since Moodle 3.11 and
it is therefore safe to remove these hacks for these versions.
2023-10-11 00:01:27 +08:00
Jun Pataleta b72ce02928 Moodle release 4.0.11 2023-10-07 11:29:58 +08:00
Sara Arjona bec75acf94 weekly release 4.0.10+ 2023-10-06 14:02:34 +02:00
Laurent David a58f091184 MDL-77795 mod_bigbluebuttonbn: Change meetingID on duplicate
* We need to set a different meetingID when duplicating or importing a
BigBlueButtonBN activity to prevent unwanted sharing of recordings between
meetings.
2023-10-06 08:49:29 +08:00
Paul Holden 21cb1ae77a MDL-79310 enrol: restrict searched users to those user can view. 2023-10-04 14:31:52 +08:00
Paul Holden c78948fe55 MDL-79310 forumreport_summary: report only on users who can be viewed. 2023-10-04 14:31:52 +08:00
Paul Holden c64f39d187 MDL-79310 mod_forum: ensure only visible users can be exported. 2023-10-04 14:31:51 +08:00
Mikel Martín 4777e96a28 MDL-79509 mod_wiki: Improve comment editing 2023-10-04 02:05:15 +02:00
Paul Holden ce38fda651 MDL-72249 message: stricter cleaning of processor type parameter. 2023-10-04 02:05:15 +02:00
Paul Holden 42fb4b1a6c MDL-79426 gradeimport_csv: safely preview CSV content during import. 2023-10-04 02:05:15 +02:00
Paul Holden 96223014bd MDL-79455 tool_uploadcourse: clean course data fields individually. 2023-10-04 02:05:15 +02:00
Paul Holden 5975ced7e1 MDL-79455 tool_uploadcourse: safe preview of uploaded course data. 2023-10-04 02:05:15 +02:00
Paul Holden c1663de71e MDL-79409 mod_imscp: appropriate unserialization of package structure. 2023-10-04 02:05:15 +02:00
Paul Holden de05fca77a MDL-79408 mod_lesson: safer unserializing/comparison of properties. 2023-10-04 02:05:15 +02:00
David Woloszyn 42518c7c4a MDL-77846 core: Make endpoint revision number checks stricter
In some places we prevented cache poisoning, in others we did not. We
also did not place any restriction on the minimum value for a revision.

This change introduces a new set of functions for configonly endpoints
which validates the revision numbers passed in. If the revision is
either too old, or too new, it is rejected and the file content is not
cached. The content is still served, but caching headers are not sent,
and any local storage caching is prevented.

The current time is used as the maximum version, with 60 seconds added
to allow for any clock skew between cluster nodes. Previously some
locations used one hour, but there should never be such a large clock
skew on a correctly configured system.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-10-04 02:05:15 +02:00
Huong Nguyen 5316b55716 MDL-66730 core_course: Improve permission check for category moving
Co-authored-by: Erica Bithell <egb10@cam.ac.uk>
2023-10-04 02:05:15 +02:00
Paul Holden 1ae0262730 MDL-78820 h5p: use fullname of current user as the xAPI actor name. 2023-10-04 02:05:15 +02:00
meirzamoodle f0c3a4ae7c MDL-78969 oauth2: remove auto-login after successful confirmation
With the new flow, users can go to the login page from the confirmed page,
and if the user successfully logs in, the user will be directed to the confirmed page.
To avoid that, the confirmed page can only be seen by users who are not logged in.
2023-10-04 02:05:15 +02:00
Paul Holden 1139407107 MDL-78971 quiz_grading: escape user identity fields on display. 2023-10-04 02:05:15 +02:00
Jun Pataleta 92b81af0a0 weekly release 4.0.10+ 2023-10-04 07:49:22 +08:00
Huong Nguyen 3dc44686bc Merge branch 'MDL-79247_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-10-03 09:58:25 +07:00
Eloy Lafuente (stronk7) 7db3ed235b MDL-79247 forum: Workaround same-time discussion modified dates bug
Within the forum_get_discussion_neighbours() function of forum
when the discussions timemodified (last post) is the same, there
is a bug that does strange things when calculating the prev and
next discussions.

Note that, in real life, this is really hard to achieve, but in tests,
when multiple discussions and post can be created by generators in the
same second (specially when the test machine is quick), chances of
facing that problem are higher.

By adding 1 second wait, we ensure that the discussions won't have
the same timemodified (last post) and workaround the problem.

No mater of that, the problem deserves an issue to be created
so we guarantee from code that it also works ok when the same
timemodified (last post) situation happens.
2023-10-01 23:47:02 +02:00
Eloy Lafuente (stronk7) c0587ac3a4 MDL-79247 forum: Make discussion list ordering deterministic
Note that normally this doesn't matter much, but there are situations
when we want the discussion list ordering fully consistent /
deterministic.

Specifically, when discussions (or forum posts )are created in the
same second, or when the discussion titles are repeated, or 2
discussions have the same number of votes... (any criteria in general),
in the context of testing, we don't want the order
to be non-consistent, so we need to provide an extra sorting
criterion to make it fully deterministic.

So, in this case, we are adding a sort by discussion.id <<DIRECTION>>
that is an unique value, primary key... so cheap to calculate and,
that way, when the 1st sorting column has repeated values, the id
will decide.
2023-10-01 23:47:02 +02:00
Jun Pataleta 0f8e3e7b88 weekly release 4.0.10+ 2023-09-29 22:07:26 +08:00
Jun Pataleta 43d08df446 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-09-29 22:07:24 +08:00
AMOS bot 32e72da2aa Automatically generated installer lang files 2023-09-29 00:08:01 +00:00
Ilya Tregubov 55430e7995 Merge branch 'MDL-79360/400' of https://github.com/skodak/moodle into MOODLE_400_STABLE 2023-09-28 09:38:59 +08:00
Sara Arjona a55231cec8 weekly release 4.0.10+ 2023-09-26 16:17:09 +02:00
Shamim Rezaie af6368c392 Merge branch 'MDL-75928-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-09-25 17:52:35 +10:00
Simey Lameze 7a9b169ec3 MDL-75928 format_week: improve get_section_dates one week calc 2023-09-22 08:48:47 +08:00
Sara Arjona 168b8d84da weekly release 4.0.10+ 2023-09-15 17:34:16 +02:00
Petr Skoda 25bc96c1c1 MDL-79360 filter: fix nolink tag regression from MDL-77525 2023-09-15 12:45:31 +02:00
Ilya Tregubov 12fc97c1b7 Merge branch 'MDL-79220-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-09-14 17:44:18 +08:00
Ilya Tregubov 660a6b1172 Merge branch 'MDL-79195-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-09-14 09:38:25 +08:00
Ilya Tregubov 46ddf24625 Merge branch 'MDL-78806-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-09-13 10:56:10 +08:00
Eloy Lafuente (stronk7) 548b78ea84 weekly release 4.0.10+ 2023-09-12 18:54:12 +02:00
Angelia Dela Cruz f2eaea0ac3 MDL-79195 core_course: Activity and resource description display behat 2023-09-12 12:38:36 +08:00
Huong Nguyen 6c0eb76077 Merge branch 'MDL-79246-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-09-12 08:51:48 +07:00
Jun Pataleta b82333dfd5 MDL-78806 mod_assign: Use new Behat step for checking page title 2023-09-10 23:33:44 +08:00
Jun Pataleta 21feaf77ba MDL-78806 behat: Create a step that for checking the page title
Create a Behat step "the page title should contain ':title'" to check
the page title.
2023-09-10 23:33:43 +08:00
Jun Pataleta d011da5803 weekly release 4.0.10+ 2023-09-08 22:35:19 +08:00
Jun Pataleta 05b96be8d6 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-09-08 22:35:18 +08:00
Jun Pataleta ade72f1cb2 MDL-78549 multianswer: Prevent default when clicking feedback trigger 2023-09-08 14:50:44 +08:00
Huong Nguyen 0832e78ba9 Merge branch 'MDL-78549-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-09-08 10:59:06 +07:00
AMOS bot ccc82fc95a Automatically generated installer lang files 2023-09-08 00:10:42 +00:00
Angelia Dela Cruz 48c594202a MDL-79220 mod_glossary: Behat for glossary entry with attachment 2023-09-07 10:31:16 +08:00
Ilya Tregubov 0add4b7a6f Merge branch 'MDL-76459_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-09-06 10:03:42 +08:00
AMOS bot 1d92692ad4 Automatically generated installer lang files 2023-09-05 14:25:06 +00:00
Jun Pataleta d70101e521 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:36:16 +08:00
AMOS bot b78c185e31 Automatically generated installer lang files 2023-09-05 00:11:46 +00:00
Andrew Nicols 2576867e7a MDL-79246 gradingform_rubric: Use i_click_on for behat clicks 2023-09-04 09:13:09 +08:00
Eloy Lafuente (stronk7) 955a276e6e MDL-76459 xmldb: Add environmental check to verify $CFG->prefix
While, right now, sites using long (> 10 chars) $CFG->prefix
can continue working (because we still don't have any table
> 28 chars), as soon as some new table with long name is added,
it won't work with PostgreSQL anymore (if the 63 limit is raised).

Hence, this environmental check will verify on both install and
upgrade that the $CFG->prefix is always <= 10 chars.

Sites with longer prefixes will need to rename all their tables
(and maybe other objects, depending on the dbtype) to use a shorter
prefix.
2023-09-02 09:22:36 +02:00
Andrew Nicols e2111d83ee weekly release 4.0.10+ 2023-09-02 08:18:38 +08:00
Andrew Nicols c1b33a6caf Merge branch 'MDL-77831-400' of https://github.com/mickhawkins/moodle into MOODLE_400_STABLE 2023-09-01 10:38:44 +08:00
Jun Pataleta c5231e4d28 Merge branch 'MDL-79017-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-08-31 20:31:53 +08:00
Michael Hawkins 573aa1c5bc MDL-77831 core: Updated security.txt expiry and added additional info 2023-08-31 18:29:59 +08:00
Huong Nguyen cae6b09efa Merge branch 'MDL-79207-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-31 12:27:27 +07:00
Angelia Dela Cruz 676f899142 MDL-79207 core_course: Behat coverage for activity and resource deletion 2023-08-31 11:01:54 +08:00
Sara Arjona 91c90b6f5d Merge branch 'MDL-78612-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-08-30 17:55:52 +02:00
Andrew Nicols 2e9dbfd2d1 MDL-78612 core: Wrap modal_factory.create in pendingPromise 2023-08-30 13:36:26 +08:00
Jun Pataleta 2ece3b7a84 weekly release 4.0.10+ 2023-08-26 11:03:29 +08:00
Jun Pataleta 57c7642210 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-08-26 11:03:26 +08:00
Jun Pataleta 11f782c4a4 Merge branch 'MDL-79015-400-fix' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-25 09:53:54 +08:00
Simey Lameze 57a985b035 MDL-79015 behat: make verification step more specific 2023-08-25 08:59:13 +08:00
AMOS bot 7b63b9ad6c Automatically generated installer lang files 2023-08-25 00:11:54 +00:00
Sara Arjona b6a5b0c5d9 Merge branch 'MDL-78965-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-24 16:38:45 +02:00
Jun Pataleta f636d3b8dc Merge branch 'MDL-79015-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-24 15:53:20 +08:00
Angelia Dela Cruz f3dbd537a5 MDL-78965 mod_quiz: Behat coverage for quiz with certainty-based marking 2023-08-24 15:13:41 +08:00
Jun Pataleta f77b73fe51 Merge branch 'MDL-78941-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-24 13:05:37 +08:00
Angelia Dela Cruz 599cd75fe6 MDL-79015 mod_lesson: Behat coverage for lesson with access restriction 2023-08-24 13:05:31 +08:00
Angelia Dela Cruz b784e61a0f MDL-78941 mod_quiz: Behat coverage for student flagging quiz questions 2023-08-24 11:13:50 +08:00
Huong Nguyen ac35349fcc Merge branch 'MDL-78843-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-24 08:58:31 +07:00
Sara Arjona 567bb622b4 weekly release 4.0.10+ 2023-08-22 15:51:07 +02:00
Ilya Tregubov 818ac5cc6c Merge branch 'MDL-79078-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-08-22 09:11:03 +08:00
Paul Holden 5e91f88d4b MDL-79017 core: re-factor method to unserialize array.
We can use the existing helper for object unserialization as the
base for this method, rather than manual string parsing.
2023-08-21 21:02:48 +01:00
Jun Pataleta e9906db076 MDL-79078 grades: Wait for pending JS when navigating gradebook 2023-08-21 17:30:41 +08:00
Ilya Tregubov 456e8d0f73 weekly release 4.0.10+ 2023-08-18 11:24:03 +08:00
Eloy Lafuente (stronk7) 2c6c256c51 Merge branch 'MDL-78684-400-fix-2' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-17 19:57:33 +02:00
Simey Lameze e6684a65d7 MDL-78684 behat: fix behat failures 2023-08-17 21:15:45 +08:00
Jun Pataleta 1bae9ad509 Merge branch 'MDL-78938-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-08-17 09:58:16 +08:00
Andrew Nicols d79615711c Merge branch 'MDL-77695-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-16 23:23:37 +08:00
Andrew Nicols c9682dfece Merge branch 'MDL-78684-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-16 22:45:00 +08:00
Andrew Nicols 72ec24d812 MDL-78938 course: Wrap manual completion toggle in pending
This commit makes two changes to reduce random failures in behat:
- wrap the toggling of manually configured completion in pendingjs
- set the loading spinner content without forcing the completion toggle
  ws to wait for the loading spinner to update.
2023-08-16 20:05:34 +08:00
Andrew Nicols 27efd067f8 MDL-78938 report_progres: Wrap completion status update in pending 2023-08-16 20:05:33 +08:00
Simey Lameze 750da4a57d MDL-77695 behat: use automatic completion to award badges 2023-08-16 11:22:33 +08:00
Shamim Rezaie 358e1793f2 Moodle release 4.0.10 2023-08-11 23:20:17 +10:00
Huong Nguyen 3a794f0e78 weekly release 4.0.9+ 2023-08-10 22:50:58 +07:00
Huong Nguyen 2a724ee1b9 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-08-10 22:50:56 +07:00
meirzamoodle b797c1314f MDL-78685 auth_oauth2: Added logged-in status check 2023-08-10 18:45:15 +07:00
Jun Pataleta 1f8f229ff0 MDL-78620 auth_cas: Pass base service URL for the CAS client
Since phpCAS v1.6.0, a required base service URL parameterneeds to be
passed to phpCAS::client(). This is basically the protocol, hostname,
and port number (optional) of the site connecting to the CAS server
in order for it to perform service URL discovery.
2023-08-10 18:45:15 +07:00
Jun Pataleta 4a3ef2c34d MDL-78620 auth_cas: Bump thirdpartylibs version to 1.6.0 2023-08-10 18:45:15 +07:00
Jun Pataleta 3bef4646fa MDL-78620 auth_cas: Update phpCAS to v1.6.0 2023-08-10 18:45:15 +07:00
David Woloszyn 56557c04a7 MDL-78620 lib: Set Moodle files after phpCAS upgrade 2023-08-10 18:45:15 +07:00
David Woloszyn 79d7685763 MDL-78620 lib: Upgrade phpCAS to 1.5.0 2023-08-10 18:45:14 +07:00
Michael Hawkins 7d120086ae MDL-78763 tool_policy: Initialise returnurl as a moodle_url in viewall 2023-08-10 18:45:14 +07:00
Paul Holden 98078b96c8 MDL-78792 message: access checks in processor fragment callback. 2023-08-10 18:45:14 +07:00
raortegar c1ed3e422d MDL-74289 lib: Improve the proxy bypass matching 2023-08-10 18:45:11 +07:00
Simey Lameze c7e549a46f MDL-78843 behat: update get_forum_id to search for idnumber or name
This commit also converts manual steps to create discussions on the
Annoucements forum to data generator.
2023-08-10 10:05:24 +08:00
AMOS bot 57fa64c768 Automatically generated installer lang files 2023-08-08 00:10:27 +00:00
Paul Holden a524ac4bb3 MDL-78647 files: safer unserializing of file reference data. 2023-08-04 12:55:23 +02:00
Shamim Rezaie cddb24754e MDL-66212 tool_lpimport: properly check capabilities
The moodle/competency:competencymanage capability should be checked
before showing the import and export pages.
2023-08-04 12:55:23 +02:00
Matt Porritt eed4592b7c MDL-78340 Blocks: Dashboards now respect block permission overrides
Patch makes user dashboard respect permission overrides
that have been set on individual blocks on the system
dashboard (indexsys.php). When a user dashboard is created
either when the user visits their dashboard for the first
time or after an admin reset. When blcoks are copied to
the new dashbaord overriden permissions are also copied.
2023-08-04 12:55:23 +02:00
Rajneel Totaram 00569bf0fe MDL-71728 mod_quiz: check if user can access this page 2023-08-04 12:55:23 +02:00
Sara Arjona d2b3068edb weekly release 4.0.9+ 2023-08-04 12:40:15 +02:00
Jun Pataleta af2d5ea945 MDL-78498 mod_forum: Prevent race condition in forum recent activity
* Using the generator to create the forum discussions, the timecreated
of a discussion can be set before the user's last course access which
will prevent forum_print_recent_activity() from including this generated
discussion in the recent activity results. To work around this, generate
the forum discussion 1 second after the current time to make sure that
the user's last course access will always be before the discussion's
creation time.
* This patch also includes some optimisations by:
  - Removing the unnecessary @javascript tag for the
    `Time limit expires` scenario
  - Bringing the discussion generation to each scenario to allow each
    scenario to customise the data passed to the generator like for the
    `Time limit expires` scenario.
  - Navigating directly to the forum instance.
2023-08-03 11:33:38 +08:00
Jun Pataleta cdfb51b114 Merge branch 'MDL-78498-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-02 11:22:50 +08:00
Sara Arjona 9077bade59 Merge branch 'MDL-78703-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-08-01 13:45:19 +02:00
Simey Lameze 066ea59ae5 MDL-78498 behat: add support for private replies
This commit adds support for private replies in the
'the following forum replies exist in course' custom step.
2023-08-01 16:08:18 +08:00
Angelia Dela Cruz e24eb760ae MDL-78498 Behat: Use data generators for forum posts and replies
This commit does few things:
* Replace manual forum posts and replies to use data generator.
* It also changes the code to handle social forums.
* Other behat clean-ups and optimization.

Co-authored-by: Simey Lameze <simey@moodle.com>
2023-08-01 16:08:18 +08:00
Angelia Dela Cruz 5017f192ba MDL-78684 Behat: Replace gradebook navigation to use page resolvers
This commit also does other things such as:
- Replace manual steps to setup gradebook by data generators
- Added support for outcomes and scales page resolvers
- Behat clean up
2023-08-01 15:53:59 +08:00
Ilya Tregubov 5ab94239f4 weekly release 4.0.9+ 2023-07-28 10:44:21 +08:00
Ilya Tregubov a42e7c9294 Merge branch 'MDL-78782-400' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-07-27 10:00:40 +08:00
Ferran Recio 78d7191ea5 MDL-78782 behat: optimize with editing mode step
The current I am on course homepage with editing mode loads twice the
course page. This patch prevents this from happening by going directly
to editmode.php.
2023-07-26 16:19:48 +02:00
Huong Nguyen 95b25c6049 weekly release 4.0.9+ 2023-07-21 20:56:36 +07:00
AMOS bot 1f18fb7f06 Automatically generated installer lang files 2023-07-19 00:10:57 +00:00
Paul Holden dcc6ad76f1 MDL-78703 behat: fix HTTP GET method capitalization on redirect. 2023-07-15 01:00:09 +01:00
Ilya Tregubov 147c818fb0 weekly release 4.0.9+ 2023-07-14 09:25:45 +08:00
Andrew Nicols bfc7a5e99f Merge branch 'MDL-78157-400' of https://github.com/golenkovm/moodle into MOODLE_400_STABLE 2023-07-13 09:48:31 +08:00
Eloy Lafuente (stronk7) a84a4414da Merge branch 'MDL-78673-400-fix' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-07-12 19:03:31 +02:00
Sara Arjona 90423dac85 MDL-78673 behat: Replace arrow function 2023-07-12 18:46:18 +02:00
Sara Arjona ad99d89bfb Merge branch 'MDL-78673-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-07-12 18:18:27 +02:00
Andrew Nicols 24e0649aa2 Merge branch 'MDL-77450-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-07-13 00:10:32 +08:00
Sara Arjona 66b25cb692 Merge branch 'MDL-78455-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-07-12 17:37:26 +02:00
Angelia Dela Cruz 6fcd9b72ba MDL-77450 Behat: Behat cleanup and optimisation 2023-07-11 14:42:44 +08:00
Andrew Nicols 4136c6b0c9 MDL-78673 grade: Switch test to use generators 2023-07-10 11:31:55 +08:00
Andrew Nicols 64e4988bd6 MDL-78673 grade: Switch to behat navigation steps 2023-07-10 11:31:55 +08:00
Andrew Nicols 7fe6a2d902 MDL-78673 grade: Address random failure due to toast 2023-07-10 11:31:54 +08:00
Andrew Nicols b621be27c7 MDL-78673 behat: Allow plugins to define their expansion of > 2023-07-10 11:31:54 +08:00
Ilya Tregubov 9544616f4c weekly release 4.0.9+ 2023-07-07 11:52:36 +08:00
Ilya Tregubov ef6f73cb66 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-07-07 11:52:33 +08:00
Misha Golenkov 4d1b3728ea MDL-78379 js: Add missing newline character 2023-07-06 16:18:07 +10:00
Jun Pataleta dd7db44ee4 Merge branch 'MDL-78488_400' of https://github.com/t-schroeder/moodle into MOODLE_400_STABLE 2023-07-06 11:18:05 +08:00
Andrew Nicols f3d31d27cf Merge branch 'MDL-78614-400' of https://github.com/noeldemartin/moodle into MOODLE_400_STABLE 2023-07-05 20:31:15 +08:00
Andrew Nicols 256809abf5 Merge branch 'MDL-78158-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-07-05 10:24:19 +08:00
Andrew Nicols 4f39c6e364 Merge branch 'MDL-75324-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-07-04 13:30:26 +08:00
Simey Lameze 7b3360099d MDL-75324 behat: use a proper step to verify completion status 2023-07-04 11:20:32 +08:00
Angelia Dela Cruz 5309a9d11a MDL-78158 behat: Behat cleanup and optimisation 2023-07-04 09:32:31 +08:00
Angelia Dela Cruz 37ec0892ec MDL-78158 Behat: Use data generators to add blocks 2023-07-04 09:11:12 +08:00
AMOS bot 5d1519b3a2 Automatically generated installer lang files 2023-07-04 00:11:34 +00:00
Noel De Martin 498d9ccb4a MDL-78614 behat: Remove trailing quotes 2023-07-03 11:18:56 +02:00
Tim Schroeder 5dbc4d269d MDL-78488 question bank: don't load statistics when they are disabled 2023-06-30 11:45:27 +02:00
AMOS bot 26c2bb411e Automatically generated installer lang files 2023-06-30 00:08:36 +00:00
Huong Nguyen 7a98a43042 weekly release 4.0.9+ 2023-06-29 22:22:26 +07:00
Paul Holden ca3ec4d0b9 Merge branch 'MDL-78521-fix' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-06-29 11:53:29 +01:00
Sara Arjona efc3e28c31 MDL-78521 badges: FixingPHP lint
This patch fixes a PHP lint error introduced in MDL-75552.
As this issue was closed a few weeks ago, I'm adding it to one
random issue integrated this week.

Thanks Eloy and Paul for your help! :-*
2023-06-29 12:39:54 +02:00
Ilya Tregubov 00916e1031 Merge branch 'MDL-77286-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-06-29 09:44:08 +08:00
Ilya Tregubov 0e60bb75f1 Merge branch 'MDL-78521-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-06-29 09:38:49 +08:00
Simey Lameze 52966bf12f MDL-77286 behat: change window size to large to avoid random fails 2023-06-27 17:12:28 +08:00
Jun Pataleta 98823e97ce Merge branch 'MDL-76724_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-06-26 19:38:17 +08:00
Simey Lameze 3c143613aa MDL-78521 behat: reload page before asserting content
This commit also reword a Scenario name to make it unique
2023-06-26 11:19:56 +08:00
Eloy Lafuente (stronk7) 1b8b3e9ac8 MDL-76724 environment: Moodle 4.3 requirements
Note that there aren't changes since Moodle 4.2
so this is a complete copy of the information
for that version.
2023-06-24 12:30:08 +02:00
Sara Arjona 5d634426a5 weekly release 4.0.9+ 2023-06-23 09:00:29 +02:00
Sara Arjona ae430b853d Merge branch 'MDL-76635-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-06-21 14:02:33 +02:00
Simey Lameze a135175c9c MDL-76635 comment: render the delete icon in the right place
Special thanks to Andrew Lyons.
2023-06-21 12:45:45 +08:00
Simey Lameze aa0cef5e5b MDL-76635 behat: improve submission comments test 2023-06-21 12:45:45 +08:00
Ilya Tregubov 5371d63c1a Merge branch 'MDL-77525/400' of https://github.com/skodak/moodle into MOODLE_400_STABLE 2023-06-20 13:06:07 +08:00
Jun Pataleta c2e6b8083a Merge branch 'MDL-74021-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-06-20 10:13:13 +08:00
Angelia Dela Cruz 2c8f3c7ed5 MDL-74021 behat: Page behat generators use UI
Replace steps that manually add page instances via the UI and use
Behat generators. This improves the speed of Behat test runs.

Co-authored-by: Simey Lameze <simey@moodle.com>
2023-06-19 17:20:13 +08:00
Petr Skoda abc2201890 MDL-77525 filter: add filtering stages 2023-06-17 16:51:08 +02:00
Andrew Nicols 2c14ed0469 weekly release 4.0.9+ 2023-06-16 12:04:34 +08:00
Andrew Nicols 1650d0a1a8 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-06-16 12:04:30 +08:00
Angelia Dela Cruz e79a71ca41 MDL-78455 Behat: Behat cleanup and optimisation for blog/tests/behat 2023-06-16 09:21:57 +08:00
Angelia Dela Cruz cb0d17f530 MDL-78455 Behat: Add Behat for adding, editing and deleting blog entries 2023-06-16 09:21:22 +08:00
Ilya Tregubov 00fbed085a Merge branch 'MDL-70152-400-fix' of https://github.com/ilyatregubov/moodle into MOODLE_400_STABLE 2023-06-15 12:11:59 +08:00
Simey Lameze 224da4b2b0 MDL-70152 behat: reply to post using data generator 2023-06-15 12:07:11 +08:00
Andrew Nicols 8ff3117478 Merge branch 'MDL-69231-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-06-15 10:55:48 +08:00
Ilya Tregubov 4ce13b411d Merge branch 'MDL-76733-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-06-15 10:24:50 +08:00
Andrew Nicols 220132391e MDL-76733 mod_assign: Remove JS requirement for time-based tests
Converting these tests to use an onlinetext submission and drop the JS
requirement means that they are much less susceptible to runtime issues,
and not susceptible to those caused by JS at all.
2023-06-15 09:34:06 +08:00
Andrew Nicols 75f833524b MDL-76733 mod_assign: Address random failure
This random failure was happening because of the time required to render
and interact with the file picker which sometimes exceeded 2 seconds,
depending on the speed of the machine running the tests.

Converting these tests to use an onlinetext submission and drop the JS
requirement means that they are much less susceptible to runtime issues,
and not susceptible to those caused by JS at all.
2023-06-15 09:33:42 +08:00
AMOS bot afedc33bd5 Automatically generated installer lang files 2023-06-15 00:16:18 +00:00
Sara Arjona f0de6ba61b Merge branch 'MDL-76733-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-06-14 16:22:49 +02:00
Jun Pataleta 2b4e791a66 Merge branch 'MDL-78466-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-06-14 16:00:04 +08:00
Ilya Tregubov cbea4fa598 Merge branch 'MDL-70152-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-06-14 13:25:29 +08:00
Andrew Nicols 01e9d88cef MDL-78466 cache: Add new result_found helper
This helper is intended to prevent recurrences of this issue by moving
the guess-work to something well tested.
2023-06-14 09:35:40 +08:00
Andrew Nicols dbdd331392 MDL-78466 cache: Perform strict test on static cache values
If a statically accelerated cache returns an empty array then the value
was still fetched from the non-static cache store.

The check of the `$result` should be strictly checked against `false`,
which is the value used if no value was found.
2023-06-14 09:28:48 +08:00
Ilya Tregubov 19c271d45e Moodle release 4.0.9 2023-06-10 14:08:16 +08:00
Ilya Tregubov c24ae4c087 weekly release 4.0.8+ 2023-06-09 13:14:32 +08:00
Sara Arjona 3828e7ad80 Merge branch 'MDL-78415-400-enfix' of https://github.com/vmdef/moodle into MOODLE_400_STABLE 2023-06-08 20:33:22 +02:00
Helen Foster 3c37cae46b MDL-78415 lang: Import fixed English strings (en_fix) 2023-06-08 12:07:48 +01:00
Sara Arjona 792c35ac30 Merge branch 'MDL-77946-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-08 06:57:02 +02:00
Sara Arjona 87945beba8 Merge branch 'MDL-78308-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-08 06:48:46 +02:00
Andrew Nicols bafc80cb04 Merge branch 'MDL-75696_400_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_400_STABLE 2023-06-08 12:31:43 +08:00
Andrew Nicols d253d86307 Merge branch 'MDL-78364-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-08 12:20:04 +08:00
Andrew Nicols 3b1205dae8 Merge branch 'MDL-78008_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-06-08 12:10:48 +08:00
Andrew Nicols 382f973727 Merge branch 'MDL-77933-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2023-06-08 12:03:54 +08:00
Andrew Nicols 546baf2d7a MDL-76838 core: Add unit test for invalid unicode sequences 2023-06-08 11:59:28 +08:00
Jake Dallimore 5a423b4e56 MDL-77933 enrol_lti: return site name and logo during registration
Instead of the Moodle icon and the 'moodle' lang string, return the
site fullname and compact logo during dynamic registration.
2023-06-08 11:59:12 +08:00
Andrew Nicols 3801d87036 Merge branch 'MDL-76838-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-08 11:54:54 +08:00
Jun Pataleta dbf53a848a Merge branch 'MDL-75898-40' of https://github.com/matthewhilton/moodle into MOODLE_400_STABLE 2023-06-08 11:42:59 +08:00
Andrew Nicols 23376f93b8 Merge branch 'MDL-78026-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-08 11:37:17 +08:00
Andrew Nicols eb9c234345 Merge branch 'MDL-77264-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-08 11:33:17 +08:00
Andrew Nicols bbe3109992 Merge branch 'MDL-76821-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2023-06-08 11:30:23 +08:00
Andrew Nicols 72e923f90b Merge branch 'MDL-77799-m400' of https://github.com/sammarshallou/moodle into MOODLE_400_STABLE 2023-06-08 11:21:48 +08:00
Jun Pataleta 452d18a8bc Merge branch 'MDL-70833_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-06-08 11:12:30 +08:00
Andrew Nicols bc50b73d15 Merge branch 'MDL-78408-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2023-06-08 11:06:14 +08:00
Andrew Nicols 2f42e68b80 Merge branch 'wip_MDL-78400_m40' of https://github.com/gjb2048/moodle into MOODLE_400_STABLE 2023-06-08 10:59:32 +08:00
Andrew Nicols 27249f3681 Merge branch 'MDL-76406-400' of https://github.com/safatshahin/moodle into MOODLE_400_STABLE 2023-06-08 10:41:47 +08:00
Jun Pataleta 68fa6f77d1 Merge branch 'MDL-76842-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2023-06-08 10:34:05 +08:00
Jun Pataleta 0f4f1c60d4 Merge branch 'MDL-78229-400' of https://github.com/lucaboesch/moodle into MOODLE_400_STABLE 2023-06-08 10:30:15 +08:00
Jake Dallimore e76dd382a0 MDL-76842 enrol_lti: fix user record updates in user_repository
Only call user_update_user when the relevant user data has changed,
preventing unnecessary user_updated events. This also removes the
line setting timemodified on the user since user_update_user already
handles this.
2023-06-08 10:29:40 +08:00
Jun Pataleta 5a04d7fc30 Merge branch 'MDL-78431-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-06-08 10:28:12 +08:00
Jake Dallimore ddcb3c7d13 MDL-76842 enrol_lti: test confirming the erroneous user_updated events
This test will fail until the fix - only updating users when data has
changed - is put in place in the following commit.
2023-06-08 09:43:11 +08:00
Jake Dallimore 1946ca5954 MDL-76842 auth_lti: don't update the user unless data has changed
When receiving data from the LTI launch, or service call, only update
the user record when we know something has changed. This prevents the
creation of many \core\event\user_updated events.
2023-06-08 09:43:10 +08:00
Jake Dallimore 2dcd4f8e78 MDL-76842 auth_lti: don't update the user after membership creation
This isn't required and generates excess events. The only thing update
does, other than update the user fields, is to update the picture, but
in this case, that's unset in membership-based auths anyway, so it's
entirely safe to remove this.
2023-06-08 09:42:19 +08:00
Jake Dallimore bc29553eb7 MDL-76842 auth_lti: test confirming the erroneous user_updated events
This test will fail until the fix - only updating users when data has
changed - is put in place in the following commit.
2023-06-08 09:42:19 +08:00
Stevani Andolo 777e72beff MDL-78215 core: Added support unit test 2023-06-08 09:37:21 +08:00
Stevani Andolo 6ae19a6c9a MDL-78215 core: support checking if 0.0.0.0 is in subnet 2023-06-08 09:37:21 +08:00
Jun Pataleta ae685a0809 Merge branch 'MDL-78378-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-06-07 23:25:28 +08:00
Andrew Nicols 555622abf2 MDL-78431 core: Abort after config for source maps 2023-06-07 21:08:00 +08:00
Sara Arjona 815f0b338f Merge branch 'MDL-78322-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-07 12:43:16 +02:00
Sara Arjona 52ea8ee444 Merge branch 'MDL-78352-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-07 12:41:21 +02:00
Sara Arjona f64987f510 Merge branch 'MDL-78047-400' of https://github.com/stevandoMoodle/moodle into MOODLE_400_STABLE 2023-06-07 18:20:27 +08:00
Sara Arjona 12a20b2d7a Merge branch 'MDL-78010-400' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-06-07 18:20:27 +08:00
sam marshall 16cb641103 MDL-77799 webservice_rest: unhandled exception should go in server log 2023-06-07 10:05:43 +01:00
Jake Dallimore d293744f08 MDL-78408 core: fix restoration of anchor to wantsurl during login 2023-06-07 14:31:58 +08:00
Stevani Andolo 6b4ae661dc MDL-78047 core_courseformat: Wrapping added to text and media activity 2023-06-07 12:58:27 +08:00
Paul Holden e8cc468184 MDL-77193 mnet: correct sorting of access control table. 2023-06-07 09:53:57 +08:00
Ferran Recio e71f208a90 MDL-78010 mod_label: improve upgrade performance 2023-06-06 21:33:11 +02:00
Petr Skoda 90c23c7543 MDL-76683 core_group: fix template 2023-06-06 09:25:17 +00:00
Sara Arjona 34fbef096e Merge branch 'MDL-76936-400' of https://github.com/HirotoKagotani/moodle into MOODLE_400_STABLE 2023-06-06 11:22:21 +02:00
Paul Holden 403bf57a8c MDL-78364 reportbuilder: earlier calculation of schedule recipients. 2023-06-05 16:22:35 +01:00
Gareth Barnard 4fbc60a455 MDL-78400 JavaScript: Building JS puts build files in src dir on Win. 2023-06-05 14:50:45 +01:00
Luca Bösch bb54ea04ea MDL-78229 quiz: quiz editing page less narrow.
This is a backport of MDL-77872.
2023-06-02 08:34:50 +02:00
Sara Arjona 70f5d8d547 MDL-78378 survey: Display default introduction when description is empty
This is a regression when the activity pages were redessigned in Moodle
4.0. The default introduction should be displayed when the activity
description is empty.
2023-06-02 08:19:43 +02:00
Simey Lameze 78aa80dd5f MDL-69231 behat: remaining work for role capability generator
This commit does few things:
* Unify data generators usage to role short name.
* Replace remaining manual steps to use the new data generator.
* Also replaced other manual steps to set config to use data generators.
* Tidy up of some tests, aligning pipes and splitting one line steps into multiple lines.
* Fixes tests to have one Given/When/Then per scenario.
2023-06-02 12:39:52 +08:00
Andrew Nicols 063e8fb534 MDL-69231 behat: Update tests to use new generator 2023-06-02 12:39:52 +08:00
Andrew Nicols 091aa9b872 MDL-69231 tests: Add role capability setting generator 2023-06-02 12:39:52 +08:00
Andrew Nicols 521e21d842 MDL-69231 tests: Improve existing role generator
Support definition of context levels and permissions.
2023-06-02 12:39:52 +08:00
Safat c2e0c4a533 MDL-76406 core: Add environment check for versions not supporting 8.2 2023-06-02 12:09:41 +10:00
Ilya Tregubov 52a4f2d030 weekly release 4.0.8+ 2023-06-02 09:55:48 +08:00
Ilya Tregubov 0630a13602 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-06-02 09:55:46 +08:00
Andrew Nicols 36ee03c6f2 Merge branch 'MDL-77749-unset-config-duration-MOODLE_400_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_400_STABLE 2023-06-01 12:03:46 +08:00
Andrew Nicols 38e27840b7 Merge branch 'MDL-78327_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-06-01 10:53:22 +08:00
Ilya Tregubov dbbd50c5d2 Merge branch 'MDL-78196-400' of https://github.com/jleyva/moodle into MOODLE_400_STABLE 2023-06-01 10:40:57 +08:00
Ilya Tregubov c7262e9ffb Merge branch 'MDL-77259-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-06-01 09:30:34 +08:00
Ilya Tregubov 57faab092e Merge branch 'MDL-75961-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-06-01 09:08:52 +08:00
AMOS bot 1868ec834e Automatically generated installer lang files 2023-06-01 00:10:59 +00:00
Sara Arjona 7d496dcfda Merge branch 'MDL-76693-400' of https://github.com/roland04/moodle into MOODLE_400_STABLE 2023-05-31 17:09:10 +02:00
Simey Lameze 770cb3107b MDL-77547 behat: run recalculate task before checking values 2023-05-31 15:04:57 +02:00
Tim Hunt 32909a830d MDL-78327 question stats: store same timestamp for all question stats 2023-05-31 12:04:53 +01:00
Sara Arjona 3c93359478 Merge branch 'MDL-77547-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-05-31 12:51:49 +02:00
Sara Arjona 3f70b37d28 Merge branch 'MDL-77907-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-05-31 12:18:18 +02:00
Sara Arjona 3c84e5e76f Merge branch 'MDL-78148-400' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-05-31 11:42:22 +02:00
Ilya Tregubov 5ab14b5143 Merge branch 'MDL-73138-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-30 12:54:39 +08:00
Ilya Tregubov 71ff178dd1 Merge branch 'MDL-77723-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-30 12:45:27 +08:00
AMOS bot 6478958c64 Automatically generated installer lang files 2023-05-30 00:10:32 +00:00
Jun Pataleta 14be143e7d Merge branch 'MDL-78314-400' of https://github.com/lucaboesch/moodle into MOODLE_400_STABLE 2023-05-29 17:34:54 +08:00
Mikel Martín 957c2121b3 MDL-76693 core_course: Fix activity chooser summary overlap
In activity chooser modal, there is an overlap issue in the information "sub-page".
Changing some classes in the layout solves the problem.
2023-05-29 09:38:25 +02:00
Ferran Recio a32e4be652 MDL-78148 core_courseformat: reduce the use of uniqid in templates 2023-05-29 08:40:15 +02:00
Angelia Dela Cruz e0e4b2fad2 MDL-70152 behat: Forum behat generators use UI
Behat cleanup and optimisation
2023-05-29 10:24:10 +08:00
Angelia Dela Cruz b6928826e1 MDL-70152 behat: Forum behat generators use UI
Replace steps that manually add forum and forum post instances
via the UI and use Behat generators. This improves the speed of
Behat test runs.
2023-05-29 10:24:02 +08:00
Andrew Nicols 35cea45566 MDL-70152 forum: Create behat data generator
* Convert track_read_posts.feature to use activity and discussion
data generators as exmaple.

Co-authored-by: Jun Pataleta <jun@moodle.com>
2023-05-29 10:24:02 +08:00
Eloy Lafuente (stronk7) f9e4dcba02 MDL-70833 auth_mnet: Fix update_enrolments request
This is a backport of the commit integrated as part
of MDL-76055 where we needed the update_enrolments
working to be able to test them. Summary:

- Fixes a typo in table name preventing it to be updated ever.
- Fix outer join that was missing records.
- Stop playing and mixing ids (local and remote).
- Better control which enrolments have to be kept (previously
  they were being deleted immediately after creating them).
- Improve the coding style of inserts.
- Modernise the deletions to use sql helper and work win 0..n ids.
2023-05-26 18:05:31 +02:00
Luca Bösch d175832b54 MDL-78314 quiz: style button fieldset in "Manually grade question". 2023-05-26 15:11:33 +02:00
Paul Holden 959bb8ba01 MDL-78352 webservice: use default user context page heading. 2023-05-26 12:27:48 +01:00
Paul Holden d9f99faf70 MDL-73138 user: avoid double encoding participant filter values. 2023-05-26 10:25:56 +01:00
Paul Holden 53dad06c2f MDL-73138 group: remove double encoding of group/role names. 2023-05-26 10:25:56 +01:00
Sara Arjona abb8647b62 weekly release 4.0.8+ 2023-05-26 09:29:00 +02:00
Sara Arjona 2f36b9f6b8 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-05-26 09:28:56 +02:00
Jun Pataleta fcf13290e9 Merge branch 'MDL-78346-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-05-25 16:22:28 +08:00
Andrew Nicols fbc7ce063f MDL-78346 tool_langimport: Print any notifications before redirect 2023-05-25 14:55:42 +08:00
Jun Pataleta 723c26a244 Merge branch 'MDL-76065-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-05-25 11:57:17 +08:00
Jun Pataleta 2e7b8495b9 Merge branch 'MDL-78320-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-25 11:49:00 +08:00
Jun Pataleta 403534f4d1 Merge branch 'MDL-78346-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-05-25 11:46:46 +08:00
Andrew Nicols 57e7158352 MDL-78346 tool_langimport: Redirect after action to prevent resubmission 2023-05-25 11:43:41 +08:00
Andrew Nicols 6f3c18b235 MDL-78346 tool_langimport: Prevent uninstallation of invalid targets 2023-05-25 11:43:41 +08:00
Andrew Nicols a110b023da Merge branch 'MDL-77995-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-25 09:50:57 +08:00
Paul Holden 877abfd439 MDL-78320 quiz_overview: format group names in overview report. 2023-05-24 16:19:37 +01:00
Simey Lameze 70d21a7e13 MDL-75961 behat: review and enhance mod_imscp tests
This commit makes the following improvements to mod_imscp tests:
* Removes unnecessary @javascript and @_file_upload tags from non-JS tests.
* Removes user/enrol data generation from tests that can be performed as admin.
* Removes "I log out" and other unnecessary steps.
2023-05-24 10:42:44 +08:00
Angelia Dela Cruz e00ab12485 MDL-75961 behat: IMSCP behat generators use UI
Replace steps that manually add IMSCP instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-05-24 10:42:44 +08:00
Sara Arjona 9749d7021b Merge branch 'MDL-78176_400' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_400_STABLE 2023-05-23 17:46:06 +02:00
Sara Arjona 41692c0191 Merge branch 'MDL-78242-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-23 17:37:05 +02:00
Angelia Dela Cruz 3b1625e332 MDL-77547 Behat: Coverage to check for bad multichoice questions 2023-05-23 15:23:46 +08:00
Jun Pataleta 5fa205bc47 Merge branch 'MDL-76688/400' of https://github.com/skodak/moodle into MOODLE_400_STABLE 2023-05-23 15:21:52 +08:00
Simey Lameze 81bb508e7e MDL-76065 behat: Review and enhance mod_lti Behat tests
In this commit, the following improvements were made to the mod_lti Behat tests:

* Replaced manual steps with data generators to set completion.
* Eliminated unnecessary user and course enrolments data generation as some tests can be performed as an admin.
* Removed the @javascript tag from non-JS tests.
* Updated the LTI data generator to generate an internal Moodle URL in the toolurl field, enabling the use of XML files.
2023-05-23 12:28:44 +08:00
Angelia Dela Cruz 6d35e44e17 MDL-76065 behat: LTI behat generators use UI
Replace steps that manually add LTI instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-05-23 12:28:32 +08:00
Andrew Nicols 8340d958cd MDL-76733 mod_assign: Tidy up availability behat tests
This feature had lots of small issues and it made sense to fix it whilst
investigating a query:

* most of the steps do not require JavaScript
* it uses the UI to set an admin setting, for every scenario:
** only 3-4 of the scenarios actually test that setting
** it is very slow to do it his way when we have a generator step we can use
* we create two assignments in the Background, but each test only uses one of them
* we create the assignments in the Background with a generator, but
  update them to modify various settings in each Scenario using the UI
  when we should just create one assignment for each test and set it up
  correctly for that Scenario
2023-05-23 10:58:07 +08:00
Andrew Nicols b3d5c50f90 Merge branch 'MDL-78170-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-23 10:28:47 +08:00
AMOS bot 75636cd51d Automatically generated installer lang files 2023-05-23 00:10:24 +00:00
Paul Holden fa042d8849 MDL-76838 backup: remove invalid utf8 code sequences writing XML.
The surrogate blocks FFFE and FFFF are non-characters, specifically
disallowed in the character range for XML documents.
2023-05-22 21:04:17 +01:00
Paul Holden 744a3438d8 MDL-78322 tool_cohortroles: don't assign roles to deleted users. 2023-05-22 20:14:45 +01:00
Tim Hunt d550d1361d MDL-78008 qtype_multianswer: random guess score with missing subqs
Sometimes, due to other bugs, subquestions can get lost, so the code
needs to be robust to this.
2023-05-22 17:02:39 +01:00
Sara Arjona 0d650c383f Merge branch 'MDL-78211-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-22 17:41:53 +02:00
Sara Arjona 127d614364 Merge branch 'MDL-78226-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-22 17:29:32 +02:00
Sara Arjona 5f0c5919c7 Merge branch 'MDL-78225-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-22 12:04:24 +02:00
Jun Pataleta 3cd579649d Merge branch 'MDL-78157-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-05-22 15:29:23 +08:00
Andrew Nicols e4f344282e MDL-78157 js: Be more careful about inserting missing module names
It is perfectly legitimate to create and/or use a method named `define`
in JS outside of RequireJS.

Unfortunately our requirejs.php wrapper is dumb and does not understand
this.

In the long term we need to stop doing this at all. We really should be
able to already, but every time I try to something prevents it.

In the interim, this change adds a secondary check to see if there is an
existing define which _does_ have the right name in it already.
2023-05-22 14:40:41 +08:00
Anupama Sarjoshi dc2d6f879a MDL-78176 Question: Fix D&D onto image and D&D markers theme issue 2023-05-19 16:26:01 +01:00
Jun Pataleta d6707840e0 weekly release 4.0.8+ 2023-05-19 21:14:04 +08:00
Jun Pataleta c94c9f4769 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-05-19 21:14:01 +08:00
Andrew Nicols 2fdf057520 MDL-77733 behat: Remove extraneous no-axe option
There is no need for no-axe if we make axe a boolean value. We already
have automatic support for negated boolean flags.
2023-05-19 11:28:19 +08:00
Mark Johnson 34134cdfc0 MDL-75696 quiz: Fix restoring pre-4.0 quizzes with random questions
Restoring multiple quizzes from a pre-4.0 backup was broken when
the quizzes shared a random question. This is because after the
first quiz created a set reference in place of the random question,
it deleted the question record so it was not there for the second
quiz to use. This change tracks the IDs of random questions so
they can be deleted at the end.
2023-05-18 16:01:03 +01:00
Mark Johnson ad0ea3ea97 MDL-75696 quiz: Set default value for includingsubcategories on restore 2023-05-18 16:01:03 +01:00
Mark Johnson e815a1c376 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 16:01:02 +01:00
Paul Holden 01b12e91ac MDL-78308 output: better parsing of custom menu item configuration.
Previously certain values would cause deprecation notices in PHP8.1.
2023-05-18 10:19:16 +01:00
Jun Pataleta 2798d551c5 Merge branch 'MDL-78135-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-18 11:54:40 +08:00
Andrew Nicols 357a23967e Merge branch 'MDL-78260_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-05-18 11:51:58 +08:00
Andrew Nicols 83c9db9e08 Merge branch 'MDL-77733-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-05-18 11:44:47 +08:00
Tim Hunt 0a42c83bce MDL-78260 quiz stats: fix View details for random questions 2023-05-17 09:05:33 +01:00
Ilya Tregubov 2fa03a28ea Merge branch 'MDL-78152-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-17 15:08:04 +08:00
AMOS bot f7200165ec Automatically generated installer lang files 2023-05-17 00:10:54 +00:00
Jun Pataleta df846aca78 Merge branch 'MDL-77439-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-05-16 20:39:22 +08:00
Peter Mayer 11d09e2a4c MDL-77439 lib_filebrowser: Splitup query to speedup get_courses 2023-05-16 20:38:06 +08:00
Paul Holden 41f5254aab MDL-78026 group: format retrieved group names from external methods. 2023-05-16 10:10:12 +01:00
Paul Holden 4acab9aaaf MDL-77264 grade: define fallback name of abstract export event. 2023-05-16 09:54:46 +01:00
Paul Holden aab6b69293 MDL-77259 tool_monitor: use core component API for event list.
The previous method of hardcoded filepaths, specifically for events
belonging to core, meant that any events belongs to core subsystems
were omitted (core_customfield, core_h5p, core_payment, etc).
2023-05-16 09:50:28 +01:00
Angelia Dela Cruz cd4b6f36ab MDL-77907 Behat: Coverage for duplicating competency framework 2023-05-16 16:28:01 +08:00
Jun Pataleta db862f2be8 Merge branch 'MDL-75576_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-05-16 09:58:54 +08:00
Andrew Nicols a18b419ad1 Merge branch 'MDL-77432-400' of https://github.com/lucaboesch/moodle into MOODLE_400_STABLE 2023-05-15 22:12:56 +08:00
Andrew Nicols 6131e8c4a2 Merge branch 'MDL-78140-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-15 22:04:07 +08:00
Paul Holden 4b8c829ea8 MDL-78242 roles: consistently check course contact config. 2023-05-15 13:04:50 +01:00
Tim Hunt 118d3e855a MDL-75576 quiz/question statistics: don't expire by time
Previously, a set of calculated quiz statistics would only 'last' for
15 minutes. Then they would be considered invalid and not used.

Now, computed statistics are kept indefinitely. Instead, when a new
batch of values are computed for a particular set of settings, older numbers
for the same settings are deleted first. Therefore,
question_stats_cleanup_task is no more.
2023-05-15 10:05:45 +01:00
Tim Hunt a3ba4772a5 MDL-75576 quiz statistics: don't time-limit the use of cached values
This should have been done as part of  MDL-74762, but was missed.
2023-05-15 10:05:43 +01:00
Tim Hunt 5f2ce7c383 MDL-75576 quiz statistics: don't compute when a user views the qbank
Previously, when users viewed the question bank, if the quiz statistics
had not already been calculated, we would try to compute them there an then.
This could be very, very slow, leading to session lock problems.

Now, we never try to compute the statistics on the fly. Instead, we rely
on the existing \quiz_statistics\task\recalculate scheduled task to do it.
2023-05-15 10:05:43 +01:00
Tim Hunt a187d7930d MDL-75576 question bank: bulk-load statistics for all questions at once
There is a new method on the column class, for the column to declare any
statistics it requires. The question then efficiently loads all those
statistics in one go, and makes them available as the columns are
rendererd, or do any subsequent processing.
2023-05-15 10:05:43 +01:00
Tim Hunt 9deabf8344 MDL-75576 qbank_statistics: remove copy-pasted PHPdoc comments
These methods are already correctly documented on the base class.
2023-05-15 10:05:43 +01:00
Paul Holden 1a217b5b0e MDL-77995 javascript: more precise path matching building JS. 2023-05-15 09:05:56 +01:00
Paul Holden 236befd139 MDL-77723 user: ensure identity refers to a valid custom profile field. 2023-05-15 09:03:45 +01:00
Jun Pataleta eb836fee86 Merge branch 'MDL-76903-400' of https://github.com/laurentdavid/moodle into MOODLE_400_STABLE 2023-05-15 12:05:56 +08:00
Andrew Nicols a0fe28c1b7 Merge branch 'MDL-78125-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-05-15 11:59:21 +08:00
Jun Pataleta 63ae4b4297 MDL-78125 qtype_multianswer: Convert popover trigger to link
According to Boostrap Popovers documentation for popovers triggered
on focus:
"For proper cross-browser and cross-platform behavior, you must use the
<a> tag, not the <button> tag, and you also must include a tabindex
attribute."
2023-05-12 22:47:28 +08:00
Luca Bösch d7c80d9c14 MDL-77432 mod_assign: Confirm submission page standard and not incourse 2023-05-12 09:42:22 +02:00
Ilya Tregubov 0ec98042d6 weekly release 4.0.8+ 2023-05-12 08:56:56 +08:00
Ilya Tregubov 4a1e0aa084 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-05-12 08:56:54 +08:00
Cameron Ball 89d8c9ec0a MDL-75898 assignfeedback_editpdf: Add randomness to PDF annotations
The behat step "I draw on the pdf" creates the exact same line every
time it is called. This can cause issues in a situation like the following:

- Student uploads PDF
- Teacher annotates page 1
- Student edits submission, adding another PDF
- Teacher annotates page 1 again
- When the student looks at their annotated PDF it appears the same as
  before they added the second PDF (i.e., they don't see extra pages for
  the second PDF)

Exactly why this happens isn't clear, and in practice this probably never
happens because the chances of drawing the exact same line twice are almost
0. However, when testing the functionality added in MDL-45580 it was causing
issues.
2023-05-12 09:18:40 +10:00
Cameron Ball fc66d6cfd9 MDL-75898 assignfeedback_editpdf: Don't poll readonly pages
When requesting the readonly version of pages (which contain
teacher annotations), they should always be available - the
PHP side even throws an exception when they're not. This
means we don't need to worry about polling document converters
from the JS side and can just return the pages immediately.
2023-05-12 09:18:40 +10:00
Cameron Ball 0c2a15738f MDL-75898 assignfeedback_editpdf: Improve page count mismatch logic
MDL-45580 introduced the readonlypages filearea, and when loading
page images for an attempt, the code would check if the pages existed
, creating them if not. The code inside this block also contained
a guard clause for the case where no readonly pages existed - which
is a situation that should not happen. Whenever readonly pages are
requested, they should exist.

MDL-66626 introduced a situation where page counts not matching would
also retrigger page generation. However this led to a situation where
the guard clause could be entered when requesting readonly pages.

This patch refactors the guard clause, and improves the logic to
regenerate pages.
2023-05-12 09:18:40 +10:00
Paul Holden 92547b151a MDL-78226 contentbank: verify presence of bank heading element. 2023-05-11 23:16:35 +01:00
Paul Holden 141afa84b4 MDL-78225 output: add sesskey for post requests only in renderables. 2023-05-11 22:48:57 +01:00
Laurent David 5270236fc4 MDL-76903 mod_book: Fix activity completion
* Check only visibles pages to set completion status.
* Make sure we have consistent completion value in API and on the view page.
2023-05-11 12:09:21 +02:00
Paul Holden 3f05904a07 MDL-78140 analytics: improve context restrictions manager test.
This test apparently fails sporadically on Oracle, without obvious
causes. The failure however was hard to interpret, and the test
itself made a lot of assumptions about the system re. naming of
categories/courses. This could be prone to errors, so improve that.
2023-05-11 09:39:32 +01:00
Paul Holden ad238868ed MDL-77946 access: fix category sort order of capability contexts. 2023-05-11 08:33:37 +01:00
Jun Pataleta 1072a3c9e3 Merge branch 'MDL-76344-400-fix' of https://github.com/stevandoMoodle/moodle into MOODLE_400_STABLE 2023-05-11 14:35:46 +08:00
Stevani Andolo 13c4b9089d MDL-76344 course: Fixed course image 'non image file' layout 2023-05-11 14:16:41 +08:00
Jake Dallimore edda29c185 Merge branch 'MDL-75552-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-05-11 11:24:10 +08:00
Sara Arjona 4aecc7b5df Merge branch 'MDL-78040-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-10 19:45:25 +02:00
Paul Holden 38941d0fda MDL-78211 contentbank: fix context option when formatting categories. 2023-05-10 17:42:31 +01:00
Juan Leyva 339244d1b7 MDL-78196 user: Fix files used space check 2023-05-10 17:17:44 +02:00
Andrew Nicols 7371e3562f Merge branch 'MDL-77592-400' of https://github.com/golenkovm/moodle into MOODLE_400_STABLE 2023-05-10 13:04:09 +08:00
Andrew Nicols bdd433354d Merge branch 'MDL-78034-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-10 13:00:45 +08:00
Ilya Tregubov a2665c8778 Merge branch 'MDL-75623-MOODLE_400_STABLE' of https://github.com/sh-csg/moodle into MOODLE_400_STABLE 2023-05-10 11:47:10 +08:00
Paul Holden 1acaa4e4a0 MDL-78170 rating: consistently calculate average rating aggregation.
Ensure it's always cast by the database as a float, to avoid loss of
precision.
2023-05-09 15:57:44 +01:00
Paul Holden a1ea84198c MDL-78152 mod_book: set permissions required for page editing. 2023-05-09 12:11:34 +01:00
Andrew Nicols a2c1c036a9 MDL-75552 badges: move apiBase consumption to backpack
The apiBase in .well-known/badgeconnect.json was ignored and it was
causing some failures when connecting or sending badges to an
external backpack.
For OBv2.1, it has been changed to always use the apiBase defined
in the badgeconnect.json backpack provider.
2023-05-09 08:51:36 +02:00
Petr Skoda bcaa98bb44 MDL-76688 filter_text: prevent LaTeX3 syntax 2023-05-08 10:12:55 +02:00
AMOS bot 50f6d69ea3 Automatically generated installer lang files 2023-05-07 00:07:22 +00:00
Paul Holden 939412bcb7 MDL-78135 completion: include required criteria library in test. 2023-05-05 16:45:50 +01:00
Jake Dallimore 660ea3df56 MDL-76821 enrol_lti: prevent legacy launches via upgraded enrolment
If the enrolment instance (the 'published resource') has been upgraded
from LTI 1.1/2.0 to LTI 1.3 (i.e. a new instance was not created),
prevent legacy launches which may occur from old resource links. Only
LTI Advantage launches should be permitted through the method.
2023-05-05 17:12:03 +08:00
Jake Dallimore ae736cca94 MDL-76821 enrol_lti: fix bug in repo causing return of legacy lti users
If the enrolment method is updated from an LTI 1.1/2.0 tool to an LTI
1.3 tool, it may have associated enrol_lti_users records not having
ltideploymentid values. These are legacy users and must not be returned
by the repository, which deals only with LTI 1.3 LTI users.
2023-05-05 17:12:00 +08:00
Jun Pataleta 36624fee4d Merge branch 'MDL-76344-400' of https://github.com/stevandoMoodle/moodle into MOODLE_400_STABLE 2023-05-05 10:34:48 +08:00
Sara Arjona 9deb29c0d6 weekly release 4.0.8+ 2023-05-04 12:43:00 +02:00
Stevani Andolo 691e7952c8 MDL-76344 course: Fixed course image 'non image file' layout 2023-05-04 10:28:29 +08:00
Paul Holden 685a2dfb73 MDL-78040 block_glossary_random: switch to block test generator.
Random failures after manually adding block instances (specifically
on slow/Oracle systems) can be entirely avoided by using the block
test generator for scenarios that are not specifically concerned with
manually adding blocks.
2023-05-03 17:17:52 +01:00
Jun Pataleta d04c0b5dae Merge branch 'MDL-77398-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-03 20:36:07 +08:00
Jake Dallimore fd643cf459 Merge branch 'MDL-77384-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-03 16:54:16 +08:00
Jake Dallimore 39a94da184 Merge branch 'MDL-78023-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-03 16:16:16 +08:00
Sara Arjona 4b0a13b2ed Merge branch 'MDL-77312-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-03 09:59:27 +02:00
Ilya Tregubov 63d423fc6d Merge branch 'MDL-77320-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-03 15:37:26 +08:00
Ilya Tregubov 4b962ce9c3 Merge branch 'MDL-77987_400' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_400_STABLE 2023-05-03 12:41:02 +08:00
Jun Pataleta 3895d92601 Merge branch 'MDL-77394-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-03 10:30:53 +08:00
Jun Pataleta bc0a1b6166 Merge branch 'MDL-78038-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-03 10:25:24 +08:00
Ilya Tregubov 994d7dd845 Merge branch 'MDL-76835-400' of https://github.com/aya-saad1/moodle into MOODLE_400_STABLE 2023-05-03 09:30:25 +08:00
Sara Arjona 77cd241bdc Merge branch 'MDL-77858-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-05-02 16:49:58 +02:00
Sara Arjona 2720d9a6db Merge branch 'MDL-77791_400' of https://github.com/dvdcastro/moodle into MOODLE_400_STABLE 2023-05-02 12:04:05 +02:00
Jun Pataleta e4134fafc2 Merge branch 'MDL-76857-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-05-02 15:44:43 +08:00
Ilya Tregubov 025202b865 Merge branch 'MDL-78025_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-05-02 11:43:49 +08:00
Ilya Tregubov c36636264f weekly release 4.0.8+ 2023-04-27 19:28:42 +08:00
Sara Arjona 149319befe MDL-76857 filter_displayh5p: Improve behat tests
Although the screenshots in the failures for some of the scenarios in
filter/displayh5p/tests/behat/h5p_filter.feature, like "Render a local
H5P file as teacher" were displaying the expected result, there were
some javascript errors (probably due to behat is quicker and the
iframes were not always ready).
I've added one extra step before accessing the iframe to give more
time to the H5P player to load and confirm the page is displayed
properly.
2023-04-27 11:21:47 +02:00
Paul Holden b1f4566f5e MDL-77320 tool_licensemanager: restrict exposure of user sesskey. 2023-04-27 09:32:43 +01:00
Jun Pataleta 6bab38c1b0 Merge branch 'MDL-77883-400' of https://github.com/danghieu1407/moodle into MOODLE_400_STABLE 2023-04-27 11:09:00 +08:00
Jun Pataleta 64d50b27e6 Merge branch 'MDL-77997_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-04-27 10:40:36 +08:00
Paul Holden 726d3324d3 MDL-78038 mod_bigbluebuttonbn: observe course format section config. 2023-04-26 16:10:54 +01:00
Tim Hunt 68cbd1a772 MDL-78025 questions: improve the comment on question_references.version 2023-04-26 15:52:23 +01:00
Tim Hunt 263960469b MDL-78025 questions: fix PHPdoc on question_require_capability_on 2023-04-26 15:52:20 +01:00
Tim Hunt 480699449b MDL-78025 quiz: fix the quiz_questions_in_use logic 2023-04-26 15:52:15 +01:00
Tim Hunt 62fdb2db50 MDL-78025 questions: questions_in_use should check question_references
This avoids the needs for plugins to do separate queries, which is
easier for them, and better performing.
2023-04-26 15:50:37 +01:00
Tim Hunt e98ec3b520 MDL-78025 question generator: make the behaviour less surprising
* The object returned by update_question is alwasy a new clone
  and the $question passed in will not be modified.

* The returned object has the fields like questionbankentryid and
  the ones related to versionning, so it is more like the data
  returned by question_bank::load_question_data.
2023-04-26 15:50:33 +01:00
Tim Hunt ed605e65d9 MDL-78025 question: move hiding logic into question_delete_question
This logic belongs in the API, so it is applied consistently.

Also this avoids calling the expensive function questions_in_use
twice per question.
2023-04-26 15:46:45 +01:00
Paul Holden 13b4cf6a38 MDL-78034 mod_bigbluebuttonbn: format instance group names. 2023-04-26 15:31:46 +01:00
Aya Saad 7f10c075bc MDL-76835 theme: Fix unordered lists indentation 2023-04-26 13:21:01 +02:00
David Castro 38a7817ba6 MDL-77791 data: Fix file attachment to search doc 2023-04-25 19:54:13 -05:00
Paul Holden 6a2c9cfbc7 MDL-78023 tool_policy: cast timemodified column on table download. 2023-04-25 14:51:14 +01:00
Sara Arjona 1ee2a41142 Merge branch 'MDL-77313-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-04-25 15:18:49 +02:00
Paul Holden 41a6048b0b Merge branch 'MDL-73331_400_toolbrickfieldadvancedtab' of https://github.com/brickfield/moodle into MOODLE_400_STABLE 2023-04-25 11:54:18 +01:00
Paul Holden d6362e1bd8 Merge branch 'MDL-77766-400-2' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-04-25 09:38:38 +01:00
Paul Holden 93dfd51516 MDL-77384 check: clarify statistics check name. 2023-04-25 09:04:47 +01:00
Jun Pataleta bd8df1ac79 MDL-77766 qtype_multichoice: Respect showstandardinstruction
* When showstandardinstruction is set to no, replace the standard
instruction with the generic "Answer" text for the answer options
fieldset's legend.
2023-04-24 20:12:44 +08:00
Tim Hunt c5cd5a0a11 MDL-77997 questions: add back Export as XML to the preview screen
The used the exist in Moodle up to 3.11, but then was removed with
insufficient thought in 4.0 (because we had grander long-term plans
which still have not happened). Until those plans happen, this
commit adds the simple link back on the preview screen.
2023-04-24 11:23:27 +01:00
Anupama Sarjoshi 1e8842726c MDL-77987 Backup: add progress tracking to some slow steps 2023-04-24 11:12:30 +01:00
Paul Holden 71cc91a810 MDL-77312 files: exclude drafts when determining license usage. 2023-04-24 11:07:43 +01:00
Paul Holden 8ce75290f2 MDL-77313 restore: re-add field to indicate course/category search.
When the two restore forms for searching courses and categories were
converted to core templates in eb9935c9 they lost the named submit
button, which broke searching.
2023-04-24 11:04:32 +01:00
Paul Holden cb6fd51254 MDL-77858 javascript: correct core/notification exception imports. 2023-04-24 10:44:19 +01:00
Paul Holden d9dbf8f710 MDL-77394 mod_forum: de-couple discussion pinned/starred options. 2023-04-24 10:38:07 +01:00
Paul Holden 6e914f9a4e MDL-77398 mod_assign: disable form submit protection for batch options. 2023-04-24 10:35:21 +01:00
danghieu1407 d3e2835171 MDL-77883 forms: fix display of client-side validation for textareas 2023-04-24 14:02:16 +07:00
Jun Pataleta 2caed2991e Moodle release 4.0.8 2023-04-22 16:22:46 +08:00
Eloy Lafuente (stronk7) 3552ac0622 weekly release 4.0.7+ 2023-04-21 19:19:20 +02:00
Eloy Lafuente (stronk7) b665e63be8 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-04-21 19:19:15 +02:00
Jun Pataleta 8e2239f1a7 Merge branch 'MDL-77927-400' of https://github.com/stevandoMoodle/moodle into MOODLE_400_STABLE 2023-04-21 16:52:09 +08:00
Jun Pataleta 4e9a6ef5be Merge branch 'MDL-77229-patch-400' of https://github.com/ilyatregubov/moodle into MOODLE_400_STABLE 2023-04-21 16:45:01 +08:00
Jun Pataleta c4f58034ab MDL-77927 core: mod_assignment subplugins environment check 2023-04-21 15:55:13 +08:00
Ilya Tregubov 313d3d76eb MDL-77229 mod_lesson: Black list detailed statistics in classic Behat.
The nav element to go to detailed stats page is missing in classic
2023-04-21 15:08:45 +08:00
Ilya Tregubov 881cc1da19 Merge branch 'MDL-77229-400' of https://github.com/ilyatregubov/moodle into MOODLE_400_STABLE 2023-04-21 12:10:28 +08:00
Ilya Tregubov 553ea69c3f MDL-77229 lesson: Add Behat test 2023-04-21 12:05:52 +08:00
AMOS bot 72c5bcc745 Automatically generated installer lang files 2023-04-21 00:07:38 +00:00
Juan Leyva d2a623971c MDL-77229 lesson: Fix error for empty responses (numerical pagetype) 2023-04-20 12:46:38 +02:00
Jun Pataleta b0d5d0ebc5 Merge branch 'MDL-73012-400' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-04-20 16:44:46 +08:00
Jun Pataleta 636890e5f6 Merge branch 'MDL-77922-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-04-20 16:10:21 +08:00
Ferran Recio 7fe5196a52 MDL-73012 core_courseformat: add pending to move section modal 2023-04-20 09:53:04 +02:00
Ferran Recio cc46c0158a MDL-77922 core_courseformat: add pending to move activity modal 2023-04-20 14:49:27 +08:00
Ilya Tregubov 1a2ca071eb Merge branch 'MDL-77577-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-04-20 12:33:50 +08:00
Paul Holden b17f5b6337 MDL-77187 mod_wiki: validate external method sort parameters. 2023-04-19 12:55:22 +00:00
Paul Holden 7daac50b35 Merge branch 'MDL-77960-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-04-19 13:41:34 +01:00
Max Larkin addb8f1c03 MDL-73331 tool_brickfield: Update advanced tab display 2023-04-19 13:24:06 +01:00
Paul Holden 1ee4d7da64 Merge branch 'MDL-77944-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-04-19 13:06:42 +01:00
Paul Holden 9540c536d8 Merge branch 'MDL-77898-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-04-19 09:03:24 +01:00
Simey Lameze a96de1c74d MDL-77960 behat: make verification steps more specific 2023-04-19 13:33:36 +08:00
Ilya Tregubov d2790cca27 Merge branch 'MDL-77935-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-04-19 13:33:00 +08:00
Andrew Nicols 69e8820de1 weekly release 4.0.7+ 2023-04-18 22:28:15 +08:00
Andrew Nicols 8d9daa91ba Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-04-18 22:28:12 +08:00
Jun Pataleta 4027721841 MDL-77898 calendar: Add iconclass for upcoming_mini template
The icon's iconclass context data adds additional CSS class(es) to
calendar event icons to better control how the event icon is displayed.
e.g. without filtering for activity events that don't hae monologo
versions of their icons.
2023-04-18 15:58:37 +08:00
Ilya Tregubov 475256b621 Merge branch 'MDL-77916-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-04-18 14:29:07 +08:00
Andrew Nicols ddc8ddb047 Merge branch 'MDL-77829-400' of https://github.com/stevandoMoodle/moodle into MOODLE_400_STABLE 2023-04-18 12:32:46 +08:00
Andrew Nicols 7f349d6552 Merge branch 'MDL-77735-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-04-18 12:10:40 +08:00
Andrew Nicols 2bbb3d0eb4 MDL-77944 behat: Rename chrome options for w3c support
From Selenium 4.8.0, support for non-w3c browser control has ended.

We only use W3C browser control these days, and this was missed as part
of the move to W3C. All browser options must be vendor-prefixed.
2023-04-18 09:04:17 +08:00
Ilya Tregubov 68d1a0c1c0 Merge branch 'MDL-77827-400' of https://github.com/HuongNV13/moodle into MOODLE_400_STABLE 2023-04-18 08:59:41 +08:00
AMOS bot a84fb29fcb Automatically generated installer lang files 2023-04-18 00:07:35 +00:00
Paul Holden 5158c1533c Merge branch 'MDL-77878-400-enfix' of https://github.com/vmdef/moodle into MOODLE_400_STABLE 2023-04-17 19:12:38 +01:00
Shamim Rezaie c8defec8dd Merge branch 'MDL-76998-400' of https://github.com/aanabit/moodle into MOODLE_400_STABLE 2023-04-17 21:28:24 +10:00
Víctor Déniz 532c3eb7b0 MDL-77878 lang: Use fixed strings in tests 2023-04-17 09:29:47 +01:00
Paul Holden f1949fe80c MDL-77935 contentbank: avoid phpunit crashes during isolated tests.
Simplify the test for allowed contexts by removing problematic use of
data provider annotation.

See: https://github.com/sebastianbergmann/phpunit/issues/2739
2023-04-17 09:28:46 +01:00
Andrew Nicols 2ac6d6a7d3 Merge branch 'MDL-76995-400' of https://github.com/aanabit/moodle into MOODLE_400_STABLE 2023-04-17 11:15:25 +08:00
Ilya Tregubov 75226d8c9e MDL-76994 core_course: Fix version for weeks and topics course formats 2023-04-17 11:02:36 +08:00
Ilya Tregubov 6496dd5277 Merge branch 'MDL-76994-400' of https://github.com/aanabit/moodle into MOODLE_400_STABLE 2023-04-17 09:47:30 +08:00
Víctor Déniz 3ef7b399a8 MDL-77878 lang: Import fixed English strings (en_fix) 2023-04-16 22:04:03 +01:00
Sara Arjona 95b427d8fe Merge branch 'MDL-77913-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-04-14 14:02:23 +02:00
Sara Arjona 18886c271f MDL-77735 core: Check $CFG->lang isset
In some cases, $CFG->lang might not be set, and this is causing a
Notice to be displayed when, for instance, database connection fails.
This patch should fix this case.
2023-04-14 13:46:45 +02:00
Sara Arjona 9cae11732f weekly release 4.0.7+ 2023-04-14 10:50:13 +02:00
Sara Arjona 9600731821 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-04-14 10:50:10 +02:00
Huong Nguyen 44a8713267 MDL-77827 events: Changed JSON comparison to be less strict 2023-04-14 12:29:38 +07:00
Paul Holden 75b6190bde MDL-77916 h5p: register autoloader in helper testcase. 2023-04-13 23:17:08 +01:00
Paul Holden 53f5432d89 MDL-77913 qbank_previewquestion: deterministic ordering of versions.
Ensure the ordering of loaded question versions is consistent, avoids
random Oracle failures.
2023-04-13 21:45:30 +01:00
Amaia Anabitarte b456e7aa18 MDL-76995 core_courseindex: Apply indentation in the course index 2023-04-13 16:58:21 +02:00
Amaia Anabitarte 75bf395e47 MDL-76998 admin: Option to reset course indentation 2023-04-13 16:57:03 +02:00
Amaia Anabitarte 029457a0a6 MDL-76994 tool_mobile: Return course format indentation setting 2023-04-13 16:56:09 +02:00
Amaia Anabitarte d23ff0a5b3 MDL-76994 core_course: New course format setting to enable indentation 2023-04-13 16:53:22 +02:00
Sara Arjona a2e0dec53b Merge branch 'MDL-76859-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-04-13 16:24:32 +02:00
Sara Arjona 2867735f7e Merge branch 'MDL77833-course-content-chng-notificatn-multilang-m4' of https://github.com/Amrita1991/moodle into MOODLE_400_STABLE 2023-04-13 16:20:11 +02:00
Sara Arjona dbb0410d58 Merge branch 'MDL-77860-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-04-13 13:45:06 +02:00
Sara Arjona 4721df9f4c Merge branch 'MDL-77788-400' of https://github.com/rmady/moodle into MOODLE_400_STABLE 2023-04-13 13:18:27 +02:00
Sara Arjona 243c35b3e8 Merge branch 'MDL-77618-admin-password-autocomplete-MOODLE_400_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_400_STABLE 2023-04-13 12:19:21 +02:00
Amrita1991 4d5ea5e9a9 MDL-77833 course: content change notification multilang processing
changing context parameter
2023-04-13 11:27:00 +02:00
Sara Arjona b47fa670f0 Merge branch 'MDL-77256-400' of https://github.com/rbravod/moodle into MOODLE_400_STABLE 2023-04-13 11:20:38 +02:00
Sara Arjona e196979e09 Merge branch 'MDL-77856-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-04-13 09:43:10 +02:00
Sara Arjona 50a79addb1 Merge branch 'MDL-77468-400' of https://github.com/rmady/moodle into MOODLE_400_STABLE 2023-04-13 09:20:04 +02:00
Juan Leyva 5f7b44fe70 MDL-77468 user: Fix invalid check for group belonging 2023-04-12 20:24:43 -03:00
Juan Leyva a18deeb18b MDL-77468 user: Make user profile visibility consistent web and ws 2023-04-12 20:21:32 -03:00
Sara Arjona 893bdf2603 Merge branch 'MDL-73610_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-04-12 18:19:47 +02:00
Petr Skoda c08401f159 MDL-76859 h5p: Fix behat failures
- Only resize if the H5P EmbedCommunicator is defined (otherwise, it was causing a
JS error)
- An unnecessary image has been removed from the greeting-card.h5p fixture package.
That way, the text will always be displayed (even if the iframe is still not
resized). Instead of replacing the original greeting-card-887.h5p file, I've
renamed it to greeting-card.h5p, to remove these ugly and unnecessary numbers
at the end of the file name).
2023-04-12 15:47:19 +02:00
Amaia Anabitarte 26ffef4f6d MDL-76993 core_course: Recover move right/left functionality
This is a backport of MDL-76990
2023-04-12 09:56:26 +02:00
Amaia Anabitarte a066890881 MDL-76993 core_course: Functions need to backport MDL-76990
MDL-76990 will be backported to 4.1 and 4.0. This commit adds the
methods needed to backport it which were not in 4.0.
2023-04-12 09:55:00 +02:00
Sara Arjona 65532b40c9 Merge branch 'MDL-77837-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-04-11 12:12:57 +02:00
Sara Arjona b61400d504 Merge branch 'MDL-77552-400' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-04-11 11:13:46 +02:00
Sara Arjona 9079a52348 Merge branch 'MDL-77148_400' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_400_STABLE 2023-04-11 10:17:14 +02:00
Sara Arjona 64038bd1d2 Merge branch 'MDL-77612-400' of https://github.com/laurentdavid/moodle into MOODLE_400_STABLE 2023-04-11 10:04:48 +02:00
Laurent David dad1f86b28 MDL-77612 mod_label: Label name fix
* The @@PLUGINFILE@@ placeholder or URLs should not be displayed in the
course index for labels
2023-04-11 05:25:40 +02:00
Stevani Andolo 8ec461823a MDL-77829 core: Added environment check for mod_assignment
Decided to add an environment check before uninstalling the
mod_assignment plugin to prevent data lost.
2023-04-10 13:55:20 +08:00
AMOS bot 2397eee6cb Automatically generated installer lang files 2023-04-07 00:07:30 +00:00
Andrew Nicols 875c1d9638 MDL-77837 core: Improve usage docs for cron_setup_user 2023-04-06 23:21:29 +08:00
Andrew Nicols 46ea3269fc MDL-77837 phpunit: Ensure that the cron user setter is used
When running an adhoc task in a unit test we should use the cron variant
of the set user method to mimic the behaviour of a real cron run.
2023-04-06 23:21:29 +08:00
Andrew Nicols be8fac6291 MDL-77837 cron: Ensure user is set when running tasks
We should be proactive in ensuring that the environment is clean when
running a task. We already ensure that we have a clean renderer and
other parts of the output chain, but we were not setting a clean user.

This change adds a call to setup the cron user before each task is
actually executed.
2023-04-06 23:21:29 +08:00
Eloy Lafuente (stronk7) 7d9d0f35a0 MDL-73610 nodejs: Small updates to required packages
The main goal of this issue is to avoid scanners (Dependabot
and friends), reporting about security issues with the current
xmldom 0.6.0 package.

Note that this doesn't affect prod at all, because it's a dev
dependency, hardly exploitable. So it's not a security fix, just
a security_benefit, if something.

So here, we are updating from xmldom 0.6.0 to @xmldom/xmldom 0.8.7
(note that the package was renamed in 0.7.0, so it's the very same)

Also, when proceeding with the changes, it was detected that we
are incorrectly declaring @babel/eslint-parser as a normal dependency
instead of a development one, so we are also fixing that little detail.

The commands executed to get the changes above applied have been:

- nvm use
- npm install @xmldom/xmldom@^0.8.7 --save-dev
- npm uninstall xmldom
- npm install @babel/eslint-parser@^7.17.0 --save-dev

(we haven't run a complete re-install because we only want to modify
the minimum possible at this stage).
2023-04-06 14:59:52 +02:00
Anupama Sarjoshi 6bee956ede MDL-77148 core: Fix to export params for templates in correct format
When questions are filtered by tags in the question bank, the qtagids
params are passed in the array format. Though moodle_url handles this,
single_button::export_for_template cannot. Hence changes done in
weblib.php to provide params for export_for_template in the
suitable format.
Thanks Huong. I have added the Behat test you provided in the patch.
2023-04-06 13:57:40 +01:00
Sara Arjona 7d8f31dbe7 weekly release 4.0.7+ 2023-04-06 14:02:24 +02:00
Sara Arjona e4e7902d7c Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-04-06 14:02:19 +02:00
AMOS bot 946ff0171c Automatically generated installer lang files 2023-04-06 00:07:34 +00:00
Paul Holden 9cf38cfd39 MDL-77860 tool_moodlenet: use localised language strings for import. 2023-04-05 23:05:34 +01:00
Jun Pataleta b3eb942301 MDL-77856 qtype_multianswer: Use Bootstrap Popover for subq feedback
The YUI Overlay widget encloses the subquestion feedback in a div
which causes a div element to be enclosed in the subquestion span. This
leads to an accessibility issue in terms of HTML parsing as inline
elements (span) should not contain block elements (div)
The YUI Overlay widget is also not accessible as it does not really hide
the overlay contents via aria-hidden when the overlay is not being
shown. It's better if we stop using this and use Bootstrap's
popover component which is more accessible by default.

This patch also removes module.js for the qtype_multianswer plugin as
it only contains codes related to rendering the feedback contents in the
YUI overlay widget which is no longer necessary.
2023-04-06 05:35:19 +08:00
Sara Arjona fce3ba9b11 Merge branch 'MDL-73642_MOODLE_400_STABLE' of https://github.com/tasosb/moodle into MOODLE_400_STABLE 2023-04-05 17:17:41 +02:00
Sara Arjona 42b6a39808 Merge branch 'MDL-75301_400_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_400_STABLE 2023-04-05 12:49:34 +02:00
Shamim Rezaie df17b180f2 Merge branch 'MDL-77555-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-04-05 20:15:09 +10:00
Mark Johnson 6ff023d292 MDL-75301 quiz: Use "always latest" option for question previews
This will set the "alwayslatest" option when previewing a question from
the quiz according to the version setting used in the quiz slot.
2023-04-05 10:23:26 +01:00
Mark Johnson 8043b7838a MDL-75301 question: Add "always latest" option to previews 2023-04-05 10:23:26 +01:00
Paul Holden 60ecd6cef5 Merge branch 'MDL-69551_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-04-05 08:56:46 +01:00
AMOS bot 558585b1ed Automatically generated installer lang files 2023-04-05 00:07:39 +00:00
Juan Leyva 5292926ebb MDL-77788 mod_assign: Apply format_string to group names in WS 2023-04-04 18:12:13 -03:00
Tim Hunt e19cbda970 MDL-69551 quiz: start quiz password field should be a passwordunmask
This help accessibility and usability
2023-04-04 12:21:26 +01:00
Paul Holden b559b84774 Merge branch 'MDL-77712-400' of https://github.com/laurentdavid/moodle into MOODLE_400_STABLE 2023-04-04 12:06:43 +01:00
Andrew Nicols 4406bcd17a Merge branch 'MDL-77584-400' of https://github.com/ewallah/moodle into MOODLE_400_STABLE 2023-04-04 12:07:33 +08:00
Simey Lameze 56bfaebb70 MDL-77733 behat: enable Axe accessibility tests by default 2023-04-04 09:20:19 +08:00
AMOS bot f8e7a1e24b Automatically generated installer lang files 2023-04-04 00:07:40 +00:00
Paul Holden 0bfa7ee0a7 Merge branch 'MDL-75906-400' of https://github.com/mickhawkins/moodle into MOODLE_400_STABLE 2023-04-03 14:54:06 +01:00
Mark Johnson 6f61f48e20 MDL-75301 question: Add behat generator for updating questions
This adds "core_question > updated question" as an entity for `the
following "X" exist` and calls the existing update_question() generator
which will create a new question version with the supplied data.
2023-04-03 12:35:08 +01:00
Paul Holden dec59bd614 Merge branch 'MDL-77227-400' of https://github.com/aanabit/moodle into MOODLE_400_STABLE 2023-04-03 10:47:38 +01:00
Michael Hawkins f37baf7b59 MDL-75906 core: Updated security.txt expiry 2023-04-03 17:27:48 +08:00
Laurent David 03c1095379 MDL-77712 core_course: Fix exception with inplace editor
* On fresh install, an exception is raised when we try to modify
the name of a newly inserted activity in the front page
2023-04-03 10:44:49 +02:00
Ferran Recio 55139ae744 MDL-77552 core_courseformat: add plugin and module to cm state
Backport of MDL-77386
2023-04-03 09:34:21 +02:00
AMOS bot 6cf8bd9832 Automatically generated installer lang files 2023-04-02 00:07:33 +00:00
Stefan Hanauska 95d8d5316c MDL-75623 backup: Encode pluginfile URLs 2023-04-01 09:09:34 +02:00
AMOS bot ed4e4660db Automatically generated installer lang files 2023-04-01 00:07:42 +00:00
Paul Holden 8400206468 weekly release 4.0.7+ 2023-03-31 18:11:57 +01:00
Paul Holden 32a944bac8 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-03-31 18:11:55 +01:00
Jake Dallimore d7185519c3 Merge branch 'MDL-59175-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-31 11:57:43 +08:00
Jake Dallimore 9daaca2400 Merge branch 'MDL-77794-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-31 11:48:56 +08:00
Mikhail Golenkov 427dff5ce1 MDL-77592 filter_tex: Use request dir instead of temp shared storage 2023-03-31 14:36:07 +11:00
Andrew Nicols dc2b74c749 Merge branch 'MDL-77783-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-03-31 11:31:16 +08:00
Ilya Tregubov db31cd37b2 Merge branch 'MDL-70976-400' of https://github.com/laurentdavid/moodle into MOODLE_400_STABLE 2023-03-31 09:42:34 +08:00
AMOS bot d8d79addc4 Automatically generated installer lang files 2023-03-31 00:07:37 +00:00
Laurent David 178cc61b18 MDL-77456 core_courseformat: Fix highlight in course index
* When navigating to a restricted activity as a student from the course index
the item is not highlighted when refreshing the page.
2023-03-30 18:57:56 +02:00
Sara Arjona 5f87d91315 Merge branch 'MDL-77761-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-03-30 17:53:25 +02:00
Sara Arjona 3cd54831ea Merge branch 'MDL-77764-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-30 16:31:26 +02:00
Paul Holden 166c6cc61e Merge branch 'MDL-76481_400_Brickfield_TCPDF_error' of https://github.com/brickfield/moodle into MOODLE_400_STABLE 2023-03-30 12:50:11 +01:00
Sara Arjona f616930138 Merge branch 'MDL-77762-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-30 13:45:23 +02:00
Jun Pataleta 8420c58e69 Merge branch 'MDL-77333_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-03-30 19:03:32 +08:00
Paul Holden 4a603fe534 MDL-77794 contentbank: fix plugin type language strings.
AMOS BEGIN
 CPY [type_contentbank,core_plugin],[type_contenttype,core_plugin]
 CPY [type_contentbank_plural,core_plugin],[type_contenttype_plural,core_plugin]
AMOS END
2023-03-30 09:58:40 +01:00
Max Larkin 7956a8d814 MDL-76481 tool_brickfield: Fix PHP 8 report download 2023-03-30 09:15:28 +01:00
Paul Holden fba11f5c29 Merge branch 'MDL-75017_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-30 08:47:56 +01:00
Ilya Tregubov b83db3be01 Merge branch 'MDL-73771_400' of https://github.com/lostrogit/moodle into MOODLE_400_STABLE 2023-03-30 14:23:08 +08:00
AMOS bot b74ee3931c Automatically generated installer lang files 2023-03-30 00:07:41 +00:00
Amaia Anabitarte d9f694bfa8 MDL-77227 roles: Remove extra information for override page 2023-03-29 18:19:26 +02:00
Carlos Castillo bdc55fbffc MDL-73771 theme: Fix scrollbar position 2023-03-29 09:07:51 -05:00
Shamim Rezaie 4b39aecb10 Merge branch 'MDL-74452_400_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_400_STABLE 2023-03-29 15:27:36 +11:00
Jun Pataleta 2834086d07 Merge branch 'MDL-77382-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2023-03-29 09:48:11 +08:00
Jun Pataleta b6604a3a19 Merge branch 'MDL-76941-400-2' of https://github.com/HuongNV13/moodle into MOODLE_400_STABLE 2023-03-29 09:31:43 +08:00
Jun Pataleta 13fec4131e MDL-77783 core: Validate sublugins.json
* Validate the decoded subplugins.json before processing it.
* Log errors if subplugins.json is invalid or if plugintypes is not
defined.
2023-03-29 09:29:51 +08:00
Jun Pataleta 9ebea4011e MDL-77761 core_form: Add label for editor format selector 2023-03-29 08:09:46 +08:00
Eloy Lafuente (stronk7) 87fbf39aae MDL-77333 mod_resource: fixes generator uploading files + tests
MDL-76499 revealed a few problems with resource generators:

1. We were not covering with unit tests the upload of files from disk
   (and here it's where the problem was).
2. There was a little of confusion between disk paths (only needed
   to upload files) and file_area paths (the generator only creates
   or uploads files to the root directory of the file area.
3. It was possible to request the upload of a file to the generator
   without that file effectively existing.

This commit fixes those points  and covers 99% of the generator code.
2023-03-28 19:06:26 +02:00
Paul Holden 6273e6fdf3 weekly release 4.0.7+ 2023-03-28 15:55:22 +01:00
Paul Holden e8be539742 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-03-28 15:55:20 +01:00
Paul Holden 5b94923b7a Merge branch 'MDL-77105-400-4' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-03-28 12:39:05 +01:00
Jun Pataleta e736f80017 MDL-77105 core: Cast custom data to an array when evaluating filtericon
Since other modules may treat custom data as an object, we need to make
cast it to an array before evaluating for the `filtericon` custom data.
2023-03-28 18:54:04 +08:00
Huong Nguyen c7cc232e16 MDL-76941 tool_usertours: Fix accessibility issue when resizing 2023-03-28 12:18:24 +07:00
Jun Pataleta 07a3a15eb7 Merge branch 'MDL-77630-400' of https://github.com/meirzamoodle/moodle into MOODLE_400_STABLE 2023-03-28 12:06:24 +08:00
Jake Dallimore 07f644d2ec Merge branch 'MDL-77105-400-4' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-03-28 11:42:54 +08:00
Meirza aac223ade5 MDL-77630 mod_forum: correct typo in variable names 2023-03-28 09:42:07 +07:00
Jun Pataleta c1a94a7d52 Merge branch 'MDL-77670-400' of https://github.com/juancs/moodle into MOODLE_400_STABLE 2023-03-28 07:05:30 +08:00
Paul Holden beaff418ba MDL-77762 contentbank: always provide exit button when appropriate.
If the current user can access the content bank in the context of the
current item, then provide link back to it.
2023-03-27 18:08:50 +01:00
Paul Holden ff1b86ab60 MDL-77764 contentbank: add field label to context selection element. 2023-03-27 16:55:00 +01:00
Sara Arjona 191ef569b5 Merge branch 'MDL-76376_m40' of https://github.com/jrchamp/moodle into MOODLE_400_STABLE 2023-03-27 16:56:36 +02:00
Sara Arjona 307be1189c Merge branch 'MDL-77659_400' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_400_STABLE 2023-03-27 16:50:37 +02:00
Sara Arjona 3cfe37dd29 Merge branch 'MDL-73226-400' of https://github.com/jleyva/moodle into MOODLE_400_STABLE 2023-03-27 16:08:32 +02:00
Juan Leyva bb4329278b MDL-73226 files: Add quota checks to core_user_add_user_private_files 2023-03-27 13:27:59 +02:00
Sara Arjona f6d297a920 Merge branch 'MDL-76303-400' of https://github.com/ssj365/moodle into MOODLE_400_STABLE 2023-03-27 12:41:50 +02:00
Paul Holden 36edc365ea Merge branch 'MDL-77729_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-27 11:09:27 +01:00
Sara Arjona ed55a94fe8 Merge branch 'MDL-77561-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-03-27 11:43:32 +02:00
Paul Holden 551edbb9a6 MDL-77555 reportbuilder: improve SQL generation within filters.
Use native ANSI SQL syntax for numeric comparisons where possible,
define filter API for the case where filters must re-use the given
field SQL while ensuring uniqueness of any field parameters.
2023-03-27 10:29:37 +01:00
Paul Holden 478861b4d1 MDL-77555 reportbuilder: method to ensure unique parameters in SQL. 2023-03-27 10:29:37 +01:00
Jun Pataleta 22768e349a MDL-77105 core: Add upgrade.txt notes 2023-03-27 14:03:48 +08:00
Jun Pataleta 6ad9bb2482 MDL-77105 mod_url: Declare filtericon custom data
* Set a custom data `filtericon` when the icon being rendered for the
URL resource is not equal to the default plugin icon.
2023-03-27 14:03:47 +08:00
Jun Pataleta fd953966d8 MDL-77105 mod_lti: Add 'nofilter' class for custom tool icons
Add a '.nofilter' class when rendering custom tool icons in order
to render them as is and without CSS filter on the activity chooser.
2023-03-27 14:03:34 +08:00
Jun Pataleta 82db828016 MDL-77105 core_course: Add 'nofilter' class for non-monologo icons
When rendering content items, check whether the plugin has monologo
icons. If so, add a 'nofilter' class so the plugin icon can be
rendered as is and without the CSS filter.
2023-03-27 14:03:21 +08:00
Jun Pataleta 6a409c4cd4 MDL-77105 block_timeline: Add 'nofilter' class when necessary
Add the `.nofilter` class for activity icons when the icon URL's
`filtericon` parameter is not set, so they get rendered as they are on
the timeline block.
2023-03-27 14:03:07 +08:00
Jun Pataleta 894a6ab5ad MDL-77105 block_recentlyaccesseditems: Add 'nofilter' class
Add the `.nofilter` class for activity icons when the icon URL's
`filtericon` parameter is not set, so they get rendered as they are on
the recently accessed items block.
2023-03-27 14:02:51 +08:00
Jun Pataleta 5b1daccb92 MDL-77105 theme_boost: Add 'nofilter' class when necessary
Add the `.nofilter` class for activity icons when the icon URL's
`filtericon` parameter is not set, so they get rendered as they are on
the context header on the activity page.
2023-03-27 13:48:47 +08:00
Jun Pataleta f005111165 MDL-77105 course_format: Add 'nofilter' class when necessary
Add the `.nofilter` class for activity icons when the icon URL's
`filtericon` parameter is not set, so they get rendered as they are on
the course homepage.
2023-03-27 13:48:46 +08:00
Jun Pataleta 1e30a80b7f MDL-77105 core: Conditionally apply icon filter
* Apply the filter CSS property only to activity icons
that don't have the ".nofilter" class. This will allow
activities with non-SVG icons to be rendered as they are.
2023-03-27 13:48:44 +08:00
Jun Pataleta 0778d512fe MDL-77105 core: Add a filtericon parameter to course mod icon URLs
* If a plugin defines a `filtericon` custom data or uses its monologo
version of the icon, a `filtericon` parameter is being added to the
icon's URL. This information can help plugins determine whether to
render the activity icon as is or with CSS filtering.
2023-03-27 13:45:35 +08:00
Jun Pataleta 8812990c85 MDL-77105 core: Method to determine whether a plugin has monolog icons 2023-03-27 13:45:32 +08:00
Brendan Heywood 2d651dc665 MDL-77749 admin: Fix code error with unset config duration 2023-03-26 16:14:11 +11:00
AMOS bot 1018c8a4c5 Automatically generated installer lang files 2023-03-26 00:07:38 +00:00
Tim Hunt 60220de680 MDL-77729 qformat_missingword: fix form of help link 2023-03-25 15:40:27 +00:00
Tim Hunt b7d7b84d30 MDL-75017 questions: give a clear error if the context type is invalid 2023-03-24 13:02:30 +00:00
Tim Hunt 8169d1da07 MDL-75017 questions: fix weird setup in qformat_xml_import_export_test 2023-03-24 13:02:28 +00:00
Sara Arjona 8af994f1f0 weekly release 4.0.7+ 2023-03-24 13:59:36 +01:00
Jun Pataleta 8ca6ffa077 Merge branch 'MDL-77669-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-24 11:51:25 +08:00
Jun Pataleta 3904547719 Merge branch 'MDL-77626_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-24 10:40:30 +08:00
Simey Lameze 74a28bde79 MDL-77561 behat: add step to accept dpa and enable bigbluebutton
The step i_enable_plugin cannot be used as bigbluebuttonbn_default_dpa_accepted
setting needs to be enable in order for the BigBlueButton plugin to be enabled.
2023-03-24 08:23:27 +08:00
Sara Arjona 5fb543fa45 Merge branch 'MDL-77666-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-23 17:53:53 +01:00
Shamiso.Jaravaza f19e245f29 MDL-76303 mod_bigbluebuttonbn: Fix userlimit 2023-03-23 08:22:29 -06:00
Paul Holden 922713d626 Merge branch 'MDL-77392-400' of https://github.com/srobotta/moodle into MOODLE_400_STABLE 2023-03-23 12:25:24 +00:00
Stephan Robotta ac7720b956 MDL-77392 calendar: calendar items are hidden because of settings 2023-03-23 12:52:32 +01:00
Paul Holden 712cdd0fc6 Merge branch 'MDL-77691-400' of https://github.com/roland04/moodle into MOODLE_400_STABLE 2023-03-23 11:43:42 +00:00
Sara Arjona f575d8fc82 Merge branch 'MDL-77380-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-03-22 14:06:14 +01:00
Sara Arjona 03a41fa881 Merge branch 'MDL-77692-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-22 13:50:19 +01:00
Ilya Tregubov 11a1ac8913 weekly release 4.0.7+ 2023-03-22 09:37:13 +08:00
Ilya Tregubov c35fd3566c Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-03-22 09:37:11 +08:00
Mark Johnson 6597f8f7f5 MDL-74452 quiz: Display an error if all versions are in draft status 2023-03-21 15:24:52 +00:00
Mikel Martín e04daa31e4 MDL-77691 behat: Add step to navigate to profile page directly 2023-03-21 08:10:16 +01:00
Simey Lameze bde844c57c MDL-77380 block_myoverview: improve show toggle functionality test 2023-03-21 14:47:33 +08:00
Angelia Dela Cruz 7c007b8f32 MDL-77577 Behat: Replaced the use of "Install selected language pack(s)
Evaluated usage of "Install selected language pack(s)" in Behat and
replaced the steps to use generator to install language packs as part
of test setup.
2023-03-21 12:13:20 +08:00
Jun Pataleta c68493a349 Merge branch 'MDL-75746_400_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_400_STABLE 2023-03-21 12:00:55 +08:00
Meirza 529187a82a MDL-77669 dml: Added extrainfo in the DB options config.
extrainfo is an extra information for the DB driver, e.g. SQL Server,
has additional configuration according to its environment,
which the administrator can specify to alter and override any connection options.

Co-authored-by: LukeCarrier <luke@carrier.im>

This is a backport of MDL-64153.
2023-03-21 08:48:39 +08:00
Ilya Tregubov c38582b409 Merge branch 'mdl-72533-event-table-performance-MOODLE_400_STABLE' of https://github.com/petersistrom/moodle into MOODLE_400_STABLE 2023-03-21 08:24:54 +08:00
Paul Holden b0872b6aa5 Merge branch 'MDL-72124_400_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_400_STABLE 2023-03-20 17:04:56 +00:00
Paul Holden 8f296f6528 MDL-77692 reportbuilder: format custom field condition/filter names. 2023-03-20 16:32:16 +00:00
Sara Arjona 1b7f761528 Merge branch 'MDL-77574-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-03-20 17:06:11 +01:00
Anupama Sarjoshi 2d9536f980 MDL-77659 core_reportbuilder: fix user profile fields phpunit tests 2023-03-20 13:46:36 +00:00
Sara Arjona 9845799ed6 Merge branch 'MDL-77523-400' of https://github.com/juancs/moodle into MOODLE_400_STABLE 2023-03-20 13:42:55 +01:00
Mark Sharp 23e15c1ae2 MDL-72533 core_calendar: improve calendar event table peformance
- Filter searchable courses if set.
- Sites with large groups should now experience better performance.
- Applies and optimises query against a proper date range.

Co-authored-by: Mark Sharp <mark.sharp@solent.ac.uk>
Co-authored-by: Peter Sistrom <petersistrom@catalyst-au.net>
Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
2023-03-20 12:17:31 +11:00
AMOS bot 5bbdf8ab51 Automatically generated installer lang files 2023-03-20 00:07:37 +00:00
Brendan Heywood f42ac85b7e MDL-77618 admin: Passwords should not auto complete 2023-03-18 13:03:38 +11:00
AMOS bot 6a566abcd9 Automatically generated installer lang files 2023-03-18 00:07:38 +00:00
Juan Segarra Montesinos c0a05c9d8a MDL-77670 course: Preserve course summary format 2023-03-17 20:53:08 +01:00
Sara Arjona a971b89389 weekly release 4.0.7+ 2023-03-17 17:58:33 +01:00
Sara Arjona 10a640c25e Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-03-17 17:58:25 +01:00
Jun Pataleta c0373ed7f7 Merge branch 'MDL-76257-400' of https://github.com/juancs/moodle into MOODLE_400_STABLE 2023-03-17 11:01:14 +08:00
Jun Pataleta 6b7b12c790 Merge branch 'MDL-77608-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-17 10:29:40 +08:00
AMOS bot 213935c460 Automatically generated installer lang files 2023-03-17 00:07:40 +00:00
Paul Holden 75a1e8d843 MDL-77666 contentbank: format category names for display. 2023-03-16 23:27:20 +00:00
info@eWallah.net c5bea842a9 MDL-77584 currencies: Fix outdated ISO 4217 code for Zambian Kwacha
On 2013-01-01 the ZMK code got replaced by the new ZMW code.

AMOS BEGIN
 MOV [ZMK,core_currencies],[ZMW,core_currencies]
AMOS END
2023-03-16 19:53:34 +01:00
Paul Holden 4e758d343a MDL-76339 mod_bigbluebuttonbn: correct upgrade note fix versions. 2023-03-15 19:15:53 +00:00
Paul Holden e889cc49c2 Merge branch 'MDL-76339-400' of https://github.com/call-learning/moodle into MOODLE_400_STABLE 2023-03-15 19:06:02 +00:00
Andrew Nicols 06fa0aad49 Merge branch 'MDL-77550-400' of https://github.com/dpalou/moodle into MOODLE_400_STABLE 2023-03-15 14:26:38 +08:00
Jun Pataleta 4a60dd3205 Merge branch 'MDL-77611_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-15 10:00:58 +08:00
AMOS bot 7c18bb6833 Automatically generated installer lang files 2023-03-15 00:07:36 +00:00
Paul Holden 5eb255f051 MDL-59175 theme_boost: style inherited permission on overide page. 2023-03-14 20:58:04 +00:00
Tim Hunt 88cedd9f99 MDL-77626 quiz statistics: Divide by zero if a random Q has max mark 0 2023-03-14 16:29:59 +00:00
Mark Johnson d1254b0c8d MDL-75746 mod_quiz: Fix backup and restore of quiz slots 2023-03-14 16:07:35 +00:00
Mark Johnson 962ab85122 MDL-72124 question: Fix system-level URLs in question events 2023-03-14 15:40:51 +00:00
Eloy Lafuente (stronk7) 264f458417 weekly release 4.0.7+ 2023-03-14 16:07:41 +01:00
Eloy Lafuente (stronk7) adc9c66e75 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-03-14 16:07:36 +01:00
Jun Pataleta 6ddeef9cab Merge branch 'MDL-76680/400' of https://github.com/skodak/moodle into MOODLE_400_STABLE 2023-03-14 21:44:14 +08:00
Laurent David 68456ca14f MDL-70976 core_files: Allow for draft files url inserted in content
* The file file_remove_editor_orphaned_files should take into account URL that
have been embedded in a tag content instead of an attribute (like src attribute)
* This will fix issue with inserting H5P content in calendar events.
2023-03-14 08:48:40 +01:00
Juan Segarra Montesinos 45d7645598 MDL-76257 core: Activity intro should honor user preference on creation 2023-03-14 06:06:27 +01:00
AMOS bot 2c2bd9e2af Automatically generated installer lang files 2023-03-14 00:07:38 +00:00
Tim Hunt 9cf379579b MDL-77611 tool_uploaduser: fix phpunit assumptions about profile fields 2023-03-13 13:37:52 +00:00
Paul Holden 2919cf9e1b MDL-77608 mod_h5pactivity: namespace component lib testcase. 2023-03-13 09:44:05 +00:00
Simey Lameze 136e636bf0 MDL-77574 myoverview: wait until next button exists before clicking 2023-03-13 14:12:33 +08:00
Jake Dallimore 622f98e637 MDL-77382 core: fix error handling in oauth2 callback for auth'd users
Pass the errors back to the calling code when the user is authenticated,
otherwise, fall back on the existing redirection to the login page.
2023-03-13 10:50:15 +08:00
AMOS bot aa6bfe07ef Automatically generated installer lang files 2023-03-12 00:07:44 +00:00
Petr Skoda 712391f96b MDL-76680 core: disable $USER->ignoresesskey on next page 2023-03-11 10:37:34 +01:00
Jun Pataleta 0fae900b58 Moodle release 4.0.7 2023-03-11 13:10:44 +08:00
Jun Pataleta 202cd371a1 weekly release 4.0.6+ 2023-03-10 22:09:56 +08:00
Jun Pataleta e60107a0d3 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-03-10 22:09:54 +08:00
Ilya Tregubov 1c6dcd21f9 Merge branch 'MDL-77429-400-fix' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-10 14:51:24 +08:00
Andrew Nicols 0be2c46692 MDL-77429 course: Change course date to previous day
When a test runs just after midnight, and the user time zone is not the
same as the server timezone, and the course is created using a generator
(which runs in server time zone) but the UI presented in the user
timezone, the course start time is still in the future.

We need to create the course a day earlier to ensure that the "This
week" indicator is in the correct day.
2023-03-10 14:11:23 +08:00
Andrew Nicols 4027a6f9fb MDL-77037 core_course: Add new courseindex test to classic excludelist 2023-03-10 13:32:15 +08:00
Jun Pataleta 2fc493dd9f Merge branch 'MDL-77458-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-10 12:06:03 +08:00
Jake Dallimore 25f8ff2446 Merge branch 'MDL-77517-400' of https://github.com/juancs/moodle into MOODLE_400_STABLE 2023-03-10 11:41:11 +08:00
Andrew Nicols 4287b7acd9 Merge branch 'MDL-77530-tool-task-checks-MOODLE_400_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_400_STABLE 2023-03-10 11:31:10 +08:00
Jake Dallimore a18d42a1bb Merge branch 'MDL-77219-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-03-10 10:36:45 +08:00
Jun Pataleta baabc32443 Merge branch 'MDL-76603-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-03-10 10:14:49 +08:00
Shamim Rezaie 05d383cdff MDL-76603 gradingforms: Some A11y fixes on editing form
- Use span instead of dummy input elements because form elements need a
  label
- Sufficient size for target is at least 24px by 24px (Success Criteria
  2.5.8)
2023-03-10 10:11:25 +08:00
Shamim Rezaie d6087552d0 MDL-76603 mod_assign: Move advanced grading grades out of the tables 2023-03-10 10:11:25 +08:00
Shamim Rezaie 27c9eb38a0 MDL-76603 gradingform_rubric: preserve bg colour on hover 2023-03-10 10:11:25 +08:00
Shamim Rezaie ea697ca8a0 MDL-76603 gradingform_rubric: fix roles
- set the role of table to none
- moved aria-label from <table> element (that doesn't has role="none")
  to the element that has the radiogroup role
- if it's not radiogroup/radio, it is list/listitem
- removed aria-label from the rubric table and used caption instead
2023-03-10 10:11:25 +08:00
Andrew Nicols 5ba62ce7ae Merge branch 'MDL-76849-400-5' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-03-10 09:29:56 +08:00
Jun Pataleta e851069e97 Merge branch 'MDL-70613-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-10 09:19:33 +08:00
Sara Arjona c231b4ff1b Merge branch 'MDL-77323-400' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_400_STABLE 2023-03-09 16:49:42 +01:00
Paul Holden 72f985e956 MDL-70613 mod_feedback: cast feedback text values for table sorting.
Specifically avoids Oracle ORA-00932 (inconsistent CLOB datatype).
2023-03-09 14:59:16 +00:00
Andrew Nicols 8284e13413 Merge branch 'MDL-77329-400-clr' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-03-09 22:19:25 +08:00
Andrew Nicols 0919443d33 Merge branch 'MDL-77429-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-09 22:11:28 +08:00
Andrew Nicols cdca553678 Merge branch 'MDL-77463-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-09 22:04:05 +08:00
Andrew Nicols aeef022c1c MDL-77037 core_course: Coding style fix in Behat feature 2023-03-09 22:00:00 +08:00
Andrew Nicols 2d3d946eef Merge branch 'MDL-77037-400' of https://github.com/laurentdavid/moodle into MOODLE_400_STABLE 2023-03-09 21:59:56 +08:00
James C fc4a4e6450 MDL-77329 course: Prevent collapse state loss 2023-03-09 12:01:27 +01:00
Sara Arjona abff12eda1 Merge branch 'MDL-76940-400' of https://github.com/laurentdavid/moodle into MOODLE_400_STABLE 2023-03-09 10:54:57 +01:00
Jun Pataleta 2570c08460 Merge branch 'MDL-77533-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-09 16:35:10 +08:00
Jun Pataleta b19ed507d1 Merge branch 'MDL-77559-400-2' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-09 15:53:34 +08:00
Laurent David e5f40a62d4 MDL-77037 core_courseformat: Refresh course index
* Refresh course index when language change
2023-03-09 08:44:28 +01:00
Brendan Heywood e3356e2a5a MDL-77530 tool_task: Fix coding errors in checks 2023-03-09 15:43:28 +11:00
Andrew Nicols 353b25f991 Merge branch 'MDL-77420-400' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-03-09 12:01:41 +08:00
Andrew Nicols f91555d94e Merge branch 'MDL-77014-400' of https://github.com/lucaboesch/moodle into MOODLE_400_STABLE 2023-03-09 11:42:16 +08:00
Andrew Nicols 8cba18bd0d Merge branch '76945-bootstrap-dropdowns-400' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_400_STABLE 2023-03-09 10:54:17 +08:00
Tim Hunt 5022583eec MDL-77467 retore: add progress tracking to potentially slow steps 2023-03-09 10:47:05 +08:00
Jun Pataleta c6abd93efb Merge branch 'MDL-77225_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-09 10:42:53 +08:00
Andrew Nicols 9893e93761 Merge branch 'MDL-77418-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-09 10:37:40 +08:00
Andrew Nicols af4fae4f5b Merge branch 'MOODLE_400_STABLE' of https://github.com/fcbsd/moodle into MOODLE_400_STABLE 2023-03-09 10:29:58 +08:00
Andrew Nicols 1bfc8f2097 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Jun Pataleta aa7d3faddb MDL-76849 qtype_essay: Allow question number inclusion in answer fields
* Have the following classes extend qtype_essay_format_renderer_base
  as they have been meant to:
  - qtype_essay_format_editor_renderer
  - qtype_essay_format_noinline_renderer
  - qtype_essay_format_plain_renderer
* Add a question_display_options instance variable for
qtype_essay_format_renderer_base so its subclasses can use it to
generate the label for their respective answer fields.
2023-03-09 08:58:52 +08:00
Jun Pataleta 05e3716ffe MDL-76849 qtype_shortanswer: Include question number in answer fields 2023-03-09 08:58:52 +08:00
Jun Pataleta f6c5e15bdf MDL-76849 qtype_numerical: Include question number in answer fields
* Also covers its qtype_calculated and qtype_calculatedsimple
which extend its renderer class
2023-03-09 08:58:52 +08:00
Jun Pataleta 9ba9723826 MDL-76849 qtype_multianswer: Include question number in answer fields
* Add the question number to the answer fields if it's available.
* Improve multiple choice question accessibility:
  - Label the multiple choice question groups appropriately by
    enclosing them in fieldset tags and applying sr-only legend tags to
    label them.
  - Apply Bootstrap form-check classes to the radio buttons, so they
    are rendered better and become responsive as well. This also helps
    avoid the use of the table element for layout purposes when
    rendering horizontal multiple choice sub-questions.
2023-03-09 08:58:52 +08:00
Jun Pataleta 716c223db5 MDL-76849 qtype_match: Include question number in answer fields 2023-03-09 08:58:52 +08:00
Jun Pataleta 8c6dbf8561 MDL-76849 qtype_truefalse: Include question number in answer fields
* Improve accessibility as well by grouping the radio buttons
in a fieldset.
2023-03-09 08:58:52 +08:00
Jun Pataleta fd13110bd4 MDL-76849 qtype_multichoice: Include question number in answer fields
* Improve accessibility as well by grouping the radio buttons/checkboxes
in a fieldset.
2023-03-09 08:58:52 +08:00
Jun Pataleta 2a5c62ab88 MDL-76849 qtype_ddwtos: Include question number in answer fields
* Plus include the item number so users will have an idea which blank
numbers they are currently on.
2023-03-09 08:58:52 +08:00
Jun Pataleta bad9e0a1bc MDL-76849 qtype_gapselect: Include question number in answer fields 2023-03-09 08:58:52 +08:00
Jun Pataleta b71d30097e MDL-76849 qtype: Add a questionidentifier instance variable
* Add an instance variable to question_display_options to store the
identifier associated with the question being rendered.
* This information can be used by question type plugins to improve the
accessibility of the answer fields being rendered by adding the
question identifier to the answer fields' labels.
* Adding the question identifier to the label can be achieved by using
question_display_options::add_question_identifier_to_label().

Co-authored-by: Tim Hunt <t.j.hunt@open.ac.uk>
2023-03-09 08:58:52 +08:00
Andrew Nicols 1852ad42b5 MDL-77559 js: Revert "MDL-75012 core: Bump NodeJS version requirements"
This reverts commit 7dc9c54ff6.
2023-03-09 08:21:36 +08:00
Andrew Nicols 3a0b800be7 MDL-77559 js: Revert "MDL-75012 js: Bump standard dependencies"
This reverts commit 86cc29f021.
2023-03-09 08:21:22 +08:00
Andrew Nicols 9e7a6d1c79 MDL-77559 js: Revert "MDL-75012 js: Remove grunt-contrib-uglify"
This reverts commit 415c9de634.
2023-03-09 08:21:19 +08:00
Andrew Nicols 7553895409 MDL-77559 js: Revert "MDL-75012 js: Bump stylelint and components"
This reverts commit e431f3a4d6.
2023-03-09 08:21:16 +08:00
Andrew Nicols 80a06b2966 MDL-77559 js: Revert "MDL-75012 js: Update browserslist"
This reverts commit a1d646d621.
2023-03-09 08:21:12 +08:00
Andrew Nicols e9e77f32e9 MDL-77559 js: Revert "MDL-75012 js: Bump node-sass"
This reverts commit d418ca209e.
2023-03-09 08:21:07 +08:00
Andrew Nicols c3097aab8c MDL-77559 js: Revert "MDL-75012 js: Audit fix"
This reverts commit 73d25ec0c6.
2023-03-09 08:21:03 +08:00
Andrew Nicols 290a7cffea MDL-77559 js: Revert "MDL-75012 js: Use our own jsdoc wrapper"
This reverts commit b7c2924b68.
2023-03-09 08:20:57 +08:00
Andrew Nicols 92b235d31b MDL-77559 js: Revert "MDL-75012 js: Bump shifter to new version"
This reverts commit 95b47d2432.
2023-03-09 08:20:53 +08:00
Andrew Nicols 9ea97cc350 MDL-77559 js: Revert "MDL-75012 js: Put shifter on a diet"
This reverts commit 77d822898a.
2023-03-09 08:20:49 +08:00
Andrew Nicols 62ed5dfd27 MDL-77559 js: Revert "MDL-75012 js: Remove unused babel-preset-minify dependency"
This reverts commit 8412495f5e.
2023-03-09 08:20:45 +08:00
Andrew Nicols dcabe38876 MDL-77559 js: Revert "MDL-75012 js: Bump Babel dependencies"
This reverts commit c90054e98e.
2023-03-09 08:20:42 +08:00
Andrew Nicols 3c05e673a3 MDL-77559 js: Revert "MDL-75012 js: Remove orphaned source maps"
This reverts commit 181e8f7686.
2023-03-09 08:20:09 +08:00
AMOS bot 1fd4f4b11b Automatically generated installer lang files 2023-03-09 00:07:38 +00:00
Tim Hunt f5645cf4a8 MDL-77225 questions: fix regrade of descriptions in finished attempts
The added logic is similar to the logic in other behaviours, and the new test fails without it.
2023-03-08 19:01:05 +00:00
Sara Arjona 4555270cfc Merge branch 'MDL-77464_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-08 16:14:53 +01:00
Laurent David a49c1483aa MDL-76940 core_courseformat: Index refreshing when role switch
* Hidden sections and content should not visible to students when switching role
2023-03-08 11:51:34 +01:00
Ilya Tregubov 7601dd8b7b Merge branch 'MDL-77414-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-08 17:05:46 +08:00
Angelia Dela Cruz a50c324721 MDL-77463 Behat: Coverage for assign submission notification to teacher 2023-03-08 17:03:53 +08:00
Angelia Dela Cruz 1885fd9a2f MDL-77429 Behat: Add coverage for changing course format as teacher 2023-03-08 15:49:32 +08:00
Luca Bösch 655cae8cc4 MDL-77014 course: Single activity format course title multilang. 2023-03-08 08:27:36 +01:00
Angelia Dela Cruz aacd3761aa MDL-77414 Behat: Coverage for "Require all group members submit" setting 2023-03-08 14:51:47 +08:00
Dani Palou 778840f1d7 MDL-77550 lesson: Format decimals in feedback page 2023-03-08 07:45:05 +01:00
Sara Arjona ff437575bc Merge branch 'MDL-77440_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-08 07:24:35 +01:00
Jun Pataleta c57bb0107c Merge branch 'MDL-77472-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-08 11:53:34 +08:00
Petr Skoda f057226154 MDL-77524 filter_algebra: fix error message 2023-03-08 11:27:13 +08:00
Paul Holden b946c528b0 MDL-75517 report_participation: filter report by viewable roles only. 2023-03-08 10:38:02 +08:00
Michael Hawkins e835233465 MDL-77204 mod_wiki: Clean filename in Moodle1 backup 2023-03-08 10:33:57 +08:00
Paul Holden 724c4fa373 MDL-77046 availability: validate profile field in condition. 2023-03-08 10:24:26 +08:00
Paul Holden 1bb6bd7381 MDL-76809 gradereport_history: pre-filter report userids filter.
Ensure current user is able to access each of the provided userids.
2023-03-08 10:01:08 +08:00
Ilya Tregubov 1cd3788793 Merge branch 'MDL-77446-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-08 09:19:27 +08:00
Petr Skoda 1d23929fa9 MDL-76645 filter_data: fix link title attribute 2023-03-08 00:55:19 +00:00
Paul Holden 586168df7c MDL-77129 tool_lp: remove redundant call to set page header. 2023-03-08 00:55:19 +00:00
Lars Bonczek e52133c631 MDL-75659 core: Don't render component argument twice in mustache pix helper 2023-03-08 00:55:19 +00:00
Jun Pataleta baca8dd626 Merge branch 'MDL-77416-400-enfix' of https://github.com/vmdef/moodle into MOODLE_400_STABLE 2023-03-08 08:50:16 +08:00
AMOS bot f0817b2e97 Automatically generated installer lang files 2023-03-08 00:07:40 +00:00
Roberto Bravo 756f56492e MDL-77256 tool_uploaduser: fix get allowed roles for courses
During user upload the permission to assign roles is checked in the wrong context
2023-03-07 18:38:46 +01:00
Tim Hunt 1397ce352a MDL-77464 questions: regrading was losing question_attempt metadata
This is very similar to MDL-77090, but at the time, I missed that this
also needed to be handled. (Question metadata is, I think, only used
by the quiz 'Try another question like this one' feature.)
2023-03-07 13:43:12 +00:00
Tim Hunt 33e98afe3c MDL-77464 questions: update comments in question_attempt_step
The class comment had some inaccuracies which I fixed.
I also replaced all uses of @link with @see.
2023-03-07 13:42:59 +00:00
Sara Arjona c11c5d26cd MDL-77219 behat: Fix issue with headless
Although the error in the "I check that I can import recordings into
the Recording activity and then if I delete them" scenario is unrelated
to this patch, this commit needs to be applied too, in order to avoid
behat failures (because the "Import recording links" button is in the
edge of the window).

This is a backport of MDL-74272.
2023-03-07 11:04:13 +01:00
Sara Arjona 6703d67439 MDL-77219 theme_boost: Remove plugin name on course page
In 4.0, the plugin name was added above their name. Based on the community
feedback and the research done by the UX team, this needs to be removed.
This commit removes the activity name when edit mode is disabled.

This is a backport of MDL-74272.
2023-03-07 11:04:12 +01:00
Angelia Dela Cruz 277c0ffc0d MDL-77446 Behat: Add coverage for changing uploaded file details 2023-03-07 16:13:26 +08:00
Andrew Nicols 6436f1532d Merge branch 'MDL-77094_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-07 12:23:24 +08:00
Andrew Nicols 95a95a80b0 Merge branch 'MDL-77336-400' of https://github.com/meirzamoodle/moodle into MOODLE_400_STABLE 2023-03-07 12:02:22 +08:00
AMOS bot ebe39a84db Automatically generated installer lang files 2023-03-07 00:07:38 +00:00
Tim Hunt 5c261335c7 MDL-77440 quiz: fix nav error reviewing after redoing a question 2023-03-06 16:17:30 +00:00
Sara Arjona 6b4edc0068 Merge branch 'MDL-77460-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-03-06 16:34:08 +01:00
Paul Holden 3fc4c17115 MDL-77472 grade: correct URL param type for adding tracking params. 2023-03-06 09:50:03 +00:00
Meirza 4a0793d898 MDL-77336 admin: fix typo in adminpreset data settings. 2023-03-06 16:46:54 +07:00
Paul Holden 91178b70f5 MDL-77533 customfield: fix exception thrown during handler retrieval. 2023-03-06 09:27:21 +00:00
Juan Segarra Montesinos 5fc2612d25 MDL-77523 mod_data: textarea field should honor editor preferred format 2023-03-05 08:53:02 +01:00
Juan Segarra Montesinos 04bb96886d MDL-77517 js: Disable "Edit mode" button when clicked
When clicked, disable the "Edit mode" button just before doing a
redirection. It's been reported that after clicling several times the
button, an inconsistent state between the button and the editing mode is
achieved. The patch mitigates the issue.
2023-03-05 07:06:24 +01:00
Víctor Déniz 1eeb10cf08 MDL-77416 lang: Use fixed strings in tests 2023-03-03 13:21:02 +00:00
Helen Foster 201e5c1103 MDL-77416 lang: Import fixed English strings (en_fix) 2023-03-03 13:21:02 +00:00
Jun Pataleta 1635a0f1b0 Merge branch 'MDL-77428-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-03 16:34:58 +08:00
Jun Pataleta 3ca56cb7f1 MDL-76849 question: New lang strings for answer fields 2023-03-03 15:32:45 +08:00
Laurent David 55620756a5 MDL-76339 mod_bigbluebuttonbn: Update dismissed recordings
* When the server is not reachable (or recordings are not reacheable)
the recording is set to RECORDING_STATUS_DISMISSED and is then
not visible in the list.
* Add a CLI script to solve potential issue with DISMISSED recordings
2023-03-03 06:38:26 +01:00
Jake Dallimore 62cfa26cb9 weekly release 4.0.6+ 2023-03-03 11:08:39 +08:00
Jake Dallimore b890f223e4 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-03-03 11:08:36 +08:00
Andrew Nicols e2eb63f1d9 MDL-77458 core: Add supported php version info to phpcs config 2023-03-02 20:37:52 +08:00
Simey Lameze fc5eba83d2 MDL-77460 behat: improve roles.feature test 2023-03-02 18:25:22 +08:00
Angelia Dela Cruz 51a25fac44 MDL-77428 Behat: Add coverage for forum post word count 2023-03-02 13:47:25 +08:00
Jun Pataleta 181e8f7686 MDL-75012 js: Remove orphaned source maps 2023-03-02 13:13:42 +08:00
Jun Pataleta f5f3457173 Merge branch 'MDL-75012-400-5' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-02 12:28:05 +08:00
Andrew Nicols 58f411d2f1 MDL-75012 js: Full build of all grunt things 2023-03-02 12:15:25 +08:00
Andrew Nicols c90054e98e MDL-75012 js: Bump Babel dependencies
Please note that whilst some dependencies have higher versions
available, these are not compatible at this time.
2023-03-02 12:15:25 +08:00
Andrew Nicols 8412495f5e MDL-75012 js: Remove unused babel-preset-minify dependency 2023-03-02 12:15:25 +08:00
Jun Pataleta 2382d6188e Merge branch 'MDL-75719-400-4' of https://github.com/ilyatregubov/moodle into MOODLE_400_STABLE 2023-03-02 11:59:19 +08:00
Jake Dallimore 3f5d3f8952 Merge branch 'MDL-77461-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-02 11:42:55 +08:00
Paul Holden 7278c5f5b4 MDL-77368 forms: remove console logging of upload DOM element. 2023-03-02 11:20:09 +08:00
Andrew Nicols 0d08af8de6 MDL-77461 behat: Use get_course_id instead of DB fetch 2023-03-02 11:06:53 +08:00
Ilya Tregubov 8585a70700 MDL-75719 completion: Add Behat scenario for completion states. 2023-03-02 11:05:31 +08:00
Ilya Tregubov 62d0d76fe1 MDL-75719 completion: Fix unit tests and Behat tests.
Fix tests since we changed behavior of completions (completion
state an UI).
2023-03-02 11:05:30 +08:00
Ilya Tregubov 710fa8ed7a MDL-75719 completion: Fix viewed criteria.
When we unlock completion criteria and save changes 'viewed' criteria
still should be completed if user has viewed activity before. Seems
that that was broken by recent changes. Fixing here.
2023-03-02 11:05:30 +08:00
Ilya Tregubov 64efaed528 MDL-75719 completion: Fix completion state for hidden grade items.
For hidden grade items we used to mark students as completed if
they have any grade. But this was not working correctly when we
also set pass grade for activity and completion criteria based
on pass grade. So we will have these completion states

Competion criteria 'Receive grade':
No grade - COMPLETION_INCOMPLETE
Grade visible, achieved passing grade - COMPLETION_COMPLETE_PASS
Grade visible, failed passing grade - COMPLETION_COMPLETE_FAIL
Grade hidden - COMPLETION_COMPLETE

Completion criteris 'Receive passing grade'
No grade - COMPLETION_INCOMPLETE
Grade visible, achieved passing grade - COMPLETION_COMPLETE_PASS
Grade visible, failed passing grade - COMPLETION_COMPLETE_FAIL
Grade hidden, achieved passing grade - COMPLETION_COMPLETE_PASS
Grade hidden, failed passing grade - COMPLETION_COMPLETE_FAIL_HIDDEN
2023-03-02 11:05:30 +08:00
Jake Dallimore 9de063d19b Merge branch 'MDL-77318-400' of https://github.com/Utdanningsdirektoratet/moodle into MOODLE_400_STABLE 2023-03-02 10:56:15 +08:00
Andrew Nicols dd651bfe75 Merge branch 'MDL-77150-400' of https://github.com/roland04/moodle into MOODLE_400_STABLE 2023-03-02 10:49:02 +08:00
Andrew Nicols a3984be80b Merge branch 'MDL-75534-400-forum-usermodified-zero' of https://github.com/mudrd8mz/moodle into MOODLE_400_STABLE 2023-03-02 10:39:07 +08:00
Jake Dallimore 926a143dd6 Merge branch 'MDL-76298_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-02 10:13:23 +08:00
Jun Pataleta c5a99daa0c Merge branch 'MDL-77413-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-02 09:45:48 +08:00
Andrew Nicols 1ceb4e2691 Merge branch 'MDL-77391-m400' of https://github.com/jrchamp/moodle into MOODLE_400_STABLE 2023-03-02 09:27:17 +08:00
Andrew Nicols d46f7f29ce Merge branch 'MDL-77321-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-02 09:25:16 +08:00
Jun Pataleta 8d2296ef33 Merge branch 'MDL-74586-400-sqlrss' of https://github.com/mudrd8mz/moodle into MOODLE_400_STABLE 2023-03-02 08:58:15 +08:00
Jun Pataleta b961e519cf Merge branch 'MDL-76938_restore_comments_400' of https://github.com/davosmith/moodle into MOODLE_400_STABLE 2023-03-02 08:41:37 +08:00
AMOS bot 7995a6a7c9 Automatically generated installer lang files 2023-03-02 00:07:43 +00:00
fcbsd fc1adc914c MDL-77365 count_words: Make span> an inline tag MOODLE_400_STABLE 2023-03-01 16:05:24 +00:00
Jun Pataleta 5003c32dd2 Merge branch 'MDL-77417_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-03-01 23:54:09 +08:00
Mikel Martín 3bb68aefc0 MDL-77150 core_table: Fix classes added as columnsattributes are ignored
Fix columnattributes with key 'class' being ingored by adding them to every 'column_class'.
2023-03-01 11:16:23 +01:00
hieuvu 8304ad73a7 MDL-77323 question: Prevent drag item sent into two drop zone 2023-03-01 14:46:40 +07:00
Andrew Nicols 146441bf58 Merge branch 'MDL-58945_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-01 10:55:49 +08:00
Andrew Nicols e3264a1ebc Merge branch 'MDL-74585-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-01 10:52:07 +08:00
Andrew Nicols 960a32b2ae Merge branch 'MDL-77322_basicauth_checkbox-400' of https://github.com/leonstr/moodle into MOODLE_400_STABLE 2023-03-01 10:50:02 +08:00
Andrew Nicols 0082649a28 Merge branch 'MDL-72727-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-01 10:47:16 +08:00
AMOS bot 6e9ff0e536 Automatically generated installer lang files 2023-03-01 00:07:36 +00:00
Jonathan Champ 0e23d91ec3 MDL-77391 question admin: further improve query peformance in qtypes.php 2023-02-28 10:18:46 -05:00
Andrew Nicols a9cc05c9fd Merge branch 'MDL-77097_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-02-28 22:14:03 +08:00
David Mudrák 06d446aec1 MDL-74586 rss: Make rss_get_userid_from_token() use table index
Due to missing `AND k.script = 'rss'` condition, the query did not make
use of the existing script-value compound index defined for the table.
So it had to perform the full sequential scan for all rows when
searching for the token. This had serious performance issues on sites
with many users, especially in case on non-existing token / key.
2023-02-28 13:26:12 +01:00
Angelia Dela Cruz bef92dfbdc MDL-77413 Behat: Minor changes to optimise the existing tests 2023-02-28 17:23:58 +08:00
Angelia Dela Cruz 63a788899f MDL-77413 Behat: Add coverage to verify groups can have a picture 2023-02-28 17:23:40 +08:00
Jun Pataleta f5f57ba477 Merge branch 'MDL-77248-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-02-28 15:46:43 +08:00
Andrew Nicols 13a1d1d661 MDL-77248 mod_bigbluebuttonbn: Remove unused dpa pages 2023-02-28 12:04:51 +08:00
Andrew Nicols 223cdb0ed9 MDL-77248 mod_bigbluebuttonbn: Set dpa accepted when creating activities
This only applies when creating activities using the test data
generator.
2023-02-28 12:04:51 +08:00
Andrew Nicols c3f0e5ddaa MDL-77248 core: Move pre_enable_plugin_actions callback to enable_plugin 2023-02-28 12:04:51 +08:00
Andrew Nicols 77d822898a MDL-75012 js: Put shifter on a diet
This commit switches to a new custom version of Shifter which sees it
put on a massive diet.

Many of the standard Shifter features are totally unused by Moodle, but
they add dependency spaghetti. Some of those dependencies will start to
cause us issues as they have not been updated for a very long time, are
no longer maintained, and are no longer compatible with anything
resembling a recent version of NodeJS.
2023-02-28 10:22:45 +08:00
Andrew Nicols 95b47d2432 MDL-75012 js: Bump shifter to new version
This resolves an issue identified in 77083 which identified that GitHub
hashes shouldn't be treated as repeatable.

Whilst GitHub have reverted this change, it's still worth making this
change.
2023-02-28 10:19:51 +08:00
Andrew Nicols b7c2924b68 MDL-75012 js: Use our own jsdoc wrapper
grunt-jsdoc is abandoned and only works with an older version of jsdoc.

This is a very simple wrapper around jsdoc itself.
2023-02-28 10:19:51 +08:00
Andrew Nicols 73d25ec0c6 MDL-75012 js: Audit fix 2023-02-28 10:19:51 +08:00
Andrew Nicols d418ca209e MDL-75012 js: Bump node-sass 2023-02-28 10:19:51 +08:00
Andrew Nicols a1d646d621 MDL-75012 js: Update browserslist
To avoid build changes we exclude older versions of Android browser
2023-02-28 10:19:51 +08:00
Andrew Nicols e431f3a4d6 MDL-75012 js: Bump stylelint and components 2023-02-28 10:19:50 +08:00
Andrew Nicols 415c9de634 MDL-75012 js: Remove grunt-contrib-uglify
We stopped using this when we updated our processes to support ESMs in
MDL-62497. Removal of the dependency was missed at the time.
2023-02-28 10:19:50 +08:00
Andrew Nicols 86cc29f021 MDL-75012 js: Bump standard dependencies
This change bumps dependencies which have no impact upon the build
process
2023-02-28 10:19:50 +08:00
Andrew Nicols 7dc9c54ff6 MDL-75012 core: Bump NodeJS version requirements 2023-02-28 10:19:50 +08:00
Jun Pataleta 4200e6ee16 Merge branch 'MDL-76956-m400' of https://github.com/sammarshallou/moodle into MOODLE_400_STABLE 2023-02-28 10:07:27 +08:00
Paul Holden 8ce95fe759 MDL-72727 mod_forum: prevent default favourite toggle click event.
Allow the repository call to the web service method to complete before
re-directing, otherwise the call may not complete and/or races against
the page reload causing random Behat errors.
2023-02-27 23:30:40 +00:00
Paul Holden b60518501f MDL-77321 reportbuilder: cache list of loaded reports per user.
Since 0188af39 we've cached loaded reports, however there was an
edge case in those report sources that relied on the current user
as part of their own initialization (e.g. checking capabilities).

Co-authored-by: Marina Glancy <marina@moodle.com>
2023-02-27 21:21:45 +00:00
Paul Holden 3178dd5bb2 MDL-77418 mod_feedback: defensive use of analysis item data. 2023-02-27 19:21:33 +00:00
Ferran Recio e8bbcdae2c MDL-77420 core: fix modal close button on remove on close 2023-02-27 19:11:03 +01:00
Eloy Lafuente (stronk7) 0b6625e736 MDL-77417 behat: behat_error_handler meets deprecation error types
Right now, any E_DEPRECATED, E_USER_DEPRECATED error type leads
to exception in behat runs, because the behat error handled is
not aware of them. See MDL-38041 for the initial implementation.

We don't want that to happen and they must behave like other "low"
error types (notices, warnings...), that will be reported in logs
or output, but won't trigger any exception, so the test can continue.

This commit just adds those 2 "new" error types to the handler,
providing the very same behaviour for them than the rest.
2023-02-27 09:38:08 +01:00
Leon Stringer 079a2e0061 MDL-77322 oauth2: Fix basicauth checkbox
Following MDL-61880 you could turn on "Authenticate token requests via
HTTP headers" but not turn this off again.  This change fixes this and
adds a Behat scenario to test toggling this checkbox is saved
correctly.
2023-02-24 17:28:05 +00:00
Eloy Lafuente (stronk7) c0786c11c0 MDL-77097 store_mongodb: keep compatibility with PHP 7.4
Replaced 4 occurrences of get_debug_type() by gettype() to keep PHP 7.4 compatibility. Note this
has not been applied to 4.2dev and up because, there, it's safe to use get_debug_type().
2023-02-24 12:38:55 +01:00
Jun Pataleta 6458658400 weekly release 4.0.6+ 2023-02-24 15:43:29 +08:00
Jun Pataleta c3c22e7219 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-02-24 15:43:26 +08:00
Matt Porritt d38a0b2100 MDL-77376 Licensing: Update trademark.txt
Update Trademark policy in TRADEMARK.txt to
be in line with advice from the Moodle HQ
legal team
2023-02-24 12:35:35 +08:00
Andrew Nicols 2cde600dd2 Merge branch 'MDL-76611-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-23 12:01:42 +08:00
Andrew Nicols ce4622ec99 Merge branch 'MDL-76843_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-23 11:53:26 +08:00
Andrew Nicols 8c455b4ad6 Merge branch 'MDL-77271-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-02-23 11:49:36 +08:00
Ilya Tregubov fd5559e3d4 MDL-74433 mod_assign: Fix version.php 2023-02-23 11:47:35 +08:00
Ilya Tregubov acc02e0631 Merge branch 'MDL-74433_400' of https://github.com/larsbonczek/moodle into MOODLE_400_STABLE 2023-02-23 11:23:00 +08:00
Andrew Nicols e6ff8205f9 Merge branch 'MDL-77352-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-23 11:20:30 +08:00
Andrew Nicols c5c621dfce Merge branch 'MDL-75005_40' of https://github.com/skodak/moodle into MOODLE_400_STABLE 2023-02-23 10:29:41 +08:00
Andrew Nicols 6df8e613be MDL-77230 mod_feedback: Coding style violation fixes 2023-02-23 10:06:19 +08:00
Andrew Nicols 484516b450 Merge branch 'MDL-77230-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-02-23 10:06:16 +08:00
Ilya Tregubov 8d68d6c050 Merge branch 'MDL-76873-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-23 09:58:31 +08:00
Andrew Nicols 4a1e1081a5 Merge branch 'MDL-77210_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-23 09:23:07 +08:00
Andrew Nicols 72342d4c08 Merge branch 'MDL-77149-m400' of https://github.com/sammarshallou/moodle into MOODLE_400_STABLE 2023-02-23 09:21:32 +08:00
Paul Holden 6f91919237 MDL-74585 core: pass string identifier/component to network keepalive.
Avoid passing potentially large amounts of data in the page AMD call,
allow the `core/network` module to load actual string content itself.
2023-02-22 16:20:41 +00:00
Tim Hunt 467d99b7bb MDL-76843 quiz: add test to verify random essay stats now work 2023-02-22 15:12:03 +00:00
Tim Hunt 2580e7d399 MDL-76843 quiz: fix statistics questions for missing questions 2023-02-22 15:11:56 +00:00
Tim Hunt 89e2da51c9 MDL-76843 questions behat: enhancements requried to test this issue
* New steps to set up certian sorts of broken test data.
* Fix qtype_essay_question::un_summarise_response().
2023-02-22 15:10:23 +00:00
Tim Hunt 7ab289879a MDL-76298 drag-drop questions: validate the questions are complete
Previously, it was possible to create drag-drop markers and onto image
questions without any drag items or drop zones. This was non-sensical,
and broke statistics calculations.

So, missing validation added, and random guess score calculation made
robust.
2023-02-22 12:06:56 +00:00
Tim Hunt a15668409e MDL-58945 qbank: showing q text should give option of plain or full 2023-02-22 11:16:58 +00:00
Paul Holden 8c2b43f133 MDL-77352 javascript: declare debouncer outside the event handler.
It needs to be declared as such, otherwise each time the event is
triggered a new debouncer is created.
2023-02-21 22:47:58 +00:00
Paul Holden cdf532cf84 MDL-76602 mod_lti: array syntax/whitespace cleanup. 2023-02-21 17:10:22 +00:00
Paul Holden 2f794ccb3d Merge branch 'MDL-76602-400-lti13claims' of https://github.com/cengage/moodle into MOODLE_400_STABLE 2023-02-21 16:46:26 +00:00
sam marshall 3130c83f02 MDL-77149 core_files: Network filesystem (Amazon EFS) can warn
If you delete a file with a hash and then create another file with
the same hash, sometimes on EFS filesystems while trying to create
the new file, it returns true to the file_exists check even though
the file doesn't exist, but then fails other calls.

This change makes Moodle tolerate that behaviour.
2023-02-21 10:56:25 +00:00
Simey Lameze fcedef4566 MDL-77271 behat: verify user licence preference is remembered 2023-02-21 15:29:44 +08:00
AMOS bot d13319f328 Automatically generated installer lang files 2023-02-21 00:07:34 +00:00
Paul Holden f244de5a77 Merge branch 'MDL-76545-400' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-02-20 10:28:54 +00:00
Paul Holden 98c8165f6a Merge branch 'MDL-77287-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2023-02-20 09:55:09 +00:00
Audun Jørstad Lillekjendlie 4ccd18f6be MDL-77318 core: Add role attribute to user navigation div 2023-02-20 10:54:58 +01:00
Paul Holden e99051aabd MDL-76873 user: method for returning profile field instance of type.
Re-factor implementation of profile field access within user fields
class to use that already provided by the fields themselves.
2023-02-20 09:24:17 +00:00
Paul Holden 0e6bc44970 MDL-76873 reportbuilder: correct checks for profile field visibility. 2023-02-20 09:22:14 +00:00
Andrew Nicols 49af8b6508 Merge branch 'MDL-77020-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-20 09:55:18 +08:00
Ferran Recio e2e6e1407f MDL-76545 core: fix reactive debug panel
The reactive debug panel stops working when a new reactive instance is
created in the fly. This was not detected until the new dragf and drop
files into course uses a second reactive UI component in the same page.
2023-02-17 17:19:16 +01:00
Sara Arjona a47f28ee75 MDL-77230 mod_feedback: Validate feedback access
The get_items() and get_page_items() external methods should return
items only when the user has access. Otherwise, empty array for items
will be returned, with the exact error in the warnings parameter.
2023-02-17 12:43:33 +01:00
Petr Skoda 2f15514fa4 MDL-75005 core: remove invalid addslashes() 2023-02-17 09:49:45 +01:00
Jake Dallimore 831f0cf6ce MDL-77287 tool_oauth2: fix issuer form validation
This ensures validation errors from the issuer persistent are seen.
2023-02-17 15:16:11 +08:00
Ilya Tregubov cb2fa7a92d weekly release 4.0.6+ 2023-02-17 09:12:27 +08:00
Ilya Tregubov 1517a26b7e Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-02-17 09:12:24 +08:00
AMOS bot 41bd934db1 Automatically generated installer lang files 2023-02-17 00:07:47 +00:00
Paul Holden 162dfaaf85 MDL-77020 behat: refer to search input fields by name/role.
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-02-16 10:34:50 +00:00
Audun Jørstad Lillekjendlie e8cc15ecaa MDL-77020 core: Include a unique id in the search input field id 2023-02-16 10:24:45 +00:00
Andrew Nicols 31b6436f90 Merge branch 'MDL-75578-400' of https://github.com/mackensen/moodle into MOODLE_400_STABLE 2023-02-16 12:01:43 +08:00
Jun Pataleta 5a81c72bac Merge branch 'MDL-72182-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-16 11:55:44 +08:00
Jun Pataleta f291f78cab Merge branch 'MDL-76584-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-16 11:48:56 +08:00
Andrew Nicols bfddf75448 Merge branch 'MDL-74698_400' of https://github.com/jonof/moodle into MOODLE_400_STABLE 2023-02-16 11:07:04 +08:00
Ilya Tregubov fce1784938 MDL-76313 forum: code style changes. 2023-02-16 11:01:04 +08:00
Ilya Tregubov 846b0c890c Merge branch '76313-forum-improve-accessibility-400' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_400_STABLE 2023-02-16 11:00:43 +08:00
Ilya Tregubov 345c4a6a3c MDL-75379 core: Code style changes. 2023-02-16 10:50:30 +08:00
Ilya Tregubov 6c82a06f49 Merge branch 'MDL-75379_400' of https://github.com/larsbonczek/moodle into MOODLE_400_STABLE 2023-02-16 10:50:07 +08:00
Andrew Nicols f71d5a9b52 Merge branch 'MDL-76878-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-16 10:44:30 +08:00
Ilya Tregubov fe269e1bac Merge branch 'MDL-73519-400' of https://github.com/meirzamoodle/moodle into MOODLE_400_STABLE 2023-02-16 09:34:46 +08:00
Andrew Nicols 31db9d0c57 Merge branch 'MDL-76478-password-unmask-MOODLE_400_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_400_STABLE 2023-02-15 23:26:28 +08:00
Andrew Nicols 20437979e6 Merge branch 'MDL-76948_400' of https://github.com/larsbonczek/moodle into MOODLE_400_STABLE 2023-02-15 23:01:30 +08:00
Paul Holden a9b0d53459 Merge branch 'MDL-77147_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-15 11:49:23 +00:00
Ilya Tregubov 8d36719bc3 Merge branch 'MDL-75230-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-15 16:13:12 +08:00
Andrew Nicols f6ec6e9dce Merge branch 'MDL-77241-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-15 11:14:44 +08:00
Jun Pataleta cafd97276a Merge branch 'MDL-77223-400' of https://github.com/roland04/moodle into MOODLE_400_STABLE 2023-02-15 11:06:48 +08:00
AMOS bot 8e20336b30 Automatically generated installer lang files 2023-02-15 00:07:47 +00:00
Paul Holden 2c3c32e29e Merge branch 'MDL-75454-400' of https://github.com/davewoloszyn/moodle into MOODLE_400_STABLE 2023-02-14 15:06:05 +00:00
Paul Holden 3fced488b3 MDL-77241 course: optional chaining safety for section toggles. 2023-02-14 13:15:40 +00:00
Paul Holden 44c94ffad4 Merge branch 'MDL-63608_400' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_400_STABLE 2023-02-14 11:59:56 +00:00
Ilya Tregubov b8604c273c Merge branch 'MDL-76947-400' of https://github.com/davewoloszyn/moodle into MOODLE_400_STABLE 2023-02-14 13:53:59 +08:00
David Woloszyn ea5d5ea519 MDL-75454 cache: Reduced exposure of sesskey param 2023-02-14 11:29:01 +11:00
Tim Hunt c7f1203480 MDL-77210 quiz: fix regrade for attempts with redone questions 2023-02-13 16:58:40 +00:00
Mikel Martín d57345bf06 MDL-77223 reportbuilder: Fix first report column as integer 2023-02-13 16:16:11 +01:00
Lars Bonczek 589ca9aec6 MDL-75379 core: Use non-static template cache 2023-02-13 12:37:02 +01:00
Paul Holden ebaec57bb2 MDL-76611 cohort: prevent duplicate idnumber in inplace editable. 2023-02-13 10:33:34 +00:00
Ilya Tregubov 0888a32602 Merge branch 'MDL-77189-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-02-13 13:44:04 +08:00
Simey Lameze 326296c482 MDL-77189 behat: basic coverage for wikimedia repository 2023-02-13 13:23:54 +08:00
Jun Pataleta b93cb20e48 Merge branch '76314-forum-fix-forumtype-and-groupmode-validation-400' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_400_STABLE 2023-02-13 11:38:49 +08:00
Anupama Sarjoshi d7d375ed14 MDL-63608 quiz: Fix Access order when manually grading quizzes
Changes done to fix access order of attempts that need manual grading.
Changed button text from 'Save and go to next page' to 'Save and show next' to improve UI.
2023-02-10 17:44:33 +00:00
Paul Holden 44d77d0848 weekly release 4.0.6+ 2023-02-10 13:47:38 +00:00
Paul Holden 5169dd0f8b Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-02-10 13:47:36 +00:00
Julien Boulen 002ed2d867 MDL-76314 forum: add form check to prevent combining wrong parameters
Form validation prevents combining the forum type "single discussion" and the group mode "separate groups".
2023-02-10 11:07:38 +01:00
Andrew Nicols 0ebbecff73 Merge branch 'MDL-76904-400' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_400_STABLE 2023-02-09 12:04:49 +08:00
Andrew Nicols 941203b502 Merge branch 'MDL-74755-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-09 11:44:40 +08:00
Jun Pataleta 9f876fe558 Merge branch 'MDL-77052-400' of https://github.com/Utdanningsdirektoratet/moodle into MOODLE_400_STABLE 2023-02-09 11:27:04 +08:00
Andrew Nicols ebeb9a87fc Merge branch 'MDL-76354-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-09 10:59:34 +08:00
Andrew Nicols bac3842abc Merge branch 'MDL-77018_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-09 10:51:59 +08:00
Andrew Nicols 4efc9efd9b Merge branch 'MDL-76066-400' of https://github.com/aanabit/moodle into MOODLE_400_STABLE 2023-02-09 10:48:23 +08:00
Andrew Nicols 1278c93a06 Merge branch 'MDL-77057-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-09 10:21:23 +08:00
Andrew Nicols b7334e05db Merge branch 'MDL-76499-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-09 10:05:22 +08:00
Andrew Nicols e900f15c57 Merge branch 'MDL-70586-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-02-09 09:45:57 +08:00
Paul Holden 2b4711fdcd Merge branch 'MDL-76672-400' of https://github.com/Utdanningsdirektoratet/moodle into MOODLE_400_STABLE 2023-02-08 14:57:38 +00:00
Paul Holden 16d81dabab Merge branch 'MDL-76542-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-02-08 14:22:12 +00:00
Simey Lameze e844d6d366 MDL-76542 behat: add step to go to user edit page directly 2023-02-08 20:55:43 +08:00
Simey Lameze 28c1597e5a MDL-76542 behat: create custom profile fields using data generators
This commit also adds a new test to verify the custom profile fields
works using the user interface.
2023-02-08 20:55:43 +08:00
Paul Holden 8c08aeb863 Merge branch 'MDL-73692-400-Add-support-for-missing-timestamps-to-rss-block' of https://github.com/melanietreitinger/moodle into MOODLE_400_STABLE 2023-02-08 11:22:52 +00:00
Melanie Treitinger 1914fe6604 MDL-73692 blocks: Add support for missing timestamps to rss block. 2023-02-08 11:16:06 +01:00
Jun Pataleta b0cc1c096a Merge branch 'MDL-74905_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-02-08 17:19:18 +08:00
Angelia Dela Cruz 61737d06c5 MDL-75230 behat: Lesson Behat tests optimised
Replace steps that manually add Lesson instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-02-08 16:59:18 +08:00
Lars Bonczek 45b117f8e7 MDL-74433 mod_assign: Fix logging of submission removal 2023-02-07 12:38:03 +01:00
Andrew Nicols db37e1eb58 Merge branch 'MDL-77023-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-07 12:48:23 +08:00
Andrew Nicols feb10fbea9 Merge branch 'MDL-77123-400' of https://github.com/cameron1729/moodle into MOODLE_400_STABLE 2023-02-07 12:40:48 +08:00
Andrew Nicols d2306d35c6 Merge branch 'mdl-76729_400' of https://github.com/james-cnz/moodle into MOODLE_400_STABLE 2023-02-07 12:37:32 +08:00
Paul Holden ddff113f3b Merge branch 'MDL-77078-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-06 13:33:06 +00:00
Audun Jørstad Lillekjendlie b9a36a1562 MDL-76672 block_myoverview: add role attribute for filter div 2023-02-06 14:07:00 +01:00
Tim Hunt 5dd03dc296 MDL-77147 question admin: optimised the query in admin/qtypes.php 2023-02-06 12:48:16 +00:00
Audun Jørstad Lillekjendlie 5563c74c95 MDL-77052 block_recentlyaccesseditems: HTML role attribute
HTML elements with role=list must contain children with role=listitem
2023-02-06 13:47:35 +01:00
Paul Holden 7aacb04321 Merge branch 'MDL-76370-publicpaths-proxying-MOODLE_400_STABLE' of https://github.com/jaydn/moodle into MOODLE_400_STABLE 2023-02-06 11:02:48 +00:00
Marina Glancy 073901d019 MDL-72182 my: tests for resetting dashboard
Co-authored-by: Paul Holden <paulh@moodle.com>
2023-02-06 09:34:32 +00:00
Paul Holden cd7ec775ae MDL-72182 user: cross-DB compatibility for getting user pages/blocks. 2023-02-06 09:34:32 +00:00
Paul Holden 3419329a12 MDL-74755 block_accessreview: stricter checking of enabled config. 2023-02-06 09:31:45 +00:00
David Woloszyn 7821816fdd MDL-76947 css: Fixed layout regression on dropdown menus 2023-02-06 16:05:40 +11:00
Andrew Nicols 93f6ce8bfe Merge branch 'MDL-77091-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-06 12:59:46 +08:00
Angelia Dela Cruz 584c42e14d MDL-77078 Behat: Coverage for assignment submission statement 2023-02-06 11:32:11 +08:00
AMOS bot a252f3ca77 Automatically generated installer lang files 2023-02-06 00:07:37 +00:00
Anastasios Bithas 9079e01d44 MDL-73642 mod_assign: Disable draft option if submission already made 2023-02-04 18:49:21 +02:00
Andrew Nicols fecc3e0fa1 Merge branch 'MDL-76662-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-04 21:52:25 +08:00
Eloy Lafuente (stronk7) 2756ebfc7c MDL-74905 ci: travis and gha, some adjustments
Apply for some of the improvements made for 4.2:
- Use our own moodlehq/mysql-action
- Define the tmpfs size and ensure that binlogs are disabled.
2023-02-03 19:48:10 +01:00
Eloy Lafuente (stronk7) a279eba2f1 MDL-74905 environment: Apply agreed changes:
- PHP 8.0 required.
- Moodle 3.11.8 required (first minor supporting PHP 8.0 officially).
- MySQL 8.0 required.
- MariaDB 10.6.7 required.
- PostgreSQL 13 required.
- php-sodium extension required.
- 64-bit PHP required.
2023-02-03 19:48:10 +01:00
Eloy Lafuente (stronk7) 5160aa199e MDL-74905 environment: 4.2 base information
This is a direct copy of the 4.1 information, to
have all the real changes under control in next commit(s).
2023-02-03 19:48:10 +01:00
Paul Holden f2a4f26708 Merge branch 'MDL-76869-400' of https://github.com/cameron1729/moodle into MOODLE_400_STABLE 2023-02-03 14:58:31 +00:00
Paul Holden 21ebba9e39 Merge branch 'MDL-77090_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-03 14:46:54 +00:00
Tim Hunt 23e26675ff MDL-77090 questions: regrade of interactive attempts lose tries count
The behaviour-specific data was getting corrupted when the regrade
recreated the first step, because $oldstep->get_behaviour_data() was
stripping off the leading '-' characters from the names, and they were
not being added back.
2023-02-03 10:53:56 +00:00
Jun Pataleta a2b88160d7 weekly release 4.0.6+ 2023-02-03 15:43:41 +08:00
Angelia Dela Cruz edc5b03aa1 MDL-76499 behat: Resource Behat tests optimised
Replace steps that manually add resource instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.

Co-authored-by: David Woloszyn <david.woloszyn@moodle.com>
2023-02-03 14:09:46 +08:00
Jonathon Fowler 36c92bc955 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:22:09 +10:00
Andrew Nicols 0004ba1d1b Merge branch 'MDL-75345-400-fix' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-02 22:01:04 +08:00
Paul Holden bdb6fb7baf MDL-75345 reportbuilder: remove course summary filter checks. 2023-02-02 13:48:49 +00:00
Cameron Ball d92966f83e MDL-77123 message_airnotifier: Don't test configured providers 2023-02-02 14:50:02 +08:00
Andrew Nicols 70fdaa51aa Merge branch 'MDL-75870-400' of https://github.com/nwp90/moodle into MOODLE_400_STABLE 2023-02-02 12:34:53 +08:00
Andrew Nicols 16e2822e90 Merge branch 'MDL-75085-400-4' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-02-02 12:04:05 +08:00
Andrew Nicols 9842833fc1 Merge branch 'MDL-75830-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-02 11:58:31 +08:00
Andrew Nicols 69395127e0 Merge branch 'MDL-77024_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-02 11:52:59 +08:00
Andrew Nicols c1bc2d4dd2 Merge branch 'MDL-76675_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-02-02 11:04:12 +08:00
Jun Pataleta a4a9984650 Merge branch 'MDL-69690-400' of https://github.com/ilyatregubov/moodle into MOODLE_400_STABLE 2023-02-02 10:31:49 +08:00
Jun Pataleta 0b0874b063 Merge branch 'MDL-77092-m400' of https://github.com/sammarshallou/moodle into MOODLE_400_STABLE 2023-02-02 09:56:59 +08:00
Andrew Nicols 9c3af6a9ae Merge branch 'MDL-75912-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-02 09:44:43 +08:00
Ilya Tregubov cf6901bb9c Merge branch 'MDL-77079-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-02-02 09:17:22 +08:00
Jun Pataleta 37da5b7176 MDL-75085 mod: Pass proper $required param value external_format_value 2023-02-02 09:05:27 +08:00
Jun Pataleta f829545013 MDL-75085 external: Pass proper $required param value in tests 2023-02-02 09:05:27 +08:00
Angelia Dela Cruz b79f853484 MDL-75830 behat: Book behat tests optimised
Replace steps that manually add Book instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
Additionally, performed Behat cleanup and optimisation to affected
files.
2023-02-02 09:03:42 +08:00
Andrew Nicols d851bb1ad3 Merge branch 'MDL-77003-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-02 08:21:23 +08:00
Andrew Nicols 720007a54c Merge branch 'MDL-75345-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-02 08:18:38 +08:00
Nick Phillips 5d7411d864 MDL-75870 course: only section togglers to toggle sections 2023-02-02 11:32:15 +13:00
Paul Holden 7e4ef00e6d Merge branch 'MDL-76658-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-01 16:34:41 +00:00
Paul Holden 6299d39bf2 MDL-75345 reportbuilder: improve course/user custom report tests.
Ensure column and filters provided by each source have sufficient
coverage. Re-factor individual entity/helper class tests to test
their own specific implementation only.

Remove now-defunct test fixtures.
2023-02-01 15:41:24 +00:00
Paul Holden b56a5e0dfb MDL-77091 reportbuilder: set base time in schedule test generator.
The base time allows for the setting of the "current time" for the
purposes of the schedule test against recurrence configuration.

We should ensure the generator method allows this property so that
it can be used when calculating the initial "next send time" of the
schedule upon creation (and avoiding excessive recursion when the
actual current time is used for the calculation).
2023-02-01 14:39:44 +00:00
Paul Holden 6be9700e32 Merge branch 'MDL-76311-400' of https://github.com/meirzamoodle/moodle into MOODLE_400_STABLE 2023-02-01 14:16:19 +00:00
Meirza 4369ac81a7 MDL-76311 user: redirect to proper URL if a new user creation cancelled 2023-02-01 20:13:22 +07:00
Sara Arjona 4f5795037e MDL-70586 mod_feedback: Hide the Preview questions icon for students
The Preview questions icon shouldn't be displayed unless the user can
edit the feedback or access to the reports; otherwise, it's causing
confusion (especially when the feedback is not opened).
2023-02-01 12:36:29 +01:00
Paul Holden b3e9ba1785 Merge branch 'MDL-73847_400' of https://github.com/jonof/moodle into MOODLE_400_STABLE 2023-02-01 10:00:29 +00:00
Jun Pataleta fc88017acf Merge branch 'MDL-76985-MOODLE_400_STABLE' of https://github.com/sh-csg/moodle into MOODLE_400_STABLE 2023-02-01 14:10:36 +08:00
Ilya Tregubov 4f0c9f4f4b Merge branch 'MDL-76587-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-02-01 13:26:19 +08:00
Jun Pataleta 74bde5fb35 MDL-75085 external: Fix external_multiple_structure parameter passing
Some calls to the external_multiple_structure's constructor incorrectly
pass parameters where the value for the $description parameter is not
being passed. This results to invalid values being passed for the
$required parameter.
2023-02-01 12:29:08 +08:00
Jun Pataleta 58bef2f34e MDL-75085 webservice: Fix parameter passed to external_format_value 2023-02-01 12:29:08 +08:00
Angelia Dela Cruz f4965f1c72 MDL-75912 behat: Wiki behat generators use UI
Behat cleanup and optimisation
2023-02-01 11:22:35 +08:00
Angelia Dela Cruz f5666cffda MDL-75912 behat: Wiki Behat tests now use generators
Replace steps that manually add Wiki instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-02-01 11:21:36 +08:00
Simey Lameze ebd0c7fe8c MDL-77079 behat: use different step to validate presets table data 2023-02-01 09:04:01 +08:00
Tim Hunt 73a7a74d92 MDL-77094 quiz_statistics: improve efficiency of the recalculate task
quiz_settings::create() requires at least 3 DB queries, so the point is
that we can avoid doing that until after we have worked out if we need
to calculate statistics for this quiz.

Also, we order the list of quizzes to consier, to process the ones with
more recent attempts first.
2023-01-31 17:02:57 +00:00
Julien Boulen ae60dd25f6 MDL-76945 theme: fix the rendering of arrows on dropdown variants 2023-01-31 15:21:53 +01:00
sam marshall 029e6e7d89 MDL-77092 Behat: Expand all fieldsets fails with single fieldset
The Behat step to expand all fieldsets did not work if the page
contains only one fieldset.
2023-01-31 13:59:12 +00:00
Angelia Dela Cruz e8719fd65a MDL-76658 Behat: Coverage for course cohort enrolment groups
Co-authored-by: Simey Lameze <simey@moodle.com>
2023-01-31 19:23:54 +08:00
Ilya Tregubov c499c7079f Merge branch 'MDL-77077-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2023-01-31 18:14:17 +08:00
hieuvu 66c35154b8 MDL-76904 question: Keep question highlight in url 2023-01-31 16:39:56 +07:00
Simey Lameze b11dbf60c0 MDL-76587 behat: make grading page wider to avoid 'out of bounds' fail
This is because on classic theme the navigation block pushes the content
to the right and once behat changes the grades the 'Save changes' button
is no longer visible.
2023-01-31 11:20:13 +08:00
Charles Fulton 4400c34168 MDL-75578 course: require course library to resolve namespace issues 2023-01-30 10:45:48 -05:00
Jake Dallimore 365fff0ff2 MDL-77077 mod_lti: Fix JWT signature verify when alg missing from JWKS
Infer the algorithm, where necessary, using a combination of JWT
headers and known valid LTI algorithms.
2023-01-30 16:45:35 +08:00
Andrew Nicols 0386f27ba1 Merge branch 'MDL-77040-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-01-30 12:28:21 +08:00
Tim Hunt a493821bcc MDL-77018 qbank_statistics: only load stats for contexts that exist
Also, pre-load the contexts for efficiency.
2023-01-27 20:52:33 +00:00
Paul Holden d3d62a087b MDL-77057 group: format group names in module override pages. 2023-01-27 11:50:52 +00:00
Eloy Lafuente (stronk7) 45730b9a07 MDL-76675 date: Only test all TZ names with PHPUNIT_LONGTEST enabled
It happens often that some timezone is renamed, split, added to the
IANAs list of timezones (that, for PHP is kept updated by the
php-timezonedb PECL extension).

When the information coming from the extension changes, all the
PHPUnit jobs in the world start failing (that's when CIs update
their PHP images, when devs update their packages, ...).

So, what we are doing here is to move that test that check for
every single string existing to be run only when PHPUNIT_LONGTEST
is enabled. That way only places running all tests will run that
one. And every other run just will skip it.

This corresponds to point 1 & 2 of the issue, lower impact in general
and, still be able to enable the tests to run.
2023-01-27 08:49:36 +01:00
Andrew Nicols a73cddb9f9 Merge branch 'MDL-75978-400' of https://github.com/JBThong/moodle into MOODLE_400_STABLE 2023-01-27 13:11:22 +08:00
Paul Holden 83bb155b67 MDL-77040 core: assert types of returned Geoplugin data, not values.
The results we get from these tests are beyond our control, and are
unreliable for use in testing.

See also previous change 215cd2d8 in similar tests.
2023-01-26 13:24:11 +00:00
Paul Holden 8f8cea4f03 MDL-76662 tool_log: correct supported reports test assertions. 2023-01-26 13:09:08 +00:00
Davo Smith f95c68c141 MDL-76938 backup: fix restore of comments linked to a course format 2023-01-26 12:33:24 +00:00
Sara Arjona f5ec0df5d5 weekly release 4.0.6+ 2023-01-26 09:59:17 +01:00
Lars Bonczek 539b6b6c85 MDL-76948 mod_assign: Fix description of submission_unlocked event 2023-01-25 19:21:43 +01:00
Tim Hunt 28226981fc MDL-77024 quiz: fix metatdata on log events
Some had the wrong edulevel or crud
2023-01-25 16:13:34 +00:00
Jun Pataleta fa558bdbdc Merge branch 'MDL-76977-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-01-25 16:10:03 +08:00
Jun Pataleta f5babd9a75 Merge branch 'MDL-77036-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-01-25 16:02:11 +08:00
Stefan Hanauska f8a081f660 MDL-76985 course: Redirect to moved section 2023-01-25 09:00:39 +01:00
Simey Lameze a0115a8578 MDL-77036 core_iplookup: update test_ipv4 test expectations 2023-01-25 15:15:22 +08:00
Paul Holden 1d8744377f MDL-77003 javascript: improve string helper JSON detection.
Changes in fbc2732d made the JS template string helper method
too strict in regards to what it considers a valid JSON object.

Co-authored-by: Mike Churchward <mike@brickfieldlabs.ie>
2023-01-24 22:16:26 +00:00
Paul Holden 7d9c52b6bd MDL-77023 javascript: always normalise component of lang strings.
Co-authored-by: David Matamoros <davidmc@moodle.com>
2023-01-24 16:44:13 +00:00
Jun Pataleta 21aba2fb63 Merge branch 'MDL-76639-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-01-24 18:59:21 +08:00
Jun Pataleta d5f6993327 Merge branch 'MDL-76652-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-01-24 18:45:12 +08:00
Jun Pataleta 9f6fcd1e47 Merge branch 'MDL-76655-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-01-24 18:26:53 +08:00
Angelia Dela Cruz 9c4637c086 MDL-76655 behat: Coverage for workshop grading strategies 2023-01-24 09:37:59 +08:00
Paul Holden a5fb38a57c MDL-76354 competency: export user privacy data unconditionally.
We should ensure that any past competency data for a user is always
exported, regardless whether competencies are currently enabled.
2023-01-23 22:15:29 +00:00
Amaia Anabitarte 72773d10f6 MDL-76066 mod_data: Trigger field_deleted event when importing 2023-01-23 18:55:13 +01:00
sam marshall e926de79f3 MDL-76956 core_grades: Regrade progress bar should be more granular
This change makes the regrade progress bar send frequent updates to
the web browser, even when processing within the same grade item, to
avoid timeout problems when there are a large number of users.
2023-01-23 11:42:14 +00:00
Paul Holden 1037818475 MDL-76584 question: correct temporary questionid upgrade field.
Pass correct parameter/type in field constructor (`XMLDB_NOTNULL`)
for consistency. This corrects the definition and preserves the
truthyness of the value that was incorrectly passed previously.
2023-01-23 09:16:32 +00:00
Paul Holden 93a6761b9e MDL-76977 phpunit: ensure unique data provider keys in mustache test. 2023-01-20 17:21:36 +00:00
Ilya Tregubov 13bc06e37d weekly release 4.0.6+ 2023-01-20 09:41:46 +08:00
Paul Holden e961a93ee8 MDL-76878 user: amend permission callbacks for preference definitions.
Ensure those preferences that are used for storing state can always be
updated via web service requests for the current user.
2023-01-19 15:28:52 +00:00
Hiroto Kagotani 7b79101032 MDL-76936 course: purge course cache on resetting start date 2023-01-19 20:01:03 +09:00
Jun Pataleta 6cec3844dc Merge branch 'MDL-76725-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-01-19 12:04:57 +08:00
Ilya Tregubov 3c44c156e6 Merge branch 'MDL-76870-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-01-19 11:15:35 +08:00
Ilya Tregubov cd685999fa Merge branch 'MDL-76766-400' of https://github.com/aanabit/moodle into MOODLE_400_STABLE 2023-01-19 11:04:47 +08:00
Ilya Tregubov 56dc60887c Merge branch 'MDL-74756-MOODLE_400_STABLE' of https://github.com/sh-csg/moodle into MOODLE_400_STABLE 2023-01-19 10:31:06 +08:00
Andrew Nicols 76bb28ab0b Merge branch 'MDL-76841-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-01-19 08:55:28 +08:00
Andrew Nicols f28a05b21c Merge branch 'MDL-70070-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-01-19 08:50:58 +08:00
Jun Pataleta c7f189da0f Merge branch 'MDL-76525-MOODLE_400_STABLE' of https://github.com/PhMemmel/moodle into MOODLE_400_STABLE 2023-01-18 22:55:31 +08:00
Philipp Memmel 69d187f94b MDL-76525 mod_data: Add param validation for data fields 2023-01-18 12:12:37 +01:00
Claude Vervoort 644d3a5b3f MDL-76602 mod_lti: move lti13 claim declaration in subplugin 2023-01-17 16:56:58 -05:00
Jake Dallimore 963379d7a8 Merge branch 'MDL-66221-400' of https://github.com/raortegar/moodle into MOODLE_400_STABLE 2023-01-17 11:29:22 +08:00
Stefan Hanauska 366e1fae05 MDL-74756 availability_completion: Prev activity (completion n/enabled) 2023-01-16 22:20:42 +01:00
Paul Holden a8e796311e MDL-76841 tool_mobile: improve potential config issues test.
Avoid certificate checking of the default test site (`example.com`),
and update the assertion so we get clearer failures in the future.
2023-01-16 08:30:36 +00:00
Paul Holden dcb19eebc2 MDL-70070 phpunit: correct data provider method names.
They should not be prefixed `test_` because that's how actual
test methods containing assertions are identified by PHPUnit.
2023-01-16 08:28:25 +00:00
Jaydn Cunningham 5ed130b575 MDL-76370 curl: suppress CONNECT header when using HTTP proxy 2023-01-16 14:17:09 +10:30
Jonathon Fowler 587c9406a3 MDL-73847 lti: fetch keyset URLs using configured proxy settings 2023-01-16 10:00:26 +10:00
raortegar f2a95bf7fa MDL-66221 tool_recyclebin: Fix recycle bin with activity settings
If backup_auto_activities setting from Automated backup is disabled
the activities will not be stored for the recycle bin
2023-01-13 11:31:57 +01:00
Simey Lameze 914e611bd1 MDL-76870 question: change assertion to assertEqualsCanonicalizing
By using that assertion the arrays will be sorted before comparison
preventing any Oracle sorting related failures.

Credits for the solution go to Tim Hunt!
2023-01-13 18:13:19 +08:00
Angelia Dela Cruz e6eb08a448 MDL-76639 behat: Add Behat test coverage for quiz with limited attempts 2023-01-13 16:29:43 +08:00
Cameron Ball 4269b654b6 MDL-76869 gradebook: Pass exception to rollback 2023-01-12 16:35:54 +08:00
Ilya Tregubov f52cc16d34 MDL-69690 mod_workshop: Fix fieldname for workshop. 2023-01-12 14:42:24 +07:00
Amaia Anabitarte 5aae7cc4aa MDL-76766 mod_quiz: Allow shuffling quizes with no questions 2023-01-11 11:16:36 +01:00
Julien Boulen ad87801d2d MDL-76313 forum: improve accessibility on subscribers page
- add header on table of subscribers
- remove one redundant header
2023-01-10 11:17:16 +01:00
Meirza 46cb0bc324 MDL-73519 core_course: re-styling the unordered list.
Currently, the unordered list in the course content follows the original style and
is ordered from the top of the content section, which is not part of the description.
That's why the first occurrence of the list is the 2nd level which uses the circle as the marker/list type
instead of the disc. In contrast, the editor always uses the original style.

so we need to reset the CSS of the unordered list in the description to the original
which the disc as the first marker, a circle for the second marker,
and a square for the following levels.
2023-01-10 12:18:29 +07:00
james-cnz 77e664ce4a MDL-76729 filepicker: Restore file picker thumbnails in tree view 2023-01-10 11:49:28 +13:00
Simey Lameze ac754da8f2 MDL-76652 behat: use data generator and remove duplicated steps 2023-01-09 10:17:04 +08:00
Simey Lameze 492a8726e2 MDL-76652 behat: add coverage for postwithoutthrottling logic 2023-01-09 10:17:04 +08:00
Paul Holden a7d6f79bdd MDL-76725 mod_wiki: avoid named arguments in real path callback.
See also f4fb91ae. PHP8 now supports named arguments in calls to
the `call_user_func_array` method, which can result in differing
behaviour compared to PHP7, e.g. in this case it was throwing an
exception due to an unknown named parameter.
2023-01-04 14:08:06 +00:00
Thong Bui 1bde415012 MDL-75978 Quiz\D&D: on mobile, a moving line-wrap can bork the question 2022-12-22 10:08:59 +07:00
Brendan Heywood 940006d39f MDL-76478 formslib: Fix autocomplete bug of existing passwords 2022-12-06 12:34:17 +11:00
Mark Holliday 801e7d9fe4 MDL-76376 scorm: fix PHP8 TypeError (null is not Countable) 2022-11-28 17:52:33 -05:00
David Mudrák fd14e16617 MDL-75534 Fix usermodified in very old forum discussions
Very early Moodle versions used to leave the field empty. Recent Moodle
versions expect that the value always links to an existing user account.
2022-10-19 20:44:50 +02:00
1308 changed files with 21506 additions and 10234 deletions
+10 -2
View File
@@ -7,6 +7,12 @@ on:
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.0
@@ -66,7 +72,7 @@ jobs:
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: johanmeiring/mysql-action@tmpfs-patch
uses: moodlehq/mysql-action@v1
with:
collation server: utf8mb4_bin
mysql version: 5.7
@@ -74,6 +80,8 @@ jobs:
mysql user: test
mysql password: test
use tmpfs: true
tmpfs size: '1024M'
extra conf: --skip-log-bin
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
@@ -112,4 +120,4 @@ jobs:
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options
run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
+1 -1
View File
@@ -156,7 +156,7 @@ const getThirdPartyLibsList = relativeTo => {
* @returns {array}
*/
const getThirdPartyPaths = () => {
const DOMParser = require('xmldom').DOMParser;
const DOMParser = require('@xmldom/xmldom').DOMParser;
const fs = require('fs');
const path = require('path');
const xpath = require('xpath');
+2 -3
View File
@@ -30,10 +30,9 @@
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
*/
const babelRename = function(destPath, srcPath) {
destPath = srcPath.replace('src', 'build');
destPath = destPath.replace('.js', '.min.js');
destPath = srcPath.replace(`amd/src`, `amd/build`);
destPath = destPath.replace(/\.js$/, '.min.js');
return destPath;
};
+3 -1
View File
@@ -81,7 +81,8 @@ install:
sudo service mysql stop
sudo mv /var/lib/mysql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql
sudo service mysql restart
echo -e "[mysqld]\nskip-log-bin" | sudo tee -a /etc/mysql/my.cnf
sudo service mysql start
fi
- >
if [ "$DB" = 'pgsql' ];
@@ -92,6 +93,7 @@ install:
sudo mv /var/lib/postgresql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/postgresql /var/lib/postgresql
sudo service postgresql start 9.6
sh -c 'until pg_isready -p 5432; do echo "Waiting for the DB to be up..."; sleep 2; done'
fi
- >
if [ "$TASK" = 'PHPUNIT' ];
+53 -35
View File
@@ -1,48 +1,66 @@
MOODLE TRADEMARKS POLICY
========================
The word "Moodle" is trademarked in many countries around the world. The word
was originally coined as an acronym: Modular Object-Oriented Dynamic Learning
Environment. The trademark is owned by Martin Dougiamas, Founder and Director
of Moodle.
The Moodle Trademark
--------------------
The law obligates trademark owners to police their marks and prevent the use of
confusingly similar names by third parties. Through this policy wed like to
make it clear how Moodle-related projects, organisations, and people can use
the Moodle trademark. Wed also like to be clear about how use of the word is
restricted when used to promote commercial Moodle services. We do this to
protect the very business model that allows us to continue developing Moodle
for you.
The brand and word "Moodle" has trade mark protection in many countries around
the world. Various Moodle™ trade marks are owned by either Moodle Pty Ltd or
one of its associated entities. The law obligates trade mark owners to police
their trade marks and prevent the use of confusingly similar names by
third parties.
Allowed uses
------------
We have created a more concise and thorough set of Trademark Guidelines
(https://moodle.com/wp-content/uploads/2023/02/Moodle-Trademark-Guidelines-2023-4.pdf)
to help you understand how to comply with Moodle's trade mark requirements.
The Trademark Guidelines will also assist our Moodle Certified Partners and the
community to understand some of the principles that inform Moodle's stance
whenever potential infringement has been detected by us or our community.
The following uses dont require any permission at all:
We need to be clear about use of the word "Moodle" and how we restrict its use
when promoting commercial Moodle™ branded services. The proper use of
trade marks reliably assures consumers about the quality of the associated
products or services and where they have been derived from. Because the
Moodle LMS is made available under the open source GNU General Public License'
that permits you to modify the copyrighted software, the distribution of such
modified software in combination with Moodle trade marks can potentially
mislead others in the community. To be clear, the GNU GPL does not include an
implied right or licence to use Moodle's trade marks.
* Referring to the software or the Moodle project.
* Describing your own Moodle implementation (including within corporate
settings).
We do all this to protect the very business model that allows us to continue
developing various Moodle software solutions for you.
Allowed uses of "Moodle"
------------------------
The following uses don't require any permission at all:
* Referring to the software or the Moodle project as the "Moodle™ software"
or the "Moodle™ project"
* Describing your own implementation of the Moodle™ software platform
(including within corporate settings).
* Describing a Moodle-based community hub.
* Describing some software youve made that integrates with Moodle
(eg a Moodle integration feature on another system).
* Describing certain software you've made that integrates with Moodle
branded software (e.g. a Moodle integration feature on another system).
Restricted uses
---------------
Restricted uses of "Moodle"
---------------------------
The following uses are generally prohibited without explicit and direct
permission being granted to you by Moodle Pty Ltd. We do this to protect the
Moodle project from software and sites which could confuse people. Please
contact us to ask for permission in writing.
Moodle project from software and sites which could confuse people. If in
doubt, reach out for clarification at <trademarks@moodle.com>
* You cant use "Moodle" in the name of your software (including Mobile apps)
* You cant use "Moodle" in your company name
* You cant use "Moodle" in your domain name
* You cant use "Moodle" in advertising-related keywords (such as Adsense)
* You cant use "Moodle" to describe services around Moodle (such as hosting,
training, support, consulting, course creation services, theme development,
customisation, installation, integration and certification). This applies
even if you do not charge for the services. Note that usually only Moodle
Partners have this permission.
For information about the Moodle Partner Certification Mark as well as for how
to contact us, please see <https://moodle.com/trademarks/>.
* You can't use the word "Moodle" or any Moodle logos for commercial purposes
without prior written permission from Moodle HQ.
* You can't use "Moodle" in the name of your software (including Mobile apps).
* You can't use "Moodle" in your company name.
* You can't use "Moodle" in your domain name.
* You can't use "Moodle" in advertising-related keywords (such as Adsense).
* You can't use "Moodle" to describe services around Moodle
(such as hosting, training, support, consulting, course creation services,
theme development, customisation, installation, integration, analytics
and certification) that cause consumers to be confused that you are
associated with Moodle HQ if you are not.
This applies even if you do not charge for the services.
Note that usually only Moodle Partners have this permission.
+78
View File
@@ -0,0 +1,78 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Reset course indentation
*
* @copyright 2023 Amaia Anabitarte <amaia@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../../config.php');
require_admin();
$format = required_param('format', PARAM_PLUGIN);
$confirm = optional_param('confirm', false, PARAM_BOOL);
$backurl = new moodle_url('/admin/settings.php', ['section' => 'formatsetting'.$format]);
$PAGE->set_url('/admin/course/resetindentation.php', ['format' => $format]);
$PAGE->set_context(context_system::instance());
if ($confirm) {
require_sesskey();
$courses = $DB->get_records('course', ['format' => $format], 'id', 'id');
if (!empty($courses)) {
$courseids = array_keys($courses);
list($courseinsql, $courseparams) = $DB->get_in_or_equal($courseids, SQL_PARAMS_NAMED, 'course');
$DB->set_field_select('course_modules', 'indent', '0', "course $courseinsql AND indent <> 0", $courseparams);
rebuild_course_cache(0, true);
}
redirect(
$backurl,
get_string('resetindentationsuccess', 'admin'),
null,
\core\output\notification::NOTIFY_SUCCESS
);
}
$strtitle = get_string('resetindentation', 'admin');
$PAGE->set_title($strtitle);
$PAGE->set_heading($strtitle);
navigation_node::override_active_url(new moodle_url(
'/admin/course/resetindentation.php',
['action' => 'confirm', 'format' => $format]
));
echo $OUTPUT->header();
$displayoptions = ['confirmtitle' => get_string('resetindentation_title', 'admin')];
$confirmbutton = new single_button(
new moodle_url('/admin/course/resetindentation.php', ['confirm' => 1, 'format' => $format, 'sesskey' => sesskey()]),
get_string('resetindentation', 'admin'),
'post'
);
$cancelbutton = new single_button($backurl, get_string('cancel'));
echo $OUTPUT->confirm(
get_string('resetindentation_help', 'admin', ['format' => get_string('pluginname', 'format_'.$format)]),
$confirmbutton,
$cancelbutton,
$displayoptions
);
echo $OUTPUT->footer();
+572
View File
@@ -3751,6 +3751,7 @@
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="7.4.0" level="required">
<RESTRICT function="restrict_php_version_82" message="unsupportedphpversion82" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -3924,4 +3925,575 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.2" requires="3.11.8">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.6.7" />
<VENDOR name="mysql" version="8.0" />
<VENDOR name="postgres" version="13" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.0.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="required"/>
<PHP_EXTENSION name="exif" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="required">
<FEEDBACK>
<ON_ERROR message="sixtyfourbitsrequired" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
<FEEDBACK>
<ON_CHECK message="iscustomadminwarnings" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.3" requires="3.11.8">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.6.7" />
<VENDOR name="mysql" version="8.0" />
<VENDOR name="postgres" version="13" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.0.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="required"/>
<PHP_EXTENSION name="exif" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="required">
<FEEDBACK>
<ON_ERROR message="sixtyfourbitsrequired" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
<FEEDBACK>
<ON_CHECK message="iscustomadminwarnings" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_db_prefix_length" level="required">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.4" requires="4.1.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.6.7" />
<VENDOR name="mysql" version="8.0" />
<VENDOR name="postgres" version="13" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.1.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="required"/>
<PHP_EXTENSION name="exif" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="required">
<FEEDBACK>
<ON_ERROR message="sixtyfourbitsrequired" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
<FEEDBACK>
<ON_CHECK message="iscustomadminwarnings" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_db_prefix_length" level="required">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+10 -2
View File
@@ -6,7 +6,7 @@ require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
$sort = optional_param('sort', 'username', PARAM_ALPHA);
$sort = optional_param('sort', 'username', PARAM_ALPHAEXT);
$dir = optional_param('dir', 'ASC', PARAM_ALPHA);
$page = optional_param('page', 0, PARAM_INT);
$perpage = optional_param('perpage', 30, PARAM_INT);
@@ -154,7 +154,15 @@ foreach ($columns as $column) {
$headings[$column] = "<a href=\"?sort=$column&amp;dir=$columndir&amp;\">".$string[$column]."</a>$columnicon";
}
$headings['delete'] = '';
$acl = $DB->get_records('mnet_sso_access_control', null, "$sort $dir", '*'); //, $page * $perpage, $perpage);
$sortorder = get_safe_orderby([
'username' => 'username',
'mnet_host_id' => 'mnet_host_id',
'access' => 'accessctrl',
'default' => 'username',
], $sort, $dir, false);
$acl = $DB->get_records('mnet_sso_access_control', null, $sortorder);
$aclcount = $DB->count_records('mnet_sso_access_control');
if (!$acl) {
+10 -19
View File
@@ -31,29 +31,20 @@
if (!empty($hide) and confirm_sesskey()) {
$class = \core_plugin_manager::resolve_plugininfo_class('mod');
$class::enable_plugin($hide, false);
admin_get_root(true, false); // settings not required - only pages
if ($class::enable_plugin($hide, false)) {
// Settings not required - only pages.
admin_get_root(true, false);
}
redirect(new moodle_url('/admin/modules.php'));
}
if (!empty($show) and confirm_sesskey()) {
$canenablemodule = true;
$modulename = $show;
// Invoking a callback function that enables plugins to force additional actions (e.g. displaying notifications,
// modals, etc.) and also specify through its returned value (bool) whether the process of enabling the plugin
// should continue after these actions or not.
if (component_callback_exists("mod_{$modulename}", 'pre_enable_plugin_actions')) {
$canenablemodule = component_callback("mod_{$modulename}", 'pre_enable_plugin_actions');
}
if ($canenablemodule) {
$class = \core_plugin_manager::resolve_plugininfo_class('mod');
$class::enable_plugin($show, true);
admin_get_root(true, false); // Settings not required - only pages.
redirect(new moodle_url('/admin/modules.php'));
if (!empty($show) && confirm_sesskey()) {
$class = \core_plugin_manager::resolve_plugininfo_class('mod');
if ($class::enable_plugin($show, true)) {
// Settings not required - only pages.
admin_get_root(true, false);
}
redirect(new moodle_url('/admin/modules.php'));
}
echo $OUTPUT->header();
+23 -12
View File
@@ -30,25 +30,36 @@
require_once(__DIR__ . '/../config.php');
// The state parameter we've given (used in moodle as a redirect url).
// Per https://www.rfc-editor.org/rfc/rfc6749#section-4.1.2.1, state is required, even during error responses.
$state = required_param('state', PARAM_LOCALURL);
$redirecturl = new moodle_url($state);
$params = $redirecturl->params();
$error = optional_param('error', '', PARAM_RAW);
if ($error) {
$message = optional_param('error_description', '', PARAM_RAW);
if ($message) {
$SESSION->loginerrormsg = $message;
redirect(new moodle_url(get_login_url()));
} else {
$SESSION->loginerrormsg = $error;
redirect(new moodle_url(get_login_url()));
$message = optional_param('error_description', null, PARAM_RAW);
// Errors can occur for authenticated users, such as when a user denies authorization for some internal service call.
// In such cases, propagate the error to the component redirect URI.
if (isloggedin()) {
if (isset($params['sesskey']) && confirm_sesskey($params['sesskey'])) {
$redirecturl->param('error', $error);
if ($message) {
$redirecturl->param('error_description', $message);
}
redirect($redirecturl);
}
}
// Not logged in or the sesskey verification failed, redirect to login + show errors.
$SESSION->loginerrormsg = $message ?? $error;
redirect(new moodle_url(get_login_url()));
}
// The authorization code generated by the authorization server.
$code = required_param('code', PARAM_RAW);
// The state parameter we've given (used in moodle as a redirect url).
$state = required_param('state', PARAM_LOCALURL);
$redirecturl = new moodle_url($state);
$params = $redirecturl->params();
if (isset($params['sesskey']) and confirm_sesskey($params['sesskey'])) {
$redirecturl->param('oauth2code', $code);
@@ -34,7 +34,7 @@ class adminpresets_admin_setting_configselect extends adminpresets_setting {
*/
protected function set_value($value) {
// When we intantiate the class we need the choices.
if (empty($this->settindata->choices) && method_exists($this->settingdata, 'load_choices')) {
if (empty($this->settingdata->choices) && method_exists($this->settingdata, 'load_choices')) {
$this->settingdata->load_choices();
}
+17 -29
View File
@@ -24,6 +24,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use core_question\local\bank\question_version_status;
require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir . '/questionlib.php');
@@ -42,36 +43,23 @@ $qtypes = question_bank::get_all_qtypes();
$pluginmanager = core_plugin_manager::instance();
// Get some data we will need - question counts and which types are needed.
$hiddenstatus = \core_question\local\bank\question_version_status::QUESTION_STATUS_HIDDEN;
$draftstatus = \core_question\local\bank\question_version_status::QUESTION_STATUS_DRAFT;
// The second JOIN on question_versions (qv2) is to get the latest version of each question. 
// (Using this sort of JOIN is a known trick for doing this in the fastest possible way.)
$counts = $DB->get_records_sql("
SELECT q.qtype,
COUNT(qv.id) AS numquestions,
SUM(CASE WHEN qv.status = :hiddenstatus THEN 1 ELSE 0 END) AS numhidden,
SUM(CASE WHEN qv.status = :draftstatus THEN 1 ELSE 0 END) AS numdraft
FROM {question} q
JOIN {question_versions} qv ON q.id = qv.questionid
LEFT JOIN {question_versions} qv2 ON qv.questionbankentryid = qv2.questionbankentryid AND qv.version < qv2.version
WHERE qv2.questionbankentryid IS NULL
GROUP BY q.qtype
", [
'hiddenstatus' => question_version_status::QUESTION_STATUS_HIDDEN,
'draftstatus' => question_version_status::QUESTION_STATUS_DRAFT,
]);
$sql = "SELECT result.qtype,
SUM(result.numquestions) AS numquestions,
SUM(result.numhidden) AS numhidden,
SUM(result.numdraft) AS numdraft
FROM (SELECT data.qtype,
data.versionid,
COUNT(data.numquestions) AS numquestions,
(SELECT COUNT(qv.id)
FROM {question_versions} qv
WHERE qv.id = data.versionid
AND qv.status = :hiddenstatus) AS numhidden,
(SELECT COUNT(qv.id)
FROM {question_versions} qv
WHERE qv.id = data.versionid
AND qv.status = :draftstatus) AS numdraft
FROM (SELECT q.qtype, qv.id AS versionid, 1 AS numquestions
FROM {question} q
JOIN {question_versions} qv ON qv.questionid = q.id
JOIN {question_bank_entries} qbe ON qbe.id = qv.questionbankentryid
AND qv.version = (SELECT MAX(v.version)
FROM {question_versions} v
JOIN {question_bank_entries} be ON be.id = v.questionbankentryid
WHERE be.id = qbe.id)) data
GROUP BY data.qtype, data.versionid) result
GROUP BY result.qtype";
$counts = $DB->get_records_sql($sql, ['hiddenstatus' => $hiddenstatus, 'draftstatus' => $draftstatus]);
$needed = [];
foreach ($qtypes as $qtypename => $qtype) {
if (!isset($counts[$qtypename])) {
+1
View File
@@ -90,6 +90,7 @@ $title = get_string('overridepermissionsforrole', 'core_role', $a);
$currenttab = 'permissions';
$PAGE->set_title($title);
$PAGE->activityheader->disable();
$PAGE->navbar->add($straction);
switch ($context->contextlevel) {
case CONTEXT_SYSTEM:
+2 -1
View File
@@ -477,7 +477,8 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), new lang_string('recyclebin_desc', 'backup')));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', new lang_string('generalusers', 'backup'), new lang_string('configgeneralusers', 'backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', new lang_string('generalactivities', 'backup'),
new lang_string('backupautoactivitiesdescription', 'backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), 1));
$temp->add(new admin_setting_configcheckbox(
'backup/backup_auto_files',
@@ -52,6 +52,7 @@
<span data-passwordunmask="wrapper" data-passwordunmaskid="{{ id }}">
<span data-passwordunmask="editor">
<input type="password"
autocomplete="new-password"
name="{{ name }}"
id="{{ id }}"
value="{{ value }}"
@@ -35,9 +35,7 @@ Feature: Allowing multiple accounts to have the same email address
| username | firstname | lastname | email |
| s1 | John | Doe | s1@example.com |
| s2 | Jane | Doe | s2@example.com |
When I log in as "admin"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I click on "Edit" "link" in the "Jane Doe" "table_row"
When I am on the "s2" "user > editing" page logged in as "admin"
And I set the field "Email address" to "<email>"
And I press "Update profile"
Then I should <expect> "This email address is already registered."
+113
View File
@@ -0,0 +1,113 @@
@core @core_admin @core_course @javascript
Feature: Reset course indentation
In order to reset indentation in course modules
As a admin
I want change indent value for all the modules of a course format courses in one go
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Topics Course 1 | T1 | topics |
| Topics Course 2 | T2 | topics |
| Weekly Course 1 | W1 | weeks |
| Weekly Course 2 | W2 | weeks |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| forum | Topics forum name | Topics forum description | T1 | forum1 |
| data | Topics database name | Topics database description | T1 | data1 |
| wiki | Topics wiki name | Topics wiki description | T2 | wiki1 |
| forum | Weekly forum name | Weekly forum description | W1 | forum2 |
| data | Weekly database name | Weekly database description | W1 | data2 |
| wiki | Weekly wiki name | Weekly wiki description | W2 | wiki2 |
And I log in as "admin"
And I am on "Topics Course 1" course homepage with editing mode on
And I open "Topics forum name" actions menu
And I click on "Move right" "link" in the "Topics forum name" activity
And I open "Topics forum name" actions menu
And "Move right" "link" in the "Topics forum name" "activity" should not be visible
And "Move left" "link" in the "Topics forum name" "activity" should be visible
And I press the escape key
And I open "Topics database name" actions menu
And "Move right" "link" in the "Topics database name" "activity" should be visible
And "Move left" "link" in the "Topics database name" "activity" should not be visible
And I am on "Topics Course 2" course homepage with editing mode on
And I open "Topics wiki name" actions menu
And I click on "Move right" "link" in the "Topics wiki name" activity
And I open "Topics wiki name" actions menu
And "Move right" "link" in the "Topics wiki name" "activity" should not be visible
And "Move left" "link" in the "Topics wiki name" "activity" should be visible
And I am on "Weekly Course 1" course homepage with editing mode on
And I open "Weekly forum name" actions menu
And I click on "Move right" "link" in the "Weekly forum name" activity
And I open "Weekly forum name" actions menu
And "Move right" "link" in the "Weekly forum name" "activity" should not be visible
And "Move left" "link" in the "Weekly forum name" "activity" should be visible
And I press the escape key
And I open "Weekly database name" actions menu
And "Move right" "link" in the "Weekly database name" "activity" should be visible
And "Move left" "link" in the "Weekly database name" "activity" should not be visible
And I am on "Weekly Course 2" course homepage with editing mode on
And I open "Weekly wiki name" actions menu
And I click on "Move right" "link" in the "Weekly wiki name" activity
And I open "Weekly wiki name" actions menu
And "Move right" "link" in the "Weekly wiki name" "activity" should not be visible
And "Move left" "link" in the "Weekly wiki name" "activity" should be visible
Scenario Outline: Apply course indentation reset
Given I navigate to "Plugins > Course formats > <format> format" in site administration
And I wait "5" seconds
And "Reset indentation" "link" should exist
When I click on "Reset indentation" "link"
And I should see "Reset indentation on course page"
And "Reset indentation" "button" should exist
And I click on "Reset indentation" "button"
Then I should see "Indentation reset"
And I am on "<format> Course 1" course homepage with editing mode on
And I open "<format> forum name" actions menu
And "Move right" "link" in the "<format> forum name" "activity" should be visible
And "Move left" "link" in the "<format> forum name" "activity" should not be visible
And I press the escape key
And I open "<format> database name" actions menu
And "Move right" "link" in the "<format> database name" "activity" should be visible
And "Move left" "link" in the "<format> database name" "activity" should not be visible
And I am on "<format> Course 2" course homepage with editing mode on
And I open "<format> wiki name" actions menu
And "Move right" "link" in the "<format> wiki name" "activity" should be visible
And "Move left" "link" in the "<format> wiki name" "activity" should not be visible
# Check other course formats had not been reset
And I am on "<other> Course 1" course homepage with editing mode on
And I open "<other> forum name" actions menu
And "Move right" "link" in the "<other> forum name" "activity" should not be visible
And "Move left" "link" in the "<other> forum name" "activity" should be visible
Examples:
| format | other |
| Topics | Weekly |
| Weekly | Topics |
Scenario Outline: Cancel course indentation reset
Given I navigate to "Plugins > Course formats > <format> format" in site administration
And "Reset indentation" "link" should exist
When I click on "Reset indentation" "link"
And I should see "Reset indentation on course page"
And "Reset indentation" "button" should exist
And "Cancel" "button" should exist
And I click on "Cancel" "button"
Then I should not see "Indentation reset"
And I am on "<format> Course 1" course homepage with editing mode on
And I open "<format> forum name" actions menu
And "Move right" "link" in the "<format> forum name" "activity" should not be visible
And "Move left" "link" in the "<format> forum name" "activity" should be visible
And I press the escape key
And I open "<format> database name" actions menu
And "Move right" "link" in the "<format> database name" "activity" should be visible
And "Move left" "link" in the "<format> database name" "activity" should not be visible
And I am on "<format> Course 2" course homepage with editing mode on
And I open "<format> wiki name" actions menu
And "Move right" "link" in the "<format> wiki name" "activity" should not be visible
And "Move left" "link" in the "<format> wiki name" "activity" should be visible
Examples:
| format |
| Topics |
| Weekly |
@@ -11,8 +11,11 @@ Feature: I can add a new preset with current settings
And I set the field "Name" to "Starter"
And I set the field "Description" to "Non-core starter preset"
When I click on "Create preset" "button"
Then I should see "Moodle with all of the most popular features" in the "Starter" "table_row"
And I should see "Starter" in the "Non-core starter preset" "table_row"
Then the following should exist in the "Site admin presets table" table:
| Name | Description |
| Starter | Moodle with all of the most popular features, including Assignment, Feedback, Forum, H5P, Quiz and Completion tracking. |
| Full | All the Starter features plus External (LTI) tool, SCORM, Workshop, Analytics, Badges, Competencies, Learning plans and lots more. |
| Starter | Non-core starter preset |
Scenario: Export current settings
Given I click on "Create preset" "button"
@@ -34,8 +34,11 @@ Feature: Manage availability conditions
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "activity" exists:
| activity | page |
| course | C1 |
| name | P1 |
And I log in as "admin"
And I am on site homepage
When I navigate to "Plugins > Availability restrictions > Manage restrictions" in site administration
# Check the icon is there (it should be a Hide icon, meaning is currently visible).
@@ -51,8 +54,7 @@ Feature: Manage availability conditions
# OK, toggling works. Set the grade one to Hide and we'll go see if it actually worked.
And I click on "Hide" "icon" in the "Restriction by grade" "table_row"
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And "Add restriction..." "dialogue" should be visible
+11 -9
View File
@@ -49,7 +49,7 @@ list($options, $unrecognized) = cli_get_params(
'torun' => 0,
'optimize-runs' => '',
'add-core-features-to-theme' => false,
'axe' => false,
'axe' => null,
'disable-composer' => false,
'composer-upgrade' => true,
'composer-self-update' => true,
@@ -69,7 +69,7 @@ Behat utilities to initialise behat tests
Usage:
php init.php [--parallel=value [--maxruns=value] [--fromrun=value --torun=value]]
[--axe] [-o | --optimize-runs] [-a | --add-core-features-to-theme]
[--no-axe] [-o | --optimize-runs] [-a | --add-core-features-to-theme]
[--no-composer-self-update] [--no-composer-upgrade]
[--disable-composer]
[--help]
@@ -79,7 +79,7 @@ Options:
-m, --maxruns Max parallel processes to be executed at one time
--fromrun Execute run starting from (Used for parallel runs on different vms)
--torun Execute run till (Used for parallel runs on different vms)
--axe Include axe accessibility tests
--no-axe Disable axe accessibility tests.
-o, --optimize-runs
Split features with specified tags in all parallel runs.
@@ -110,6 +110,12 @@ if (!empty($options['help'])) {
exit(0);
}
if ($options['axe']) {
echo "Axe accessibility tests are enabled by default, to disable them, use the --no-axe option.\n";
} else if ($options['axe'] === false) {
echo "Axe accessibility tests have been disabled.\n";
}
// Check which util file to call.
$utilfile = 'util_single_run.php';
$commandoptions = "";
@@ -118,9 +124,7 @@ if ($options['parallel'] && $options['parallel'] > 1) {
$utilfile = 'util.php';
// Sanitize all input options, so they can be passed to util.
foreach ($options as $option => $value) {
if ($value) {
$commandoptions .= " --$option=\"$value\"";
}
$commandoptions .= behat_get_command_flags($option, $value);
}
} else {
// Only sanitize options for single run.
@@ -130,9 +134,7 @@ if ($options['parallel'] && $options['parallel'] > 1) {
];
foreach ($cmdoptionsforsinglerun as $option) {
if (!empty($options[$option])) {
$commandoptions .= " --$option='$options[$option]'";
}
$commandoptions .= behat_get_command_flags($option, $options[$option]);
}
}
+4 -9
View File
@@ -57,7 +57,7 @@ list($options, $unrecognized) = cli_get_params(
'torun' => 0,
'optimize-runs' => '',
'add-core-features-to-theme' => false,
'axe' => false,
'axe' => true,
),
array(
'h' => 'help',
@@ -73,7 +73,7 @@ $help = "
Behat utilities to manage the test environment
Usage:
php util.php [--install|--drop|--enable|--disable|--diag|--updatesteps|--axe|--help] [--parallel=value [--maxruns=value]]
php util.php [--install|--drop|--enable|--disable|--diag|--updatesteps|--no-axe|--help] [--parallel=value [--maxruns=value]]
Options:
--install Installs the test environment for acceptance tests
@@ -82,7 +82,7 @@ Options:
--disable Disables test environment
--diag Get behat test environment status code
--updatesteps Update feature step file.
--axe Include axe accessibility tests
--no-axe Disable axe accessibility tests.
-j, --parallel Number of parallel behat run operation
-m, --maxruns Max parallel processes to be executed at one time.
@@ -320,12 +320,7 @@ function commands_to_execute($options) {
}
foreach ($extraoptions as $option => $value) {
if ($options[$option]) {
$extra .= " --$option";
if ($value) {
$extra .= "=\"$value\"";
}
}
$extra .= behat_get_command_flags($option, $value);
}
if (empty($options['parallel'])) {
+3 -3
View File
@@ -52,7 +52,7 @@ list($options, $unrecognized) = cli_get_params(
'updatesteps' => false,
'optimize-runs' => '',
'add-core-features-to-theme' => false,
'axe' => false,
'axe' => true,
),
array(
'h' => 'help',
@@ -79,7 +79,7 @@ Options:
--disable Disables test environment
--diag Get behat test environment status code
--updatesteps Update feature step file.
--axe Include axe accessibility tests
--no-axe Disable axe accessibility tests.
-o, --optimize-runs Split features with specified tags in all parallel runs.
-a, --add-core-features-to-theme Add all core features to specified theme's
@@ -186,7 +186,7 @@ if ($options['install']) {
behat_config_manager::set_behat_run_config_value('behatsiteenabled', 1);
}
// Define whether to run Behat with axe tests.
// Configure axe according to option.
behat_config_manager::set_behat_run_config_value('axe', $options['axe']);
// Enable test mode.
@@ -103,8 +103,7 @@ Feature: Set up contextual data for tests
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
Then I should see "Topic 1"
Scenario: Add role assigns
@@ -138,17 +137,11 @@ Feature: Set up contextual data for tests
When I log in as "user1"
And I am on site homepage
Then edit mode should be available on the current page
And I log out
And I log in as "user2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as user2
Then edit mode should be available on the current page
And I log out
And I log in as "user3"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as user3
Then edit mode should be available on the current page
And I log out
And I log in as "user4"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as user4
Then edit mode should be available on the current page
And I log out
And I log in as "user5"
@@ -190,8 +183,7 @@ Feature: Set up contextual data for tests
And the following "activities" exist:
| activity | name | intro | course | idnumber | grade |
| assign | Test assignment name with scale | Test assignment description | C1 | assign1 | Test Scale 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as admin
Then I should see "Test assignment name"
# Assignment 2.2 module type is disabled by default
# And I should see "Test assignment22 name"
@@ -308,9 +300,7 @@ Feature: Set up contextual data for tests
And the following "grade categories" exist:
| fullname | course | gradecategory |
| Grade sub category 2 | C1 | Grade category 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
When I am on the "Course 1" "grades > Grader report > View" page logged in as "admin"
Then I should see "Grade category 1"
And I should see "Grade sub category 2"
@@ -331,9 +321,7 @@ Feature: Set up contextual data for tests
| itemname | course | gradecategory |
| Test Grade Item 2 | C1 | Grade category 1 |
| Test Grade Item 3 | C1 | Grade sub category 2 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
When I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
Then I should see "Test Grade Item 1"
And I follow "Edit Test Grade Item 1"
And I expand all fieldsets
@@ -359,9 +347,7 @@ Feature: Set up contextual data for tests
And the following "scales" exist:
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Scales" in the course gradebook
When I am on the "Course 1" "grades > scales" page logged in as admin
Then I should see "Test Scale 1"
And I should see "Disappointing, Good, Very good, Excellent"
@@ -380,9 +366,7 @@ Feature: Set up contextual data for tests
| Grade outcome 2 | OT2 | C1 | Test Scale 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "More > Outcomes" in the course gradebook
When I am on the "Course 1" "grades > outcomes" page logged in as admin
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element"
And I press "Manage outcomes"
@@ -408,9 +392,7 @@ Feature: Set up contextual data for tests
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
When I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
Then I should see "Test Outcome Grade Item 1"
And I follow "Edit Test Outcome Grade Item 1"
And the field "Outcome" matches value "Grade outcome 1"
@@ -425,6 +407,5 @@ Feature: Set up contextual data for tests
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| online_users | Course | C1 | course-view-* | site-pre |
When I log in as "admin"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as admin
Then I should see "Online users"
@@ -21,12 +21,15 @@ Feature: Edit capabilities
Scenario: Default system capabilities modification
Given I log in as "admin"
And I set the following system permissions of "Teacher" role:
And I navigate to "Users > Permissions > Define roles" in site administration
And I click on "Edit Teacher role" "link"
And I fill the capabilities form with the following permissions:
| capability | permission |
| block/mnet_hosts:myaddinstance | Allow |
| moodle/site:messageanyuser | Inherit |
| moodle/grade:managesharedforms | Prevent |
| moodle/course:request | Prohibit |
And I press "Save changes"
When I follow "Edit Teacher role"
Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission
And "moodle/site:messageanyuser" capability has "Not set" permission
@@ -48,16 +51,12 @@ Feature: Edit capabilities
And "mod/forum:addquestion" capability has "Allow" permission
Scenario: Module capabilities overrides
Given I log in as "teacher1"
And the following "activity" exists:
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | 00001 |
| name | I'm the name |
| intro | I'm the introduction |
| section | 1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "I'm the name"
And I am on the "I'm the name" "forum activity" page logged in as teacher1
And I navigate to "Permissions" in current page administration
And I override the system permissions of "Student" role with:
| mod/forum:deleteanypost | Prohibit |
@@ -30,10 +30,9 @@ Feature: Verify that all form fields values can be get and set
| student2 | G2 |
| student3 | G2 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | firstpagetitle | wikimode | visible |
| wiki | C1 | wiki1 | Test this one | Test this one | Test this one | collaborative | 0 |
And I log in as "admin"
And I am on the "Course 1" "reset" page
| activity | course | idnumber | name | firstpagetitle | wikimode | visible |
| wiki | C1 | wiki1 | Test this one | Test this one | collaborative | 0 |
And I am on the "Course 1" "reset" page logged in as admin
# Select (multi-select) - Checking "the select box should contain".
And I expand all fieldsets
And the "Unenrol users" select box should contain "No roles"
@@ -60,16 +59,14 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" ticked.
And I set the field "Force format" to "1"
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the field "Force format" matches value "1"
And the field "Force format" does not match value ""
# Checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Force format" to ""
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the field "Force format" matches value ""
And the field "Force format" does not match value "1"
@@ -77,8 +74,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | 1 |
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the following fields match these values:
| Force format | 1 |
@@ -88,8 +84,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | |
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the following fields match these values:
| Force format | |
@@ -142,10 +137,11 @@ Feature: Verify that all form fields values can be get and set
And I navigate to "Settings" in current page administration
And the field "Course ID number" matches value "Course id number"
Scenario: with JS disabled all form fields getters and setters works as expected
@javascript
Scenario: with JS enabled all form fields getters and setters works as expected
Given the following "activities" exist:
| activity | course | name |
| lesson | C1 | Test lesson |
Then I am on the "Course 1" "groups" page
# Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain".
And I set the field "groups" to "Group 2"
@@ -157,11 +153,8 @@ Feature: Verify that all form fields values can be get and set
And the "members" select box should contain "Student 2 (s2@example.com)"
And the "members" select box should not contain "Student 3 (s3@example.com)"
# Checkbox (AJAX) - Checking "I set the field" and "I set the following fields to these values".
And I am on "Course 1" course homepage
And I add a "Lesson" to section "1"
And I am on the "Test lesson" "lesson activity editing" page
And I set the following fields to these values:
| Name | Test lesson |
| Description | Test lesson description |
| available[enabled] | 1 |
And I set the field "deadline[enabled]" to "1"
# Checkbox (AJAX) - Checking "the field matches value" before saving.
+2
View File
@@ -1,5 +1,7 @@
This files describes API changes in the tool_behat code.
=== 4.0.9 ===
* Behat is initialised with Axe accessibility tests enabled by default, if you want to disable them please use the --no-axe option.
=== 3.7 ===
* Behat will now look for behat step definitions in the current
theme and any parents the theme may have.
@@ -48,12 +48,7 @@ class accessibility {
public static function is_accessibility_enabled(): bool {
global $CFG;
if (isset($CFG->enableaccessibilitytools)) {
return $CFG->enableaccessibilitytools;
}
// Enabled by default.
return true;
return !empty($CFG->enableaccessibilitytools);
}
/**
@@ -16,6 +16,8 @@
namespace tool_brickfield\local\tool;
use tool_brickfield\manager;
/**
* Class advanced.
*
@@ -51,12 +53,36 @@ class advanced extends tool {
return 'advanced';
}
/**
* Builds context data used to render a single grid item on the advanced page.
* @param string $icon
* @param string $heading
* @param string $content
* @return array
*/
protected function get_grid_item_context(string $icon, string $heading, string $content): array {
return [
"icon" => "pix/i/$icon.png",
"iconalt" => get_string("icon:$icon", manager::PLUGINNAME),
"heading" => get_string($heading, manager::PLUGINNAME),
"content" => get_string($content, manager::PLUGINNAME)
];
}
/**
* Return the data for renderer / template display.
* @return \stdClass
*/
protected function fetch_data(): \stdClass {
$data = (object)[
'griditems' => [
$this->get_grid_item_context("analytics-custom", "headingone", "contentone"),
$this->get_grid_item_context("tools-custom", "headingtwo", "contenttwo"),
$this->get_grid_item_context("file-edit-custom", "headingthree", "contentthree"),
$this->get_grid_item_context("search-plus-custom", "headingfour", "contentfour"),
$this->get_grid_item_context("wand-magic-custom", "headingfive", "contentfive"),
$this->get_grid_item_context("hands-helping-custom", "headingsix", "contentsix"),
],
'valid' => true,
'error' => '',
];
@@ -254,19 +254,16 @@ class renderer extends \tool_brickfield\output\renderer {
<tr>
<td>
<img src="' . $this->image_path() . 'tachometer-alt-solid.svg" width="15" height="15">' .
' <td style="line-height: 10px;"> ' .
get_string('totalactivitiescount', manager::PLUGINNAME, $data->combodata['total']) .
'</td></td>
'</td>
<td>
<img src="' . $this->image_path() . 'check-square-regular.svg" width="15" height="15">' .
' <td style="line-height: 10px;"> ' .
get_string('passedcount', manager::PLUGINNAME, $data->combodata['passed']) .
'</td></td>
'</td>
<td>
<img src="' . $this->image_path() . 'times-circle-regular.svg" width="15" height="15">' .
' <td style="line-height: 10px;"> ' .
get_string('failedcount', manager::PLUGINNAME, $data->combodata['failed']) .
'</td></td>
'</td>
</tr>
</table>';
@@ -396,8 +393,8 @@ class renderer extends \tool_brickfield\output\renderer {
foreach ($data->groupdata as $key => $group) {
$checkgroup = area_base::checkgroup_name($key);
$icon = $icons[$key];
$tabledata[] = ['<img src="'.$icon.'" width="15" height="15">' . ' ' .' <td style="line-height: 10px;"> '.
get_string('checktype:' . $checkgroup, manager::PLUGINNAME).'</td>', $group->errorinstances];
$tabledata[] = ['<img src="'.$icon.'" width="15" height="15">' . ' ' .
get_string('checktype:' . $checkgroup, manager::PLUGINNAME), $group->errorinstances];
}
return $this->render_table(
@@ -270,3 +270,9 @@ $string['headingthree'] = 'Accessible file formats';
$string['headingfour'] = 'Focus effort';
$string['headingfive'] = 'HTML fixes';
$string['headingsix'] = 'Performance support';
$string['icon:analytics-custom'] = 'Analytics icon';
$string['icon:tools-custom'] = 'Tools icon';
$string['icon:file-edit-custom'] = 'Edit file icon';
$string['icon:search-plus-custom'] = 'Search icon';
$string['icon:wand-magic-custom'] = 'Magic wand icon';
$string['icon:hands-helping-custom'] = 'Helping hands icon';
+48 -71
View File
@@ -10,49 +10,22 @@
/* Advanced Page CSS */
@media only screen and (min-width: 768px) {
.tool_brickfield_grid_item {
width: 33.333333333333336%;
}
#tool_brickifeld_advanced_page {
margin: 20px 20px 20px 10px;
}
@media only screen and (max-width: 767px) {
.tool_brickfield_grid_item {
width: 100%;
}
}
.tool_brickfield_grid {
max-width: 1140px;
margin-right: auto;
margin-left: auto;
}
.tool_brickfield_grid_inner {
width: 100%;
.tool_brickfield_banner_heading {
display: flex;
flex-wrap: wrap;
}
.tool_brickfield_grid_item_shape {
height: 96%;
background-color: #fff;
padding: 10% 10% 10% 10%;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.05);
margin: 1% 1% 1% 1%;
border-radius: 15px 15px 15px 70px;
}
.tool_brickfield_grid_display {
display: grid;
grid-template-columns: 0.6fr 1.4fr 1fr;
grid-template-rows: 1fr 1fr;
}
.tool_brickfield_grid_spacing {
justify-content: space-between;
margin-bottom: 20px;
margin-left: auto;
margin-right: 1em;
}
.tool_brickfield_banner_heading > img {
height: 50px;
}
.tool_brickfield_banner > p {
text-align: center;
}
.tool_brickfield_grid_heading {
@@ -60,59 +33,63 @@
font-size: 20px;
font-weight: 400;
color: #040d29;
padding-bottom: 4px;
}
.tool_brickfield_grid_content {
color: #040d29;
font-size: 16px;
line-height: 1.4em;
margin: 0;
padding: 0;
}
.tool_brickfield_logo_height {
height: 3em;
}
.tool_brickfield_logo_position {
padding-bottom: 2em;
}
.tool_brickfield_icon_position {
line-height: 1;
font-size: 50px;
}
.tool_brickfield_icon_height {
.tool_brickfield_grid_heading > img {
height: 30px;
padding-right: 16px;
}
.tool_brickfield_center_button {
text-align: center;
.tool_brickfield_grid {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: 20px 20px 30px;
}
.tool_brickfield_advanced_button {
.tool_brickfield_grid > div {
margin: 10px;
padding: 20px;
flex-basis: 30%;
border: 1px solid grey;
max-width: 500px;
min-width: 250px;
flex-grow: 4;
border-radius: 15px 15px 15px 50px;
}
.tool_brickfield_grid_heading {
display: flex;
}
.tool_brickfield_footer > a {
font-size: 18px;
letter-spacing: 1px;
color: #fff;
background-color: #4054b2;
border-style: solid;
border-color: #fff;
border-radius: 5px 5px 5px 5px;
padding: 15px 50px 15px 50px;
border-radius: 5px;
padding: 15px 50px;
transition: 0.3s;
margin-bottom: 20px;
}
.tool_brickfield_advanced_button:hover {
.tool_brickfield_footer {
text-align: center;
}
.tool_brickfield_footer > a:hover {
color: #fff;
background-color: #253687;
text-decoration: none;
}
.tool_brickfield_banner_heading {
margin-bottom: 1.5em;
}
.tool_brickfield_banner {
height: 10em;
padding: 2.5em;
margin-bottom: 2em;
.tool_brickfield_footer > p {
margin-bottom: 25px;
}
+31 -173
View File
@@ -21,184 +21,42 @@
Example context (json):
{
"pagetitle": "Advanced"
"griditems": [
{
"icon": "some-icon-name",
"iconalt": "some-icon-alt",
"heading": "some-heading",
"content": "some-content"
}
]
}
}}
<link rel="stylesheet" href="styles.css">
<h3>{{{pagetitle}}}</h3>
<section class="tool_brickfield_banner">
<div class="tool_brickfield_banner_heading">
<img src="pix/i/Brickfield-logo-black.png" alt="Brickfield Logo" class="pull-right tool_brickfield_logo_height">
<h2>{{# str }}bannerheadingone, tool_brickfield{{/ str }}</h2>
<div id="tool_brickifeld_advanced_page">
<div class="tool_brickfield_banner">
<div class="tool_brickfield_banner_heading">
<h2>{{#str}} bannerheadingone, tool_brickfield{{/str}}</h2>
<img src="pix/i/Brickfield-logo-black.png" alt="Brickfield Logo">
</div>
<p>{{#str}} bannercontentone, tool_brickfield, https://www.brickfield.ie/moodle_talk_to_sales/{{/str}}</p>
</div>
<p>
{{# str }}bannercontentone, tool_brickfield, https://www.brickfield.ie/moodle_talk_to_sales/{{/ str }}
</p>
</section>
<div class="tool_brickfield_grid">
<div class="tool_brickfield_grid_inner">
<div class="tool_brickfield_grid">
{{#griditems}}
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'al ar ar' 'al ar ar'; grid-area: a;">
<div style="grid-area: al;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/analytics-custom.png" alt="Analytics icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: ar;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingone, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contentone, tool_brickfield{{/ str }}
</p>
</div>
</div>
<div class="tool_brickfield_grid_heading">
<img src={{icon}} alt={{iconalt}}>
<h3>{{heading}}</h3>
</div>
<div class="tool_brickfield_grid_content">
<p>{{content}}</p>
</div>
</div>
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'bl br br' 'bl br br'; grid-area: b;">
<div style="grid-area: bl;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/tools-custom.png" alt="Tools icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: br;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingtwo, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contenttwo, tool_brickfield{{/ str }}
</p>
</div>
</div>
</div>
</div>
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'cl cr cr' 'cl cr cr'; grid-area: c;">
<div style="grid-area: cl;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/file-edit-custom.png" alt="Edit file icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: cr;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingthree, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contentthree, tool_brickfield{{/ str }}
</p>
</div>
</div>
</div>
</div>
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'dl dr dr' 'dl dr dr'; grid-area: d;">
<div style="grid-area: dl;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/search-plus-custom.png" alt="Search icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: dr;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingfour, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contentfour, tool_brickfield{{/ str }}
</p>
</div>
</div>
</div>
</div>
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'el er er' 'el er er'; grid-area: e;">
<div style="grid-area: el;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/wand-magic-custom.png" alt="Magic wand icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: er;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingfive, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contentfive, tool_brickfield{{/ str }}
</p>
</div>
</div>
</div>
</div>
<div class="tool_brickfield_grid_item">
<div class="tool_brickfield_grid_item_shape">
<div class="tool_brickfield_grid_display" style="grid-template-areas: 'fl fr fr' 'fl fr fr'; grid-area: f;">
<div style="grid-area: fl;">
<div class="tool_brickfield_grid_spacing">
<span class="tool_brickfield_icon_position">
<img src="pix/i/hands-helping-custom.png" alt="Helping hands icon" class="tool_brickfield_icon_height">
</span>
</div>
</div>
<div style="grid-area: fr;">
<h3>
<span class="tool_brickfield_grid_heading">
{{# str }}headingsix, tool_brickfield{{/ str }}
</span>
</h3>
<p class="tool_brickfield_grid_content">
{{# str }}contentsix, tool_brickfield{{/ str }}
</p>
</div>
</div>
</div>
</div>
{{/griditems}}
</div>
<div class="tool_brickfield_footer">
<h2 class="accesshide">{{#str}} footerheading, tool_brickfield {{/str}}</h2>
<p>{{#str}}bannercontenttwo, tool_brickfield{{/str}}</p>
<a href="https://www.brickfield.ie/moodle_free_demo/">
{{#str}}buttonone, tool_brickfield{{/str}}
</a>
</div>
</div>
<section class="tool_brickfield_banner">
<h2 class="accesshide">{{# str }}footerheading, tool_brickfield{{/ str }}</h2>
<p>
{{# str }}bannercontenttwo, tool_brickfield{{/ str }}
</p>
<div class="tool_brickfield_center_button">
<form action="https://www.brickfield.ie/moodle_free_demo/">
<button class="tool_brickfield_advanced_button">
{{# str }}buttonone, tool_brickfield{{/ str }}
</button>
</form>
</div>
</section>
+1
View File
@@ -179,6 +179,7 @@ class api {
AND ra.roleid = :roleid
AND ra.userid = :userid
WHERE cm.cohortid ' . $cohortsql . '
AND u.deleted = 0
AND ra.id IS NULL';
$toadd = $DB->get_records_sql($sql, $params);
@@ -0,0 +1,43 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
declare(strict_types=1);
namespace tool_cohortroles;
use core\event\user_deleted;
/**
* Plugin event observer callbacks
*
* @package tool_cohortroles
* @copyright 2023 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class observers {
/**
* User deleted event, remove cohort role assignments specific to them
*
* @param user_deleted $event
*/
public static function user_deleted(user_deleted $event): void {
$cohortroleassignments = cohort_role_assignment::get_records(['userid' => $event->objectid]);
foreach ($cohortroleassignments as $cohortroleassignment) {
$cohortroleassignment->delete();
}
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Plugin event observers
*
* @package tool_cohortroles
* @copyright 2023 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$observers = [
[
'eventname' => '\core\event\user_deleted',
'callback' => '\tool_cohortroles\observers::user_deleted',
],
];
+8
View File
@@ -47,5 +47,13 @@ function xmldb_tool_cohortroles_upgrade($oldversion) {
// Automatically generated Moodle v4.0.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2022041901) {
// Delete any tool_cohortroles mappings for users who no longer exist.
$DB->delete_records_select('tool_cohortroles', 'userid NOT IN (SELECT id FROM {user} WHERE deleted = 0)');
// Cohortroles savepoint reached.
upgrade_plugin_savepoint(true, 2022041901, 'tool', 'cohortroles');
}
return true;
}
+1 -2
View File
@@ -24,8 +24,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2022041901; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022041200; // Requires this Moodle version.
$plugin->component = 'tool_cohortroles'; // Full name of the plugin (used for diagnostics).
@@ -274,7 +274,7 @@ $string['requesttypedelete'] = 'Delete all of my personal data';
$string['requesttypedeleteshort'] = 'Delete';
$string['requesttypeexport'] = 'Export all of my personal data';
$string['requesttypeexportshort'] = 'Export';
$string['requesttypeothers'] = 'General inquiry';
$string['requesttypeothers'] = 'General enquiry';
$string['requesttypeothersshort'] = 'Message';
$string['requireallenddatesforuserdeletion'] = 'Consider courses without end date as active';
$string['requireallenddatesforuserdeletion_desc'] = 'When calculating user expiry, several factors are considered:
@@ -20,7 +20,7 @@ Feature: Contact the privacy officer
And I click on "Send" "button" in the "Contact the privacy officer" "dialogue"
Then I should see "Your request has been submitted to the privacy officer"
And I click on "Data requests" "link"
And I should see "Hello DPO!" in the "General inquiry" "table_row"
And I should see "Hello DPO!" in the "General enquiry" "table_row"
Scenario: Contacting the privacy officer when not enabled
When I log in as "student1"
@@ -30,6 +30,12 @@ Feature: Protected data should not be deleted
| Site purpose | PT1H | 0 |
| prot | P1D | 1 |
| unprot | P1D | 0 |
And the following "mod_forum > discussions" exist:
| user | forum | name | message |
| u1 | forump1 | Discussion subject | Test post in forump1 |
| u1 | forumu1 | Discussion subject | Test post in forumu1 |
| u1 | forump2 | Discussion subject | Test post in forump2 |
| u1 | forumu2 | Discussion subject | Test post in forumu2 |
And I set the category and purpose for the "forump1" "forum" in course "C1" to "CAT" and "prot"
And I set the category and purpose for the "forump2" "forum" in course "C2" to "CAT" and "prot"
And I set the category and purpose for the "forumu1" "forum" in course "C1" to "CAT" and "unprot"
@@ -38,47 +44,25 @@ Feature: Protected data should not be deleted
@javascripta
Scenario: Unexpired and protected data is not removed
Given I log in as "u1"
And I am on "C1" course homepage
And I add a new discussion to "forump1" forum with:
| Subject | Discussion subject |
| Message | Test post in forump1 |
And I am on "C1" course homepage
And I add a new discussion to "forumu1" forum with:
| Subject | Discussion subject |
| Message | Test post in forumu1 |
And I am on "C2" course homepage
And I add a new discussion to "forump2" forum with:
| Subject | Discussion subject |
| Message | Test post in forump2 |
And I am on "C2" course homepage
And I add a new discussion to "forumu2" forum with:
| Subject | Discussion subject |
| Message | Test post in forumu2 |
And I log out
And I log in as "admin"
Given I log in as "admin"
And I create a dataprivacy "delete" request for "u1"
And I approve a dataprivacy "delete" request for "u1"
And I run all adhoc tasks
And I navigate to "Users > Privacy and policies > Data requests" in site administration
And I should see "Deleted" in the "u1" "table_row"
And I am on "C1" course homepage
And I follow "forump1"
And I am on the "forump1" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forump1"
When I am on "C1" course homepage
And I follow "forumu1"
When I am on the "forumu1" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forumu1"
And I am on "C2" course homepage
And I follow "forump2"
And I am on the "forump2" "forum activity" page
And I follow "Discussion subject"
Then I should see "Test post in forump2"
When I am on "C2" course homepage
And I follow "forumu2"
When I am on the "forumu2" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forumu2"
+1 -1
View File
@@ -5,6 +5,6 @@ define("tool_langimport/search",["exports","core/pending","core/utils"],(functio
* @module tool_langimport/search
* @copyright 2021 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_pending=(obj=_pending)&&obj.__esModule?obj:{default:obj};const SELECTORS_AVAILABLE_LANG_SELECT="select",SELECTORS_AVAILABLE_LANG_SEARCH='[data-action="search"]';var _default={init:form=>{const availableLangsElement=form.querySelector(SELECTORS_AVAILABLE_LANG_SELECT),availableLangsFilter=event=>{const pendingPromise=new _pending.default("tool_langimport/search:filter");availableLangsElement.querySelectorAll("option").forEach((option=>{option.remove()}));const searchTerm=event.target.value.toLowerCase(),availableLanguages=JSON.parse(availableLangsElement.dataset.availableLanguages),filteredLanguages=Object.keys(availableLanguages).reduce(((matches,langcode)=>(availableLanguages[langcode].toLowerCase().includes(searchTerm)&&(matches[langcode]=availableLanguages[langcode]),matches)),[]);Object.entries(filteredLanguages).forEach((_ref=>{let[langcode,langname]=_ref;const option=document.createElement("option");option.value=langcode,option.innerText=langname,availableLangsElement.append(option)})),pendingPromise.resolve()},availableLanguages={};availableLangsElement.querySelectorAll("option").forEach((option=>{availableLanguages[option.value]=option.text})),availableLangsElement.dataset.availableLanguages=JSON.stringify(availableLanguages);const availableLangsSearch=form.querySelector(SELECTORS_AVAILABLE_LANG_SEARCH);availableLangsSearch.addEventListener("keydown",(event=>{"Enter"===event.key&&event.preventDefault()})),availableLangsSearch.addEventListener("keyup",(event=>{const pendingPromise=new _pending.default("tool_langimport/search:keyup");(0,_utils.debounce)(availableLangsFilter,250)(event),setTimeout((()=>{pendingPromise.resolve()}),250)}))}};return _exports.default=_default,_exports.default}));
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_pending=(obj=_pending)&&obj.__esModule?obj:{default:obj};const SELECTORS_AVAILABLE_LANG_SELECT="select",SELECTORS_AVAILABLE_LANG_SEARCH='[data-action="search"]';_exports.init=form=>{const availableLangsElement=form.querySelector(SELECTORS_AVAILABLE_LANG_SELECT),availableLanguages={};availableLangsElement.querySelectorAll("option").forEach((option=>{availableLanguages[option.value]=option.text})),availableLangsElement.dataset.availableLanguages=JSON.stringify(availableLanguages);const availableLangsSearch=form.querySelector(SELECTORS_AVAILABLE_LANG_SEARCH);availableLangsSearch.addEventListener("keydown",(event=>{"Enter"===event.key&&event.preventDefault()}));const availableLangsSearchDebounce=(0,_utils.debounce)((event=>{const pendingPromise=new _pending.default("tool_langimport/search:filter");availableLangsElement.querySelectorAll("option").forEach((option=>{option.remove()}));const searchTerm=event.target.value.toLowerCase(),availableLanguages=JSON.parse(availableLangsElement.dataset.availableLanguages),filteredLanguages=Object.keys(availableLanguages).reduce(((matches,langcode)=>(availableLanguages[langcode].toLowerCase().includes(searchTerm)&&(matches[langcode]=availableLanguages[langcode]),matches)),[]);Object.entries(filteredLanguages).forEach((_ref=>{let[langcode,langname]=_ref;const option=document.createElement("option");option.value=langcode,option.innerText=langname,availableLangsElement.append(option)})),pendingPromise.resolve()}),250);availableLangsSearch.addEventListener("keyup",(event=>{const pendingPromise=new _pending.default("tool_langimport/search:keyup");availableLangsSearchDebounce(event),setTimeout((()=>{pendingPromise.resolve()}),250)}))}}));
//# sourceMappingURL=search.min.js.map
File diff suppressed because one or more lines are too long
+3 -6
View File
@@ -36,7 +36,7 @@ const DEBOUNCE_TIMER = 250;
*
* @param {Element} form
*/
const init = (form) => {
export const init = form => {
const availableLangsElement = form.querySelector(SELECTORS.AVAILABLE_LANG_SELECT);
const availableLangsFilter = (event) => {
@@ -84,16 +84,13 @@ const init = (form) => {
});
// Debounce the event listener to allow the user to finish typing.
const availableLangsSearchDebounce = debounce(availableLangsFilter, DEBOUNCE_TIMER);
availableLangsSearch.addEventListener('keyup', (event) => {
const pendingPromise = new Pending('tool_langimport/search:keyup');
debounce(availableLangsFilter, DEBOUNCE_TIMER)(event);
availableLangsSearchDebounce(event);
setTimeout(() => {
pendingPromise.resolve();
}, DEBOUNCE_TIMER);
});
};
export default {
init: init,
};
@@ -24,6 +24,8 @@
namespace tool_langimport;
use moodle_url;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->libdir.'/componentlib.class.php');
@@ -59,6 +61,25 @@ class controller {
$this->availablelangs = $this->installer->get_remote_list_of_languages();
}
/**
* Redirect to the specified url, outputting any required messages.
*
* @param moodle_url $url
*/
public function redirect(moodle_url $url): void {
if ($this->info) {
$info = implode('<br />', $this->info);
\core\notification::success($info);
}
if ($this->errors) {
$info = implode('<br />', $this->errors);
\core\notification::error($info);
}
redirect($url);
}
/**
* Install language packs provided
*
@@ -112,6 +133,18 @@ class controller {
public function uninstall_language($lang) {
global $CFG;
$lang = clean_param($lang, PARAM_LANG);
if ($lang === '') {
// Do not allow uninstallation of invalid languages.
// Note: PARAM_LANG returns an empty string for invalid validation.
return false;
}
if ($lang === 'en') {
// Never allow removal of the default langauge.
return false;
}
$dest1 = $CFG->dataroot.'/lang/'.$lang;
$dest2 = $CFG->dirroot.'/lang/'.$lang;
$rm1 = false;
+10 -2
View File
@@ -43,6 +43,13 @@ $uninstalllang = optional_param_array('uninstalllang', array(), PARAM_LANG)
$confirmtounistall = optional_param('confirmtouninstall', '', PARAM_SAFEPATH); // uninstallation confirmation
$purgecaches = optional_param('purgecaches', false, PARAM_BOOL); // explicit caches reset
// Filter the uninstall language list.
// If the list contains a language which is not installed, it is replaced with an empty string.
// When we try to uninstall an empty string, we uninstall every language.
$uninstalllang = array_filter($uninstalllang, function($lang) {
return !empty($lang);
});
if ($purgecaches) {
require_sesskey();
get_string_manager()->reset_caches();
@@ -69,11 +76,12 @@ if (($mode == INSTALLATION_OF_SELECTED_LANG) and confirm_sesskey() and !empty($p
if (is_array($pack) && count($pack) > 1) {
// Installing multiple languages can take a while - perform it asynchronously in the background.
$controller->schedule_languagepacks_installation($pack);
$controller->redirect($PAGE->url);
} else {
// Single language pack to be installed synchronously. It should be reasonably quick and can be used for debugging, too.
core_php_time_limit::raise();
$controller->install_languagepacks($pack);
$controller->redirect($PAGE->url);
}
}
@@ -102,7 +110,7 @@ if ($mode == DELETION_OF_SELECTED_LANG and (!empty($uninstalllang) or !empty($co
foreach ($uninstalllang as $ulang) {
$controller->uninstall_language($ulang);
}
$controller->redirect($PAGE->url);
}
}
@@ -0,0 +1,59 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_langimport;
/**
* Tests for \tool_langimport\locale class.
*
* @package tool_langimport
* @category test
* @coversDefaultClass \tool_langimport\controller
* @copyright 2023 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class controller_test extends \advanced_testcase {
/**
* Test uninstall of language with invalid values.
*
* @covers ::uninstall_lang
* @dataProvider uninstall_lang_invalid_provider
* @params string $lang
*/
public function test_uninstall_lang_invalid(string $lang): void {
global $CFG;
$controller = new controller();
$this->assertFalse($controller->uninstall_language($lang));
$this->assertFileExists("{$CFG->dataroot}/lang");
$this->assertFileExists("{$CFG->dirroot}/lang/en");
}
/**
* Data provider for uninstall_lang tests with invalid values.
*
* @return array
*/
public function uninstall_lang_invalid_provider(): array {
return [
'Empty string' => [''],
'Meaningless empty string' => [' '],
'Default language' => ['en'],
'Invalid language string' => ['swedish'],
];
}
}
+5 -20
View File
@@ -14,19 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* License manager helper class.
*
* @package tool_licensemanager
* @copyright 2019 Tom Dickman <tomdickman@catalyst-au.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_licensemanager;
use moodle_url;
defined('MOODLE_INTERNAL') || die();
/**
* License manager helper class.
@@ -48,12 +40,7 @@ class helper {
* @return \moodle_url
*/
public static function get_licensemanager_url() : moodle_url {
global $CFG;
$url = new moodle_url($CFG->wwwroot . self::MANAGER_PATH,
['sesskey' => sesskey()]);
return $url;
return new moodle_url(self::MANAGER_PATH);
}
/**
@@ -90,9 +77,8 @@ class helper {
* @return \moodle_url
*/
public static function get_create_license_url() : moodle_url {
$url = new moodle_url(self::MANAGER_PATH,
['action' => manager::ACTION_CREATE, 'sesskey' => sesskey()]);
$url = self::get_licensemanager_url();
$url->params(['action' => manager::ACTION_CREATE]);
return $url;
}
@@ -104,9 +90,8 @@ class helper {
* @return \moodle_url
*/
public static function get_update_license_url(string $licenseshortname) : moodle_url {
$url = new moodle_url(self::MANAGER_PATH,
['action' => manager::ACTION_UPDATE, 'license' => $licenseshortname, 'sesskey' => sesskey()]);
$url = self::get_licensemanager_url();
$url->params(['action' => manager::ACTION_UPDATE, 'license' => $licenseshortname]);
return $url;
}
+9 -10
View File
@@ -14,22 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* License manager.
*
* @package tool_licensemanager
* @copyright 2019 Tom Dickman <tomdickman@catalyst-au.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_licensemanager;
use tool_licensemanager\form\edit_license;
use license_manager;
use stdClass;
defined('MOODLE_INTERNAL') || die();
/**
* License manager, main controller for tool_licensemanager.
*
@@ -95,18 +85,25 @@ class manager {
}
$viewmanager = true;
$redirect = helper::get_licensemanager_url();
switch ($action) {
case self::ACTION_DISABLE:
require_sesskey();
license_manager::disable($license);
redirect($redirect);
break;
case self::ACTION_ENABLE:
require_sesskey();
license_manager::enable($license);
redirect($redirect);
break;
case self::ACTION_DELETE:
require_sesskey();
license_manager::delete($license);
redirect($redirect);
break;
case self::ACTION_CREATE:
@@ -116,7 +113,9 @@ class manager {
case self::ACTION_MOVE_UP:
case self::ACTION_MOVE_DOWN:
require_sesskey();
$this->change_license_order($action, $license);
redirect($redirect);
break;
case self::ACTION_VIEW_LICENSE_MANAGER:
-6
View File
@@ -28,15 +28,9 @@ require_once($CFG->libdir . '/licenselib.php');
require_admin();
$returnurl = \tool_licensemanager\helper::get_licensemanager_url();
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$license = optional_param('license', '', PARAM_SAFEDIR);
if (!confirm_sesskey()) {
redirect($returnurl);
}
// Route via the manager.
$licensemanager = new \tool_licensemanager\manager();
$PAGE->set_context(context_system::instance());
@@ -33,3 +33,26 @@ Feature: Licence manager
And "This is the site default licence" "icon" should exist in the "cc" "table_row"
And "Enable licence" "icon" should not exist in the "cc" "table_row"
And "This is the site default licence" "icon" should not exist in the "public" "table_row"
@javascript @_file_upload
Scenario Outline: User licence preference is remembered depending of setting value
Given the following config values are set as admin:
| sitedefaultlicense | cc |
| rememberuserlicensepref | <rememberuserlicensepref> |
And I log in as "admin"
And I follow "Private files" in the user menu
And I follow "Add..."
And I follow "Upload a file"
And the field with xpath "//select[@name='license']" matches value "Creative Commons"
And I click on "Close" "button" in the "File picker" "dialogue"
When I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as:
| Save as | empty_copy.txt |
| license | Public domain |
And I press "Save changes"
And I follow "Add..."
Then the field with xpath "//select[@name='license']" matches value "<expectedlicence>"
Examples:
| rememberuserlicensepref | expectedlicence |
| 0 | Creative Commons |
| 1 | Public domain |
+1 -1
View File
@@ -75,7 +75,7 @@ trait reader {
*/
public static function decode_other(?string $other) {
if ($other === 'N;' || preg_match('~^.:~', $other)) {
return unserialize($other);
return unserialize($other, ['allowed_classes' => [stdClass::class]]);
} else {
return json_decode($other, true);
}
@@ -33,8 +33,7 @@ class store_test extends \advanced_testcase {
* Tests log writing.
*
* @param bool $jsonformat True to test with JSON format
* @dataProvider test_log_writing_provider
* @throws moodle_exception
* @dataProvider log_writing_provider
*/
public function test_log_writing(bool $jsonformat) {
global $DB, $CFG;
@@ -252,9 +251,9 @@ class store_test extends \advanced_testcase {
* Returns different JSON format settings so the test can be run with JSON format either on or
* off.
*
* @return [bool] Array of true/false
* @return bool[] Array of true/false
*/
public static function test_log_writing_provider(): array {
public static function log_writing_provider(): array {
return [
[false],
[true]
@@ -311,17 +310,16 @@ class store_test extends \advanced_testcase {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');
$supportedreports = array(
'report_log' => '/report/log',
'report_loglive' => '/report/loglive'
);
// Make sure all supported reports are installed.
$expectedreports = array_keys(array_intersect_key($allreports, $supportedreports));
$reports = $logmanager->get_supported_reports('logstore_database');
$reports = array_keys($reports);
$expectedreports = array_intersect_key([
'log' => 'report_log',
'loglive' => 'report_loglive',
], $allreports);
$supportedreports = $logmanager->get_supported_reports('logstore_database');
foreach ($expectedreports as $expectedreport) {
$this->assertContains($expectedreport, $reports);
$this->assertArrayHasKey($expectedreport, $supportedreports);
}
}
}
@@ -217,20 +217,19 @@ class store_test extends \advanced_testcase {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');
$supportedreports = array(
'report_log' => '/report/log',
'report_loglive' => '/report/loglive',
'report_outline' => '/report/outline',
'report_participation' => '/report/participation',
'report_stats' => '/report/stats'
);
// Make sure all supported reports are installed.
$expectedreports = array_keys(array_intersect_key($allreports, $supportedreports));
$reports = $logmanager->get_supported_reports('logstore_legacy');
$reports = array_keys($reports);
$expectedreports = array_intersect_key([
'log' => 'report_log',
'loglive' => 'report_loglive',
'outline' => 'report_outline',
'participation' => 'report_participation',
'stats' => 'report_stats'
], $allreports);
$supportedreports = $logmanager->get_supported_reports('logstore_legacy');
foreach ($expectedreports as $expectedreport) {
$this->assertContains($expectedreport, $reports);
$this->assertArrayHasKey($expectedreport, $supportedreports);
}
}
@@ -38,8 +38,7 @@ class store_test extends \advanced_testcase {
* Tests log writing.
*
* @param bool $jsonformat True to test with JSON format
* @dataProvider test_log_writing_provider
* @throws moodle_exception
* @dataProvider log_writing_provider
*/
public function test_log_writing(bool $jsonformat) {
global $DB;
@@ -223,9 +222,9 @@ class store_test extends \advanced_testcase {
* Returns different JSON format settings so the test can be run with JSON format either on or
* off.
*
* @return [bool] Array of true/false
* @return bool[] Array of true/false
*/
public static function test_log_writing_provider(): array {
public static function log_writing_provider(): array {
return [
[false],
[true]
@@ -239,20 +238,19 @@ class store_test extends \advanced_testcase {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');
$supportedreports = array(
'report_log' => '/report/log',
'report_loglive' => '/report/loglive',
'report_outline' => '/report/outline',
'report_participation' => '/report/participation',
'report_stats' => '/report/stats'
);
// Make sure all supported reports are installed.
$expectedreports = array_keys(array_intersect_key($allreports, $supportedreports));
$reports = $logmanager->get_supported_reports('logstore_standard');
$reports = array_keys($reports);
$expectedreports = array_intersect_key([
'log' => 'report_log',
'loglive' => 'report_loglive',
'outline' => 'report_outline',
'participation' => 'report_participation',
'stats' => 'report_stats'
], $allreports);
$supportedreports = $logmanager->get_supported_reports('logstore_standard');
foreach ($expectedreports as $expectedreport) {
$this->assertContains($expectedreport, $reports);
$this->assertArrayHasKey($expectedreport, $supportedreports);
}
}
@@ -368,7 +366,7 @@ class store_test extends \advanced_testcase {
* Tests the decode_other function can cope with both JSON and PHP serialized format.
*
* @param mixed $value Value to encode and decode
* @dataProvider test_decode_other_provider
* @dataProvider decode_other_provider
*/
public function test_decode_other($value) {
$this->assertEquals($value, \logstore_standard\log\store::decode_other(serialize($value)));
@@ -387,7 +385,7 @@ class store_test extends \advanced_testcase {
*
* @return array Array of parameters
*/
public function test_decode_other_provider(): array {
public function decode_other_provider(): array {
return [
[['info' => 'd2819896', 'logurl' => 'discuss.php?d=2819896']],
[null],
@@ -400,8 +398,7 @@ class store_test extends \advanced_testcase {
* Checks that backup and restore of log data works correctly.
*
* @param bool $jsonformat True to test with JSON format
* @dataProvider test_log_writing_provider
* @throws moodle_exception
* @dataProvider log_writing_provider
*/
public function test_backup_restore(bool $jsonformat) {
global $DB;
-2
View File
@@ -229,7 +229,6 @@ class page_helper {
$PAGE->set_pagelayout('standard');
$PAGE->set_url($url);
$PAGE->set_title($title);
$PAGE->set_heading(fullname($user));
if (!empty($plan)) {
$PAGE->navbar->add($title, $planurl);
@@ -303,7 +302,6 @@ class page_helper {
$PAGE->set_pagelayout('standard');
$PAGE->set_url($url);
$PAGE->set_title($title);
$PAGE->set_heading(fullname($user));
if (!empty($evidence)) {
$PAGE->navbar->add($title, $evidenceurl);
@@ -128,3 +128,18 @@ Feature: Manage competency frameworks
Then I should see "Competency framework updated"
And I should see "Science Year-6 Edited"
And I should see "sc-y-6"
Scenario: Duplicate a competency framework
Given the following lp "frameworks" exist:
| shortname | idnumber |
| CF1 | CF1 |
And the following lp "competencies" exist:
| shortname | framework |
| C1 | CF1 |
And I navigate to "Competencies > Competency frameworks" in site administration
# Duplicate the selected competency framework
When I click on "Duplicate" of edit menu in the "CF1" row
# Confirm that the selected framework was duplicated by clicking on the link
And I click on "CF1 (copy) (CF1_1)" "link"
# Confirm that the corresponding competency also exists in the duplicated framework
Then I should see "C1"
+14 -26
View File
@@ -15,6 +15,17 @@ Feature: Manage plan workflow
| usermanageowndraftplan | User manage own draft plan role | user |
| usermanageownplan | User manage own plan role | user |
| manageplan | Manager all plans role | manager |
And the following "role capabilities" exist:
| role | moodle/competency:planmanageowndraft | moodle/competency:planmanageown |
| usermanageowndraftplan | allow | |
| usermanageownplan | allow | allow |
| manageplan | allow | allow |
And the following "role capability" exists:
| role | manageplan |
| moodle/competency:planmanage | allow |
| moodle/competency:planview | allow |
| moodle/competency:planreview | allow |
| moodle/competency:planrequestreview | allow |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| user1 | usermanageowndraftplan | System | |
@@ -40,23 +51,6 @@ Feature: Manage plan workflow
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| lp | System | 1 | my-index | content |
And I log in as "admin"
And I set the following system permissions of "User manage own draft plan role" role:
| capability | permission |
| moodle/competency:planmanageowndraft | Allow |
And I set the following system permissions of "User manage own plan role" role:
| capability | permission |
| moodle/competency:planmanageowndraft | Allow |
| moodle/competency:planmanageown | Allow |
And I set the following system permissions of "Manager all plans role" role:
| capability | permission |
| moodle/competency:planmanage | Allow |
| moodle/competency:planmanagedraft | Allow |
| moodle/competency:planmanageowndraft | Allow |
| moodle/competency:planview | Allow |
| moodle/competency:planreview | Allow |
| moodle/competency:planrequestreview | Allow |
And I log out
Scenario: User can manages his own plan draft
Given I log in as "user1"
@@ -147,9 +141,7 @@ Feature: Manage plan workflow
| name | user | description | status | reviewer |
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
And I log in as "manager1"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
And I am on the "user1" "user > profile" page logged in as "manager1"
And I follow "Learning plans"
And I should see "List of learning plans"
When I click on "Send back to draft" of edit menu in the "Test-Plan3" row
@@ -165,9 +157,7 @@ Feature: Manage plan workflow
| name | user | description | status | reviewer |
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
And I log in as "manager1"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
And I am on the "user1" "user > profile" page logged in as "manager1"
And I follow "Learning plans"
And I should see "List of learning plans"
When I click on "Complete this learning plan" of edit menu in the "Test-Plan3" row
@@ -186,9 +176,7 @@ Feature: Manage plan workflow
| name | user | description | status | reviewer |
| Test-Plan3 | user1 | Description of plan 3 for user 1 | complete | manager1 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | complete | manager1 |
And I log in as "manager1"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
And I am on the "user1" "user > profile" page logged in as "manager1"
And I follow "Learning plans"
And I should see "List of learning plans"
When I click on "Reopen this learning plan" of edit menu in the "Test-Plan3" row
+2
View File
@@ -25,6 +25,8 @@
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toollpexportcsv');
$pagetitle = get_string('exportnavlink', 'tool_lpimportcsv');
$context = context_system::instance();
+2
View File
@@ -25,6 +25,8 @@ define('NO_OUTPUT_BUFFERING', true);
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toollpimportcsv');
$pagetitle = get_string('pluginname', 'tool_lpimportcsv');
$context = context_system::instance();
+11 -7
View File
@@ -59,22 +59,26 @@ class api_test extends \externallib_advanced_testcase {
*/
public function test_get_potential_config_issues() {
global $CFG;
require_once($CFG->dirroot . '/message/lib.php');
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->userquota = '73289234723498234723423489273423497234234';
// Set non-SSL wwwroot, to avoid spurious certificate checking.
$CFG->wwwroot = 'http://www.example.com';
$CFG->debugdisplay = 1;
set_config('debugauthdb', 1, 'auth_db');
set_config('debugdb', 1, 'enrol_database');
$expectedissues = array('adodbdebugwarning', 'displayerrorswarning');
// Get potential issues, obtain their keys for comparison.
$issues = api::get_potential_config_issues();
$this->assertCount(count($expectedissues), $issues);
foreach ($issues as $issue) {
$this->assertTrue(in_array($issue[0], $expectedissues));
}
$issuekeys = array_column($issues, 0);
$this->assertEqualsCanonicalizing([
'nohttpsformobilewarning',
'adodbdebugwarning',
'displayerrorswarning',
], $issuekeys);
}
/**
+53 -134
View File
@@ -14,17 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Event documentation
*
* @package tool_monitor
* @copyright 2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_monitor;
defined('MOODLE_INTERNAL') || die();
use core_component;
use ReflectionClass;
/**
* Class for returning event information.
@@ -35,126 +29,6 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class eventlist {
/**
* Return all of the core event files.
*
* @return array Core events.
*/
protected static function get_core_eventlist() {
global $CFG;
// Disable developer debugging as deprecated events will fire warnings.
// Setup backup variables to restore the following settings back to what they were when we are finished.
$debuglevel = $CFG->debug;
$debugdisplay = $CFG->debugdisplay;
$debugdeveloper = $CFG->debugdeveloper;
$CFG->debug = 0;
$CFG->debugdisplay = false;
$CFG->debugdeveloper = false;
$eventinformation = array();
$directory = $CFG->libdir . '/classes/event';
$files = self::get_file_list($directory);
// Remove exceptional events that will cause problems being displayed.
if (isset($files['unknown_logged'])) {
unset($files['unknown_logged']);
}
foreach ($files as $file => $location) {
$classname = '\\core\\event\\' . $file;
// Check to see if this is actually a valid event.
if (method_exists($classname, 'get_static_info')) {
$ref = new \ReflectionClass($classname);
// Ignore abstracts.
if (!$ref->isAbstract() && $file != 'manager') {
$eventinformation[$classname] = $classname::get_name_with_info();
}
}
}
// Now enable developer debugging as event information has been retrieved.
$CFG->debug = $debuglevel;
$CFG->debugdisplay = $debugdisplay;
$CFG->debugdeveloper = $debugdeveloper;
return $eventinformation;
}
/**
* This function returns an array of all events for the plugins of the system.
*
* @param bool $withoutcomponent Return an eventlist without associated components.
*
* @return array A list of events from all plug-ins.
*/
protected static function get_non_core_eventlist($withoutcomponent = false) {
global $CFG;
// Disable developer debugging as deprecated events will fire warnings.
// Setup backup variables to restore the following settings back to what they were when we are finished.
$debuglevel = $CFG->debug;
$debugdisplay = $CFG->debugdisplay;
$debugdeveloper = $CFG->debugdeveloper;
$CFG->debug = 0;
$CFG->debugdisplay = false;
$CFG->debugdeveloper = false;
$noncorepluginlist = array();
$plugintypes = \core_component::get_plugin_types();
foreach ($plugintypes as $plugintype => $notused) {
$pluginlist = \core_component::get_plugin_list($plugintype);
foreach ($pluginlist as $plugin => $directory) {
$plugindirectory = $directory . '/classes/event';
foreach (self::get_file_list($plugindirectory) as $eventname => $notused) {
$fullpluginname = $plugintype . '_' . $plugin;
$plugineventname = '\\' . $fullpluginname . '\\event\\' . $eventname;
// Check that this is actually an event.
if (method_exists($plugineventname, 'get_static_info') && $fullpluginname !== 'tool_monitor') { // No selfie here.
$ref = new \ReflectionClass($plugineventname);
if (!$ref->isAbstract() && $fullpluginname !== 'logstore_legacy') {
if ($withoutcomponent) {
$noncorepluginlist[$plugineventname] = $plugineventname::get_name_with_info();
} else {
$noncorepluginlist[$fullpluginname][$plugineventname] = $plugineventname::get_name_with_info();
}
}
}
}
}
}
// Now enable developer debugging as event information has been retrieved.
$CFG->debug = $debuglevel;
$CFG->debugdisplay = $debugdisplay;
$CFG->debugdeveloper = $debugdeveloper;
return $noncorepluginlist;
}
/**
* Returns a list of files with a full directory path in a specified directory.
*
* @param string $directory location of files.
* @return array full location of files from the specified directory.
*/
protected static function get_file_list($directory) {
global $CFG;
$directoryroot = $CFG->dirroot;
$finalfiles = array();
if (is_dir($directory)) {
if ($handle = opendir($directory)) {
$files = scandir($directory);
foreach ($files as $file) {
if ($file != '.' && $file != '..') {
// Ignore the file if it is external to the system.
if (strrpos($directory, $directoryroot) !== false) {
$location = substr($directory, strlen($directoryroot));
$name = substr($file, 0, -4);
$finalfiles[$name] = $location . '/' . $file;
}
}
}
}
}
return $finalfiles;
}
/**
* Get a list of events present in the system.
@@ -164,13 +38,58 @@ class eventlist {
* @return array list of events present in the system.
*/
public static function get_all_eventlist($withoutcomponent = false) {
if ($withoutcomponent) {
$return = array_merge(self::get_core_eventlist(), self::get_non_core_eventlist($withoutcomponent));
array_multisort($return, SORT_NATURAL);
} else {
$return = array_merge(array('core' => self::get_core_eventlist()),
self::get_non_core_eventlist($withoutcomponent = false));
global $CFG;
// Disable developer debugging as deprecated events will fire warnings.
// Setup backup variables to restore the following settings back to what they were when we are finished.
$debuglevel = $CFG->debug;
$debugdisplay = $CFG->debugdisplay;
$debugdeveloper = $CFG->debugdeveloper;
$CFG->debug = 0;
$CFG->debugdisplay = false;
$CFG->debugdeveloper = false;
// List of exceptional events that will cause problems if displayed.
$eventsignore = [
\core\event\unknown_logged::class,
\logstore_legacy\event\legacy_logged::class,
];
$return = [];
$events = core_component::get_component_classes_in_namespace(null, 'event');
foreach (array_keys($events) as $event) {
// We need to filter all classes that extend event base, or the base class itself.
if (is_a($event, \core\event\base::class, true) && !in_array($event, $eventsignore)) {
$reflectionclass = new ReflectionClass($event);
if ($reflectionclass->isAbstract()) {
continue;
}
// We can't choose this component's own events.
[$component] = explode('\\', $event);
if ($component === 'tool_monitor') {
continue;
}
if ($withoutcomponent) {
$return["\\{$event}"] = $event::get_name_with_info();
} else {
$return[$component]["\\{$event}"] = $event::get_name_with_info();
}
}
}
// Now enable developer debugging as event information has been retrieved.
$CFG->debug = $debuglevel;
$CFG->debugdisplay = $debugdisplay;
$CFG->debugdeveloper = $debugdeveloper;
if ($withoutcomponent) {
array_multisort($return, SORT_NATURAL);
}
return $return;
}
@@ -169,10 +169,9 @@ Feature: tool_monitor_subscriptions
And I should not see "You can manage rules the from the Event monitoring rules page."
Scenario: No manage rules link when user does not have permission
Given I log in as "admin"
And I set the following system permissions of "Non-editing teacher" role:
| tool/monitor:managerules | Prohibit |
And I log out
Given the following "role capability" exists:
| role | teacher |
| tool/monitor:managerules | prohibit |
And I log in as "teacher1"
And I follow "Preferences" in the user menu
And I follow "Event monitoring"
@@ -71,8 +71,8 @@
</div>
<div class="box py-3 modal-footer">
<div class="buttons">
<input class="btn btn-secondary" type="submit" name="cancel" value="Cancel">
<input class="btn btn-primary" type="submit" name="import" value="Continue">
<input class="btn btn-secondary" type="submit" name="cancel" value="{{#str}}cancel, core{{/str}}">
<input class="btn btn-primary" type="submit" name="import" value="{{#str}}continue, core{{/str}}">
</div>
</div>
</form>
+1 -2
View File
@@ -108,7 +108,7 @@ class issuer extends persistent {
$mform->addHelpButton('clientsecret', 'issuerclientsecret', 'tool_oauth2');
// Use basic authentication.
$mform->addElement('checkbox', 'basicauth', get_string('usebasicauth', 'tool_oauth2'));
$mform->addElement('advcheckbox', 'basicauth', get_string('usebasicauth', 'tool_oauth2'));
$mform->addHelpButton('basicauth', 'usebasicauth', 'tool_oauth2');
// Base Url.
@@ -244,7 +244,6 @@ class issuer extends persistent {
* @return array of additional errors, or overridden errors.
*/
protected function extra_validation($data, $files, array &$errors) {
$errors = [];
if ($data->showonloginpage != \core\oauth2\issuer::SERVICEONLY) {
if (!strlen(trim($data->loginscopes))) {
$errors['loginscopes'] = get_string('required');
@@ -151,25 +151,25 @@ Feature: Basic OAuth2 functionality
| Service base URL | https://dc.imsglobal.org/ |
When I press "Save changes"
Then I should see "Changes saved"
And I should see "Open Badges"
And "Allow services" "icon" should exist in the "Open Badges" "table_row"
And "Do not allow login" "icon" should exist in the "Open Badges" "table_row"
And "Service discovery successful" "icon" should exist in the "Open Badges" "table_row"
And the "src" attribute of "table.admintable th img" "css_element" should contain "IMS-Global-Logo.png"
And I click on "Configure endpoints" "link" in the "Open Badges" "table_row"
And I should see "https://dc.imsglobal.org/.well-known/badgeconnect.json" in the "discovery_endpoint" "table_row"
And I should see "authorization_endpoint"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "Open Badges" "table_row"
And I should not see "given_name"
And I should not see "middle_name"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Edit" "link" in the "Open Badges" "table_row"
And I should see "IMS Global Reference Implementation"
And I click on "Edit" "link" in the "IMS Global Reference Implementation" "table_row"
And I set the following fields to these values:
| Name | IMS Global |
And I press "Save changes"
And I should see "Changes saved"
And I should see "IMS Global"
And "Allow services" "icon" should exist in the "IMS Global" "table_row"
And "Do not allow login" "icon" should exist in the "IMS Global" "table_row"
And "Service discovery successful" "icon" should exist in the "IMS Global" "table_row"
And the "src" attribute of "table.admintable th img" "css_element" should contain "IMS-Global-Logo.png"
And I click on "Configure endpoints" "link" in the "IMS Global" "table_row"
And I should see "https://dc.imsglobal.org/.well-known/badgeconnect.json" in the "discovery_endpoint" "table_row"
And I should see "authorization_endpoint"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Configure user field mappings" "link" in the "IMS Global" "table_row"
And I should not see "given_name"
And I should not see "middle_name"
And I navigate to "Server > OAuth 2 services" in site administration
And I click on "Delete" "link" in the "IMS Global" "table_row"
And I should see "Are you sure you want to delete the identity issuer \"IMS Global\"?"
And I press "Continue"
@@ -218,9 +218,13 @@ Feature: Basic OAuth2 functionality
| Name | Invalid custom service |
| Client ID | thisistheclientid |
| Client secret | supersecret |
| Service base URL | https://dc.imsglobal.org/ |
| Service base URL | http://dc.imsglobal.org/ |
When I press "Save changes"
Then I should see "Could not discover end points for identity issuer: Invalid custom service"
Then I should see "For security reasons only https connections are allowed, sorry"
And I set the following fields to these values:
| Service base URL | https://dc.imsglobal.org/ |
And I press "Save changes"
And I should see "Could not discover end points for identity issuer: Invalid custom service"
And I should see "URL: https://dc.imsglobal.org/.well-known/openid-configuration"
And "Allow services" "icon" should exist in the "Invalid custom service" "table_row"
And "Do not allow login" "icon" should exist in the "Invalid custom service" "table_row"
@@ -358,3 +362,21 @@ Feature: Basic OAuth2 functionality
And I navigate to "Server > OAuth 2 services" in site administration
And "Allow login" "icon" should exist in the "Empty custom service" "table_row"
And "Do not allow services" "icon" should exist in the "Empty custom service" "table_row"
@javascript
Scenario: Changes to "Authenticate token requests via HTTP headers" are saved
Given I press "Custom"
And I set the following fields to these values:
| Name | Custom service |
| Client ID | thisistheclientid |
| Client secret | supersecret |
And I press "Save changes"
When I click on "Edit" "link" in the "Custom service" "table_row"
And I click on "Authenticate token requests via HTTP headers" "checkbox"
And I press "Save changes"
And I click on "Edit" "link" in the "Custom service" "table_row"
And the field "Authenticate token requests via HTTP headers" matches value "1"
And I click on "Authenticate token requests via HTTP headers" "checkbox"
And I press "Save changes"
And I click on "Edit" "link" in the "Custom service" "table_row"
Then the field "Authenticate token requests via HTTP headers" matches value ""
@@ -573,7 +573,7 @@ class acceptances_table extends \table_sql {
if ($row->timemodified) {
if ($this->is_downloading()) {
// Use timestamp format readable for both machines and humans.
return date_format_string($row->timemodified, '%Y-%m-%d %H:%M:%S %Z');
return date_format_string((int) $row->timemodified, '%Y-%m-%d %H:%M:%S %Z');
} else {
// Use localised calendar format.
return userdate($row->timemodified, get_string('strftimedatetime'));
@@ -48,15 +48,18 @@ use tool_policy\policy_version;
*/
class page_viewalldoc implements renderable, templatable {
/** @var string Return url */
private $returnurl;
/** @var ?moodle_url Return url */
private $returnurl = null;
/**
* Prepare the page for rendering.
*
*/
public function __construct($returnurl) {
$this->returnurl = $returnurl;
if (!empty($returnurl)) {
$this->returnurl = new moodle_url($returnurl);
}
$this->prepare_global_page_access();
$this->prepare_policies();
}
@@ -48,11 +48,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And "Pending" "text" should exist in the "User Two" "table_row"
Scenario: Agree on behalf of another user as a manager, single policy, javascript off
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -73,11 +71,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Agree on behalf of another user as a manager, single policy, javascript on
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -135,13 +131,13 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And "Pending" "text" should exist in the "This privacy policy" "table_row"
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript off
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Continue"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -167,14 +163,14 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript on
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Activate"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -215,11 +211,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And I should not see "Policies and agreements"
Scenario: Policies and agreements profile link visible also for users who can access on behalf of others
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -231,19 +225,15 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
Then I should see "Policies and agreements"
Scenario: Agree on behalf of another user as an admin who is logged in as a manager
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I press "Next"
And I log out
And I log in as "admin"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "Manager"
And I am on the "manager" "user > profile" page logged in as "admin"
And I follow "Log in as"
And I press "Continue"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
@@ -263,14 +253,14 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Bulk agree on behalf of another users as a manager, multiple policies, javascript on
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Activate"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -462,7 +462,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I am on site homepage
And I change window size to "large"
And I follow "Log in"
When I press "Log in as a guest"
When I press "Access as a guest"
Then I should see "If you continue browsing this website, you agree to our policies"
# Confirm when navigating, the pop-up policies are displayed.
When I am on the "My courses" page
@@ -563,9 +563,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And the following "users" exist:
| username | firstname | lastname | email |
| user1 | User | 1 | user1@example.com |
When I log in as "admin"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
When I am on the "user1" "user > profile" page logged in as "admin"
And I follow "Log in as"
Then I should see "You are logged in as User 1"
And I press "Continue"
@@ -604,8 +602,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I set the field "I agree to the This site policy" to "1"
And I set the field "I agree to the This privacy policy" to "1"
And I press "Next"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
And I am on the "user1" "user > profile" page
And I follow "Log in as"
Then I should see "You are logged in as User 1"
And I press "Continue"
@@ -626,7 +623,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I am on site homepage
And I follow "Log in"
# First log in as a guest
And I press "Log in as a guest"
And I press "Access as a guest"
# Now sign up
And I follow "Log in"
When I click on "Create new account" "link"
@@ -133,6 +133,16 @@ class course_bin extends base_bin {
\backup::MODE_AUTOMATED,
$user->id
);
// When "backup_auto_activities" setting is disabled, activities can't be restored from recycle bin.
$plan = $controller->get_plan();
$activitiessettings = $plan->get_setting('activities');
$settingsvalue = $activitiessettings->get_value();
if (empty($settingsvalue)) {
$controller->destroy();
return;
}
$controller->execute_plan();
// We don't need the forced setting anymore, hence unsetting it.
@@ -54,10 +54,7 @@ Feature: Backup user data
And I navigate to "Recycle bin" in current page administration
And I should see "Quiz 1"
And I click on "Restore" "link" in the "region-main" "region"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I navigate to "User report" in the course gradebook
When I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then "Quiz 1" row "Grade" column of "user-grade" table should contain "50"
And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50"
@@ -242,6 +242,29 @@ class course_bin_test extends \advanced_testcase {
$this->assertEquals(true, $attemptobj->is_finished());
}
/**
* Test that the activity is NOT stored in bin when
* in Automated backup setup settings "backup_auto_activities" is disabled.
*
* @dataProvider recycle_bin_settings_provider
* @covers ::store_item
*/
public function test_coursemodule_restore_with_activity_setting_disabled() {
// Set the configuration to not include activities in the automated backup.
set_config('backup_auto_activities', false, 'backup');
// Delete the course module.
course_delete_module($this->quiz->cmid);
// Now, run the course module deletion adhoc task.
\phpunit_util::run_all_adhoc_tasks();
// Check there is no items in the recycle bin.
$recyclebin = new \tool_recyclebin\course_bin($this->course->id);
$this->assertEquals(0, count($recyclebin->get_items()));
}
/**
* Tests that user data is not restored when module is restored.
*
@@ -38,15 +38,6 @@ use core\check\result;
*/
class adhocqueue extends check {
/**
* Constructor
*/
public function __construct() {
global $CFG;
$this->id = 'adhocqueue';
$this->name = get_string('checkadhocqueue', 'tool_task');
}
/**
* Return result
* @return result
+7 -10
View File
@@ -38,17 +38,14 @@ use core\check\result;
class cronrunning extends check {
/**
* Constructor
* A link the running tasks report
*
* @return action_link|null
*/
public function __construct() {
global $CFG;
$this->id = 'cronrunning';
$this->name = get_string('checkcronrunning', 'tool_task');
if (empty($CFG->cronclionly)) {
$this->actionlink = new \action_link(
new \moodle_url('/admin/cron.php'),
get_string('cron', 'admin'));
}
public function get_action_link(): ?\action_link {
return new \action_link(
new \moodle_url('/admin/tool/task/runningtasks.php'),
get_string('runningtasks', 'tool_task'));
}
/**
@@ -39,15 +39,13 @@ use core\check\result;
class maxfaildelay extends check {
/**
* Constructor
* Links to the task log report
*
* @return \action_link|null
*/
public function __construct() {
global $CFG;
$this->id = 'cronfaildelay';
$this->name = get_string('checkmaxfaildelay', 'tool_task');
$this->actionlink = new \action_link(
new \moodle_url('/admin/tool/task/scheduledtasks.php'),
get_string('scheduledtasks', 'tool_task'));
public function get_action_link(): ?\action_link {
$url = new \moodle_url('/admin/tasklogs.php');
return new \action_link($url, get_string('tasklogs', 'tool_task'));
}
/**
+10
View File
@@ -37,3 +37,13 @@ function tool_task_status_checks() : array {
];
}
/**
* Function used to handle mtrace by outputting the text to normal browser window.
*
* @param string $message Message to output
* @param string $eol End of line character
*/
function tool_task_mtrace_wrapper(string $message, string $eol): void {
$message = s($message);
echo $message . $eol;
}
+1 -10
View File
@@ -30,16 +30,6 @@ require('../../../config.php');
require_once($CFG->libdir.'/cronlib.php');
/**
* Function used to handle mtrace by outputting the text to normal browser window.
*
* @param string $message Message to output
* @param string $eol End of line character
*/
function tool_task_mtrace_wrapper($message, $eol) {
echo s($message . $eol);
}
// Allow execution of single task. This requires login and has different rules.
$taskname = required_param('task', PARAM_RAW_TRIMMED);
@@ -97,6 +87,7 @@ require_sesskey();
// Prepare to handle output via mtrace.
echo html_writer::start_tag('pre');
require('lib.php');
$CFG->mtrace_wrapper = 'tool_task_mtrace_wrapper';
// Run the specified task (this will output an error if it doesn't exist).
+6 -3
View File
@@ -173,13 +173,16 @@ class tool_uploadcourse_tracker {
} else {
$outcome = $OUTPUT->pix_icon('i/invalid', '');
}
echo html_writer::start_tag('tr', array('class' => 'r' . $this->rownb % 2));
echo html_writer::tag('td', $line, array('class' => 'c' . $ci++));
echo html_writer::tag('td', $outcome, array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['id']) ? $data['id'] : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['shortname']) ? $data['shortname'] : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['fullname']) ? $data['fullname'] : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['idnumber']) ? $data['idnumber'] : '', array('class' => 'c' . $ci++));
// Ensure our data is suitable for HTML output.
echo html_writer::tag('td', isset($data['shortname']) ? s($data['shortname']) : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['fullname']) ? s($data['fullname']) : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['idnumber']) ? s($data['idnumber']) : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', $status, array('class' => 'c' . $ci++));
echo html_writer::end_tag('tr');
}
+4 -1
View File
@@ -111,7 +111,10 @@ class cli_helper {
$form = new \admin_uploaduser_form1();
[$elements, $defaults] = $form->get_form_for_cli();
$options += $this->prepare_form_elements_for_cli($elements, $defaults);
$form = new \admin_uploaduser_form2(null, ['columns' => ['type1'], 'data' => []]);
// Specify pseudo-column 'type1' to force the form to populate the legacy role mapping selector
// but only if user is allowed to assign roles in courses (otherwise form validation will fail).
$columns = uu_allowed_roles() ? ['type1'] : [];
$form = new \admin_uploaduser_form2(null, ['columns' => $columns, 'data' => []]);
[$elements, $defaults] = $form->get_form_for_cli();
$options += $this->prepare_form_elements_for_cli($elements, $defaults);
return $options;
+19 -8
View File
@@ -123,7 +123,6 @@ class process {
$today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0);
$this->today = $today;
$this->rolecache = uu_allowed_roles_cache(); // Course roles lookup cache.
$this->sysrolecache = uu_allowed_sysroles_cache(); // System roles lookup cache.
$this->supportedauths = uu_supported_auths(); // Officially supported plugins that are enabled.
@@ -1140,14 +1139,18 @@ class process {
}
}
if (!array_key_exists($courseid, $this->rolecache)) {
$this->rolecache[$courseid] = uu_allowed_roles_cache(null, (int)$courseid);
}
if ($courseid == SITEID) {
// Technically frontpage does not have enrolments, but only role assignments,
// let's not invent new lang strings here for this rarely used feature.
if (!empty($user->{'role'.$i})) {
$rolename = $user->{'role'.$i};
if (array_key_exists($rolename, $this->rolecache)) {
$roleid = $this->rolecache[$rolename]->id;
if (array_key_exists($rolename, $this->rolecache[$courseid]) ) {
$roleid = $this->rolecache[$courseid][$rolename]->id;
} else {
$this->upt->track('enrolments', get_string('unknownrole', 'error', s($rolename)), 'error');
continue;
@@ -1157,7 +1160,7 @@ class process {
$a = new \stdClass();
$a->course = $shortname;
$a->role = $this->rolecache[$roleid]->name;
$a->role = $this->rolecache[$courseid][$roleid]->name;
$this->upt->track('enrolments', get_string('enrolledincourserole', 'enrol_manual', $a), 'info');
}
@@ -1167,8 +1170,8 @@ class process {
$roleid = false;
if (!empty($user->{'role'.$i})) {
$rolename = $user->{'role'.$i};
if (array_key_exists($rolename, $this->rolecache)) {
$roleid = $this->rolecache[$rolename]->id;
if (array_key_exists($rolename, $this->rolecache[$courseid])) {
$roleid = $this->rolecache[$courseid][$rolename]->id;
} else {
$this->upt->track('enrolments', get_string('unknownrole', 'error', s($rolename)), 'error');
continue;
@@ -1187,7 +1190,15 @@ class process {
}
} else {
// No role specified, use the default from manual enrol plugin.
$roleid = $this->manualcache[$courseid]->roleid;
$defaultenrolroleid = (int)$this->manualcache[$courseid]->roleid;
// Validate the current user can assign this role.
if (array_key_exists($defaultenrolroleid, $this->rolecache[$courseid]) ) {
$roleid = $defaultenrolroleid;
} else {
$role = $DB->get_record('role', ['id' => $defaultenrolroleid]);
$this->upt->track('enrolments', get_string('unknownrole', 'error', s($role->shortname)), 'error');
continue;
}
}
if ($roleid) {
@@ -1230,7 +1241,7 @@ class process {
$a = new \stdClass();
$a->course = $shortname;
$a->role = $this->rolecache[$roleid]->name;
$a->role = $this->rolecache[$courseid][$roleid]->name;
$this->upt->track('enrolments', get_string('enrolledincourserole', 'enrol_manual', $a), 'info');
}
}
+19 -4
View File
@@ -369,17 +369,32 @@ function uu_allowed_roles() {
}
/**
* Returns mapping of all roles using short role name as index.
* Returns assignable roles for current user using short role name and role ID as index.
* This function is no longer called without parameters.
*
* @param int|null $categoryid Id of the category to get roles for.
* @param int|null $courseid Id of the course to get roles for.
* @return array
*/
function uu_allowed_roles_cache() {
$allowedroles = get_assignable_roles(context_course::instance(SITEID), ROLENAME_SHORT);
function uu_allowed_roles_cache(?int $categoryid = null, ?int $courseid = null): array {
if (!is_null($categoryid) && !is_null($courseid)) {
return [];
} else if (is_null($categoryid) && !is_null($courseid)) {
$allowedroles = get_assignable_roles(context_course::instance($courseid), ROLENAME_SHORT);
} else if (is_null($courseid) && !is_null($categoryid)) {
$allowedroles = get_assignable_roles(context_coursecat::instance($categoryid), ROLENAME_SHORT);
} else {
$allowedroles = get_assignable_roles(context_course::instance(SITEID), ROLENAME_SHORT);
}
$rolecache = [];
// A role can be searched for by its ID or by its shortname.
foreach ($allowedroles as $rid=>$rname) {
$rolecache[$rid] = new stdClass();
$rolecache[$rid]->id = $rid;
$rolecache[$rid]->name = $rname;
if (!is_numeric($rname)) { // only non-numeric shortnames are supported!!!
// Since numeric short names are allowed, to avoid replacement of another role, we only accept non-numeric values.
if (!is_numeric($rname)) {
$rolecache[$rname] = new stdClass();
$rolecache[$rname]->id = $rid;
$rolecache[$rname]->name = $rname;
@@ -125,12 +125,10 @@ Feature: Upload users
And I should see "Users created: 4"
And I press "Continue"
# Boost check.
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I click on ".icon[title=Edit]" "css_element" in the "jonest@example.com" "table_row"
And I am on the "jonest@example.com" "user > editing" page
And I should see "Boost"
# Classic check.
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I click on ".icon[title=Edit]" "css_element" in the "reznor@example.com" "table_row"
And I am on the "reznor@example.com" "user > editing" page
And I should see "Classic"
@javascript
+2 -1
View File
@@ -143,7 +143,8 @@ class cli_test extends \advanced_testcase {
// Created users have data in the profile fields.
$user1 = \core_user::get_user_by_username('reznort');
$profilefields1 = profile_user_record($user1->id);
$this->assertEquals((object)['superfield' => 'Loves cats'], $profilefields1);
$this->assertObjectHasAttribute('superfield', $profilefields1);
$this->assertEquals('Loves cats', $profilefields1->superfield);
}
/**
@@ -0,0 +1,221 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_uploaduser;
use advanced_testcase;
use context_system;
use context_course;
use context_coursecat;
use stdClass;
use tool_uploaduser\cli_helper;
use tool_uploaduser\local\text_progress_tracker;
/**
* Class upload_users_test
*
* @package tool_uploaduser
* @copyright 2020 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class upload_users_test extends advanced_testcase {
/**
* Load required test libraries
*/
public static function setUpBeforeClass(): void {
global $CFG;
require_once("{$CFG->dirroot}/{$CFG->admin}/tool/uploaduser/locallib.php");
}
/**
* Test upload users, enrol and role assignation
* @covers \tool_uploadusers::process
*/
public function test_user_can_upload_with_course_enrolment(): void {
$this->resetAfterTest();
set_config('passwordpolicy', 0);
$this->setAdminUser();
// Create category and course.
$coursecat = $this->getDataGenerator()->create_category();
$coursecatcontext = context_coursecat::instance($coursecat->id);
$course = $this->getDataGenerator()->create_course(['shortname' => 'course01', 'category' => $coursecat->id]);
$coursecontext = context_course::instance($course->id);
// Create user.
$user = $this->getDataGenerator()->create_user();
// Create role with capability to upload CSV files, and assign this role to user.
$uploadroleid = create_role('upload role', 'uploadrole', '');
set_role_contextlevels($uploadroleid, [CONTEXT_SYSTEM]);
$systemcontext = context_system::instance();
assign_capability('moodle/site:uploadusers', CAP_ALLOW, $uploadroleid, $systemcontext->id);
$this->getDataGenerator()->role_assign($uploadroleid, $user->id, $systemcontext->id);
// Create role with some of allowed capabilities to enrol users, and assign this role to user.
$enrolroleid = create_role('enrol role', 'enrolrole', '');
set_role_contextlevels($enrolroleid, [CONTEXT_COURSECAT]);
assign_capability('enrol/manual:enrol', CAP_ALLOW, $enrolroleid, $coursecatcontext->id);
assign_capability('moodle/course:enrolreview', CAP_ALLOW, $enrolroleid, $coursecatcontext->id);
assign_capability('moodle/role:assign', CAP_ALLOW, $enrolroleid, $coursecatcontext->id);
$this->getDataGenerator()->role_assign($enrolroleid, $user->id, $coursecatcontext->id);
// User makes assignments.
$studentarch = get_archetype_roles('student');
$studentrole = array_shift($studentarch);
core_role_set_assign_allowed($enrolroleid, $studentrole->id);
// Flush accesslib.
accesslib_clear_all_caches_for_unit_testing();
// Process CSV file as user.
$csv = <<<EOF
username,firstname,lastname,email,course1,role1
student1,Student,One,s1@example.com,{$course->shortname},{$studentrole->shortname}
student2,Student,Two,s2@example.com,{$course->shortname},teacher
EOF;
$this->setUser($user);
$output = $this->process_csv_upload($csv, ['--uutype=' . UU_USER_ADDNEW]);
$this->assertStringContainsString('Enrolled in "course01" as "student"', $output);
$this->assertStringContainsString('Unknown role "teacher"', $output);
// Check user creation, enrolment and role assignation.
$this->assertEquals(1, count_enrolled_users($coursecontext));
$usersasstudent = get_role_users($studentrole->id, $coursecontext);
$this->assertCount(1, $usersasstudent);
$this->assertEquals('student1', reset($usersasstudent)->username);
}
/**
* Test upload users, enrol and assign default role from manual enrol plugin.
* @covers \tool_uploadusers::process
*/
public function test_user_can_upload_with_course_enrolment_default_role(): void {
$this->resetAfterTest();
set_config('passwordpolicy', 0);
$this->setAdminUser();
// Create category and courses.
$coursecat = $this->getDataGenerator()->create_category();
$coursecatcontext = context_coursecat::instance($coursecat->id);
$course1 = $this->getDataGenerator()->create_course(['shortname' => 'course01', 'category' => $coursecat->id]);
$course1context = context_course::instance($course1->id);
// Change the default role to 'teacher'.
set_config('roleid', 4, 'enrol_manual');
$course2 = $this->getDataGenerator()->create_course(['shortname' => 'course02', 'category' => $coursecat->id]);
$course2context = context_course::instance($course2->id);
// Create user.
$user = $this->getDataGenerator()->create_user();
// Create role with capability to upload CSV files, and assign this role to user.
$uploadroleid = create_role('upload role', 'uploadrole', '');
set_role_contextlevels($uploadroleid, [CONTEXT_SYSTEM]);
$systemcontext = context_system::instance();
assign_capability('moodle/site:uploadusers', CAP_ALLOW, $uploadroleid, $systemcontext->id);
$this->getDataGenerator()->role_assign($uploadroleid, $user->id, $systemcontext->id);
// Create role with some of allowed capabilities to enrol users, and assign this role to user.
$enrolroleid = create_role('enrol role', 'enrolrole', '');
set_role_contextlevels($enrolroleid, [CONTEXT_COURSECAT]);
assign_capability('enrol/manual:enrol', CAP_ALLOW, $enrolroleid, $coursecatcontext->id);
assign_capability('moodle/course:enrolreview', CAP_ALLOW, $enrolroleid, $coursecatcontext->id);
assign_capability('moodle/role:assign', CAP_ALLOW, $enrolroleid, $coursecatcontext->id);
$this->getDataGenerator()->role_assign($enrolroleid, $user->id, $coursecatcontext->id);
// User makes assignments.
$studentarch = get_archetype_roles('student');
$studentrole = array_shift($studentarch);
core_role_set_assign_allowed($enrolroleid, $studentrole->id);
// Flush accesslib.
accesslib_clear_all_caches_for_unit_testing();
// Process CSV file (no roles specified) as user.
$csv = <<<EOF
username,firstname,lastname,email,course1,role1
student1,Student,One,s1@example.com,{$course1->shortname},
student2,Student,Two,s2@example.com,{$course2->shortname},
EOF;
$this->setUser($user);
$output = $this->process_csv_upload($csv, ['--uutype=' . UU_USER_ADDNEW]);
$this->assertStringContainsString('Enrolled in "course01" as "student"', $output);
// This $user cannot assign teacher role.
$this->assertStringContainsString('Unknown role "teacher"', $output);
// Check user creation, enrolment and role assignation.
$this->assertEquals(1, count_enrolled_users($course1context));
// This $user cannot enrol anyone as teacher.
$this->assertEquals(0, count_enrolled_users($course2context));
// Test user is enrolled as default-manual-enrol-plugin role.
$manualenrolinstance = new stdClass;
$enrolinstances = enrol_get_instances($course1->id, true);
foreach ($enrolinstances as $courseenrolinstance) {
if ($courseenrolinstance->enrol === 'manual') {
$manualenrolinstance = $courseenrolinstance;
break;
}
}
$defaulroleidexpected = $manualenrolinstance->roleid ?? 0;
// The default role of course01 is student, id 5.
$this->assertEquals(5, $defaulroleidexpected);
$usersasdefaultrole = get_role_users($defaulroleidexpected, $course1context);
$this->assertCount(1, $usersasdefaultrole);
$this->assertEquals('student1', reset($usersasdefaultrole)->username);
}
/**
* Generate cli_helper and mock $_SERVER['argv']
*
* @param string $filecontent
* @param array $mockargv
* @return string
*/
protected function process_csv_upload(string $filecontent, array $mockargv = []): string {
$filepath = make_request_directory() . '/upload.csv';
file_put_contents($filepath, $filecontent);
$mockargv[] = "--file={$filepath}";
if (array_key_exists('argv', $_SERVER)) {
$oldservervars = $_SERVER['argv'];
}
$_SERVER['argv'] = array_merge([''], $mockargv);
$clihelper = new cli_helper(text_progress_tracker::class);
if (isset($oldservervars)) {
$_SERVER['argv'] = $oldservervars;
} else {
unset($_SERVER['argv']);
}
ob_start();
$clihelper->process();
$output = ob_get_contents();
ob_end_clean();
return $output;
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+23 -1
View File
@@ -14,6 +14,8 @@ import {eventTypes} from './events';
let currentTour = null;
let tourId = null;
let restartTourAndKeepProgress = false;
let currentStepNo = null;
/**
* Find the first matching tour.
@@ -75,6 +77,20 @@ export const init = async(tourDetails, filters) => {
resetTourState(tourId);
}
});
// Watch for the resize event.
window.addEventListener("resize", () => {
// Only listen for the running tour.
if (currentTour && currentTour.tourRunning) {
clearTimeout(window.resizedFinished);
window.resizedFinished = setTimeout(() => {
// Wait until the resize event has finished.
currentStepNo = currentTour.getCurrentStepNumber();
restartTourAndKeepProgress = true;
resetTourState(tourId);
}, 250);
}
});
};
/**
@@ -187,7 +203,13 @@ const startBootstrapTour = (tourId, template, tourConfig) => {
});
currentTour = new BootstrapTour(tourConfig);
return currentTour.startTour();
let startAt = 0;
if (restartTourAndKeepProgress && currentStepNo) {
startAt = currentStepNo;
restartTourAndKeepProgress = false;
currentStepNo = null;
}
return currentTour.startTour(startAt);
};
/**
@@ -152,18 +152,11 @@ Feature: Apply tour filters to a tour
| fullname | shortname | format | enablecompletion |
| Course 1 | C1 | topics | 1 |
| Course 2 | C2 | topics | 1 |
And the following "activities" exist:
| activity | course | name | firstpagetitle | wikimode | idnumber | intro | type |
| wiki | C1 | Test wiki name | First page | collaborative | | | |
| forum | C2 | Test forum name | | | 001 | Test forum description | general |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Wiki" to section "1" and I fill the form with:
| Wiki name | Test wiki name |
| Description | Test wiki description |
| First page name | First page |
| Wiki mode | Collaborative wiki |
And I am on "Course 2" course homepage
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
And I add a new user tour with:
| Name | Wiki tour |
| Description | A tour with both matches |
+55 -16
View File
@@ -29,6 +29,7 @@ require_once(__DIR__ . '/fixtures/test_target_course_level_shortname.php');
* @package core_analytics
* @copyright 2017 David Monllaó {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \core_analytics\manager
*/
class manager_test extends \advanced_testcase {
@@ -491,25 +492,63 @@ class manager_test extends \advanced_testcase {
// No potential context restrictions.
$this->assertFalse(\core_analytics\manager::get_potential_context_restrictions([]));
$defaultcategory = \core_course_category::get_default();
$defaultcategorycontext = $defaultcategory->get_context();
// Include the all context levels so the misc. category get included.
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions());
$this->assertEquals([
$defaultcategorycontext->id => "Category: {$defaultcategory->name}",
], manager::get_potential_context_restrictions());
$this->getDataGenerator()->create_course();
$this->getDataGenerator()->create_category();
$this->assertCount(3, \core_analytics\manager::get_potential_context_restrictions());
$this->assertCount(3, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSE, CONTEXT_COURSECAT]));
$category = $this->getDataGenerator()->create_category(['name' => 'My category']);
$categorycontext = $category->get_context();
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSE]));
$this->assertCount(2, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSECAT]));
$courseone = $this->getDataGenerator()->create_course(['fullname' => 'Course one', 'shortname' => 'CS1']);
$courseonecontext = \context_course::instance($courseone->id);
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSECAT], 'Course category'));
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSECAT], 'Course category 1'));
$this->assertCount(
2,
\core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSECAT],
get_string('defaultcategoryname')
));
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSE], 'Test course 1'));
$this->assertCount(1, \core_analytics\manager::get_potential_context_restrictions([CONTEXT_COURSE], 'Test course'));
$coursetwo = $this->getDataGenerator()->create_course(['fullname' => 'Course two', 'shortname' => 'CS2']);
$coursetwocontext = \context_course::instance($coursetwo->id);
// All context levels.
$this->assertEqualsCanonicalizing([
$defaultcategorycontext->id => "Category: {$defaultcategory->name}",
$categorycontext->id => "Category: {$category->name}",
$courseonecontext->id => "Course: {$courseone->shortname}",
$coursetwocontext->id => "Course: {$coursetwo->shortname}",
], manager::get_potential_context_restrictions());
// All category/course context levels.
$this->assertEqualsCanonicalizing([
$defaultcategorycontext->id => "Category: {$defaultcategory->name}",
$categorycontext->id => "Category: {$category->name}",
$courseonecontext->id => "Course: {$courseone->shortname}",
$coursetwocontext->id => "Course: {$coursetwo->shortname}",
], manager::get_potential_context_restrictions([CONTEXT_COURSECAT, CONTEXT_COURSE]));
// All category context levels.
$this->assertEqualsCanonicalizing([
$defaultcategorycontext->id => "Category: {$defaultcategory->name}",
$categorycontext->id => "Category: {$category->name}",
], manager::get_potential_context_restrictions([CONTEXT_COURSECAT]));
// Filtered category context levels.
$this->assertEquals([
$categorycontext->id => "Category: {$category->name}",
], manager::get_potential_context_restrictions([CONTEXT_COURSECAT], 'My cat'));
$this->assertEmpty(manager::get_potential_context_restrictions([CONTEXT_COURSECAT], 'nothing'));
// All course context levels.
$this->assertEqualsCanonicalizing([
$courseonecontext->id => "Course: {$courseone->shortname}",
$coursetwocontext->id => "Course: {$coursetwo->shortname}",
], manager::get_potential_context_restrictions([CONTEXT_COURSE]));
// Filtered course context levels.
$this->assertEquals([
$courseonecontext->id => "Course: {$courseone->shortname}",
], manager::get_potential_context_restrictions([CONTEXT_COURSE], 'one'));
$this->assertEmpty(manager::get_potential_context_restrictions([CONTEXT_COURSE], 'nothing'));
}
}
+7 -5
View File
@@ -1,18 +1,20 @@
Description of phpCAS 1.4.0 import into Moodle
Description of phpCAS import into Moodle
Last release package can be found in hhttps://github.com/apereo/phpCAS/releases
Last release can be found at https://github.com/apereo/phpCAS/releases
NOTICE:
* Before running composer command, make sure you have the composer version updated.
* Composer version 2.2.4 2022-01-08 12:30:42
STEPS:
* Create a temporary folder outside your moodle installation
* Execute `composer require apereo/phpcas:VERSION`
* Make sure you're using the lowest supported PHP version for the given release (e.g. PHP 7.4 for Moodle 4.1)
* Create a temporary folder outside your Moodle installation
* Execute 'composer require apereo/phpcas:VERSION'
* Check any new libraries that have been added and make sure they do not exist in Moodle already.
* Remove the old 'vendor' directory in auth/cas/CAS/
* Copy contents of 'vendor' directory
* Create a commit with only the library changes
* Create a commit with only the library changes.
- Note: Make sure to check the list of unversioned files and add any new files to the staging area.
* Update auth/cas/thirdpartylibs.xml
* Apply the modifications described in the CHANGES section
* Create another commit with the previous two steps of changes
+1 -1
View File
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS.php
* @category Authentication
+1 -1
View File
@@ -13,7 +13,7 @@ Api documentation can be found here:
https://apereo.github.io/phpCAS/api/
[![Build Status](https://travis-ci.org/apereo/phpCAS.png)](https://travis-ci.org/apereo/phpCAS)
[![Test](https://github.com/apereo/phpCAS/actions/workflows/test.yml/badge.svg)](https://github.com/apereo/phpCAS/actions/workflows/test.yml)
LICENSE
-------
+11 -7
View File
@@ -22,13 +22,15 @@
}
],
"require" : {
"php" : ">=7.0.0",
"php" : ">=7.1.0",
"ext-curl" : "*",
"psr/log" : "^1.0.0"
},
"ext-dom" : "*",
"psr/log" : "^1.0 || ^2.0 || ^3.0"
},
"require-dev" : {
"monolog/monolog" : "^1.0.0",
"phpunit/phpunit" : ">=4.8.35 <8"
"monolog/monolog" : "^1.0.0 || ^2.0.0",
"phpunit/phpunit" : ">=7.5",
"phpstan/phpstan" : "^1.5"
},
"autoload" : {
"classmap" : [
@@ -36,16 +38,18 @@
]
},
"autoload-dev" : {
"files": ["source/CAS.php"],
"psr-4" : {
"PhpCas\\" : "test/CAS/"
}
},
"scripts" : {
"test" : "phpunit"
"test" : "phpunit",
"phpstan" : "phpstan"
},
"extra" : {
"branch-alias" : {
"dev-master" : "1.3.x-dev"
}
}
}
}
+11 -19
View File
@@ -1,21 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="source/CAS.php"
convertNoticesToExceptions="false"
colors="true"
stderr="true"
backupGlobals="true"
>
<testsuites>
<testsuite name="phpCAS Tests">
<directory>test/CAS/Tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="false">
<directory>source/</directory>
</whitelist>
</filter>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="source/CAS.php" convertNoticesToExceptions="false" colors="true" stderr="true" backupGlobals="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="false">
<include>
<directory>source/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="phpCAS Tests">
<directory>test/CAS/Tests/</directory>
</testsuite>
</testsuites>
</phpunit>
+24 -13
View File
@@ -20,7 +20,7 @@
*
*
* Interface class of the phpCAS library
* PHP Version 5
* PHP Version 7
*
* @file CAS/CAS.php
* @category Authentication
@@ -57,7 +57,7 @@ if (!isset($_SERVER['REQUEST_URI']) && isset($_SERVER['SCRIPT_NAME']) && isset($
/**
* phpCAS version. accessible for the user by phpCAS::getVersion().
*/
define('PHPCAS_VERSION', '1.4.0');
define('PHPCAS_VERSION', '1.6.0');
/**
* @addtogroup public
@@ -136,11 +136,6 @@ define("SAML_SOAP_ENV_CLOSE", '</SOAP-ENV:Envelope>');
*/
define("SAML_ATTRIBUTES", 'SAMLATTRIBS');
/**
* SAML Attributes
*/
define("DEFAULT_ERROR", 'Internal script failure');
/** @} */
/**
* @addtogroup publicPGTStorage
@@ -332,6 +327,14 @@ class phpCAS
* @param string $server_hostname the hostname of the CAS server
* @param int $server_port the port the CAS server is running on
* @param string $server_uri the URI the CAS server is responding on
* @param string|string[]|CAS_ServiceBaseUrl_Interface
* $service_base_url the base URL (protocol, host and the
* optional port) of the CAS client; pass
* in an array to use auto discovery with
* an allowlist; pass in
* CAS_ServiceBaseUrl_Interface for custom
* behavior. Added in 1.6.0. Similar to
* serverName config in other CAS clients.
* @param bool $changeSessionID Allow phpCAS to change the session_id
* (Single Sign Out/handleLogoutRequests
* is based on that change)
@@ -343,7 +346,8 @@ class phpCAS
* and phpCAS::setDebug()).
*/
public static function client($server_version, $server_hostname,
$server_port, $server_uri, $changeSessionID = true, \SessionHandlerInterface $sessionHandler = null
$server_port, $server_uri, $service_base_url,
$changeSessionID = true, \SessionHandlerInterface $sessionHandler = null
) {
phpCAS :: traceBegin();
if (is_object(self::$_PHPCAS_CLIENT)) {
@@ -362,7 +366,7 @@ class phpCAS
// initialize the object $_PHPCAS_CLIENT
try {
self::$_PHPCAS_CLIENT = new CAS_Client(
$server_version, false, $server_hostname, $server_port, $server_uri,
$server_version, false, $server_hostname, $server_port, $server_uri, $service_base_url,
$changeSessionID, $sessionHandler
);
} catch (Exception $e) {
@@ -378,6 +382,14 @@ class phpCAS
* @param string $server_hostname the hostname of the CAS server
* @param string $server_port the port the CAS server is running on
* @param string $server_uri the URI the CAS server is responding on
* @param string|string[]|CAS_ServiceBaseUrl_Interface
* $service_base_url the base URL (protocol, host and the
* optional port) of the CAS client; pass
* in an array to use auto discovery with
* an allowlist; pass in
* CAS_ServiceBaseUrl_Interface for custom
* behavior. Added in 1.6.0. Similar to
* serverName config in other CAS clients.
* @param bool $changeSessionID Allow phpCAS to change the session_id
* (Single Sign Out/handleLogoutRequests
* is based on that change)
@@ -389,7 +401,8 @@ class phpCAS
* and phpCAS::setDebug()).
*/
public static function proxy($server_version, $server_hostname,
$server_port, $server_uri, $changeSessionID = true, \SessionHandlerInterface $sessionHandler = null
$server_port, $server_uri, $service_base_url,
$changeSessionID = true, \SessionHandlerInterface $sessionHandler = null
) {
phpCAS :: traceBegin();
if (is_object(self::$_PHPCAS_CLIENT)) {
@@ -408,7 +421,7 @@ class phpCAS
// initialize the object $_PHPCAS_CLIENT
try {
self::$_PHPCAS_CLIENT = new CAS_Client(
$server_version, true, $server_hostname, $server_port, $server_uri,
$server_version, true, $server_hostname, $server_port, $server_uri, $service_base_url,
$changeSessionID, $sessionHandler
);
} catch (Exception $e) {
@@ -597,8 +610,6 @@ class phpCAS
}
if (self::$_PHPCAS_VERBOSE) {
echo "<br />\n<b>phpCAS error</b>: <font color=\"FF0000\"><b>" . __CLASS__ . "::" . $function . '(): ' . htmlentities($msg) . "</b></font> in <b>" . $file . "</b> on line <b>" . $line . "</b><br />\n";
} else {
echo "<br />\n<b>Error</b>: <font color=\"FF0000\"><b>". DEFAULT_ERROR ."</b><br />\n";
}
phpCAS :: trace($msg . ' in ' . $file . 'on line ' . $line );
phpCAS :: traceEnd();
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/AuthenticationException.php
* @category Authentication
@@ -72,11 +72,15 @@ implements CAS_Exception
phpCAS::traceBegin();
$lang = $client->getLangObj();
$client->printHTMLHeader($lang->getAuthenticationFailed());
printf(
$lang->getYouWereNotAuthenticated(),
htmlentities($client->getURL()),
isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN']:''
);
if (phpCAS::getVerbose()) {
printf(
$lang->getYouWereNotAuthenticated(),
htmlentities($client->getURL()),
$_SERVER['SERVER_ADMIN'] ?? ''
);
}
phpCAS::trace($messages[] = 'CAS URL: '.$cas_url);
phpCAS::trace($messages[] = 'Authentication failure: '.$failure);
if ( $no_response ) {
+4 -4
View File
@@ -3,7 +3,7 @@
/**
* Autoloader Class
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Autoload.php
* @category Authentication
@@ -68,12 +68,12 @@ function CAS_autoload($class)
);
$trace = $e->getTrace();
if (isset($trace[2]) && isset($trace[2]['function'])
&& in_array($trace[2]['function'], array('class_exists', 'interface_exists'))
&& in_array($trace[2]['function'], array('class_exists', 'interface_exists', 'trait_exists'))
) {
return false;
}
if (isset($trace[1]) && isset($trace[1]['function'])
&& in_array($trace[1]['function'], array('class_exists', 'interface_exists'))
&& in_array($trace[1]['function'], array('class_exists', 'interface_exists', 'trait_exists'))
) {
return false;
}
@@ -92,4 +92,4 @@ if (!class_exists('CAS_Client'))
// it to the autoload stack
spl_autoload_register('__autoload');
}
}
}
+102 -69
View File
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Client.php
* @category Authentication
@@ -102,6 +102,10 @@ class CAS_Client
*/
public function printHTMLHeader($title)
{
if (!phpCAS::getVerbose()) {
return;
}
$this->_htmlFilterOutput(
str_replace(
'__TITLE__', $title,
@@ -130,16 +134,17 @@ class CAS_Client
*/
public function printHTMLFooter()
{
if (!phpCAS::getVerbose()) {
return;
}
$lang = $this->getLangObj();
$this->_htmlFilterOutput(
empty($this->_output_footer)?
(phpCAS::getVerbose())?
'<hr><address>phpCAS __PHPCAS_VERSION__ '
.$lang->getUsingServer()
.' <a href="__SERVER_BASE_URL__">__SERVER_BASE_URL__</a> (CAS __CAS_VERSION__)</a></address></body></html>'
:'</body></html>'
:$this->_output_footer
);
$message = empty($this->_output_footer)
? '<hr><address>phpCAS __PHPCAS_VERSION__ ' . $lang->getUsingServer() .
' <a href="__SERVER_BASE_URL__">__SERVER_BASE_URL__</a> (CAS __CAS_VERSION__)</a></address></body></html>'
: $this->_output_footer;
$this->_htmlFilterOutput($message);
}
/**
@@ -174,6 +179,21 @@ class CAS_Client
$this->_output_footer = $footer;
}
/**
* Simple wrapper for printf function, that respects
* phpCAS verbosity setting.
*
* @param string $format
* @param string|int|float ...$values
*
* @see printf()
*/
private function printf(string $format, ...$values): void
{
if (phpCAS::getVerbose()) {
printf($format, ...$values);
}
}
/** @} */
@@ -898,6 +918,14 @@ class CAS_Client
* @param bool $changeSessionID Allow phpCAS to change the session_id
* (Single Sign Out/handleLogoutRequests
* is based on that change)
* @param string|string[]|CAS_ServiceBaseUrl_Interface
* $service_base_url the base URL (protocol, host and the
* optional port) of the CAS client; pass
* in an array to use auto discovery with
* an allowlist; pass in
* CAS_ServiceBaseUrl_Interface for custom
* behavior. Added in 1.6.0. Similar to
* serverName config in other CAS clients.
* @param \SessionHandlerInterface $sessionHandler the session handler
*
* @return self a newly created CAS_Client object
@@ -908,6 +936,7 @@ class CAS_Client
$server_hostname,
$server_port,
$server_uri,
$service_base_url,
$changeSessionID = true,
\SessionHandlerInterface $sessionHandler = null
) {
@@ -925,6 +954,8 @@ class CAS_Client
if (gettype($changeSessionID) != 'boolean')
throw new CAS_TypeMismatchException($changeSessionID, '$changeSessionID', 'boolean');
$this->_setServiceBaseUrl($service_base_url);
if (empty($sessionHandler)) {
$sessionHandler = new CAS_Session_PhpSession;
}
@@ -1029,7 +1060,7 @@ class CAS_Client
if ( $this->_isCallbackMode() ) {
//callback mode: check that phpCAS is secured
if ( !$this->_isHttps() ) {
if ( !$this->getServiceBaseUrl()->isHttps() ) {
phpCAS::error(
'CAS proxies must be secured to use phpCAS; PGT\'s will not be received from the CAS server'
);
@@ -1037,7 +1068,7 @@ class CAS_Client
} else {
//normal mode: get ticket and remove it from CGI parameters for
// developers
$ticket = (isset($_GET['ticket']) ? $_GET['ticket'] : null);
$ticket = (isset($_GET['ticket']) ? $_GET['ticket'] : '');
if (preg_match('/^[SP]T-/', $ticket) ) {
phpCAS::trace('Ticket \''.$ticket.'\' found');
$this->setTicket($ticket);
@@ -1553,7 +1584,7 @@ class CAS_Client
{
phpCAS::traceBegin();
$res = false;
$validate_url = '';
if ( $this->_wasPreviouslyAuthenticated() ) {
if ($this->hasTicket()) {
// User has a additional ticket but was already authenticated
@@ -1587,6 +1618,10 @@ class CAS_Client
$this->markAuthenticationCall($res);
} else {
if ($this->hasTicket()) {
$validate_url = '';
$text_response = '';
$tree_response = '';
switch ($this->getServerVersion()) {
case CAS_VERSION_1_0:
// if a Service Ticket was given, validate it
@@ -1650,7 +1685,7 @@ class CAS_Client
$logoutTicket = $this->getTicket();
break;
default:
phpCAS::trace('Protocoll error');
phpCAS::trace('Protocol error');
break;
}
} else {
@@ -1827,7 +1862,7 @@ class CAS_Client
phpCAS::trace("Redirect to : ".$cas_url);
$lang = $this->getLangObj();
$this->printHTMLHeader($lang->getAuthenticationWanted());
printf('<p>'. $lang->getShouldHaveBeenRedirected(). '</p>', $cas_url);
$this->printf('<p>'. $lang->getShouldHaveBeenRedirected(). '</p>', $cas_url);
$this->printHTMLFooter();
phpCAS::traceExit();
throw new CAS_GracefullTerminationException();
@@ -1870,7 +1905,7 @@ class CAS_Client
}
$lang = $this->getLangObj();
$this->printHTMLHeader($lang->getLogout());
printf('<p>'.$lang->getShouldHaveBeenRedirected(). '</p>', $cas_url);
$this->printf('<p>'.$lang->getShouldHaveBeenRedirected(). '</p>', $cas_url);
$this->printHTMLFooter();
phpCAS::traceExit();
throw new CAS_GracefullTerminationException();
@@ -2159,6 +2194,8 @@ class CAS_Client
$validate_url .= '&renew=true';
}
$headers = '';
$err_msg = '';
// open and read the URL
if ( !$this->_readURL($validate_url, $headers, $text_response, $err_msg) ) {
phpCAS::trace(
@@ -2235,6 +2272,8 @@ class CAS_Client
$validate_url .= '&renew=true';
}
$headers = '';
$err_msg = '';
// open and read the URL
if ( !$this->_readURL($validate_url, $headers, $text_response, $err_msg) ) {
phpCAS::trace(
@@ -2550,8 +2589,7 @@ class CAS_Client
// the URL is built when needed only
if ( empty($this->_callback_url) ) {
// remove the ticket if present in the URL
$final_uri = 'https://';
$final_uri .= $this->_getClientUrl();
$final_uri = $this->getServiceBaseUrl()->get();
$request_uri = $_SERVER['REQUEST_URI'];
$request_uri = preg_replace('/\?.*$/', '', $request_uri);
$final_uri .= $request_uri;
@@ -2892,6 +2930,8 @@ class CAS_Client
$cas_url = $this->getServerProxyURL().'?targetService='
.urlencode($target_service).'&pgt='.$this->_getPGT();
$headers = '';
$cas_response = '';
// open and read the URL
if ( !$this->_readURL($cas_url, $headers, $cas_response, $err_msg) ) {
phpCAS::trace(
@@ -3917,10 +3957,7 @@ class CAS_Client
// the URL is built when needed only
if ( empty($this->_url) ) {
// remove the ticket if present in the URL
$final_uri = ($this->_isHttps()) ? 'https' : 'http';
$final_uri .= '://';
$final_uri .= $this->_getClientUrl();
$final_uri = $this->getServiceBaseUrl()->get();
$request_uri = explode('?', $_SERVER['REQUEST_URI'], 2);
$final_uri .= $request_uri[0];
@@ -3957,65 +3994,61 @@ class CAS_Client
return $this->_server['base_url'] = $url;
}
/**
* The ServiceBaseUrl object that provides base URL during service URL
* discovery process.
*
* @var CAS_ServiceBaseUrl_Interface
*
* @hideinitializer
*/
private $_serviceBaseUrl = null;
/**
* Try to figure out the phpCAS client URL with possible Proxys / Ports etc.
* Answer the CAS_ServiceBaseUrl_Interface object for this client.
*
* @return string Server URL with domain:port
* @return CAS_ServiceBaseUrl_Interface
*/
private function _getClientUrl()
public function getServiceBaseUrl()
{
if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
// explode the host list separated by comma and use the first host
$hosts = explode(',', $_SERVER['HTTP_X_FORWARDED_HOST']);
// see rfc7239#5.3 and rfc7230#2.7.1: port is in HTTP_X_FORWARDED_HOST if non default
return $hosts[0];
} else if (!empty($_SERVER['HTTP_X_FORWARDED_SERVER'])) {
$server_url = $_SERVER['HTTP_X_FORWARDED_SERVER'];
} else {
if (empty($_SERVER['SERVER_NAME'])) {
$server_url = $_SERVER['HTTP_HOST'];
} else {
$server_url = $_SERVER['SERVER_NAME'];
}
if (empty($this->_serviceBaseUrl)) {
phpCAS::error("ServiceBaseUrl object is not initialized");
}
if (!strpos($server_url, ':')) {
if (empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {
$server_port = $_SERVER['SERVER_PORT'];
} else {
$ports = explode(',', $_SERVER['HTTP_X_FORWARDED_PORT']);
$server_port = $ports[0];
}
if ( ($this->_isHttps() && $server_port!=443)
|| (!$this->_isHttps() && $server_port!=80)
) {
$server_url .= ':';
$server_url .= $server_port;
}
}
return $server_url;
return $this->_serviceBaseUrl;
}
/**
* This method checks to see if the request is secured via HTTPS
* This method sets the service base URL used during service URL discovery process.
*
* @return bool true if https, false otherwise
* This is required since phpCAS 1.6.0 to protect the integrity of the authentication.
*
* @since phpCAS 1.6.0
*
* @param $name can be any of the following:
* - A base URL string. The service URL discovery will always use this (protocol,
* hostname and optional port number) without using any external host names.
* - An array of base URL strings. The service URL discovery will check against
* this list before using the auto discovered base URL. If there is no match,
* the first base URL in the array will be used as the default. This option is
* helpful if your PHP website is accessible through multiple domains without a
* canonical name, or through both HTTP and HTTPS.
* - A class that implements CAS_ServiceBaseUrl_Interface. If you need to customize
* the base URL discovery behavior, you can pass in a class that implements the
* interface.
*
* @return void
*/
private function _isHttps()
private function _setServiceBaseUrl($name)
{
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
return ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https');
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTOCOL'])) {
return ($_SERVER['HTTP_X_FORWARDED_PROTOCOL'] === 'https');
} elseif ( isset($_SERVER['HTTPS'])
&& !empty($_SERVER['HTTPS'])
&& strcasecmp($_SERVER['HTTPS'], 'off') !== 0
) {
return true;
if (is_array($name)) {
$this->_serviceBaseUrl = new CAS_ServiceBaseUrl_AllowedListDiscovery($name);
} else if (is_string($name)) {
$this->_serviceBaseUrl = new CAS_ServiceBaseUrl_Static($name);
} else if ($name instanceof CAS_ServiceBaseUrl_Interface) {
$this->_serviceBaseUrl = $name;
} else {
throw new CAS_TypeMismatchException($name, '$name', 'array, string, or CAS_ServiceBaseUrl_Interface object');
}
return false;
}
/**
@@ -4147,7 +4180,7 @@ class CAS_Client
phpCAS::traceBegin();
$lang = $this->getLangObj();
$this->printHTMLHeader($lang->getAuthenticationFailed());
printf(
$this->printf(
$lang->getYouWereNotAuthenticated(), htmlentities($this->getURL()),
isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN']:''
);
+1 -1
View File
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/CookieJar.php
* @category Authentication
+2 -2
View File
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Exception.php
* @category Authentication
@@ -56,4 +56,4 @@ interface CAS_Exception
{
}
?>
?>

Some files were not shown because too many files have changed in this diff Show More