Compare commits

...

1100 Commits

Author SHA1 Message Date
Jun Pataleta 9d8ec047be Moodle release 3.11.14 2023-04-22 16:22:30 +08:00
Eloy Lafuente (stronk7) 731ff89794 weekly release 3.11.13+ 2023-04-21 19:19:29 +02:00
Eloy Lafuente (stronk7) a9ca81e8c9 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-04-21 19:19:24 +02:00
Jun Pataleta d3f5a3c2cc Merge branch 'MDL-77927-311' of https://github.com/stevandoMoodle/moodle into MOODLE_311_STABLE 2023-04-21 16:51:20 +08:00
Jun Pataleta 5f8d85fe23 MDL-77927 core: mod_assignment subplugins environment check 2023-04-21 15:57:36 +08:00
AMOS bot 4f793fe59a Automatically generated installer lang files 2023-04-21 00:07:34 +00:00
Paul Holden 3fd0b34805 MDL-77187 mod_wiki: validate external method sort parameters. 2023-04-19 12:54:30 +00:00
Paul Holden eeae907302 Merge branch 'MDL-77960-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-04-19 13:41:35 +01:00
Paul Holden 767104a1ff Merge branch 'MDL-77944-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-04-19 13:06:43 +01:00
Simey Lameze 9e0e54e3c0 MDL-77960 behat: make verification steps more specific 2023-04-19 13:33:49 +08:00
Andrew Nicols 8eaed7a7eb weekly release 3.11.13+ 2023-04-18 22:28:21 +08:00
Andrew Nicols a3e3a3f251 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-04-18 22:28:18 +08:00
Andrew Nicols 1b0c425ade Merge branch 'MDL-77829-311' of https://github.com/stevandoMoodle/moodle into MOODLE_311_STABLE 2023-04-18 12:34:17 +08:00
Andrew Nicols 93bfa46f5e 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:24 +08:00
AMOS bot f4e40a3eb8 Automatically generated installer lang files 2023-04-18 00:07:31 +00:00
Sara Arjona b379d31219 weekly release 3.11.13+ 2023-04-14 10:50:19 +02:00
Sara Arjona 05ab49e052 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-04-14 10:50:16 +02:00
AMOS bot 81c5a10527 Automatically generated installer lang files 2023-04-14 00:07:37 +00:00
Sara Arjona ddfd85697f Merge branch 'MDL-73610_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2023-04-12 18:20:03 +02:00
Sara Arjona e2c90dd430 Merge branch 'MDL-77837-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-04-11 12:13:27 +02:00
Stevani Andolo 83aa818f08 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:55 +08:00
AMOS bot 9ece6979c1 Automatically generated installer lang files 2023-04-07 00:07:26 +00:00
Andrew Nicols 5e6ae141ce MDL-77837 core: Improve usage docs for cron_setup_user 2023-04-06 23:21:29 +08:00
Andrew Nicols eaa34a048b 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 5837ade0ea 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) cddda7483d 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 15:00:03 +02:00
Sara Arjona ca59050173 weekly release 3.11.13+ 2023-04-06 14:02:34 +02:00
Sara Arjona 3334ab4821 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-04-06 14:02:29 +02:00
AMOS bot b409a71f4f Automatically generated installer lang files 2023-04-06 00:07:31 +00:00
AMOS bot 49d7941d81 Automatically generated installer lang files 2023-04-05 00:07:34 +00:00
Andrew Nicols c211a5854f Merge branch 'MDL-77584-311' of https://github.com/ewallah/moodle into MOODLE_311_STABLE 2023-04-04 12:08:01 +08:00
AMOS bot cf7c308bcf Automatically generated installer lang files 2023-04-04 00:07:35 +00:00
Paul Holden abc9f31fa3 Merge branch 'MDL-75906-311' of https://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2023-04-03 14:54:06 +01:00
Michael Hawkins 3178ffa04a MDL-75906 core: Updated security.txt expiry 2023-04-03 17:27:56 +08:00
AMOS bot 513bf77347 Automatically generated installer lang files 2023-04-02 00:07:30 +00:00
AMOS bot 48f24504ca Automatically generated installer lang files 2023-04-01 00:07:38 +00:00
Paul Holden e4918f1e1d weekly release 3.11.13+ 2023-03-31 18:12:01 +01:00
Paul Holden 516d111d94 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-03-31 18:11:59 +01:00
AMOS bot fa348c3a04 Automatically generated installer lang files 2023-03-31 00:07:34 +00:00
Sara Arjona 11b53571e6 Merge branch 'MDL-77761-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2023-03-30 17:53:32 +02:00
Jun Pataleta d1fd4c2660 Merge branch 'MDL-77333_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2023-03-30 19:03:26 +08:00
AMOS bot 9bd8cdae36 Automatically generated installer lang files 2023-03-30 00:07:37 +00:00
Jun Pataleta 54ed5324ac MDL-77761 core_form: Add label for editor format selector 2023-03-28 23:34:02 +08:00
Eloy Lafuente (stronk7) f1095d111e 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-26 11:44:16 +02:00
AMOS bot 4f62cc1df2 Automatically generated installer lang files 2023-03-26 00:07:33 +00:00
Sara Arjona 170be96134 weekly release 3.11.13+ 2023-03-24 13:59:41 +01:00
Jun Pataleta 8fd2717282 Merge branch 'MDL-77669-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-03-24 11:51:15 +08:00
Paul Holden 51d69fa94b Merge branch 'MDL-77691-311' of https://github.com/roland04/moodle into MOODLE_311_STABLE 2023-03-23 11:43:44 +00:00
Mikel Martín dcce6d99df MDL-77691 behat: Add step to navigate to profile page directly
Co-authored-by: Simey Lameze <simey@moodle.com>
2023-03-23 08:24:52 +01:00
Ilya Tregubov e978042e2a weekly release 3.11.13+ 2023-03-22 09:37:18 +08:00
Ilya Tregubov 939202d95d Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-03-22 09:37:16 +08:00
Meirza 23c31f017f 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:38 +08:00
Sara Arjona 9b3cf25838 Merge branch 'MDL-77574-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-03-20 17:06:18 +01:00
AMOS bot a034c0a53b Automatically generated installer lang files 2023-03-20 00:07:34 +00:00
AMOS bot d3eea84c50 Automatically generated installer lang files 2023-03-19 00:07:29 +00:00
AMOS bot 455ca43140 Automatically generated installer lang files 2023-03-18 00:07:34 +00:00
Sara Arjona 7d8be2a715 weekly release 3.11.13+ 2023-03-17 17:58:44 +01:00
Sara Arjona cf33bc4411 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-03-17 17:58:37 +01:00
AMOS bot a9d42baf99 Automatically generated installer lang files 2023-03-17 00:07:36 +00:00
info@eWallah.net b073419601 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:31 +01:00
Jun Pataleta 3b1ca1610e Merge branch 'MDL-77611_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2023-03-15 10:00:37 +08:00
AMOS bot 2ba187b91b Automatically generated installer lang files 2023-03-15 00:07:32 +00:00
Eloy Lafuente (stronk7) 0249b9f16f weekly release 3.11.13+ 2023-03-14 16:07:49 +01:00
Eloy Lafuente (stronk7) 9a45a3fa3f Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-03-14 16:07:45 +01:00
Jun Pataleta 223a90679b Merge branch 'MDL-76680/311' of https://github.com/skodak/moodle into MOODLE_311_STABLE 2023-03-14 11:57:01 +08:00
AMOS bot b7d4a3280c Automatically generated installer lang files 2023-03-14 00:07:34 +00:00
Tim Hunt ac15d110ba MDL-77611 tool_uploaduser: fix phpunit assumptions about profile fields 2023-03-13 13:36:42 +00:00
Simey Lameze 9f1de216a4 MDL-77574 myoverview: wait until next button exists before clicking 2023-03-13 14:18:50 +08:00
AMOS bot 0b083a7f6f Automatically generated installer lang files 2023-03-12 00:07:38 +00:00
Petr Skoda aa0d711a6f MDL-76680 core: disable $USER->ignoresesskey on next page 2023-03-11 10:37:45 +01:00
Jun Pataleta cd71612cf6 Moodle release 3.11.13 2023-03-11 13:10:27 +08:00
Jun Pataleta a4874cb9c5 weekly release 3.11.12+ 2023-03-10 22:10:03 +08:00
Jun Pataleta 90818a22ad Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-03-10 22:10:01 +08:00
Ilya Tregubov 28bb2b50d6 Merge branch 'MDL-77429-311-fix' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-03-10 14:50:40 +08:00
Andrew Nicols 28d6953d48 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
Jun Pataleta c7b3edf823 Merge branch 'MDL-77458-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-03-10 12:05:56 +08:00
Andrew Nicols 880e150587 Merge branch 'MDL-77429-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-03-09 22:12:39 +08:00
Andrew Nicols 760a316679 Merge branch 'MDL-77463-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-03-09 22:04:24 +08:00
Jun Pataleta 525f816567 Merge branch 'MDL-77559-311-2' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-03-09 15:46:24 +08:00
Angelia Dela Cruz 40b1954431 MDL-77463 Behat: Coverage for assign submission notification to teacher 2023-03-09 12:56:39 +08:00
Angelia Dela Cruz 9f152581f0 MDL-77429 Behat: Add coverage for changing course format as teacher 2023-03-09 10:01:40 +08:00
Andrew Nicols 1a624afb87 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 08:22:29 +08:00
Andrew Nicols f80a3bce0a MDL-77559 js: Revert "MDL-75012 core: Bump NodeJS version requirements"
This reverts commit fb8fa74655.
2023-03-09 08:21:22 +08:00
Andrew Nicols 4deb1eea56 MDL-77559 js: Revert "MDL-75012 js: Bump standard dependencies"
This reverts commit 811526b0a6.
2023-03-09 08:21:19 +08:00
Andrew Nicols 77c72b0bd7 MDL-77559 js: Revert "MDL-75012 js: Remove grunt-contrib-uglify"
This reverts commit d01eba812b.
2023-03-09 08:21:15 +08:00
Andrew Nicols a15df02640 MDL-77559 js: Revert "MDL-75012 js: Bump stylelint and components"
This reverts commit 9899fc0a0f.
2023-03-09 08:21:12 +08:00
Andrew Nicols e5dd087852 MDL-77559 js: Revert "MDL-75012 js: Update browserslist"
This reverts commit c920bb6db5.
2023-03-09 08:21:07 +08:00
Andrew Nicols f46643fd61 MDL-77559 js: Revert "MDL-75012 js: Bump node-sass"
This reverts commit 173b61bf69.
2023-03-09 08:21:03 +08:00
Andrew Nicols 426e58d35d MDL-77559 js: Revert "MDL-75012 js: Audit fix"
This reverts commit dfea25b3d7.
2023-03-09 08:20:57 +08:00
Andrew Nicols be86e18ff1 MDL-77559 js: Revert "MDL-75012 js: Use our own jsdoc wrapper"
This reverts commit a22e2aa0d7.
2023-03-09 08:20:53 +08:00
Andrew Nicols d33aa94074 MDL-77559 js: Revert "MDL-75012 js: Bump shifter to new version"
This reverts commit 0ebccd5bb4.
2023-03-09 08:20:49 +08:00
Andrew Nicols 47fcb7c012 MDL-77559 js: Revert "MDL-75012 js: Put shifter on a diet"
This reverts commit 8d6e0dc416.
2023-03-09 08:20:45 +08:00
Andrew Nicols 7fd65d8896 MDL-77559 js: Revert "MDL-75012 js: Remove unused babel-preset-minify dependency"
This reverts commit 35ef8a9e40.
2023-03-09 08:20:42 +08:00
Andrew Nicols 4ad6481a77 MDL-77559 js: Revert "MDL-75012 js: Bump Babel dependencies"
This reverts commit 0a95429dce.
2023-03-09 08:19:26 +08:00
AMOS bot 40d01acce6 Automatically generated installer lang files 2023-03-09 00:07:34 +00:00
Ilya Tregubov f5daf410af Merge branch 'MDL-77414-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-03-08 17:06:17 +08:00
Angelia Dela Cruz 40510605e4 MDL-77414 Behat: Coverage for "Require all group members submit" setting 2023-03-08 14:52:46 +08:00
Petr Skoda b436508b24 MDL-77524 filter_algebra: fix error message 2023-03-08 11:27:28 +08:00
Paul Holden 98bbce7011 MDL-75517 report_participation: filter report by viewable roles only. 2023-03-08 10:38:29 +08:00
Michael Hawkins 04d74da325 MDL-77204 mod_wiki: Clean filename in Moodle1 backup 2023-03-08 10:34:18 +08:00
Paul Holden 90c5358680 MDL-77046 availability: validate profile field in condition. 2023-03-08 10:24:37 +08:00
Paul Holden 882b9d67f5 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:32 +08:00
Ilya Tregubov 591ffa267d Merge branch 'MDL-77446-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-03-08 09:20:01 +08:00
AMOS bot 7c10813e02 Automatically generated installer lang files 2023-03-08 00:07:36 +00:00
Petr Skoda a099b1d893 MDL-76645 filter_data: fix link title attribute 2023-03-07 14:49:50 +00:00
Lars Bonczek 39ab1182d9 MDL-75659 core: Don't render component argument twice in mustache pix helper 2023-03-07 14:49:50 +00:00
Angelia Dela Cruz 9e5bf8d4d5 MDL-77446 Behat: Add coverage for changing uploaded file details 2023-03-07 16:14:34 +08:00
AMOS bot fc2ed595d9 Automatically generated installer lang files 2023-03-07 00:07:34 +00:00
Jun Pataleta 86f1bf85c4 Merge branch 'MDL-77428-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-03-03 16:34:50 +08:00
Jake Dallimore 4e858410ea weekly release 3.11.12+ 2023-03-03 11:08:47 +08:00
Jake Dallimore dd581ff3f5 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-03-03 11:08:45 +08:00
Andrew Nicols 1a70b72b41 MDL-77458 core: Add supported php version info to phpcs config 2023-03-02 20:37:52 +08:00
Angelia Dela Cruz c7b2f34748 MDL-77428 Behat: Add coverage for forum post word count 2023-03-02 13:48:47 +08:00
Jun Pataleta ee828d828a Merge branch 'MDL-75012-311-5' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-03-02 12:25:04 +08:00
Andrew Nicols 499f651729 MDL-75012 js: Full build of all grunt things 2023-03-02 12:15:25 +08:00
Andrew Nicols 0a95429dce 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 35ef8a9e40 MDL-75012 js: Remove unused babel-preset-minify dependency 2023-03-02 12:15:25 +08:00
Jake Dallimore 51dae0b04e Merge branch 'MDL-77461-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-03-02 11:43:09 +08:00
Andrew Nicols bc41f92872 MDL-77461 behat: Use get_course_id instead of DB fetch 2023-03-02 11:07:39 +08:00
Jun Pataleta 430b3e7043 Merge branch 'MDL-77413-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-03-02 09:45:42 +08:00
AMOS bot f6debec437 Automatically generated installer lang files 2023-03-02 00:07:38 +00:00
Jun Pataleta c4d91b4e42 Merge branch 'MDL-77417_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2023-03-01 23:53:54 +08:00
Andrew Nicols 98317ff91a Merge branch 'MDL-72727-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2023-03-01 10:47:27 +08:00
AMOS bot 21c5f2d453 Automatically generated installer lang files 2023-03-01 00:07:32 +00:00
Andrew Nicols 42ec6014c4 Merge branch 'MDL-77097_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2023-02-28 22:34:30 +08:00
Angelia Dela Cruz 45b81544c5 MDL-77413 Behat: Minor changes to optimise the existing tests 2023-02-28 17:38:14 +08:00
Angelia Dela Cruz f055b84644 MDL-77413 Behat: Add coverage to verify groups can have a picture 2023-02-28 17:25:04 +08:00
Andrew Nicols 8d6e0dc416 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 11:10:32 +08:00
Andrew Nicols 0ebccd5bb4 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 11:10:32 +08:00
Andrew Nicols a22e2aa0d7 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 11:10:32 +08:00
Andrew Nicols dfea25b3d7 MDL-75012 js: Audit fix 2023-02-28 11:10:32 +08:00
Andrew Nicols 173b61bf69 MDL-75012 js: Bump node-sass 2023-02-28 11:10:32 +08:00
Andrew Nicols c920bb6db5 MDL-75012 js: Update browserslist 2023-02-28 11:10:31 +08:00
Andrew Nicols 9899fc0a0f MDL-75012 js: Bump stylelint and components 2023-02-28 10:19:24 +08:00
Andrew Nicols d01eba812b 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:23 +08:00
Andrew Nicols 811526b0a6 MDL-75012 js: Bump standard dependencies
This change bumps dependencies which have no impact upon the build
process
2023-02-28 10:19:23 +08:00
Andrew Nicols fb8fa74655 MDL-75012 core: Bump NodeJS version requirements 2023-02-28 10:19:23 +08:00
Paul Holden 36e2f7d5a3 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:43 +00:00
Eloy Lafuente (stronk7) 4fa6354d89 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:37 +01:00
Eloy Lafuente (stronk7) 7ed2a79297 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:39:03 +01:00
Jun Pataleta 65731963bc weekly release 3.11.12+ 2023-02-24 15:43:36 +08:00
Jun Pataleta 63c6f278a7 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-02-24 15:43:33 +08:00
Matt Porritt 474ee8524a 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:36:43 +08:00
Andrew Nicols 5956302d76 Merge branch 'MDL-76843_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2023-02-23 11:54:21 +08:00
Andrew Nicols 9121d889f5 Merge branch 'MDL-77271-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-02-23 11:49:48 +08:00
Tim Hunt af0aee7d2a 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:25:32 +00:00
Simey Lameze 76fc2573ce MDL-77271 behat: verify user licence preference is remembered 2023-02-22 09:31:04 +08:00
AMOS bot d611739b3f Automatically generated installer lang files 2023-02-21 00:07:30 +00:00
Ilya Tregubov f638a5bbae weekly release 3.11.12+ 2023-02-17 09:12:33 +08:00
Ilya Tregubov 2079ba1387 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2023-02-17 09:12:31 +08:00
AMOS bot c12e3b46de Automatically generated installer lang files 2023-02-17 00:07:43 +00:00
Andrew Nicols bdb1aefaad Merge branch 'MDL-76478-password-unmask-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2023-02-15 23:28:22 +08:00
Ilya Tregubov 6c48aaf4d9 Merge branch 'MDL-75230-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-02-15 16:13:32 +08:00
AMOS bot a745135867 Automatically generated installer lang files 2023-02-15 00:07:42 +00:00
Ilya Tregubov 2674350a47 Merge branch 'MDL-77189-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-02-13 13:44:38 +08:00
Simey Lameze 16cee3894e MDL-77189 behat: basic coverage for wikimedia repository 2023-02-13 13:24:03 +08:00
Paul Holden 5e943bf6ba weekly release 3.11.12+ 2023-02-10 13:47:41 +00:00
Angelia Dela Cruz 4d29785724 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-10 17:44:33 +08:00
Andrew Nicols 733b90eef0 Merge branch 'MDL-76499-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-02-09 10:08:00 +08:00
Jun Pataleta 00385e7580 Merge branch 'MDL-74905_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2023-02-08 17:19:11 +08:00
Andrew Nicols 3b757a24eb Merge branch 'MDL-77123-311' of https://github.com/cameron1729/moodle into MOODLE_311_STABLE 2023-02-08 13:01:19 +08:00
Cameron Ball c56edaa116 MDL-77123 message_airnotifier: Don't test configured providers 2023-02-08 09:59:19 +08:00
Paul Holden 6b54bd46f2 Merge branch 'MDL-77078-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-02-06 13:33:09 +00:00
Angelia Dela Cruz 31f13cd315 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-06 14:32:10 +08:00
Angelia Dela Cruz a45ccc464b MDL-77078 Behat: Coverage for assignment submission statement 2023-02-06 12:09:54 +08:00
Andrew Nicols 604d8c291f Merge branch 'MDL-76662-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2023-02-04 21:52:43 +08:00
Eloy Lafuente (stronk7) c5fdf320cd 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:15 +01:00
Eloy Lafuente (stronk7) 0fd5993afb 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:15 +01:00
Eloy Lafuente (stronk7) ec56eeb9a9 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:15 +01:00
Jun Pataleta fa6c77adc7 weekly release 3.11.12+ 2023-02-03 15:43:46 +08:00
Andrew Nicols dca46bcab8 Merge branch 'MDL-75830-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-02-02 11:58:59 +08:00
Andrew Nicols cc045cc27d Merge branch 'MDL-76675_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2023-02-02 11:04:32 +08:00
Andrew Nicols 980a265718 Merge branch 'MDL-75912-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-02-02 09:45:03 +08:00
Angelia Dela Cruz 6ad9dcae1c 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:01:01 +08:00
Paul Holden 2ebc453c99 Merge branch 'MDL-76658-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-02-01 16:34:45 +00:00
Ilya Tregubov 5cbd545cd3 Merge branch 'MDL-76587-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-02-01 13:26:58 +08:00
Angelia Dela Cruz e988445521 MDL-75912 behat: Wiki Behat tests optimised
Behat cleanup and optimisation
2023-02-01 11:32:00 +08:00
Angelia Dela Cruz b08f86b258 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:31:20 +08:00
Angelia Dela Cruz 58213db159 MDL-76658 Behat: Coverage for course cohort enrolment groups
Co-authored-by: Simey Lameze <simey@moodle.com>
2023-01-31 19:55:10 +08:00
Simey Lameze c34dc466b6 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:21:20 +08:00
Andrew Nicols 2b7ede20b5 Merge branch 'MDL-77040-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2023-01-30 12:28:34 +08:00
Eloy Lafuente (stronk7) 4c64f49a88 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:50:18 +01:00
Paul Holden 0baa1aa391 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:16 +00:00
Paul Holden a9b87fa989 MDL-76662 tool_log: correct supported reports test assertions. 2023-01-26 13:09:02 +00:00
Sara Arjona cdcfb84d18 weekly release 3.11.12+ 2023-01-26 09:59:22 +01:00
Jun Pataleta 52046c52b1 Merge branch 'MDL-76977-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2023-01-25 16:09:47 +08:00
Jun Pataleta 9eccbb590e Merge branch 'MDL-77036-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-01-25 16:02:02 +08:00
Simey Lameze 2b7f887245 MDL-77036 core_iplookup: update test_ipv4 test expectations 2023-01-25 15:20:58 +08:00
Jun Pataleta 3dd63e8149 Merge branch 'MDL-76639-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-01-24 18:59:09 +08:00
Jun Pataleta 78e5dd6284 Merge branch 'MDL-76652-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-01-24 18:45:05 +08:00
Jun Pataleta f14dc52adc Merge branch 'MDL-76655-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-01-24 18:26:47 +08:00
Angelia Dela Cruz aab571ca2c MDL-76655 behat: Coverage for workshop grading strategies 2023-01-24 10:08:33 +08:00
Paul Holden eadfbd21e9 MDL-76977 phpunit: ensure unique data provider keys in mustache test. 2023-01-20 17:23:34 +00:00
Ilya Tregubov b5eb437fcd weekly release 3.11.12+ 2023-01-20 09:41:50 +08:00
Ilya Tregubov 16e5b999ce Merge branch 'MDL-76870-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-01-19 11:16:27 +08:00
Andrew Nicols 7d596ff339 Merge branch 'MDL-76841-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2023-01-19 08:55:45 +08:00
Andrew Nicols d02bcbb963 Merge branch 'MDL-70070-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2023-01-19 08:51:32 +08:00
Paul Holden c01344a0e7 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:31 +00:00
Paul Holden e9439d064b 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:19 +00:00
Jun Pataleta f21e1443dc Moodle release 3.11.12 2023-01-14 14:16:53 +08:00
Simey Lameze 860bfb6f25 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:27 +08:00
Angelia Dela Cruz 388c5731fa MDL-76639 behat: Add Behat test coverage for quiz with limited attempts 2023-01-13 16:32:58 +08:00
Jun Pataleta dc93055e28 weekly release 3.11.11+ 2023-01-13 10:52:25 +08:00
Jake Dallimore d57db03d20 MDL-76862 user: Unit test for setting user home page preferences 2023-01-12 11:30:59 +08:00
Paul Holden bd5bcec3f1 MDL-76862 user: ensure user can only update own preferred start page. 2023-01-12 11:17:12 +08:00
Tim Hunt 261fe42c05 MDL-76810 redirect handling: ensure return URLs are properly sanitised 2023-01-11 11:44:12 +08:00
Paul Holden 6f622e2393 Merge branch 'MDL-76811-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-01-10 16:40:08 +00:00
Paul Holden 00b9fe36c1 Merge branch 'MDL-76653-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-01-10 15:29:17 +00:00
Paul Holden e4b27dd81b Merge branch 'MDL-76833-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-01-10 12:29:19 +00:00
Andrew Nicols 5c9704b210 MDL-76833 core: Bump phpunit/php-code-coverage version
This includes a bug fix for a display issue with code coverage reporting
in phpunit's HTML output report.
2023-01-10 12:09:01 +08:00
Andrew Nicols f6f2dd5022 MDL-76811 mod_data: Remove duplicate tests 2023-01-10 11:39:40 +08:00
Andrew Nicols 9fc5f273e0 MDL-76811 mod_data: strpos check should be strict 2023-01-10 11:39:40 +08:00
Andrew Nicols dd63b85ed4 MDL-76811 mod_data: Generator test cleanup 2023-01-10 11:39:39 +08:00
Simey Lameze f164d03df5 MDL-76653 behat: add coverage for SCORM availability 2023-01-10 10:20:58 +08:00
Simey Lameze e32d27e1ff MDL-76652 behat: use data generator and remove duplicated steps 2023-01-09 10:09:58 +08:00
Simey Lameze 2f826724c8 MDL-76652 behat: add coverage for postwithoutthrottling logic 2023-01-09 10:09:58 +08:00
Paul Holden 00ccb3a314 weekly release 3.11.11+ 2023-01-05 10:53:16 +00:00
Sara Arjona 88d4939f25 Merge branch 'MDL-76375-311' of https://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2023-01-04 16:22:00 +01:00
Luca Bösch e3be2fcfb6 MDL-76375 quiz generator: Allow more than one attempt by Behat tests. 2023-01-04 15:15:51 +01:00
Sara Arjona 3585ab5afa Merge branch 'MDL-76760-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2023-01-02 12:27:54 +01:00
Sara Arjona b7bfc77b52 weekly release 3.11.11+ 2022-12-29 12:57:57 +01:00
Sara Arjona 72d98b0dd5 Merge branch 'MDL-76399-patch-311' of https://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2022-12-29 09:13:49 +01:00
Ilya Tregubov 15916a6f3b MDL-76399 behat: switch to appropriate Behat step for selects. 2022-12-29 14:39:37 +07:00
Ilya Tregubov 48256e0242 Merge branch 'MDL-76399-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-12-29 09:44:30 +07:00
Paul Holden 18013b2153 MDL-76760 tool_behat: defer library loading until service execution.
Ensures that API documentation can be generated without requiring
the presence of the `vendor/` directory.
2022-12-28 10:48:02 +00:00
Ilya Tregubov 9da4095949 Merge branch 'MDL-76731_311' of https://github.com/PhilippImhof/moodle into MOODLE_311_STABLE 2022-12-28 15:15:09 +07:00
Paul Holden dc399cd841 MDL-76679 admin: correct password config field template.
The template changes were missed as part of 0795b579, update them
to match so that they continue to work with the unmask JS module.
2022-12-27 16:55:57 +01:00
Philipp Imhof e4a8272d9c MDL-76731 behat: add steps to check for version
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2022-12-22 17:11:44 +01:00
Ilya Tregubov 6832ac123d weekly release 3.11.11+ 2022-12-22 19:16:40 +07:00
Ilya Tregubov e892c66058 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-12-22 19:16:38 +07:00
Andrew Nicols 48637c438d MDL-75105 tool_behat: Coding style fixes 2022-12-22 12:32:01 +07:00
Andrew Nicols 0e64a10ecf Merge branch 'MDL-75105_311_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_311_STABLE 2022-12-22 12:32:01 +07:00
AMOS bot 0dd5b86d3f Automatically generated installer lang files 2022-12-22 00:07:36 +00:00
Mark Johnson b0f89e5b92 MDL-75105 tool_behat: List available data generators
This will find all data generators that can be used in behat via the
'the following "something" exist:' step, and display them in a select
list on the step definitions page.

When a generator is selected, it will fetch the required fields for that
generator and display them on the page.
2022-12-21 08:38:38 +00:00
Ilya Tregubov c4c67cd975 Merge branch 'MDL-76727-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-12-21 09:51:19 +07:00
Andrew Nicols 9ae06b8dc7 MDL-76727 core: Allow phpcs configuration to be overridden locally
This change reduces the priority of the shipped phpcs configuration to
allow for local overrides.

This is beneficial in several situations:
- when users wish to apply stricter or additional standards
- when the integration team wishes to trial new rules
2022-12-21 09:07:52 +08:00
Paul Holden e59e39c78f MDL-76399 question: switch to appropriate Behat step for selects. 2022-12-16 13:13:55 +00:00
Paul Holden 99e20baa54 MDL-76399 behat: improvements to "should exist in" thrown exception. 2022-12-16 12:29:13 +00:00
Andrew Nicols 7c04ccfdf9 weekly release 3.11.11+ 2022-12-16 09:06:03 +08:00
Andrew Nicols 2f8a56eaf0 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-12-16 09:06:01 +08:00
Sara Arjona 0a774cefb8 Merge branch 'MDL-76674_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-12-14 18:35:08 +01:00
Eloy Lafuente (stronk7) 6257ac4de7 MDL-76674 core_lang: Add string for new America/Ciudad_Juarez 2022-12-14 15:52:03 +01:00
Paul Holden 5f34ca7b01 Merge branch 'MDL-76666_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-12-14 13:22:09 +00:00
Eloy Lafuente (stronk7) 624d027753 MDL-76666 local_langimport: Better handling of long locales
Under some linux versions, and depending of the configured
locale categories, it's possible to get a current locally
which length > 255 when calling to setlocale(LC_ALL, 0).

Later, if that long locale is tried to be restored, there
is a "setlocale(): Specified locale name is too long" warning
error.

When that happens we need to split the long locale into
individual chunks and set all the (six) locale categories
supported one by one.

Covered with tests, note that, in practice, this only
happens with linux because it supports 12 locale categories
@ OS level. Both BSD (6) and Windows (5) hardly can reach the limit.

No matter of that, the tests have been designed to ensure that
they pass on all OSs, just the new code only will be executed
on linux.
2022-12-14 12:26:27 +01:00
AMOS bot b492fa8255 Automatically generated installer lang files 2022-12-14 00:07:36 +00:00
Andrew Nicols 2d1c45a40e Merge branch 'MDL-76398-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-12-11 20:21:17 +08:00
Sara Arjona 13000ae319 weekly release 3.11.11+ 2022-12-09 08:57:13 +01:00
Sara Arjona 81dee5182b Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-12-09 08:57:09 +01:00
AMOS bot 44ec3591c0 Automatically generated installer lang files 2022-12-08 00:07:35 +00:00
Brendan Heywood 7f638dac59 MDL-76478 formslib: Fix autocomplete bug of existing passwords 2022-12-08 00:45:58 +11:00
Jun Pataleta 3ad36ca4f9 Merge branch 'MDL-73017-M311_add-environment-check-for-versions-not-supporting-php-8-1' of https://github.com/ziegenberg/moodle into MOODLE_311_STABLE 2022-12-07 13:47:27 +08:00
Ilya Tregubov ffc0155eab Merge branch 'MDL-76490-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-12-06 13:10:47 +03:00
Andrew Nicols 42e3f4d696 Merge branch 'MDL-75446-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2022-12-06 15:21:01 +08:00
Paul Holden ff446d05f6 MDL-76490 behat: use defined step for interaction with autocomplete. 2022-12-05 14:22:34 +00:00
Marina Glancy a213654a08 MDL-76490 behat: correct step for opening autocomplete in container. 2022-12-05 14:22:05 +00:00
Ilya Tregubov b7947e03ff Merge branch 'MDL-75788-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-12-05 14:32:56 +03:00
Daniel Ziegenberg 2c18225da4 MDL-73017 env: Moodle 3.9.x, 3.11.x and 4.0.x do not support PHP 8.1
This commit adds an additional environment check for the unsupported
PHP 8.1 version to Moodle 3.9.x, 3.11.x and 4.0.x.

It also updates the lang string for unsupported PHP version.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-12-05 11:43:37 +01:00
Angelia Dela Cruz 67edcbd16f MDL-75446 behat: Workshop behat generators use UI
Replace steps that manually add Workshop instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2022-12-05 16:49:04 +08:00
AMOS bot a6154a1cab Automatically generated installer lang files 2022-12-04 00:08:25 +00:00
Dani Palou eb7a2e3070 MDL-75788 behat: Use profile field generators in existing tests 2022-12-02 15:04:36 +08:00
Dani Palou 29a6589b8d MDL-75788 testing: Handle new lines in menu profile field generator 2022-12-02 15:04:33 +08:00
Sara Arjona 219206d83e weekly release 3.11.11+ 2022-12-01 16:08:09 +01:00
Jun Pataleta 7391010aac Merge branch 'MDL-76429_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-11-30 10:52:28 +08:00
Andrew Nicols 713048a0c9 Merge branch 'MDL-75960-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2022-11-29 17:05:39 +08:00
Andrew Nicols 9f018ab557 Merge branch 'MDL-65939-311' of https://github.com/ewallah/moodle into MOODLE_311_STABLE 2022-11-29 15:42:38 +08:00
Andrew Nicols 8e6aeda4ba Merge branch 'MDL-76058-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-11-29 15:37:45 +08:00
Angelia Dela Cruz 8af4bb6a40 MDL-75960 behat: Survey behat generators use UI
Replace steps that manually add Survey instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2022-11-28 10:21:24 +08:00
Eloy Lafuente (stronk7) 804ae9ad72 MDL-76429 composer: Bump to phpwebdriver 1.2.1 for php81 compat
This fix is really only required for Moodle 4.1 and up, that will
be the one supporting php81, but we always apply composer changes
to all branches (supported and security), so we keep them running
the same stuff.

Note this comes with a bunch of other small updates, all them
pretty minor and should not be problematic. Better we get them
than keeping them apart.
2022-11-25 16:27:31 +01:00
Ilya Tregubov 75a49ff1b2 weekly release 3.11.11+ 2022-11-25 15:38:33 +03:00
Jun Pataleta 3931e6fe5c Merge branch 'MDL-76340-311' of https://github.com/stevandoMoodle/moodle into MOODLE_311_STABLE 2022-11-25 08:21:40 +08:00
Stevani Andolo 8e195adb84 MDL-76340 VideoJS: Fixed the menu item not being displayed as expected 2022-11-24 22:55:52 +08:00
Paul Holden 44ab3ba8f1 MDL-76398 behat: broader action menu partial matching by element.
For action menu elements whose trigger element isn't plain text
(e.g. a pix icon), we should be able to match via the title of
that element.
2022-11-21 16:59:24 +00:00
Paul Holden 91de19a803 weekly release 3.11.11+ 2022-11-18 11:43:16 +00:00
Paul Holden fcbd95d16d Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-11-18 11:43:13 +00:00
AMOS bot ccb7bb2767 Automatically generated installer lang files 2022-11-18 00:07:36 +00:00
info@eWallah.net 09be924480 MDL-65939 phpunit: Maildigest tests can query a wrong adhoc task 2022-11-17 15:52:11 +01:00
Jun Pataleta 9d9a626038 Merge branch 'MDL-76292-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-11-17 14:53:10 +08:00
Jun Pataleta 9a3cf47a77 Merge branch 'MDL-76310-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-11-17 14:39:26 +08:00
Paul Holden 1fb8bedf50 MDL-76310 enrol_lti: fix consumer key upgrade steps for Oracle.
Avoids CLOB comparison exceptions, related to ORA-00932.
2022-11-16 09:28:46 +00:00
Simey Lameze 92b909033e MDL-76292 completion: split criteria duration test into two tests 2022-11-14 16:13:22 +08:00
Jun Pataleta becbdd847d Moodle release 3.11.11 2022-11-12 12:55:28 +08:00
Sara Arjona 6ac3dd457c weekly release 3.11.10+ 2022-11-11 15:02:00 +01:00
Sara Arjona cd97da9c5c NOBUG: Fixed file access permissions 2022-11-11 15:01:59 +01:00
Mathew May 759b2670a0 MDL-71920 libraries: Migrate LTI lib away from pure curl 2022-11-11 12:54:45 +08:00
Mathew May 3f90e29e39 MDL-71920 core: update filelib opt name definition 2022-11-11 12:54:45 +08:00
Jake Dallimore 257a8126ad Merge branch 'MDL-75872-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-11-11 11:45:57 +08:00
Jun Pataleta d32320beac Merge branch 'MDL-63037-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2022-11-11 10:42:11 +08:00
Sara Arjona 1352a23354 Merge branch 'MDL-71951-311' of https://github.com/stevandoMoodle/moodle into MOODLE_311_STABLE 2022-11-10 16:37:42 +01:00
Sara Arjona 46a8a3bb75 Merge branch 'MOODLE_311_MDL-75874' of https://github.com/matheusot/moodle into MOODLE_311_STABLE 2022-11-10 16:22:22 +01:00
Sara Arjona 79d1331384 Merge branch 'MDL-74606-311-support-multilang-group-names-in-mod_assign' of https://github.com/krostas1983/moodle into MOODLE_311_STABLE 2022-11-10 16:04:45 +01:00
Matheus Rodrigues cd72578917 MDL-75874 aiken_html: correctly display HTML chars for Aiken questions
Updates the Aiken Format class to process answers correctly, enabling
support for special HTML characteres such as <, >, and &.

Co-authored-by: Leticia Luz <leticia.adrielli.luz@gmail.com>
2022-11-10 10:00:48 -03:00
Sara Arjona 72e9f115ab Merge branch 'MDL-75448-MOODLE_311' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2022-11-10 13:19:48 +01:00
Paul Holden 01011e49dd Merge branch 'MDL-68550-311' of https://github.com/rezaies/moodle into MOODLE_311_STABLE 2022-11-10 12:00:22 +00:00
Sara Arjona fcf7d12a4b Merge branch 'MDL-75974-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-11-10 12:51:43 +01:00
Paul Holden f44d6ba340 Merge branch 'MDL-76011-311' of https://github.com/abgreeve/moodle into MOODLE_311_STABLE 2022-11-10 11:50:07 +00:00
Sara Arjona 15632be78d Merge branch 'MDL-75876-MOODLE_311_STABLE' of https://github.com/praxisdigital/moodle into MOODLE_311_STABLE 2022-11-10 12:47:21 +01:00
Sara Arjona 53a0fbecd2 Merge branch 'MDL-76167-311' of https://github.com/davewoloszyn/moodle into MOODLE_311_STABLE 2022-11-10 12:42:25 +01:00
Paul Holden 832261f49b Merge branch 'MDL-76224-311' of https://github.com/justusdieckmann/moodle into MOODLE_311_STABLE 2022-11-10 08:54:20 +00:00
Paul Holden 2378fc0117 MDL-75862 backup: omit sesskey for continue buttons using get method.
It's automatically added by the rendered single_button instance when
using post method, so no need to add it unconditionally.
2022-11-10 10:17:35 +08:00
Shamim Rezaie cd754d3b44 MDL-68550 tablelib: Use aria-role=button
Use the aria-role=button for:
- show/hide links
- sort links
- reset table preferences link
2022-11-10 06:22:54 +11:00
Shamim Rezaie 8307ce8f18 MDL-68550 output: Improve accessibility of the initials bar
- The current item should be focusable otherwise the focus will be lost
  as soon as a user clicks on an item in the initials bar
- Modified behat tests to not mistakenly click on the 'All' link
- The currently selected item is specified by aria-current
- Useed aria-current=true rather than =page because the links of each
  item in the initials bar is missing the pagination information
2022-11-10 06:21:52 +11:00
Shamim Rezaie 4225940caa MDL-68550 output: Improve accessibility of the paging bar
The use of aria-current is based on the example at
https://design-system.w3.org/components/pagination.html
2022-11-10 06:21:52 +11:00
Shamim Rezaie 2ce1ed7247 MDL-68550 theme: Not showing the gap in the initial bar
The gap issue was a regression from MDL-66670.
2022-11-10 06:21:52 +11:00
Paul Holden f21c892997 MDL-75872 mod_lesson: allow unlimited attempts default value.
Related change in 252e85be added a similar value per activity, we
should also allow it to be chosen as a default for the site.
2022-11-09 18:54:14 +00:00
Sara Arjona 0b8ab4fcef Merge branch 'MDL-50935-311-2' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-11-09 16:01:30 +01:00
Justus Dieckmann 8ec49b09e5 MDL-76224 Resource: Set correct page url in /mod/label/view.php 2022-11-09 15:50:48 +01:00
Meirza fd9ab3efbd MDL-76131 core_user: encode social profile fields data. 2022-11-09 15:49:53 +01:00
Jun Pataleta acdca038df Merge branch 'MDL-76185-311' of https://github.com/mihailges/moodle into MOODLE_311_STABLE 2022-11-09 21:52:04 +08:00
Jun Pataleta dd6f0debcc Merge branch 'MDL-76054_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-11-09 20:08:56 +08:00
Sara Arjona 8f93e88387 Merge branch 'MDL-75889-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-11-09 12:36:55 +01:00
Sara Arjona 17fccfcf64 Merge branch 'MDL-76059-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-11-09 12:31:46 +01:00
David Woloszyn 0cdb9169cb MDL-76091 lib: Add additional check to local URLs params 2022-11-09 19:24:42 +08:00
Sara Arjona a110b34a5a Merge branch 'MDL-75766-311' of https://github.com/aanabit/moodle into MOODLE_311_STABLE 2022-11-09 11:57:38 +01:00
Sara Arjona 252d0faac1 Merge branch 'MDL-74201-311' of https://github.com/aanabit/moodle into MOODLE_311_STABLE 2022-11-09 11:49:44 +01:00
Jun Pataleta 1802410629 Merge branch 'MDL-76170-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2022-11-09 15:44:39 +08:00
Jake Dallimore 89cba33e91 MDL-76170 enrol_lti: fix missing secret in enrol_lti_users
If member sync runs before the user launches the tool, a partial record
is created, without consumer secret. Subsequent launches of the tool by
that member don't resolve this and this results in grade sync failing
for any affected users. This patch:
- data fixes the existing affected rows
- fixes the launch code, ensuring secret is recorded on launch,
irrespective of whether the user info record has been created already
or not.
2022-11-09 10:04:39 +08:00
Simey Lameze 2a36ff8dfb MDL-76058 behat: send message using data generator 2022-11-09 09:52:16 +08:00
Frédéric Massart b86162544d MDL-74201 backup: Restore reference to content bank files 2022-11-08 20:20:21 +01:00
Eloy Lafuente (stronk7) 2135ff7c19 MDL-76054 environment: Remove the php-xmlrpc extension check
For Moodle 4.1 and up, the php-xmlrpc is not needed anymore:
- All the MNet stuff has been moved to use php library (MDL-76055).
- The webservice/xmlrpc has been moved from core to contrib (MDL-76052).

So we just remove the check here. Starting with 4.1, it's not
needed for any core functionality.

No lang string changes in this branch, only in master (4.1dev).
2022-11-08 16:46:26 +01:00
Stevani Andolo d0e63f5a60 MDL-75278 VideoJS: Update VideoJS to use validation helper 2022-11-08 13:54:20 +00:00
Víctor Déniz ec65857de0 weekly release 3.11.10+ 2022-11-08 13:44:52 +00:00
Jake Dallimore d34d35d2b6 MDL-63037 mnet: fix hostexists string usage 2022-11-08 17:05:48 +08:00
Jun Pataleta 0742fb7b44 Merge branch 'MDL-76113-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2022-11-08 12:01:47 +08:00
Jake Dallimore 0e7caf93b5 Merge branch 'MDL-76071-311' of https://github.com/laurentdavid/moodle into MOODLE_311_STABLE 2022-11-08 11:44:34 +08:00
Jake Dallimore e876654d1f Merge branch 'MDL-72882-311-3' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-11-08 11:32:25 +08:00
Jun Pataleta a11e590324 Merge branch 'MDL-76207-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-11-08 10:25:22 +08:00
Paul Holden 5ff8f06f64 MDL-75974 tool_customlang: check out language pack in CLI import. 2022-11-07 22:41:07 +00:00
Paul Holden 8a1c8f8bb3 MDL-75889 core: compare domain names in a case-insensitive manner.
As per https://www.rfc-editor.org/rfc/rfc1035#section-3.1
2022-11-07 22:37:00 +00:00
Andrew Nicols 671849b2db Merge branch 'MDL-75880_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-11-07 21:57:32 +08:00
Andrew Nicols 8341244903 Merge branch 'MDL-73624-311' of https://github.com/meirzamoodle/moodle into MOODLE_311_STABLE 2022-11-07 21:52:25 +08:00
Víctor Déniz 02d251294c Merge branch 'm311_MDL-74912_Fix_RegExp_Word_Boundaries_On_MySQL8' of https://github.com/scara/moodle into MOODLE_311_STABLE 2022-11-07 10:22:00 +00:00
Jun Pataleta b490d511d6 MDL-50935 atto_equation: Add upgrade step to fix existing sites 2022-11-07 15:15:40 +08:00
Jun Pataleta 2d08d7d2c0 MDL-50935 atto_equation: Fix display of matrix template
Thanks to Geoffrey Rowland's fix suggestion.
2022-11-07 15:13:07 +08:00
Andrew Nicols 016d123034 MDL-76207 contentbank: Switch to opened window 2022-11-06 21:00:09 +08:00
Matteo Scaramuccia 2e4c5f9c12 MDL-74912 dml: Fix PHP coding style problems 2022-11-05 10:09:04 +01:00
Matteo Scaramuccia e7b463af6d MDL-74912 dml: Fix missing nullable marker 2022-11-05 10:09:04 +01:00
Matteo Scaramuccia 314c9671fc MDL-74912 mod_forum: Fix regexp word boundaries markers in MySQL 8 2022-11-05 10:09:04 +01:00
anisa kusumadewi b8c4c975e0 MDL-75766 core_h5p: Added index for pathnamehash to h5p table 2022-11-04 16:55:54 +01:00
Eloy Lafuente (stronk7) f3952dc29f MDL-75880 phpunit: fix all @coversDefaultClass missing @covers
Because @coversDefaultClass doesn't indicate any coverage (it's
just an alias to avoid having to write the class name in @covers),
this commit fixes all the files that were using that annotation
and missing any @covers.

Basically, replacing one by the other and done.
2022-11-04 16:51:30 +01:00
Sara Arjona 71841556aa weekly release 3.11.10+ 2022-11-04 14:52:07 +01:00
Sara Arjona 575fabe57a Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-11-04 14:52:03 +01:00
Jun Pataleta 5cf3b78855 Merge branch 'MDL-76103-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-11-04 11:34:28 +08:00
Marina Glancy a84b1f1307 MDL-76103 search: skip solr behat tests if solr is not installed 2022-11-04 11:22:20 +08:00
Jun Pataleta c435b7896f Merge branch 'MDL-76072-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-11-04 10:37:34 +08:00
AMOS bot e740fa9c3b Automatically generated installer lang files 2022-11-04 00:07:31 +00:00
David Woloszyn 243eb04a85 MDL-76167 installer: Corrected dockblock param types 2022-11-04 10:48:03 +11:00
Víctor Déniz 88c757cef0 Merge branch 'MDL-70071-311' of https://github.com/Chocolate-lightning/moodle into MOODLE_311_STABLE 2022-11-03 20:38:58 +00:00
Sara Arjona 8f06e62409 Merge branch 'MDL-76169-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-11-03 17:06:22 +01:00
Mihail Geshoski 0eda72ec4f MDL-76185 mod_glossary: Remove separator in continuous display format 2022-11-03 23:54:23 +08:00
Andrew Nicols 68ff5f0ce0 MDL-70071 forum: Convert post threshold warnings to info 2022-11-03 15:04:48 +08:00
Jun Pataleta deb5150786 MDL-72882 tool_langimport: Set default language when deleting lang pack
* When the language pack being deleted is
  - the same as the site default language, we must set the site default
    language to 'en'.
  - fix the user's current language to the default site language.
2022-11-03 14:01:06 +08:00
Jun Pataleta 15521655a3 MDL-72882 core: Use default site lang when user lang no longer available
* Check that the lang attribute for the output HTML exists. If not,
use the default site language.
* Also fix the current language for the user.
2022-11-03 14:01:06 +08:00
Andrew Nicols 3a2703c9f5 Merge branch 'MDL-75904-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-11-03 13:48:11 +08:00
Andrew Nicols f48d31f0d4 MDL-76169 behat: Normalise exception message in should (not) steps
These steps have accepted a NodeElement instance as an argument for some
time, but were trying to cast it to string when formulating exception
messages, making it harder to debug and, in the case of the 'should see'
step, not work at all.

This patch introduces a new function to produce a consistent naming for
them.
2022-11-03 13:28:51 +08:00
Andrew Nicols 38da2c3a61 MDL-76169 behat: Add improved steps for using action menus
This commit adds new steps related to action menus to support:
* Choosing an item in a named action menu
* Choosing an item in a named action menu within a container
* Confirming that an action menu item does or does not exist in a named
  action menu
* Confirming that an action menu item does or does not exist in a named
  action menu within a container

The existing action menu steps were insufficient as they assume that
there is only one action menu within he container, which is not
necessarily the case.

The existing action menu steps are not non-JS friendly and will error if
JS is disabled, without providing any fallback when one is easily
available.

Unfortunately these steps cannot be used to replace the existing steps
without manual intervention.
2022-11-03 13:28:51 +08:00
Simey Lameze 583b655e37 MDL-76072 tool_lp: only init inlineGrader module if user can grade 2022-11-03 11:42:10 +08:00
Jake Dallimore 28f06c0f27 MDL-76113 enrol_lti: Fix secret on lti user for LTI 2.0 consumers
Fixes the enrol_lti_users.consumersecret field for LTI 2.0 users.
This field erroneously contained the tool secret and not the consumer
secret needed for service requests when used with LTI 2.0 consumers,
which resulted in complete grade sync failure for LTI 2.0 consumers.
This patch:
- adds an upgrade step to address existing incorrect secrets for LTI
2.0 launched users. It sets these to the correct consumer secret.
- fixes the way the secret is first set during a launch, ensuring
this->consumer->secret is used, which properly captures either the
tool secret (for 1.1 launches) or the consumer secret (for 2.0
launches).
2022-11-02 17:06:04 +08:00
Sara Arjona 4e1e916ca6 Merge branch 'MDL-61880-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2022-11-02 08:30:59 +01:00
Jake Dallimore 0c2426d207 MDL-61880 tool_oauth2: don't rely on discovery when editing issuers
Adjusts the testing scenarios so that we don't rely on endpoint
discovery being run during an issuer edit, which is no longer the case.
For scenarios that need a userinfo endpoint, set this manually.
2022-11-02 11:12:40 +08:00
Jake Dallimore 3f17ea00e7 MDL-61880 core: don't clear issuer fields not present in form data
In cases where we have an id, load the persistent and then set new data
before saving. This ensures we don't delete fields which are missing in
the form data.
2022-11-02 11:12:40 +08:00
Yannick Forget 565fe67086 MDL-61880 core: Retain OAuth 2.0 user field mappings after issuer update 2022-11-02 11:12:34 +08:00
Ilya Tregubov 97f67db36d weekly release 3.11.10+ 2022-11-01 15:00:04 +03:00
Andrew Nicols e2b085c81b Merge branch '311-mdl-75010' of https://github.com/danmarsden/moodle into MOODLE_311_STABLE 2022-11-01 11:52:57 +08:00
Jun Pataleta 91bb1805d9 Merge branch 'MDL-76108-311' of https://github.com/aanabit/moodle into MOODLE_311_STABLE 2022-10-31 16:49:07 +08:00
Dan Marsden 4d36e008dd MDL-75010 core: Prevent user last access update on user key login 2022-10-31 14:20:23 +13:00
Víctor Déniz e57d9506af Merge branch 'MDL-68437-311' of https://github.com/mihailges/moodle into MOODLE_311_STABLE 2022-10-28 18:28:48 +01:00
Amaia Anabitarte 779cd5b40c MDL-76108 mod_lesson: improving count call for PHP8.0 2022-10-28 18:18:05 +02:00
Sara Arjona 98fd15d75b weekly release 3.11.10+ 2022-10-28 14:09:22 +02:00
Jake Dallimore 552ec1b547 MDL-68943 assignfeedback_editpdf: fix version numbers 2022-10-28 12:09:10 +08:00
Jake Dallimore 977cbaf239 Merge branch 'MDL-68943-311' of https://github.com/cameron1729/moodle into MOODLE_311_STABLE 2022-10-28 11:50:14 +08:00
Cameron Ball a68be3c7fa MDL-68943 assignfeedback_editpdf: Upgrade step for stale conversions 2022-10-28 11:26:43 +08:00
Cameron Ball a123645de3 MDL-68943 assignfeedback_editpdf: Reconvert updated files 2022-10-28 11:26:43 +08:00
Víctor Déniz 29191eeff2 Merge branch 'MDL-75969-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-27 15:45:27 +01:00
Meirza b9701a8bb8 MDL-73624 lib_spout: encode output file name 2022-10-27 17:09:57 +07:00
Adrian Greeve 1fe901e1ab MDL-76011 lib: Updated the zip writer to retain the modified date. 2022-10-27 15:08:40 +08:00
Jun Pataleta 24bc7e9a19 weekly release 3.11.10+ 2022-10-25 17:17:15 +08:00
Jun Pataleta c352ec94a8 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-10-25 17:17:12 +08:00
Laurent David 91c7b05b05 MDL-76071 mod_choice: fix choice display on graphs
* The setting "Display mode" modifies the choices alignment of radio choice button
from horizontally to vertically. It should also display the list of choices in
the graph in the same directions.
2022-10-25 10:42:49 +02:00
Stevani Andolo a9e12e1d84 MDL-71951 calendar: Accessbility issue fix 2022-10-25 13:07:33 +08:00
Andrew Nicols 33eaae5569 Merge branch 'MDL-76049_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2022-10-25 11:50:10 +08:00
Andrew Nicols aaedf21a31 Merge branch 'MDL-74911-311' of https://github.com/matthewhilton/moodle into MOODLE_311_STABLE 2022-10-24 22:23:14 +08:00
Sara Arjona 658c7e9ef5 Merge branch 'MDL-73030-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-10-24 15:47:31 +02:00
Jun Pataleta 7ef51203c6 Merge branch 'MDL-75936-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-24 15:57:58 +08:00
Andrew Nicols 6591971e8a MDL-75936 core_message: Drawer must be ready before firing drawer events
This commit addresses a race condition when showing the message drawer
and opening the settings page from the Message preferences page.

In that situation, the message/edit.php page calls the
message_drawer_helper.showSettings function, which publishes a request
to show the drawer.

In some conditions (notably faster machines, or after MDL-66107) this
event is fired before the message_drawer.init has listened to it.

The solution here is to delay firing of the event until the drawer
announces itself as ready.

This ensures that the event is subscribed to before it is fired.
2022-10-24 14:30:32 +08:00
Matthew Hilton 58bc68b0bc MDL-74911 assignfeedback_editpdf: unlock session when polling conversion
Polling conversions will run the document conversion immediately if the
conversion has not already been completed.

Releasing the session lock while doing this ensures large conversions
do not unnecessarily hold the users session.
2022-10-24 12:58:31 +10:00
Matthew Hilton 93c53ea726 MDL-74911 assignfeedback_editpdf: per-assignment conversion poll lock
The lock ensures that multiple conversions do not happen for the same
assignment submission.

Otherwise, subsequent conversions will fail when trying to save the
converted file.
2022-10-24 12:58:29 +10:00
AMOS bot 73eec5d12d Automatically generated installer lang files 2022-10-23 00:08:12 +00:00
Paul Holden ee36b4146f MDL-75904 admin: ignore $CFG->allowcategorythemes during installation. 2022-10-21 23:22:37 +01:00
Paul Holden 6180b175d4 MDL-76059 forms: graceful early exit for invalid button elements.
Ensure login form tries to capture guest button only if it exists.
2022-10-21 19:40:33 +01:00
Sara Arjona e083dae38e Merge branch 'MDL-72828-311' of https://github.com/davewoloszyn/moodle into MOODLE_311_STABLE 2022-10-21 16:24:54 +02:00
Ilya Tregubov 42be9c33eb weekly release 3.11.10+ 2022-10-21 15:33:52 +03:00
David Woloszyn 8ba4d8be17 MDL-72828 js: get_strings supports jquery objects 2022-10-21 15:03:10 +11:00
Tim Hunt 78910334ff MDL-76049 quiz generator: update calendar events for new overrides 2022-10-20 23:45:13 +01:00
Víctor Déniz 6af53fa8c0 Merge branch 'MDL-75907-311' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2022-10-20 10:47:02 +01:00
Jun Pataleta d0b8656cb5 Merge branch 'MDL-75497-311' of https://github.com/raortegar/moodle into MOODLE_311_STABLE 2022-10-20 17:28:58 +08:00
Jun Pataleta 9c93fbe3a4 Merge branch 'MDL-75599-311' of https://github.com/laurentdavid/moodle into MOODLE_311_STABLE 2022-10-20 17:25:55 +08:00
raortegar a97f8d6720 MDL-75497 mod_data: Review Check existence of field.class.php 2022-10-20 10:03:12 +02:00
Andrew Nicols 7ceb1466e9 Merge branch 'MDL-75834-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2022-10-20 14:38:03 +08:00
Jun Pataleta 5d0b1f0ed3 Merge branch 'MDL-59458-311' of https://github.com/laurentdavid/moodle into MOODLE_311_STABLE 2022-10-20 13:08:44 +08:00
Jun Pataleta 180bf41216 Merge branch 'MDL-75985-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-19 21:28:07 +08:00
Andrew Nicols 509578453a MDL-75985 behat: Return newline character for \n
Somehow part of this commit was lost during the push and/or squash.
2022-10-19 20:27:45 +08:00
Sara Arjona 8be7ac509a Merge branch 'MDL-76010_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-10-19 12:56:32 +02:00
Jun Pataleta fcfd012b6a Merge branch 'MDL-75645_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-10-19 15:37:05 +08:00
Jun Pataleta a778af133e Merge branch 'MDL-75985-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-19 10:55:41 +08:00
Eloy Lafuente (stronk7) 1ff07992ec MDL-75645 mnet: Stop caching OpenSSLAsymmetricKey keys
The mnet_environment->keypair array contains the following
elements (and more, just focussing on these):
- keypair_PEM : textual representation of the private key.
- certificate : textual representation of the public key.
- privatekey  : OpenSSLAsymmetricKey representation of the private key,
                generated from keypair_PEM. See get_private_key().
- publickey   : OpenSSLAsymmetricKey representation if the public key,
                generated from certificate. See get_public_key().

The last 2 elements in the array are only used as "caching", to avoid
having to call to openssl_pkey_get_private() and
openssl_pkey_get_public() to convert from the textual representation
to the OpenSSLAsymmetricKey representation that is the one required
by a number of openssl functions.

Problems arrive when, as part of the MNet protocol, the mnet_environment
is serialised, because, since PHP 8.0 those OpenSSLAsymmetricKey objects
aren't serialisable any more.

So, as far as they are only used for internal caching it's perfectly ok
to remove the caching bits and use the openssl_pkey_get_xxx() methods
to calculate them under demand.

The alternative to this would be to implement into the mnet_environment
some custom serialisation, skipping those OpenSSLAsymmetricKey
instances, using __sleep(), the Serializabla interface or __serialize(),
but that seems unnecessary because, as explained above, the uses are
really limited and easily replaceable.

That's what this patch does.
2022-10-18 14:31:03 +02:00
Eloy Lafuente (stronk7) 8cbcbc094c MDL-76010 behat: New scenario to verify that manual attempts work
This is basically the manual background that was removed in the
previous commit, with 4 attempts here. Note it includes the 2
waits that are REQUIRED to make it pass in too-quick environments.

If they are removed, they begin to fail because it seems that
the attempts need a minimum of separation between them.
2022-10-18 14:28:07 +02:00
Eloy Lafuente (stronk7) a35c9aab6d MDL-76010 behat: Move feature to use attempts generator
This moves away from manual attempts and uses the activity
attempts generator instead. Quicker and not exposed to the
problems with clicks, refreshes and missing attempts.

Note that there is a small change in the attempt generator
so, now, when a new attempt is created, if the activity has
tracking enabled, the final result / grades are recalculated.

That's the real behaviour when the activity settings are
changes in the edition form and it's natural to get them
recalculated without having to visit the form. Specifically,
this allows the 1st scenario to pass, because in that scenario
no changes to the form are being performed.

Also, little detail, amend a dupe scenario name.
2022-10-18 14:28:07 +02:00
Sara Arjona bef4181788 weekly release 3.11.10+ 2022-10-18 13:09:58 +02:00
Laurent David abcbc42139 MDL-75599 mod_data: Fix warning message
* Fix warning message when accessing advanced search page with a date field.
2022-10-18 07:56:14 +02:00
Jun Pataleta f65577ef3a Merge branch 'MDL-75783-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-18 10:06:51 +08:00
Andrew Nicols fdc7349577 MDL-75783 javascript: Add optional jsconfig configuration
This commit adds a new Grunt task which generates a jsconfig.json file.

This file is described at
https://code.visualstudio.com/docs/languages/jsconfig and can be used
to configure vscode and other similar editors to understand our module
loading.

This task is an optional task for Grunt and can be run with:

    npx grunt jsconfig

The file is git-ignored and will not affect normal usage.
2022-10-18 09:33:04 +08:00
Víctor Déniz 0ee24af3cd Merge branch 'MDL-75983_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-10-18 01:09:04 +01:00
Sara Arjona 815419ad12 Merge branch 'MDL-72836-311' of https://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2022-10-17 16:40:00 +02:00
Sara Arjona b92f5e00aa Merge branch 'MDL-74814-311-1' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-10-17 15:30:59 +02:00
Huong Nguyen 54263aa1f6 MDL-74814 forms: Fix accessibility issue in edit profile page
- Fixed legend tag issue
 - Modified the passwordunmask Javascript hide/unhide the password field by CSS class
2022-10-17 15:52:20 +07:00
Andrew Nicols 100fad08fe MDL-75969 behat: Allow the editor field to request a save
Some editors do not immediately store their content to the textarea they
represent and only do so when the form is submitted or they are
requested to.

This change adds to the existing API to allow an (optional)
`store_current_value` function to be defined for the editor type so that
it can use the JavaScript API to persist any current content to the
editor.
2022-10-14 23:46:25 +08:00
Andrew Nicols 14f87ce4b5 MDL-75985 behat: Standardise HTML output when comparing editor content
This commit adds a standardise_html function and updates the matches
function to compare normalised content.

This allows for a wider variety of valid editor output to be handled
using the standard value matching steps in Behat, thus supporting
editors other than Atto better.
2022-10-14 23:44:11 +08:00
Eloy Lafuente (stronk7) b4b650f9cd MDL-75983 gha: Update used actions to be node16 compatible
Node12 is being deprecated in github for actions:

https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

So we need to ensure we are using node16 actions.
2022-10-14 13:28:25 +02:00
Sara Arjona efc6d19ac2 weekly release 3.11.10+ 2022-10-14 12:49:22 +02:00
Sara Arjona a887e577a4 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-10-14 12:49:20 +02:00
AMOS bot 5b9f243378 Automatically generated installer lang files 2022-10-14 00:07:33 +00:00
Jun Pataleta 1900cadd4f Merge branch 'MDL-74887-MOODLE_311_STABLE' of https://github.com/sh-csg/moodle into MOODLE_311_STABLE 2022-10-14 00:30:55 +08:00
Sara Arjona f55fd1b49c Merge branch 'MDL-75959-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-13 16:03:41 +02:00
Ilya Tregubov 575358c0f0 Merge branch 'MDL-75970-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-10-13 14:09:06 +03:00
Stefan Hanauska 83a1703746 MDL-74887 mod_label: Update visibility 2022-10-13 12:47:31 +02:00
Paul Holden 5c74434dfa MDL-75970 tool_customlang: clarify CLI export target/filename. 2022-10-12 10:32:30 +01:00
Jun Pataleta 72e2a0dfb5 Merge branch 'MDL-75887-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-12 09:23:13 +08:00
Simey Lameze 8c30413ba8 MDL-75887 behat: Add ability to set value regardless of the editor
Prior to this commit, the behat_form_editor integration was hard-coded
to use Atto.

This change allows other editors to be used to set editor values, and
breaks that hard bond. Following this change, any editor is able to
define a behat_editor_[name].php file defining a function which meets
the following signature:

  set_editor_value(string $editorid, string $value): void

Each editor is responsible for checking whether its own API is available
and calling any relevant functions to force the editor to set the
content.

Please note: Behat is unable to determine the current editor in use on
the page automatically.
2022-10-12 06:44:30 +08:00
Andrew Nicols ce2a901414 MDL-75959 customfield: Correct inappropriate class import
I suspect this was an incorrect tab completion import by an IDE which
was missed.
2022-10-12 06:40:18 +08:00
Jun Pataleta 811fc31904 weekly release 3.11.10+ 2022-10-11 23:16:41 +08:00
Jun Pataleta 25efc9e7aa Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-10-11 23:16:39 +08:00
AMOS bot c29ba27942 Automatically generated installer lang files 2022-10-11 00:07:30 +00:00
sam marshall 125065e488 MDL-75834 lib: Focus lock JS bug when focus area removed 2022-10-10 16:41:49 +01:00
Sara Arjona 613ba34b07 Merge branch 'MDL-75656-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-10-10 16:16:32 +02:00
Jun Pataleta 975ef5c540 Merge branch 'MDL-75909-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-10 18:08:04 +08:00
Jun Pataleta 1db7e78c8b Merge branch 'MDL-75922-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-10 14:55:17 +08:00
Jun Pataleta 37fa9f51e9 Merge branch 'MDL-75910-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-10 11:06:55 +08:00
Simey Lameze 4eed9bd261 MDL-75922 behat: Apply @editor_atto tag to tests requiring Atto
These steps are currently using Atto-specific UI features and must
therefore make use of the @editor_atto tag to ensure that they continue
to run using Atto.

A new issue will be raised to migrate each of these to be
editor-agnostic.
2022-10-09 20:27:05 +08:00
Andrew Nicols ec6c3cd9a0 Merge branch 'MDL-61395-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-10-09 13:13:39 +08:00
Stefan Hanauska 133b7b700d MDL-74887 course: Hide stealth mode without view page 2022-10-08 08:09:34 +02:00
AMOS bot c269c67830 Automatically generated installer lang files 2022-10-08 00:07:29 +00:00
Michael Hawkins 8d09620c14 MDL-72836 core: Updated security.txt expiry and policy URL 2022-10-07 14:12:14 +08:00
Mikhail Golenkov 94327ba15f MDL-75907 core: Add index on temp table to optimise stats cron 2022-10-07 16:16:44 +11:00
Andrew Nicols 8e1353f39d weekly release 3.11.10+ 2022-10-07 13:04:02 +08:00
Andrew Nicols 342c6367d0 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-10-07 13:04:00 +08:00
AMOS bot fe6c455b51 Automatically generated installer lang files 2022-10-07 00:07:35 +00:00
Simey Lameze 777025b298 MDL-75910 core_form: Allow editor field to set a hidden label
When an editor is used in a form as part of a group, it is missing its
label element.

This happens because there is no inline template for the editor, and
therefore it reverts to using the old `toHtml` function. The legacy
function does not cater to the editor being in a group, and therefore
does not add the hidden label.

In addition, the hiddenLabel attribute was missing from the editor
element. This is a semi-standard element but must be added to each
supporting element.

Both the missing inline template for the editor, and the hidden label
attribute must be present:
- If the hidden label attribute is not present, then the standard inline
  template will add a visible label within the group.
- If the inline editor template is missing, then the label is not shown
  at all.
2022-10-06 22:54:12 +08:00
Andrew Nicols 1545abb21d MDL-75909 mod_data: Make template editor use html editor
When the template editor is configured to use the HTML Editor, it should
indicate this to Behat by setting the `data-fieldtype` to "editor".

This indicates to the behat field manager that the editor is in use,
which ensures that the correct value setting can take place.

This is important in the context of MDL-75887.
2022-10-06 21:49:01 +08:00
Andrew Nicols d70b73345c MDL-71686 core_form: Rebuild amd util module 2022-10-06 16:13:17 +08:00
Andrew Nicols fbc97ebdcd MDL-71686 core_form: Include missing build 2022-10-06 14:44:35 +08:00
Andrew Nicols 95b4682d3c MDL-71686 core_form: Move form serializer to shared function 2022-10-06 10:22:46 +08:00
Andrew Nicols 27f7c54d58 Merge branch 'MDL-71686-311' of https://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2022-10-06 10:21:34 +08:00
Shamim Rezaie 459da610c6 Merge branch 'MDL-75886-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-10-06 12:24:45 +11:00
Thorsten Siegmund Bartel 930a0d2944 MDL-74606 mod_assign: Support multilanguage strings in group names. 2022-10-05 12:56:16 +02:00
Andrew Nicols e881dee5b4 MDL-75886 atto: Always use Atto for @atto tests
This change, which should be easy to mimic for other editors.

This will ensure that the correct editor is used for tests relating to
that editor, or its subplugins.
2022-10-05 09:57:19 +08:00
Jun Pataleta f525194ea2 Merge branch 'MDL-66955-m311' of https://github.com/NeillM/moodle into MOODLE_311_STABLE 2022-10-04 16:36:25 +08:00
AMOS bot d18f60bd3f Automatically generated installer lang files 2022-10-04 00:07:33 +00:00
Frederik Milling Pytlick 01643574c5 MDL-75876 core_calendar: Add raise_memory_limit call to export_execute
Added a call to raise_memory_limit in /calendar/export_execute.php as it can be very memory intensive.
2022-10-03 12:47:57 +02:00
Paul Holden 0268bbd07b MDL-73030 backup: case-insensitive detection of Moodle backups. 2022-10-03 09:32:05 +01:00
Andrew Nicols 4f5d221749 Merge branch 'MDL-75836_311' of https://github.com/jrchamp/moodle into MOODLE_311_STABLE 2022-10-02 21:44:40 +08:00
Andrew Nicols 8ca4a0087d MDL-75614 dml: Unit tests must test something 2022-09-30 16:38:27 +08:00
Andrew Nicols 357ab40ff4 Merge branch 'MDL-75614-debugsqltrace-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2022-09-30 16:38:24 +08:00
Neill Magill a0518068fb MDL-66955 messages: Improve speed of message search
The OR conditions in the WHERE clause prevented the query from
effectively filtering the messages related to the user quickly, this
change helps gets around this by allowing the database to limit
the rows in the messages table it needs to scan significantly.
2022-09-30 08:31:11 +01:00
Mihail Geshoski 5ef68db33a MDL-68437 forum: Support to show only active course users in grader
The following change adds support to show only active course users
in the forum grader and generally replicates the behaviour from the
assignment grader which relies on certain config settings, user
permissions and capabilities.
2022-09-30 12:18:46 +08:00
Mihail Geshoski 2914d47171 MDL-68437 course: ws support to optionally fetch only active users
Modifies the 'core_course_get_enrolled_users_by_cmid' webservice and
the generic js methods that call this webservice and enables defining
whether the ws should only return the active users or all enrolled
users in the course.
2022-09-30 12:12:28 +08:00
Jake Dallimore e79b14e2a9 weekly release 3.11.10+ 2022-09-30 10:17:39 +08:00
Andrew Nicols b97ed6d75a Merge branch 'MDL-74922_MOODLE_311_STABLE_fix_storage_wrapper_validate_cache' of https://github.com/gthomas2/moodle into MOODLE_311_STABLE 2022-09-29 12:06:45 +08:00
Jun Pataleta f4d830d7e4 Merge branch 'MDL-75782-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-09-29 11:53:57 +08:00
Jun Pataleta 2974880afe Merge branch 'MDL-75559-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-09-29 10:53:59 +08:00
Jun Pataleta 4ed21af7df Merge branch 'MDL-66902_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-09-28 23:15:26 +08:00
Jun Pataleta e1d80935a3 Merge branch 'MDL-75827-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-09-28 20:35:58 +08:00
Jake Dallimore f40424cd25 Merge branch '31_mdl75668' of https://github.com/danmarsden/moodle into MOODLE_311_STABLE 2022-09-28 16:36:36 +08:00
Jun Pataleta 47f85d5da1 Merge branch 'MDL-72490-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2022-09-28 11:55:08 +08:00
Jun Pataleta ac0444bff4 Merge branch 'MDL-66273-MOODLE-311-v2' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2022-09-28 09:45:35 +08:00
Jun Pataleta bb7955546c Merge branch 'MDL-75726_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-09-28 08:12:14 +08:00
Jun Pataleta 0fd522dd1f Merge branch 'MDL-75776_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-09-28 08:06:39 +08:00
Jonathan Champ a09f258f70 MDL-75836 activities: preserve moodleform validation errors 2022-09-27 14:24:36 -04:00
Andrew Nicols b193122b29 Merge branch 'MDL-75168-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-09-27 23:42:42 +08:00
Paul Holden 10d39a1feb MDL-75168 tag: cleanup module tag instances upon course deletion. 2022-09-27 14:11:32 +01:00
Jun Pataleta d51a14792b Merge branch 'MDL-75800-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-09-27 20:19:54 +08:00
Andrew Nicols 074307ebba Merge branch 'MDL-27570_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2022-09-27 17:02:24 +08:00
Jun Pataleta aeacebf383 Merge branch 'MDL-71531-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-09-27 16:29:01 +08:00
Andrew Nicols 51c22d1e3f MDL-75744 qtype_gapselect: Remove unnecessary javascript tag 2022-09-27 12:45:25 +08:00
Andrew Nicols e5bf98ab9d Merge branch 'MDL-75744-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2022-09-27 12:38:23 +08:00
Paul Holden 1b1758caa2 MDL-75827 theme_boost: append table elements to popover whitelist.
This allows for their use within popover tooltips, such as those
used for showing help icon dialogues.
2022-09-26 16:06:42 +01:00
Eloy Lafuente (stronk7) a71341c693 MDL-66902 tests: Fix all incorrect namespaces
This issue just goes over all the currently incorrect
namespaces in test cases and:

1. Change the namespace to the correct one.
2. Move/rename it to correct location if needed (level 2 and down).
3. Remove not needed MOODLE_INTERNAL check when possible.
4. Remove file phpdoc when the file only has one class.
5. Make small adjustments in case the change of namespace requires it.
2022-09-26 14:34:30 +02:00
Hien Dinh b21541294a MDL-72490 availability: Show error if conflict in date restriction 2022-09-26 11:19:39 +01:00
Paul Holden 806a667b3a MDL-61395 forms: style frozen tag element values. 2022-09-26 11:16:13 +01:00
Paul Holden 7311810970 MDL-75656 tag: decode entities in tags element values. 2022-09-26 10:56:37 +01:00
Eloy Lafuente (stronk7) c8773b698a MDL-75726 ci: Bump GHA to Ubuntu 22.04
Have tried to also bump Travis to 22.04 (jammy) but it
was not working ok, with problems trying to find both
PHP and PostgreSQL versions.

Surely that's because 22.04 support is really new (Sep 9, 2022):

https://blog.travis-ci.com/22-9-9-ubuntujammy

So we'll have to wait a little more before being able to, also,
bump Travis to use 22.04
2022-09-22 17:45:16 +02:00
Eloy Lafuente (stronk7) e446e2b6a9 MDL-75776 composer: minor updates
In stables, just minors updates to components.

Generated using the instructions @ https://docs.moodle.org/dev/Composer
and using PHP 7.3 (always the min version supported) to generate the
lock file.
2022-09-22 17:44:45 +02:00
Eloy Lafuente (stronk7) 6a6344e268 weekly release 3.11.10+ 2022-09-22 17:05:51 +02:00
Tim Hunt bcdee74ae9 MDL-27570 quiz timing: add unit test and simplify top of process_attempt 2022-09-22 11:12:45 +01:00
Philipp Imhof dacd86c23c MDL-27570 quiz: check if time is really up 2022-09-21 11:39:14 +01:00
Paul Holden bb6c03a252 MDL-75800 enrol: correct instance deleted event name. 2022-09-20 14:09:40 +01:00
Jun Pataleta b37a074180 Merge branch 'MDL-75777_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-09-20 15:11:59 +08:00
Eloy Lafuente (stronk7) 64e570d0ab MDL-75777 phpunit: Move tests to use correct names and ns (take#6)
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.
2022-09-19 11:03:36 +02:00
Jun Pataleta 0a4af5f771 Merge branch 'MDL-75757_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-09-19 13:01:50 +08:00
Andrew Nicols d288aea421 MDL-75782 mod_quiz: Make TinyMCE autosave less fragile
This commit amends the quiz autosave feature to not assume the
components of the Tiny API as much, and add support for newer versions
of TinyMCE.
2022-09-19 12:56:55 +08:00
Eloy Lafuente (stronk7) a9edf3962a MDL-75757 phpunit: Add some tolerance to a few failing assertions
Recently, PHPUnit (all versions) did some changes about how the
comparators worked and this has caused some float comparisons
to stop working.

We need to move them to assertEqualsWithDelta(), allowing a small
tolerance to workaround the floats comparison problem.

0.00001 has been decided. And applied to all the similar assertions
within the unittest function, so if more cases are added to them
better be copied with the agreed tolerance.
2022-09-18 15:57:36 +02:00
Sara Arjona 6087c2a835 Merge branch 'MDL-75108-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2022-09-16 11:23:29 +02:00
Sara Arjona 6fd68977ac weekly release 3.11.10+ 2022-09-15 16:11:55 +02:00
Sara Arjona 94f6eefb86 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-09-15 16:11:53 +02:00
hieuvu d03da85cef MDL-75744 gapselect: remove empty choices option. 2022-09-15 15:46:16 +07:00
Andrew Nicols 3e789e5d6d MDL-71531 cachestore_file: Stop locking cache files to read
The cache file is only ever written to in the `write_file` function,
where it does so by writing to a temp file and performing an atomic
rename of that file. When writing, the target file is never locked.

The cache file is only ever read in the `get` function, and there is no
need for an exclusive lock in that situation.

There is therefore no need to obtain any lock, shared or exclusive, to
read the cache file. Doing so only affects performance of the file sytem
as file locks must be needlessly obtained and written to disk for a read
operation which does not benefit from them.
2022-09-15 10:14:51 +08:00
Jun Pataleta b16eb4c432 Merge branch 'MDL-75716_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-09-15 09:55:38 +08:00
Marina Glancy f533978709 MDL-71686 forms: allow arrays in dynamic forms args 2022-09-14 18:00:05 +02:00
Sara Arjona 53846820df Merge branch 'MDL-74010-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-09-14 11:41:53 +02:00
Eloy Lafuente (stronk7) 65c8839157 MDL-75716 phpunit: Move tests to use correct names and ns (take#5)
Applied the following changes to various testcase classes:

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

Special mention to:

- In lib/tests/blocklib_test.php 2 helper classes have been
  moved to tests/fixtures, because they needed to be namespace-free.
2022-09-12 23:34:59 +02:00
Sara Arjona 0561f8c5b5 Merge branch 'MDL-75051_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2022-09-12 12:30:38 +02:00
Mikhail Golenkov 8684cd6a76 MDL-66273 qtype_random: Fix question deletion during course restore 2022-09-12 16:43:37 +10:00
Andrew Nicols fa10357f57 MDL-75559 behat: Sort behat_hooks to top of context list 2022-09-12 12:33:40 +08:00
AMOS bot d463e0d8f6 Automatically generated installer lang files 2022-09-11 00:07:54 +00:00
Eloy Lafuente (stronk7) 54b614ca7e Moodle release 3.11.10 2022-09-10 12:16:05 +02:00
Mahmoud Kassaei 9f7d92de62 MDL-75051 Questions: Selecting idnumber in the question bank,
the copy/pasting, includes extraneous text in Chrome
2022-09-09 10:39:22 +01:00
Jun Pataleta 4125c3c470 weekly release 3.11.9+ 2022-09-09 08:36:51 +08:00
Jun Pataleta 258cdfaa6a Merge branch 'MDL-74866-311-behat' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-09-08 11:29:43 +08:00
Huong Nguyen 8c2792cb5d MDL-74866 core_calendar: Fix Behat failures 2022-09-08 09:49:40 +07:00
Michael Hawkins 25d4bc7ffc MDL-68066 output: Apply disable lambda rendering to Mustache renderer 2022-09-07 23:56:51 +08:00
Lars Bonczek d98b39a597 MDL-68066 output: Mustache - Add option to disable lambda rendering
This commit is based on an outstanding pull request to the Mustache repo
2022-09-07 23:56:51 +08:00
Paul Holden 191badf5ad MDL-72012 mod_h5pactivity: respect user access when getting report. 2022-09-07 22:10:56 +08:00
Jun Pataleta c4ba598a0b MDL-75283 core: Fetch proper column mapping for sort
Calling \core_user\fields::get_sql() incerements a static uniqueid
variable. This should be called only once and not make a separate call
for the sort mapping data as it doing so will result to an incorrect
table alias for the sort mapping data.
2022-09-07 17:16:03 +04:00
Sara Arjona f77ea5bffa Merge branch 'MDL-74866-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-09-07 13:10:24 +02:00
stevando 3d11b25cce MDL-75283 admin: Update admin user fetching to use sort helper 2022-09-07 13:18:43 +08:00
Jun Pataleta 8a55673463 Merge branch 'MDL-75553-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-09-07 12:58:54 +08:00
Jun Pataleta 230f7a2d1b MDL-75553 mod_data: Fix wording of data fields in Behat tests 2022-09-07 12:55:50 +08:00
Huong Nguyen 87344d03e1 MDL-74866 bennu: Fix parameter parsing
Some parameter values are wrapped by DQUOTE character.
We need to go through and get the actual value inside the quoted string.
2022-09-07 11:16:01 +07:00
Dan Marsden e237e83dfb MDL-75668 backup: Save context mapping of duplicate blocks. 2022-09-07 12:40:47 +12:00
David Mudrák aa392ce73a MDL-75553 lang: Fix Behat regressions in scenario files 2022-09-06 21:49:32 +02:00
Paul Holden 6220f712ab MDL-75405 block_html: safer unserialize during old block conversion. 2022-09-06 17:54:17 +02:00
Jun Pataleta 714b88a1b8 Merge branch 'MDL-75231-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-09-06 23:49:08 +08:00
Sara Arjona bbadf7a02c Merge branch 'MDL-75548_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2022-09-05 13:09:57 +02:00
Ilya Tregubov 57b97b29b7 Merge branch 'MDL-60666-311' of https://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2022-09-05 14:38:41 +04:00
Peter Sistrom 6fe4eb2a86 MDL-60666 auth_ldap: One transaction per user 2022-09-05 14:35:26 +04:00
Sara Arjona 8a0274423d Merge branch 'MDL-75550-311' of https://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2022-09-05 08:57:37 +02:00
Jun Pataleta ddd80a5d2c Merge branch 'MDL-75641_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-09-05 14:37:09 +08:00
Helen Foster 50bf83fede MDL-75553 lang: Import fixed English strings (en_fix) 2022-09-04 21:07:38 +02:00
Eloy Lafuente (stronk7) cafbfc6076 MDL-75641 core_lang: Add string for new Europe/Kyiv timezone
With IANA TZDB (timezone database) release 2022b, Europe/Kiev
has been renamed to Europe/Kyiv. So we need to add this string
to our list to keep tests passing.

Note that the old Europe/Kiev continues working (is an alias) and,
also, there are places in core where we are using it. Just we cannot
remove/replace those uses in core until we ensure that everybody is
using PHP 8.0.23 (TZDB 2022b) or more recent versions. Hence,
not changing those uses now.
2022-09-04 10:11:20 +02:00
Ilya Tregubov 2b22716dc2 weekly release 3.11.9+ 2022-09-02 08:49:20 +04:00
Brendan Heywood 3498aeaf1e MDL-75614 dml: Fixed debugsqltrace with anon classes bug 2022-09-02 11:42:22 +10:00
Jun Pataleta c59d4f9612 Merge branch 'MDL-75111_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-08-31 23:04:15 +08:00
Jun Pataleta e3ce532831 Merge branch 'MDL-75019-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2022-08-31 20:24:56 +08:00
Ilya Tregubov 87e0d39e19 Merge branch 'MDL-74861-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2022-08-31 11:52:30 +04:00
Michael Hawkins 90aceb5e6c MDL-75550 lib: Update Mustache const to reflect correct version
Mustache version 2.14.1 is already included, but the VERSION const
incorrectly listed 2.14.0 in the tagged Mustache release. A later
upstream commit corrected this in the library, which this now matches.
2022-08-31 15:29:52 +08:00
Sara Arjona 7d1996fb3a Merge branch 'MDL-68717-311' of https://github.com/laurentdavid/moodle into MOODLE_311_STABLE 2022-08-30 16:05:11 +02:00
Víctor Déniz cb9583c21c Merge branch 'MDL-75360-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-08-30 11:43:33 +01:00
Jun Pataleta 633c6d7e80 MDL-70480 mod_assign: Apply proper upgrade savepoint version 2022-08-30 17:18:38 +08:00
Jun Pataleta 76ed3885a9 MDL-70480 mod_assign: Bump version.php properly 2022-08-30 17:04:17 +08:00
Víctor Déniz f4456f6afe Merge branch 'MDL-70480-311' of https://github.com/chanqihui/moodle into MOODLE_311_STABLE 2022-08-30 09:17:00 +01:00
Ilya Tregubov 21384101e1 Merge branch 'MDL-71662-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-08-30 08:00:37 +04:00
Eloy Lafuente (stronk7) 61cedbd56e MDL-75111 phpunit: Move tests to use correct names and ns (take#4)
Applied the following changes to various testcase classes:

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

Special mention to:

- The following task tests have been moved within the level2 directory:
  - \core\adhoc_task_test => \core\task\adhoc_task_test
  - \core\scheduled_task_test => \core\task\scheduled_task_test
  - \core\calendar_cron_task_test => \core\task\calendar_cron_task_test
  - \core\h5p_get_content_types_task_test => \core\task\h5p_get_content_types_task_test
  - \core\task_database_logger_test => \core\task\database_logger_test
  - \core\task_logging_test => \core\task\logging_test

- The following event tests have been moved within level2 directory:
  - \core\event_context_locked_test => \core\event\context_locked_test
  - \core\event_deprecated_test => \core\event\deprecated_test
  - \core\event_grade_deleted_test => \core\event\grade_deleted_test
  - \core\event_profile_field_test => \core\event\profile_field_test
  - \core\event_unknown_logged_test => \core\event\unknown_logged_test
  - \core\event_user_graded_test => \core\event\user_graded_test
  - \core\event_user_password_updated_test => \core\event\user_password_updated_test

- The following output tests have been moved within level2 directory:
  - \core\mustache_template_finder_test => \core\output\mustache_template_finder_test
  - \core\mustache_template_source_loader_test => \core\output\mustache_template_source_loader_test
  - \core\output_mustache_helper_collection_test => \core\output\mustache_helper_collection_test

- The following tests have been moved to their correct tests directories:
  - lib/tests/time_splittings_test.php => analytics/tests/time_splittings_test.php

- All the classes and tests under lib/filebrowser and lib/filestorage
  belong to core, not to core_files. Some day we should move
  them to their correct subsystem.
- All the classes and tests under lib/grade belong to core, not
  to core_grades. Some day we should move them to their correct
  subsystem.
- The core_grades_external class and its \core\grades_external_test
  unit test should belong to the grades subsystem or, alternatively,
  to \core\external, they both should be moved together.
- The core_grading_external class and its \core\grading_external_test
  unit test should belong to the grading subsystem or, alternatively,
  to \core\external, they both should be moved together.
- The \core\message\message and \core\message\inbound (may be others)
  classes, and their associated tests should go to the core_message
  subsystem.
- The core_user class, and its associated tests should go to the
  core_user subsystem.
- The \core\update namespace is plain wrong (update is not valid API)
  and needs action 1) create it or 2) move elsewhere.
2022-08-26 16:34:28 +02:00
Shamim Rezaie 376e57d267 weekly release 3.11.9+ 2022-08-26 21:07:42 +10:00
Tim Hunt 9de11ea641 MDL-75548 misc: final Required parameter follows optional notices 2022-08-22 15:19:55 +01:00
Simey Lameze d793ac8e5e MDL-75231 files: make bucket calculations more precise
This commit changes changes the unit test calculations to
keep track of the time the bucket starts/finishes bursting
and use milliseconds instead of seconds to have a precise
time to sleep.
2022-08-22 14:11:39 +08:00
Sara Arjona 3828f4b484 Moodle release 3.11.9 2022-08-19 09:50:31 +02:00
Mikhail Golenkov e5e8bc4b22 MDL-75448 assignfeedback_editpdf: Fix conversion for rotated images 2022-08-19 15:35:34 +10:00
Mikhail Golenkov 911fafd9a9 MDL-75448 stored_file: Cover rotate_image() method with unit tests 2022-08-19 15:35:34 +10:00
Sara Arjona 4c5288b32c weekly release 3.11.8+ 2022-08-18 14:54:20 +02:00
Laurent David 284b201a28 MDL-75210 mod_quiz: fix sequential quiz access
* As a student I should only be able to access the next question or the current question
* The API should not show more than the current question
* Once the quiz is previewed we can see the question in any order (existing behaviour)
* Related to ticket MDL-71728

Co-authored-by: Rajneel Totaram <rjnlfj@yahoo.com>
Co-authored-by: Tim Hunt <t.j.hunt@open.ac.uk>
2022-08-18 08:08:25 +04:00
Andrew Nicols 31c078e183 Merge branch 'MDL-75029-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-08-18 11:19:17 +08:00
Shamim Rezaie 6b8961b7ae Merge branch 'MDL-75386-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-08-17 13:29:53 +10:00
Shamim Rezaie 7ef79076fe Merge branch 'MDL-73876-311' of https://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2022-08-17 02:32:46 +10:00
Sara Arjona 1bf4ac0c11 Merge branch 'MDL-72178-311' of https://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2022-08-16 16:58:43 +02:00
Laurent David 739b551fa8 MDL-59458 mod_data: Fix sorting data query
* When activating sorting on a different field than the original field
the list of records is empty
2022-08-15 17:14:33 +02:00
Mark Johnson 2c4cc3caf6 MDL-75388 lib: Update mustache to 2.14.1
MDL-67114 and MDL-73586 local changes removed as they are now available
upstream.
2022-08-12 04:14:19 +02:00
Petr Skoda 3fd34dd999 MDL-75237 core: improve PARAM_SAFEPATH docs 2022-08-12 04:14:19 +02:00
Petr Skoda 4dcb3b244c MDL-75237 qformat_blackboard_six: sanitise blackboard import file paths 2022-08-12 04:14:19 +02:00
Petr Skoda 6272227934 MDL-75237 core: Revert MDL-72029
This reverts commit edc7eb06b7.
2022-08-12 04:14:19 +02:00
Petr Skoda 36e0a49c00 MDL-75237 qformat_blackboard_six: Revert MDL-72029
This reverts commit 46ee4f4062.
2022-08-12 04:14:19 +02:00
Paul Holden 1ee3d6323c MDL-75326 h5p: require sesskey to toggle library enabled state. 2022-08-12 04:14:19 +02:00
Shamim Rezaie 4ed613fbc2 weekly release 3.11.8+ 2022-08-12 11:52:57 +10:00
Noel De Martin 123fc91eea MDL-72178 feedback: Implement behat generators
Based on Andrew's WIP from https://github.com/andrewnicols/moodle/commit/b3d40cb20d1f0edf0bf21077c8f94bce5dec56db

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2022-08-11 10:54:40 +02:00
Jun Pataleta 83c9f41a47 Merge branch 'MDL-75375-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-08-10 00:25:41 +08:00
Brendan Heywood 3bec78df9b MDL-75375 cache: Fix file store path cleaning 2022-08-09 23:54:02 +08:00
Jun Pataleta 6793732790 Merge branch 'MDL-74636_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2022-08-09 11:10:58 +08:00
Laurent David a9ce394b63 MDL-68717 core_calendar: Hide completed event
* "expectcompletionon" type of event should be hidden if the related
activity is completed
2022-08-08 07:18:26 +02:00
Angelia Dela Cruz a8c9e82653 MDL-74861 behat: H5P behat generators use UI
Replace steps that manually add H5Pactivity instances via the UI
and use Behat generators. This improves the speed of the Behat test
runs.

Co-authored-by: Simey Lameze <simey@moodle.com>
2022-08-08 12:18:28 +08:00
Jun Pataleta 9ceb538216 Merge branch 'MDL-74211-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-08-08 11:15:03 +08:00
Paul Holden f8351de05e MDL-74010 core: check defined MDL_PERF* values in conditionals. 2022-08-05 11:03:09 +01:00
Ilya Tregubov 5073d3542b Merge branch 'MDL-74475-311' of https://github.com/aanabit/moodle into MOODLE_311_STABLE 2022-08-05 12:27:21 +04:00
Angelia Dela Cruz 34f352ded2 MDL-75019 behat: Folder behat generators use UI
Replace steps that manually add Folder instances via the UI and
use Behat generators. This improves the speed of the Behat test
runs.
2022-08-05 15:41:57 +08:00
Andrew Nicols 1125231af0 MDL-75386 theme: Include CSS from editor subplugins in editor style
Editor stylesheets are kept separately to standard plugin stylesheets so
that they can be provided to style individual iframes where loading the
standard Moodle stylesheets would be incorrect.

Unfortunately the editor stylesheet system does not consider that
subplugins may want to add small individual styling to the editor but
this is required in some situations.
2022-08-05 14:18:49 +08:00
Ilya Tregubov 8a147fee4b weekly release 3.11.8+ 2022-08-05 08:29:20 +04:00
Andrew Lyons 1d4a1bc258 MDL-73876 behat: Show exceptions stack trace 2022-08-04 16:51:37 +04:00
Paul Holden 4119bd99a9 MDL-75029 block_news_items: indicate posts made by deleted users. 2022-08-04 09:43:09 +01:00
Qihui Chan a287546036 MDL-70480 mod_assign: fix user and group submission and update database 2022-08-04 18:03:42 +10:00
Jun Pataleta 6102f8553a Merge branch 'MDL-74895-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-08-04 11:35:30 +08:00
Jun Pataleta 982dda9417 Merge branch 'MDL-69251-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2022-08-04 11:16:03 +08:00
Andrew Nicols e5744719c9 Merge branch 'MDL-56923-311' of https://github.com/rezaies/moodle into MOODLE_311_STABLE 2022-08-04 11:13:11 +08:00
Andrew Nicols 1b513e8c42 Merge branch 'MDL-74502-311' of https://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2022-08-04 11:09:15 +08:00
Jake Dallimore 1aa9a5b11f Merge branch 'MDL-74766-311' of https://github.com/JBThong/moodle into MOODLE_311_STABLE 2022-08-04 11:03:28 +08:00
Andrew Nicols a313e53b54 Merge branch 'MDL-75080-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2022-08-04 10:45:06 +08:00
Simey Lameze 983a79347b MDL-74211 behat: convert few more steps to use new data generators 2022-08-04 10:38:39 +08:00
Andrew Nicols f6a3cbe339 Merge branch 'MDL-74655-311' of https://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2022-08-04 10:09:08 +08:00
Andrew Nicols cccef66f0c MDL-74492 editor_atto: Comment the regex change 2022-08-04 10:05:21 +08:00
Andrew Nicols ad58a4c3c3 Merge branch 'MDL-74492__MOODLE_311_STABLE' of https://github.com/PhilippImhof/moodle into MOODLE_311_STABLE 2022-08-04 10:05:17 +08:00
Paul Holden 2eb859a839 MDL-71662 mod_h5pactivity: add group filter to attempts report. 2022-08-03 15:30:36 +01:00
Jun Pataleta 3583300da5 Merge branch 'MDL-62959-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2022-08-03 16:50:35 +08:00
Noel De Martin 2d9ee56211 MDL-74655 competency: Implement behat generators 2022-08-03 10:49:14 +02:00
Amaia Anabitarte 5ba22c14a1 MDL-74475 core_badges: Behat test using new step 2022-08-03 10:29:39 +02:00
Amaia Anabitarte b3fab1d80e MDL-74475 behat: Option to jump to course edit page 2022-08-03 10:29:39 +02:00
Andrew Nicols d5cd3c95b0 Merge branch 'MDL-72430-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-08-03 12:50:03 +08:00
Paul Holden 0448a7b267 MDL-75360 user: relax initial parameter types of external method.
Defer cleaning of supplied text to inside the method, so we don't
throw confusing exceptions if a user enters "unsafe" characters in
the form input.
2022-08-02 21:04:40 +01:00
Jun Pataleta 7b841a0f39 Merge branch 'MDL-74947-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2022-08-02 09:59:19 +08:00
Tim Hunt 25519bc4d8 MDL-74636 behat: step to skip this scenario if a plugin isn't installed 2022-07-29 09:51:11 +01:00
Jun Pataleta 5f6923adf1 Merge branch 'MDL-75244-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-07-29 15:28:55 +08:00
Philipp Imhof a08fcb8d13 MDL-74492 editor_atto: <line> tags should not be confused with <li> tags 2022-07-29 08:36:38 +02:00
Simey Lameze 9fbbdc8a0a MDL-74211 behat: replace steps to use new categories page type 2022-07-29 13:07:55 +08:00
Simey Lameze 56781dec40 MDL-74211 behat: add course question categories page type 2022-07-29 13:07:55 +08:00
Simey Lameze 15b31bfb39 MDL-74211 quiz: make use of question data generators 2022-07-29 13:07:55 +08:00
Andrew Nicols fc65a2e4a2 Merge branch 'MDL-72349_M311_update_strip_double_headers_function' of https://github.com/christina-roperto/moodle into MOODLE_311_STABLE 2022-07-29 12:12:27 +08:00
Jun Pataleta 3436523f17 weekly release 3.11.8+ 2022-07-29 10:56:47 +08:00
Angelia Dela Cruz 8062e43941 MDL-75080 behat: Chat behat generators use UI
Replace steps that manually add Chat instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2022-07-29 10:56:09 +08:00
Andrew Nicols a28e929a74 MDL-75244 form: Change checker should check existence of tinyMCE API
The window.tinyMCE.editors API was present in version 3 of TinyMCE, but
is not present in later versions. As a result, this check tries to loop
over a variable which does not exist and throws an error in the process.

We should check that window.tinyMCE *and* window.tinyMCE.editors both
exist before attempting to loop over them.
2022-07-28 16:09:21 +08:00
Simey Lameze 838f1bfa7b MDL-62959 calendar: add behat to test event type changing 2022-07-27 15:31:10 +08:00
Simey Lameze 88a18df37f MDL-62959 calendar: fix event data mapping for group id 2022-07-27 11:48:16 +08:00
Huong Nguyen cad3403e71 MDL-72430 Calendar: Fix admin cannot edit course event 2022-07-26 11:47:50 +07:00
Andrew Nicols 34b551b4e7 Merge branch 'MDL-73788-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2022-07-26 11:38:44 +08:00
Jun Pataleta a62e36a9f6 Merge branch 'MDL-74057-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2022-07-26 11:01:53 +08:00
Paul Holden 7dd9098338 MDL-74895 h5p: more resilient error handling during content fetching.
On new installs, the task for downloading new H5P content types would
throw exceptions and exit when encountering unexpected and/or missing
data.
2022-07-25 20:05:59 +01:00
Ilya Tregubov a69d81beaa Merge branch 'MDL-75083-MOODLE_311_STABLE' of https://github.com/rzhtwberlin/moodle into MOODLE_311_STABLE 2022-07-25 14:56:29 +04:00
Angelia Dela Cruz 4434756fd6 MDL-74057 behat: SCORM behat generators use UI
Replace steps that manually add SCORM instances via the UI and use
Behat generators. This improves the speed of Behat test runs.
2022-07-25 18:22:22 +08:00
Ilya Tregubov 08e64ba626 Merge branch 'MDL-74974__MOODLE_311_STABLE' of https://github.com/PhilippImhof/moodle into MOODLE_311_STABLE 2022-07-25 11:46:42 +04:00
Philipp Imhof caa944907a MDL-74974 quiz override mark: do not hide_all_feedback
(backport of MDL-74495)
2022-07-22 15:34:16 +02:00
Thong Bui 19815c2c2c MDL-74766 html_editor: Fix form is submitted as an empty string 2022-07-22 10:17:45 +07:00
Ilya Tregubov 8de4b14be7 weekly release 3.11.8+ 2022-07-21 21:29:58 +04:00
Ilya Tregubov 2016d64b83 NOBUG: Fixed SVG browser compatibility 2022-07-21 21:29:56 +04:00
Ilya Tregubov 3eedb8a9c9 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-07-21 21:29:56 +04:00
Jun Pataleta 7f8d209ba1 Merge branch 'MDL-75208_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-07-21 11:27:14 +08:00
Víctor Déniz 3f2ffcce08 Merge branch 'MDL-73332-311' of https://github.com/martygilbert/moodle into MOODLE_311_STABLE 2022-07-20 19:56:07 +01:00
Christina Thee Roperto 18f46b32a2 MDL-72349 filelib: update strip_double_headers function 2022-07-19 19:14:52 +10:00
Eloy Lafuente (stronk7) ffb762aae0 MDL-75208 oracle: Amend a couple of queries to make Oracle happy
The changes introduced here are completely safe, just we stop
binding SITEID and, instead, embed it in the SQL.

Why? Because Oracle 21 has started to return non-sense results
when SITEID is bound.

After lots of tests, attempts, debugging... we have been unable
to find any logic to the need of this change and also, have been
unable to reproduce the problem with a standalone script that
pretty much runs the same queries that the ones changed here.

I'm sure that there is something, somewhere, but have failed
to find it, grrr.

Please read MDL-75208 and linked issues to find more information
about this problem, that is one of the biggest mysteries I've
seen recently. Maybe at the end there is a tiny detail that
explains it all, but it's really well hidden.
2022-07-19 09:52:59 +02:00
Angelia Dela Cruz 9b6a36114c MDL-73788 behat: URL behat generators use UI
Replace steps that manually add URL instances via the UI and use
Behat generators. This improves the speed of Behat test runs.
2022-07-19 08:53:26 +08:00
Ilya Tregubov 8ef1574c47 Merge branch 'MDL-68843-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2022-07-18 14:16:37 +04:00
Jake Dallimore 09a93cb6eb MDL-68843 enrol_lti: auto disable orphaned enrolment instances
- pre_course_module_deletion hook to disable on mod delete
- upgrade step dealing with legacy orphaned records
2022-07-18 16:25:08 +08:00
Jake Dallimore b1fa2a9976 MDL-68843 enrol_lti: add deleted activity warning to published tools
Adds a warning to the 'name' column of the tables, letting teachers know
that the activity exposed by the method has been deleted and what their
options are.
2022-07-18 16:25:08 +08:00
AMOS bot 310da5eee7 Automatically generated installer lang files 2022-07-16 00:08:03 +00:00
Denis Brat f9e7aa5820 MDL-69251 enrol_lti: fix sync_members task inconsistent internal state 2022-07-15 12:21:09 +08:00
Marty 91c1bba220 MDL-73332 mustache: Fix shortentext helper
In the docs, it claims you can provide length to
the shortentext template helper as a context variable.
In reality, that is not the case.
2022-07-14 09:36:07 -04:00
Víctor Déniz 8984ffef4f weekly release 3.11.8+ 2022-07-14 12:06:12 +01:00
Víctor Déniz 419e169fa5 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-07-14 12:06:10 +01:00
Víctor Déniz 73003c7c96 Merge branch 'MDL-74681-written_time_in_query_end_311' of https://github.com/catalyst/moodle into MOODLE_311_STABLE 2022-07-12 11:54:39 +01:00
Srdjan 4619b5128d MDL-74681 lib/dml: moodle_read_slave_trait: written table timestamping
Moved written table timestamping from query_start() to query_end():
We are adjusting table last written times at the end of transaction.
That does not apply to immediate database writes that are not performed
within transaction. This change is to set last written time after the query
has finished for such writes, rather than before it started. That way
long write operations cannot spill over the latency parameter.
2022-07-12 14:39:04 +10:00
Jun Pataleta 9a5389830e Merge branch 'MDL-71747_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-07-12 10:50:51 +08:00
AMOS bot 44cd084562 Automatically generated installer lang files 2022-07-12 00:07:59 +00:00
Jun Pataleta ca6f1479ad Merge branch 'MDL-74282-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-07-11 20:35:40 +08:00
Jun Pataleta 2e592749aa Merge branch 'MDL-73215-undef-plagiarismlinks-311' of https://github.com/leonstr/moodle into MOODLE_311_STABLE 2022-07-11 17:01:50 +08:00
Jun Pataleta e261c7ed25 Merge branch 'MDL-74784-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-07-11 16:53:41 +08:00
Jake Dallimore 57c492a6a5 MDL-74947 mod_lti: remove text validation from password field
This is a password field so should not be cleaned.
2022-07-11 13:37:31 +08:00
Johannes Burk 442e1f33c9 MDL-75083 login: prevent double submission
Apply core_form/submit JavaScript code to prevent double submission of login form and guest login button.
Add ID to guest login button to make it addressable.
2022-07-08 16:28:13 +02:00
Paul Holden 9cde5a75bb MDL-74282 grade: omit outcomes report if outcomes aren't enabled. 2022-07-08 10:43:31 +01:00
Jake Dallimore b8fd606243 Moodle release 3.11.8 2022-07-08 11:28:39 +08:00
Eloy Lafuente (stronk7) 191351d2a3 MDL-71747 environment: Ensure that check_xmlrpc_usage is in >=39
This is a partial backport of MDL-73270 to ensure that the
check_xmlrpc_usage custom check is present in all the supported
branches and it's applied to all branches able to run php80:

- MOODLE_311_STABLE
- MOODLE_400_STABLE
- master (aka, 4.1 and up)

Note that the whole patch has not been backported, only the
environmental check (xml file and check implementation).
2022-07-07 23:44:57 +02:00
Eloy Lafuente (stronk7) fec4afdbd3 MDL-71747 environment: Apply agreed changes
- PHP 7.4 required.
- Moodle 3.9 required.
- MariaDB 10.4 required.
- PostgreSQL 12 required.
- Oracle 19c required.
2022-07-07 19:19:53 +02:00
Eloy Lafuente (stronk7) 02daea22d5 MDL-71747 environment: 4.1 base information
This is a direct copy of the 4.0 information, to
have the changes under control in the next commit.
2022-07-07 19:19:53 +02:00
Jun Pataleta 5cb257b4c3 weekly release 3.11.7+ 2022-07-07 21:33:10 +08:00
Jun Pataleta 64b6bca053 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-07-07 21:33:08 +08:00
Shamim Rezaie df61870abc MDL-56923 gradingform_guide: Fix icon positioning in RTL 2022-07-07 16:03:34 +10:00
Jake Dallimore d3d988fcc6 Merge branch 'MDL-69400-311' of https://github.com/abgreeve/moodle into MOODLE_311_STABLE 2022-07-07 11:49:05 +08:00
Jun Pataleta bf3f06bb82 Merge branch 'MDL-75116_311' of https://github.com/aolley/moodle into MOODLE_311_STABLE 2022-07-07 10:47:50 +08:00
Víctor Déniz fb714c7cf6 Merge branch 'MDL-74835-M311_update-nodejs-version-in-travis-integration-to-lts-gallium' of https://github.com/ziegenberg/moodle into MOODLE_311_STABLE 2022-07-06 12:16:56 +01:00
Jun Pataleta 4ce6dc7b4d Merge branch 'MDL-74741-311' of https://github.com/rezaies/moodle into MOODLE_311_STABLE 2022-07-06 16:45:52 +08:00
stevando cd6e0bf763 MDL-72171 tool_mobile: Ensure auto login URL is always local 2022-07-06 14:28:39 +08:00
Adrian Greeve 69ce532809 MDL-69400 mod_forum: Added calender event refreshing. 2022-07-06 12:42:47 +08:00
Mihail Geshoski 0f4e8413fc MDL-71921 scorm: Sanitize element names before outputting track details 2022-07-06 05:24:15 +02:00
Alex Morris 919f5bfb36 MDL-75044 assignfeedback_editpdf: Add SAFER option to GS command
Adds the SAFER option to the Ghostscript command to limit interaction
with IO and OS commands
2022-07-06 05:24:15 +02:00
Huong Nguyen 46ee4f4062 MDL-72029 Lesson: Prevent arbitrary file read when importing lesson questions in blackboard format 2022-07-06 05:24:15 +02:00
Huong Nguyen edc7eb06b7 MDL-72029 lib: Prevent path traversal for clean_param with PARAM_SAFEPATH 2022-07-06 05:24:15 +02:00
Laurent David 8af0c977d0 MDL-74473 core_analytics: Upgrade ML Backend to 2.6.6 2022-07-06 05:24:15 +02:00
Jake Dallimore f1c0f2849b MDL-72299 mod_lti: fix html escaping when reposting cross site posts 2022-07-06 05:24:15 +02:00
Andrew Nicols 00f0ebf5ea Merge branch 'MDL-73305_MOODLE_311_STABLE' of https://github.com/tasosb/moodle into MOODLE_311_STABLE 2022-07-06 11:16:28 +08:00
Andrew Nicols 8c87a29d2e Merge branch 'MDL-74408-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-07-06 11:03:12 +08:00
Andrew Nicols 26fe42c16e Merge branch 'MDL-74972-311' of https://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2022-07-06 10:58:29 +08:00
Jun Pataleta d7f72ffdc8 Merge branch 'MDL-74813-311' of https://github.com/mihailges/moodle into MOODLE_311_STABLE 2022-07-06 10:53:53 +08:00
Mihail Geshoski 60d8572d4e MDL-74813 filepicker: Replace the dnd gif animation with a static icon 2022-07-06 10:24:44 +08:00
Jun Pataleta b7d79061f1 Merge branch 'MDL-74821-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-07-05 22:13:27 +08:00
Laurent David cc7ccb6c42 MDL-74821 mod_feedback: Fix HTML validator error
* Remove align attribute on table elements
* Fix dangling tr/td on multichoice rated
* Remove colspan as it is not used
2022-07-05 21:41:12 +08:00
Jake Dallimore d16e3a8141 Merge branch 'MDL-74815-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-07-05 14:53:18 +08:00
Jake Dallimore 05bc504e4e Merge branch '311_mdl-73498' of https://github.com/daniil-berg/moodle into MOODLE_311_STABLE 2022-07-05 12:01:20 +08:00
AMOS bot 7197b264b1 Automatically generated installer lang files 2022-07-05 00:08:20 +00:00
Adam Olley 83e6407074 MDL-75116 mod_feedback: Check array values exist before using them
Without this, the @list will emit a PHP warning under php8.0+ when the array
doesn't have a second element to assign.
2022-07-05 09:18:10 +09:30
Jun Pataleta 93e30fbe3c Merge branch 'MDL-74516_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-07-04 23:17:53 +08:00
Jun Pataleta 287d51323f Merge branch 'MDL-75008-311-enfix' of https://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2022-07-04 22:17:48 +08:00
Jun Pataleta 8acd5f7390 MDL-74815 pix: Convert PNG version of darkened SVG icons
* Conversion was done using rsvg-convert from librsvg
2022-07-04 14:00:55 +08:00
Jun Pataleta f7c7b7cb73 MDL-74815 pix: Darken colour of grey icons
* Change the fill colour of grey icons from #999 to #888.
2022-07-04 12:55:02 +08:00
sam marshall 2571dcf012 MDL-75108 block_html: Search tries to index directory entries
Search attach_files function should only attach indexable files,
not directory entries which are 0 bytes and cannot be indexed.
2022-07-01 14:08:51 +01:00
Eloy Lafuente (stronk7) 1271286cf5 MDL-74516 activities: Better handling of floats for gradepass fields
Note that in 311_STABLE the patch is different from the 400 and master
fixes. The API for grade_floatval() was only changed for 4.0 and up.

Hence, for this branch we are just:

- Changing the form definition to use proper "float" element (instead
  of text + raw.
- Backporting the behat tests to verify that everything continues
  working ok.

Also, in 311_STABLE, the workshop module did not have the grade
to pass completion condition, so we aren't modifying anything
in that activity for that branch.
2022-07-01 13:55:57 +02:00
Víctor Déniz fda6e143af weekly release 3.11.7+ 2022-07-01 11:28:48 +01:00
Marina Glancy cb42a0ad6a MDL-74502 behat: when setting a field value it may not be visible
for example in case of editor field, the textarea element is hidden by wysiwyg widget but we still need to be able to set it
2022-07-01 10:31:28 +02:00
David Mudrák 03c7f3dc87 MDL-75008 lang: Use the fixed strings in Behat scenario files 2022-06-30 22:10:57 +02:00
Helen Foster 985be80d1f MDL-75008 lang: Import fixed English strings (en_fix) 2022-06-30 22:06:42 +02:00
Jun Pataleta ef6bb4439d Merge branch 'MDL-74613-311' of https://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2022-06-30 20:24:14 +08:00
Noel De Martin 787e36fea8 MDL-74613 grade: Fix undefined behat step 2022-06-30 11:26:27 +02:00
Shamim Rezaie 79af8fb2f5 Merge branch 'MDL-74812-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-06-30 13:34:52 +10:00
Shamim Rezaie f247f5b048 Merge branch 'MDL-75055-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-06-30 13:20:39 +10:00
Andrew Nicols 3176d756e0 Merge branch 'MDL-75084-311' of https://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2022-06-30 11:13:53 +08:00
Andrew Nicols 5de3c84461 Merge branch 'MDL-74613-311' of https://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2022-06-30 11:04:56 +08:00
Andrew Nicols b08a9e0b66 Merge branch 'MDL-74220-311' of https://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2022-06-30 11:00:01 +08:00
Andrew Nicols ef6a03ea51 Merge branch 'MDL-74744-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2022-06-30 10:55:54 +08:00
Andrew Nicols ce8237d5fd Merge branch 'MDL-74841-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2022-06-30 10:44:47 +08:00
Andrew Nicols 8db9ab4908 Merge branch 'MDL-72292-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-06-30 10:40:40 +08:00
Andrew Nicols eda6b9ba8f MDL-74379 core: Update date_format_string to use x-os functions 2022-06-30 10:36:14 +08:00
Andrew Nicols f85d5e9e5d Merge branch 'MDL-74379_311' of https://github.com/aya-saad1/moodle into MOODLE_311_STABLE 2022-06-30 10:36:10 +08:00
Andrew Nicols dd4702ee80 Merge branch 'MDL-74287-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-30 10:02:29 +08:00
Víctor Déniz ad5e6f00df Merge branch 'MDL-72885-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-06-29 22:47:49 +01:00
Jun Pataleta a3af9f65bf Merge branch 'MDL74387_MOODLE_311_STABLE' of https://github.com/Amrita1991/moodle into MOODLE_311_STABLE 2022-06-29 23:21:05 +08:00
Jun Pataleta 3584a14e78 MDL-75055 templates: Apply .alert-dismissible class
- Apply the .alert-dismissible class for notification alerts with
close button to fix its positioning. As an added bonus, the
.alert-dismissible class also enlarges the clickable area of the
close button which is great for accessibility.
- Improve example context for the notification alerts templates.
2022-06-29 22:27:35 +08:00
Jun Pataleta 77abe66d2c MDL-75055 theme_boost: Darken close button colour in notification alerts
This is in order for the close button to have a good contrast against
the alert background and meet the minimum Level AA contrast ratio of 3:1
2022-06-29 22:27:35 +08:00
Ilya Tregubov ab22e012d8 Merge branch 'MDL-74548-311' of https://github.com/cameron1729/moodle into MOODLE_311_STABLE 2022-06-29 16:17:18 +04:00
Jun Pataleta 758281716e Merge branch 'MDL-74886-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-06-29 17:47:12 +08:00
Anastasios Bithas 9b64f0afcd MDL-73305 mod_folder: Download Folder in a mlang formated folder 2022-06-29 12:42:50 +03:00
Jake Dallimore 9c611755d4 Merge branch 'MDL-74674-311' of https://github.com/alfonso-salces/moodle into MOODLE_311_STABLE 2022-06-29 16:45:02 +08:00
Alfonso Salces 96b7a7d066 MDL-74674 core: create notification generators 2022-06-29 10:30:55 +02:00
Noel De Martin cc68de58d1 MDL-75084 blog: Implement behat generators 2022-06-29 09:40:16 +02:00
Jake Dallimore 79c83bfcef Merge branch 'MDL-74864-311' of https://github.com/dpalou/moodle into MOODLE_311_STABLE 2022-06-29 13:41:15 +08:00
Cameron Ball 79e0d92848 MDL-74548 backup: Deprecate get/set copy from base controller 2022-06-29 09:39:51 +08:00
Cameron Ball f7189aea98 MDL-74548 backup: Deprecate core_backup\copy\copy 2022-06-29 09:39:49 +08:00
Cameron Ball 58fcbe9678 MDL-74548 backup: Unit tests for course copy refactor 2022-06-29 09:36:06 +08:00
Cameron Ball 4751e672e3 MDL-74548 backup: Refactor course copies
This patch modifies the way copy data is shared in order to mitigate potential race conditions
and ensure that the serialised controller stored in the DB is always in a valid state.

The restore controller is now considered the "source of truth" for all information about the
copy operation. Backup controllers can no longer contain information about course copies.

As copy creation is not atomic, it is still possible for copy controllers to become orphaned or
exist in an invalid state. To mitigate this the backup cleanup task has been modified to call
a new helper method copy_helper::cleanup_orphaned_copy_controllers.

Summary of changes in this patch:

    - Copy data must now be passed through the restore controller's constructor
    - base_controller::get_copy has been deprecated in favour of restore_controller::get_copy
    - base_controller::set_copy has been deprecated without replacement
    - core_backup\copy\copy has been deprecated, use copy_helper.class.php's copy_helper instead
    - backup_cleanup_task will now clean up orphaned controllers from copy operations that went awry

Thanks to Peter Burnett for assiting with testing this patch.
2022-06-29 09:36:06 +08:00
Jun Pataleta ba64cce68d Merge branch 'MDL-74701-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-06-28 23:53:10 +08:00
Jun Pataleta 0d20c1c2d6 Merge branch 'MDL-74906-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2022-06-28 23:33:29 +08:00
Shamim Rezaie 539d1b3c89 Merge branch 'MDL-73121-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-28 16:09:17 +10:00
Dani Palou 6d047756d2 MDL-74864 forum: Allow specifying group in discussions generator 2022-06-28 07:00:12 +02:00
Jun Pataleta 6ba7009a11 Merge branch 'MDL-68867-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-06-28 11:23:51 +08:00
Jun Pataleta 56ab65f46a Merge branch 'MDL-74781_311' of https://github.com/aya-saad1/moodle into MOODLE_311_STABLE 2022-06-28 10:45:09 +08:00
Aya Saad ca13d3e05c MDL-74781 search: Fix heading repetition in global search page 2022-06-26 10:37:26 +02:00
Aya Saad df32c00ab5 MDL-74379 language: injecting am/pm in date string
patching the date_format_string() function in moodlelib to add am/pm for languages that don't suuport it.
2022-06-26 10:34:41 +02:00
Shamim Rezaie f375246427 MDL-74741 javascript: Set the role of d&d links to button 2022-06-24 14:27:40 +10:00
Shamim Rezaie 544947c9c7 MDL-74741 javascript: A11y fix for dialogues visible from beginning 2022-06-24 14:26:46 +10:00
Jun Pataleta 1f6ab2b676 weekly release 3.11.7+ 2022-06-24 11:59:10 +08:00
Jun Pataleta 5f098189dd Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-06-24 11:59:09 +08:00
Jun Pataleta 9e530add9e Merge branch 'MDL-69939-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-23 09:53:27 +08:00
Jun Pataleta a349ae01e9 Merge branch 'MDL-74713-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-23 09:51:27 +08:00
Jun Pataleta 99b5fb3a3b Merge branch 'MDL-73156-M311' of https://github.com/michael-milette/moodle into MOODLE_311_STABLE 2022-06-23 09:50:21 +08:00
Simey Lameze a47525cbc9 MDL-68867 calendar: remove dependency on USER->groupmember hack 2022-06-22 07:57:28 +08:00
Jun Pataleta 762fb71a1f Merge branch 'MDL-73212_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-06-21 23:53:43 +08:00
Eloy Lafuente (stronk7) 146d84ebde MDL-73212 gha: Allow parameters to be passed via secret
We are disabling the -v (verbose) option, used by default. Still,
now we support a secret (that can be added to everyone's repository)
to accept any PHPUnit's command line options and run the tests with
them.

Some examples:

phpunit_options = -v (to keep the verbose option enabled)
phpunit_options = --testdox (to print information about every test...)

... (basically anything supported by the CLI)

Also, we are raising here the environment from Ubuntu 18.04 to 20.04

(self tested by GHA, heh)
2022-06-21 16:52:36 +02:00
Jun Pataleta c0b0f6f411 MDL-74812 gradingform_rubric: Add radiogroup role properly
Do not add the radiogroup role to the rubric criterion when the rubric
table is being displayed on edit or preview modes.
2022-06-21 12:33:05 +08:00
Jun Pataleta 6e6260f6d0 MDL-74812 gradingform_rubric: Fix text overlap in rubric levels 2022-06-21 12:33:05 +08:00
Jun Pataleta d0a2de670b MDL-74812 gradingform_rubric: Do not use deprecated width attribute
Use inline CSS style to define level width instead.
2022-06-21 12:33:05 +08:00
Jun Pataleta d82af28545 MDL-74812 gradingform_rubric: Fix contrast issues in rubric table
* Darken the score value using the green theme colour
* Use a light green theme colour for selection backgrounds
* Unify rubric styles related to background and text colour within the
  criteria.
2022-06-21 12:32:22 +08:00
Jun Pataleta ad408bbfdf Merge branch 'MDL-74630-311' of https://github.com/aanabit/moodle into MOODLE_311_STABLE 2022-06-21 10:12:00 +08:00
AMOS bot 0ff0d1d66a Automatically generated installer lang files 2022-06-21 00:09:39 +00:00
Daniil Fajnberg 0957e83d8d MDL-73498 mod_lti: iframe allowed domain fixed 2022-06-20 15:53:13 +02:00
Jun Pataleta 4dd37348b4 Merge branch 'MDL-74358_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-06-20 14:35:56 +08:00
Paul Holden c5c6758ed7 MDL-69939 webservice: correct AJAX bool value in services definition. 2022-06-17 11:03:32 +01:00
Eloy Lafuente (stronk7) 78cbd77c0d MDL-74358 availability: Avoid php8 problem with array_values(null) 2022-06-17 11:09:53 +02:00
Jun Pataleta 8303206ae0 weekly release 3.11.7+ 2022-06-17 15:30:35 +08:00
Eloy Lafuente (stronk7) d13ed5575c Merge branch 'MDL-72324-311-fix' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-06-17 08:38:59 +02:00
Jun Pataleta 1d40ffaf55 MDL-72324 core: Add upgrade.txt note about $plugin->incompatible 2022-06-17 10:42:29 +08:00
Jun Pataleta 146048903b Merge branch 'MDL-74529-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-17 10:20:47 +08:00
Jun Pataleta 57d119a43f Merge branch 'MDL-72555-311' of https://github.com/laurentdavid/moodle into MOODLE_311_STABLE 2022-06-17 10:20:47 +08:00
Simey Lameze 3b18f7884f MDL-72292 core: add param type and polishing 2022-06-17 09:54:41 +08:00
Alexander Bias 3cc3d83b7e MDL-72292 core: Check if fulldir is set when loading renamed classes 2022-06-17 09:54:40 +08:00
Marina Glancy bd2cb3c4e8 MDL-74972 core_form: frozen autocomplete element does not display values 2022-06-16 10:24:56 +02:00
Paul Holden c8aa905ef0 MDL-74287 forms: request changesmade string as required.
Unconditionally requesting the string was triggering exceptions
during installation, before the required external functions had
been populated.
2022-06-16 08:07:44 +01:00
Paul Holden d1e8870fb5 MDL-74287 media_videojs: skip dynamic loader during install/upgrade. 2022-06-16 08:07:44 +01:00
Michael Milette e34b09be48 MDL-73156 user: Custom user profile field names now filtered. 2022-06-15 11:50:13 -04:00
Jun Pataleta 94d025a912 Merge branch 'MDL-72324-incompatible-check-311' of https://github.com/Peterburnett/moodle into MOODLE_311_STABLE 2022-06-15 23:03:38 +08:00
Jun Pataleta 1a87e306e9 Merge branch 'MDL-73966-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-15 18:06:04 +08:00
Paul Holden 9bbeeaa557 MDL-74713 admin: format custom profile fields in identify config. 2022-06-14 17:19:33 +01:00
Jun Pataleta 598845e3ff Merge branch 'MDL-74790-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-14 22:52:29 +08:00
Jun Pataleta 0c2cd0de2a Merge branch 'MDL-74573_311' of https://github.com/aya-saad1/moodle into MOODLE_311_STABLE 2022-06-14 22:35:25 +08:00
Jun Pataleta 170a12537b Merge branch 'MDL-74649-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-14 22:26:11 +08:00
Víctor Déniz 1662bae0ab Merge branch 'MDL-74449_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-06-14 10:02:10 +01:00
Laurent David a0727a15d5 MDL-72555 block_site_main_menu: Fix activity chooser issue
* When adding the block_site_main_menu on every page, the activity chooser generated
for this entire page is set with courseid = 1. So any activity is then added to the
home page instead of a course.
2022-06-14 10:03:42 +02:00
Jun Pataleta 834e634c9f Merge branch 'MDL-74816-311' of https://github.com/dpalou/moodle into MOODLE_311_STABLE 2022-06-14 13:58:47 +08:00
Amrita ac7eedb851 MDL-74387 url: exception for php to correct icon 2022-06-13 08:53:51 +02:00
Jake Dallimore 78a4febfb4 Merge branch 'MDL_74310_311' of https://github.com/cengage/moodle into MOODLE_311_STABLE 2022-06-13 11:46:24 +08:00
Jake Dallimore 99e43efb1e Merge branch 'MDL69756_MOODLE_311_STABLE' of https://github.com/Amrita1991/moodle into MOODLE_311_STABLE 2022-06-13 11:13:27 +08:00
Jake Dallimore 51c5405e6f Merge branch 'MDL-74718-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2022-06-13 10:53:45 +08:00
Huong Nguyen 01222cbb06 MDL-74701 core: Fix popover elements are focusable even when hidden 2022-06-13 09:45:37 +07:00
Eloy Lafuente (stronk7) df048de49d MDL-74449 gradebook: Protect flatten_dependencies_array() a little bit
It has been detected that the flatten_dependencies_array() was fragile
and leading to wrong results when some incorrect data was passed to it.

This includes:

- Missing elements.
- Null dependencies.
- Non array dependencies.

While the existing behaviour (testing-wise) has been preserved, now the
situations above are better controlled and the function ignores all
those incorrect cases that shouldn't happen ever.

That implies that a good number of notices/warnings/errors aren't
happening anymore. That was impacting both results (when the problems
were  only notices and warnings) and execution (when the problems
were errors).

Covered with tests.
2022-06-10 18:18:00 +02:00
Sara Arjona 22dffcd0c2 weekly release 3.11.7+ 2022-06-10 17:08:25 +02:00
Sara Arjona e5ec14cc01 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-06-10 17:08:22 +02:00
Amrita fa82e4aa00 MDL-69756 nextcloud: copy-overwrite handling 2022-06-10 16:30:52 +02:00
Jun Pataleta afa1b6f0ad MDL-74802 core: Remove tooltip on the notification close button
Reverting the addition of a Boostrap tooltip on the alert notification's
close button. It introduced a bug where the tooltip remains after
dismissing the notification alert. We can manually toggle the state of
the tooltip via JS, but I don't think it's worth the effort. The tooltip
is meant as an added bonus for sighted users to see what the close
button is about.
2022-06-10 13:17:01 +02:00
Jun Pataleta 4cb53f71b3 MDL-74802 core_user: Use button label to close notification alert
With the notification alert's close button now properly labelled, it is
better for Behat to interact on it using its label.
2022-06-10 13:17:01 +02:00
Andrew Nicols 7e180482ca MDL-73013 filelib: Fix code lint 2022-06-10 13:17:01 +02:00
Andrew Nicols a9af3c9cd4 MDL-73013 filelib: Address coding style violations 2022-06-10 13:17:01 +02:00
Andrew Nicols a37caf6126 Merge branch 'MDL-73013-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-10 13:17:00 +02:00
Jake Dallimore 8e0205ec56 Merge branch 'MDL-72377-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-10 13:17:00 +02:00
Andrew Nicols 3156398c54 Merge branch 'MDL-73466-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-10 13:17:00 +02:00
Andrew Nicols 21f43574fd Merge branch 'MDL-74764-311' of https://github.com/BruceGoodGuy/moodle into MOODLE_311_STABLE 2022-06-10 13:17:00 +02:00
Shamim Rezaie f83929ab57 Merge branch 'MDL-73702-fix_report_helper' of https://github.com/praxisdigital/moodle into MOODLE_311_STABLE 2022-06-10 13:17:00 +02:00
Víctor Déniz faa4d5ab56 Merge branch 'MDL-69970_311' of https://github.com/aya-saad1/moodle into MOODLE_311_STABLE 2022-06-10 13:17:00 +02:00
Sara Arjona d89301add2 Merge branch 'MDL-74802-311-2' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-06-10 13:16:59 +02:00
Sara Arjona 15e127fe7e Merge branch 'MDL-74577-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2022-06-10 13:16:59 +02:00
Jun Pataleta 79b5632ce9 Merge branch 'mdl-69637_311' of https://github.com/james-cnz/moodle into MOODLE_311_STABLE 2022-06-10 13:16:59 +02:00
Angelia Dela Cruz 75715efdfa MDL-74841 behat: Label behat generators use UI
Replace steps that manually add Label instances via the UI and use
Behat generators. This improves the speed of Behat test runs.
2022-06-10 13:34:11 +08:00
Paul Holden d80a7c43dc MDL-74649 course: render scale information using page popup layout. 2022-06-09 12:18:55 +01:00
Jake Dallimore 439e4edc99 MDL-74906 mod_lti: fix form selector in multi-item content item post
Use #region-main-box and not .mform in the selector, otherwise it may
return the wrong mform, such as global search, if enabled. This is the
same way the form is selected in showMultipleSummaryAndHideForm().
2022-06-09 17:06:07 +08:00
Paul Holden a39feaefe7 MDL-74408 core: exclude empty patterns in divert email config. 2022-06-09 09:39:32 +01:00
Sujith Haridasan 8c8e5eba2c MDL-74718 webdav: correct the loop when reading chunks
Adjusted the condition while reading the streams
in chunks. Read till the end to make sure we have got all
the data. Else we might not get all the data to show
in file picker.
2022-06-09 12:03:11 +05:30
Paul Holden 16b9813aae MDL-73466 forumreport_summary: use formatted course module name. 2022-06-08 21:36:46 +01:00
Víctor Déniz 07a07679a1 Merge branch 'MDL-73774-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-06-08 10:16:01 +01:00
Sara Arjona 1207c31c78 Merge branch 'MDL-74182-311' of https://github.com/ericmerrill/moodle into MOODLE_311_STABLE 2022-06-08 10:41:56 +02:00
gthomas2 23f0472514 MDL-74922 javascript: storragewrapper validateCache fix 2022-06-08 09:33:46 +01:00
Adam Olley c8ade37695 MDL-74886 core_admin: Add unit test
Simple unit test to verify we don't get the TypeError anymore.
2022-06-08 10:08:21 +08:00
Simey Lameze 23bb2275d9 MDL-74886 core_admin: cast value and unit to integer 2022-06-08 10:08:20 +08:00
Peter Burnett 1f7a90fbe2 MDL-72324 upgrade: Fix incompatible check in upgrade to match docs 2022-06-08 10:52:54 +10:00
AMOS bot 82d55b7455 Automatically generated installer lang files 2022-06-08 00:08:14 +00:00
Sara Arjona 064c473a4e Merge branch 'MDL-74344-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-07 16:51:58 +02:00
Sara Arjona bf6e018f9d Merge branch 'MDL-72983-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-07 16:09:01 +02:00
Paul Holden 5c418c72f3 MDL-74529 theme_boost: accessible autolink styles from filters.
The `autolink` class is used by various filter types to create
hyperlinks within text. Extend existing `aalink` class so they
behave in the same way.
2022-06-07 10:57:49 +01:00
Huong Nguyen 47e66ef9d1 MDL-73774 timeline: Prevent ID duplication 2022-06-07 12:05:27 +07:00
Jun Pataleta 335b09205b Merge branch 'MDL-70223_311' of https://github.com/aya-saad1/moodle into MOODLE_311_STABLE 2022-06-07 10:29:38 +08:00
AMOS bot 9b779e3d53 Automatically generated installer lang files 2022-06-07 00:08:10 +00:00
Paul Holden e084b47f92 MDL-72983 tool_dataprivacy: respect capability to export own data. 2022-06-06 20:50:17 +01:00
Paul Holden 44b49b5651 MDL-72377 grade: fix category form hidden/until fields.
Ensure the saved values for the hidden and hidden until fields are
populated when editing a grade category. Fix behaviour on enabling
the hidden until field.

Re-enable tests commented out in eba1d32c.
2022-06-06 15:29:09 +01:00
Paul Holden 2742b32ed8 MDL-72377 grade: increase size of category hidden fields.
As well as storing 1/0 to indicate hidden state, they are also used
to store a timestamp indicating hidden until date. Increasing field
size allows these values to be stored without triggering exceptions.
2022-06-06 15:29:09 +01:00
Paul Holden df6d634d57 MDL-73121 atto_managefiles: match used files enclosed by quotes. 2022-06-06 15:17:26 +01:00
Ilya Tregubov b2b0d0795e Merge branch 'MDL-69951-remove_drop-font-tags-311' of https://github.com/leonstr/moodle into MOODLE_311_STABLE 2022-06-06 11:38:48 +06:00
aya.saad 39f39999be MDL-74573 mod_assign: convert view other attempt link to a button 2022-06-05 09:21:23 +02:00
aya.saad 088519178f MDL-70223 h5p: fix invalid id when adding h5p activity 2022-06-05 09:19:11 +02:00
aya.saad 7ee20257b0 MDL-69970 icons: flip help icon direction in RTL languages 2022-06-05 09:17:02 +02:00
Shamim Rezaie 4fc3052a73 Merge branch 'MDL-74250-311' of https://github.com/adpe/moodle into MOODLE_311_STABLE 2022-06-03 18:42:50 +10:00
Andrew Nicols fc056f1aa6 Merge branch 'MDL-73898-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-03 13:32:24 +08:00
Andrew Nicols 2fe2cd8eab weekly release 3.11.7+ 2022-06-03 11:04:08 +08:00
Andrew Nicols 4c0a1ffaab Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-06-03 11:04:06 +08:00
AMOS bot c9d14b4ce8 Automatically generated installer lang files 2022-06-03 00:08:06 +00:00
Jun Pataleta 6368b3f055 Merge branch 'MDL-74631-invalid-tag-311' of https://github.com/leonstr/moodle into MOODLE_311_STABLE 2022-06-02 12:20:33 +08:00
Jun Pataleta 544d1ab453 Merge branch 'MDL-57065-311' of https://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2022-06-02 12:03:27 +08:00
Jun Pataleta 4ba43b851d Merge branch 'MDL-71301-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-06-02 11:22:49 +08:00
Issam Taboubi fbbb7da0f6 MDL-71301 qtype_gapselect: Make blank answer box labels more meaningful 2022-06-02 10:51:26 +08:00
Jun Pataleta e78978ec6b Merge branch 'MDL-67966-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-06-02 10:30:09 +08:00
Joshua Ebarvia 394f65e91e MDL-67966 mod_workshop: Use condition to verify form is using editor
This adds a condition to check if Online text is used
for the submission. The functions file_postupdate_standard_editor
and file_postupdate_standard_filemanager needs the property
content_editor of the formdata.
2022-06-02 10:28:24 +08:00
Sara Arjona 2432ac2c08 Merge branch 'MDL-71276-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-06-01 18:38:00 +02:00
Noel De Martin 986cf06e55 MDL-74613 grade: Add missing generators 2022-05-31 18:13:48 +02:00
Amaia Anabitarte 3619147c76 MDL-74630 core_contenbank: Add contextid to URL parameters 2022-05-31 09:49:49 +02:00
AMOS bot de03dfa066 Automatically generated installer lang files 2022-05-31 00:08:08 +00:00
AMOS bot bd9c3fd5db Automatically generated installer lang files 2022-05-30 00:08:02 +00:00
AMOS bot e6b39085a8 Automatically generated installer lang files 2022-05-28 00:08:10 +00:00
Jun Pataleta 3c982ce134 MDL-72885 output: Add lang attribute for language custom menu items 2022-05-27 19:44:17 +08:00
Jun Pataleta eefd6bbf54 MDL-72885 output: Allow additional attributes for custom menu items
* Plus don't render the link title if it's the same as the link text.
2022-05-27 19:44:17 +08:00
Leon Stringer 9b3be75879 MDL-73215 assign: Undefined var: plagiarismlinks
Fix: $plagiarismlinks is concatenated in return but may not have been
initialised.
2022-05-27 08:53:57 +01:00
Adrian Perez b5157c8153 MDL-74250 core: Improve indicator that link opens in new window 2022-05-27 07:21:43 +02:00
Khoa Nguyen Dang 53cc3870e1 MDL-74764 core_course: Activity is not in alphabetical order. 2022-05-27 11:07:38 +07:00
Jake Dallimore 72b408772c weekly release 3.11.7+ 2022-05-27 10:02:13 +08:00
Noel De Martin b08d4ea2ed MDL-74220 data: Implement behat generators 2022-05-26 10:39:14 +02:00
Jake Dallimore 0ed76e9316 Merge branch 'MDL-73801-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-05-26 12:12:17 +08:00
Jake Dallimore 3cca8ba5d8 Merge branch 'MDL-73386-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-05-26 11:47:48 +08:00
Dani Palou bfad8c4dd1 MDL-74816 mod_resource: Allow specify default file name in generator 2022-05-25 10:41:37 +02:00
Paul Holden da60508071 MDL-74790 mod_resource: better detection of empty module intro. 2022-05-24 21:21:40 +01:00
Angelia Dela Cruz ca14e2d950 MDL-74744 behat: Quiz behat generators use UI
Replace steps that manually add Quiz instances via the UI and use
Behat generators. This improves the speed of Behat test runs.
2022-05-24 10:52:04 +08:00
Jun Pataleta a7db400e61 MDL-74802 core: Improve the accessibility of alert notifications
* Make the ordering of the message and the close button logical on
  the DOM.
* Hide the times HTML entity
* Add sr-only label on the close button for non-sighted users
* Add tooltip on the close button sighted users
2022-05-23 13:01:32 +08:00
Daniel Ziegenberg 59d7b57a7a MDL-74835 ci: Update nodejs version in travis integration to lts/gallium
In MDL-73915 the nodejs version was switched to lts/gallium but the
travis integration was not updated.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-05-22 23:51:53 +02:00
Jun Pataleta 4bdedd7d56 MDL-73386 mod_quiz: Use plain text for quiz navigation fake block title
* No need to enclose the title of the quiz navigation fake block in
a span tag. The block title also gets appended to the skip link which
means that a block title with a span tag assigned with an identifier
can cause duplicate ID errors on the DOM.
2022-05-21 00:33:46 +08:00
Sujith Haridasan dbe2390e97 MDL-74577 core: Reset login_failed_count_since_success after login
When the user is logged in successfully then reset the value
of login_failed_count_since_success to zero, if the value of
login_failed_count_since_success is greater than zero.
2022-05-20 10:14:08 +05:30
james-cnz b24bef6b97 MDL-69637 course: Avoid unnecessary aria labels 2022-05-20 10:09:05 +12:00
Ilya Tregubov 2affa30359 weekly release 3.11.7+ 2022-05-19 19:24:34 +06:00
Ilya Tregubov 83ccb2913b Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-05-19 19:24:32 +06:00
Paul Holden a2a37f3cb5 MDL-73801 backup: set predictably ordered backup next start time.
Prior to this change, the testcase would assert ordering based on
identical fields which could lead to random failures. Set distinct
next start time of course backup, and also remove random ordering
by sorting on defined course order (all other fields being equal).
2022-05-19 08:18:56 +01:00
Jun Pataleta b388341f47 Merge branch 'MDL-73163-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-05-19 10:11:09 +08:00
Jun Pataleta 7261abf98d Merge branch 'MDL-74416-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-05-19 09:53:49 +08:00
Sara Arjona 1b9df59e3c MDL-74784 core_badges: Fix exception with related badges
System badges with related badges were displaying an error before this patch,
because the is_guest($context) function expects a context_course.
2022-05-18 09:18:05 +02:00
Paul Holden 10de05f5d6 MDL-73966 grade: fetch required user name fields of unenrolled users. 2022-05-17 16:03:12 +01:00
AMOS bot 4091db771e Automatically generated installer lang files 2022-05-17 00:07:36 +00:00
Paul Holden 8978466354 MDL-71276 message_email: include alternate email in privacy export. 2022-05-16 09:41:39 +01:00
Paul Holden 590088f118 MDL-74344 comment: consistent capability check for accessing report.
Co-authored-by: David Wipperfurth <dwipperfurth@webcourseworks.com>
2022-05-13 10:31:24 +01:00
AMOS bot 796a14a5ce Automatically generated installer lang files 2022-05-13 00:07:35 +00:00
Paul Holden 9b302f133a MDL-73013 calendar: fix serving of files added to category events. 2022-05-12 16:12:23 +01:00
Jun Pataleta b8e9cb31e9 weekly release 3.11.7+ 2022-05-12 22:16:09 +08:00
Leon Stringer 972744ee12 MDL-69951 filter_tidy: Replace drop-font-tags
The option drop-font-tags was removed in HTML Tidy version 5.5.14.  It
had been deprecated since 5.1.25, the docs said "Use the clean option
instead" which is what this commit does (see
https://api.html-tidy.org/tidy/quickref_5.1.25.html#drop-font-tags).
2022-05-12 11:36:55 +01:00
Jun Pataleta 98104be4f4 Merge branch 'MDL-74413_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-05-12 12:08:48 +08:00
Jun Pataleta e7e690e3b8 Merge branch 'MDL-73971_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-05-12 11:54:30 +08:00
Kordan 6ded74cc2a MDL-73163 behat: Changed most to must 2022-05-12 10:11:46 +08:00
Petr Skoda 1099b3f022 MDL-74416 phpunit: fix generator counters reset 2022-05-12 10:10:21 +08:00
Paul Holden 93315ab389 MDL-73898 user: exclude guest user from participants table. 2022-05-10 17:21:10 +01:00
Eloy Lafuente (stronk7) 875591f589 MDL-74413 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

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

Special mention to:

- Moved to the level2 "privacy" namespace:
  - \mod_assign\privacy\feedback_legacy_polyfill_test
  - \mod_assign\privacy\submission_legacy_polyfill_test

- Moved to the level2 "task" namespace:
  - \core_message\task\migrate_message_data_test
  - \ltiservice_gradebookservices\task\cleanup_test
  - \message_email\task\send_email_test
  - \mod_lti\task\clean_access_tokens_test
  - \mod_workshop\task\cron_task_test

- Moved to the level2 "event" namespace:
  - \core_h5p\event\deleted_test
  - \core_h5p\event\viewed_test

- Renamed to a better name:
  - backup_forum_activity_task_test.php (missing "task")
2022-05-07 20:33:48 +02:00
Jun Pataleta 4d48741ed7 Moodle release 3.11.7 2022-05-07 19:34:59 +08:00
Eloy Lafuente (stronk7) 1c33085ede MDL-73971 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

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

Special mention to:

- Some fixtures, initially defined in the test files have been
  moved to new files in fixtures subdirectory, leaving the unit
  test files clearer:
  - moodle2_course_format_test.php
- Rename wrong named test:
  - baseoptiogroup_test = baseoptigroup_test
2022-05-06 18:29:24 +02:00
Eloy Lafuente (stronk7) 199974b45d weekly release 3.11.6+ 2022-05-06 15:58:35 +02:00
Ferran Recio 464a4cb4d5 MDL-57065 theme_boost: fix debug messages
The first debug message is covered by the top navbar header. This patch
will move the body's first debug message down below the navbar.
2022-05-06 12:27:21 +02:00
Jun Pataleta 637c6fbbca Merge branch 'MDL-74511-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-05-06 11:57:59 +08:00
Andrew Nicols e2d9a7fcee MDL-74511 core: Add phpcs default config 2022-05-06 11:39:20 +08:00
Víctor Déniz b115058dc5 Merge branch 'MDL-74612-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-05-05 13:25:53 +01:00
Víctor Déniz fd5832fde9 Merge branch 'MDL-74567-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-05-05 09:40:06 +01:00
Paul Holden 8f375b3923 MDL-74567 core: re-factor flickr libraries to use shared user-agent. 2022-05-05 09:21:28 +01:00
Jun Pataleta 2970dfb52d Merge branch 'MDL-73981-311' of https://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2022-05-05 09:49:14 +08:00
Ilya Tregubov a174a570a6 MDL-73981 tool_uploadcourse: Validate enrolment role from csv. 2022-05-05 07:40:49 +06:00
Jun Pataleta 917d7e1003 Merge branch 'MDL-74511-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-05-05 09:37:39 +08:00
Jake Dallimore 83a8cfb9e4 MDL-73736 core_auth: Fix concurrency issue in login_attempt_failed()
This patch wraps the login_failed_count logic in a resource lock and
forces a user preferences cache reload. Each thread must wait for the
lock and must fetch the current count before incrementing it. This
ensures that login_failed_count is correct across threads and that the
lockout threshold is correctly honoured.

Co-Authored-By: Sujith Haridasan <sujith@moodle.com>
2022-05-04 14:45:15 +06:00
Michael Hawkins 947b6f202c MDL-74333 badges: Check profile criteria valid when reviewing 2022-05-04 12:58:14 +08:00
Ferran Recio 5ab6d18354 MDL-71623 core_search: fix user document visibility 2022-05-04 04:04:14 +02:00
Amaia Anabitarte e36332c01a MDL-74318 core_user: Description field as hidden on profile 2022-05-04 04:04:14 +02:00
Paul Holden 5f399aa81a MDL-74204 mod_assign: escape identity fields in allocate marker form. 2022-05-04 04:04:14 +02:00
Jun Pataleta 5b02f3bcf7 Merge branch 'MDL-73878-311' of https://github.com/aanabit/moodle into MOODLE_311_STABLE 2022-05-04 09:44:38 +08:00
Leon Stringer 8a6e4904bf MDL-74631 mod_lti: Remove </img>
Remove illegal HTML tag.

Added example context to pass CI checks.
2022-05-03 17:30:36 +01:00
Amaia Anabitarte 692657ffc4 MDL-73878 core_user: Creating a new category for social fields 2022-05-03 17:48:05 +02:00
Amaia Anabitarte 753373d6e6 MDL-73878 core_user: Fixing social fields upgrading issue 2022-05-03 17:39:23 +02:00
Jun Pataleta 43e181f391 Merge branch 'MDL-74543_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2022-05-03 22:21:17 +08:00
Ilya Tregubov 0cdb291d9e Merge branch 'mdl65478-fix-311' of https://github.com/matthewhilton/moodle into MOODLE_311_STABLE 2022-05-03 15:44:05 +06:00
Jake Dallimore 031004097b Merge branch 'MDL-74441-311' of https://github.com/cameron1729/moodle into MOODLE_311_STABLE 2022-05-03 16:55:14 +08:00
Cameron Ball 869c717e72 MDL-74441 mod_forum: Fix overflow in unified grader 2022-05-03 15:52:39 +08:00
Jason den Dulk 0536942919 MDL-65478 backup, course format: Handle editor elements in course format
Modified course format options reading and writing to be able to handle Editor elements by enabling them to split array values into
multiple values before inserting into database, and combining multiple values into an array when reading from the database.
Modified backup and restore code to use backup_nested_elements, and to interact directly with the database.

Co-authored-by: Jason den Dulk <jasondendulk@catalyst-au.net>
Co-authored-by: Matthew Hilton <matthewhilton@catalyst-au.net>
2022-05-03 14:18:53 +10:00
Víctor Déniz 5e5b39ee2c Merge branch 'MDL-73951-311' of https://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2022-05-02 11:13:19 +01:00
Jun Pataleta 055fff8005 Merge branch 'MDL-74436-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-05-02 16:30:19 +08:00
Paul Holden e7094cdb75 MDL-74612 cohort: use data generator for populating cohort members. 2022-04-29 16:23:38 +01:00
Michael Hawkins 3a5f610034 MDL-73951 core: Updated security.txt expiry date
Also updated expiry date format to meet latest standard.
2022-04-29 18:55:40 +08:00
Ilya Tregubov 44e3680153 weekly release 3.11.6+ 2022-04-29 07:55:36 +06:00
Ilya Tregubov 11db1b0193 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-04-29 07:55:33 +06:00
Paul Holden c4f95593a9 MDL-74567 repository_flickr: replace user-agent value for API calls.
Flickr doesn't like user agent that looks like a bot. Effectively the
same reasoning/fix as b8ee31a0.
2022-04-28 14:45:45 +01:00
Jun Pataleta 5957b238ef Merge branch 'MDL-74478-311' of https://github.com/mihailges/moodle into MOODLE_311_STABLE 2022-04-28 12:54:17 +08:00
Peter Dias 51a7a0aa3e MDL-74478 badges: Check completion_fail when awarding badge
Bring the award_criteria_activity checks in line with the observer checks
2022-04-28 12:25:54 +08:00
Ilya Tregubov 9bb6ed7c1c Merge branch 'MOODLE_311-MDL-74427-v4' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2022-04-28 08:11:07 +06:00
Jun Pataleta 1a01e66976 Merge branch 'MDL-74537-311-enfix' of https://github.com/vmdef/moodle into MOODLE_311_STABLE 2022-04-27 15:49:00 +06:00
Jake Dallimore 899e7e2103 Merge branch 'MDL-73672-311-patch' of https://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2022-04-27 15:49:00 +06:00
Ilya Tregubov 92509cdeae Merge branch 'MDL-74481-311-LTI13-InstructorRole' of https://github.com/cengage/moodle into MOODLE_311_STABLE 2022-04-27 15:49:00 +06:00
Ilya Tregubov af84b0ea22 MDL-73672 reports: Fix Behat step for classic theme. 2022-04-27 15:49:00 +06:00
Mikhail Golenkov 10ad537723 MDL-74427 question: Implement get_real_question_ids_in_category() 2022-04-27 13:42:23 +10:00
Helen Foster a576209dd1 MDL-74537 lang: Import fixed English strings (en_fix) 2022-04-26 11:28:57 +01:00
Paul Holden 1a76f2752a MDL-74436 calendar: validate course/category field during import. 2022-04-25 18:01:23 +01:00
Ilya Tregubov 8e0da918ab Merge branch 'MDL-73672-311' of https://github.com/BruceGoodGuy/moodle into MOODLE_311_STABLE 2022-04-25 10:03:11 +06:00
AMOS bot ff3fd8a222 Automatically generated installer lang files 2022-04-23 00:07:34 +00:00
Eloy Lafuente (stronk7) 0127abe30e weekly release 3.11.6+ 2022-04-22 18:03:54 +02:00
Ilya Tregubov a0aaa3cacf Merge branch 'MDL-74394_311' of https://github.com/aolley/moodle into MOODLE_311_STABLE 2022-04-22 08:00:52 +06:00
Tim Hunt d02d01aa71 MDL-74543 quiz: correctly record time when overdue attempt submitted 2022-04-21 22:25:28 +01:00
Andrew Nicols b9e3bcb748 MDL-74511 core: Add phpcs config generator 2022-04-19 11:16:46 +08:00
Ilya Tregubov 447067d874 weekly release 3.11.6+ 2022-04-15 16:03:07 +06:00
Ilya Tregubov 282e60115d Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-04-15 16:03:05 +06:00
Claude Vervoort d3f3da7277 MDL-74481 mod_lti: fix role lookup for LTI 1.3 2022-04-13 13:03:28 -04:00
Sara Arjona 7228428479 Merge branch 'MDL-74486-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-04-13 16:59:01 +02:00
Mihail Geshoski 53a493030c MDL-73672 reports: fix navigation when clicking on parent Reports link 2022-04-13 17:08:14 +07:00
Huong Nguyen 3fc5d0dec3 MDL-74486 tool_usertours: Prevent step to inherit theme background image 2022-04-13 09:49:42 +07:00
AMOS bot b6ccf35285 Automatically generated installer lang files 2022-04-12 00:07:35 +00:00
Ilya Tregubov 4af82f5154 weekly release 3.11.6+ 2022-04-08 16:39:53 +06:00
Ilya Tregubov 5855059608 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-04-08 16:39:51 +06:00
Ilya Tregubov 9a7bdedc5a Merge branch 'MDL-73555_311_toolbrickfieldsummaryprocessing' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2022-04-08 09:24:38 +06:00
Andrew Nicols b276bfce77 Merge branch 'MDL-74438-311' of https://github.com/cameron1729/moodle into MOODLE_311_STABLE 2022-04-08 11:04:02 +08:00
Shamim Rezaie 8d2f2e7d37 Merge branch 'MDL-73874-311' of https://github.com/BruceGoodGuy/moodle into MOODLE_311_STABLE 2022-04-08 12:39:13 +10:00
Cameron Ball 705e6c5614 MDL-74438 cache: Check if cached value is boolean false 2022-04-08 10:10:44 +08:00
Víctor Déniz 48f1e6165d Merge branch 'MDL-74419-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-04-07 20:25:13 +01:00
Eloy Lafuente (stronk7) 917369b8ef Merge branch 'MDL-74434-311' of https://github.com/mihailges/moodle into MOODLE_311_STABLE 2022-04-07 17:11:58 +02:00
Khoa Nguyen Dang 81e7828600 MDL-73874 Questions: Add new validation for Drag and drop into text 2022-04-07 17:21:36 +07:00
Andrew Nicols a5776a4bbe Merge branch 'MDL-74202-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-04-07 15:29:14 +08:00
Sara Arjona 7917f9a509 Merge branch 'MDL-58044_311' of https://github.com/Chocolate-lightning/moodle into MOODLE_311_STABLE 2022-04-07 09:16:13 +02:00
Mihail Geshoski c15ffa0e88 MDL-74434 block_tag_youtube: Update instances only if category is set
Modifies the existing upgrade step to only take into consideration
block instances that have a specific category set prior to determening
if a legacy category is being used and updating them. Instances that do
not have any category set should be ignored.
2022-04-07 13:26:08 +08:00
Nadav Kavalerchik 36c1a657b4 MDL-58044 report/progress: Fix table headers labels display in RTL mode. 2022-04-07 14:15:30 +12:00
AMOS bot 9fc20a6fef Automatically generated installer lang files 2022-04-07 00:07:31 +00:00
Víctor Déniz c07e077f04 Merge branch 'MDL-74189-311' of https://github.com/mihailges/moodle into MOODLE_311_STABLE 2022-04-06 22:56:23 +01:00
Jun Pataleta 0e9eddf51e Merge branch 'MDL-74332-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2022-04-07 00:35:13 +08:00
Mihail Geshoski c0462feec8 MDL-74189 tool_moodlenet: Add upgrade step to remove irrelevant data
Upgrade step to identify all existing cases where users have linked
their MoodleNet profile on the site and remove the related data from
the database. Due to some recent changes on the MoodleNet platform,
this data is now irrelevant and can no longer be used to authenticate
on the MoodleNet platform.
2022-04-06 23:33:37 +08:00
Mihail Geshoski 711e2b006f MDL-74189 tool_moodlenet: Update language strings
Updates the existing language strings in order to provide more accurate
instructions on how users can link existing their MoodleNet profile on
the site.
2022-04-06 23:31:53 +08:00
Sara Arjona 45e81f4818 Merge branch 'wip_MDL-59545_m311' of https://github.com/gjb2048/moodle into MOODLE_311_STABLE 2022-04-06 12:42:14 +02:00
Sara Arjona ac822d9655 MDL-74419 search_simpledb: Search with quotes not working on Oracle
Global search with quotes is not working on DB engines without
full-text search support (i.e. Oracle).
2022-04-06 11:50:54 +02:00
Jake Dallimore 0907ff86f8 Merge branch 'MDL-74371-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2022-04-06 12:26:25 +08:00
Jake Dallimore a52378726e Merge branch 'MDL-74424-311' of https://github.com/mihailges/moodle into MOODLE_311_STABLE 2022-04-06 12:15:45 +08:00
Sujith Haridasan a2dd8127f0 MDL-74371 mod_survey: Wordrap long questions in response reports
Word wrap long questions in Response reports so that the users dont
see broken questions in the questions page.
2022-04-06 09:38:16 +05:30
AMOS bot e9cf945617 Automatically generated installer lang files 2022-04-06 00:07:31 +00:00
Mihail Geshoski 64bc864e2e MDL-74424 repository_googledocs: Update phpunit tests 2022-04-06 01:43:35 +08:00
Mihail Geshoski e34a301fd0 MDL-74424 repository_googledocs: Respect default import formats
Makes sure that the correct file extension is attributed when importing
a file using the Google Drive repository based on the set configuration
values for the default import format settings.
2022-04-06 01:43:34 +08:00
Eloy Lafuente (stronk7) 339c473b9c Merge branch 'MDL-74330-311-enfix' of https://github.com/vmdef/moodle into MOODLE_311_STABLE 2022-04-05 18:39:43 +02:00
Sara Arjona 62dec781bb weekly release 3.11.6+ 2022-04-05 13:24:48 +02:00
Sara Arjona a76e8e9fbe Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-04-05 13:24:46 +02:00
Víctor Déniz 1a9cb490ba Merge branch 'MDL-74113-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-04-04 20:06:25 +01:00
Sara Arjona ceef8c7e1b Merge branch 'MDL-74383-311' of https://github.com/mihailges/moodle into MOODLE_311_STABLE 2022-04-04 15:46:25 +02:00
Víctor Déniz f8a83d8a67 MDL-74330 lang: Replace modified strings in tests 2022-04-04 10:29:40 +01:00
Helen Foster a6773e6664 MDL-74330 lang: Import fixed English strings (en_fix) 2022-04-04 10:29:40 +01:00
Sujith Haridasan fb9fdc4754 MDL-74332 mod_survey: Indent the file properly
Correct the indentation of the file.
Replaced print_error with moodle_exception.
Updated the comments to start with capital and end with fullstop.
2022-04-04 11:45:40 +05:30
Jun Pataleta 4194bdf0fd Merge branch 'MDL-70014_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-04-04 13:56:23 +08:00
Jun Pataleta 710099242f Merge branch 'MDL-74096-311' of https://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2022-04-04 13:05:52 +08:00
Sujith Haridasan aee71c329d MDL-74332 mod_survey: Critical incidents dont require summary and scales
Do not show summary and scales for the survey with critical
incidents. So critical incidents survey would have questions
and participants only under response reports.
Also corrected the heading for the Questions page.
2022-04-04 09:59:03 +05:30
Mihail Geshoski b72e73d6de MDL-74383 assignfeedback_editpdf: Fix comment issues in the pdf editor 2022-04-04 10:56:32 +08:00
Mihail Geshoski 9a75af7805 MDL-74383 assignfeedback_editpdf: 'Annotated PDF' link style update 2022-04-04 10:56:31 +08:00
AMOS bot a0653230c5 Automatically generated installer lang files 2022-04-04 00:07:28 +00:00
Gareth Barnard 802f6b3fa1 MDL-59545 navigation: Missing editing icons on activity pages 2022-04-03 21:58:03 +01:00
Eloy Lafuente (stronk7) 55198f851c MDL-70014 tool_customlang: Workaround to make behat happier
This is a BEHAT_RUNNING only hack, so it doesn't affect normal
operations at all. What it achieves is to reduce the number of
strings loaded when customising a lang pack from current 31K ones
to the just needed ones for Behat testing purposes.

That way we avoid the random failures that are happening more and
more (while the "en" lang pack grows) and also save some precious
minutes in every behat run.

Also, unrelated, a couple of tiny changes:
- Modified constant (that was really outdated) to current number
  of lang strings (so the progress bar behaves better).
- Remove an elseif occurrence because it was hurting my eyes.
2022-04-01 23:57:09 +02:00
Sara Arjona a4c654d67c Merge branch 'MDL-74286-311' of https://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2022-04-01 17:34:36 +02:00
Sara Arjona 6e7c7a7e2e weekly release 3.11.6+ 2022-04-01 16:40:47 +02:00
Sara Arjona eb3a220af8 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-04-01 16:40:45 +02:00
Ilya Tregubov d3b25ce4d9 MDL-74096 mlbackend_python: Update mlbackend version. 2022-04-01 16:30:15 +06:00
Adam Olley 7e29aee395 MDL-74394 mnet: Better check for openssl_get_publickey() failure
In PHP8, this func now returns an object of type OpenSSLAsymmetricKey, not a
resource.

Reference:
https://www.php.net/manual/en/function.openssl-pkey-get-public.php
2022-04-01 14:33:31 +10:30
Jun Pataleta 556236134a Merge branch 'MDL-74390_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2022-04-01 11:45:23 +08:00
Huong Nguyen b1bad66d46 MDL-74113 atto_media: Listen to play/pause events 2022-04-01 10:04:47 +07:00
Andrew Nicols 660b5b0045 Merge branch 'MDL-69552-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-04-01 10:57:46 +08:00
Andrew Nicols d28f836536 Merge branch 'MDL-70731-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-04-01 10:26:47 +08:00
Tim Hunt 6b8ae1c193 MDL-74390 filter admin: log filter order changes in config_log 2022-03-31 16:50:19 +01:00
Jun Pataleta 2a606b6a10 MDL-70731 mod_forum: Fix moodle_exception error messages 2022-03-31 22:51:16 +08:00
Andrew Nicols 96cbdb8452 Merge branch 'MDL-72446_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-31 22:33:10 +08:00
Ilya Tregubov 1a9775cb82 Merge branch 'MOODLE_311_MDL-73948-v4' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2022-03-31 15:41:02 +06:00
Eloy Lafuente (stronk7) 7806534af2 MDL-72446 behat: Ensure that the day reset happens on enabled element
Before this change we were setting the month day to 1 unconditionally
and that was working ok for enabled by default elements.

But in a number or cases we were doing that against disabled elements
so the day reset was not happening. Now we wait for the element to
be enabled and only then proceed with the day reset.

Backed with tests using disabled form elements, so we have now
both enabled and disabled fields covered.
2022-03-31 11:30:22 +02:00
Mikhail Golenkov f994a89ce5 MDL-73948 report_loglive: Fix missing records 2022-03-31 18:36:38 +11:00
Huong Nguyen ae1a4cf5a7 MDL-69552 Quiz: Fix tag filter does not work when adding random question 2022-03-31 11:59:04 +07:00
AMOS bot e1d2f92bda Automatically generated installer lang files 2022-03-31 00:07:32 +00:00
Víctor Déniz 0faeb73989 Merge branch 'MDL-74205-311' of https://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2022-03-30 09:52:17 +01:00
Jun Pataleta 54ca52c917 Merge branch 'MDL-71801-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2022-03-30 16:14:03 +08:00
Jun Pataleta f3ea59897e Merge branch 'MDL-74231_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-30 14:28:19 +08:00
Ilya Tregubov d9a3ef29ce MDL-74205 navigation: Don't show participants link to user if he has no permission. 2022-03-30 10:44:13 +06:00
Eloy Lafuente (stronk7) 224038fc65 MDL-74231 grader report: Fix case where old settings are empty / null
There is an edge case in the conversion from old collapse/expand
settings (stored as user preference) to the new ones that can lead
to notices / warnings / errors.

Before PHP 8, they weren't being detected, but now they are.

Basically, if some of the expected components of the preferences
are missing, then some array (array_diff(), array_intersect()..)
operations now are failing, because now those parameter functions
do require to be arrays (so empty strings or nulls aren't allowed).

Also, there were some cases where the old preference was not being
removed ever, so its removal has been moved to a common place at
the end of the function, where it's always evaluated in case
the preference still exists but is empty of contents.

I've tried to cover all the cases I've been able to imagine with
unit tests (empty information, some component not set, all components
not set...), have moved it to a new unit test because the one
already performing some tests with those old preferences was
already too long to add more cases.
2022-03-29 23:47:50 +02:00
Eloy Lafuente (stronk7) 3ab09c775d weekly release 3.11.6+ 2022-03-29 17:53:55 +02:00
Eloy Lafuente (stronk7) 065bcc9a3a Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-03-29 17:53:51 +02:00
Jake Dallimore 962f75ec53 MDL-71801 mod_lti: set default keytype value when upgrading tool types
MDL-66920 added this field but didn't set defaults for upgrading tool
types. This patch fixes that for any 1.3 tools which don't yet have a
value for this field.
2022-03-29 14:10:23 +08:00
Andrew Nicols 982e4df1f1 Merge branch 'MDL-74117-311' of https://github.com/rezaies/moodle into MOODLE_311_STABLE 2022-03-29 11:25:06 +08:00
Jun Pataleta d1d96d4902 Merge branch 'MDL-74110-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-29 10:51:00 +08:00
Víctor Déniz 5c2be62c94 Merge branch 'MDL-74321-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-03-28 22:48:59 +01:00
Jun Pataleta cc05ca22da Merge branch 'MDL-74279_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-28 23:29:05 +08:00
Andrew Nicols f5b9056370 Merge branch 'MDL-74299-311' of https://github.com/ericmerrill/moodle into MOODLE_311_STABLE 2022-03-28 15:52:34 +08:00
Shamim Rezaie 03a003289a MDL-74117 theme_boost: Only focus the trigger if nothing else is focused 2022-03-28 18:20:10 +11:00
Jun Pataleta a8011f89c8 MDL-74321 mod_forum: Add forum_check_throttling unit tests 2022-03-28 14:40:29 +08:00
Jun Pataleta 8a9fea33e2 MDL-74321 mod_forum: Forum_check_throttling improvements and fixes
* Fetch only the fields required by the function.
* Quick validation of the passed forum parameter. If the forum parameter
is an object, it should have the forum ID and the course ID.
* Default return when there's no need to show a warning yet.
2022-03-28 14:40:28 +08:00
Jun Pataleta 9d827a29a4 MDL-74321 mod_forum: Pass course module to forum_check_throttling() 2022-03-28 14:40:26 +08:00
Jun Pataleta 2c2686d66e MDL-74321 mod_forum: forum_check_throttling performance improvements
* Return early if the forum's blockafter or blockperiod attributes
are empty.
* If $cm is not passed in forum_check_throttling(), try to fetch it
using get_fast_modinfo() which avoids DB reads. Fetch it via
get_coursemodule_from_instance() as a last resort (though it's unlikely
to happen).
2022-03-28 14:40:25 +08:00
Ilya Tregubov 0d05e7696f Merge branch 'MDL-59681-recursive-file-311' of https://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2022-03-28 12:06:10 +06:00
Brendan Heywood 56846834e4 MDL-59681 file: Stop recursive file serving 2022-03-28 11:57:04 +06:00
Eloy Lafuente (stronk7) 5e1cee2bd4 Merge branch 'MDL-72634-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-27 16:50:46 +02:00
Eloy Lafuente (stronk7) e34536fc05 Merge branch 'MDL-74306-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-27 16:04:25 +02:00
Eloy Lafuente (stronk7) 54ecc0d0d7 MDL-74279 phpunit: Tests using sqlsrv AdoDB must reset settings
AdoDB SQL*Server drivers use to modify some error and
logging preferences. As far as the connection is shared
with the main one, that implies that those settings
remain for the whole remaining execution.

We don't want his in tests, because can affect to other
tests at distance.

We are fixing this here, only for tests, because it
doesn't affect normal requests and because, once we
remove AdoDB this won't be needed anymore.
2022-03-26 18:43:30 +01:00
AMOS bot 419f6d6d5c Automatically generated installer lang files 2022-03-26 00:07:28 +00:00
Víctor Déniz 49171c9f6e weekly release 3.11.6+ 2022-03-25 15:00:24 +00:00
Víctor Déniz 53a2efa29f Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-03-25 15:00:19 +00:00
Paul Holden 8e19d73c2b MDL-74202 webservice: fix protocol type in exception message. 2022-03-25 09:53:15 +00:00
Jun Pataleta 432bd19d5a Merge branch 'MDL-74143_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-25 13:12:38 +08:00
Ferran Recio 7eee5bff29 MDL-74286 gradereport_grader: fix overlap scale selector 2022-03-24 15:50:58 +01:00
Víctor Déniz 60d07529d0 Merge branch 'MDL-74307-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2022-03-24 09:19:48 +00:00
Jun Pataleta 81d104300b Merge branch 'MDL-74274-311' of https://github.com/peterRd/moodle into MOODLE_311_STABLE 2022-03-24 16:33:26 +08:00
Eric Merrill 7fc6677853 MDL-74299 question: Don't use a strict comparison for DB objects 2022-03-23 19:20:37 -04:00
Eloy Lafuente (stronk7) f8037d326d MDL-74143 database: Make get_indexes() to return original column names
Sometimes, in order to provide a cross-db behaviour of unique indexes
mixing null and not null columns, we create, under the hood, some
function based indexes.

When that happens get_indexes() is returning the name of the
expression objects used to calculate that function index. But we need
the original column names to be able to compare indexes and get
column dependencies properly.

So, this patch just looks, when the index is unique and function based,
to the expressions (pretty standard CASE statements) and gets the
original column name from it.

Covered with tests.
2022-03-23 23:17:30 +01:00
Claude Vervoort 411416a37a MDL-74310 mod_lti: fix ltilinkid on lineitems import 2022-03-23 16:38:56 -04:00
Paul Holden baba2c573e MDL-74306 mod_assign: fix undefined property in override cache key. 2022-03-23 18:56:17 +00:00
Sara Arjona 08b121599e Merge branch 'MOODLE_311_MDL-48633' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2022-03-23 15:14:32 +01:00
Sara Arjona 2532fc2a15 Merge branch 'MDL-74283-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-23 13:53:23 +01:00
Sara Arjona f31b3f4d55 Merge branch 'MDL-57383-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-23 13:51:16 +01:00
Ilya Tregubov b6327f4435 Merge branch 'MDL-74121-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2022-03-23 17:22:33 +06:00
Sujith Haridasan 7745c451fd MDL-74307 core_search: Use PARAM_ALPHANUMEXT for $areaid
Use PARAM_ALPHANUMEXT for $areaid as areaid can also be
say mod_h5pactivity. When PARAM_ALPHAEXT is used it would
become mod_hpactivity and would cause exception in code flow.
2022-03-23 14:53:16 +05:30
Sujith Haridasan 290ee98681 MDL-74121 mod_forum: Fix the posting threshold issue
When a student post exceeds the posting threshold
block then 'Add discussion topic' button should not be shown.
Also the student cannot reply to a topic if this is exceeded.
2022-03-23 14:23:13 +05:30
Peter Dias 12c5859ad2 MDL-74274 lesson: Set maxattempts reached when retries allowed 2022-03-23 10:36:38 +08:00
AMOS bot b364d2b8fe Automatically generated installer lang files 2022-03-23 00:07:26 +00:00
Paul Holden 3dd97076d9 MDL-74283 dml: replace hardcoded concat SQL with appropriate API. 2022-03-22 17:32:41 +00:00
Paul Holden 4a61fc1e76 MDL-72634 user: populate default city/country during user creation. 2022-03-22 17:28:01 +00:00
Sara Arjona ced37870e6 MDL-74184 behat: Unrelated, remove the @skip_interim tag
This commit is UNRELATED to the MDL-74184, but we need the
@skip_interim tag removed to a couple of scenarios that were
causing lots of noise and failures @ci infrastructure.
MDL-74265 was created to deal with this issue but these jobs
are now passing, and nothing has been changed...

So we are using MDL-74184 (this extra commit) to remove that
tag (sorry for the noise).
2022-03-22 17:23:38 +01:00
Sara Arjona 008443efdd Merge branch 'MDL-74184_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2022-03-22 16:42:08 +01:00
Mikhail Golenkov a01201ec4c MDL-48633 mod_lesson: Fix lesson grade handling when scales in use 2022-03-22 23:03:41 +11:00
Sara Arjona 25f22a3cb7 weekly release 3.11.6+ 2022-03-22 12:54:47 +01:00
Sara Arjona 7c585543e9 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-03-22 12:54:44 +01:00
Tim Hunt 039953f01a MDL-74184 quiz: prevent repagination of quizzes with attepts
There was a loophole to this rule on the settings form, which is now fixed.
2022-03-22 10:35:40 +00:00
Ilya Tregubov 66165e081d Merge branch 'MDL-74169-311' of https://github.com/FMCorz/moodle into MOODLE_311_STABLE 2022-03-22 08:48:12 +06:00
Jun Pataleta 5a8d478e3d Merge branch 'MDL-72698_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-22 10:19:26 +08:00
Eloy Lafuente (stronk7) 81da9e8ab2 MDL-72698 behat: fix problem with FF, not able to auto-scroll iframes
The "Save changes" button in the SCORM package falls out from the
viewport and that seems to be a problem for Firefox, not being able
to auto-scroll to it before clicking.

So we are just making the window 200 points taller and that
makes the button to be visible (within the viewport) and clickable.

Also, change the way we "wait" at the end of the scenario and,
instead of reloading, we re-visit one of the contents to allow
completion to be ready for final assertions.
2022-03-22 01:37:39 +01:00
AMOS bot 39d832251f Automatically generated installer lang files 2022-03-22 00:07:28 +00:00
Sara Arjona 6f5dd17b43 Merge branch 'MDL-74225-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-21 12:59:36 +01:00
Sara Arjona a15d2100b4 Merge branch 'MDL-74183-311' of https://github.com/ericmerrill/moodle into MOODLE_311_STABLE 2022-03-21 12:41:17 +01:00
Frédéric Massart 7eb557e695 MDL-74169 core_message: Hide preferences link when permissions lacking 2022-03-21 18:38:05 +08:00
Paul Holden 1e2c2c5a2a MDL-74110 forms: disable calendar link when date selector disabled. 2022-03-21 09:34:14 +00:00
Jun Pataleta 0b463d4203 Merge branch 'MDL-72698_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-21 17:13:50 +08:00
Eloy Lafuente (stronk7) c74979a798 MDL-72698 behat: Reduce random lesson behat failures on slow envs
In very slow environments viewing the lesson page for a student takes
more than 1 second and, because of this, the "Spend at least 1 sec"
completion condition is considered done.

So, in order to alleviate this problem, that leads to random failures
in CIs with slow databases, we have changed the condition to be 3
seconds instead.

That seems to do the work in super-slow environments, with 100
executions passing ok (when previously the scenario was failing 33%
of times).

The only cost is that now the behat run will be 2 seconds slower (there
is a wait changed from 2 to 4 seconds), but that's an acceptable
price to pay to get the scenarios consistent passing.

See the issue for more details.
2022-03-19 18:11:02 +01:00
Eloy Lafuente (stronk7) 7bd1ca51c9 MDL-72698 behat: Reduce random scorm behat failures on slow envs
This just applies two "tricks" to make the test to behave better:
- Ensuring that the "wait until the page is loaded" happens in the scorm frame.
- Ensuring that the last item in the package gets some extra time
  by reloading the page completely at the end.

With them, a testing environment with a 100% of failures has become 100%
passing (25 repetitions). That should be good enough to reduce the
impact of that failure everywhere.

See the issue for more details.
2022-03-19 18:10:54 +01:00
Andrew Nicols b463787e70 Merge branch 'MDL-74199-311' of https://github.com/aanabit/moodle into MOODLE_311_STABLE 2022-03-19 22:00:41 +08:00
Andrew Nicols dd1cd6cd8b Merge branch 'MDL-74258-311' of https://github.com/cescobedo/moodle into MOODLE_311_STABLE 2022-03-19 21:54:52 +08:00
Andrew Nicols cd112cf93f Merge branch 'MDL-74270_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2022-03-19 21:42:54 +08:00
Tim Hunt 5ab43fb1b3 MDL-74270 format_float: fix bug with $decimalpoints=0, $stripzeros=true 2022-03-18 22:23:31 +00:00
cescobedo 08e4bc556c MDL-74258 mod_h5pactivity: Add global search to h5pactivity 2022-03-18 17:10:42 +01:00
Sara Arjona 8a5bea2bc3 weekly release 3.11.6+ 2022-03-18 16:28:17 +01:00
Sara Arjona 263a17676b MDL-74116 behat: Unrelated, add the @skip_interim tag
This commit is UNRELATED to the MDL-74116, but we need the
@skip_interim tag added to a couple of scenarios that are
causing lots of noise and failures  @CI infrastructure.
MDL-74265 has been created to deal with this issue.

So we are using MDL-74116 (this extra commit) to add that tag
(sorry for the noise).
2022-03-18 13:46:10 +01:00
Eloy Lafuente (stronk7) 3f6999f42e Merge branch 'MDL-69078-M311_better-error-message-for-wrong-encoding' of https://github.com/ziegenberg/moodle into MOODLE_311_STABLE 2022-03-17 22:24:12 +01:00
Daniel Ziegenberg 8b7d96ca68 MDL-69078 questions: check for UTF-8 encoding of the import file
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-17 21:36:27 +01:00
Eloy Lafuente (stronk7) 4f5bdfcc0c Merge branch 'MDL-74159-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-03-17 18:08:37 +01:00
Andrew Nicols 77655b1ba3 Merge branch 'MDL-72991-311-2' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-03-17 22:25:19 +08:00
Sara Arjona 2fae9b9849 Merge branch 'MDL-74214-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-17 13:11:54 +01:00
Jun Pataleta e9827edb0a Merge branch 'MDL-74112-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-03-17 17:08:55 +08:00
Sara Arjona bce68bd0c4 Merge branch 'MDL-74127-311' of https://github.com/peterRd/moodle into MOODLE_311_STABLE 2022-03-17 09:15:08 +01:00
Jun Pataleta 8c34c3ed08 Merge branch 'MDL-73597-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-03-17 15:50:30 +08:00
Andrew Nicols 7da1d94956 MDL-74112 course: Support multiple mforms in format chooser
The format chooser JS assumes that it is the only mform on the page. If
it is not, and another mform appears before it, then the jump will not
work.
2022-03-17 10:55:43 +08:00
Peter Dias 125b689a5c MDL-74127 lesson: Show remaining attempts on all types of jumps
- Show remaining attempts on all types of jumps
- Highlight the lesson tab when viewing the continue page.
2022-03-17 09:10:28 +08:00
Eloy Lafuente (stronk7) 8e2b50aec5 Merge branch 'MDL-74116-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-03-16 22:19:20 +01:00
Andrew Nicols 74f0fe1e77 MDL-74116 behat: Fix browser instantiation for Selenium 4 2022-03-16 22:29:10 +08:00
Sara Arjona 55e1312f88 Merge branch 'MDL-74073-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-03-16 12:05:24 +01:00
Paul Holden 0c6b884060 MDL-74225 dataformat: load plugin settings into admin tree. 2022-03-16 09:43:01 +00:00
Huong Nguyen 7d764cde8b MDL-73597 Questions: Form checker integration for D&D question types 2022-03-16 16:29:19 +07:00
Jun Pataleta 576020ce6a MDL-74073 core_form: Set aria-expanded values for expand/collapse all 2022-03-16 14:00:28 +08:00
Ilya Tregubov 22fb553178 Merge branch 'MDL-74144-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-16 10:37:35 +06:00
Ilya Tregubov 820cac7677 Merge branch 'MDL-73344-311' of https://github.com/peterRd/moodle into MOODLE_311_STABLE 2022-03-16 10:05:20 +06:00
Eloy Lafuente (stronk7) 1dcfa8fffe Merge branch 'MDL-74141-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-03-15 23:38:26 +01:00
Paul Holden ba53bf48a7 MDL-57383 tool_uploaduser: don't overwrite auth during update.
If updating users during upload along with the option to fill in
missing fields from file content, then we should exclude the auth
column because it will always be present for a user.
2022-03-15 17:20:09 +00:00
Amaia Anabitarte 7b8c92106a MDL-74199 core_user: Remove breadcrumbs on private files 2022-03-15 18:10:35 +01:00
Eloy Lafuente (stronk7) b25dce473b Merge branch 'MDL-74131-311' of https://github.com/aanabit/moodle into MOODLE_311_STABLE 2022-03-15 16:54:47 +01:00
Eloy Lafuente (stronk7) 911441bf43 Merge branch 'MDL-74156-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-03-15 15:38:15 +01:00
Paul Holden 8dc128313a MDL-74214 forms: re-calculate calendar panel zIndex each time.
The previous iteration only calculated it's zIndex value on
initial load. This meant that any nodes added subsequent to this
would not be taken into account (e.g. modal forms).
2022-03-15 13:57:29 +00:00
Sara Arjona e14a534ce1 Merge branch 'MDL-73979-311-2' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-03-15 12:29:03 +01:00
Sara Arjona 5aacd4ba77 Merge branch 'MDL-74130_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2022-03-15 12:19:17 +01:00
Sara Arjona ed0dacbb5d weekly release 3.11.6+ 2022-03-15 11:30:30 +01:00
Huong Nguyen 62a909f91a MDL-72991 Course: Improve coursemodinfo cache performance
- New course_modinfo::get_array_of_activities() function was created to reduce
   the unnecessary DB call
 - New course_modinfo::purge_course_cache function was created to purge the cache of a given course
2022-03-15 10:57:12 +07:00
Huong Nguyen 1f85802f86 MDL-72991 Course: Fix move_section_to is not updating correct section
When we change the position of two sections, we just need to update
the position of the affected sections, not all the sections in the course.
This will improve the performance since the system only executes the queries to affected sections.
Also, the system only clears the cache for affected sections, not all the sections in the course.
2022-03-15 10:37:55 +07:00
Eric Merrill 109bac00c8 MDL-74183 completion: Protect against index conflict in cron 2022-03-14 22:56:38 -04:00
Sara Arjona d789be92ae Merge branch 'MDL-74179-311' of https://github.com/cescobedo/moodle into MOODLE_311_STABLE 2022-03-14 18:48:49 +01:00
cescobedo ba26cf7c90 MDL-74179 mod_chat: Fix warnings header when accessing as a guest
Initialize  before showing the no guest message
when user is accesing as a guest.
2022-03-14 11:08:58 +01:00
Amaia Anabitarte f0170da7ec MDL-74131 tags: Fix flagged tags color contrast 2022-03-14 09:59:54 +01:00
Sara Arjona 2fe08752e6 Merge branch 'MDL-73629-311_color_errors' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2022-03-14 08:37:14 +01:00
Eric Merrill 313aedcf13 MDL-74182 core_task: Obey CFG debug settings 2022-03-13 23:57:27 -04:00
Mike Churchward 42c4d51f7c MDL-73629 tool_brickfield: Ensuring colour check causes no errors. 2022-03-11 15:21:07 -05:00
Huong Nguyen b635c658c8 MDL-73979 timeline: Views should display consistent information
The course view is updated to display the events that match
the filter condition, no matter the course start date is in the future
or the course end date is in the past
2022-03-11 09:46:05 +07:00
Sara Arjona c604750339 MDL-74159 output: Add icon near docs link
An icon has been added near the 'Help and documentation' link in the
site footer When the site admin setting 'Open in new window' (doctonewwindow)
is enabled, for consistency with other similar links like 'Give feedback
about this software'.

Apart from that, now the link will be opened using the standard target
'_blank' instead of using the new window Javascript, to let users decide
whether the new page should be opened in a new tab or a new window.
2022-03-10 17:18:01 +01:00
Sara Arjona 87a6da0d59 MDL-74141 tool_task: Display error when Path to CLI not defined
When "Path to PHP CLI" is not defined, an exception with the message
in cannotfindthepathtothecli should be displayed, and the page should
be redirected to System paths settings page.

Apart from that, this patch also replaced core_task to tool_task,
because this message wasn't traslated properly.
2022-03-10 16:25:02 +01:00
Tim Hunt 37b3397bea MDL-74130 question behat: Update tests to use the new navigation steps 2022-03-10 09:29:24 +00:00
Jun Pataleta f8ebec2da5 MDL-74156 block: Remove redundant configure block headings 2022-03-10 16:47:27 +08:00
Tim Hunt 8af6174946 MDL-74130 question behat: support I am on ... page or key qbank pages 2022-03-09 14:46:36 +00:00
Paul Holden 767d46be4c MDL-74144 user: add cancel button to user private files form. 2022-03-09 11:43:43 +00:00
Peter Dias c64dc2e545 MDL-73344 reports: Include the user/report node based on context
Properly indicate the report node based on context.
2022-03-08 14:02:22 +08:00
Frederik Milling Pytlick c73673f2f3 MDL-73702 reports: Fixed report_helper
Made the report_helper make sure there was an action before trying to output it
2022-01-27 11:04:27 +01:00
Max Larkin 4c53ddf46b MDL-73555 tool_brickfield: More efficient summary data processing 2022-01-20 11:42:21 -05:00
2239 changed files with 26019 additions and 15808 deletions
+12 -9
View File
@@ -13,14 +13,14 @@ env:
jobs:
Grunt:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Checking out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Configuring node & npm
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
@@ -54,11 +54,11 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
- os: ubuntu-22.04
php: 7.3
extensions:
db: mysqli
- os: ubuntu-18.04
- os: ubuntu-22.04
php: 8.0
db: pgsql
extensions: xmlrpc-beta
@@ -66,7 +66,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 +74,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' }}
@@ -85,7 +87,7 @@ jobs:
postgresql password: test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v3.x
uses: rlespinasse/github-slug-action@v4
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
@@ -96,7 +98,7 @@ jobs:
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setting up PHPUnit
env:
@@ -111,4 +113,5 @@ jobs:
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
run: vendor/bin/phpunit -v
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options
+2
View File
@@ -51,3 +51,5 @@ moodle-plugin-ci.phar
.eslintignore
.stylelintignore
/jsdoc
phpcs.xml
jsconfig.json
+2 -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');
@@ -233,6 +233,7 @@ const getOwningComponentDirectory = checkPath => {
};
module.exports = {
fetchComponentData,
getAmdSrcGlobList,
getComponentFromPath,
getComponentPaths,
+39
View File
@@ -21,6 +21,43 @@
*/
module.exports = grunt => {
/**
* Generate the PHPCS configuration.
*
* @param {Object} thirdPartyPaths
*/
const phpcsIgnore = (thirdPartyPaths) => {
const {toXML} = require('jstoxml');
const config = {
_name: 'ruleset',
_attrs: {
name: "MoodleCore",
},
_content: [
{
rule: {
_attrs: {
ref: './phpcs.xml.dist',
},
},
},
],
};
thirdPartyPaths.forEach(library => {
config._content.push({
'exclude-pattern': library,
});
});
grunt.file.write('phpcs.xml', toXML(config, {
header: true,
indent: ' ',
}) + "\n");
};
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
@@ -52,6 +89,8 @@ module.exports = grunt => {
'jsdoc/styles/*.css',
].concat(thirdPartyPaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n') + '\n');
phpcsIgnore(thirdPartyPaths);
};
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', handler);
+3
View File
@@ -47,6 +47,9 @@ module.exports = grunt => {
// Load ESLint.
require('./eslint')(grunt);
// Load jsconfig.
require('./jsconfig')(grunt);
// Load JSDoc.
require('./jsdoc')(grunt);
+53
View File
@@ -0,0 +1,53 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2022 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
const configuration = {
compilerOptions: {
baseUrl: ".",
paths: {
},
target: "es2015",
allowSyntheticDefaultImports: false,
},
exclude: [
"node_modules",
],
include: [],
};
module.exports = (grunt) => {
const handler = () => {
const jsconfigData = Object.assign({}, configuration);
const path = require('path');
const {fetchComponentData} = require(path.join(process.cwd(), '.grunt', 'components.js'));
const componentData = fetchComponentData().components;
for (const [thisPath, component] of Object.entries(componentData)) {
jsconfigData.compilerOptions.paths[`${component}/*`] = [`${thisPath}/amd/src/*`];
jsconfigData.include.push(`${thisPath}/amd/src/**/*`);
}
grunt.file.write('jsconfig.json', JSON.stringify(jsconfigData, null, " ") + "\n");
};
grunt.registerTask('jsconfig', 'Generate a jsconfig configuration compatible with the LSP', handler);
};
+5 -3
View File
@@ -36,7 +36,7 @@ jobs:
- php: 7.3
env: DB=none TASK=CITEST
- php: 7.3
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
env: DB=none TASK=GRUNT NVM_VERSION='lts/gallium'
- if: env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present
php: 7.3
@@ -52,7 +52,7 @@ jobs:
env: DB=none TASK=CITEST
- if: env(MOODLE_PHP) = "all"
php: 8.0
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
env: DB=none TASK=GRUNT NVM_VERSION='lts/gallium'
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present)
php: 8.0
@@ -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.
+2 -2
View File
@@ -69,11 +69,11 @@ if ($options['help'] or (!$options['list'] and !$options['execute'])) {
die;
}
if ($options['showdebugging']) {
if ($options['showdebugging'] || !empty($CFG->showcrondebugging)) {
set_debugging(DEBUG_DEVELOPER, true);
}
if ($options['showsql']) {
if ($options['showsql'] || !empty($CFG->showcronsql)) {
$DB->set_debug(true);
}
if ($options['list']) {
+382
View File
@@ -3371,6 +3371,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.0" level="required">
<RESTRICT function="restrict_php_version_81" message="unsupportedphpversion81" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -3539,6 +3540,8 @@
</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_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.0" requires="3.6">
@@ -3555,6 +3558,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.0" level="required">
<RESTRICT function="restrict_php_version_81" message="unsupportedphpversion81" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -3729,6 +3733,384 @@
<ON_CHECK message="iscustomadminwarnings" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.1" requires="3.9">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.4" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="12" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="7.4.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="optional"/>
<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="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</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_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>
</COMPATIBILITY_MATRIX>
+2 -3
View File
@@ -59,9 +59,8 @@ class mnet_simple_host_form extends moodleform {
$wwwroot = 'http://'.$wwwroot;
}
if ($host = $DB->get_record('mnet_host', array('wwwroot' => $wwwroot))) {
global $CFG;
return array('wwwroot' => get_string('hostexists', 'mnet',
new moodle_url('/admin/mnet/peers.php', array('hostid' => $host->id))));
$str = get_string('hostexists', 'mnet', (new moodle_url('/admin/mnet/peers.php', ['hostid' => $host->id]))->out());
return array('wwwroot' => $str);
}
return array();
}
+7 -7
View File
@@ -14,19 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_role;
use core_role_preset;
/**
* Role XML presets test case.
*
* @package core_role
* @category phpunit
* @category test
* @copyright 2013 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
class core_role_preset_testcase extends advanced_testcase {
class preset_test extends \advanced_testcase {
public function test_xml() {
global $DB;
@@ -61,7 +61,7 @@ class core_role_preset_testcase extends advanced_testcase {
FROM {role_capabilities}
WHERE contextid = :syscontext AND roleid = :roleid
ORDER BY capability ASC",
array('syscontext'=>context_system::instance()->id, 'roleid'=>$role->id));
array('syscontext' => \context_system::instance()->id, 'roleid' => $role->id));
foreach ($capabilities as $cap) {
$this->assertEquals($cap->permission, $info['permissions'][$cap->capability]);
+1 -1
View File
@@ -26,7 +26,7 @@ require_once($CFG->libdir . '/adminlib.php');
admin_externalpage_setup('searchareas');
$areaid = optional_param('areaid', null, PARAM_ALPHAEXT);
$areaid = optional_param('areaid', null, PARAM_ALPHANUMEXT);
$action = optional_param('action', null, PARAM_ALPHA);
$indexingenabled = \core_search\manager::is_indexing_enabled(); // This restricts many of the actions on this page.
+11 -1
View File
@@ -308,6 +308,13 @@ if ($hassiteconfig) {
$temp->add(new admin_setting_managedataformats());
$ADMIN->add('dataformatsettings', $temp);
$plugins = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
core_collator::asort_objects_by_property($plugins, 'displayname');
foreach ($plugins as $plugin) {
/** @var \core\plugininfo\dataformat $plugin */
$plugin->load_settings($ADMIN, 'dataformatsettings', $hassiteconfig);
}
//== Portfolio settings ==
require_once($CFG->libdir. '/portfoliolib.php');
$catname = new lang_string('portfolios', 'portfolio');
@@ -485,7 +492,10 @@ if ($hassiteconfig && !empty($CFG->enableplagiarism)) {
$plugin->load_settings($ADMIN, 'plagiarism', $hassiteconfig);
}
}
$ADMIN->add('reports', new admin_externalpage('comments', new lang_string('comments'), $CFG->wwwroot.'/comment/', 'moodle/site:viewreports'));
// Comments report, note this page is really just a means to delete comments so check that.
$ADMIN->add('reports', new admin_externalpage('comments', new lang_string('comments'), $CFG->wwwroot . '/comment/index.php',
'moodle/comment:delete'));
// Course reports settings
if ($hassiteconfig) {
+2 -1
View File
@@ -236,7 +236,8 @@ if ($hassiteconfig
if ($field->param2 > 255 || $field->datatype != 'text') {
continue;
}
$fields['profile_field_' . $field->shortname] = $field->name . ' *';
$fields['profile_field_' . $field->shortname] = format_string($field->name, true,
['context' => context_system::instance()]) . ' *';
}
return $fields;
@@ -51,12 +51,12 @@
<div class="form-password">
<span data-passwordunmask="wrapper" data-passwordunmaskid="{{ id }}">
<span data-passwordunmask="editor">
<input type="hidden"
<input type="password"
name="{{ name }}"
id="{{ id }}"
value="{{ value }}"
data-size="{{ size }}"
class="form-control d-inline-block"
class="form-control d-none"
>
</span>
<a href="#" data-passwordunmask="edit" title="{{ edithint }}">
+4 -2
View File
@@ -18,6 +18,10 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
And the following "cohorts" exist:
| name | idnumber |
| Cohort 1 | CH1 |
And the following "cohort members" exist:
| user | cohort |
| user2 | CH1 |
| user3 | CH1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
@@ -27,8 +31,6 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
| user2 | C1 | student |
| user3 | C1 | student |
And I log in as "admin"
And I add "User Two (two@example.com)" user to "CH1" cohort members
And I add "User Three (three@example.com)" user to "CH1" cohort members
And I navigate to "Users > Accounts > Browse list of users" in site administration
Scenario: Filter user accounts by role and cohort
+12
View File
@@ -0,0 +1,12 @@
define("tool_behat/steps",["exports","core/ajax","core/templates","core/pending"],(function(_exports,_ajax,_templates,_pending){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_ajax=_interopRequireDefault(_ajax),_templates=_interopRequireDefault(_templates),_pending=_interopRequireDefault(_pending);
/**
* Enhancements for the step definitions page.
*
* @module tool_behat/steps
* @copyright 2022 Catalyst IT EU
* @author Mark Johnson <mark.johnson@catalyst-eu.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
var getRequiredFieldsContent=function(entityData){var _entityData$required;return null!==(_entityData$required=entityData.required)&&void 0!==_entityData$required&&_entityData$required.length?_templates.default.renderForPromise("tool_behat/steprequiredfields",{fields:entityData.required}):Promise.resolve({html:"",js:""})};_exports.init=function(){var fn,_ref;document.addEventListener("change",(fn=regeneratorRuntime.mark((function _callee(e){var entityElement,stepElement,pendingPromise,entityData,_yield$getRequiredFie,html,js,stepRequiredFields;return regeneratorRuntime.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:if(entityElement=e.target.closest(".entities"),stepElement=e.target.closest(".stepcontent"),entityElement&&stepElement){_context.next=4;break}return _context.abrupt("return");case 4:return pendingPromise=new _pending.default("tool_behat/steps:change"),_context.next=7,entityType=e.target.value,_ajax.default.call([{methodname:"tool_behat_get_entity_generator",args:{entitytype:entityType}}])[0];case 7:return entityData=_context.sent,_context.next=10,getRequiredFieldsContent(entityData);case 10:if(_yield$getRequiredFie=_context.sent,html=_yield$getRequiredFie.html,js=_yield$getRequiredFie.js,!(stepRequiredFields=stepElement.querySelector(".steprequiredfields"))){_context.next=19;break}return _context.next=17,_templates.default.replaceNode(stepRequiredFields,html,js);case 17:_context.next=21;break;case 19:return _context.next=21,_templates.default.appendNodeContents(stepElement,html,js);case 21:pendingPromise.resolve();case 22:case"end":return _context.stop()}var entityType}),_callee)})),_ref=function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))},function(_x){return _ref.apply(this,arguments)}))}}));
//# sourceMappingURL=steps.min.js.map
@@ -0,0 +1 @@
{"version":3,"file":"steps.min.js","sources":["../src/steps.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\nimport Ajax from 'core/ajax';\nimport Templates from 'core/templates';\nimport PendingJS from 'core/pending';\n\n/**\n * Enhancements for the step definitions page.\n *\n * @module tool_behat/steps\n * @copyright 2022 Catalyst IT EU\n * @author Mark Johnson <mark.johnson@catalyst-eu.net>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Call the get_entity_generator web service function\n *\n * Takes the name of an entity generator and returns an object containing a list of the required fields.\n *\n * @param {String} entityType\n * @returns {Promise}\n */\nconst getGeneratorEntities = (entityType) => Ajax.call([{\n methodname: 'tool_behat_get_entity_generator',\n args: {entitytype: entityType}\n}])[0];\n\n/**\n * Render HTML for required fields\n *\n * Takes the entity data returned from getGeneratorEntities and renders the HTML to display the required fields.\n *\n * @param {String} entityData\n * @return {Promise}\n */\nconst getRequiredFieldsContent = (entityData) => {\n if (!entityData.required?.length) {\n return Promise.resolve({\n html: '',\n js: ''\n });\n }\n return Templates.renderForPromise('tool_behat/steprequiredfields', {fields: entityData.required});\n};\n\nexport const init = () => {\n // When an entity is selected in the \"the following exist\" step, fetch and display the required fields.\n document.addEventListener('change', async(e) => {\n const entityElement = e.target.closest('.entities');\n const stepElement = e.target.closest('.stepcontent');\n if (!entityElement || !stepElement) {\n return;\n }\n\n const pendingPromise = new PendingJS('tool_behat/steps:change');\n\n const entityData = await getGeneratorEntities(e.target.value);\n const {html, js} = await getRequiredFieldsContent(entityData);\n\n const stepRequiredFields = stepElement.querySelector('.steprequiredfields');\n if (stepRequiredFields) {\n await Templates.replaceNode(stepRequiredFields, html, js);\n } else {\n await Templates.appendNodeContents(stepElement, html, js);\n }\n pendingPromise.resolve();\n });\n};\n"],"names":["getRequiredFieldsContent","entityData","required","_entityData$required","length","Templates","renderForPromise","fields","Promise","resolve","html","js","document","addEventListener","e","entityElement","target","closest","stepElement","pendingPromise","PendingJS","entityType","value","Ajax","call","methodname","args","entitytype","stepRequiredFields","querySelector","replaceNode","appendNodeContents"],"mappings":";;;;;;;;;IAiDMA,yBAA2B,SAACC,yEACzBA,WAAWC,0CAAXC,qBAAqBC,OAMnBC,mBAAUC,iBAAiB,gCAAiC,CAACC,OAAQN,WAAWC,WAL5EM,QAAQC,QAAQ,CACnBC,KAAM,GACNC,GAAI,oBAMI,uBAEhBC,SAASC,iBAAiB,sCAAU,iBAAMC,oNAChCC,cAAgBD,EAAEE,OAAOC,QAAQ,aACjCC,YAAcJ,EAAEE,OAAOC,QAAQ,gBAChCF,eAAkBG,kFAIjBC,eAAiB,IAAIC,iBAAU,2CAhCfC,WAkCwBP,EAAEE,OAAOM,MAlClBC,cAAKC,KAAK,CAAC,CACpDC,WAAY,kCACZC,KAAM,CAACC,WAAYN,eACnB,iBA+BUpB,0CACmBD,yBAAyBC,2DAA3CS,2BAAAA,KAAMC,yBAAAA,KAEPiB,mBAAqBV,YAAYW,cAAc,wEAE3CxB,mBAAUyB,YAAYF,mBAAoBlB,KAAMC,mEAEhDN,mBAAU0B,mBAAmBb,YAAaR,KAAMC,YAE1DQ,eAAeV,mDA3CM,IAACY"}
+82
View File
@@ -0,0 +1,82 @@
// 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/>.
import Ajax from 'core/ajax';
import Templates from 'core/templates';
import PendingJS from 'core/pending';
/**
* Enhancements for the step definitions page.
*
* @module tool_behat/steps
* @copyright 2022 Catalyst IT EU
* @author Mark Johnson <mark.johnson@catalyst-eu.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Call the get_entity_generator web service function
*
* Takes the name of an entity generator and returns an object containing a list of the required fields.
*
* @param {String} entityType
* @returns {Promise}
*/
const getGeneratorEntities = (entityType) => Ajax.call([{
methodname: 'tool_behat_get_entity_generator',
args: {entitytype: entityType}
}])[0];
/**
* Render HTML for required fields
*
* Takes the entity data returned from getGeneratorEntities and renders the HTML to display the required fields.
*
* @param {String} entityData
* @return {Promise}
*/
const getRequiredFieldsContent = (entityData) => {
if (!entityData.required?.length) {
return Promise.resolve({
html: '',
js: ''
});
}
return Templates.renderForPromise('tool_behat/steprequiredfields', {fields: entityData.required});
};
export const init = () => {
// When an entity is selected in the "the following exist" step, fetch and display the required fields.
document.addEventListener('change', async(e) => {
const entityElement = e.target.closest('.entities');
const stepElement = e.target.closest('.stepcontent');
if (!entityElement || !stepElement) {
return;
}
const pendingPromise = new PendingJS('tool_behat/steps:change');
const entityData = await getGeneratorEntities(e.target.value);
const {html, js} = await getRequiredFieldsContent(entityData);
const stepRequiredFields = stepElement.querySelector('.steprequiredfields');
if (stepRequiredFields) {
await Templates.replaceNode(stepRequiredFields, html, js);
} else {
await Templates.appendNodeContents(stepElement, html, js);
}
pendingPromise.resolve();
});
};
@@ -0,0 +1,92 @@
<?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/>.
/**
* Return data about an entity generator.
*
* @package tool_behat
* @copyright 2022 onwards Catalyst IT EU {@link https://catalyst-eu.net}
* @author Mark Johnson <mark.johnson@catalyst-eu.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_behat\external;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/externallib.php');
/**
* External function for getting properties of entity generators.
*/
class get_entity_generator extends \external_api {
/**
* Define parameters for external function.
*
* The parameter is either in the format 'entity' or 'component_name > entity'. There is no appropriate param type for a
* string like this containing angle brackets, so we will do PARAM_RAW. The value will be parsed by
* behat_data_generators::parse_entity_type, which validates the format of the parameter and throws an exception if it is not
* correct.
*
* @return \external_function_parameters
*/
public static function execute_parameters(): \external_function_parameters {
return new \external_function_parameters([
'entitytype' => new \external_value(PARAM_RAW, 'Entity type that can be created by a generator.'),
]);
}
/**
* Return a list of the required fields for a given entity type.
*
* @param string $entitytype
* @return array
*/
public static function execute(string $entitytype): array {
global $CFG;
// Ensure we can load Behat and Facebook namespaces in behat libraries.
require_once("{$CFG->dirroot}/vendor/autoload.php");
require_once("{$CFG->libdir}/tests/behat/behat_data_generators.php");
$params = self::validate_parameters(self::execute_parameters(), ['entitytype' => $entitytype]);
$context = \context_system::instance();
self::validate_context($context);
require_capability('moodle/site:config', $context);
$generators = new \behat_data_generators();
$entity = $generators->get_entity($params['entitytype']);
return ['required' => $entity['required']];
}
/**
* Define return values.
*
* Return required fields
*
* @return \external_single_structure
*/
public static function execute_returns(): \external_single_structure {
return new \external_single_structure([
'required' => new \external_multiple_structure(
new \external_value(PARAM_TEXT, 'Required field'),
'Required fields',
VALUE_OPTIONAL
),
]);
}
}
+37
View File
@@ -0,0 +1,37 @@
<?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/>.
/**
* Define web service functions for tool_behat
*
* @package tool_behat
* @copyright 2022 onwards Catalyst IT EU {@link https://catalyst-eu.net}
* @author Mark Johnson <mark.johnson@catalyst-eu.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$functions = [
'tool_behat_get_entity_generator' => [
'classname' => 'tool_behat\\external\\get_entity_generator',
'methodname' => 'execute',
'description' => 'Get the generator details for an entity',
'type' => 'read',
'ajax' => true,
'capabilities' => 'moodle/site:config'
]
];
+1
View File
@@ -56,6 +56,7 @@ if ($components) {
$form = new steps_definitions_form(null, array('components' => $componentswithsteps));
// Output contents.
$PAGE->requires->js_call_amd('tool_behat/steps', 'init');
$renderer = $PAGE->get_renderer('tool_behat');
echo $renderer->render_stepsdefinitions($steps, $form);
+28
View File
@@ -24,6 +24,8 @@
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/behat/classes/behat_generator_base.php');
/**
* Renderer for behat tool web features
*
@@ -106,6 +108,32 @@ class tool_behat_renderer extends plugin_renderer_base {
},
$stepsdefinitions
);
$elementstrings = [];
$count = 1;
$stepsdefinitions = preg_replace_callback('/(the following ")ELEMENT\d?_STRING(" exist:)/',
function($matches) use (&$elementstrings, &$count) {
// Replace element type arguments with a user-friendly select.
if (empty($elementstrings)) {
$behatgenerators = new behat_data_generators();
$componententities = $behatgenerators->get_all_entities();
ksort($componententities);
$elementstrings = [];
foreach ($componententities as $component => $entities) {
asort($entities);
foreach ($entities as $entity) {
$string = ($component === 'core') ? $entity : $component . ' > ' . $entity;
$elementstrings[$string] = $string;
}
}
}
$select = html_writer::select($elementstrings, 'entities' . $count, '', ['' => 'choosedots'],
['class' => 'entities']);
$count++;
return $matches[1] . $select . $matches[2];
},
$stepsdefinitions
);
}
// Steps definitions.
+6
View File
@@ -29,3 +29,9 @@
#page-admin-tool-behat-index .steps-definitions .stepregex {
color: #060;
}
#page-admin-tool-behat-index .steprequiredfields {
font-weight: bold;
font-size: 1em;
margin-top: 1em;
}
@@ -0,0 +1,33 @@
{{!
This file is part of Moodle - https://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/>.
}}
{{!
@template tool_behat/steprequiredfields
Display a Gherkin-style table row showing required columns for a step.
Example context (json):
{
"fields": [
"user",
"role",
"context"
]
}
}}
<pre class="steprequiredfields">
|{{#fields}} {{{.}}} |{{/fields}}
</pre>
@@ -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 "Course 1" course homepage
| 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" course page logged in as admin
And I navigate to "Reset" in current page administration
# Select (multi-select) - Checking "the select box should contain".
And I expand all fieldsets
@@ -61,16 +60,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 "Edit 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 "Edit 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"
@@ -78,8 +75,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 "Edit 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 |
@@ -89,8 +85,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 "Edit 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 | |
@@ -143,10 +138,11 @@ Feature: Verify that all form fields values can be get and set
And I navigate to "Edit 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 "Course 1" course homepage
And I navigate to "Users > Groups" in current page administration
# Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain".
@@ -159,11 +155,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.
@@ -7,8 +7,8 @@ Feature: Behat steps for interacting with form work
@javascript
Scenario: Test fields in containers
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
| fullname | shortname | summary | summaryformat |
| Course 1 | C1 | Red | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
# Just get to any form.
@@ -17,11 +17,15 @@ Feature: Behat steps for interacting with form work
And I set the following fields in the "Appearance" "fieldset" to these values:
| Show activity reports | Yes |
| Number of announcements | 1 |
And I set the following fields in the "Description" "fieldset" to these values:
| Course summary | Green |
Then the field "Show activity reports" in the "Appearance" "fieldset" matches value "Yes"
And the field "Show activity reports" in the "Appearance" "fieldset" does not match value "No"
And the following fields in the "region-main" "region" match these values:
| Course full name | Frog |
| Number of announcements | 1 |
| Course summary | Green |
And the following fields in the "region-main" "region" do not match these values:
| Course full name | Course 1 |
| Number of announcements | 5 |
| Course summary | Red |
@@ -13,6 +13,10 @@ Feature: List the system steps definitions
Scenario: Accessing the list
Then I should see "Step definitions"
And I should not see "There aren't steps definitions matching this filter"
And I should not see "the following \"ELEMENT_STRING\" exist:"
And "entities1" "select" should exist
And the "entities1" select box should contain "users"
And the "entities1" select box should contain "mod_assign > submissions"
@javascript
Scenario: Filtering by type
@@ -34,3 +38,11 @@ Feature: List the system steps definitions
Then I should not see "There aren't steps definitions matching this filter"
And I should see "Checks the provided element and selector type exists in the current page."
And I should see "Checks that an element and selector type exists in another element and selector type on the current page."
@javascript
Scenario: Get required fields
Given I set the field "entities1" to "users"
And I should see "| username |"
When I set the field "entities1" to "mod_quiz > user overrides"
Then I should not see "| username |"
And I should see "| quiz | user |"
@@ -20,9 +20,10 @@ Feature: Forms manipulation
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Quiz" to section "1"
And the following "activities" exist:
| activity | course | section | name |
| quiz | C1 | 1 | Quiz 1 |
And I am on the "Quiz 1" "quiz activity editing" page logged in as admin
When I expand all fieldsets
Then I should see "Close the quiz"
And I should see "Group mode"
@@ -0,0 +1,104 @@
<?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/>.
/**
* Unit tests for get_entity_generator web service
*
* @package tool_behat
* @copyright 2022 onwards Catalyst IT EU {@link https://catalyst-eu.net}
* @author Mark Johnson <mark.johnson@catalyst-eu.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_behat\external;
/**
* Tests for get_entity_generator web service
*
* @covers \tool_behat\external\get_entity_generator
*/
class get_entity_generator_test extends \advanced_testcase {
/**
* Log in as admin
*
* @return void
*/
public function setUp(): void {
$this->resetAfterTest();
$this->setAdminUser();
}
/**
* Get the generator for a core entity.
*
* @return void
*/
public function test_execute_core_entity(): void {
$generator = get_entity_generator::execute('users');
$this->assertEquals(['required' => ['username']], $generator);
}
/**
* Get the generator for the plugin entity.
*
* @return void
*/
public function test_execute_plugin_entity(): void {
$generator = get_entity_generator::execute('mod_book > chapters');
$this->assertEquals(['required' => ['book', 'title', 'content']], $generator);
}
/**
* Get the generator for an entity with no required fields.
*
* @return void
*/
public function test_execute_no_requried(): void {
$generator = get_entity_generator::execute('mod_forum > posts');
$this->assertEquals(['required' => []], $generator);
}
/**
* Attempt to get the generator for a core entity that does not exist.
*
* @return void
*/
public function test_execute_invalid_entity(): void {
$this->expectException('coding_exception');
get_entity_generator::execute('foo');
}
/**
* Attempt to get a generator form a plugin that does not exist.
*
* @return void
*/
public function test_execute_invalid_plugin(): void {
$this->expectException('coding_exception');
get_entity_generator::execute('foo > bar');
}
/**
* Attempt to get a generator for an entity that does not exist, from a plugin that does.
*
* @return void
*/
public function test_execute_invalid_plugin_entity(): void {
$this->expectException('coding_exception');
get_entity_generator::execute('mod_book > bar');
}
}
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021051700; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2021051701; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021051100; // Requires this Moodle version.
$plugin->component = 'tool_behat'; // Full name of the plugin (used for diagnostics)
+14 -14
View File
@@ -323,7 +323,7 @@ class accessibility {
/**
* This function runs one specified check on the html item
*
* @param string $html The html string to be analysed; might be NULL.
* @param string|null $html The html string to be analysed; might be NULL.
* @param int $contentid The content area ID
* @param int $errid The error ID
* @param string $check The check name to run
@@ -333,7 +333,7 @@ class accessibility {
* @throws \dml_exception
*/
public static function run_one_check(
string $html = null,
?string $html,
int $contentid,
int $errid,
string $check,
@@ -477,8 +477,6 @@ class accessibility {
public static function get_summary_data(int $id): \stdClass {
global $CFG, $DB;
$components = $DB->get_records(manager::DB_AREAS);
$summarydata = new \stdClass();
$summarydata->siteurl = (substr($CFG->wwwroot, -1) !== '/') ? $CFG->wwwroot . '/' : $CFG->wwwroot;
$summarydata->moodlerelease = (preg_match('/^(\d+\.\d.*?)[. ]/', $CFG->release, $matches)) ? $matches[1] : $CFG->release;
@@ -488,7 +486,7 @@ class accessibility {
$summarydata->numfactivities = $DB->count_records('course_modules');
$summarydata->mobileservice = (int)$CFG->enablemobilewebservice === 1 ? true : false;
$summarydata->usersmobileregistered = $DB->count_records('user_devices');
$summarydata->contenttyperesults = static::get_contenttyperesults($id, $components);
$summarydata->contenttyperesults = static::get_contenttyperesults($id);
$summarydata->contenttypeerrors = static::get_contenttypeerrors();
$summarydata->percheckerrors = static::get_percheckerrors();
return $summarydata;
@@ -497,22 +495,24 @@ class accessibility {
/**
* Get content type results.
* @param int $id
* @param array $components
* @return \stdClass
*/
private static function get_contenttyperesults(int $id, array $components): \stdClass {
private static function get_contenttyperesults(int $id): \stdClass {
global $DB;
$sql = 'SELECT component, COUNT(id) AS count
FROM {' . manager::DB_AREAS . '}
GROUP BY component';
$components = $DB->get_recordset_sql($sql);
$contenttyperesults = new \stdClass();
$contenttyperesults->id = $id;
$datacomponents = array();
foreach ($components as $component) {
$datacomponents[$component->component][] = $component;
}
$contenttyperesults->contenttype = new \stdClass();
foreach ($datacomponents as $key => $component) {
$contenttyperesults->contenttype->$key = count($component);
foreach ($components as $component) {
$componentname = $component->component;
$contenttyperesults->contenttype->$componentname = $component->count;
}
$components->close();
$contenttyperesults->summarydatastorage = static::get_summary_data_storage();
$contenttyperesults->datachecked = time(); // Correct??
$contenttyperesults->datachecked = time();
return $contenttyperesults;
}
@@ -25,7 +25,7 @@ namespace tool_brickfield\local\htmlchecker\common;
*/
class brickfield_accessibility_color_test extends brickfield_accessibility_test {
/** @var string[] Mapping of colours to hex codes. */
/** @var string[] Define colour codes. */
public $colornames = [
'aliceblue' => 'f0f8ff',
'antiquewhite' => 'faebd7',
@@ -183,6 +183,12 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
}
$forergb = $this->get_rgb($foreground);
$backrgb = $this->get_rgb($background);
// If get_rgb returns null for either, return 0.
if ($forergb === null || $backrgb === null) {
return 0;
}
return $this->luminosity($forergb['r'], $backrgb['r'],
$forergb['g'], $backrgb['g'],
$forergb['b'], $backrgb['b']);
@@ -227,15 +233,15 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
/**
* Returns the decimal equivalents for a HEX color
* Returns the decimal equivalents for a HEX color. Returns null if it cannot be determined.
* @param string $color The hex color value
* @return array An array where 'r' is the Red value, 'g' is Green, and 'b' is Blue
* @return array|null An array where 'r' is the Red value, 'g' is Green, and 'b' is Blue
*/
public function get_rgb(string $color) {
public function get_rgb(string $color): ?array {
$color = $this->convert_color($color);
$c = str_split($color, 2);
if (count($c) != 3) {
return false;
return null;
}
$results = ['r' => hexdec($c[0]), 'g' => hexdec($c[1]), 'b' => hexdec($c[2])];
return $results;
@@ -307,6 +313,12 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
public function get_wai_ert_contrast(string $foreground, string $background): array {
$forergb = $this->get_rgb($foreground);
$backrgb = $this->get_rgb($background);
// If get_rgb returns null for either, return 0.
if ($forergb === null || $backrgb === null) {
return [];
}
$diffs = $this->get_wai_diffs($forergb, $backrgb);
return $diffs['red'] + $diffs['green'] + $diffs['blue'];
@@ -321,12 +333,18 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
public function get_wai_ert_brightness(string $foreground, string $background): float {
$forergb = $this->get_rgb($foreground);
$backrgb = $this->get_rgb($background);
// If get_rgb returns null for either, return 0.
if ($forergb === null || $backrgb === null) {
return 0;
}
$color = $this->get_wai_diffs($forergb, $backrgb);
return (($color['red'] * 299) + ($color['green'] * 587) + ($color['blue'] * 114)) / 1000;
}
/**
* Get wai diffs.
* Get the wai differences.
* @param array $forergb
* @param array $backrgb
* @return array
@@ -248,7 +248,7 @@ $string['printable:toolname'] = 'Summary report';
$string['printable:toolshortname'] = 'Summary report';
$string['printable:downloadpdf'] = 'Download PDF';
$string['printable:printreport'] = 'Printable report';
$string['error:nocoursespecified'] = 'This summary report requires a valid course id. Please access the accessibility toolkit from within a course, via the actions menu, which will then supply this required course id.';
$string['error:nocoursespecified'] = 'The summary report requires a valid course ID. Please access the accessibility toolkit from within a course.';
$string['pdf:filename'] = 'Brickfield_Summaryreport_CourseID-{$a}';
// Advanced page.
@@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* tool_brickfield check test.
* Class test_css_text_has_contrast test
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, https://www.brickfield.ie
@@ -29,14 +29,79 @@ defined('MOODLE_INTERNAL') || die();
require_once('all_checks.php');
/**
* Class test_css_text_has_contrast_testcase
* Class test_css_text_has_contrast_test
*/
class css_text_has_contrast_test extends all_checks {
/** @var string Check type */
/** @var string The check type. */
protected $checktype = 'css_text_has_contrast';
/** @var string Html fail */
private $htmlfail = <<<EOD
/** @var string HTML that should get flagged. */
private $htmlfail1 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:#333333; background-color:#000000; font-weight: bold;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML that should get flagged. */
private $htmlfail2 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:#333333; background-color:#000000; font-size: 18px;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML that should get flagged. */
private $htmlfail3 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:#333333; background-color:#000000; font-size: 18%;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML that should get flagged. */
private $htmlfail4 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:#333333; background-color:#000000; font-size: 18em;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML that should get flagged. */
private $htmlfail5 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:#333333; background-color:#000000; font-size: 18ex;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML that should get flagged. */
private $htmlfail6 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
@@ -48,7 +113,7 @@ class css_text_has_contrast_test extends all_checks {
</html>
EOD;
/** @var string Html pass */
/** @var string HTML that should not get flagged. */
private $htmlpass = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
@@ -61,14 +126,113 @@ EOD;
</html>
EOD;
/** @var string HTML that should get flagged. */
private $namecolours = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color: red; background-color: blue;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML with invalid colour names. */
private $invalidcolours = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color: grog; background-color: numpi;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML with invalid colour numeric values. */
private $invalidvalue = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color: 10000500; background-color: -10234;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/** @var string HTML with empty colour values. */
private $emptyvalue = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #6 - Positive</title>
</head>
<body>
<p style="color:; background-color:;">This is not contrasty enough.</p>
</body>
</html>
EOD;
/**
* Test for the area assign intro
*/
public function test_check() {
$results = $this->get_checker_results($this->htmlfail);
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlfail2);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlfail3);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlfail4);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlfail5);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlfail6);
$this->assertTrue($results[0]->element->tagName == 'p');
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}
/**
* Test with valid colour names.
*/
public function test_check_for_namedcolours() {
$results = $this->get_checker_results($this->namecolours);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test with invalid colour names.
*/
public function test_check_for_invalidcolours() {
$results = $this->get_checker_results($this->invalidcolours);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test with invalid colour numeric values.
*/
public function test_check_for_invalidvalues() {
$results = $this->get_checker_results($this->invalidvalue);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test with empty colour values.
*/
public function test_check_for_emptyvalues() {
$results = $this->get_checker_results($this->emptyvalue);
$this->assertEmpty($results);
}
}
+6
View File
@@ -0,0 +1,6 @@
This files describes API changes in /admin/tool/brickfield/*.
=== 3.11.7 ===
* classes/local/htmlchecker/common/brickfield_accessibility_color_test::get_rgb() has been modified to return either an
array or null. Previously it returned either an array or false.
+6 -5
View File
@@ -36,7 +36,7 @@ Useful for uploading custom langstrings to AMOS or importing or syncing them to
Options:
-l, --lang Comma seperated language ids to export, default: all
-c, --components Comma seperated components to export, default: all
-t, --target Target to copy the zip files to, default: $CFG->tempdir/customlang
-t, --target Target directory to copy the zip files to, default: $CFG->tempdir/customlang
-o, --overwrite Overwrite existing files in the target folder.
Note: If the target is not set, the files are always overwritten!
-h, --help Print out this help
@@ -73,9 +73,10 @@ if ($options['help']) {
echo $usage;
die;
}
if (!file_exists($options['target'])) {
mkdir($options['target'], 0777, true);
}
// Ensure target directory exists.
$options['target'] = rtrim($options['target'], '/') . '/';
check_dir_exists($options['target']);
cli_writeln(get_string('cliexportheading', 'tool_customlang'));
$langs = [];
@@ -90,7 +91,7 @@ foreach ($langs as $lang) {
$filename = $options['target'] . get_string('exportzipfilename', 'tool_customlang', ['lang' => $lang]);
// If the file exists and we are not using the temp folder it requires an ovewrite.
if ($options['target'] != $dafaulttarget && file_exists($filename) && !$options['overwrite']) {
cli_problem(get_string('cliexportfileexists', 'tool_customlang', $lang));
cli_problem(get_string('cliexportfileexists', 'tool_customlang', ['lang' => $lang]));
continue;
}
cli_heading(get_string('cliexportstartexport', 'tool_customlang', $lang));
+10
View File
@@ -160,6 +160,16 @@ foreach ($langfiles as $lng => $files) {
cli_heading(get_string('clifiles', 'tool_customlang', $lng));
// If we intend to check in any changes, we must first check them out.
if ($checkin) {
cli_writeln(get_string('checkout', 'tool_customlang'));
$progressbar = new progress_bar();
$progressbar->create();
tool_customlang_utils::checkout($lng, $progressbar);
}
foreach ($files as $file) {
// Generate a valid stored_file from this file.
$record = (object)[
@@ -50,6 +50,7 @@ $string['customlang:export'] = 'Export local translation';
$string['customlang:view'] = 'View local translation';
$string['export'] = 'Export custom strings';
$string['exportfilter'] = 'Select component(s) to export';
$string['exportzipfilename'] = 'customlang-export-{$a->lang}.zip';
$string['filter'] = 'Filter strings';
$string['filtercomponent'] = 'Show strings of these components';
$string['filtercustomized'] = 'Customised only';
+18 -3
View File
@@ -36,7 +36,7 @@ class tool_customlang_utils {
* Rough number of strings that are being processed during a full checkout.
* This is used to estimate the progress of the checkout.
*/
const ROUGH_NUMBER_OF_STRINGS = 16500;
const ROUGH_NUMBER_OF_STRINGS = 32000;
/** @var array cache of {@link self::list_components()} results */
private static $components = null;
@@ -89,11 +89,26 @@ class tool_customlang_utils {
* @param progress_bar $progressbar optionally, the given progress bar can be updated
*/
public static function checkout($lang, progress_bar $progressbar = null) {
global $DB;
global $DB, $CFG;
require_once("{$CFG->libdir}/adminlib.php");
// For behat executions we are going to load only a few components in the
// language customisation structures. Using the whole "en" langpack is
// too much slow (leads to Selenium 30s timeouts, especially on slow
// environments) and we don't really need the whole thing for tests. So,
// apart from escaping from the timeouts, we are also saving some good minutes
// in tests. See MDL-70014 and linked issues for more info.
$behatneeded = ['core', 'core_langconfig', 'tool_customlang'];
// make sure that all components are registered
$current = $DB->get_records('tool_customlang_components', null, 'name', 'name,version,id');
foreach (self::list_components() as $component) {
// Filter out unwanted components when running behat.
if (defined('BEHAT_SITE_RUNNING') && !in_array($component, $behatneeded)) {
continue;
}
if (empty($current[$component])) {
$record = new stdclass();
$record->name = $component;
@@ -103,7 +118,7 @@ class tool_customlang_utils {
$record->version = $version;
}
$DB->insert_record('tool_customlang_components', $record);
} elseif ($version = get_component_version($component)) {
} else if ($version = get_component_version($component)) {
if (is_null($current[$component]->version) or ($version > $current[$component]->version)) {
$DB->set_field('tool_customlang_components', 'version', $version, array('id' => $current[$component]->id));
}
+13 -1
View File
@@ -786,6 +786,18 @@ class api {
return true;
}
/**
* Check if user has permission to create data download request for themselves
*
* @param int|null $userid
* @return bool
*/
public static function can_create_data_download_request_for_self(int $userid = null): bool {
global $USER;
$userid = $userid ?: $USER->id;
return has_capability('tool/dataprivacy:downloadownrequest', \context_user::instance($userid), $userid);
}
/**
* Check if user has permisson to create data deletion request for themselves.
*
@@ -847,7 +859,7 @@ class api {
$usercontext = \context_user::instance($userid);
// If it's your own and you have the right capability, you can download it.
if ($userid == $downloaderid && has_capability('tool/dataprivacy:downloadownrequest', $usercontext, $downloaderid)) {
if ($userid == $downloaderid && self::can_create_data_download_request_for_self($downloaderid)) {
return true;
}
// If you can download anyone's in that context, you can download it.
@@ -96,6 +96,11 @@ if ($data = $mform->get_data()) {
throw new moodle_exception('nopermissions', 'error', '',
get_string('errorcannotrequestdeleteforother', 'tool_dataprivacy'));
}
} else if ($data->type == \tool_dataprivacy\api::DATAREQUEST_TYPE_EXPORT) {
if ($data->userid == $USER->id && !\tool_dataprivacy\api::can_create_data_download_request_for_self()) {
throw new moodle_exception('nopermissions', 'error', '',
get_string('errorcannotrequestexportforself', 'tool_dataprivacy'));
}
}
\tool_dataprivacy\api::create_data_request($data->userid, $data->type, $data->comments);
@@ -97,10 +97,11 @@ class tool_dataprivacy_data_request_form extends \core\form\persistent {
$mform->setType('userid', PARAM_INT);
// Subject access request type.
$options = [
api::DATAREQUEST_TYPE_EXPORT => get_string('requesttypeexport', 'tool_dataprivacy'),
api::DATAREQUEST_TYPE_DELETE => get_string('requesttypedelete', 'tool_dataprivacy')
];
$options = [];
if ($this->manage || api::can_create_data_download_request_for_self()) {
$options[api::DATAREQUEST_TYPE_EXPORT] = get_string('requesttypeexport', 'tool_dataprivacy');
}
$options[api::DATAREQUEST_TYPE_DELETE] = get_string('requesttypedelete', 'tool_dataprivacy');
$mform->addElement('select', 'type', get_string('requesttype', 'tool_dataprivacy'), $options);
$mform->addHelpButton('type', 'requesttype', 'tool_dataprivacy');
@@ -174,7 +175,7 @@ class tool_dataprivacy_data_request_form extends \core\form\persistent {
$errors['type'] = get_string('errorrequestalreadyexists', 'tool_dataprivacy');
}
// Check if current user can create data deletion request.
// Check if current user can create data requests.
if ($data->type == api::DATAREQUEST_TYPE_DELETE) {
if ($userid == $USER->id) {
if (!api::can_create_data_deletion_request_for_self()) {
@@ -184,6 +185,10 @@ class tool_dataprivacy_data_request_form extends \core\form\persistent {
&& !api::can_create_data_deletion_request_for_children($userid)) {
$errors['type'] = get_string('errorcannotrequestdeleteforother', 'tool_dataprivacy');
}
} else if ($data->type == api::DATAREQUEST_TYPE_EXPORT) {
if ($userid == $USER->id && !api::can_create_data_download_request_for_self()) {
$errors['type'] = get_string('errorcannotrequestexportforself', 'tool_dataprivacy');
}
}
return $errors;
@@ -135,6 +135,7 @@ $string['effectiveretentionperioduser'] = '{$a} (since the last time the user ac
$string['emailsalutation'] = 'Dear {$a},';
$string['errorcannotrequestdeleteforself'] = 'You don\'t have permission to create deletion request for yourself.';
$string['errorcannotrequestdeleteforother'] = 'You don\'t have permission to create deletion request for this user.';
$string['errorcannotrequestexportforself'] = 'You don\'t have permission to create export request for yourself.';
$string['errorcontactdpodisabled'] = 'The option to contact the privacy officer is disabled.';
$string['errorinvalidrequestcomments'] = 'The comments field may contain plain text only.';
$string['errorinvalidrequestcreationmethod'] = 'Invalid request creation method!';
+3 -2
View File
@@ -68,8 +68,9 @@ function tool_dataprivacy_myprofile_navigation(tree $tree, $user, $iscurrentuser
// Check if the user has an ongoing data export request.
$hasexportrequest = \tool_dataprivacy\api::has_ongoing_request($user->id, \tool_dataprivacy\api::DATAREQUEST_TYPE_EXPORT);
// Show data export link only if the user doesn't have an ongoing data export request.
if (!$hasexportrequest) {
// Show data export link only if the user doesn't have an ongoing data export request and has permission
// to download own data.
if (!$hasexportrequest && \tool_dataprivacy\api::can_create_data_download_request_for_self()) {
$exportparams = ['type' => \tool_dataprivacy\api::DATAREQUEST_TYPE_EXPORT];
$exporturl = new moodle_url('/admin/tool/dataprivacy/createdatarequest.php', $exportparams);
$exportnode = new core_user\output\myprofile\node('privacyandpolicies', 'requestdataexport',
+22
View File
@@ -26,6 +26,7 @@ use tool_dataprivacy\task\process_data_request_task;
* API tests.
*
* @package tool_dataprivacy
* @covers \tool_dataprivacy\api
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -2174,6 +2175,27 @@ class api_test extends \advanced_testcase {
return $request;
}
/**
* Test whether user can create data download request for themselves
*/
public function test_can_create_data_download_request_for_self(): void {
global $DB;
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
// The default user role allows for the creation of download data requests.
$this->assertTrue(api::can_create_data_download_request_for_self());
// Prohibit that capability.
$userrole = $DB->get_field('role', 'id', ['shortname' => 'user'], MUST_EXIST);
assign_capability('tool/dataprivacy:downloadownrequest', CAP_PROHIBIT, $userrole, \context_user::instance($user->id));
$this->assertFalse(api::can_create_data_download_request_for_self());
}
/**
* Test user cannot create data deletion request for themselves if they don't have
* "tool/dataprivacy:requestdelete" capability.
@@ -14,17 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the data_registry class.
*
* @package tool_dataprivacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
use \tool_dataprivacy\data_registry;
namespace tool_dataprivacy;
/**
* Unit tests for the data_registry class.
@@ -33,7 +23,7 @@ use \tool_dataprivacy\data_registry;
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_dataprivacy_dataregistry_testcase extends advanced_testcase {
class data_registry_test extends \advanced_testcase {
/**
* Ensure that the get_effective_context_value only errors if provided an inappropriate element.
@@ -41,7 +31,7 @@ class tool_dataprivacy_dataregistry_testcase extends advanced_testcase {
* This test is not great because we only test a limited set of values. This is a fault of the underlying API.
*/
public function test_get_effective_context_value_invalid_element() {
$this->expectException(coding_exception::class);
$this->expectException(\coding_exception::class);
data_registry::get_effective_context_value(\context_system::instance(), 'invalid');
}
@@ -51,7 +41,7 @@ class tool_dataprivacy_dataregistry_testcase extends advanced_testcase {
* This test is not great because we only test a limited set of values. This is a fault of the underlying API.
*/
public function test_get_effective_contextlevel_value_invalid_element() {
$this->expectException(coding_exception::class);
$this->expectException(\coding_exception::class);
data_registry::get_effective_contextlevel_value(\context_system::instance(), 'invalid');
}
}
@@ -14,19 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Tests for the data_request persistent.
*
* @package tool_dataprivacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
use data_privacy_testcase;
defined('MOODLE_INTERNAL') || die();
require_once('data_privacy_testcase.php');
use tool_dataprivacy\api;
/**
* Tests for the data_request persistent.
*
@@ -34,7 +28,7 @@ use tool_dataprivacy\api;
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_dataprivacy_data_request_testcase extends data_privacy_testcase {
class data_request_test extends data_privacy_testcase {
/**
* Data provider for testing is_resettable, and is_active.
@@ -14,25 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Expired contexts tests.
*
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use tool_dataprivacy\api;
use tool_dataprivacy\data_registry;
use tool_dataprivacy\expired_context;
use tool_dataprivacy\purpose;
use tool_dataprivacy\purpose_override;
use tool_dataprivacy\category;
use tool_dataprivacy\contextlevel;
use tool_dataprivacy\expired_contexts_manager;
defined('MOODLE_INTERNAL') || die();
global $CFG;
namespace tool_dataprivacy;
/**
* Expired contexts tests.
@@ -41,7 +23,7 @@ global $CFG;
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_dataprivacy_expired_contexts_testcase extends advanced_testcase {
class expired_contexts_test extends \advanced_testcase {
/**
* Setup the basics with the specified retention period.
@@ -14,21 +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/>.
/**
* Expired data requests tests.
*
* @package tool_dataprivacy
* @copyright 2018 Michael Hawkins
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
use tool_dataprivacy\api;
use tool_dataprivacy\category;
use tool_dataprivacy\data_request;
use tool_dataprivacy\purpose;
use data_privacy_testcase;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once('data_privacy_testcase.php');
@@ -39,7 +29,7 @@ require_once('data_privacy_testcase.php');
* @copyright 2018 Michael Hawkins
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_dataprivacy_expired_data_requests_testcase extends data_privacy_testcase {
class expired_data_requests_test extends data_privacy_testcase {
/**
* Test tearDown.
@@ -59,7 +49,7 @@ class tool_dataprivacy_expired_data_requests_testcase extends data_privacy_testc
// Set up test users.
$this->setAdminUser();
$studentuser = $this->getDataGenerator()->create_user();
$studentusercontext = context_user::instance($studentuser->id);
$studentusercontext = \context_user::instance($studentuser->id);
$dpouser = $this->getDataGenerator()->create_user();
$this->assign_site_dpo($dpouser);
@@ -14,13 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the filtered_userlist.
*
* @package tool_dataprivacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
/**
* Unit tests for the filtered_userlist.
@@ -29,7 +23,7 @@
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_dataprivacy_filtered_userlist_testcase extends advanced_testcase {
class filtered_userlist_test extends \advanced_testcase {
/**
* Test the apply_expired_contexts_filters function with arange of options.
*
@@ -14,6 +14,13 @@
// 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_dataprivacy;
use data_privacy_testcase;
defined('MOODLE_INTERNAL') || die();
require_once('data_privacy_testcase.php');
/**
* Tests for the manager observer.
*
@@ -21,18 +28,7 @@
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once('data_privacy_testcase.php');
/**
* API tests.
*
* @package tool_dataprivacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_dataprivacy_manager_observer_testcase extends data_privacy_testcase {
class manager_observer_test extends data_privacy_testcase {
/**
* Ensure that when users are configured as DPO, they are sent an message upon failure.
*/
@@ -14,16 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Metadata registry tests.
*
* @package tool_dataprivacy
* @copyright 2018 Adrian Greeve <adriangreeve.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
namespace tool_dataprivacy;
/**
* Metadata registry tests.
@@ -32,7 +23,7 @@ global $CFG;
* @copyright 2018 Adrian Greeve <adriangreeve.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_dataprivacy_metadata_registry_testcase extends advanced_testcase {
class metadata_registry_test extends \advanced_testcase {
/**
* Fetch the meta data and return it in a form that we can easily unit test.
@@ -14,18 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Tests for the event observer.
*
* @package tool_dataprivacy
* @copyright 2018 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy;
defined('MOODLE_INTERNAL') || die();
use \tool_dataprivacy\event\user_deleted_observer;
use \tool_dataprivacy\api;
use tool_dataprivacy\event\user_deleted_observer;
/**
* Event observer test.
@@ -34,7 +25,7 @@ use \tool_dataprivacy\api;
* @copyright 2018 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_dataprivacy_user_deleted_observer_testcase extends advanced_testcase {
class user_deleted_observer_test extends \advanced_testcase {
/**
* Ensure that a delete data request is created upon user deletion.
+6
View File
@@ -0,0 +1,6 @@
This file describes API changes in /admin/tool/dataprivacy/*
Information provided here is intended especially for developers.
=== 3.11.8 ===
* New `api::can_create_data_download_request_for_self` method for determining whether user has permission to create their
own data download requests
@@ -14,7 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || die();
namespace tool_generator;
use tool_generator_course_backend;
/**
* Automated unit testing. This tests the 'make large course' backend,
@@ -24,7 +26,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2013 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_generator_maketestcourse_testcase extends advanced_testcase {
class maketestcourse_test extends \advanced_testcase {
/**
* Creates a small test course and checks all the components have been put in place.
*/
@@ -52,7 +54,7 @@ class tool_generator_maketestcourse_testcase extends advanced_testcase {
// Get course details.
$course = get_course($courseid);
$context = context_course::instance($courseid);
$context = \context_course::instance($courseid);
$modinfo = get_fast_modinfo($course);
// Check course names.
@@ -88,7 +90,7 @@ class tool_generator_maketestcourse_testcase extends advanced_testcase {
// Check it contains 2 files (the default txt and a dat file).
$fs = get_file_storage();
$resourcecontext = context_module::instance($resource->id);
$resourcecontext = \context_module::instance($resource->id);
$files = $fs->get_area_files($resourcecontext->id, 'mod_resource', 'content', false, 'filename', false);
$files = array_values($files);
$this->assertEquals(2, count($files));
@@ -106,7 +108,7 @@ class tool_generator_maketestcourse_testcase extends advanced_testcase {
$this->assertTrue($ok);
// Check it contains 2 files.
$resourcecontext = context_module::instance($resource->id);
$resourcecontext = \context_module::instance($resource->id);
$files = $fs->get_area_files($resourcecontext->id, 'mod_resource', 'content', false, 'filename', false);
$files = array_values($files);
$this->assertEquals(2, count($files));
@@ -155,7 +157,7 @@ class tool_generator_maketestcourse_testcase extends advanced_testcase {
$lastusernumber = 0;
$discussionstarters = array();
foreach ($discussions as $discussion) {
$usernumber = core_user::get_user($discussion->userid, 'id, idnumber')->idnumber;
$usernumber = \core_user::get_user($discussion->userid, 'id, idnumber')->idnumber;
// Checks that the users are odd numbers.
$this->assertEquals(1, $usernumber % 2);
@@ -190,7 +192,7 @@ class tool_generator_maketestcourse_testcase extends advanced_testcase {
$fs = get_file_storage();
$resources = $modinfo->get_instances_of('resource');
foreach ($resources as $resource) {
$resourcecontext = context_module::instance($resource->id);
$resourcecontext = \context_module::instance($resource->id);
$files = $fs->get_area_files($resourcecontext->id, 'mod_resource', 'content', false, 'filename', false);
foreach ($files as $file) {
if ($file->get_mimetype() == 'application/octet-stream') {
@@ -210,7 +212,7 @@ class tool_generator_maketestcourse_testcase extends advanced_testcase {
$fs = get_file_storage();
$resources = $modinfo->get_instances_of('resource');
foreach ($resources as $resource) {
$resourcecontext = context_module::instance($resource->id);
$resourcecontext = \context_module::instance($resource->id);
$files = $fs->get_area_files($resourcecontext->id, 'mod_resource', 'content', false, 'filename', false);
foreach ($files as $file) {
if ($file->get_mimetype() == 'application/octet-stream') {
@@ -22,27 +22,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_generator;
use tool_generator_site_backend;
defined('MOODLE_INTERNAL') || die();
/**
* Silly class to access site_backend internal methods.
*
* @package tool_generator
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class testable_tool_generator_site_backend extends tool_generator_site_backend {
/**
* Public accessor.
*
* @return int
*/
public static function get_last_testcourse_id() {
return parent::get_last_testcourse_id();
}
}
/**
* Unit test for the site generator
*
@@ -50,7 +35,7 @@ class testable_tool_generator_site_backend extends tool_generator_site_backend {
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_generator_maketestsite_testcase extends advanced_testcase {
class maketestsite_test extends \advanced_testcase {
/**
* Checks that site courses shortnames are properly generated.
@@ -102,5 +87,22 @@ class tool_generator_maketestsite_testcase extends advanced_testcase {
$lastshortname = testable_tool_generator_site_backend::get_last_testcourse_id();
$this->assertEquals(20, $lastshortname);
}
}
/**
* Silly class to access site_backend internal methods.
*
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class testable_tool_generator_site_backend extends tool_generator_site_backend {
/**
* Public accessor.
*
* @return int
*/
public static function get_last_testcourse_id() {
return parent::get_last_testcourse_id();
}
}
@@ -22,8 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_httpsreplace\tests;
namespace tool_httpsreplace;
defined('MOODLE_INTERNAL') || die();
Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 329 B

+1 -1
View File
@@ -1,3 +1,3 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" preserveAspectRatio="xMinYMid meet" overflow="visible"><path d="M16 9v6c0 .5-.5 1-1 1H1c-.5 0-1-.5-1-1V9c0-.5.5-1 1-1h1c.5 0 1 .5 1 1v4h10V9c0-.5.5-1 1-1h1c.5 0 1 .5 1 1zm-3.6-3.9l-.7-.7c-.4-.4-1-.4-1.4 0l-.8.8V1c0-.5-.4-1-1-1h-1c-.5 0-1 .5-1 1v4.2l-.8-.8c-.4-.4-1-.4-1.4 0l-.7.7c-.4.4-.4 1 0 1.4l3.7 3.7c.2.2.5.3.7.3.3 0 .5-.1.7-.3l3.7-3.7c.4-.3.4-1 0-1.4z" fill="#999"/></svg>
]><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" preserveAspectRatio="xMinYMid meet" overflow="visible"><path d="M16 9v6c0 .5-.5 1-1 1H1c-.5 0-1-.5-1-1V9c0-.5.5-1 1-1h1c.5 0 1 .5 1 1v4h10V9c0-.5.5-1 1-1h1c.5 0 1 .5 1 1zm-3.6-3.9l-.7-.7c-.4-.4-1-.4-1.4 0l-.8.8V1c0-.5-.4-1-1-1h-1c-.5 0-1 .5-1 1v4.2l-.8-.8c-.4-.4-1-.4-1.4 0l-.7.7c-.4.4-.4 1 0 1.4l3.7 3.7c.2.2.5.3.7.3.3 0 .5-.1.7-.3l3.7-3.7c.4-.3.4-1 0-1.4z" fill="#888"/></svg>

Before

Width:  |  Height:  |  Size: 618 B

After

Width:  |  Height:  |  Size: 618 B

@@ -15,14 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Provides the unit tests class and some helper classes
*
* @package tool_installaddon
* @category test
* @copyright 2013 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_installaddon;
use testable_tool_installaddon_installer;
use tool_installaddon_installer;
defined('MOODLE_INTERNAL') || die();
@@ -32,10 +28,12 @@ require_once(__DIR__.'/fixtures/testable_installer.php');
/**
* Unit tests for the {@link tool_installaddon_installer} class
*
* @package tool_installaddon
* @category test
* @copyright 2013 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_installaddon_installer_testcase extends advanced_testcase {
class installer_test extends \advanced_testcase {
public function test_get_addons_repository_url() {
$installer = testable_tool_installaddon_installer::instance();
@@ -124,6 +124,12 @@ class controller {
}
if ($rm1 or $rm2) {
// Set the default site language to en if the deleted language pack is the default site language.
if ($CFG->lang === $lang) {
set_config('lang', 'en');
// Fix the user's current language to the default site language.
fix_current_language($CFG->lang);
}
$this->info[] = get_string('langpackremoved', 'tool_langimport', $lang);
event\langpack_removed::event_with_langcode($lang)->trigger();
return true;
+14 -1
View File
@@ -79,6 +79,19 @@ class locale {
* @return string|false Returns the new current locale, or FALSE on error.
*/
protected function set_locale(int $category = LC_ALL, string $locale = '0') {
return setlocale($category, $locale);
if (strlen($locale) <= 255 || PHP_OS_FAMILY === 'BSD' || PHP_OS_FAMILY === 'Darwin') {
// We can set the whole locale all together.
return setlocale($category, $locale);
}
// Too long locale with linux or windows, let's split it into known and supported categories.
$split = explode(';', $locale);
foreach ($split as $element) {
[$category, $value] = explode('=', $element);
if (defined($category)) { // Only if the category exists, there are OS differences.
setlocale(constant($category), $value);
}
}
return setlocale(LC_ALL, 0); // Finally, return the complete configured locale.
}
}
+106 -14
View File
@@ -14,26 +14,22 @@
// 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\locale
* @copyright 2018 Université Rennes 2 {@link https://www.univ-rennes2.fr}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Tests for \tool_langimport\locale class.
*
* @copyright 2018 Université Rennes 2 {@link https://www.univ-rennes2.fr}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class locale_testcase extends \advanced_testcase {
class locale_test extends \advanced_testcase {
/**
* Test that \tool_langimport\locale::check_locale_availability() works as expected.
*
* @covers ::check_locale_availability
* @return void
*/
public function test_check_locale_availability() {
@@ -41,7 +37,7 @@ class locale_testcase extends \advanced_testcase {
// - first setlocale() call which backup current locale
// - second setlocale() call which try to set new 'es' locale
// - third setlocale() call which restore locale.
$mock = $this->getMockBuilder(\tool_langimport\locale::class)
$mock = $this->getMockBuilder(locale::class)
->onlyMethods(['set_locale'])
->getMock();
$mock->method('set_locale')->will($this->onConsecutiveCalls('en', 'es', 'en'));
@@ -54,7 +50,7 @@ class locale_testcase extends \advanced_testcase {
// - first setlocale() call which backup current locale
// - second setlocale() call which fail to set new locale
// - third setlocale() call which restore locale.
$mock = $this->getMockBuilder(\tool_langimport\locale::class)
$mock = $this->getMockBuilder(locale::class)
->onlyMethods(['set_locale'])
->getMock();
$mock->method('set_locale')->will($this->onConsecutiveCalls('en', false, 'en'));
@@ -64,8 +60,104 @@ class locale_testcase extends \advanced_testcase {
$this->assertFalse($result);
// Test an invalid parameter.
$locale = new \tool_langimport\locale();
$this->expectException(coding_exception::class);
$locale = new locale();
$this->expectException(\coding_exception::class);
$locale->check_locale_availability('');
}
/**
* Test \tool_langimport\locale::set_locale() own logic.
*
* We have to explicitly test set_locale() own logic and results,
* that effectively sets the current locale, so we need to restore
* the original locale after every test (ugly, from a purist unit test
* point of view, but needed).
*
* @dataProvider set_locale_provider
* @covers ::set_locale
*
* @param string $set locale string to be set.
* @param string $ret expected results returned after setting the locale.
*/
public function test_set_locale(string $set, string $ret) {
// Make set_locale() public.
$loc = new locale();
$rc = new \ReflectionClass(locale::class);
$rm = $rc->getMethod('set_locale');
$rm->setAccessible(true);
// Capture current locale for later restore (funnily, using the set_locale() method itself.
$originallocale = $rm->invokeArgs($loc, [LC_ALL, 0]);
// Assert we get the locale defined as expected.
$this->assertEquals($ret, $rm->invokeArgs($loc, [LC_ALL, $set]));
// We have finished, restore the original locale, so this doesn't affect other tests at distance.
// (again, funnily, using the very same set_locale() method).
$rm->invokeArgs($loc, [LC_ALL, $originallocale]);
}
/**
* Data provider for test_set_locale().
*
* Provides a locale to be set (as 'set') and a expected return value (as 'ret'). Note that
* some of the locales are OS dependent, so only the ones matching the OS will be provided.
*
* We make extensive use of the en_AU.UTF-8/English_Australia.1252 locale that is mandatory to
* be installed in any system running PHPUnit tests.
*/
public function set_locale_provider(): array {
// Let's list the allowed categories by OS.
$bsdallowed = ['LC_COLLATE', 'LC_CTYPE', 'LC_MESSAGES', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME'];
$winallowed = ['LC_COLLATE', 'LC_CTYPE', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME'];
$linuxallowed = [
'LC_COLLATE', 'LC_CTYPE', 'LC_MESSAGES', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME',
'LC_PAPER', 'LC_NAME', 'LC_ADDRESS', 'LC_TELEPHONE', 'LC_MEASUREMENT', 'LC_IDENTIFICATION'
];
// The base locale name is also OS dependent.
$baselocale = get_string('locale', 'langconfig');
if (PHP_OS_FAMILY === 'Windows') {
$baselocale = get_string('localewin', 'langconfig');
}
// Here we'll go accumulating cases to be provided.
$cases = [];
// First, the simplest case, just pass a locale name, without categories.
$cases['rawlocale'] = [
'set' => $baselocale,
'ret' => $baselocale,
];
// Now, let's fill ALL LC categories, we should get back the locale name if all them are set with same value.
// Note that this case is the one that, under Linux only, covers the changes performed to the set_locale() method.
// Pick the correct categories depending on the OS.
$oscategories = $bsdallowed; // Default to BSD/Dawrwin ones because they are the standard 6 supported by PHP.
if (PHP_OS_FAMILY === 'Windows') {
$oscategories = $winallowed;
} else if (PHP_OS_FAMILY === 'Linux') {
$oscategories = $linuxallowed;
}
$localestr = '';
foreach ($oscategories as $category) {
// Format is different by OS too, so let build the string conditionally.
if (PHP_OS_FAMILY === 'BSD' || PHP_OS_FAMILY === 'Darwin') {
// BSD uses slashes (/) separated list of the 6 values in exact order.
$localestr .= '/' . $baselocale;
} else {
// Linux/Windows use semicolon (;) separated list of category=value pairs.
$localestr .= ';' . $category . '=' . $baselocale;
}
}
$cases['allcategories'] = [
'set' => trim($localestr, ';/'),
'ret' => $baselocale,
];
// Return all the built cases.
return $cases;
}
}
@@ -33,3 +33,27 @@ 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 "Manage private files..."
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 "Manage private files..."
And I follow "Add..."
Then the field with xpath "//select[@name='license']" matches value "<expectedlicence>"
Examples:
| rememberuserlicensepref | expectedlicence |
| 0 | Creative Commons |
| 1 | Public domain |
@@ -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;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

After

Width:  |  Height:  |  Size: 510 B

+1 -1
View File
@@ -9,7 +9,7 @@
xml:space="preserve" preserveAspectRatio="xMinYMid meet">
<defs>
</defs>
<path style="fill:#999999;" d="M8.5,9.5C8.8,10,9,10.6,9,11.2c0,0.6-0.3,1.1-0.7,1.6l-2.5,2.5C5.2,15.8,4.7,16,4,16
<path style="fill:#888;" d="M8.5,9.5C8.8,10,9,10.6,9,11.2c0,0.6-0.3,1.1-0.7,1.6l-2.5,2.5C5.2,15.8,4.7,16,4,16
s-1.3-0.2-1.7-0.7l-1.5-1.5C0.2,13.3,0,12.7,0,12c0-0.7,0.2-1.3,0.7-1.7l2.5-2.5C3.7,7.3,4.3,7,5,7c0.5,0,1,0.2,1.5,0.5l-1,1
C5.3,8.5,5.2,8.4,5,8.4c-0.3,0-0.5,0.1-0.8,0.3l-2.5,2.5c-0.2,0.2-0.3,0.5-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l1.5,1.5
c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3l2.5-2.5c0.2-0.2,0.3-0.5,0.3-0.8c0-0.2,0-0.3-0.1-0.4L8.5,9.5z M5,10L10,5

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

@@ -77,9 +77,10 @@
ucw.registerEvents('[data-region="user-competency-status"]');
ucw.on('status-changed', infoReloader.reload.bind(infoReloader));
ucw.on('error-occured', infoReloader.reload.bind(infoReloader));
var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '{{plan.id}}', '', '{{#str}}chooserating, tool_lp{{/str}}');
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
{{#cangrade}}
var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '{{plan.id}}', '', '{{#str}}chooserating, tool_lp{{/str}}');
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
{{/cangrade}}
});
{{/js}}
{{/usercompetency}}
@@ -95,13 +95,14 @@
{{#js}}
require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info'], function($, mod, info) {
var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', '{{#str}}chooserating, tool_lp{{/str}}');
var competencyElement = $('[data-region-id="{{uniqid}}"]');
var displayuser = ('{{displayuser}}' == 'true') ? true : false;
var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', displayuser);
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
{{#cangrade}}
var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '', '{{course.id}}', '{{#str}}chooserating, tool_lp{{/str}}');
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
{{/cangrade}}
});
{{/js}}
@@ -63,4 +63,67 @@ class behat_tool_lp extends behat_base {
$this->execute('behat_general::i_click_on', [$xpathtarget, 'xpath_element']);
}
/**
* Convert page names to URLs for steps like 'When I am on the "[identifier]" "[page type]" page'.
*
* Recognised page names are:
* | pagetype | name meaning | description |
* | Course competencies | Course name | The course competencies page |
*
* @param string $page identifies which type of page this is, e.g. 'Course competencies'.
* @param string $identifier identifies the particular page, e.g. 'C1'.
* @return moodle_url the corresponding URL.
* @throws Exception with a meaningful error message if the specified page cannot be found.
*/
protected function resolve_page_instance_url(string $page, string $identifier): moodle_url {
switch (strtolower($page)) {
case 'course competencies':
$courseid = $this->get_course_id($identifier);
return new moodle_url('/admin/tool/lp/coursecompetencies.php', [
'courseid' => $courseid,
]);
default:
throw new Exception("Unrecognised page type '{$page}'");
}
}
/**
* Return a list of the exact named selectors for the component.
*
* @return behat_component_named_selector[]
*/
public static function get_exact_named_selectors(): array {
return [
new behat_component_named_selector('competency', [
"//*[@data-region='coursecompetencies']//table[contains(@class,'managecompetencies')]".
"//tr[contains(., //a[@title='View details'][contains(., %locator%)])]",
]),
new behat_component_named_selector('learning plan', [
"//*[@data-region='plan-competencies']//table[contains(@class,'managecompetencies')]".
"//tr[@data-node='user-competency'][contains(., //a[@data-usercompetency='true'][contains(., %locator%)])]",
]),
new behat_component_named_selector('competency description', [
"//td/p[contains(., %locator%)]",
]),
new behat_component_named_selector('competency grade', [
"//span[contains(concat(' ', normalize-space(@class), ' '), ' badge ')][contains(., %locator%)]",
]),
new behat_component_named_selector('learning plan rating', [
"//td[position()=2][contains(., %locator%)]",
]),
new behat_component_named_selector('learning plan proficiency', [
"//td[position()=3][contains(., %locator%)]",
]),
new behat_component_named_selector('competency page proficiency', [
"//dt[contains(., 'Proficient')]/following-sibling::dd[1][contains(., %locator%)]",
]),
new behat_component_named_selector('competency page rating', [
"//dt[contains(., 'Rating')]/following-sibling::dd[1][contains(., %locator%)]",
]),
new behat_component_named_selector('competency page related competency', [
"//*[@data-region='relatedcompetencies']//a[contains(., %locator%)]",
]),
];
}
}
@@ -144,9 +144,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"
And I follow "Learning plans"
@@ -163,9 +161,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"
And I follow "Learning plans"
@@ -185,9 +181,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"
And I follow "Learning plans"
@@ -0,0 +1,187 @@
@tool @tool_lp @javascript
Feature: View competencies
In order to access competency information
As a user
I need to view user competencies
Background:
Given the following "users" exist:
| username | firstname | lastname |
| student1 | Student | first |
| teacher1 | Teacher | first |
And the following "system role assigns" exist:
| user | role | contextlevel |
| teacher1 | editingteacher | System |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/competency:planview | Allow | editingteacher | System | |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "scales" exist:
| name | scale |
| Test Scale | Bad, Good, Great |
And the following "core_competency > frameworks" exist:
| shortname | idnumber | scale |
| Cookery | cookery | Test Scale |
| Literacy | literacy | Test Scale |
And the following "core_competency > competencies" exist:
| shortname | idnumber | description | competencyframework |
| Salads | salads | Salads are important | cookery |
| Desserts | desserts | Desserts are important | cookery |
| Cakes | cakes | Cakes are important | cookery |
| Reading | reading | Reading is important | literacy |
| Writing | writing | Writing is important | literacy |
And the following "core_competency > related_competencies" exist:
| competency | relatedcompetency |
| desserts | cakes |
And the following "core_competency > plans" exist:
| name | description | competencies | user |
| Cookery | Cookery is important | salads, desserts, cakes | student1 |
| Literacy | Literacy is important | reading, writing | student1 |
And the following "core_competency > course_competencies" exist:
| course | competency |
| C1 | salads |
| C1 | desserts |
| C1 | cakes |
| C1 | reading |
| C1 | writing |
And the following "core_competency > user_competency" exist:
| competency | user | grade |
| salads | student1 | Good |
| desserts | student1 | Great |
| cakes | student1 | Great |
And the following "core_competency > user_competency_courses" exist:
| course | competency | user | grade |
| C1 | salads | student1 | Good |
| C1 | desserts | student1 | Great |
| C1 | cakes | student1 | Great |
Scenario: Student view
# Course competencies
Given I am on the "C1" "tool_lp > course competencies" page logged in as "student1"
Then I should see "You are proficient in 3 out of 5 competencies in this course"
And "Salads are important" "tool_lp > competency description" should exist in the "Salads" "tool_lp > competency"
And "Good" "tool_lp > competency grade" should exist in the "Salads" "tool_lp > competency"
And "Desserts are important" "tool_lp > competency description" should exist in the "Desserts" "tool_lp > competency"
And "Great" "tool_lp > competency grade" should exist in the "Desserts" "tool_lp > competency"
And "Cakes are important" "tool_lp > competency description" should exist in the "Cakes" "tool_lp > competency"
And "Great" "tool_lp > competency grade" should exist in the "Cakes" "tool_lp > competency"
And "Reading is important" "tool_lp > competency description" should exist in the "Reading" "tool_lp > competency"
And "Good" "tool_lp > competency grade" should not exist in the "Reading" "tool_lp > competency"
And "Great" "tool_lp > competency grade" should not exist in the "Reading" "tool_lp > competency"
And "Bad" "tool_lp > competency grade" should not exist in the "Reading" "tool_lp > competency"
And "Writing is important" "tool_lp > competency description" should exist in the "Writing" "tool_lp > competency"
And "Good" "tool_lp > competency grade" should not exist in the "Writing" "tool_lp > competency"
And "Great" "tool_lp > competency grade" should not exist in the "Writing" "tool_lp > competency"
And "Bad" "tool_lp > competency grade" should not exist in the "Writing" "tool_lp > competency"
# Course competencies details
And I click on "Desserts" "link" in the "Desserts" "tool_lp > competency"
And I should see "Desserts are important"
And "Yes" "tool_lp > competency page proficiency" should exist
And "Great" "tool_lp > competency page rating" should exist
# Course competencies summary
And I click on "Cakes" "link"
And I should see "Cakes are important"
# Learning plans
And I click on "Close" "button" in the "Cakes" "dialogue"
And I follow "Profile" in the user menu
And I click on "Learning plans" "link"
And I should see "Cookery"
And I should see "Literacy"
# Learning plans details
And I click on "Cookery" "link"
And I should see "Cookery is important"
And I should see "3 out of 3 competencies are proficient"
And "Good" "tool_lp > learning plan rating" should exist in the "Salads" "tool_lp > learning plan"
And "Yes" "tool_lp > learning plan proficiency" should exist in the "Salads" "tool_lp > learning plan"
And "Great" "tool_lp > learning plan rating" should exist in the "Desserts" "tool_lp > learning plan"
And "Yes" "tool_lp > learning plan proficiency" should exist in the "Desserts" "tool_lp > learning plan"
And "Great" "tool_lp > learning plan rating" should exist in the "Cakes" "tool_lp > learning plan"
And "Yes" "tool_lp > learning plan proficiency" should exist in the "Cakes" "tool_lp > learning plan"
And I should not see "Literacy"
And I should not see "Reading"
And I should not see "Writing"
# Learning plans competency details
And I click on "Desserts" "link" in the "Desserts" "tool_lp > learning plan"
And I should see "Desserts are important"
And "Yes" "tool_lp > competency page proficiency" should exist
And "Great" "tool_lp > competency page rating" should exist
# Learning plans competency summary
And I click on "Cakes cakes" "link"
And I should see "Cakes are important"
Scenario: Teacher view
# Participant competencies
Given I am on the "C1" "report_competency > breakdown" page logged in as "teacher1"
Then I should see "Student first"
And "Good" "report_competency > breakdown rating" should exist in the "Salads" "report_competency > breakdown"
And "Great" "report_competency > breakdown rating" should exist in the "Desserts" "report_competency > breakdown"
And "Great" "report_competency > breakdown rating" should exist in the "Cakes" "report_competency > breakdown"
And "Not rated" "report_competency > breakdown rating" should exist in the "Reading" "report_competency > breakdown"
And "Not rated" "report_competency > breakdown rating" should exist in the "Writing" "report_competency > breakdown"
# Participant competencies details
And I click on "Great" "report_competency > breakdown rating" in the "Desserts" "report_competency > breakdown"
And "Yes" "tool_lp > competency page proficiency" should exist
And "Great" "tool_lp > competency page rating" should exist
# Participant competencies summary
And I click on "Cakes" "tool_lp > competency page related competency"
And I should see "Cakes are important"
# Participant learning plans
And I click on "Close" "button" in the "Cakes" "dialogue"
And I click on "Close" "button" in the "User competency summary" "dialogue"
And I navigate to course participants
And I click on "Student first" "link"
And I click on "Learning plans" "link"
And I should see "Cookery"
And I should see "Literacy"
# Participant learning plans details
And I click on "Cookery" "link"
And I should see "Cookery is important"
And I should see "3 out of 3 competencies are proficient"
And "Good" "tool_lp > learning plan rating" should exist in the "Salads" "tool_lp > learning plan"
And "Yes" "tool_lp > learning plan proficiency" should exist in the "Salads" "tool_lp > learning plan"
And "Great" "tool_lp > learning plan rating" should exist in the "Desserts" "tool_lp > learning plan"
And "Yes" "tool_lp > learning plan proficiency" should exist in the "Desserts" "tool_lp > learning plan"
And "Great" "tool_lp > learning plan rating" should exist in the "Cakes" "tool_lp > learning plan"
And "Yes" "tool_lp > learning plan proficiency" should exist in the "Cakes" "tool_lp > learning plan"
And I should not see "Literacy"
And I should not see "Reading"
And I should not see "Writing"
# Learning plans competency details
And I click on "Desserts" "link"
And I should see "Desserts are important"
And "Yes" "tool_lp > competency page proficiency" should exist
And "Great" "tool_lp > competency page rating" should exist
# Learning plans competency summary
And I click on "Cakes" "tool_lp > competency page related competency"
And I should see "Cakes are important"
+2 -1
View File
@@ -27,7 +27,8 @@ require_once($CFG->libdir . '/externallib.php');
$userid = required_param('userid', PARAM_INT); // The user id the key belongs to (for double-checking).
$key = required_param('key', PARAM_ALPHANUMEXT); // The key generated by the tool_mobile_external::get_autologin_key() external function.
$urltogo = optional_param('urltogo', $CFG->wwwroot, PARAM_URL); // URL to redirect.
$urltogo = optional_param('urltogo', $CFG->wwwroot, PARAM_LOCALURL); // URL to redirect.
$urltogo = $urltogo ?: $CFG->wwwroot;
$context = context_system::instance();
$PAGE->set_context($context);
+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);
}
/**
@@ -14,14 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for event observers.
*
* @package tool_monitor
* @category test
* @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();
@@ -30,11 +23,14 @@ require_once($CFG->dirroot . '/blog/locallib.php');
require_once($CFG->dirroot . '/blog/lib.php');
/**
* Class tool_monitor_eventobservers_testcase
* Unit tests for event observers.
*
* Tests for event observers
* @package tool_monitor
* @category test
* @copyright 2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_monitor_eventobservers_testcase extends advanced_testcase {
class eventobservers_test extends \advanced_testcase {
/**
* Set up method.
*/
@@ -57,12 +53,12 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$course2 = $this->getDataGenerator()->create_course();
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$rule = new stdClass();
$rule = new \stdClass();
$rule->userid = $user->id;
$rule->courseid = $course1->id;
$rule->plugin = 'test';
$sub = new stdClass();
$sub = new \stdClass();
$sub->courseid = $course1->id;
$sub->userid = $user->id;
@@ -83,7 +79,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
}
// Add a site rule.
$rule = new stdClass();
$rule = new \stdClass();
$rule->userid = $user->id;
$rule->courseid = 0;
$rule->plugin = 'core';
@@ -135,7 +131,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
// Fire a bunch of events.
// Trigger a bunch of other events.
$eventparams = array(
'context' => context_course::instance($course->id)
'context' => \context_course::instance($course->id)
);
for ($i = 0; $i < 5; $i++) {
\core\event\course_viewed::create($eventparams)->trigger();
@@ -148,14 +144,14 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$this->assertEquals(0, $DB->count_records('tool_monitor_events'));
// Now, let's create a rule so an event can be stored.
$rule = new stdClass();
$rule = new \stdClass();
$rule->courseid = $course->id;
$rule->plugin = 'mod_book';
$rule->eventname = '\mod_book\event\course_module_instance_list_viewed';
$rule = $monitorgenerator->create_rule($rule);
// Let's subscribe to this rule.
$sub = new stdClass;
$sub = new \stdClass;
$sub->courseid = $course->id;
$sub->ruleid = $rule->id;
$sub->userid = $user->id;
@@ -187,14 +183,14 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$DB->delete_records('tool_monitor_events');
// Now, let's create a site wide rule.
$rule = new stdClass();
$rule = new \stdClass();
$rule->courseid = 0;
$rule->plugin = 'mod_book';
$rule->eventname = '\mod_book\event\course_module_instance_list_viewed';
$rule = $monitorgenerator->create_rule($rule);
// Let's subscribe to this rule.
$sub = new stdClass;
$sub = new \stdClass;
$sub->courseid = 0;
$sub->ruleid = $rule->id;
$sub->userid = $user->id;
@@ -231,14 +227,14 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$course = $this->getDataGenerator()->create_course();
$toolgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$rulerecord = new stdClass();
$rulerecord = new \stdClass();
$rulerecord->courseid = $course->id;
$rulerecord->eventname = '\mod_book\event\course_module_instance_list_viewed';
$rulerecord->frequency = 1;
$rule = $toolgenerator->create_rule($rulerecord);
$subrecord = new stdClass();
$subrecord = new \stdClass();
$subrecord->courseid = $course->id;
$subrecord->ruleid = $rule->id;
$subrecord->userid = $USER->id;
@@ -279,7 +275,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$DB->delete_records('tool_monitor_events');
// Now let us create a rule specific to a module instance.
$cm = new stdClass();
$cm = new \stdClass();
$cm->course = $course->id;
$book = $this->getDataGenerator()->create_module('book', $cm);
$rulerecord->eventname = '\mod_book\event\course_module_viewed';
@@ -290,7 +286,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
// Let us trigger events.
$params = array(
'context' => context_module::instance($book->cmid),
'context' => \context_module::instance($book->cmid),
'objectid' => $book->id
);
for ($i = 0; $i < 5; $i++) {
@@ -337,10 +333,10 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$toolgenerator->create_subscription($subrecord);
// Let us trigger events.
$blog = new blog_entry();
$blog = new \blog_entry();
$blog->subject = "Subject of blog";
$blog->userid = $USER->id;
$states = blog_entry::get_applicable_publish_states();
$states = \blog_entry::get_applicable_publish_states();
$blog->publishstate = reset($states);
for ($i = 0; $i < 5; $i++) {
$newblog = fullclone($blog);
@@ -367,14 +363,14 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$course = $this->getDataGenerator()->create_course();
$toolgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$rulerecord = new stdClass();
$rulerecord = new \stdClass();
$rulerecord->courseid = $course->id;
$rulerecord->eventname = '\mod_book\event\course_module_instance_list_viewed';
$rulerecord->frequency = 5;
$rule = $toolgenerator->create_rule($rulerecord);
$subrecord = new stdClass();
$subrecord = new \stdClass();
$subrecord->courseid = $course->id;
$subrecord->ruleid = $rule->id;
$subrecord->userid = $USER->id;
@@ -416,7 +412,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
*
* @param phpunit_message_sink $msgsink Message sink
*/
protected function verify_processed_data(phpunit_message_sink $msgsink) {
protected function verify_processed_data(\phpunit_message_sink $msgsink) {
global $DB, $USER;
$recordexists = $DB->count_records('task_adhoc', array('component' => 'tool_monitor'));
@@ -435,7 +431,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
*
* @param phpunit_message_sink $msgsink Message sink
*/
protected function verify_message_not_sent_yet(phpunit_message_sink $msgsink) {
protected function verify_message_not_sent_yet(\phpunit_message_sink $msgsink) {
$msgs = $msgsink->get_messages();
$this->assertCount(0, $msgs);
$msgsink->clear();
@@ -457,12 +453,12 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$context = \context_user::instance($USER->id, IGNORE_MISSING);
// Creating book.
$cm = new stdClass();
$cm = new \stdClass();
$cm->course = $course->id;
$book = $this->getDataGenerator()->create_module('book', $cm);
// Creating rule.
$rulerecord = new stdClass();
$rulerecord = new \stdClass();
$rulerecord->courseid = $course->id;
$rulerecord->eventname = '\mod_book\event\course_module_viewed';
$rulerecord->cmid = $book->cmid;
@@ -478,7 +474,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$rule = $toolgenerator->create_rule($rulerecord);
// Creating subscription.
$subrecord = new stdClass();
$subrecord = new \stdClass();
$subrecord->courseid = $course->id;
$subrecord->ruleid = $rule->id;
$subrecord->userid = $USER->id;
@@ -486,7 +482,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
// Now let us trigger the event.
$params = array(
'context' => context_module::instance($book->cmid),
'context' => \context_module::instance($book->cmid),
'objectid' => $book->id
);
@@ -496,7 +492,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$msgs = $msgsink->get_messages();
$msg = array_pop($msgs);
$modurl = new moodle_url('/mod/book/view.php', array('id' => $book->cmid));
$modurl = new \moodle_url('/mod/book/view.php', array('id' => $book->cmid));
$this->assertMatchesRegularExpression('~<h2>.*' . preg_quote($event->get_url()->out(), '~') . '.*</h2>~',
$msg->fullmessagehtml);
@@ -529,12 +525,12 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$course2 = $this->getDataGenerator()->create_course();
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$rule = new stdClass();
$rule = new \stdClass();
$rule->userid = $user->id;
$rule->courseid = $course1->id;
$rule->plugin = 'test';
$sub = new stdClass();
$sub = new \stdClass();
$sub->courseid = $course1->id;
$sub->userid = $user->id;
@@ -585,16 +581,16 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
// Now let us create a rule specific to a module instance.
$cm = new stdClass();
$cm = new \stdClass();
$cm->course = $course1->id;
$book = $this->getDataGenerator()->create_module('book', $cm);
$rule = new stdClass();
$rule = new \stdClass();
$rule->userid = $user->id;
$rule->courseid = $course1->id;
$rule->plugin = 'test';
$sub = new stdClass();
$sub = new \stdClass();
$sub->courseid = $course1->id;
$sub->userid = $user->id;
$sub->cmid = $book->cmid;
+11 -19
View File
@@ -14,6 +14,8 @@
// 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_monitor;
/**
* Unit tests for rule manager api.
*
@@ -22,17 +24,7 @@
* @copyright 2014 onwards Simey Lameze <simey@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
/**
* Tests for rule manager.
*
* Class tool_monitor_rule_manager_testcase
*/
class tool_monitor_rule_manager_testcase extends advanced_testcase {
class rule_manager_test extends \advanced_testcase {
/**
* Set up method.
@@ -53,7 +45,7 @@ class tool_monitor_rule_manager_testcase extends advanced_testcase {
$course = $this->getDataGenerator()->create_course();
$now = time();
$rule = new stdClass();
$rule = new \stdClass();
$rule->userid = $user->id;
$rule->courseid = $course->id;
$rule->name = 'test rule 1';
@@ -98,7 +90,7 @@ class tool_monitor_rule_manager_testcase extends advanced_testcase {
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$rule = $monitorgenerator->create_rule();
$ruledata = new stdClass;
$ruledata = new \stdClass;
$ruledata->id = $rule->id;
$ruledata->frequency = 25;
@@ -119,10 +111,10 @@ class tool_monitor_rule_manager_testcase extends advanced_testcase {
$course1 = $this->getDataGenerator()->create_course();
$course2 = $this->getDataGenerator()->create_course();
$record = new stdClass();
$record = new \stdClass();
$record->courseid = $course1->id;
$record2 = new stdClass();
$record2 = new \stdClass();
$record2->courseid = $course2->id;
$ruleids = array();
@@ -147,10 +139,10 @@ class tool_monitor_rule_manager_testcase extends advanced_testcase {
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$record = new stdClass();
$record = new \stdClass();
$record->plugin = 'core';
$record2 = new stdClass();
$record2 = new \stdClass();
$record2->plugin = 'mod_assign';
$ruleids = array();
@@ -175,10 +167,10 @@ class tool_monitor_rule_manager_testcase extends advanced_testcase {
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$rule = $monitorgenerator->create_rule();
$record = new stdClass();
$record = new \stdClass();
$record->eventname = '\core\event\calendar_event_created';
$record2 = new stdClass();
$record2 = new \stdClass();
$record2->eventname = '\core\event\calendar_event_updated';
$ruleids = array();
@@ -14,6 +14,8 @@
// 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_monitor;
/**
* Unit tests for subscription manager api.
*
@@ -22,17 +24,7 @@
* @copyright 2014 onwards Simey Lameze <simey@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
/**
* Tests for subscription manager.
*
* Class tool_monitor_subscription_manager_testcase.
*/
class tool_monitor_subscription_manager_testcase extends advanced_testcase {
class subscription_manager_test extends \advanced_testcase {
/**
* Test count_rule_subscriptions method.
@@ -56,7 +48,7 @@ class tool_monitor_subscription_manager_testcase extends advanced_testcase {
$this->assertEquals(0, $subs);
// Subscribe user 1 to rule 1.
$record = new stdClass;
$record = new \stdClass;
$record->ruleid = $rule1->id;
$record->userid = $user1->id;
$monitorgenerator->create_subscription($record);
@@ -75,4 +67,4 @@ class tool_monitor_subscription_manager_testcase extends advanced_testcase {
$this->assertEquals(2, $subs1);
$this->assertEquals(1, $subs2);
}
}
}
@@ -13,7 +13,8 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || exit();
namespace tool_monitor;
/**
* Unit tests for the subscription class.
@@ -24,7 +25,7 @@ defined('MOODLE_INTERNAL') || exit();
* @copyright 2016 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_monitor_subscription_testcase extends advanced_testcase {
class subscription_test extends \advanced_testcase {
/**
* @var \tool_monitor\subscription $subscription object.
@@ -38,7 +39,7 @@ class tool_monitor_subscription_testcase extends advanced_testcase {
$this->resetAfterTest(true);
// Create the mock subscription.
$sub = new stdClass();
$sub = new \stdClass();
$sub->id = 100;
$sub->name = 'My test rule';
$sub->courseid = 20;
@@ -62,7 +63,7 @@ class tool_monitor_subscription_testcase extends advanced_testcase {
*/
public function test_magic_get() {
$this->assertEquals(20, $this->subscription->courseid);
$this->expectException(coding_exception::class);
$this->expectException(\coding_exception::class);
$this->subscription->ruleid;
}
}
@@ -13,7 +13,8 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || exit();
namespace tool_monitor;
/**
* Unit tests for the tool_monitor clean events task.
@@ -24,7 +25,7 @@ defined('MOODLE_INTERNAL') || exit();
* @copyright 2016 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_monitor_task_check_subscriptions_testcase extends advanced_testcase {
class task_check_subscriptions_test extends \advanced_testcase {
private $course;
private $user;
@@ -45,7 +46,7 @@ class tool_monitor_task_check_subscriptions_testcase extends advanced_testcase {
$this->user = $this->getDataGenerator()->create_user();
$this->course = $this->getDataGenerator()->create_course();
$rule = new stdClass();
$rule = new \stdClass();
$rule->userid = 2; // Rule created by admin.
$rule->courseid = $this->course->id;
$rule->plugin = 'mod_book';
@@ -54,7 +55,7 @@ class tool_monitor_task_check_subscriptions_testcase extends advanced_testcase {
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$this->rule = $monitorgenerator->create_rule($rule);
$sub = new stdClass();
$sub = new \stdClass();
$sub->courseid = $this->course->id;
$sub->userid = $this->user->id;
$sub->ruleid = $this->rule->id;
@@ -90,7 +91,7 @@ class tool_monitor_task_check_subscriptions_testcase extends advanced_testcase {
public function test_site_level_subscription() {
// Create a site level subscription.
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$sub = new stdClass();
$sub = new \stdClass();
$sub->userid = $this->user->id;
$sub->ruleid = $this->rule->id;
$this->subscription = $monitorgenerator->create_subscription($sub);
@@ -104,7 +105,7 @@ class tool_monitor_task_check_subscriptions_testcase extends advanced_testcase {
$this->assertEquals(false, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Now, assign the user as a teacher role at system context.
$this->getDataGenerator()->role_assign($this->teacherrole->id, $this->user->id, context_system::instance());
$this->getDataGenerator()->role_assign($this->teacherrole->id, $this->user->id, \context_system::instance());
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
@@ -238,7 +239,7 @@ class tool_monitor_task_check_subscriptions_testcase extends advanced_testcase {
$book = $this->getDataGenerator()->create_module('book', array('course' => $this->course->id));
// And add a subscription to it.
$sub = new stdClass();
$sub = new \stdClass();
$sub->courseid = $this->course->id;
$sub->userid = $this->user->id;
$sub->ruleid = $this->rule->id;
@@ -14,6 +14,8 @@
// 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_monitor;
/**
* Unit tests for the tool_monitor clean events task.
*
@@ -22,15 +24,7 @@
* @copyright 2014 Mark Nelson <markn@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
/**
* Class used to test the tool_monitor clean events task.
*/
class tool_monitor_task_clean_events_testcase extends advanced_testcase {
class task_clean_events_test extends \advanced_testcase {
/**
* Test set up.
@@ -51,16 +45,16 @@ class tool_monitor_task_clean_events_testcase extends advanced_testcase {
$course = $this->getDataGenerator()->create_course();
$bookgenerator = $this->getDataGenerator()->get_plugin_generator('mod_book');
$book = $this->getDataGenerator()->create_module('book', array('course' => $course->id));
$bookcontext = context_module::instance($book->cmid);
$bookcontext = \context_module::instance($book->cmid);
$bookchapter = $bookgenerator->create_chapter(array('bookid' => $book->id));
$course2 = $this->getDataGenerator()->create_course();
$book2 = $this->getDataGenerator()->create_module('book', array('course' => $course2->id));
$book2context = context_module::instance($book2->cmid);
$book2context = \context_module::instance($book2->cmid);
$book2chapter = $bookgenerator->create_chapter(array('bookid' => $book2->id));
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
// Let's set some data for the rules we need before we can generate them.
$rule = new stdClass();
$rule = new \stdClass();
$rule->userid = $user->id;
$rule->courseid = $course->id;
$rule->plugin = 'mod_book';
@@ -96,7 +90,7 @@ class tool_monitor_task_clean_events_testcase extends advanced_testcase {
// Let's subscribe to these rules.
$sub = new stdClass;
$sub = new \stdClass;
$sub->courseid = $course->id;
$sub->ruleid = $rule1->id;
$sub->userid = $user->id;
@@ -133,7 +127,7 @@ class tool_monitor_task_clean_events_testcase extends advanced_testcase {
// Trigger a bunch of other events.
$eventparams = array(
'context' => context_course::instance($course->id)
'context' => \context_course::instance($course->id)
);
for ($i = 0; $i < 5; $i++) {
\mod_quiz\event\course_module_instance_list_viewed::create($eventparams)->trigger();
@@ -164,7 +158,7 @@ class tool_monitor_task_clean_events_testcase extends advanced_testcase {
$this->assertEquals($course2->id, $event4->courseid);
// Update the timewindow for two of the rules.
$updaterule = new stdClass();
$updaterule = new \stdClass();
$updaterule->id = $rule1->id;
$updaterule->timewindow = 0;
\tool_monitor\rule_manager::update_rule($updaterule);
@@ -0,0 +1,45 @@
<?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_moodlenet\task;
use core\message\message;
/**
* Ad-hoc task to send a notification to admin stating that the user data related to the linked MoodleNet profiles has
* been removed.
*
* @package tool_moodlenet
* @copyright 2022 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class send_mnet_profiles_data_removed_notification extends \core\task\adhoc_task {
public function execute(): void {
$message = new message();
$message->component = 'moodle';
$message->name = 'notices';
$message->userfrom = \core_user::get_noreply_user();
$message->userto = get_admin();
$message->notification = 1;
$message->subject = get_string('removedmnetprofilenotification_subject', 'tool_moodlenet');
$message->fullmessageformat = FORMAT_HTML;
$message->fullmessagehtml = get_string('removedmnetprofilenotification', 'tool_moodlenet');
$message->smallmessage = strip_tags($message->fullmessagehtml);
message_send($message);
}
}
+19
View File
@@ -129,5 +129,24 @@ function xmldb_tool_moodlenet_upgrade(int $oldversion) {
// Automatically generated Moodle v3.11.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2021051701) {
$selectsql = "moodlenetprofile IS NOT NULL AND moodlenetprofile != ''";
// If there are any users with MoodleNet profile set.
if ($DB->count_records_select('user', $selectsql)) {
// Remove the value set for the MoodleNet profile as this format can no longer be used to authenticate
// MoodleNet users.
$DB->set_field_select('user', 'moodlenetprofile', '', $selectsql);
// Use an adhoc task to send a notification to admin stating that the user data related to the linked
// MoodleNet profiles has been removed.
$notificationtask = new tool_moodlenet\task\send_mnet_profiles_data_removed_notification();
core\task\manager::queue_adhoc_task($notificationtask);
}
upgrade_plugin_savepoint(true, 2021051701, 'tool', 'moodlenet');
}
return true;
}
@@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();
$string['addingaresource'] = 'Adding content from MoodleNet';
$string['aria:enterprofile'] = "Enter your MoodleNet profile URL";
$string['aria:enterprofile'] = "Enter your MoodleNet profile ID";
$string['aria:footermessage'] = "Browse for content on MoodleNet";
$string['browsecontentmoodlenet'] = "Or browse for content on MoodleNet";
$string['clearsearch'] = "Clear search";
@@ -39,11 +39,11 @@ $string['defaultmoodlenetname_desc'] = 'The name of the MoodleNet instance avail
$string['enablemoodlenet'] = 'Enable MoodleNet integration';
$string['enablemoodlenet_desc'] = 'If enabled, a user with the capability to create and manage activities can browse MoodleNet via the activity chooser and import MoodleNet resources into their course. In addition, a user with the capability to restore backups can select a backup file on MoodleNet and restore it into Moodle.';
$string['errorduringdownload'] = 'An error occurred while downloading the file: {$a}';
$string['forminfo'] = 'Your MoodleNet profile will be automatically saved in your profile on this site.';
$string['forminfo'] = 'Your MoodleNet profile ID will be automatically saved in your profile on this site.';
$string['footermessage'] = "Or browse for content on";
$string['instancedescription'] = "MoodleNet is an open social media platform for educators, with a focus on the collaborative curation of collections of open resources. ";
$string['instanceplaceholder'] = '@yourprofile@moodle.net';
$string['inputhelp'] = 'Or if you have a MoodleNet account already, enter your MoodleNet profile:';
$string['instanceplaceholder'] = 'a1b2c3d4e5f6-example@moodle.net';
$string['inputhelp'] = 'Or if you have a MoodleNet account already, copy the ID from your MoodleNet profile and paste it here:';
$string['invalidmoodlenetprofile'] = '$userprofile is not correctly formatted';
$string['importconfirm'] = 'You are about to import the content "{$a->resourcename} ({$a->resourcetype})" into the course "{$a->coursename}". Are you sure you want to continue?';
$string['importconfirmnocourse'] = 'You are about to import the content "{$a->resourcename} ({$a->resourcetype})" into your site. Are you sure you want to continue?';
@@ -56,12 +56,14 @@ $string['mnetprofiledesc'] = '<p>Enter your MoodleNet profile details here to be
$string['moodlenetsettings'] = 'MoodleNet settings';
$string['moodlenetnotenabled'] = 'The MoodleNet integration must be enabled in Site administration / MoodleNet before resource imports can be processed.';
$string['notification'] = 'You are about to import the content "{$a->name} ({$a->type})" into your site. Select the course in which it should be added, or <a href="{$a->cancellink}">cancel</a>.';
$string['removedmnetprofilenotification'] = 'Due to recent changes on the MoodleNet platform, any users who previously saved their MoodleNet profile ID on the site will need to enter a MoodleNet profile ID in the new format in order to authenticate on the MoodleNet platform.';
$string['removedmnetprofilenotification_subject'] = 'MoodleNet profile ID format change';
$string['searchcourses'] = "Search courses";
$string['selectpagetitle'] = 'Select page';
$string['pluginname'] = 'MoodleNet';
$string['privacy:metadata'] = "The MoodleNet tool only facilitates communication with MoodleNet. It stores no data.";
$string['profilevalidationerror'] = 'There was a problem trying to validate your profile';
$string['profilevalidationfail'] = 'Please enter a valid MoodleNet profile';
$string['profilevalidationerror'] = 'There was a problem trying to validate your MoodleNet profile ID';
$string['profilevalidationfail'] = 'Please enter a valid MoodleNet profile ID';
$string['profilevalidationpass'] = 'Looks good!';
$string['saveandgo'] = "Save and go";
$string['uploadlimitexceeded'] = 'The file size {$a->filesize} exceeds the user upload limit of {$a->uploadlimit} bytes.';
@@ -14,6 +14,8 @@
// 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_moodlenet;
/**
* Unit tests for the import_backup_helper
*
@@ -22,15 +24,7 @@
* @copyright 2020 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
/**
* Class import_backup_helper tests
*/
class tool_moodlenet_import_backup_helper_testcase extends advanced_testcase {
class import_backup_helper_test extends \advanced_testcase {
/**
* Test that the first available context with the capability to upload backup files is returned.
@@ -47,7 +41,7 @@ class tool_moodlenet_import_backup_helper_testcase extends advanced_testcase {
$user5 = $this->getDataGenerator()->create_user();
$course = $this->getDataGenerator()->create_course();
$coursecontext = context_course::instance($course->id);
$coursecontext = \context_course::instance($course->id);
$this->getDataGenerator()->enrol_user($user1->id, $course->id, 'student');
$this->getDataGenerator()->enrol_user($user2->id, $course->id, 'editingteacher');
@@ -55,12 +49,12 @@ class tool_moodlenet_import_backup_helper_testcase extends advanced_testcase {
$category = $this->getDataGenerator()->create_category();
$rolerecord = $DB->get_record('role', ['shortname' => 'manager']);
$categorycontext = context_coursecat::instance($category->id);
$categorycontext = \context_coursecat::instance($category->id);
$this->getDataGenerator()->role_assign($rolerecord->id, $user3->id, $categorycontext->id);
$this->getDataGenerator()->role_assign($rolerecord->id, $user5->id, $categorycontext->id);
$roleid = $this->getDataGenerator()->create_role();
$sitecontext = context_system::instance();
$sitecontext = \context_system::instance();
assign_capability('moodle/restore:uploadfile', CAP_ALLOW, $roleid, $sitecontext->id, true);
accesslib_clear_all_caches_for_unit_testing();
$this->getDataGenerator()->role_assign($roleid, $user4->id, $sitecontext->id);
@@ -81,4 +75,4 @@ class tool_moodlenet_import_backup_helper_testcase extends advanced_testcase {
$this->assertEquals(CONTEXT_COURSECAT, $result->contextlevel);
}
}
}
@@ -14,24 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the import_handler_info class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_moodlenet\local\tests;
namespace tool_moodlenet\local;
use tool_moodlenet\local\import_handler_info;
use tool_moodlenet\local\import_strategy;
use tool_moodlenet\local\import_strategy_file;
defined('MOODLE_INTERNAL') || die();
/**
* Class tool_moodlenet_import_handler_info_testcase, providing test cases for the import_handler_info class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_handler_info_test extends \advanced_testcase {
@@ -14,15 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the import_handler_registry class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_moodlenet\local\tests;
namespace tool_moodlenet\local;
use tool_moodlenet\local\import_handler_registry;
use tool_moodlenet\local\import_handler_info;
@@ -31,10 +23,13 @@ use tool_moodlenet\local\import_strategy_link;
use tool_moodlenet\local\remote_resource;
use tool_moodlenet\local\url;
defined('MOODLE_INTERNAL') || die();
/**
* Class tool_moodlenet_import_handler_registry_testcase, providing test cases for the import_handler_registry class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_handler_registry_test extends \advanced_testcase {
@@ -14,24 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the import_info class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_moodlenet\local\tests;
namespace tool_moodlenet\local;
use tool_moodlenet\local\import_info;
use tool_moodlenet\local\remote_resource;
use tool_moodlenet\local\url;
defined('MOODLE_INTERNAL') || die();
/**
* Class tool_moodlenet_import_info_testcase, providing test cases for the import_info class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_info_test extends \advanced_testcase {
@@ -14,15 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Unit tests for the import_processor class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_moodlenet\local\tests;
namespace tool_moodlenet\local;
use tool_moodlenet\local\import_handler_registry;
use tool_moodlenet\local\import_processor;
@@ -31,10 +23,13 @@ use tool_moodlenet\local\import_strategy_link;
use tool_moodlenet\local\remote_resource;
use tool_moodlenet\local\url;
defined('MOODLE_INTERNAL') || die();
/**
* Class tool_moodlenet_import_processor_testcase, providing test cases for the import_processor class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class import_processor_test extends \advanced_testcase {
@@ -14,24 +14,19 @@
// 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_moodlenet\local;
use tool_moodlenet\local\remote_resource;
use tool_moodlenet\local\url;
/**
* Unit tests for the remote_resource class.
* Class tool_moodlenet_remote_resource_testcase, providing test cases for the remote_resource class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_moodlenet\local\tests;
use tool_moodlenet\local\remote_resource;
use tool_moodlenet\local\url;
defined('MOODLE_INTERNAL') || die();
/**
* Class tool_moodlenet_remote_resource_testcase, providing test cases for the remote_resource class.
*/
class remote_resource_test extends \advanced_testcase {
/**
@@ -14,23 +14,18 @@
// 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_moodlenet\local;
use tool_moodlenet\local\url;
/**
* Unit tests for the url class.
* Class tool_moodlenet_url_testcase, providing test cases for the url class.
*
* @package tool_moodlenet
* @category test
* @copyright 2020 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_moodlenet\local\tests;
use tool_moodlenet\local\url;
defined('MOODLE_INTERNAL') || die();
/**
* Class tool_moodlenet_url_testcase, providing test cases for the url class.
*/
class url_test extends \advanced_testcase {
/**
@@ -14,6 +14,8 @@
// 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_moodlenet;
/**
* Unit tests for the profile manager
*
@@ -22,15 +24,7 @@
* @copyright 2020 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
/**
* Class profile_manager tests
*/
class tool_moodlenet_profile_manager_testcase extends advanced_testcase {
class profile_manager_test extends \advanced_testcase {
/**
* Test that on this site we use the user table to hold moodle net profile information.
@@ -57,7 +51,7 @@ class tool_moodlenet_profile_manager_testcase extends advanced_testcase {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
$this->expectException(moodle_exception::class);
$this->expectException(\moodle_exception::class);
$this->expectExceptionMessage(get_string('invalidmoodlenetprofile', 'tool_moodlenet'));
$result = new \tool_moodlenet\moodlenet_user_profile("", $user->id);
}
+1 -1
View File
@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'tool_moodlenet';
$plugin->version = 2021051700;
$plugin->version = 2021051701;
$plugin->requires = 2021051100;
$plugin->maturity = MATURITY_ALPHA;

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