Compare commits

...

2365 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) e1ad263f90 Moodle release 3.11.4 2021-11-06 10:34:18 +01:00
Ilya Tregubov 107dc9be23 weekly release 3.11.3+ 2021-11-05 19:18:33 +02:00
Ilya Tregubov 59f7f1c961 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-11-05 19:18:30 +02:00
Huong Nguyen 7293a38647 MDL-71918 Calendar: Improve capability checks when fetching events 2021-11-05 13:15:41 +08:00
Jun Pataleta 91a51bbf24 Merge branch 'MDL-72667-311-fix' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2021-11-05 12:44:47 +08:00
Simey Lameze 05f4ac39fa MDL-72667 assign: change overdue message to darker red 2021-11-05 12:42:11 +08:00
Jun Pataleta fa9632cb54 Merge branch 'MDL-72679-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-11-05 12:40:55 +08:00
Andrew Nicols d905332e97 Merge branch 'MDL-72990-311' of https://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-11-05 11:58:29 +08:00
Andrew Nicols ceba19a45c Merge branch 'MDL-71439_311' of https://github.com/mdjnelson/moodle into MOODLE_311_STABLE 2021-11-05 11:32:59 +08:00
Jun Pataleta 3dcfe5a4c0 Merge branch 'MDL-72688-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-11-05 11:23:43 +08:00
Víctor Déniz ddc368559d Merge branch 'MDL-72945-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-11-05 01:47:46 +00:00
Shamim Rezaie a7889e19ee MDL-72688 contentbank: Some accessibility improvements described below
- Label the table/list with aria-label
- Hide sort buttons from screen-readers and use aria-sort instead
- Remove the redundant title from decorative thumbnails
2021-11-05 12:46:05 +11:00
Shamim Rezaie eaaf4e9486 MDL-72688 contentbank: Add and maintain appropriate aria roles
Also moved header text into the sorting button as per the example at
https://dequeuniversity.com/library/aria/table-sortable
2021-11-05 12:46:05 +11:00
Víctor Déniz adc358399e Merge branch 'MDL-72969-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-11-05 01:19:37 +00:00
AMOS bot 55a21bfe31 Automatically generated installer lang files 2021-11-05 00:07:25 +00:00
Jun Pataleta 1cdea1f1ea Merge branch 'MDL-72667-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2021-11-04 22:05:57 +08:00
Simey Lameze 7909173f5d MDL-72667 message: fix contrast issue in the drawer 2021-11-04 21:14:21 +08:00
Simey Lameze bf711cc097 MDL-72667 notifications: improve colour contrast 2021-11-04 21:06:01 +08:00
Simey Lameze 162751f709 MDL-72667 lesson: improve colour contrast of correct text 2021-11-04 21:04:44 +08:00
Simey Lameze 93dc1eb447 MDL-72667 assign: improve contrast of not graded text 2021-11-04 21:04:44 +08:00
Jun Pataleta e2e6731171 Merge branch 'MDL-72672-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-11-04 18:23:00 +08:00
Simey Lameze 8c59e41bfa MDL-72672 lesson: make edit collapsed table responsive 2021-11-04 18:20:35 +08:00
Simey Lameze b1f87d5ef0 MDL-72672 lesson: make detailed stats table responsive 2021-11-04 18:20:35 +08:00
Simey Lameze b874c56751 MDL-72672 lesson: make attempts table responsive 2021-11-04 18:20:34 +08:00
Simey Lameze 4c4abafedc MDL-72672 lesson: add label for true/false checkboxes 2021-11-04 18:20:33 +08:00
Simey Lameze 36e2b9cd95 MDL-72672 lesson: add label for multichoice checkboxes 2021-11-04 18:20:32 +08:00
Simey Lameze 214c3994df MDL-72672 lesson: remove unnecessary nowrap
This commit also remove some deprecated table properties as well.
2021-11-04 18:20:31 +08:00
Simey Lameze 7e69d60652 MDL-72672 mod_lesson: add aria-label to actions select element 2021-11-04 18:20:30 +08:00
Sara Arjona cbc7cdb686 Merge branch 'MDL-72949-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-11-04 10:33:29 +01:00
Nathan Nguyen 41868f952b MDL-72679 qtype_ddmarker: Fix incorrect positions in multiple viewportss
Co-authored-by: Huong Nguyen <huongnv13@gmail.com>
2021-11-04 14:42:50 +07:00
Jun Pataleta 70bb50e3b7 Merge branch 'MDL-72668-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-11-04 12:04:01 +08:00
Shamim Rezaie c6f3ea3932 MDL-72990 badges: Use imagecaption as alternative text for badge image 2021-11-04 15:03:32 +11:00
Shamim Rezaie d0d82e9f34 MDL-72668 block_badges: Add alt attribute to badge images 2021-11-04 14:17:36 +11:00
Shamim Rezaie ced90c8a18 MDL-72668 core: Highlight the focused tree item in a tree. 2021-11-04 14:17:35 +11:00
Shamim Rezaie 6e5c04f6c5 MDL-72668 block_private_files: Switched from YUI to core/tree AMD 2021-11-04 14:17:33 +11:00
Víctor Déniz 99c7eacdeb Merge branch 'MDL-72895-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-11-04 01:47:38 +00:00
Paul Holden 7012c95569 MDL-70823 qtype_ddwtos: new method for safer feedback unserializing. 2021-11-03 16:57:15 +01:00
Paul Holden cdc80e6bfd MDL-70823 mod: safely parse module display options array. 2021-11-03 16:57:15 +01:00
Paul Holden 294fa223c9 MDL-70823 blocks: safer unserializing during block restore. 2021-11-03 16:57:15 +01:00
Paul Holden f8fed9810a MDL-70823 core: safer alternative for unserializing objects. 2021-11-03 16:57:14 +01:00
sangnguyena d01f8ac051 MDL-72949 WS: Return coursegraceperiod setting in tool_mobile_get_config 2021-11-03 16:12:13 +07:00
Ilya Tregubov 0316f650ed Merge branch 'MOODLE_311_MDL-72953' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-11-03 10:34:47 +02:00
Andrew Nicols e504d7159c MDL-72894 courseexport: Whitespace fix 2021-11-03 16:11:27 +08:00
Andrew Nicols 98a784483a Merge branch 'MDL-72894-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-11-03 16:11:23 +08:00
Sara Arjona 72a7266a87 Merge branch 'MDL-72977-311' of https://github.com/juancs/moodle into MOODLE_311_STABLE 2021-11-03 09:04:00 +01:00
Ilya Tregubov 3cb24afce3 Merge branch 'MDL-71872-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-11-03 09:27:24 +02:00
Jun Pataleta 7bf69ea780 Merge branch 'MDL-72687-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-11-03 11:57:17 +08:00
Mikhail Golenkov 7552335ccf MDL-72953 core_lang: Add string for new timezone Pacific/Kanton 2021-11-03 11:43:14 +11:00
AMOS bot af5e30b2b2 Automatically generated installer lang files 2021-11-03 00:07:26 +00:00
Paul Holden 1cdacd7771 MDL-72370 badges: require sesskey to remove related badge. 2021-11-02 18:04:15 +01:00
Ilya Tregubov fa363b52eb MDL-70887 mlbackend_python: Update to latest version. 2021-11-02 18:04:15 +01:00
Simey Lameze 2a22a20251 MDL-72571 tool_filetypes: change extension param to PARAM_ALPHANUMEXT 2021-11-02 18:04:15 +01:00
Sara Arjona 5ce9c733ce Merge branch 'MDL-72857-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-11-02 18:01:06 +01:00
Eloy Lafuente (stronk7) 8ecf433c53 weekly release 3.11.3+ 2021-11-02 14:07:54 +01:00
Eloy Lafuente (stronk7) a4aefa9c98 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-11-02 14:07:49 +01:00
Juan Segarra Montesinos 40124ef728 MDL-72977 qtype_essay: Honor Information for graders text format. 2021-11-02 12:21:38 +01:00
Simey Lameze 66cf7b94db MDL-72687 assign: move labels for toggle zoom icons to the <a> 2021-11-02 13:55:25 +08:00
Simey Lameze 04e8993910 MDL-72687 assign: move labels for collapse buttons to the button 2021-11-02 13:55:25 +08:00
Simey Lameze 96ea7a04ed MDL-72687 assign: remove title attr from view all submissions link 2021-11-02 13:55:25 +08:00
Simey Lameze 7137b20762 MDL-72687 assign: move label from the edit settings icon to <a> 2021-11-02 13:55:25 +08:00
Simey Lameze 6cb38c56fa MDL-72687 assign: remove presentation role from profile image 2021-11-02 13:55:25 +08:00
Simey Lameze f619fb8df4 MDL-72687 assign: fix email and due date cut off whem zooming 2021-11-02 13:55:25 +08:00
Simey Lameze 994952712c MDL-72687 assign: fix colour picker broken aria menu 2021-11-02 13:55:25 +08:00
Simey Lameze 77a84ad325 MDL-72687 assign: fix stamp picker broken aria menu 2021-11-02 13:55:25 +08:00
Simey Lameze ea35916f09 MDL-72687 assign: fix change filter element tab navigation 2021-11-02 13:55:24 +08:00
Simey Lameze 380b565487 MDL-72687 assign: use correct aria role for toolbar 2021-11-02 13:55:24 +08:00
Simey Lameze fe7b49250d MDL-72687 assign: add missing label to change user element 2021-11-02 13:55:24 +08:00
Simey Lameze e0077b7175 MDL-72687 assign: display a more friendly link when not graded 2021-11-02 13:55:24 +08:00
Simey Lameze 210c80e48e MDL-72687 assign: add missing aria-label to prev/next arrows 2021-11-02 13:55:24 +08:00
Simey Lameze 6f1773b841 MDL-72687 form: only add legend tag if a label is set 2021-11-02 13:55:24 +08:00
Andrew Nicols eb6a7272f9 Merge branch 'MDL-72884-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-11-02 11:34:07 +08:00
Andrew Nicols 63f865a594 Merge branch 'MDL-72767-m311' of https://github.com/NeillM/moodle into MOODLE_311_STABLE 2021-11-02 11:28:43 +08:00
AMOS bot 1808fd1d22 Automatically generated installer lang files 2021-11-02 00:07:26 +00:00
Paul Holden 78f2c07d30 MDL-72969 output: correct ansi colour format codes for check results. 2021-11-01 17:12:05 +00:00
Huong Nguyen 521591639c MDL-71872 Questions: The placeholder disappears when double-clicking 2021-11-01 17:30:23 +07:00
Paul Holden 40451d3a90 MDL-72857 badges: filter site/course name when showing issued badge. 2021-11-01 10:20:52 +00:00
Neill Magill 137a1ef570 MDL-72767 forum: Stop duplicate digests being created
This change is to stop there being a possibility of 2 digests tasks
being created for a user on the day that MDL-72767 is applied.
2021-11-01 08:50:29 +00:00
Neill Magill 29f8071c3b MDL-72767 forum: Ensure digests are sent
Before this change if a new post was made after the digest time but
before todays daily digest had been sent the run time on the digest
would be set to the next day resulting in no digest being sent to
the user.

By adding the server midnight to the custom data on the task we
ensure that in this case a new adhoc task is created for the next
day leaving the current one to get processed.

Server midnight is used so that if the digest time setting is
changed we would not get two tasks queued for the same day.
2021-11-01 08:50:28 +00:00
Neill Magill 23f8a8b2d5 MDL-72767 forum: Fix PHPDoc 2021-11-01 08:50:28 +00:00
Andrew Nicols fcbb050b48 Merge branch 'MDL-72921_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-11-01 08:55:32 +08:00
AMOS bot 3dd0115779 Automatically generated installer lang files 2021-10-30 00:07:25 +00:00
Eloy Lafuente (stronk7) b97643453d MDL-72921 generators: exported users now match the plan size definition
Before this patch the exported users (to csv file that jmeter consumes)
were all the enrolled users in the test course. And that's ok when the
number of users enrolled match the number of concurrent threads planned
for a jmeter plan (each thread is a user).

But when both numbers don't match, that can lead to the jmeter plan
not behaving as expected, because it iterates over the excessive users
in the file, leading to some users having run 5 loops, others 4...

The only way to make results more consistent is to, always, ensure that
the number of users exported for the plan match the plan size and not
the site size.

And that's what this issue exactly does, restrict the export to the
number of threads that the plan will have. So every user always runs
the very same number of loops.
2021-10-29 18:03:44 +02:00
Eloy Lafuente (stronk7) ee1c3d9837 weekly release 3.11.3+ 2021-10-29 17:10:11 +02:00
Eloy Lafuente (stronk7) f8c673b03c Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-10-29 17:10:07 +02:00
Eloy Lafuente (stronk7) acf393873e MDL-72743 phpunit: Skip test until MDL-72950 is fixed
It's good to keep the test because it's not easy to
reproduce the issue to be fixed. Part of the fix will
be to remove this skip.
2021-10-29 13:59:38 +02:00
Huong Nguyen 3cef1996eb MDL-72895 Assignment: Fix colour contrast for grading navigation 2021-10-29 18:53:13 +08:00
Shamim Rezaie 3c1f14fb22 Merge branch 'MDL-72874-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-10-29 03:34:47 +11:00
Shamim Rezaie 82e055104c Merge branch 'MDL-72924-fix-component-initialisation-for-performance-checks-MOODLE_311_STABLE' of https://github.com/keevan/moodle into MOODLE_311_STABLE 2021-10-29 02:57:01 +11:00
Sara Arjona 3fa45f00c6 MDL-72945 badges: use default issuer contact
The defaultissuercontact was ignored if the sitebackpack email was set
to empty string..
2021-10-28 17:47:20 +02:00
Víctor Déniz fab5e031f9 Merge branch 'MDL-72912_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-10-28 15:45:28 +01:00
Víctor Déniz 9afd3da2b3 Merge branch 'MDL-72901_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-10-28 13:49:10 +01:00
Ilya Tregubov fb800de092 Merge branch 'MDL-72670-311' of git://github.com/cameron1729/moodle into MOODLE_311_STABLE 2021-10-28 13:14:53 +02:00
Eloy Lafuente (stronk7) 0a8666b01a MDL-72743 tests: tidy up the new test with NS/name/covers
Ideally any new test should be using a class name matching
the file name, and to use namespace when clearly belonging to
a component (sub-namespace also allowed for better accuracy).

And, also, adding a @covers label to indicate which class
(preferred, method is also possible) is being covered with the test.
2021-10-28 13:11:37 +02:00
Eloy Lafuente (stronk7) 48c3f683a6 Merge branch 'MDL-72743-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-10-28 13:11:27 +02:00
Andrew Nicols 256242cfd7 Merge branch 'MDL-72871_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-10-28 14:16:10 +08:00
Jun Pataleta 8850a21f66 Merge branch 'MDL-72316-311-2' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-10-28 13:50:27 +08:00
Michael Hawkins 0f6ab8bf12 MDL-72316 filelib: Add ability for modules to directly load SVG images
This also implements the functionality for SCORM packages, which may
have SVG images embedded within their content which require loading
directly (and are only created by users with appropriate risk flag).
2021-10-28 12:58:41 +08:00
Kevin Pham c21d587016 MDL-72924 check: Fix component initialisation for performance checks 2021-10-28 14:25:48 +11:00
Eloy Lafuente (stronk7) 7165c2ac74 Merge branch 'MDL-72879-311-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-10-27 22:12:24 +02:00
Jun Pataleta 0421a9aba5 Merge branch 'MDL-72669-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-10-27 15:07:38 +08:00
Mark Nelson 53a4d06a8d MDL-71439 core_grades: return a blank mustache template for letters 2021-10-27 12:20:21 +08:00
Mark Nelson 6070bbb37b MDL-71439 mod_forum: display user grade from web service 2021-10-27 12:20:21 +08:00
Mark Nelson f13e3235c4 MDL-71439 core_grades: return result of new method in web services 2021-10-27 12:20:21 +08:00
Mark Nelson 20b3b4c38d MDL-71439 core_grades: add new method 'get_formatted_grade_for_user' 2021-10-27 12:20:21 +08:00
Mark Nelson 641b5a27ab MDL-71439 core_grades: fixed undefined class issues 2021-10-27 12:20:21 +08:00
Mark Nelson ea996d378b MDL-71439 core_grades: remove returning null when not possible
The method explicitly declares 'stdClass' as the return type.
2021-10-27 12:20:21 +08:00
AMOS bot f4f8118ad6 Automatically generated installer lang files 2021-10-27 00:07:26 +00:00
Eloy Lafuente (stronk7) dd89bfab41 MDL-72871 cleanup: Remove incorrect whitespace from codebase
Differences can be checked with git diff --ignore-all-space and
that will show that the only non-whitespace change is in a test
in the git lib/tests/html2text_test.php file. In that case the
whitespace has been replaced by a quoted string (of whitespaces)
keeping the test 100% equivalent and workarrounding the whitespace.
2021-10-26 17:19:17 +02:00
Víctor Déniz b8e5f7b428 weekly release 3.11.3+ 2021-10-26 13:44:06 +01:00
Víctor Déniz bb033deac1 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-10-26 13:44:00 +01:00
Tim Hunt 90d04a010b MDL-72912 questions: fix type of question_display_options::$context 2021-10-26 08:06:19 +01:00
Helen Foster 6509786f2b MDL-72879 lang: Import fixed English strings (en_fix) 2021-10-25 20:57:04 +02:00
Paul Holden 2a6554678e MDL-72894 course: format name and summary data for download.
The names and summaries of course elements (i.e. the course
itself, plus sections and modules) included when downloading
it's content are now passed through appropriate methods to
format their values.
2021-10-25 08:08:01 +01:00
Andrew Nicols 8bd492084d Merge branch 'MDL-71750-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-10-25 13:58:27 +08:00
AMOS bot ba376027e8 Automatically generated installer lang files 2021-10-24 00:07:27 +00:00
Tim Hunt f89a6106fa MDL-72901 question: add missing {$a} in string attemptfinishedsubmitting 2021-10-22 23:15:58 +01:00
Ilya Tregubov fa492071fe weekly release 3.11.3+ 2021-10-22 12:49:04 +02:00
Shamim Rezaie 6215cbba29 MDL-72669 qtype_multianswer: Replace empty option with NBSP 2021-10-22 16:02:19 +11:00
Víctor Déniz 9b67243b6b Merge branch 'MDL-72607-MOODLE-311-STABLE_fix_media_vimeo_url_parser' of https://github.com/praxisdigital/moodle into MOODLE_311_STABLE 2021-10-22 00:02:32 +01:00
Paul Holden 544ee202ca MDL-72884 atto_image: improve svg support in editor dialogue.
Where the dimensions of an image are not present, we should use
sensible defaults so that the dialogue is still usable.
2021-10-21 23:58:32 +01:00
Paul Holden fe3441d95f MDL-72743 mod_quiz: verify user mapping prior to restoring attempts. 2021-10-21 08:26:41 +01:00
Eloy Lafuente (stronk7) d524f2eadc Merge branch 'MDL-72013-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-10-21 09:23:04 +02:00
Andrew Nicols 8159824033 Merge branch 'MDL-72507-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-10-21 12:57:36 +08:00
Andrew Nicols babe07eec3 MDL-72874 behat: Allow behat window sizes to be modified during run
In some situations it is useful to modify the requested screensize by a
modifier. This allows for failing tests to be rerun at a different
screensize, where the original screensize triggered a failure for some
size-related reason.
2021-10-21 10:26:01 +08:00
Andrew Nicols e88926fb4f MDL-72013 js: Configure eslint-jsdoc plugin
This change adds configuration for the eslint-jsdoc plugin in order to
detect the following errors with jsdoc blocks:
* missing params
* params in incorrect order
* params with no type defined
* properties incorrectly defined
* incorrect use of @package
* incorrect values for @access

In addition, warnings will be thrown where indentation is incorrect.
2021-10-21 08:52:57 +08:00
Andrew Nicols 0d6e90470b MDL-72013 js: Add eslint-jsdoc plugin 2021-10-21 08:52:57 +08:00
Andrew Nicols a5c1b7924d MDL-72013 js: Fix jsdocs to meet stricter eslint 2021-10-21 08:52:57 +08:00
Ilya Tregubov be58e75573 Merge branch 'MDL-72639-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-10-20 13:01:01 +02:00
Eloy Lafuente (stronk7) ff37cc27be Merge branch 'MDL-72849-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-10-19 22:17:15 +02:00
sam marshall b449a10a09 MDL-72849 tool_behat: Use of xpath name() not compatible with Firefox
The xpath name() function returns upper-case e.g. 'IMG' in Firefox and
lower-case e.g. 'img' in Chrome.
2021-10-19 13:49:52 +01:00
Ilya Tregubov 68cd3002ce Merge branch 'MDL-71270-311' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-10-19 14:45:30 +02:00
Eloy Lafuente (stronk7) 261bc97b3e weekly release 3.11.3+ 2021-10-19 12:51:49 +02:00
Eloy Lafuente (stronk7) 4ef90e61e9 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-10-19 12:51:44 +02:00
Andrew Nicols b71cc1f99d MDL-71785 mod_quiz: Correct string as per reviewer feedback 2021-10-19 11:20:26 +08:00
Andrew Nicols 932c5faef9 Merge branch 'MDL-71785_311' of https://github.com/StudiUM/moodle into MOODLE_311_STABLE 2021-10-19 11:20:24 +08:00
Sara Arjona 49285bf337 Merge branch 'MDL-72590-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-10-18 17:38:38 +02:00
Luca Bösch e8f4b6ff60 MDL-72590 enrol: Course in success message after unenroll passes filter 2021-10-18 16:38:02 +02:00
Sara Arjona 8639d45416 Merge branch 'MDL-72064-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-10-18 12:59:44 +02:00
Michael Hawkins 800d0e7ad4 MDL-71270 core: Updated security.txt expiry 2021-10-18 17:14:07 +08:00
Sam Møller 81c0b420c6 MDL-72607 media_vimeo: Fix vimeo URL parser
Fix vimeo URL parser to support the new vimeo URL format with privacy
settings (the video with password or domain restricted setting).
For example "https://vimeo.com/123456789/2bffff0000" the plugin must
parse the URL "https://player.vimeo.com/video/123456789?h=2bffff0000"
to the iframe source to make it compatible with the new vimeo URL
format.
See more about vimeo video privacy settings at
https://vimeo.com/blog/post/video-privacy-explained/
2021-10-18 08:52:38 +02:00
Andrew Nicols 5d54d89044 Merge branch 'MDL-65943-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-10-18 14:04:41 +08:00
Huong Nguyen ed3f7bb078 MDL-65943 media_videojs: add videojs-ogvjs plugin
VideoJS now support to play Ogg Vorbis/Opus/Theora and WebM VP8/VP9/AV1 video on:
 - Safari on Mac OS
 - Safari on iPhone OS
 - Safari on iPad OS
2021-10-18 11:39:59 +07:00
AMOS bot b881fff43f Automatically generated installer lang files 2021-10-16 00:07:33 +00:00
Shamim Rezaie ea0487cdef weekly release 3.11.3+ 2021-10-16 00:29:22 +11:00
Shamim Rezaie 44749626b0 Merge branch 'MDL-71344-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-10-15 14:24:56 +11:00
Jun Pataleta 9b83cae1b5 Merge branch 'MDL-72623_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-10-15 09:47:21 +08:00
Jun Pataleta cc4e898144 Merge branch 'MDL-72807_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-10-15 09:08:21 +08:00
Eloy Lafuente (stronk7) 1114a3755a Merge branch 'MDL-26633-311-workshopnumofreviews' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-10-14 22:40:52 +02:00
Eloy Lafuente (stronk7) 95694f0965 Merge branch 'MDL-68325-311' of git://github.com/odeialba/moodle into MOODLE_311_STABLE 2021-10-14 22:19:31 +02:00
Eloy Lafuente (stronk7) 5912b69773 Merge branch 'MDL-72464-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-10-14 22:02:15 +02:00
Eloy Lafuente (stronk7) de1f45f535 MDL-72807 behat: Add a few more @skip_chrome_zerosize tags
This is the 3rd round adding the tags to some scenarios
detected to be failing with zerosize problems lately.

Note that @ MDL-71108, the final solution will happen, say
switching to own webdriver till the upstream one is fixed
or whatever. Our @skip_chrome_zerosize solution is just a
workaround to have all those scenarios detected and ignored
by normal runs.
2021-10-14 16:16:52 +02:00
Eloy Lafuente (stronk7) 4c3a318ffa MDL-72623 nodejs: Bump from v14.15.0 to v14.18.0
Without modifying any installed package or dependency
because, after trying to do so, the updated stuff is huge
and leads to some JS validation / minimisation problems.
2021-10-13 09:49:53 +02:00
Andrew Nicols 65ad94b87c weekly release 3.11.3+ 2021-10-13 09:40:48 +08:00
Andrew Nicols 74a41120d6 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-10-13 09:40:45 +08:00
AMOS bot 35ea0a22e3 Automatically generated installer lang files 2021-10-13 00:07:24 +00:00
Víctor Déniz 318637c781 Merge branch 'MDL-72498-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-10-12 15:34:11 +08:00
Huong Nguyen 06858a584a MDL-71344 questions: Improve event handler for Drag n Drop family 2021-10-11 11:05:14 +07:00
Andrew Nicols 6f4d296da2 Merge branch 'MDL-66203-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-10-11 08:36:54 +08:00
Paul Holden b413ff4684 MDL-72639 admin: consistent primary buttons during site upgrade. 2021-10-10 20:43:18 +01:00
Paul Holden 72b8b2e858 MDL-72498 report_eventlist: use core component API for event list.
The previous method of hardcoded filepaths, specifically for events
belonging to core, meant that any events belongs to core subsystems
were omitted (core_customfield, core_h5p, core_payment, etc).
2021-10-10 20:41:43 +01:00
Paul Holden c250f825ed MDL-72464 webservice: fix detection of non-expiring external tokens. 2021-10-10 20:40:38 +01:00
David Mudrák a2a309f9a0 MDL-26633 workshop: Allow to randomly allocate more than 30 reviews
For classes with many students, there may be valid cases for having more
than 30 reviews per submission / reviewer.

The patch changes the type of the input field so that it can freely
editable to any integer value.
2021-10-08 17:10:36 +02:00
Sara Arjona 0850628c6c weekly release 3.11.3+ 2021-10-08 12:43:20 +02:00
Sara Arjona 2082bc6a89 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-10-08 12:43:16 +02:00
Cameron Ball 2de9208ce8 MDL-72670 session: Correct read only debugging logic
Prior to this patch the debugging mode (when enabled) would trigger
on everywhere, regardless of whether or not READ_ONLY_SESSION is defined.

This patch modifies that behaviour so that the debugging only kicks in
if READ_ONLY_SESSION is defined and set to true.
2021-10-08 15:12:03 +08:00
AMOS bot 31f3479fbf Automatically generated installer lang files 2021-10-08 00:07:26 +00:00
Víctor Déniz 221ed2ac87 Merge branch 'MOODLE_311_MDL-64576' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-10-07 22:29:50 +01:00
Eloy Lafuente (stronk7) 2266158778 Merge branch 'MDL-71306-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-10-07 23:10:08 +02:00
Eloy Lafuente (stronk7) e0c0c1dd17 Merge branch 'MDL-72674-311' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-10-07 22:54:00 +02:00
Eloy Lafuente (stronk7) bc7c322c62 Merge branch 'MDL-72309-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-10-07 22:42:57 +02:00
Eloy Lafuente (stronk7) c44a461146 Merge branch 'MDL-72635-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-10-07 22:39:04 +02:00
Eloy Lafuente (stronk7) 9a6b0b8c31 Merge branch 'MDL-72621-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-10-07 21:10:05 +02:00
AMOS bot e0fd61d727 Automatically generated installer lang files 2021-10-07 00:07:24 +00:00
Jun Pataleta 802259a6c8 Merge branch 'MDL-72339-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-10-06 22:44:31 +08:00
sam marshall 4ae6235d64 MDL-72339 core_availability: Unsafe to use format_string in description
The availability condition get_description method is called while
gathering data for the modinfo object. As such it is not safe to
call other functions which might rely on modinfo, such as format_string
(if using filters which access modinfo).

This change provides a mechanism to call format_string later, and also
a general callback to do other stuff later as well if needed. It uses
the same approach already taken to make activity names work correctly
in the availability_condition class.
2021-10-06 11:26:28 +01:00
Andrew Nicols 13d8eb3321 Merge branch 'MDL-72515-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-10-06 12:58:39 +08:00
Ilya Tregubov 3fe1755d5d Merge branch 'MDL-72452-resource-filter-311' of https://github.com/Peterburnett/moodle into MOODLE_311_STABLE 2021-10-06 10:55:01 +07:00
Andrew Nicols ab7d7d4d57 Merge branch 'MDL-72599-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-10-06 09:12:42 +08:00
Eloy Lafuente (stronk7) d2c4d59f81 weekly release 3.11.3+ 2021-10-06 00:24:51 +02:00
Ilya Tregubov 26bcfa6122 Merge branch 'MDL-56773-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-10-05 23:26:59 +02:00
Jun Pataleta 1c8e09b4aa Merge branch 'MDL-39324-moodle311' of https://github.com/kiratskitizing/moodle into MOODLE_311_STABLE 2021-10-05 23:26:59 +02:00
Ilya Tregubov 2980b46bf8 Merge branch 'MDL-72395_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-10-05 23:26:59 +02:00
Simey Lameze 1bb79a6cb3 MDL-72635 calendar: fix typo in data attribute 2021-10-05 06:30:43 +08:00
Paul Holden f91d23a739 MDL-71306 cohort: ignore empty values in form autocomplete element. 2021-10-04 21:14:17 +01:00
Joshua Ebarvia 2ac4573661 MDL-39324 mod_url: Fix icon when URL has params 2021-10-04 20:04:00 +10:30
Marina Glancy c9ff42d096 MDL-72515 admin: do not call curl unnecessary on plugins page 2021-10-04 10:01:12 +02:00
Paul Holden 30830852bf MDL-72309 course: make category a required field in forms.
Course category fields were changed en masse from simple select
elements to autocompletes in 93d72205, but weren't defined as
required fields. This could lead to exceptions and/or unexpected
behaviour if their values were cleared prior to form submission.
2021-10-04 08:11:40 +01:00
Mikhail Golenkov 3550f90dad MDL-64576 completion: Fix criteria and course completion dates 2021-10-04 10:52:31 +11:00
Shamim Rezaie 99af155ddd MDL-66203 mod_assign: Reset submission status when removing a submission 2021-10-04 02:12:43 +11:00
Eloy Lafuente (stronk7) 2a0e7b1d8c MDL-72395 composer: Update to newer dependencies
More notably PHPUnit to 9.5.9 that comes with some good fixes
and better support for go prospecting php81 (beta) status.

Generated with php73, that is the lower version supported
by this branch, following the instructions @ https://docs.moodle.org/dev/Composer
2021-10-02 22:46:11 +02:00
Eloy Lafuente (stronk7) d5e66b50b3 weekly release 3.11.3+ 2021-10-02 22:05:12 +02:00
Eloy Lafuente (stronk7) 55aa35d9fe Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-10-02 22:05:08 +02:00
Eloy Lafuente (stronk7) 59e08ceb6d Merge branch 'MDL-72714_311' of git://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-10-02 15:29:28 +02:00
Eloy Lafuente (stronk7) f3a6d622a2 MDL-72714 behat: Add new @skip_chrome_zerosize labels
With the move from Chrome 93 to 94 a few new "zerosize" cases
have appeared, this just protect us from them, so they
are run apart.
2021-10-02 12:17:51 +02:00
Eloy Lafuente (stronk7) 2704764d80 MDL-72714 behat: fix problem with button on the edge and failing
Surprise came with Chrome 94, so applying the usual trick by
changing window size. Hopefully some day we'll be able to
revert all them (Chrome 123).
2021-10-02 12:17:51 +02:00
Víctor Déniz 61e68a15a1 MDL-72714 behat: Fix Behat failures for chrome 94. 2021-10-01 11:56:47 +01:00
abgreeve 5f26d8c331 Merge branch 'MDL-69682-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-10-01 11:24:46 +08:00
Jun Pataleta 7c814fa48f MDL-72674 core: Add indicator that feedback link opens in new window
* New pix icon i/externallink
* New lang string opensinnewwindow
* Use the external link pix icon with "Opens in new window" lang string
 as its alt text and add it to the "Give feedback about this software"
 link.
* Update cta template to indicate whether the link opens in new window.
2021-10-01 10:39:22 +08:00
Andrew Nicols f603c2c38e Merge branch 'MDL-72673-311' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-10-01 10:23:44 +08:00
Eloy Lafuente (stronk7) 207174aa0a Merge branch 'MDL-72484-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-09-30 23:19:15 +02:00
Víctor Déniz ced66d9d66 Merge branch 'MDL-72496-311_assert_tag' of https://github.com/call-learning/moodle into MOODLE_311_STABLE 2021-09-30 15:41:09 +01:00
Laurent David d0958a89f9 MDL-72496 question tests: fix assertTag if tag not found
* The basic_test::assertTag method will issue a warning as $tag is not
found, failing the PHP Unit test that uses this method.
* Add tests to check that assertTag is working
2021-09-30 13:14:34 +02:00
Thong Bui 392e57b6a0 MDL-72507 Quiz: Quiz auto-save does not detect uploaded files 2021-09-30 12:17:40 +07:00
abgreeve 250524cf5b Merge branch 'MDL-72275-311-2' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-09-30 10:03:27 +08:00
AMOS bot dbdc0e44d1 Automatically generated installer lang files 2021-09-30 00:07:25 +00:00
Eloy Lafuente (stronk7) 954bc8e887 Merge branch 'MDL-71970-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-09-29 23:27:25 +02:00
Andrew Nicols 0e0984010b MDL-72621 admin: Add environment check for admin deprecation 2021-09-29 22:39:32 +08:00
Shamim Rezaie ddff536561 Merge branch 'MDL-72060-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-09-28 20:17:12 +10:00
Adrian Perez f0bf659715 MDL-72060 mod_lti: fix comparison if user is gradable 2021-09-28 17:25:27 +08:00
AMOS bot 955ea66652 Automatically generated installer lang files 2021-09-28 00:07:32 +00:00
Paul Holden d8a1fab050 MDL-72484 report_eventlist: looser check for event 'other' docs. 2021-09-27 18:21:34 +01:00
Sara Arjona 8e1463334c MDL-71970 h5plib_v124: Replace references to new Moodle\H5Pxxx namespace
The joubel/core and joubel/editor libraries have been moved to Moodle
namespace.
This commit adds the new namespace to the places where these classes
are used.
Besides, a couple of minor changes have been done to replace the _test.php
classname and remove some unnecessary defined('MOODLE_INTERNAL').
2021-09-27 11:42:28 +02:00
Sara Arjona 79aa88fddd MDL-71970 h5plib_v124: Add namespace to H5P editor library
The joubel/editor is a third-party library. A namespace has been added to
avoid collision with other plugins using it (such as mod_hvp).
That way, they will be able to have a different version without
side effects.
2021-09-27 11:42:28 +02:00
Sara Arjona 88c5228e61 MDL-71970 h5plib_v124: Add namespace to H5P core library
The joubel/core is a third-party library. A namespace has been added to
avoid collision with other plugins using it (such as mod_hvp).
That way, they will be able to have a different version without
side effects.
2021-09-27 11:42:27 +02:00
Jun Pataleta e0dbb85732 MDL-72673 mod_glossary: Generate unique ID for Keywords select element 2021-09-24 18:31:28 +08:00
Paul Holden 0c9993773c MDL-69682 theme_boost: remove minimum height of tables.
The change that introduced this property (a3124b15) is no longer
required, and it caused visual glitches on tables containing a
single row.
2021-09-24 08:22:45 +01:00
Michael Hawkins 5b6f95647b MDL-72275 timeline: Add default offset to template
This value was being passed in the template, but the template
had 0 hardcoded instead of injecting the context value. With the other
bug fixes in this issue correctly loading the "All" view properly on
page load, this uncovered that at load time, the course view would not
load overdue items, which also meant a behat test was failing.
2021-09-24 11:23:57 +08:00
Michael Hawkins 8061730d7b MDL-72275 timeline: Make time dropdown options display consistently
The 6 month option was highlighted on load if previously selected,
which was not the case for any other options. This has been removed
so it behaves consistently.
2021-09-24 11:23:57 +08:00
Michael Hawkins ea0f449e1b MDL-72275 timeline: Fixed non-loading issue in dates sort
Incorrect setting/getting of the "seen" data attribute resulted in no
information being fetched when switching from course view back to dates
view.
2021-09-24 11:23:57 +08:00
Michael Hawkins 4564ed7412 MDL-72275 timeline: Display "all" time on page load fix
When the timeframe filter was set to "all" when the timeline
block was initially loaded, an incorrect value rendered into
the template meant the timeframe limit was set to 0 (which will
return no results) instead of setting no limit (which would fetch all
 action events, as intended).
2021-09-24 11:23:57 +08:00
AMOS bot 61339394d7 Automatically generated installer lang files 2021-09-24 00:07:32 +00:00
Ilya Tregubov 1a63bccf46 weekly release 3.11.3+ 2021-09-23 18:21:52 +02:00
Ilya Tregubov fcd3d82558 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-09-23 18:21:50 +02:00
Jun Pataleta 9063970932 Merge branch 'MDL-72426-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-09-23 12:23:53 +08:00
Thong Bui a79905af9a MDL-71750 File upload: Disable submittion when uploading multiple files 2021-09-23 09:08:39 +07:00
AMOS bot 58bbab621c Automatically generated installer lang files 2021-09-23 00:07:27 +00:00
Eloy Lafuente (stronk7) 29e944addb Merge branch 'MDL-72110-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2021-09-22 20:12:18 +02:00
Eloy Lafuente (stronk7) bfec56ac5e Merge branch 'MDL-72593-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-09-22 10:48:18 +02:00
Jun Pataleta 86f5f11cf8 Merge branch 'MDL-51165-moodle311' of https://github.com/kiratskitizing/moodle into MOODLE_311_STABLE 2021-09-22 10:51:42 +08:00
AMOS bot 497dc38a4b Automatically generated installer lang files 2021-09-22 00:07:28 +00:00
Eloy Lafuente (stronk7) dd401b0dfe Merge branch 'MDL-71352-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-09-21 23:19:34 +02:00
Eloy Lafuente (stronk7) 0170fcddd0 Merge branch 'MDL-72566-311' of git://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2021-09-21 19:07:27 +02:00
Eloy Lafuente (stronk7) fd54c1631f Merge branch 'MDL-69364-311-alt' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-09-21 18:19:32 +02:00
Ilya Tregubov f8001bbf14 MDL-70946 repository: Fix 311 branch Behat. 2021-09-21 18:09:42 +02:00
Ilya Tregubov 479d7a42d6 Merge branch 'MDL-70946-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-09-21 13:15:21 +02:00
Andrew Nicols 4f4e9b4828 MDL-72593 behat: Improve behat handling of file manager buttons
When using a try/catch for a find if the first match is not met then we
have an implicit 6 second delay waiting for the search to time out.

We can avoid this by combining the searches in a comma-separated
selection.

I have also taken the opportunity to convert the use of ->click() to the
i_click_on function which has the benefit of supporting wait for
pendingJS.
2021-09-21 16:00:41 +08:00
Andrew Nicols 4258188126 MDL-72593 behat: Load the Field node content locally for processing
The standard NodeElement functions for getAttribute, getTagName,
getParent, and friends go back to WebDriver and parse the DOM for each
request. This is insanely slow per request, and in the case of forms we
do a lot of checking to determine the field type.

This change modifies the form field detection to copy the entire node
content into a DOMDocument and parse the document locally.

This is significantly faster - in some cases where there are large
documents minutes faster.

I believe that this should be a safe change as the document fetched from
the browser is normalised to match the doctype specified.
2021-09-21 16:00:41 +08:00
Eloy Lafuente (stronk7) 78c1ecc30c Merge branch 'MDL-72205-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-09-20 19:05:33 +02:00
Andrew Nicols 3e2cc3cc4c MDL-69364 enrol: Improve setting of save button 2021-09-20 12:07:49 +08:00
Andrew Nicols 9fdaa9daec MDL-69364 enrol: Improve cohort test 2021-09-20 12:07:49 +08:00
Huong Nguyen df426e4a12 MDL-72205 admin: admin_setting_configduration validation improvement
The write_setting() should only use the internal validation if no validation function was provided
2021-09-20 09:18:32 +07:00
Peter Dias 48e1f7f484 MDL-70946 repository: Reenable and fix the disabled behat test 2021-09-20 08:10:09 +08:00
Joshua Ebarvia 0803f695fa MDL-51165 mod_url: allow directory index url direct access 2021-09-19 12:06:37 +09:30
Paul Holden 5279102245 MDL-72599 blocks: handle editing/deletion on admin notification page.
This was broken by changes in fdd5aef0, as the sesskey URL parameter
was required on admin/index.php in order for block related actions
to be performed uninterrupted by any redirections.
2021-09-17 12:21:46 +01:00
Luca Bösch e10d8c46e2 MDL-71352 gradereport_grader: Add icons for pass/fail. 2021-09-17 12:13:20 +02:00
Ilya Tregubov c71b2db9a3 weekly release 3.11.3+ 2021-09-17 08:58:33 +02:00
Ilya Tregubov c7485d9d5f Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-09-17 08:58:31 +02:00
Ilya Tregubov cd6c68cf20 Merge branch 'MDL-72173-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-09-16 15:02:02 +02:00
Andrew Nicols 6220e076f4 MDL-72173 behat: Respect login page preference 2021-09-16 20:47:18 +08:00
Ferran Recio d70cfe4c8c MDL-72566 completion: fix missing mod bug
MDL-71899 produces a regression. When an activity plugin is not present
but it has activities in the DB the course view returns an exception.
With this patch the code will ignore missing modules when calculating
the completion.
2021-09-16 09:59:32 +02:00
Jun Pataleta 533c6717a2 Merge branch 'MDL-72173-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-09-16 15:39:51 +08:00
Andrew Nicols 84d82ce72e MDL-72173 behat: Fix typo Logout <> Log out 2021-09-16 15:03:07 +08:00
Jun Pataleta 773a4d7603 Merge branch 'MDL-71602-311-2' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-09-16 12:57:50 +08:00
Jun Pataleta 0f82d8c809 Merge branch 'MDL-72173-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-09-16 12:22:56 +08:00
Andrew Nicols 030dae8824 MDL-72173 behat: Add tests for login/logout steps 2021-09-16 12:20:37 +08:00
Andrew Nicols c47da95926 MDL-72173 behat: Automatically log user out on behat login 2021-09-16 12:13:26 +08:00
Andrew Nicols 3ea7982a85 MDL-72173 behat: Add and use behat logout URL 2021-09-16 12:13:25 +08:00
Jake Dallimore 189b888019 Merge branch 'MDL-71860-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-09-16 11:02:51 +08:00
Jun Pataleta 5795f1b6b3 Merge branch 'MDL-72589_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-09-16 09:46:48 +08:00
AMOS bot 7bcf5222e3 Automatically generated installer lang files 2021-09-16 00:07:27 +00:00
Leon Stringer a40e05798d MDL-71860 core: Migrate lang string
Corresponding move of language string invalidpersistenterror following
move of class invalid_persistent_exception in MDL-57273.

AMOS BEGIN
 CPY [invalidpersistenterror,core_competencies],[invalidpersistenterror,core_error]
AMOS END
2021-09-16 07:00:43 +08:00
Eloy Lafuente (stronk7) 8d080e0994 Merge branch 'MDL-72432-MOODLE_311_STABLE' of https://github.com/katerynadegtyariova/moodle into MOODLE_311_STABLE 2021-09-16 00:37:20 +02:00
Eloy Lafuente (stronk7) 3671f1963e MDL-72589 behat: Create course with 3 sections (workaround)
With the default 5 sections course, after editing the activities, the
"log out" link is exactly on the edge of the view port. It's one of
those cases where Chrome fails to click/press it (have tried both).

So just make the course to have 3 sections is enough to avoid the
problem. Some day Chrome will fix that problem but, until then...
we cannot do much apart from changing the window size or try to
configure things to show differently.
2021-09-15 20:27:06 +02:00
Eloy Lafuente (stronk7) 452c5815e5 MDL-72589 behat: Add @skip_chrome_zerosize to failing scenarios
All the scenarios failing with Chrome zero-size errors are
getting the @skip_chrome_zerosize to be able to keep them apart from
regular runs. See MDL-71108 for more information about
that error.

They will be run by another job, specifically using that tag to
keep them failing and under control.
2021-09-15 20:26:51 +02:00
Jake Dallimore b73f9fec06 Merge branch 'MDL-71550-311' of git://github.com/bmbrands/moodle into MOODLE_311_STABLE 2021-09-15 10:49:45 +08:00
Jake Dallimore c1f3de62ee Merge branch 'MDL-71137-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-09-15 10:12:09 +08:00
Eloy Lafuente (stronk7) 0bc281384d Merge branch '71093-moodle311-backup-honor-formatstringstriptags' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_311_STABLE 2021-09-14 22:22:15 +02:00
Eloy Lafuente (stronk7) 7eb9672445 Merge branch 'MDL-72192-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-09-14 22:17:31 +02:00
Marie-Eve Lévesque c943722407 MDL-71785 core_quiz: Empty quiz section name behaves like new page 2021-09-14 14:38:18 -04:00
Ilya Tregubov bce29fbd43 Merge branch 'MDL-71961-311' of git://github.com/nguyenphuctien/moodle into MOODLE_311_STABLE 2021-09-14 12:08:58 +02:00
Ilya Tregubov bbdca02068 Merge branch 'MDL-71846-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-09-13 13:43:38 +02:00
Tien Nguyen 6115822226 MDL-71961 Quiz: Disable quiz navigation buttons when files are uploading 2021-09-13 17:44:02 +07:00
Odei Alba 1209205766 MDL-68325 completion: Add validation to course completion form 2021-09-13 12:11:53 +02:00
Andrew Nicols 1349e5d2f9 MDL-72173 behat: Switch to behat login URL 2021-09-13 11:20:35 +08:00
gthomas2 6c578308b0 MDL-72173 behat: Add alternative login file for behat 2021-09-13 11:14:02 +08:00
Eloy Lafuente (stronk7) ab931f6aa7 Moodle release 3.11.3 2021-09-12 12:37:26 +02:00
Eloy Lafuente (stronk7) 39cff78f7e weekly release 3.11.2+ 2021-09-11 12:12:19 +02:00
Eloy Lafuente (stronk7) 19cbc68871 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-09-11 12:12:15 +02:00
Shamim Rezaie 6e37e4606c MDL-71240 filter_tex: Add allowlist for filter_tex_sanitize_formula 2021-09-10 18:10:02 +02:00
Eloy Lafuente (stronk7) 89f2984206 Merge branch 'MOODLE_311_STABLE' of git://github.com/cescobedo/moodle into MOODLE_311_STABLE 2021-09-09 18:04:14 +02:00
cescobedo 1d37ef7bbb MDL-63207 auth_ldap: hot fix, remove remaining line 2021-09-09 17:59:51 +02:00
Eloy Lafuente (stronk7) 33c80edfae Merge branch 'MDL-71385-311-3' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-09-09 12:59:45 +02:00
Jun Pataleta f88a73bbe6 Merge branch 'MDL-71899-311-2' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-09-09 12:59:45 +02:00
Eloy Lafuente (stronk7) b1216eefe4 Merge branch 'MDL-63207-311' of git://github.com/cescobedo/moodle into MOODLE_311_STABLE 2021-09-09 12:59:45 +02:00
Eloy Lafuente (stronk7) fec2e6c661 Merge branch 'MDL-69855-311' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-09-09 12:59:45 +02:00
Jun Pataleta 6903d7e908 MDL-71385 theme: Fix contrast for dimmed text against striped table rows
In order to achieve good colour contrast between dimmed text and striped
table rows, the background colour of the striped rows are being
lightened to 0.03 alpha. While $gray-600 is being adjusted to a bit
darker shade of #6a737b. This gives a colour contrast ratio of 4.5:1
between the dimmed text colour and the striped table row background
which meets WCAG 2.1 Level AA requirements.

Comparing the normal font colour (#212529) with the adjusted dimmed text
colour gives a contrast ratio of 3.20:1 which meets WCAG 2.1 Level AA
requirements and still makes them distinguishable from one another.
2021-09-09 16:02:12 +08:00
Huong Nguyen 3a42d256af MDL-71899 performance: Improve activity completion data caching
- Modified SQL in get_data() to get the activity completion of all course modules without calling get_fast_modinfo() to reduce the DB queries.
 - Building activity completion cache for the whole course in one time instead of building the cache for each course module by passing $wholecourse = true to get_data()
2021-09-09 10:03:53 +07:00
Huong Nguyen 604d58ff4a MDL-71899 performance: Improve course image caching
Changed to use get_course() instead of get_fast_modinfo() for better performance
2021-09-09 10:03:53 +07:00
AMOS bot 7831dff5ac Automatically generated installer lang files 2021-09-09 00:07:25 +00:00
Eloy Lafuente (stronk7) 2f0752bd1c Merge branch 'MDL-72358-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-09-08 17:08:14 +02:00
Eloy Lafuente (stronk7) c7aad0eac2 Merge branch 'MDL-72216-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-09-08 11:29:01 +02:00
Eloy Lafuente (stronk7) 93c2d51181 Merge branch 'MDL-72499-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-09-07 23:52:01 +02:00
Eloy Lafuente (stronk7) 3f1828f78d Merge branch 'MDL-72071-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-09-07 23:29:54 +02:00
Eloy Lafuente (stronk7) 8c3b24cc8e Merge branch 'MDL-71925-311_wordcount' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2021-09-07 23:25:33 +02:00
Eloy Lafuente (stronk7) f422c92b97 Merge branch 'MDL-72488-311-importdatastring' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-09-07 22:59:35 +02:00
cescobedo 4bd73eceb8 MDL-63207 auth_ldap: Update user profile if field is empty 2021-09-07 22:54:37 +02:00
Eloy Lafuente (stronk7) a8b9b98827 Merge branch 'MDL-69504-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2021-09-07 20:03:15 +02:00
Eloy Lafuente (stronk7) 7c9fe59856 Merge branch 'MDL-67610-311-2' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-09-07 19:25:26 +02:00
Jun Pataleta 7b3b935a2e MDL-67610 mod_forum: Do not include private replies in unread count
Fetching the counts of unread posts should only include unread regular
posts or unread private reply posts directed to the user unless the user
has the capability to read private replies.
In order to retrieve the correct counts, we also need to loop through
each forum instance in the course to check the capability of the user to
read private replies in each forum.
2021-09-07 23:20:23 +08:00
Eloy Lafuente (stronk7) 76a2decae9 Merge branch 'MDL-72025-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-09-07 16:30:53 +02:00
AMOS bot 2955eda18a Automatically generated installer lang files 2021-09-07 00:07:26 +00:00
Paul Holden e09e5f427b MDL-71726 course: respect user access when exporting participants.
We should ensure that users being exported are enrolled on the
course being exported from. In courses where the current user can't
access all groups we should ensure that users being exported belong
to the same groups as them.
2021-09-07 00:14:27 +02:00
Sujith Haridasan ed4389857d MDL-71160 auth_db: Use strict comaprison
Use strict comparison to avoid type juggling.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-09-07 00:14:27 +02:00
Paul Holden b5b7b1f54f MDL-71976 auth_shibboleth: consistent session parsing during logout. 2021-09-07 00:14:27 +02:00
Shamim Rezaie 272780993d MDL-71240 filter_tex: Sanitize the whole latex document
LaTeX documents have a preamble section and admins can use a \newcommand
statement to define new commands there (or to give an alias to another
command). This commit makes sure no blocked command can escape
sanitization by being used in a new seemingly harmless command that is
defined in the LaTeX preamble.
2021-09-07 00:14:27 +02:00
Shamim Rezaie 888c3288a2 MDL-71240 filter_tex: Support paranoid mode for openin_any in latex 2021-09-07 00:14:27 +02:00
Huong Nguyen 298951cd2e MDL-71797 quiz: Improve the checks when fetching user's attempts 2021-09-07 00:14:27 +02:00
Eloy Lafuente (stronk7) 78b3472f5d Merge branch 'MDL-72286-311-test' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-09-06 23:58:04 +02:00
David Mudrák ef8cda836f MDL-72488 lang: Fix hard-coded English string at grades import form
Also adding a help tooltip as this seems to be the most important field
in the form and yet it was the only one without a help.
2021-09-06 17:41:09 +02:00
Paul Holden 14781b4c2e MDL-72499 event: add/correct event language strings as required. 2021-09-06 11:16:38 +01:00
Thong Bui aaa2f20a5f MDL-71137 File upload: progress bar issues display when D&D multi files 2021-09-06 14:11:59 +07:00
Eloy Lafuente (stronk7) 08f9a7a431 Merge branch 'MDL-72428-311-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-09-03 19:10:26 +02:00
Eloy Lafuente (stronk7) 596cace356 Merge branch 'MDL-72478-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-09-03 17:03:01 +02:00
Shamim Rezaie bef758bae6 MDL-56773 atto_equation: The equation editor should always be rtl
Also re-applied the border that was added to the preview area as part of
MDL-44778. The class name that's used no longer exists.
2021-09-03 17:58:42 +10:00
Sara Arjona 7b3ef08994 MDL-72478 calendar: Fix PHPUnit failure with offset
Before PHP 8.0.10, the time is lost when datetime->modify() is used
with weekdays. However, with PHP 8.0.10, the time is kept.
In consequence, the test_yearly_every_20th_monday_forever method
started failing.
For fixing it, the offset has been removed and the time has been set
to 00:00, so the behaviour will be the same regardless the PHP
version.
2021-09-03 09:35:06 +02:00
Simey Lameze 6ba8dbf909 MDL-72426 theme: fix message and notification count colour contrast 2021-09-03 12:26:36 +08:00
Peter Burnett 6f25060b32 MDL-72452 resource: Filter resource media embed output 2021-09-03 09:12:38 +10:00
sam marshall 68204f0870 MDL-72025 Upgrade: Out of memory when updating social profile fields 2021-09-02 13:44:20 +01:00
Luca Bösch e1046f053a MDL-72216 questions: Don't stick buttons together in preview. 2021-09-02 13:36:30 +02:00
Sara Arjona 7fdf72a268 weekly release 3.11.2+ 2021-09-02 11:51:26 +02:00
Jun Pataleta baa54113d6 Merge branch 'MDL-72440_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-09-02 09:52:02 +08:00
David Mudrák d6bc2e2a47 MDL-72428 lang: Use the fixed strings in the tests 2021-09-01 21:55:41 +02:00
Helen Foster a8bae35491 MDL-72428 lang: Import fixed English strings (en_fix) 2021-09-01 21:53:31 +02:00
Sara Arjona f06450a050 Merge branch 'MDL-72169-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-09-01 17:46:43 +02:00
Sara Arjona 4b63194dd3 Merge branch 'MDL-71375-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-09-01 17:09:33 +02:00
Sara Arjona 3bf10af46b Merge branch 'MDL-70376-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-09-01 16:52:08 +02:00
Sara Arjona 0a9017dad3 Merge branch 'MDL-71674-311' of https://github.com/dcai/moodle into MOODLE_311_STABLE 2021-09-01 11:36:41 +02:00
Dongsheng Cai 6237ac5ae9 MDL-71674 editor_atto: more assessible errors 2021-09-01 18:27:32 +10:00
Eloy Lafuente (stronk7) b849fbebd8 Merge branch 'MDL-71999-311' of https://github.com/danielneis/moodle into MOODLE_311_STABLE 2021-08-31 23:16:16 +02:00
Eloy Lafuente (stronk7) 4053ab14d6 Merge branch 'MDL-71121-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-31 23:13:07 +02:00
Jun Pataleta baa4772cc6 Merge branch 'MDL-71778-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-08-31 22:58:44 +08:00
Paul Holden 7c277c69bf MDL-72296 admin: style form when prompting for upgrade key. 2021-08-31 13:52:54 +02:00
Paul Holden e8b23a3efb MDL-72192 user: observe fullname capability in selector context. 2021-08-31 12:17:17 +01:00
Paul Holden 13537c6d64 MDL-71846 group: consistent escaping of user/group names. 2021-08-31 12:15:49 +01:00
Paul Holden 72a28cf776 MDL-72071 message: preserve window scroll opening processor modal. 2021-08-31 11:57:24 +01:00
Paul Holden 97997d1960 MDL-72169 privacy: format course name/summary during export. 2021-08-31 11:56:04 +01:00
Eloy Lafuente (stronk7) ca5a05550d MDL-72440 js: reconcile npm installed stuff
When npm-shrinkwrap.json was regenerated few days ago by MDL-72014
running audit-fix on it, it seems that some checksums in the "lodash"
package were missing.

Now they are properly set and that's leading to npm-shrinkwrap.json
changes when people runs npm install (note npm ci is the recommended
way to install all the dev dependencies).

So, just reconcile the file to include the new checksums.
2021-08-31 11:20:16 +02:00
cperves 1a991ae622 MDL-71778 admin: patch for hard-set check filter 2021-08-31 12:34:20 +08:00
Peter Dias 9d0e0519f2 MDL-70376 mod_assign: Reintroduce pdf orientation check
Reintroduce the orientation check and sizing when importing an image
2021-08-31 12:29:15 +08:00
Jake Dallimore 9aa2e468d6 Merge branch 'MDL-70433-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-08-30 10:42:14 +08:00
Simeon Naydenov 4edbc6c861 MDL-71375 lib: Fix tooltip in show_hide_icon in flexible table 2021-08-30 09:42:26 +08:00
Luca Bösch 77077c6567 MDL-70433 grades: prevent double escaping in titles 2021-08-27 10:56:07 +02:00
Sara Arjona 1aebcd49c3 MDL-72358 contenttype_h5p: Improve error handling
In MoodleCloud it was raised that, in some cases, loading the content
bank, from a course page, gives an "Invalid H5P content URL", not
offering any way to delete the offending content or create new one.
An extra-check has been added to the "is_view_allowed" method to
guarantee the H5P API is called only if the H5P content has a file.
2021-08-27 10:40:05 +02:00
Andrew Nicols 80c48e12ce weekly release 3.11.2+ 2021-08-27 12:00:17 +08:00
Andrew Nicols 6577d20773 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-08-27 12:00:14 +08:00
Sujith Haridasan 1e67fe7005 MDL-72110 core_navigation: home page preference
Admin should respect the home page preference set
just like any other user.
2021-08-27 07:35:10 +05:30
Sara Arjona 2993eadf2d Merge branch 'MDL-71029-311' of https://github.com/dcai/moodle into MOODLE_311_STABLE 2021-08-26 07:12:27 +02:00
Andrew Nicols 50f6fa90b8 Merge branch 'MDL-72403-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-08-26 13:02:16 +08:00
Heena Agheda 7b6e564041 MDL-72187 logstore: record log store's visibility change 2021-08-26 12:56:58 +08:00
Andrew Nicols 8a7f7a4d70 Merge branch 'MDL-70176_311' of https://github.com/TomoTsuyuki/moodle into MOODLE_311_STABLE 2021-08-26 12:16:24 +08:00
Andrew Nicols 1dfc7f6356 Merge branch 'MDL-72271_311' of https://github.com/larsbonczek/moodle into MOODLE_311_STABLE 2021-08-26 11:44:33 +08:00
Andrew Nicols 4f295616af Merge branch 'MDL-72152-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-08-26 11:36:12 +08:00
Andrew Nicols 3a8c8fd1ac Merge branch 'MDL-72153-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-26 11:31:58 +08:00
Andrew Nicols 6884c6b65f Merge branch 'MDL-72312_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-08-26 11:26:10 +08:00
AMOS bot 6424a1817b Automatically generated installer lang files 2021-08-26 00:07:29 +00:00
Sara Arjona 5b2c9cf18b Merge branch 'MDL-72106-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-25 18:38:38 +02:00
Eloy Lafuente (stronk7) cf2d9cdfef Merge branch 'MDL-72163-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-08-24 20:12:22 +02:00
Sara Arjona c59c09a65d Merge branch '311_MDL-70006' of git://github.com/danmarsden/moodle into MOODLE_311_STABLE 2021-08-24 13:13:13 +02:00
Shamim Rezaie a45b9e347f MDL-72403 calendar: prereserve courseid after form submit 2021-08-24 18:05:00 +10:00
Jake Dallimore c7ae5b9a0f MDL-69504 mod_lti: check role switches when setting lti roles on launch
is_siteadmin isn't aware of role switches, so make sure we're not in a
switched role before calling that method.
2021-08-24 14:33:49 +08:00
Andrew Nicols fb13698049 Merge branch 'MDL-72014_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-08-24 09:16:53 +08:00
Andrew Nicols 6c6dc64458 Merge branch 'MDL-72207-311' of git://github.com/jleyva/moodle into MOODLE_311_STABLE 2021-08-24 09:06:36 +08:00
Kateryna Degtyariova 094a136394 MDL-72342 groups: Use get_columns() to handle BOM in CSV
Ensuring that BOM was properly removed from input CSV file by using get_columns() instead of parsing the raw data.
2021-08-24 10:50:17 +10:00
Eloy Lafuente (stronk7) 72e15b8845 Merge branch 'MDL-71055-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-08-23 23:22:25 +02:00
Sara Arjona 084f74a5a2 Merge branch 'MDL-72257-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-23 17:52:26 +02:00
Shamim Rezaie fa1da2e471 MDL-71602 qtype_essay: label essay question's answer area 2021-08-24 00:59:18 +10:00
Eloy Lafuente (stronk7) a9a2127ddd MDL-72312 environment: Add new optional custom check for igbinary
This optional environmental check will look if:

- the site is running php72.
- the site has igbinary extension enabled.
- the igbinary extension version is a buggy one >=3.2.2 <= 3.2.4
- the bug is reproducible.

And will warn if all the conditions are met.
2021-08-23 15:11:11 +02:00
Andrew Nicols 81ee8fe275 MDL-71055 behat: Update core settings to use generator
These changes have only been applied to settings which were already
using settings names and values, but which were still using the UI.
2021-08-23 12:23:03 +08:00
Eloy Lafuente (stronk7) 46bac04f41 Merge branch 'MDL-71973-311' of https://github.com/mohalisad/moodle into MOODLE_311_STABLE 2021-08-20 19:07:04 +02:00
Eloy Lafuente (stronk7) 4a0ed883e0 MDL-72014 nodejs: audit fix to solve some security reports
Simply run npm audit fix that updates these main packages:

- xmldom 0.6.0
- grunt 1.4.1
- gherkin-lint 4.2.2

(and also a bunch of dependencies
2021-08-20 13:49:50 +02:00
Ilya Tregubov f9ea7e747f weekly release 3.11.2+ 2021-08-20 13:24:33 +02:00
Ilya Tregubov 01465a4ee4 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-08-20 13:24:31 +02:00
Tomo Tsuyuki b1ab339ee0 MDL-70176 mod_forum: Grading respects separate groups filter 2021-08-20 13:35:28 +10:00
Ilya Tregubov 7569f511b5 MDL-49202 core: Comment broken test.
Should be fixed properly as part of MDL-72377.
2021-08-19 17:14:17 +02:00
Ilya Tregubov 8de0f4896f Merge branch 'MDL-49202_311' of git://github.com/mdjnelson/moodle into MOODLE_311_STABLE 2021-08-19 17:06:04 +02:00
Mark Nelson 03a3b7124c MDL-49202 core: fix failing unit tests
See MDL-72377.
2021-08-19 20:16:10 +08:00
Mark Nelson 150231444f MDL-49202 core_grades: add Behat tests 2021-08-19 20:16:10 +08:00
Juan Leyva 3a229f93cc MDL-72207 assign: Support all participants in get_submission_status WS 2021-08-19 14:11:57 +02:00
Mark Nelson e6ea2e72f4 MDL-49202 core_grades: perform same action on categories in form
When you click on 'Edit' then 'Hide' on a grade item like a course category
that contains many grade items, the course and the grade items are set to
hidden. However, if you use the 'hidden' option on the 'Edit settings'
page it only hides that item and none of the items (assignment etc)
under that course category. We want them to be consistent.
2021-08-19 17:44:02 +08:00
Mark Nelson 9396dacf81 MDL-49202 core_grades: perform same action on items in form
When you click on 'Edit' then 'Hide' on a grade item like an
assignment it also hides the grades. However, If you use the
'hidden' option on the 'Edit settings' page it just hides that
item and doesn't hide grades as well. We want them to be
consistent.
2021-08-19 17:44:02 +08:00
Julien Boulen 63e37835e0 MDL-71093 backup: fix backup when activity names use HTML tags 2021-08-19 11:24:34 +02:00
Thong Bui 49d1413f72 MDL-72064 Questions: response selection area enough 2021-08-19 14:33:45 +07:00
Bas Brands 6fb325de02 MDL-71550 theme_boost: improve dropdown hover styles 2021-08-19 09:17:24 +02:00
Andrew Nicols 1780caf656 Merge branch 'MDL-68639-3.11' of https://github.com/xcaro/moodle into MOODLE_311_STABLE 2021-08-19 10:06:08 +08:00
Eloy Lafuente (stronk7) 60d3bfca83 Merge branch 'MOODLE_311-MDL-72210' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-08-18 19:55:02 +02:00
Eloy Lafuente (stronk7) 4ee195b5cc Merge branch 'MDL-72206-311' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-08-18 19:32:37 +02:00
Andrew Nicols 97834dc094 Merge branch 'MDL-69451-shared-temptables-3.11' of https://github.com/srdjan-catalyst/moodle into MOODLE_311_STABLE 2021-08-18 21:40:19 +08:00
Víctor Déniz e3e071c9c9 Merge branch 'MOODLE_311_MDL-72239-v2' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-08-18 13:57:35 +01:00
Mikhail Golenkov 36b7ae3e52 MDL-72239 phpunit: Assert the number of db queries to be less or equal
The course unit test assumes the number of db call. This assumption
is correct in vanilla moodle only. Once some plugins installed their
observers may do extra db calls. Due to caching the number of actual
db calls in the unit test may be fewer.
2021-08-18 21:29:14 +10:00
Víctor Déniz 22dd5c744b Merge branch 'MDL-71487-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-18 09:54:48 +01:00
AMOS bot d3fbaed60d Automatically generated installer lang files 2021-08-18 00:07:25 +00:00
Nhan Vo 1b99453e1f MDL-68639 HTML Editor (Atto): Invalid HTML for nested lists 2021-08-17 10:26:06 +07:00
Frédéric Massart c1b68bf712 MDL-72286 editor_atto: Declare type on plugins button groups 2021-08-17 12:00:10 +10:00
Ilya Tregubov c7a0f15a14 Merge branch 'MDL-71814-311' of git://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-08-16 13:57:10 +02:00
Jun Pataleta 9b0616be13 MDL-69855 mod_forum: Don't show reply link in email for private replies 2021-08-16 17:46:00 +08:00
Thach Le Huy a76e6df756 MDL-71814 Atto: File picker – file info panel focus issue 2021-08-16 16:38:16 +07:00
Mikhail Golenkov 2af7fbcdbf MDL-72210 phpunit: Remove excessive curl mock responses 2021-08-14 10:40:30 +10:00
AMOS bot 099a04142e Automatically generated installer lang files 2021-08-14 00:07:26 +00:00
Paul Holden 667f621ca6 MDL-72153 privacy: correctly export user description/files. 2021-08-13 12:41:00 +01:00
Ilya Tregubov 30991deb7c Merge branch 'MDL-72035-excel_csv_bom-311' of git://github.com/leonstr/moodle into MOODLE_311_STABLE 2021-08-13 11:24:55 +02:00
Jun Pataleta 8eddaa6479 Merge branch 'MDL-72330-311' of git://github.com/vmdef/moodle into MOODLE_311_STABLE 2021-08-13 11:00:47 +08:00
Andrew Nicols 137aed09fd Merge branch 'MDL-72325-311-tourspolicy' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-08-13 09:58:59 +08:00
Víctor Déniz b6bb3e46dd MDL-72330 behat: revert previous incorrect change 2021-08-12 23:43:57 +01:00
Ilya Tregubov 707d09a568 weekly release 3.11.2+ 2021-08-12 16:50:17 +02:00
Ilya Tregubov bd7eb39d7c Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-08-12 16:50:15 +02:00
David Mudrák 3188b6fc52 MDL-72325 user: Do not show user tours without site policy agreed
Fetching user tours used to fail on external_api::validate_context() and
require_login() calls if the user did not have the site policy agreed.

The patch introduces a check to see if the user is fully set up and
ready to use the site before attempting to load the tours.
2021-08-12 13:22:07 +02:00
Víctor Déniz c5ff109f53 MDL-71500 calendar_threemonth: fix wrong behat step 2021-08-12 11:42:09 +01:00
Andrew Nicols a4cfda4e51 Merge branch 'MDL-71844-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-12 10:25:18 +08:00
Eloy Lafuente (stronk7) 6865a3a0a1 Merge branch 'MDL-72265_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-08-12 00:05:44 +02:00
Eloy Lafuente (stronk7) a990007a77 Merge branch 'MDL-71500-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-08-11 20:16:46 +02:00
Eloy Lafuente (stronk7) 8bb82b5bc7 Merge branch 'MDL-71945-M311S' of https://github.com/lucisgit/moodle into MOODLE_311_STABLE 2021-08-11 11:47:09 +02:00
Eloy Lafuente (stronk7) 9bcac8370b Merge branch 'MDL-72242-311-svgforcedfilter' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-08-11 11:40:05 +02:00
Eloy Lafuente (stronk7) 774f6ff070 Merge branch 'MDL-71656-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-08-10 19:09:41 +02:00
Eloy Lafuente (stronk7) 1f343bf0a2 Merge branch 'MDL-70165-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-10 18:52:18 +02:00
Ilya Tregubov 983d456fa2 Merge branch 'MDL-72033-311' of git://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-08-10 16:08:38 +02:00
Tony Butler bf2a7643ef MDL-71945 mod_assign: Remove unneccesary call to assign_update_grades()
The update_grade() call achieves the same thing with additional checks.
2021-08-10 11:07:30 +01:00
Lars Bonczek 637ab9420c MDL-72271 mod_quiz: fix secure_window close function 2021-08-10 11:53:28 +02:00
Paul Holden f20a20b7b0 MDL-72106 calendar: redirect to same page post-subscription process.
Avoid issues when reloading page/re-sending POST data.
2021-08-10 09:40:54 +01:00
Paul Holden 84d1f3c078 MDL-71844 tool_task: preserve navigation when executing task. 2021-08-09 10:44:53 +01:00
Paul Holden a8fe74f951 MDL-71487 admin: ensure filesize settings don't overflow integer. 2021-08-09 10:36:04 +01:00
Paul Holden dd01ce509f MDL-70165 course: always import inplace editable module.
It's required on the course participants table for the roles/groups
columns, but isn't always loaded after adding the first participant.
2021-08-09 10:30:15 +01:00
AMOS bot 0f6ce1dce9 Automatically generated installer lang files 2021-08-06 00:07:28 +00:00
Srdjan e02b3beb79 MDL-69451 dml: use same temptables for both rw and ro database handle
moodle_read_slave_trait: when creating another handle, restore temptables
property that is clobbered by raw_connect().

Also a better condition for temptable related queries detection in
pgsql_native_moodle_database.

dml_pgsql_read_slave_test::test_temp_table(): use real db connection
if possible, otherwise skip the test.
2021-08-06 10:02:31 +10:00
Víctor Déniz 605ce2781b weekly release 3.11.2+ 2021-08-05 16:27:25 +01:00
Víctor Déniz 9f434e5844 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-08-05 16:27:20 +01:00
Tim Hunt 1c25e9ec53 MDL-72265 backup: fix checking of override capabilites on restore
Thanks to Peter Dias <peter@moodle.com> for his help with the unit test.
2021-08-05 14:28:37 +01:00
Víctor Déniz fb50327bcf Merge branch 'MDL-71835-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-04 23:32:01 +01:00
Víctor Déniz 435c0c34d6 Merge branch 'MDL-71152-311' of git://github.com/roland04/moodle into MOODLE_311_STABLE 2021-08-04 20:37:49 +01:00
Víctor Déniz 22ee833a80 Merge branch 'MDL-72262-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-08-04 12:43:37 +01:00
abgreeve 439092427b Merge branch 'MDL-71050-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-04 15:53:15 +08:00
abgreeve 0af232b461 Merge branch 'MDL-67833-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-08-03 10:26:49 +08:00
Dan Marsden 1f1ecab583 MDL-70006 analytics: Don't send notifications to suspended enrolments. 2021-08-03 10:55:17 +12:00
Paul Holden f8cffa2803 MDL-71121 backup: apply config defaults for async backups. 2021-08-02 23:35:03 +01:00
David Mudrák 7e3ea17638 MDL-72242 files: Do not force text filtering of SVG files
It was a mistake to force filtering of SVG files in MDL-55243. It can
easily lead to corrupted SVG files.

The patch removes that forced filtering and clarifies the inline comment
of what and why we need to do.
2021-08-02 14:43:21 +02:00
Paul Holden 4feb3c4835 MDL-72257 gradeexport_xml: detect absense of grade items to export.
Where there are no grade items with idnumbers for selection, then
nothing should be exported. Currently, this is being interpreted as
the user exporting all grade items.
2021-08-02 10:24:01 +01:00
Ilya Tregubov 8521213b82 MDL-72262 behat: Make alias shorter to fix Oracle failures. 2021-08-02 08:26:39 +02:00
AMOS bot 205438924a Automatically generated installer lang files 2021-07-31 00:07:30 +00:00
Víctor Déniz b3a82b1b1e Merge branch 'MDL-72085-MOODLE_311_STABLE' of https://github.com/dmitriim/moodle into MOODLE_311_STABLE 2021-07-30 08:52:32 +01:00
Dmitrii Metelkin a6a5070d06 MDL-72085 core_phpunit: reset session notifications 2021-07-30 10:02:49 +10:00
Jun Pataleta 0a21811ed0 Moodle release 3.11.2 2021-07-29 10:03:20 +08:00
Ilya Tregubov 5102a3a04f weekly release 3.11.1+ 2021-07-28 16:48:22 +02:00
Ilya Tregubov ae77cfd5af Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-07-28 16:48:20 +02:00
Ilya Tregubov 6da13bc87a Merge branch 'MDL-71672-311-2' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-07-28 11:16:47 +02:00
Jun Pataleta a8f4ba9af1 Merge branch 'MDL-72203-311-2' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-07-28 11:26:52 +08:00
AMOS bot b9ab9d82e9 Automatically generated installer lang files 2021-07-28 00:07:28 +00:00
Mike Churchward ec367da169 MDL-71925 tool_brickfield: Limited DOM tag count using core function. 2021-07-27 15:52:58 -04:00
Michael Hawkins dc19dd6134 MDL-72203 curl: Improve redirect unit testing and update upgrade.txt
lib/upgrade.txt was updated to reflect the fact that all cURL redirects
will be emulated.
2021-07-27 23:09:09 +08:00
David Mudrák 986a6f6f40 MDL-72203 curl: Remove duplicate unit tests for emulated redirects
Before, we had each redirect test duplicated: one for the native
redirects via native cURL, second for our emulated implementation. Now
all redirects are always emulated so there is no need to have them
tested twice.
2021-07-27 22:56:48 +08:00
David Mudrák cbf9dfbd8d MDL-72203 curl: Check each URL in redirect chain to see if it is blocked
The security problem here was that only the first and the last URL in
the redirect chain was checked by the security helper. This patch forces
the curl wrapper to always emulate cURL redirects and check every
redirect URL in the chain before actually visiting it.
2021-07-27 22:56:48 +08:00
David Mudrák 6527cbc492 MDL-72203 curl: Warn if someone actually started to use $maxredirects
The new parameter of curl_security_helper::url_is_blocked() introduced
in MDL-71916 became part of the API. Even if we reverted it quickly,
someone can use a released Moodle version that has that parameter in
place. For that reason and also to avoid potential troubles in the
future (e.g. when yet another argument would be added to this method),
we need to make it clear that the second parameter of this method should
never be used again.

Poor $maxredirects, you did not live long with us. Oh well.
2021-07-27 22:56:48 +08:00
David Mudrák 5068469f6f MDL-72203 curl: Revert original fix of redirects to blocked URLs
This reverts the original fix introduced in MDL-71916. It introduced an
extra native cURL call inside curl_security_helper to check if the given
URL triggers a redirect to a blocked URL or not.

Shortly after the release, a couple of regressions were reported as a
result of the integrated solution. It was agreed to revert the fix and
progress with implementing an alternative approach.
2021-07-27 22:56:48 +08:00
Ilya Tregubov 3f9cc1fc76 Merge branch 'MDL-72179-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-07-27 12:37:38 +02:00
Andrew Nicols 3dd5ef4cc0 MDL-72179 behat: Make use of page resolvers 2021-07-26 15:14:24 +08:00
Andrew Nicols 2b7a9da30f MDL-72179 behat: Add page resolvers for activity roles/perms 2021-07-23 20:44:26 +08:00
Andrew Nicols 9f1f8e584f MDL-72179 behat: Add page resolver for activity names 2021-07-23 20:43:47 +08:00
Andrew Nicols 68edc3c42a MDL-72179 behat: Add activity editing page resolution 2021-07-23 20:43:47 +08:00
Andrew Nicols 3d4b232a4a MDL-72179 behat: Fix page resolvers to remove ambiguity
The simple pattern matches were conflicting in some situations. To make
this backwards compatable we need to convert it to a Regex pattern match
instead, and provide the quoted and unquoted variants.
2021-07-23 20:43:47 +08:00
Andrew Nicols 63df6e1ee2 MDL-72179 behat: Correct course category page resolving
There were two issues here:
* I am on the [categoryname] category page page (duplicated page)
* the wrong URL was being used

Since an incorrect URL was used I felt it safe to rename the step from
'category page page' to 'category page'.
2021-07-23 20:43:47 +08:00
Andrew Nicols 30adbbf796 MDL-72179 behat: Lowercase all page instance resolvers 2021-07-23 20:43:47 +08:00
Andrew Nicols 995ceb32d0 MDL-72179 behat: Improve core page resolvers
This commit makes the following improvements to core page resolverss:
* allows for mixed case naming (course, Course, etc.)
* allows fields other than the idnumber to be specified:
** course: idnumber, shortname, fullname
** course category: idnumber, name

Whilst some of these fields are not unique, they will typically be
unique in most test scenarios. Where they are not then the idnumber
should be used in preference.
2021-07-23 20:28:10 +08:00
Ilya Tregubov 2c69199ca1 weekly release 3.11.1+ 2021-07-23 11:31:01 +02:00
Ilya Tregubov 0ca014907b Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-07-23 11:30:59 +02:00
Jun Pataleta 8096d76275 MDL-72206 theme_boost: Have env check classes extend alert classes
To achieve good colour contrast and consistency with other parts of
Moodle, the environment check classes need to extend the alert-*
classes.
2021-07-23 15:07:59 +08:00
Andrew Nicols 2afafa0431 Merge branch 'MDL-70427-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-07-22 11:22:56 +08:00
AMOS bot 9fb9779780 Automatically generated installer lang files 2021-07-22 00:07:33 +00:00
Víctor Déniz e08da48fbd Merge branch 'MDL-72108-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-07-21 19:28:54 +01:00
Ilya Tregubov d6bd634cc5 Merge branch 'MDL-72125-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-07-19 14:00:45 +02:00
Andrew Nicols 3fb79f7a6a MDL-72125 mod_assign: Use assign submission data generators 2021-07-19 18:41:31 +08:00
Andrew Nicols 94bdaa6b4e MDL-72125 mod_assign: Add data generator for assign submissions 2021-07-19 18:41:31 +08:00
Andrew Nicols aa1f55f1bc MDL-72125 testing: Make global $CFG available when including generators
This will remove the requirement to add the global $CFG call to the top
of generator scripts.
2021-07-19 18:41:31 +08:00
Shamim Rezaie f2a52e06e5 MDL-71672 javascript: Fix the markup in the header of YUI dialogs
Move the close button out of the element that is set as the
aria-labelledby for the dialog.
Also used h5 for the dialog titles so they are consistent with
AMD modals.
2021-07-19 16:41:52 +10:00
Shamim Rezaie 2bafc91952 MDL-71672 atto_equation: Fix the markup and the initial focused element
The initial focused element should be the first operator button.
This commit also fixes the accessibility issues that previously were
wrongly fixed by a redundant click on the first tab using javascript.
2021-07-19 16:41:51 +10:00
Shamim Rezaie aa3a2a43ea MDL-71672 atto_managefiles: Focus the first file manager button 2021-07-19 16:41:51 +10:00
Shamim Rezaie a7c9576c20 MDL-71672 atto_emojipicker: Focus the search bar initially 2021-07-19 16:41:51 +10:00
Shamim Rezaie 321c443838 MDL-71672 atto_recordrtc: focus Atto button after hide 2021-07-19 16:41:51 +10:00
Shamim Rezaie c34bd1aa46 MDL-71672 javascript: Fix the issue of focusOnShowSelector being ignored
When focusOnShowSelector is not present, as a fallback, focus the first
focusable element in YUI dialogues
Ref:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/dialog_role
2021-07-19 16:41:51 +10:00
Mikel Martín 46225f323a MDL-71152 theme_boost: Use 'scroll-margin-top' for anchor links
Current anchor link offset fix is not working with 'display:flex' elements
2021-07-16 11:56:24 +02:00
boygr49p 5cadd35f14 MDL-71500 calendar_threemonth: add behat step and coverage 2021-07-16 15:08:27 +08:00
boygr49p fa3f88babb MDL-71500 calendar_threemonth: clicking in a diff day should refresh day view
Clicking in a day in the three month block replaces the div with id starting
with calendar- so we can do so repeatedly and successfully and test that it does (with behat).
2021-07-16 15:08:27 +08:00
Andrew Nicols e6e1b50c31 MDL-72163 admin: Plugins overview page should link to categories 2021-07-16 13:49:43 +08:00
Andrew Nicols 2fe23b9295 MDL-72125 behat: Add get_activity_id() behat generators helper 2021-07-16 12:33:56 +08:00
Andrew Nicols c9a309ed6a MDL-72125 testing: Set a default idnumber when creating activities
The activity generator currently requires an idnumber when creating
activities, but this is not a requirement when creating the same
activity through the UI. The requirement comes because we want to
provide a way to refer to activities in subsequent steps.

This commit modifies the behaviour such that the generator uses the name
of the activity as the default idnumber.

This has two  main benefits:
1. it simplfies generation of activities; and
2. it makes the language used when writing behat tests much more natural.

With this change, steps will refer to the activity by its idnumber/title
in all cases, rather than sometimes by an idnumber which bears no
relevance to the title.
2021-07-16 12:33:56 +08:00
Andrew Nicols a247fd8d93 MDL-72125 testing: Add helper to run generators as a user 2021-07-16 12:33:56 +08:00
Thach Le Huy 7076db3492 MDL-72033 User tours: step placement issues if screen too narrow 2021-07-16 11:05:51 +07:00
abgreeve 5774e9e081 weekly release 3.11.1+ 2021-07-16 10:16:38 +08:00
abgreeve fdaeb5c7c3 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-07-16 10:16:37 +08:00
AMOS bot ff2de0df79 Automatically generated installer lang files 2021-07-16 00:07:29 +00:00
sam marshall cfb22b5591 MDL-72152 Behat: No way to test key shortcuts with letter keys
Extends the existing step 'And I press the Shift Left key' so that
it supports letter/other keys: 'And I press the Ctrl C key'.
2021-07-15 10:46:45 +01:00
Jun Pataleta 2cde9d6aff Merge branch 'MDL-63770-311' of /home/jun/moodles/stable_311/moodle into MOODLE_311_STABLE 2021-07-15 16:15:39 +08:00
Matteo Scaramuccia 15d50814c6 MDL-63770 core: 'port' should be an integer like in parse_url()
Plus trivial comment cleanup.
2021-07-15 11:39:33 +08:00
Dmitri Pisarev aa59c122df MDL-63770 core: Fix a false-positive in reverseproxyabused check
A `reverseproxyabused` error is wrongly triggered when external port number doesn't equal internal.
2021-07-15 11:39:33 +08:00
Eloy Lafuente (stronk7) 0443be1bca Merge branch 'MDL-67338-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-07-15 00:34:42 +02:00
Paul Holden de589ca25d MDL-67338 message: re-implement block page type patterns.
The `page_type_list` method for the message component was deprecated
in 5b0769db as part of MDL-54744. However it is still required when
trying to configure blocks on any messaging pages.
2021-07-14 19:32:24 +01:00
Eloy Lafuente (stronk7) c2dd676a4e Merge branch 'MDL-72139-311' of git://github.com/cescobedo/moodle into MOODLE_311_STABLE 2021-07-14 13:59:58 +02:00
cescobedo beb13397f8 MDL-72139 core_message: Fix encoding UTF-8 in prevent unclosed tags 2021-07-14 07:41:24 +02:00
Eloy Lafuente (stronk7) 13a902faea Merge branch 'MDL-71874-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-07-13 20:38:10 +02:00
Sara Arjona 7487cbd043 Merge branch 'MDL-71782_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-07-13 16:44:40 +02:00
Jun Pataleta f884dee7e8 Merge branch 'MDL-72036-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-07-13 16:05:36 +08:00
Sara Arjona f008960321 MDL-72036 atto_h5p: Random error with external URL
After a major upgrade was done in h5p.com, some random errors appeared
in the "H5P options are ignored for H5P URLs" scenario.
They have been fixed replacing the URL for different (which should
load quicker). As we're checking external content, no other improvement
can be done on the Moodle site.
2021-07-13 08:37:42 +02:00
Huong Nguyen f53dd9c5d2 MDL-71656 atto: Add meaningful labels to colour items
Colour chooser supported:
 - atto_fontcolor
 - atto_backcolor
2021-07-13 13:07:06 +07:00
Paul Holden e6a4dde54b MDL-70427 task: correct missing component when queuing adhoc task.
If the task belongs to a component, and doesn't have it's own
component property set then we can lazy-load it based on class
namespace.
2021-07-12 20:47:00 +01:00
Paul Holden 2a2fd7ad38 MDL-70427 admin: remove plugin adhoc tasks during uninstall. 2021-07-12 20:45:07 +01:00
Paul Holden 37716dc58e MDL-71050 h5p: account for parent languages retrieving translations.
Take account of parent languages when requesting given library
translation. For example if we are currently using "de_kids" as the
current language, we need to recurse each language pack looking for
a matching H5P translation ("de_kids" -> "de_du" -> "de").
2021-07-12 13:17:07 +01:00
AMOS bot bb4bcb120d Automatically generated installer lang files 2021-07-11 00:07:26 +00:00
Eloy Lafuente (stronk7) 2094d420e1 Moodle release 3.11.1 2021-07-10 18:56:04 +02:00
Eloy Lafuente (stronk7) 1e03249349 MDL-71782 behat: Ensure page after saving changes is there
A similar approach was followed @ MDL-67935, although the
case doesn't seem to be the same.

In any case, it's curious that all local execution are
100% passing and only CIs fail so often. Just guessing if,
maybe, there is some Chrome version factor around (we
are running older, sticky, versions @ CIs.
2021-07-10 15:50:31 +02:00
Paul Holden 1f20d8dfed MDL-71835 report_log: correct query returning user fullname from DB. 2021-07-09 13:54:18 +01:00
Paul Holden b40cf3ba54 MDL-67833 tool_customlang: break long text in component column. 2021-07-09 11:37:04 +01:00
AMOS bot a50d03fa58 Automatically generated installer lang files 2021-07-09 00:07:33 +00:00
Eloy Lafuente (stronk7) 04eaed2029 weekly release 3.11+ 2021-07-08 23:44:06 +02:00
Jun Pataleta edd769831c Merge branch 'MDL-71919-311-fix' of https://github.com/cescobedo/moodle into MOODLE_311_STABLE 2021-07-08 23:32:19 +02:00
Jun Pataleta a405f1c947 Merge branch 'MDL-70594_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-07-08 23:32:19 +02:00
cescobedo 386b1ad8a6 MDL-71919 core_message: Fix tests in message_send 2021-07-08 23:32:19 +02:00
Huong Nguyen cb48219537 MDL-71922 file: Enhance endless recursion requests protection 2021-07-08 23:32:19 +02:00
cescobedo 1f45155354 MDL-71919 core_message: Fix unclosed html tags in email notification 2021-07-08 23:32:19 +02:00
Paul Holden 17bbd8e109 MDL-71957 auth_shibboleth: safer session retrieval during logout. 2021-07-08 23:32:19 +02:00
Eloy Lafuente (stronk7) fa012b1b3c MDL-70335 behat: Ensure the scenario passes under all themes
Also, get rid of not needed @javascript tag
2021-07-08 23:32:19 +02:00
Dongsheng Cai ecae6484a4 MDL-71978 core_calendar: only allow owner to edit user subscriptions 2021-07-08 23:32:19 +02:00
Adrian Greeve 3a2b3ac3e0 Merge branch 'MDL-71887-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2021-07-08 23:32:19 +02:00
Paul Holden e3343c280d MDL-71760 admin: escape identity fields in token management table. 2021-07-08 23:32:19 +02:00
Paul Holden 9360ddef14 MDL-71898 mod_quiz: escape user identity fields on override pages. 2021-07-08 23:32:19 +02:00
Mihail Geshoski ee4a1fb8d4 MDL-58393 core: Remove firstname argument from emailconfirmation string 2021-07-08 23:32:19 +02:00
Sujith Haridasan c750bd273b MDL-71241 course: Validate and sanitize sort arguments
Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-07-08 23:32:10 +02:00
Mihail Geshoski c4b65df459 MDL-71242 core_course: Test the validation of the sort value
Adds new unit test, test_course_get_recent_courses_sort_validation(),
which is reponsible for testing the validation of the sort value in
course_get_recent_courses().
2021-07-08 23:32:10 +02:00
Mihail Geshoski 4d2f6a1d08 MDL-71242 core_course: Update test_course_get_recent_courses() unit test
Adds additional assertions in test_course_get_recent_courses() test to
ensure that the sort funcionality works as expected.
2021-07-08 23:32:10 +02:00
Mihail Geshoski db6340a0e1 MDL-71242 core_course: Validate the value of the sort argument
This change validates the value of the sort argument in
course_get_recent_courses().
2021-07-08 23:31:50 +02:00
Andrew Nicols d2cd91224f MDL-72108 js: Fix incorrect jsdoc examples for core/ajax 2021-07-08 10:39:44 +08:00
Claude Vervoort 5e64128392 MDL-71887 mod_lti: repost when no cookie due to crosssite request 2021-07-07 14:17:51 +08:00
Michael Hawkins 15264e5d9a MDL-71916 lib: Check cURL redirects for blocked URLs before following 2021-07-06 23:45:41 +02:00
Eloy Lafuente (stronk7) 01a23b30ca Merge branch 'MDL-70638-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-07-06 20:21:25 +02:00
Eloy Lafuente (stronk7) bf5e9b7aec Merge branch 'MDL-70335-311' of https://github.com/juancs/moodle into MOODLE_311_STABLE 2021-07-06 20:18:33 +02:00
Eloy Lafuente (stronk7) f70a99543d Merge branch 'MDL-71537-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-07-06 20:16:28 +02:00
Paul Holden 9ed376448f MDL-70638 user: correct access checks when serving profile files.
Requests for files from a users profile file area should follow
the same access checks as for the profile itself.
2021-07-06 10:28:22 +01:00
cescobedo 06d74009ba MDL-71917 core_message: Use $USER in WS delete_message_for_all_users 2021-07-06 13:33:39 +08:00
Thach Le Huy ed48e5149b MDL-71537 User tours: Minor display errors on mobile 2021-07-06 09:34:25 +07:00
Paul Holden 318528af1a MDL-71981 user: escape identity fields if writer supports HTML. 2021-07-06 09:28:01 +08:00
Paul Holden fb18ed8256 MDL-71981 dataformat: indicate HTML support in writer callback. 2021-07-06 09:28:01 +08:00
Ilya Tregubov 0d13cd3f29 Merge branch 'MDL-71796-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-07-05 12:35:35 +02:00
Simey Lameze 4fc4c6b54b MDL-71796 mod_scorm: fix custom completion logic 2021-07-05 17:47:44 +08:00
Eloy Lafuente (stronk7) 74c605196d Merge branch 'MDL-72063-311-en_fix' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-07-04 11:02:27 +02:00
Juan Segarra Montesinos b7b5d7112f MDL-70335 mod_forum: Subscribe users from Forced to Auto mode
When a teacher changes the subscription mode from forced
subscription to auto subscription using the "cog" icon in the
forum page, users are not seen in the Show/edit current
subscribers" page.

This does not happens when done from the Edit settings page.
2021-07-03 09:51:28 +02:00
Eloy Lafuente (stronk7) 90711fb0c3 MDL-70594 environment: Apply agreed changes
- PostgreSQL 10 required.
- Exif PHP extension recommended.
2021-07-01 22:41:37 +02:00
Eloy Lafuente (stronk7) c5b76d8e54 MDL-70594 environment: 4.0 base information
This is a direct copy of the 3.11 branch to have
the changes under control in next commits.
2021-07-01 22:41:37 +02:00
David Mudrák 9dc8ec17b9 MDL-72063 lang: Use fixed strings in tests, too 2021-07-01 19:29:02 +02:00
Helen Foster b6dca70a44 MDL-72063 lang: Import fixed English strings (en_fix) 2021-07-01 19:14:53 +02:00
Ilya Tregubov aeb47889fa weekly release 3.11+ 2021-07-01 16:42:03 +02:00
Bas Brands 1f3a2943f1 MDL-71366 core_question: prevent question options overflow 2021-07-01 11:58:07 +08:00
Bas Brands ee1fc4661f MDL-71366 core_question: prevent shrinking of input radio 2021-07-01 11:58:02 +08:00
Andrew Nicols 64ce58d737 Merge branch 'MDL-72010_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-07-01 11:11:06 +08:00
Paul Holden a263679bdd MDL-71314 course: add category record snapshot to deletion event. 2021-07-01 10:31:57 +08:00
Andrew Nicols b18f066ff2 Merge branch 'MDL-68003_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-07-01 09:53:53 +08:00
Sara Arjona cdd0a7f2ae Merge branch 'MDL-67208-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-06-30 16:55:38 +02:00
Simey Lameze 35d8248b7a MDL-71789 calendar: fix subscription url validation 2021-06-30 16:29:58 +02:00
Sara Arjona debc96a0fa Merge branch 'MDL-71971-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-06-30 16:16:12 +02:00
Sara Arjona 5bd645d3b3 Merge branch 'MDL-71991_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-06-30 16:09:35 +02:00
Leon Stringer 3236bae2ed MDL-72035 csvlib: Write BOM for Excel
Add option to class csv_export_writer to prefix CSV file with UTF-8 byte
order mark (BOM).  This helps Microsoft Excel detect the file's character
encoding.
2021-06-30 15:01:11 +01:00
Tim Hunt 46ba8d9e70 MDL-68003 session timeout warning: don't show in iframes 2021-06-29 16:58:51 +01:00
Eloy Lafuente (stronk7) bd83bb57cb Merge branch 'MDL-71947-311' of https://github.com/bmbrands/moodle into MOODLE_311_STABLE 2021-06-29 11:39:34 +02:00
Sara Arjona d1b55df6d2 Merge branch 'MDL-71777-311' of https://github.com/appalachianstate/moodle into MOODLE_311_STABLE 2021-06-28 11:33:25 +02:00
Fred Woolard 80f368e8aa MDL-71777 antivirus: Use hash_from_path (sha1_file) 2021-06-25 09:50:39 -04:00
Luca Bösch 2ac36fd458 MDL-71971 mod_quiz: separate "Repaginate" and "Select multiple items" 2021-06-25 00:03:34 +02:00
Eloy Lafuente (stronk7) 911f9adccf weekly release 3.11+ 2021-06-24 23:03:13 +02:00
Eloy Lafuente (stronk7) cb2132a69e NOBUG: Fixed SVG browser compatibility 2021-06-24 23:03:09 +02:00
Eloy Lafuente (stronk7) e98fa251a7 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-06-24 23:03:08 +02:00
Tim Hunt 784fd2857f MDL-72010 quiz: prevent session timeouts during attempts 2021-06-24 12:25:50 +01:00
Bas Brands e5400da73e MDL-71947 core_quiz: vertical forms for access rule popups 2021-06-24 12:32:05 +02:00
Bas Brands 64fb0a9587 MDL-71947 theme_boost: fix styles for vertical forms 2021-06-24 12:32:05 +02:00
Simey Lameze 5e5421b56d MDL-67208 calendar: fix manage subscription redirection
This patch fix the subcription page only adding the course parameter
only when viewing the calendar on course context. It also passes the
url to the form instance, so we have the course parameter on the
form action attribute.
2021-06-24 17:00:04 +08:00
Tony Butler 6d175e1769 MDL-71694 assignfeedback_comments: Behat test for feedback preservation
Including efficiency improvements from https://github.com/davosmith
2021-06-24 12:02:47 +08:00
Tony Butler e6f453376b MDL-71694 assignfeedback_comments: Fill latest submitted comment data
Otherwise if grading validation fails, any new/updated comments are
lost and replaced with previously saved data (or an empty editor).
2021-06-24 12:02:46 +08:00
Andrew Nicols c54bf071a1 Merge branch 'MDL-71837-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-06-24 10:59:57 +08:00
Andrew Nicols 4e9bef0197 Merge branch 'MDL-55243-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-06-24 10:56:11 +08:00
Huong Nguyen 29f384fd91 MDL-55243 files: Make is_valid_image support SVG files 2021-06-24 09:03:23 +07:00
Eloy Lafuente (stronk7) 2f07a9416b Merge branch 'MDL-71593-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-06-23 23:35:15 +02:00
Daniel Neis Araujo f699d8ee39 MDL-71999 enrol: enrol_imsenterprise_allow_group_member_remove global 2021-06-23 13:21:24 -03:00
Andrew Nicols a0e267c9a5 MDL-71669 editor_atto: Rebuild editor_atto/events 2021-06-23 14:48:33 +08:00
Andrew Nicols e57e76096f Merge branch 'MDL-71669-311' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-06-23 14:07:13 +08:00
Jun Pataleta 335e628e27 MDL-71669 atto_table: Set appropriate ARIA roles for table button
The table button can become a menu button when the cursor's position
in the editor is within a table. So we'd need to update the button with
ARIA attributes appropriate for a menu button.
This is best done when the button's highlight gets toggled, so we're
adding an event listener for when this happens and add/remove the ARIA
attributes accordingly.
2021-06-23 13:10:16 +08:00
Jun Pataleta 2874db9bd5 MDL-71669 editor_atto: Fire custom event when toggling button highlight 2021-06-23 13:10:16 +08:00
Jun Pataleta 408a698eef MDL-71669 editor_atto: Create an events module for the atto editor 2021-06-23 13:10:16 +08:00
AMOS bot 254f3d34c6 Automatically generated installer lang files 2021-06-23 00:07:31 +00:00
Dongsheng Cai 9a50919cbc MDL-71029 forum: fix post count for users have more than 1 enrolment 2021-06-23 09:44:05 +10:00
Tim Hunt 54197c12d2 MDL-71991 files: check return value of rename when writing files 2021-06-22 19:37:28 +01:00
Víctor Déniz 0cc154a14c Merge branch 'MDL-71634-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-06-22 18:38:19 +01:00
Sara Arjona ae9c02762e Merge branch 'MDL-70750-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-06-22 10:21:05 +02:00
Andrew Nicols 2f36d545a5 Merge branch 'MDL-70233-alternative-disabled-cache-311' of https://github.com/Peterburnett/moodle into MOODLE_311_STABLE 2021-06-22 15:47:41 +08:00
mohalisad 480ceb3b10 MDL-71973 analytics cli: fix enabling model bug
Fix the exception at line 143 caused by wrong argument for constructor in line 140
2021-06-21 18:51:10 +04:30
Ilya Tregubov 69b3669a64 MDL-71593 oauth2: Remove methods that were readded by mistake. 2021-06-21 10:12:45 +02:00
Ilya Tregubov b818405c99 MDL-70750 mod_survey: Fix warning for undefined offset. 2021-06-21 08:42:28 +02:00
Eloy Lafuente (stronk7) bafd525ebe Merge branch 'MDL-71113-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-06-19 18:03:03 +02:00
AMOS bot 9fc53b4428 Automatically generated installer lang files 2021-06-19 00:07:33 +00:00
Jun Pataleta c4b00efba1 MDL-71669 editor_atto: Set proper roles to toolbar menus
* Menu button fix
  - Added aria-haspopup, aria-controls, and aria-expanded attributes.
* Menu fixes
  - Added aria-labelledby that points to the menu button label.
  - Removed the dialog role in the menu's container.
  - The ul tag needs the "menu" role.
  - The li tag needs the role "none" instead of the "presentation" role

Reference:
https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton
2021-06-18 15:20:52 +08:00
Andrew Nicols 613cd69cbd MDL-71113 javascript: Improve basic JS Documentation 2021-06-18 09:38:05 +08:00
Andrew Nicols e214af5720 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Andrew Nicols 43ae52cbf8 MDL-71113 js: Bare minimum fixes to build jsdoc 2021-06-18 09:38:04 +08:00
Andrew Nicols b811a22f86 MDL-71113 js: Add jsdoc configuration and Grunt 2021-06-18 09:38:04 +08:00
AMOS bot 25a35fc5ac Automatically generated installer lang files 2021-06-18 00:07:31 +00:00
Luca Bösch 77504691d5 MDL-71634 course: Do not show "Your progress" info any more. 2021-06-17 19:22:12 +02:00
Víctor Déniz 0e64d1d00d weekly release 3.11+ 2021-06-17 14:54:56 +01:00
Andrew Nicols 5ef3bfa683 Merge branch 'MDL-71813-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-06-17 11:28:34 +08:00
Andrew Nicols e66cd8b30d Merge branch 'MDL-71926-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-06-17 10:45:02 +08:00
Eloy Lafuente (stronk7) 86b801358a Merge branch 'MDL-71896-311' of git://github.com/merrill-oakland/moodle into MOODLE_311_STABLE 2021-06-17 00:11:36 +02:00
Eloy Lafuente (stronk7) afe6b6914c Merge branch 'MDL-71888-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-06-17 00:08:12 +02:00
Eloy Lafuente (stronk7) 383fcbbfb2 Merge branch 'MDL-71736-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-06-17 00:01:50 +02:00
Andrew Nicols 56efe6f9e3 Merge branch 'MDL-71804_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-06-15 11:27:08 +08:00
Peter Dias 6c5b6ab10c MDL-71926 core: Check capabilities before adding link
Check whether the user has the capability to manage courses before adding any link
2021-06-15 08:41:53 +08:00
Eloy Lafuente (stronk7) 3b90b7da11 MDL-71804 travis: Bump to bionic 2021-06-13 22:53:36 +02:00
abgreeve 70f99ddd9a weekly release 3.11+ 2021-06-11 13:52:12 +08:00
abgreeve a3ef910dcf Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-06-11 13:52:11 +08:00
Eric Merrill c5f16df579 MDL-71896 dml: Add auroramysql to config-dist 2021-06-10 15:30:25 -04:00
Sujith Haridasan b5cd2c809b MDL-68915 core_form: Fix the behat test failure
Fix the behat test failure for the forums when
grades exist.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-06-10 15:04:05 +08:00
Adrian Greeve 881ec9371b Merge branch 'MDL-71369-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-06-10 11:50:08 +08:00
Andrew Nicols 430f220649 Merge branch 'MDL-71838_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-06-10 11:42:44 +08:00
Adrian Greeve 588db816c9 Merge branch 'MDL-68915-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2021-06-10 11:36:16 +08:00
Adrian Greeve 2048fa0397 Merge branch 'MDL-64236-311' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-06-10 11:28:38 +08:00
Sujith Haridasan ee1b33a480 MDL-68915 lesson: Do not allow maxgrade change
Do not allow maxgrade change when some of the
users are already graded. As of now this is applicable
to the following activities:
1. Forum
2. Database
3. Lesson
4. Glossary

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-06-10 08:32:23 +05:30
Andrew Nicols a14f5eb8ba Merge branch 'MDL-71559-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-06-10 10:58:33 +08:00
Adrian Greeve 02bff36c41 Merge branch 'MDL-71682-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-06-10 10:52:43 +08:00
Andrew Nicols 6774412034 Merge branch 'MDL-71832-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-06-10 10:41:31 +08:00
Andrew Nicols e4f9f7ddea Merge branch 'MDL-71836-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-06-10 09:19:04 +08:00
Andrew Nicols 42dc1464df Merge branch 'MDL-70846-311' of https://github.com/dcai/moodle into MOODLE_311_STABLE 2021-06-10 08:41:34 +08:00
AMOS bot 000065610d Automatically generated installer lang files 2021-06-10 00:07:26 +00:00
Paul Holden 71300b78a6 MDL-71888 admin: define clitablesexist string used by CLI installer. 2021-06-09 22:06:10 +01:00
Andrew Nicols 022e9ab852 MDL-71736 javascript: Run the ignorefiles command more liberally 2021-06-09 19:11:53 +08:00
Andrew Nicols 4abe3027d8 MDL-71874 behat: Show warning when using add to section without js 2021-06-09 16:27:19 +08:00
abgreeve dbde80d859 Merge branch 'MDL-67975-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2021-06-09 16:13:57 +08:00
Sujith Haridasan 23f7bdc9a2 MDL-67975 nextcloud: Add support for Link to file
This change set would bring the following new additions
to the nextcloud repo:
1. Create a new radio button in filepicker: "Link to file"
2. When user clicks this radio button a warning message
   would be created, saying this file would become public.
   Meaning a public link is created in the nextcloud server.
3. Created a sync_reference method to sync the files downloaded
   from nextcloud server. The sync/refresh time given is 1 day/24 hours.
4. Made sure that when the file is downloaded, we use the file
   from moodledata file pool.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-06-09 13:38:07 +05:30
Andrew Nicols a40c30b0be Merge branch 'MDL-65637-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-06-09 13:27:06 +08:00
Eloy Lafuente (stronk7) d9ee747e0b Merge branch 'MOODLE_311_MDL-71471_v2' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-06-07 20:15:02 +02:00
Mikhail Golenkov 4be14f2d27 MDL-71471 assign: Remove submission from queue when converted in web 2021-06-04 15:21:51 +10:00
Eloy Lafuente (stronk7) 193a0a6189 weekly release 3.11+ 2021-06-03 23:56:11 +02:00
Eloy Lafuente (stronk7) b7e345a7eb Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-06-03 23:56:07 +02:00
sam marshall 52636524d4 MDL-71559 core_user: Fields support for PROFILE_VISIBLE_TEACHERS 2021-06-03 11:24:24 +01:00
Andrew Nicols 328577f89b Merge branch 'MDL-71741-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-06-03 11:51:31 +08:00
Huong Nguyen da14398a88 MDL-71741 portfolio: Reset header information between requests
The reset process also removes the CURLFile option in the HTTP object,
which will avoid the serialisation issue on PHP7.4 and upward
2021-06-03 10:51:16 +07:00
Huong Nguyen 63a05f4f1f MDL-71741 portfolio: Use the correct configurations 2021-06-03 10:51:16 +07:00
abgreeve 6e8ccc0851 Merge branch 'MDL-71284-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-06-03 11:42:31 +08:00
Andrew Nicols 05af1f4404 Merge branch 'MDL-71668-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-06-03 11:34:09 +08:00
Andrew Nicols ccac2556c9 Merge branch 'MDL-71622_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-06-03 11:20:58 +08:00
Andrew Nicols 24e486017b Merge branch 'MDL-71737-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-06-03 11:09:21 +08:00
abgreeve 4e63264072 Merge branch 'MDL-71693-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-06-03 10:18:27 +08:00
abgreeve a7c2b6d33c Merge branch 'MDL-71644-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-06-03 09:25:10 +08:00
Eloy Lafuente (stronk7) bd512aa401 Merge branch 'MOODLE_311_MDL-71438_v2' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-06-02 23:52:16 +02:00
Paul Holden 73ac5eb4d6 MDL-71682 course: remove deprecated non-AJAX activity chooser call.
The deprecated method to render the dropdown based activity chooser
from 430746d3 was still being called, which produced debugging on
the site when doing so.
2021-06-02 21:07:34 +01:00
Paul Holden 3ed05ecf8c MDL-71837 calendar: turn off export form double submit protection. 2021-06-02 19:53:02 +01:00
Tim Hunt 490b59a7b3 MDL-71838 quiz reports: average rows calc can run out of memory
Should not use get_records when you mean record_exists.
2021-06-02 16:49:34 +01:00
sam marshall d7434abe97 MDL-71836 core_enrol: Cannot search for users by username 2021-06-02 14:53:49 +01:00
Mikhail Golenkov d36305b090 MDL-71438 blocks: Add index on mdl_user_preferences.name 2021-06-02 22:12:40 +10:00
sam marshall b0be8281b6 MDL-71832 core_admin: Browse users page, sort by custom field fails
The failure was because the sort parameter in URL is like
profile_field_xx, but PARAM_ALPHANUM strips the _ symbols.
2021-06-02 12:06:44 +01:00
Shamim Rezaie 33cb9e8af0 MDL-71668 editor_atto: Accissibility focus styling for Atto buttons
Make all Atto buttons consistent in the way they show the focus outline
2021-06-02 17:11:52 +10:00
Peter Dias a593731e7c MDL-65637 core_oauth2: Introduce a new custom linkedin oauth2 client 2021-06-02 08:13:20 +08:00
Peter Dias 6f411ad4c7 MDL-65637 core_oauth2: Create new oauth2 mapping function
Separated userinfo mapping into a function and new unit test
2021-06-02 08:12:10 +08:00
Andrew Nicols b4d899d0d3 Merge branch 'MDL-71731_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-06-01 12:47:53 +08:00
hiendinh a31db6d88a MDL-71813 filepicker: view file not available using keyboard (Enter) 2021-05-31 18:22:21 +07:00
AMOS bot 46a444beb5 Automatically generated installer lang files 2021-05-29 00:07:26 +00:00
Huong Nguyen b17d54b307 MDL-71737 portfolio: Make is_valid_image become internal function 2021-05-28 15:07:19 +07:00
Dongsheng Cai e280853f7a MDL-70846 accessibility: update color to increase contrast 2021-05-28 12:49:56 +10:00
Dongsheng Cai a246699a2b MDL-70846 accessibility: update tree attributes to pass a11y check
- Move aria-* atrributes from <p> to <li>
- Move "role" attribute from <p> to <li>
- Update behat tests

Based on reference implementation from:
- https://www.w3.org/TR/wai-aria-practices-1.1/examples/treeview/treeview-2/treeview-2a.html
- https://www.w3.org/WAI/GL/wiki/Using_ARIA_trees
2021-05-28 12:49:56 +10:00
Luca Bösch a62fc597a7 MDL-71284 assign: prevent double escaping assignment name. 2021-05-27 20:30:49 +02:00
Eloy Lafuente (stronk7) b93c667bf6 MDL-71731 phpunit: isolate tests requiring lots of peak mem
It's mostly addDocuments(), used by test_add_document_batch_large()
with 100 big documents what requires a lot of ram
although apparently, it's freed (partially) once ended.
Just the peak usage remains high. In any case, isolating that
test to avoid the non-freed side of it to consume too
much memory for the rest. (We allow "only" 2GB).

Still, I think that there is a good work about to detect which
tests are leaking / consuming too much, I'd bet there are
a bunch running completely out of control.
2021-05-27 19:42:26 +02:00
Eloy Lafuente (stronk7) 5d3c294eeb MDL-71622 behat: use own fork of friends-of-behat/mink-extension
Upstream behat/mink-extension isn't updated since 2018.

So we switch to friends-of-behat/mink-extension until
upstream situation is clarified.

But friends-of-behat/mink-extension has some PHP8 issues
that, at the time of writting this, have not been solved:

- https://github.com/FriendsOfBehat/MinkExtension/pull/9

So we are temporarily changing to one fork:

https://github.com/moodlehq/MinkExtension

Whenever those issues are solved by friends-of-beha or behat
we will change back to them and remove our fork.

Generated with composer 2.x and PHP 7.3
2021-05-27 19:42:18 +02:00
Sara Arjona 2d82188d89 weekly release 3.11+ 2021-05-27 17:45:09 +02:00
Sara Arjona b84c90b8aa Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-05-27 17:45:07 +02:00
Sara Arjona 0d4dd9d891 Merge branch 'MDL-69703-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-27 12:25:01 +02:00
Paul Holden e2f4bddc6d MDL-69703 theme_boost: ensure multi-select options take all space. 2021-05-27 10:45:48 +01:00
Sara Arjona 6bd128b714 Merge branch 'MDL-71145-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-05-27 11:37:07 +02:00
Huong Nguyen 67ca5af409 MDL-71145 qtype_ddmarker: Fix Behat failure 2021-05-27 15:29:25 +07:00
Andrew Nicols 2a7cd2b0d8 Merge branch 'MDL-69703-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-27 12:05:58 +08:00
Andrew Nicols 12db5d25fe Merge branch 'MDL-71637-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-05-27 11:53:25 +08:00
Andrew Nicols 96c52f32ae Merge branch 'MDL-71047-3.11' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-05-27 11:18:34 +08:00
Andrew Nicols cd5c2bd341 Merge branch 'MDL-71462-MOODLE_311_STABLE' of https://github.com/SysBind/moodle into MOODLE_311_STABLE 2021-05-27 09:54:07 +08:00
Andrew Nicols 2b3c70eee8 Merge branch 'MDL-67771-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-05-27 09:45:00 +08:00
Andrew Nicols 39151da155 Merge branch 'MDL-71145-311' of git//github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-05-27 09:39:53 +08:00
AMOS bot 2ab19a8c46 Automatically generated installer lang files 2021-05-27 00:07:27 +00:00
Eloy Lafuente (stronk7) 311519306c Merge branch 'MDL-71159-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-05-26 18:47:55 +02:00
Peter Dias 04e0c75456 MDL-71637 core: Set default for mb_substitute_character 2021-05-26 14:19:59 +08:00
Mihail Geshoski 73d596570b MDL-64236 gradereport_grader: Add padding to content in grader report
In certain operative systems the browser's scrollbar may partly cover
the content in the student header and user cells when horizontally
scrolling through the table contents. This is most noticeable when in
RTL mode. Adding slight padding on the left (or right in RTL mode) to
the content in these cells would fix this UI issue.
2021-05-26 13:47:39 +08:00
Andrew Nicols 14a0882662 Merge branch 'MDL-71628-311' of https://github.com/nguyenphuctien/moodle into MOODLE_311_STABLE 2021-05-26 10:39:02 +08:00
Sara Arjona 97f3b0cf17 Merge branch 'MDL-68925_311' of git://github.com/mdjnelson/moodle into MOODLE_311_STABLE 2021-05-25 15:34:30 +02:00
Tien Nguyen 57d66da1a5 MDL-71628 quiz: Quiz review: names not shown on Manual grading screens 2021-05-25 16:30:20 +07:00
Eloy Lafuente (stronk7) fa9e5f890a Merge branch 'MDL-71659-311-missinggradeitem' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-05-24 23:23:08 +02:00
Paul Holden 372924b4a8 MDL-69703 theme_boost: remove right padding for multi-selects.
This removes the whitespace obscuring longer option elements when
selected, particularly on narrow screens.
2021-05-24 15:56:44 +01:00
avi 8b4eff6fbd MDL-71462 core: Add phpstorm metadata file to gitignore 2021-05-24 15:54:45 +03:00
AMOS bot 3fc9bf8350 Automatically generated installer lang files 2021-05-24 00:07:26 +00:00
AMOS bot 0fd372707a Automatically generated installer lang files 2021-05-23 00:07:23 +00:00
Andrew Nicols 2a2e548f4c MDL-71369 admin: Apply form change checker to admin/category view 2021-05-21 09:58:16 +08:00
Huong Nguyen 9c4948a892 MDL-71145 qtype_ddmarker: Incorrect marker positions in responsive mode 2021-05-21 08:47:37 +07:00
Jun Pataleta 44257ec096 Merge branch 'MDL-60431_311' of https://github.com/jonof/moodle into MOODLE_311_STABLE 2021-05-21 08:57:20 +08:00
Jonathon Fowler f2c9e1728e MDL-60431 qtype_calculated: handle NAN and INF calculation outcomes
With significant-digits presentation mode, NAN would be formatted as
'NAN' followed by zeroes, which looks silly, and +INF would cause an
execution timeout as Moodle tries to divide +∞ by 10 until it becomes
less than 1, which can happen in a divide-by-zero situation.

Note that the user can't answer NAN or INF to any question, but at this
at least now looks consistent and also doesn't break Moodle in the case
of +INF.
2021-05-21 09:35:40 +10:00
Paul Holden 48c7b4a1fe MDL-71693 admin: set default for debugdisplay to off.
The previous default value for this config was based on the
PHP ini file `display_error` property (6349a3ba). However we
override this propertly during page setup (25338300) according
to the value of the configuration itself.

This had the effect of always setting the default value for
this config to it's current value.
2021-05-20 21:39:36 +01:00
Sara Arjona beefea6bad weekly release 3.11+ 2021-05-20 11:09:04 +02:00
Sara Arjona 1f2f52d949 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-05-20 11:09:01 +02:00
Peter Dias 18fe7a38d3 MDL-67771 theme: Add side-post to incourse views 2021-05-20 15:15:09 +08:00
Mark Nelson 99c43cae2c MDL-68925 assignfeedback_editpdf: avoid hiding comments with a menu open
Co-authored by: Jonathon Fowler <fowlerj@usq.edu.au>
2021-05-20 13:16:06 +08:00
Jun Pataleta bb662a7dc4 Merge branch 'MDL-71157-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-05-20 12:29:58 +08:00
abgreeve 98b407a0ba Merge branch 'MDL-65203-311' of https://github.com/dcai/moodle into MOODLE_311_STABLE 2021-05-20 11:05:58 +08:00
Andrew Nicols 09df41a8ac Merge branch 'MDL-71647-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-20 10:49:34 +08:00
Thong Bui 95974314dd MDL-71644 Quiz: The issues outstanding from MDL-70947.
Issue 1: While essay question's uploading progress, we need to disable submit
buttons to prevent submit form event.

Issue 2: Enable buttons after pressing cancel button on the popup
confirming overwrite file existed.
2021-05-20 08:32:50 +07:00
Andrew Nicols 33c9dde707 Merge branch 'MDL-71626-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-20 09:32:19 +08:00
Eloy Lafuente (stronk7) 0fc5c86d42 Merge branch 'MDL-71126-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-05-19 23:03:13 +02:00
Eloy Lafuente (stronk7) b4dee39b4c Merge branch 'MDL-67935-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-05-19 22:50:21 +02:00
Eloy Lafuente (stronk7) 5f0b872a5d Merge branch 'MDL-71373-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-05-19 19:37:54 +02:00
Sara Arjona 88a00e6a78 MDL-71157 block_myoverview: remove wait from behat
The step "And I wait until ".block_myoverview
[data-control='next']" "css_element" exists" is not correct
because this [data-control='next'] element exists before and
after the step so, in some cases, it might cause the following
step will start earlier than expected.
As pending JS has been added, this wait steps are not required
any more.
2021-05-19 12:34:51 +02:00
Andrew Nicols 02bc9d32c3 MDL-71157 core: Pending JS in paged content bars 2021-05-19 12:34:51 +02:00
Luca Bösch a2fc77efad MDL-71373 tool_usertours: localize "previous"/"next" in user tours.
AMOS BEGIN
        CPY [previous,core],[previousstep,tool_usertours]
        CPY [next,core],[nextstep,tool_usertours]
       AMOS END
2021-05-19 09:56:08 +02:00
Luca Bösch c71c13ff70 MDL-71373 core_enrol: localize "close" in role manager. 2021-05-19 09:56:08 +02:00
Luca Bösch c0bb9750f3 MDL-71373 tool_usertours: localize "previous"/"next" in user tours. 2021-05-19 09:56:08 +02:00
Luca Bösch b739173419 MDL-71373 core_table: localize "previous"/"next" in pagination. 2021-05-19 09:56:08 +02:00
Eloy Lafuente (stronk7) 03b86c5364 Merge branch 'MDL-71619-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-18 22:59:24 +02:00
Eloy Lafuente (stronk7) bca8b8bd49 Merge branch 'MDL-71373-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-05-18 22:54:25 +02:00
David Mudrák 3d2b204283 MDL-71659 completion: Consider modules without grade_item incomplete
Activity modules may not have the associated grade_item created yet. It
used to throw fatal error in that case - even when trying to view the
course or edit the activity. So there was no easy way to recover from
this situation.

The patch is based on reasoning that an activity without grade item is
same as activity without any grades. And as such it is considered
incomplete.

A new unit test is added to cover this specific scenario. The existing
unit test is modified and it does not expect the exception any more.
There does not seem to be any good reason why this situation should be
exceptional.
2021-05-18 20:56:31 +02:00
Dongsheng Cai 5464f37017 MDL-65203 template: tab should be quoted to produce valid json 2021-05-18 20:42:17 +10:00
AMOS bot 857626bbe1 Automatically generated installer lang files 2021-05-18 00:07:36 +00:00
Paul Holden 113bef8365 MDL-71647 user: allow searching user selector by identity fields.
Fixes regression from d916cd77, which passed empty extra fields when
not including custom fields.
2021-05-17 16:07:39 +01:00
Sara Arjona 536a5a4ac5 Merge branch 'MDL-71638_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-05-17 12:44:50 +02:00
Nhan Vo 7981b16046 MDL-71047 HTML Editor (Atto): Cursor position is not correct when paste 2021-05-17 14:22:53 +07:00
Eloy Lafuente (stronk7) b23a50a063 MDL-71638 upgrade: add 3.10.0 separation line to all upgrade scripts 2021-05-16 00:00:43 +02:00
Eloy Lafuente (stronk7) 94f2d3fc4b Moodle release 3.11 2021-05-15 18:10:59 +02:00
Luca Bösch 0c3a643182 MDL-71373 core_enrol: localize "close" in role manager. 2021-05-14 14:17:47 +02:00
Luca Bösch c9be7c7c5b MDL-71373 tool_usertours: localize "previous"/"next" in user tours. 2021-05-14 14:17:47 +02:00
Luca Bösch 280ec710c7 MDL-71373 core_table: localize "previous"/"next" in pagination. 2021-05-14 14:17:47 +02:00
Huong Nguyen c08dab048b MDL-71126 Quiz: Manual grading page size preference can get stuck at 0
Including in this change:
 - New positiveint regex rule to check if the value is a positive integer
2021-05-14 17:02:28 +07:00
Sara Arjona bdd30ee5b1 Moodle release 3.11rc2 2021-05-14 11:09:10 +02:00
Sara Arjona c537bd587c Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-05-14 11:09:07 +02:00
Sara Arjona 2864b51c7b MDL-67935 tool_lp: fix random errors with login/logout 2021-05-14 10:53:13 +02:00
AMOS bot 3f02adabd1 Automatically generated installer lang files 2021-05-14 00:07:33 +00:00
Víctor Déniz 439d1cf29d Merge branch 'MDL-71569_Summarydata' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2021-05-13 22:40:15 +01:00
Paul Holden e16b41d630 MDL-71626 admin: filter site fullname in CLI maintenance script. 2021-05-13 20:27:58 +01:00
Paul Holden 9d5b74865f MDL-71619 privacy: extend correct class in provider testcases.
Extending the privacy provider testcase means that it's tearDown
method will reset the request writer.
2021-05-13 20:25:03 +01:00
Sara Arjona 511986822d Merge branch 'MDL-71611-311_blockaccessreviewupgrade' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2021-05-13 11:45:41 +02:00
Jun Pataleta 3bf7557afd Merge branch 'MDL-71612-311' of https://github.com/snake/moodle into MOODLE_311_STABLE 2021-05-13 14:30:07 +08:00
Jun Pataleta 789fab146f Merge branch 'MDL-71584-311_Languagestrings' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2021-05-13 14:00:28 +08:00
Jake Dallimore aaaaf28ec2 MDL-71612 tool_oauth2: remove erroneous hideIf rules for form fields
Some fields were being hidden based on whether the service was set up
for internal service use or was a service shown on the login page.
These fields refer to OAuth 2 logins and must be configurable for both
kinds of services.
2021-05-13 12:54:01 +08:00
Eloy Lafuente (stronk7) 370a38484f Merge branch 'MDL-71580-311-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-05-12 23:00:00 +02:00
Mike Churchward 311dc0cdea MDL-71611 block_accessreview: Return formats if feature disabled. 2021-05-12 16:27:55 -04:00
David Mudrák 857d7b613f MDL-71580 lang: Fix reworded strings in tests 2021-05-12 17:11:57 +02:00
Helen Foster 5070425e99 MDL-71580 lang: Import fixed English strings (en_fix) 2021-05-12 17:11:57 +02:00
Mike Churchward 38f57b67b6 MDL-71584 tool_brickfield: Fixed up language string issues. 2021-05-12 08:42:30 -04:00
Jun Pataleta 6c3f385c8b Merge branch 'MDL-71590-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-05-12 13:25:28 +08:00
Huong Nguyen 8a4a205bb5 MDL-71590 usertours: Create language string for activity information 2021-05-12 11:30:54 +07:00
Jake Dallimore c2d7d4cf35 Merge branch 'MDL-71583_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-05-12 10:36:01 +08:00
Karen Holland 66a7400dcf MDL-71569 Accessibility toolkit: Fix Summary data task failure 2021-05-11 19:44:41 -04:00
Eloy Lafuente (stronk7) 0524a0b9f9 MDL-71583 versions: Add all the missing full-stops to version/requires
It seems that the new phpcs3 checker is now controlling those
line comments that previously were ignored.

This commit just looks for all the cases and bulk-add
them when needed. The bash script (mac) used to add all them is:

while read -r line; do
    arr=(${line//:/ })
    if [[ -n ${arr[0]} ]] && [[ -n ${arr[1]} ]]; then
        echo "  file ${arr[0]}, line ${arr[1]}"
        sed -i "${arr[1]}s/\$/\./" ${arr[0]}
    fi
done < <(find . -name version.php | xargs ag --nomultiline '>(version|requires) *=.*//.*[^;\.]$')
2021-05-11 20:00:11 +02:00
Eloy Lafuente (stronk7) ab8275f28f MDL-71583 versions: main version bump 2021-05-11 18:50:49 +02:00
Eloy Lafuente (stronk7) 71d0cfefab MDL-71583 versions: bump all versions and requires near release
version = 2021051700 release version
requires= 2021051100 current rc1 (week7roll1) version

Note that, because we are under parallel development period,
this is being done in the branch that is going to be released
(MOODLE_311_STABLE already existing) for Moodle 3.11.0 and
not in master, that is the one getting the bump under normal
(non-parallel) periods.
2021-05-11 18:50:34 +02:00
Sara Arjona 62142a081a Moodle release 3.11rc1 2021-05-11 12:43:50 +02:00
Sara Arjona 7fa14d7439 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-05-11 12:43:47 +02:00
AMOS bot 9f2e86e07c Automatically generated installer lang files 2021-05-11 00:07:34 +00:00
Thong Bui 6af383f5b4 MDL-71060 Questions: Duplicates 'Current category' text. 2021-05-10 23:25:12 +01:00
Víctor Déniz c53a0816c4 Merge branch 'MDL-70900_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-05-10 22:46:30 +01:00
Víctor Déniz 773e8b6cda Merge branch 'MDL-71543-311_toggleicon' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2021-05-10 22:18:35 +01:00
Sara Arjona e62225b1f5 Merge branch 'MDL-71570-311' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-05-10 15:38:30 +02:00
Sara Arjona 7969291581 Merge branch 'm311_MDL-71533' of git://github.com/danmarsden/moodle into MOODLE_311_STABLE 2021-05-10 11:38:05 +02:00
Jun Pataleta e4a811ab21 Merge branch 'MDL-71552-311_heatmaptoggle' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2021-05-10 17:23:11 +08:00
Mihail Geshoski f78e9f3ffe MDL-71570 mod_forum: Avoid using deprecated string in forum templates 2021-05-10 12:22:11 +08:00
Mihail Geshoski f0351e4d95 MDL-71570 core_grades: Avoid using deprecated string in grade templates 2021-05-10 12:22:10 +08:00
Víctor Déniz ec21302c3c Merge branch 'MDL-71544-311_Errorspage' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2021-05-08 20:20:57 +01:00
Eloy Lafuente (stronk7) 09febbd51b MDL-70900 ci: Move highest PHP to 8.0 (from current 7.4)
Also adds xmlrpc-beta from PECL (PHP8 moved the extension there)
and setups max_input_vars=5000 as initial value (see MDL-71390).

Note that this also includes a tiny modification when configuring
redis sessions, because there was some outdated code from old issue,
now fixed (MDL-60978), so that info has been removed.
2021-05-07 17:43:22 +02:00
Eloy Lafuente (stronk7) 61f9d3cac6 Moodle release 3.11beta 2021-05-07 16:55:23 +02:00
Eloy Lafuente (stronk7) 3f9c0f2174 NOBUG: Fixed file access permissions 2021-05-07 16:55:23 +02:00
Eloy Lafuente (stronk7) 5f4ac36853 NOBUG: Fixed SVG browser compatibility 2021-05-07 16:55:20 +02:00
Eloy Lafuente (stronk7) b1e9ba53ea Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-05-07 16:55:19 +02:00
Jun Pataleta b8cee10357 Merge branch 'MDL-71234-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-05-07 12:21:37 +08:00
Huong Nguyen 32ae33d19a MDL-71234 usertours: Create tours for the activity completion output 2021-05-07 11:16:14 +07:00
abgreeve fceb660463 Merge branch 'MDL-68747-311' of https://github.com/dcai/moodle into MOODLE_311_STABLE 2021-05-07 11:44:49 +08:00
Mathew May 709cd59808 MDL-70622 mod_lti: Tighten redirect param typing 2021-05-07 11:44:49 +08:00
Adam Olley 547ddfa39f MDL-70622 mod_lti: Prevent xss on lti 1.3 authentication script
Without this, people can craft URLs that other users might use not realising
what they do - and as a XSS vulnerability, it could do any number of things the
clicking-user has access to do on the site.

Change-Id: I82adc71e8706d8929011b4b24523d5b62b8ccea1
2021-05-07 11:44:40 +08:00
Jun Pataleta 1621c3dfe8 Merge branch 'MDL-71395-311-2' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-05-07 10:30:32 +08:00
abgreeve 07d2b976f8 Merge branch 'MDL-70181_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-05-07 10:22:10 +08:00
Dan Marsden c0e623878e MDL-71533 lib: Remove libraries that already exist in core. 2021-05-07 12:24:12 +12:00
Víctor Déniz 9cd458c3f8 Merge branch 'MDL-71303-311' of https://github.com/StudiUM/moodle into MOODLE_311_STABLE 2021-05-06 23:34:20 +01:00
Mike Churchward e514384695 MDL-71543 block_accessreview: Toggling the heatmap icon image. 2021-05-06 17:28:26 -04:00
Eloy Lafuente (stronk7) 311ca27a8b Merge branch 'MDL-70049-311_count_submissions' of https://github.com/agrowe/moodle into MOODLE_311_STABLE 2021-05-06 23:27:10 +02:00
Eloy Lafuente (stronk7) 330d34a714 Merge branch 'MDL-70772-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-06 23:20:03 +02:00
Eloy Lafuente (stronk7) 136e008a13 Merge branch 'MDL-71313_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-05-06 23:14:58 +02:00
Eloy Lafuente (stronk7) 9ad6dce459 Merge branch 'MDL-71343-m311' of https://github.com/rjnl/moodle into MOODLE_311_STABLE 2021-05-06 23:07:37 +02:00
Mike Churchward 94e6f3c84f MDL-71552 block_accessreview: Removed 'alert' class when toggling off. 2021-05-06 15:24:28 -04:00
Marina Glancy c7e3291ac8 MDL-70926 core: getuserdate() shoud show debugging if null was passed
passing null to getdate() has different results in PHP7 and PHP8
2021-05-06 20:41:16 +02:00
Sara Arjona 383848344c MDL-70110 mod_assign: make phpunit test DB order agnostic 2021-05-06 19:38:32 +02:00
Mike Churchward f136aec38f MDL-71544 tool_brickfield: Allowing text to break in table. 2021-05-06 13:10:47 -04:00
Sara Arjona e5d50dced1 Merge branch 'MDL-71491-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-06 18:42:25 +02:00
Sara Arjona 8880be478c Merge branch 'MDL-71420_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-05-06 17:58:14 +02:00
Víctor Déniz b604c15755 Merge branch 'MDL-71402-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-06 16:46:50 +01:00
Paul Holden 6972e6ec92 MDL-71491 repository_flickr: return more file data.
See also 643b0cca.
2021-05-06 16:36:42 +01:00
Sara Arjona f4bb15aee8 Merge branch 'MDL-71268-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-05-06 17:11:24 +02:00
Marina Glancy eca372eb78 MDL-71395 core: fix bug in google lib wrapper
because of changes in PHP8 the '' == 0 is no longer true and the error in the google api wrapper was discovered
2021-05-06 15:39:26 +02:00
Marina Glancy e38247449a MDL-71395 block_tag_youtube: sometimes exception may have empty message 2021-05-06 15:39:26 +02:00
Paul Holden 311c8276df MDL-71402 availability: fix group restriction button in mod form.
* The button to "Add group/grouping access restriction" under
   common module settings should only be present if corresponding
   availability plugins are enabled; and
 * Prevent the same button behaving as a submit button, which
   intercepted the user hitting return in the form and added a
   restriction without deliberate action taken by the user.
2021-05-06 14:20:34 +01:00
Eloy Lafuente (stronk7) f7aa32f2a6 MDL-71420 environment: Add some strategic comments and todos.
This isn't really a deprecations where something is replaced
by another and all uses must adapt to. Instead it's just a
fallback functionality that will stop working in Moodle 4.2.

Because of that, I've tried to add TODO/@todo comments to
the places that will need to modified, always pointing to
MDL-71421 that is where the removal will happen.

Also, haven't added any debugging() output, after thinking
a lot about it, because this isn't anything that developers
can be using but a internal implementation detail (a fallback)
that we want to remove in some versions.
2021-05-06 14:33:23 +02:00
Sara Arjona 61cfcb9253 Merge branch 'MDL-70110-311' of https://github.com/septatrix/moodle into MOODLE_311_STABLE 2021-05-06 13:16:06 +02:00
Víctor Déniz d0e0d3963b Merge branch 'MDL-71434-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-06 11:15:07 +01:00
Sara Arjona 48ac131ee1 Merge branch 'MDL-71390-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-05-06 08:02:59 +02:00
Shamim Rezaie e0e5881c12 MDL-71518 behat: Remove %P and AM/PM
The %P modifier is not supported in the macOS (MDL-71549)
2021-05-06 12:01:24 +08:00
Adrian Greeve 7d967d910f Merge branch 'MDL-70786-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-05-06 10:05:30 +08:00
Jun Pataleta e19c9ce1df Merge branch 'MDL-69863_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-05-06 10:02:14 +08:00
Andrew Davis 06395d8c8e MDL-27193 mod_glossary: reducing system setting db queries 2021-05-06 09:49:43 +08:00
Jake Dallimore 4ecd1c4716 Merge branch 'MDL-71492-311' of git://github.com/jleyva/moodle into MOODLE_311_STABLE 2021-05-06 09:16:02 +08:00
AMOS bot 791db7e4fb Automatically generated installer lang files 2021-05-06 00:07:35 +00:00
Eloy Lafuente (stronk7) 43b436c1c0 MDL-69863 database: Fix oracle and sqlsrv problems
1) The GROUP BY statement must include all fields in the SELECT
   not being aggregated or constant cols.
2) There was a missing space causing problems to databases
   using named parameters.
2021-05-06 00:03:03 +02:00
Juan Leyva 85b0b92c73 MDL-71513 mobile: Fix last access visibility 2021-05-05 22:48:58 +01:00
Eloy Lafuente (stronk7) 460fddbc0f MDL-71420 environment: Lower sodium requirement to recommended 2021-05-05 23:06:13 +02:00
Eloy Lafuente (stronk7) c89a1878f0 Merge branch 'MDL-71539_311_PHP8optionalparams' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2021-05-05 20:01:08 +02:00
Sara Arjona 27d1ba01d7 Merge branch 'MDL-71532_311_illegalwhitespace' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2021-05-05 19:05:51 +02:00
Mike Churchward f816040530 MDL-71539 tool_brickfield: PHP8 optional param error fixed. 2021-05-05 11:46:49 -04:00
Mike Churchward 96fc86a7a3 MDL-71532 tool_brickfield: Removing tabs and unneeded files. 2021-05-05 11:10:39 -04:00
Juan Leyva 1e2ab99fb6 MDL-71492 mod_quiz: Include missing gradepass in WebService 2021-05-05 14:45:43 +02:00
Sara Arjona 4e01410b9f Merge branch 'MDL-71517-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-05 12:17:38 +02:00
Sara Arjona af2b6acba6 Merge branch 'MDL-71187-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-05-05 12:14:06 +02:00
Víctor Déniz 10d776d539 Merge branch 'MDL-71460-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-05-05 10:41:54 +01:00
Luca Bösch 48d220aaa6 MDL-71187 quizaccess_seb: Change "Launch Safe Exam Browser" to a href.
In order to allow for correct seb:// or sebs:// calls without browser
warnings of insecure links, it is not possible to send a get request
with an attached cmid parameter to the unknown seb:// or sebs://
URL via a form button.
We've got to use a <a href> link outside a form to circumvent
browsers warning of an insecure link and call Safe Exam Browser
correctly.
2021-05-05 10:54:42 +02:00
Marina Glancy 1001a8fb25 MDL-71390 core: raise max_input_vars requirement 2021-05-05 10:52:11 +02:00
Luca Bösch 7ed02d2233 MDL-70786 report_loglive: respect fullname setting. 2021-05-05 10:51:51 +02:00
Leon Stringer 36a165b63b MDL-70181 database: Quote database object names
Table names and database name now enclosed in backticks.
admin/cli/mysql_collation.php failed if $CFG->prefix was blank with
MySQL 8.0 because table 'groups' conflicted with a new reserved word.

Note that this quotes both mysql_collation.php and mysql_compressed_rows.php
but only the former was mal-functioning.

The case of mysql_compressed_rows.php is a little bit special because
not all tables are processed, only those having big rows. And the groups
table is not one of them. In any case, better add the quotes there for
any future case.

Also, when testing this patch https://tracker.moodle.org/browse/MDL-71512
was discovered and will need to be fixed to make core 100% compliant
with MySQL 8.0 and MariaDB 10.6 and up.
2021-05-05 10:16:49 +02:00
Jun Pataleta 88f1fa9b0f Merge branch 'MDL-71518-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-05-05 13:26:19 +08:00
Shamim Rezaie daff66b1df MDL-71518 core: Add weekday to activity dates 2021-05-05 13:59:02 +10:00
Peter Dias bbc896bc34 MDL-71460 hub: Use checkboxes instead of dropdowns
Change the yes/no dropdowns to a checkbox. Defaults to unchecked.
2021-05-05 10:09:10 +08:00
Adrian Greeve 3723014289 Merge branch 'MDL-71530-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-05 09:30:47 +08:00
Víctor Déniz 116621f973 Merge branch 'MDL-70864-311-zip_packer_windows' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-05-05 00:03:17 +01:00
Eloy Lafuente (stronk7) 896123d130 Merge branch 'MDL-71425-311-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-05-04 23:39:40 +02:00
Eloy Lafuente (stronk7) c1473c0de0 Merge branch 'MDL-71397-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-05-04 23:37:41 +02:00
Eloy Lafuente (stronk7) 5670d351ef MDL-69863 tool_brickfield: Final version adjustments to current
In 311_STABLE, to today: 2021050400
2021-05-04 19:44:55 +02:00
Mike Churchward 749c657b50 MDL-69863 block_accessreview: Better error display. 2021-05-04 19:36:33 +02:00
Mike Churchward c0a52bc66c MDL-69863 tool_brickfield: Better instance name displayed in error list. 2021-05-04 19:36:33 +02:00
Mike Churchward a65647f3f3 MDL-69863 tool_brickfield: Add 'periodically' to data message. 2021-05-04 19:36:33 +02:00
Mike Churchward fa07b96a70 MDL-69863 tool_brickfield: Change public to private. 2021-05-04 19:36:33 +02:00
Mike Churchward 199eaa5e5b MDL-69863 tool_brickfield: Removing plugin_installed event. 2021-05-04 19:36:33 +02:00
Mike Churchward af73c3b374 MDL-69863 tool_brickfield: Language improvements. 2021-05-04 19:36:33 +02:00
Mike Churchward a134cfdfe4 MDL-69863 tool_brickfield: Adding settings page title. 2021-05-04 19:36:33 +02:00
Mike Churchward a37aaa8f20 MDL-69863 tool_brickfield: Disable analysis by default on installation. 2021-05-04 19:36:33 +02:00
Mike Churchward c8e14ad361 MDL-69863 tool_brickfield: Ensure language strings use correct case. 2021-05-04 19:36:33 +02:00
Mike Churchward 65c8f7b7f3 MDL-69863 tool_brickfield: Ensuring navigation is correct. 2021-05-04 19:36:33 +02:00
Mike Churchward b3c3fff86b MDL-69863 tool_brickfield: ensuring lang string independence. 2021-05-04 19:36:33 +02:00
Mike Churchward a83c25e80a MDL-69863 tool_brickfield: Moving plugins to core files. 2021-05-04 19:36:33 +02:00
Mike Churchward abf3cb9e3d MDL-69863 tool_brickfield: Added Behat tests. 2021-05-04 19:36:33 +02:00
Andrew Nicols 19e3ba9f07 MDL-69863 block_accessreview: Fix file mode 2021-05-04 19:36:33 +02:00
Mike Churchward 43d29ccbed MDL-69863 tool_brickfield: Adding the Brickfield toolkit. 2021-05-04 19:36:32 +02:00
Paul Holden a46acabdcf MDL-71530 competency: ensure all exported course fields are present.
Previously missing were the two new properties added in 36bc7b07:
showactivitydates & showcompletionconditions - this change ensures
all properties are requested before exporting courses linked to
competencies.
2021-05-04 17:57:45 +01:00
David Mudrák 4806989294 MDL-71425 lang: Fix reworded strings in tests 2021-05-04 17:47:01 +02:00
Paul Holden 49c74619f7 MDL-71359 mod_forum: empty forums shouldn't export anything. 2021-05-04 17:22:21 +02:00
Sara Arjona b3996aebb4 MDL-71408 h5plib_v124: Add required changes after lib upgrade
- The mbstring extension is required since Moodle 3.9 onwards so
the upgrading steps have been removed because they are not
required any more.
- The pull-request for fixing some minor PHP7.4 problems has been
integrated so this patch is not required.
2021-05-04 17:22:21 +02:00
Sara Arjona 3a1aa38bac MDL-71408 h5plib_v124: Upgrade H5P core library to 1.24.02 2021-05-04 17:22:21 +02:00
Huong Nguyen c2db084215 MDL-70720 Quiz: Improve capability checks when fetching users' best grades 2021-05-04 17:22:21 +02:00
Shamim Rezaie f4139818d1 MDL-69028 repository: Put a rate limit on draft file uploads 2021-05-04 17:22:21 +02:00
Paul Holden e806e56ebd MDL-71130 quiz_grading: escape user idnumber on display. 2021-05-04 17:22:21 +02:00
David Mudrák c54a79e9cc MDL-70804 mnet: Use proper DML method to get records from the table
This improves the code and avoids the risk of SQL injection through the
malicious XML-RPC request from the MNet peer.
2021-05-04 17:22:21 +02:00
Sara Arjona 0989db0190 Merge branch 'MDL-71274-311' of git://github.com/aanabit/moodle into MOODLE_311_STABLE 2021-05-04 17:10:42 +02:00
Helen Foster 00006816e0 MDL-71425 lang: Import fixed English strings (en_fix) 2021-05-04 16:43:13 +02:00
Paul Holden 702d0ba4c5 MDL-71517 mod_data: remove invalid form custom data access.
On PHP7.4, trying to access array offsets of NULL triggers a notice.
2021-05-04 15:35:41 +01:00
Luca Bösch cdcf6f44fc MDL-70786 report_log: respect fullname setting. 2021-05-04 15:50:36 +02:00
Luca Bösch 4874954a45 MDL-70786 report_completion: respect fullname setting. 2021-05-04 14:29:57 +02:00
Luca Bösch 7403c62aef MDL-70786 report_competency: respect fullname setting. 2021-05-04 14:29:57 +02:00
Luca Bösch 3917849965 MDL-70786 report_progress: respect fullname setting. 2021-05-04 14:29:57 +02:00
Luca Bösch c33a41a34d MDL-71268 graphics: Use new Moodle logo for RSS feeds by Moodle 2021-05-04 14:16:43 +02:00
Sara Arjona b009de3c60 on-demand release 3.11dev+ 2021-05-04 13:28:17 +02:00
Sara Arjona b38bb3b1ff Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-05-04 13:28:14 +02:00
Adrian Greeve 1f93d2bbff Merge branch 'MDL-66673-MOODLE_311_STABLE' of https://github.com/ScottVerbeek/moodle into MOODLE_311_STABLE 2021-05-04 15:48:45 +08:00
Jun Pataleta f350b8e0bd Merge branch 'MDL-71401-311-3' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-05-04 12:26:41 +08:00
Michael Hawkins c31d3450b4 MDL-71401 mod_scorm: Completion behat test fix 2021-05-04 12:22:36 +08:00
Michael Hawkins fe02e8f4ab MDL-71401 mod_quiz: Add behat testing for multiple completion conditions
Other tests check behaviour of individual conditions, this tests that
when multiple core and custom conditions are required, each will be
updated as required and not cache until all are completed.
2021-05-04 12:22:36 +08:00
Michael Hawkins 13ff928efd MDL-71401 mod_lesson: Update completion behat to test individual changes 2021-05-04 12:22:36 +08:00
Michael Hawkins ffe4a99adb MDL-71401 mod_glossary: Update completion behat to test all changes 2021-05-04 12:22:36 +08:00
Michael Hawkins 5ba3aa765d MDL-71401 mod_forum: Update completion behat to test individual changes 2021-05-04 12:22:36 +08:00
Michael Hawkins 4308462ad1 MDL-71401 mod_data: Update completion behat to test individual changes 2021-05-04 12:22:36 +08:00
Michael Hawkins 767f129dbf MDL-71401 assign: Update completion behat to test individual changes 2021-05-04 12:22:36 +08:00
Michael Hawkins 2fdf71ffc7 MDL-71401 core_completion: Fix completion status caching
When an automatic completion condition may have had its state change,
we now unset the cached value for the user's completion in the relevant
activity, so up-to-date values are re-fetched and available to students.
The previous behaviour was that custom conditions would remain cached
until the activity reached overall completion.
2021-05-04 12:22:36 +08:00
AMOS bot 127cb81416 Automatically generated installer lang files 2021-05-04 00:07:34 +00:00
Eloy Lafuente (stronk7) 6486979fe6 Merge branch 'MDL-71463-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-05-03 19:00:28 +02:00
David Mudrák d95c3a00a0 MDL-70864 files: Fix zip_packer extracting files with trailing dots
File and folder names cannot end with dots on Windows. So replace the
trailing dots with underscore consistently with how some other zip tools
(such as 7-zip) handle this case.
2021-05-03 18:06:40 +02:00
Shamim Rezaie c91c2aa744 MDL-71163 mod_lesson: Fix behat failures 2021-05-03 15:43:02 +02:00
Sara Arjona afb9462896 Merge branch 'MDL-71163-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-05-03 12:00:06 +02:00
Sara Arjona 64a1ac1148 MDL-66431 behat: fix goutte + classic failure 2021-05-03 10:08:14 +02:00
Adrian Greeve d5386da038 Merge branch 'MDL-71440-311' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-05-03 16:04:56 +08:00
Jun Pataleta ebae37ea6c Merge branch 'MDL-71454-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-05-03 15:34:03 +08:00
Mihail Geshoski 0b07c0346f MDL-71440 mod_assign: New capability for viewing the submission summary
Creates a new capability mod/assign:viewownsubmissionsummary which will
be required in order to display the submission summary to the user in
the assignment page.
2021-05-03 15:30:52 +08:00
Víctor Déniz 997d9c4468 Merge branch 'MDL-71189-311-3' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-05-03 08:17:45 +01:00
Jake Dallimore ba134b77dc Merge branch 'MDL-71273-311' of git://github.com/dpalou/moodle into MOODLE_311_STABLE 2021-05-03 14:39:34 +08:00
Simey Lameze 57c8fff41a MDL-71454 theme: fix paddings for label resource 2021-05-03 14:35:56 +08:00
Michael Hawkins de08af9e4a MDL-71189 mod_quiz: Update completion rule descriptions method
Allow for conditions that are not set, consistent with other modules.
They will usually always be set in practice, but best to handle it,
which also helps with unit testing.
2021-05-03 13:42:23 +08:00
Michael Hawkins 70b16bb87c MDL-71189 core_completion: Adding completion sort order to activities
This implements sort ordering for all completion conditions, in
activities which support custom completion conditions.
2021-05-03 13:42:23 +08:00
Michael Hawkins 30426fbe5e MDL-71189 core_completion: Implementing custom completion sort ordering
This adds the requirement for activities supporting custom completion to
specify the order all completion conditions should be displayed for that
activity. It also implements the sorting that takes place.
2021-05-03 13:42:23 +08:00
Michael Hawkins c3bd602fb0 MDL-71189 core_completion: Updates to meet current coding standards 2021-05-03 13:42:23 +08:00
Jake Dallimore 8732156670 Merge branch 'MDL-52724-311' of git://github.com/merrill-oakland/moodle into MOODLE_311_STABLE 2021-05-03 13:25:20 +08:00
Adrian Greeve d89a89c862 Merge branch 'MDL-71258_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-05-03 11:08:42 +08:00
Eloy Lafuente (stronk7) 372a6c5742 Merge branch 'MDL-66431-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-05-02 19:13:56 +02:00
Víctor Déniz 2f2f1e6798 Merge branch 'MDL-69956-311' of https://github.com/dcai/moodle into MOODLE_311_STABLE 2021-05-02 19:13:45 +02:00
Víctor Déniz 43cd8af9e0 Merge branch 'MDL-70753-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2021-05-02 19:13:44 +02:00
Ilya Tregubov 9d4f7eb9c6 MDL-66431 core: Fix lti test for classic theme. 2021-05-02 16:10:20 +02:00
Ilya Tregubov be5eff78ab MDL-66431 core: Fix behat tests.
Move activity creation to data generators. Only fixing those
tests failing due to removing usemodchooser preference.
2021-05-01 16:18:56 +02:00
Ilya Tregubov 21ecadc082 MDL-66431 core: Remove activity chooser user preference.
This commit removes activity chooser user preference and
course preference page. Separate dropdowns to activity and
resource is also removed.
2021-05-01 16:18:56 +02:00
Rajneel Totaram c217daf2a4 MDL-71343 core_h5p: Convert all line-endings to UNIX format 2021-05-01 00:05:30 +12:00
Víctor Déniz 6f48b4ab71 weekly release 3.11dev+ 2021-04-30 12:54:10 +01:00
Andrew Nicols 9a4a49f060 MDL-71343 core_h5p: Add unit test for helper::parse_js_array
Signed-off-by: Rajneel Totaram <rjnlfj@yahoo.com>
2021-04-30 23:51:56 +12:00
Mahmoud Kassaei d25f0453cf MDL-71258 questions: privacy support for settings defaults preferences 2021-04-30 10:16:14 +01:00
Shamim Rezaie 3a70953cf5 MDL-71163 mod_lesson: Remove duplicate info for open and close time 2021-04-30 17:15:54 +10:00
Shamim Rezaie 4b593aaeef MDL-71163 mod_forum: Remove duplicate due date info 2021-04-30 17:15:54 +10:00
Shamim Rezaie b23bbc2711 MDL-71163 mod_data: Remove duplicate info for open and close time 2021-04-30 17:15:54 +10:00
Shamim Rezaie cb80fa82b2 MDL-71163 mod_scorm: Remove duplicate info for open and close time 2021-04-30 17:15:53 +10:00
Shamim Rezaie 1de059a261 MDL-71163 quizaccess_openclosedate: remove duplicate date info
The quiz module now showa the quiz open and close dates at the top of
the page. So there is no need for the quizaccess_openclosedate plugin to
display these dates in the middle of the page.
2021-04-30 17:15:53 +10:00
Shamim Rezaie a1411bb562 MDL-71163 mod_feedback: remove duplicate date info
The $extradetails parameter in the constructor of the
mod_feedback\output\summary class is no longer used by any of the codes
that instantiate the class. Therefore, it is removed.
The respective template is updated as well.
2021-04-30 17:15:53 +10:00
Shamim Rezaie c49d99d1a5 MDL-71163 mod_choice: remove duplicate info for timeopen and timeclose 2021-04-30 17:15:53 +10:00
Shamim Rezaie 1abf669d99 MDL-71163 mod_assign: remove duplicate available from and due date info 2021-04-30 17:15:53 +10:00
Shamim Rezaie dcbfe15f37 MDL-71163 mod_assign: Show the selected group's dates 2021-04-30 17:15:53 +10:00
Shamim Rezaie d8a1cf696e MDL-71163 core: support relative dates in activity dates
AMOS BEGIN
 CPY [relativedatessubmissionduedateafter,mod_assign],[relativedatessubmissionduedateafter,core_course]
 CPY [relativedatessubmissionduedatebefore,mod_assign],[relativedatessubmissionduedatebefore,core_course]
AMOS END
2021-04-30 17:15:53 +10:00
Jun Pataleta 7103cf86d0 Merge branch 'MDL-71051-311' of git://github.com/abgreeve/moodle into MOODLE_311_STABLE 2021-04-30 14:18:27 +08:00
Adrian Greeve ffe3fa8ea8 MDL-71051 profilefield_datetime: Fix to missing required param.
The define_after_data method was looking for a required_param
when it should have been an optional parameter. This was causing
error messages when creating a new datetime field.
2021-04-30 13:05:35 +08:00
Dongsheng Cai 4f1c48ef54 MDL-69956 forum: throw exception when advanced grading is not ready 2021-04-30 14:59:31 +10:00
Adrian Greeve f104a01ba5 Merge branch 'MDL-71481-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-30 11:19:27 +08:00
Jun Pataleta f852b7d938 Merge branch 'MDL-71486-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-04-30 11:08:44 +08:00
Sujith Haridasan 9d60d0dd82 MDL-70753 report: Provide a separate page for course report
Provide page for the reports in the course administration.
The page has a drop down to navigate to different reports.
The navigation is remembered just like the grade reports in
the course.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-04-30 08:37:13 +05:30
Jun Pataleta 67d1960126 Merge branch 'MDL-70947-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-04-30 10:34:17 +08:00
Sara Arjona ca3f88fd1f Merge branch 'MDL-60331-311_take3' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-04-29 17:49:48 +02:00
Sara Arjona 76cda8ba33 Merge branch 'MDL-71162-311-2' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-04-29 17:27:27 +02:00
Dani Palou 185ed20456 MDL-71273 tool_mobile: Change the LTI disabled feature 2021-04-29 14:57:07 +02:00
Paul Holden e810f798ee MDL-71463 dml: escape square brackets for SQL Server LIKE operator. 2021-04-29 13:49:35 +01:00
Jun Pataleta b4edfb9031 Merge branch 'MDL-71455-311' of https://github.com/dcai/moodle into MOODLE_311_STABLE 2021-04-29 18:05:17 +08:00
Amaia Anabitarte 3d932a0fd9 MDL-71274 analytics: Don't generate insight for hidden courses
Hidden courses can be used for training
but we do not want to generate insights for them
because students do not have access to hidden courses.
This was fixed in MDL-66806 for "Students at risk" model.
Fixed for "Students who have not accessed the course recently" in this issue.
2021-04-29 11:15:34 +02:00
Paul Holden 864bf17afb MDL-71481 repository_flickr_public: return more file data.
A HTTP HEAD request is required to get the image filesize.
The remaining data can be obtained from existing calls to
the Flickr API.
2021-04-29 09:48:12 +01:00
Huong Nguyen 89fe45e38c MDL-70947 File upload: Upload protection
Interacts badly with double-submit protection, and not all uploads protected
2021-04-29 15:32:00 +07:00
Huong Nguyen feb8548a45 MDL-71486 course: Notice when in site home/course page 2021-04-29 14:43:06 +07:00
Sara Arjona d7f2abf5af Merge branch 'MDL-71016-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-29 09:21:44 +02:00
Jun Pataleta 20f2014d0d Merge branch 'MDL-70863-311' of git://github.com/jleyva/moodle into MOODLE_311_STABLE 2021-04-29 15:04:32 +08:00
Adrian Greeve cd96ef301c Merge branch 'MDL-71235-311' of https://github.com/dcai/moodle into MOODLE_311_STABLE 2021-04-29 14:41:55 +08:00
Adrian Greeve 24695a6e42 Merge branch 'MDL-71470-311' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-04-29 14:26:23 +08:00
Andrew Nicols 3bc386e69e Merge branch 'MDL-70965-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-04-29 13:51:02 +08:00
Dongsheng Cai 4104a24196 MDL-71235 webservices: add activity completion data to web services 2021-04-29 13:52:52 +10:00
Andrew Nicols 50a6634639 Merge branch 'MDL-70897-311' of git://github.com/kabalin/moodle into MOODLE_311_STABLE 2021-04-29 10:33:20 +08:00
Dongsheng Cai 0ebdf3f1b4 MDL-71455 core_backup: fix course completion options when backup/restore 2021-04-29 11:42:47 +10:00
Andrew Nicols 14add58a7f Merge branch 'MDL-56609_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-04-29 09:41:40 +08:00
Adrian Greeve 702ea8590e Merge branch 'MDL-71051-311-2' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-04-29 09:22:37 +08:00
Víctor Déniz da781a899a Merge branch 'MDL-71200-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-28 20:53:27 +01:00
Paul Holden 23f0859a9c MDL-71016 gradeexport_xml: ensure user/grade idnumbers are encoded. 2021-04-28 19:03:50 +01:00
Michael Hawkins 635a53e293 MDL-71162 mod_assign: Update and improve completion behat testing 2021-04-29 00:47:21 +08:00
Michael Hawkins 3ac450e1fc MDL-71162 mod_resource: Improve behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 5c0a2b0d7d MDL-71162 mod_label: Improve behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 0fb2ea4eef MDL-71162 mod_imscp: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins f84235eac7 MDL-71162 mod_h5pactivity: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 7b9a10b175 MDL-71162 mod_folder: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 29cb40286a MDL-71162 mod_chat: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins ef3b5d9297 MDL-71162 mod_quiz: Improve behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 619b5d1b98 MDL-71162 mod_survey: Improve behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 0773b2c4c6 MDL-71162 mod_scorm: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 5150efa190 MDL-71162 mod_glossary: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 4aec4586d3 MDL-71162 mod_wiki: Improve behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 5a9053f87e MDL-71162 mod_wiki: Ensure completion conditions displayed on all tabs 2021-04-29 00:47:21 +08:00
Michael Hawkins 0888b6b285 MDL-71162 mod_book: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 751220c3be MDL-71162 mod_forum: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 70fe3792b3 MDL-71162 mod_feedback: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins 29a02febdc MDL-71162 mod_data: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Michael Hawkins f5687b7bc6 MDL-71162 mod_data: Ensure completion conditions displayed on all tabs 2021-04-29 00:47:21 +08:00
Michael Hawkins 954ec584f2 MDL-71162 mod_choice: Updated completion behat to use latest rules 2021-04-29 00:47:21 +08:00
Michael Hawkins b04f03598a MDL-71162 mod_lesson: Add behat testing for completion conditions 2021-04-29 00:47:21 +08:00
Luca Bösch 003d17d98b MDL-60331 questions: prevent double escaping question categories. 2021-04-28 17:16:31 +02:00
Sara Arjona f65de8edfb Merge branch 'MDL-70979-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-28 13:06:12 +02:00
Sara Arjona c70efcb7ec Merge branch 'MDL-71127-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-28 12:58:22 +02:00
Marina Glancy 86d19b3474 MDL-70965 core_dml: php8 related changes:
1. pg_connection_status(false) fails on PHP8 because the argument is not a stream
2. skipeed the unittest that expected that pg_query() does not show an error if the resource is invalid
see also MDL-71482
2021-04-28 12:42:41 +02:00
Srdjan 99e536fc4c MDL-70965 core_dml: read_slave - mock db handles as resources
So they comply with the type hints.
2021-04-28 12:42:41 +02:00
Sara Arjona 2e877cd448 Merge branch 'MDL-70763-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-28 12:36:30 +02:00
Septatrix a05e94a03e MDL-70110 assign: add group submission attemptnumber test 2021-04-28 11:50:37 +02:00
Ruslan Kabalin 66e8f7a3d4 MDL-71051 core_user: fix issues and address review issues 2021-04-28 11:49:28 +02:00
Marina Glancy b597b491ec MDL-71051 core_user: create user profile field form is now modal form 2021-04-28 11:49:28 +02:00
Marina Glancy ac494c7d91 MDL-71051 core_user: move user profile edit field form to classes 2021-04-28 11:49:27 +02:00
Marina Glancy abb2c72b26 MDL-71051 core_user: editing user profiles - modal form, template 2021-04-28 11:49:27 +02:00
Marina Glancy bc74e13322 MDL-71051 core_user: move edit profile category form to classes 2021-04-28 11:49:27 +02:00
Marina Glancy 10bf851874 MDL-71051 core_user: use user profile generator in all tests 2021-04-28 11:49:27 +02:00
Marina Glancy 5ac934b1fd MDL-71051 core_user: fix mistakes in phpdocs, deprecated unused func 2021-04-28 11:49:27 +02:00
Marina Glancy 3c9e54eafa MDL-71051 core_user: always use API when working with profile fields 2021-04-28 11:49:27 +02:00
Mihail Geshoski a4bd04e892 MDL-71470 repository_googledocs: Update unit tests 2021-04-28 16:29:33 +08:00
Sara Arjona 7fae164d47 Merge branch 'MDL-71244-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-04-28 09:17:34 +02:00
Jun Pataleta e197cf24d8 Merge branch 'MDL-71330-311' of https://github.com/dcai/moodle into MOODLE_311_STABLE 2021-04-28 13:41:52 +08:00
Dongsheng Cai f628b3d1bd MDL-71330 mod_chat: Implement the activity dates functionality 2021-04-28 15:34:02 +10:00
Mihail Geshoski dbd4620365 MDL-71470 repository_googledocs: Use file name in the source attribute
Instead of using the file title when generating the source attribute,
we should be using only the name of the Google Drive file in order to
avoid having the original extension within the filename after the file
is imported and added into Moodle.
2021-04-28 12:56:46 +08:00
Andrew Nicols e3fb7862d7 Merge branch 'MDL-71168-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-28 10:50:02 +08:00
Andrew Nicols 2f1e3eada4 MDL-70909 mod_h5pactivity: Whitespace fix 2021-04-28 10:26:24 +08:00
Andrew Nicols 66131d9307 Merge branch 'MDL-70909-311' of git://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2021-04-28 10:25:44 +08:00
Andrew Nicols 6645cb3396 Merge branch 'MDL-71386-311' of git://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2021-04-28 10:15:42 +08:00
Andrew Nicols 1d7bbdfc08 Merge branch 'MDL-71389-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-04-28 09:49:48 +08:00
Eloy Lafuente (stronk7) f6062a0bf8 MDL-56609 phpunit: Fix bogus expectation on DST changes day
Current test works ok every day of the year but the day of
DST begin changes (last Sunday of March currently).

That day, 01:00 Europe/London simply doesn't exist, because
the time is moved forward by 60 minutes.

Hence the expectation for the next cron execution is not 1 "normal"
day (24h) but 1 less hour.

Note this only happens for the current test on DST begins, the
opposite change (DST ends), happening the last Sunday of October
is not affected, because, at all effects, 01:00 is a perfectly normal
and existing hour.
2021-04-27 18:30:56 +02:00
Luca Bösch 7758387005 MDL-71244 enrol_manual: Add bootstrap classes to buttons 2021-04-27 17:27:53 +02:00
Sara Arjona 89c919813e Merge branch 'MDL-71403-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-27 16:02:02 +02:00
Ferran Recio 17ee80ca64 MDL-70909 mod_h5pactivity: fix reports on freeze context 2021-04-27 15:35:39 +02:00
Sara Arjona 5b315fa595 on-demand release 3.11dev+ 2021-04-27 15:15:26 +02:00
Jun Pataleta 00dfc98251 Merge branch 'MDL-71410-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-04-27 12:36:29 +08:00
Shamim Rezaie b315affbd4 MDL-71410 core: Prevent recursively calling getters 2021-04-27 14:34:09 +10:00
Shamim Rezaie d8806cc8aa MDL-71410 mod_quiz: implement activity_dates for the quiz module 2021-04-27 14:34:09 +10:00
Shamim Rezaie d89d984048 MDL-71410 mod_quiz: Cache quiz times in modinfo for performance
We update the dates with user/group overrides. The calculation of
the override in the quiz module is different from the assignment
module as the quiz_overrides table des not have a sortorder column.
See quiz_update_effective_access().
2021-04-27 14:34:09 +10:00
Shamim Rezaie e8caa2d2a2 MDL-71410 mod_quiz: Cache user and group overrides 2021-04-27 14:34:07 +10:00
Shamim Rezaie 9bf74e7e85 MDL-71410 mod_lesson: implement activity_dates for the lesson module 2021-04-27 14:33:49 +10:00
Shamim Rezaie 5f9ca816f4 MDL-71410 mod_lesson: Cache lesson times in modinfo for performance
We update the dates with user/group overrides. The calculation of
the override in the lesson module is different from the assignment
module as the lesson_overrides table des not have a sortorder column.
See lesson::update_effective_access().
2021-04-27 14:33:49 +10:00
Shamim Rezaie 04e6d285d8 MDL-71410 mod_lesson: Cache user and group overrides 2021-04-27 14:33:47 +10:00
Shamim Rezaie b700f690ab MDL-71410 mod_assign: implement activity_dates for the assignment module 2021-04-27 14:33:28 +10:00
Shamim Rezaie 279def66dc MDL-71410 mod_assign: Cache assign times in modinfo for performance
We update the dates with user/group overrides
2021-04-27 14:33:27 +10:00
Shamim Rezaie 7b54f5b2e6 MDL-71410 mod_assign: Cache user and group overrides 2021-04-27 14:33:26 +10:00
Shamim Rezaie 8408cb1050 MDL-71410 core: Introduce override_customdata()
The get_custom_data() method now calls obtain_dynamic_data() because
$this->customdata can be dynamic now.
2021-04-27 14:32:54 +10:00
Jun Pataleta 623a3d9d1e Merge branch 'MDL-71252-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-04-27 10:40:55 +08:00
Huong Nguyen 93d00d6777 MDL-71252 completion: PHPUnit failure 2021-04-27 08:43:16 +07:00
Adrian Greeve dd9ca2ee93 Merge branch 'MDL-71329-311' of https://github.com/Chocolate-lightning/moodle into MOODLE_311_STABLE 2021-04-27 09:36:33 +08:00
Víctor Déniz 57a6625dab Merge branch 'MDL-65687-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-27 01:12:30 +01:00
Víctor Déniz 5cb1ae3c07 Merge branch 'MDL-71003-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-27 00:36:28 +01:00
Víctor Déniz 5ffa79f8d8 Merge branch 'MDL-71441-311' of git://github.com/bmbrands/moodle into MOODLE_311_STABLE 2021-04-27 00:04:56 +01:00
Sara Arjona d37145a52f Merge branch 'MDL-70917-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-26 15:18:04 +02:00
Bas Brands b1db156ec0 MDL-71441 core_user: add profilefield social to standard plugins list 2021-04-26 14:43:55 +02:00
Jun Pataleta 69f6e1e188 MDL-71252 completion: Fix Behat test for manual completion display
Adjusting the test since the manual completion button is now being
hidden from the course homepage when completion is disabled.
2021-04-26 19:53:59 +08:00
Sara Arjona 523e57fb14 Merge branch 'MDL-71416-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-26 12:35:40 +02:00
Sara Arjona 6a5b32a584 Merge branch 'MDL-71392-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-26 11:52:54 +02:00
Jun Pataleta 2d576c3b41 Merge branch 'MDL-71252-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-04-26 17:02:31 +08:00
Huong Nguyen 195ac89d7d MDL-71252 completion: Behat failure 2021-04-26 15:59:26 +07:00
Eloy Lafuente (stronk7) 51536c7cea Merge branch 'MDL-70446-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-04-26 10:45:07 +02:00
Jun Pataleta 88a5780f09 Merge branch 'MDL-71252-311' of git://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2021-04-26 15:55:04 +08:00
Sara Arjona 7b62b266fe Merge branch 'MDL-71370-311-test' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-26 09:50:47 +02:00
Huong Nguyen d3dc55b4d5 MDL-71252 completion: Avoid showing the 'Mark as done' button
The following activites will be applied:
 - Label
 - File (Force download/Open/In pop-up)
 - URL (Open/In pop-up)
2021-04-26 14:25:31 +07:00
Paul Holden 8518751467 MDL-71434 mod_data: add form control class to template textarea. 2021-04-25 18:34:58 +01:00
Paul Holden 10d853a891 MDL-71403 message: Bootstrap controls for message preferences.
Replicates changes made to notification preferences in e41b3485.
The templates for each are similar enough than one can be used
from the other. Remove redundant styles for previous controls.
2021-04-25 16:43:11 +01:00
Jun Pataleta 469e492196 MDL-71370 course: Make showcompletionconditions nullable
* When completion tracking is not enabled for the course, it does not
make sense for the course's showcompletionconditions setting to
be set according to the default value indicated by the
"moodlecourse | showcompletionconditions" admin setting. Setting
showcompletionconditions as enabled when completion tracking is disabled
makes even less sense. So in such a case, we should not be setting a
default value for showcompletionconditions and allow it to be null.

* When the course is edited and completion tracking is enabled, this
also would set the "Show completion conditions" field to default to the
value set in the "moodlecourse | showcompletionconditions" admin
setting.
2021-04-24 19:15:19 +08:00
Tim Schroeder 647c5ac8cd MDL-70110 assign: fixed ws get_submissions for groups 2021-04-24 12:10:48 +02:00
Paul Holden 95c8e10fcc MDL-71416 report_log: user context header should show users name.
Co-Authored-By: Luca Bösch <luca.boesch@bfh.ch>
2021-04-23 20:24:28 +01:00
Sara Arjona 6f890af454 Merge branch 'MDL-71144-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-04-23 13:16:10 +02:00
Marina Glancy 66a7520a7b MDL-71397 mod_glossary: empty category is the same as all categories
In PHP8 empty string is not equal to zero
2021-04-23 11:46:12 +02:00
Sara Arjona fe04d078a4 on-demand release 3.11dev+ 2021-04-23 10:47:17 +02:00
Sara Arjona 61b35eebfa NOBUG: Fixed SVG browser compatibility 2021-04-23 10:47:15 +02:00
Mathew May 37a80759ea MDL-71329 tool_moodlenet: Check to see if we get errors before curl 2021-04-23 15:48:31 +08:00
Jun Pataleta c60671bdb2 Merge branch 'MDL-71171_311' of git://github.com/mdjnelson/moodle into MOODLE_311_STABLE 2021-04-23 12:41:10 +08:00
Mark Nelson e98a902a7b MDL-71171 customfield_text: ensure we set defaults properly 2021-04-23 12:37:28 +08:00
abgreeve bdad52f522 Merge branch 'MDL-70818-311-4' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-04-23 12:18:31 +08:00
Andrew Nicols 5319d41af0 Merge branch 'MDL-70903-311' of git://github.com/roland04/moodle into MOODLE_311_STABLE 2021-04-23 11:56:59 +08:00
Andrew Nicols 9d275ebbfd Merge branch 'MOODLE_311_STABLE-MDL-71376' of https://github.com/rjnl/moodle into MOODLE_311_STABLE 2021-04-23 11:52:31 +08:00
Shamim Rezaie 57926096b8 MDL-70818 mod_workshop: implement activity_dates for the workshop module 2021-04-23 13:47:51 +10:00
Shamim Rezaie 2d19fa0d5f MDL-70818 mod_workshop: cache workshop times in modinfo for performance 2021-04-23 13:47:51 +10:00
Shamim Rezaie 1a50f27b8b MDL-70818 mod_scorm: implement activity_dates for the scorm module 2021-04-23 13:47:51 +10:00
Shamim Rezaie e6a6b08196 MDL-70818 mod_forum: implement activity_dates for the forum module 2021-04-23 13:47:50 +10:00
Shamim Rezaie 3594a90298 MDL-70818 mod_forum: cache forum times in modinfo for performance 2021-04-23 13:47:50 +10:00
Shamim Rezaie f88f792b3b MDL-70818 mod_feedback: implement activity_dates for the feedback module 2021-04-23 13:47:50 +10:00
Shamim Rezaie ec55d63ca0 MDL-70818 mod_data: implement activity_dates for the database module 2021-04-23 13:47:50 +10:00
Andrew Nicols b9d08260bd Merge branch 'MDL-71394-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-04-23 11:46:17 +08:00
Andrew Nicols 391447a3b5 Merge branch 'MDL-70970-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-23 11:38:50 +08:00
Andrew Nicols 7b21ac7a0c Merge branch 'MDL-70902-311' of git://github.com/dravek/moodle into MOODLE_311_STABLE 2021-04-23 11:17:20 +08:00
ScottVerbeek 0c9412a7fd MDL-66673 groups: Stop notice when messaging system is disabled 2021-04-23 08:54:05 +10:00
Sara Arjona 1e0742f0a4 Merge branch 'MDL-57831-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-22 18:13:10 +02:00
Paul Holden c34d739636 MDL-57831 tool_monitor: update Behat tests for message preferences. 2021-04-22 16:12:49 +01:00
Ferran Recio cd97f217b6 MDL-70909 behat: context freeze and not freeze steps 2021-04-22 15:51:36 +02:00
Sara Arjona 7ccfb2410a Merge branch 'MDL-71136_311' of https://github.com/TomoTsuyuki/moodle into MOODLE_311_STABLE 2021-04-22 13:56:43 +02:00
Shamim Rezaie 7f03204486 MDL-71144 mod_scorm: Deprecate scorm_get_completion_state() 2021-04-22 21:28:10 +10:00
Shamim Rezaie ba90a6462d MDL-71144 mod_quiz: custom_completion should not use deprecated function
This commit also removes an unnecessary DB query.
2021-04-22 21:28:10 +10:00
Shamim Rezaie 7bdff82066 MDL-71144 mod_quiz: Deprecate quiz_get_completion_state() 2021-04-22 21:28:09 +10:00
Shamim Rezaie e88a9462d1 MDL-71144 mod_lesson: Deprecate lesson_get_completion_state() 2021-04-22 21:28:09 +10:00
Shamim Rezaie 0780c6a7bd MDL-71144 mod_survey: Deprecate survey_get_completion_state() 2021-04-22 21:28:09 +10:00
Shamim Rezaie 223bee6bd0 MDL-71144 mod_glossary: Deprecate glossary_get_completion_state() 2021-04-22 21:28:09 +10:00
Jun Pataleta 81ddb3c13d MDL-71144 mod_forum: Deprecate forum_get_completion_state() 2021-04-22 21:28:09 +10:00
Jun Pataleta c008814ca4 MDL-71144 mod_feedback: Deprecate feedback_get_completion_state() 2021-04-22 21:28:09 +10:00
Jun Pataleta 8e79ddef3b MDL-71144 mod_data: Deprecate data_get_completion_state() 2021-04-22 21:28:09 +10:00
Jun Pataleta 9dfc27cc33 MDL-71144 mod_choice: Deprecate choice_get_completion_state() 2021-04-22 21:28:09 +10:00
Jun Pataleta bbe3a4882d MDL-71144 mod_assign: Deprecate assign_get_completion_state() 2021-04-22 21:28:09 +10:00
Jun Pataleta e774335f16 MDL-71144 completion: Deprecate get_completion_state callbacks
* *_get_completion_state() callback functions have been deprecated and
should no  longer be used. Plugins that define custom completion rules
must implement the mod_[modname]\completion\custom_completion class that
extends the \core_completion\activity_custom_completion base class.
2021-04-22 21:28:09 +10:00
Sara Arjona 6abbca9754 Merge branch 'MDL-71400-311' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-04-22 13:16:29 +02:00
Ferran Recio 150280bafa MDL-70909 core: add cannotmatchanyrows to capabilities join 2021-04-22 13:09:47 +02:00
Jun Pataleta 672bbb6cd6 Merge branch 'MDL-71170_311' of git://github.com/mdjnelson/moodle into MOODLE_311_STABLE 2021-04-22 18:55:21 +08:00
Noel De Martin 5c1cf60ae4 MDL-71386 behat: Support for 3.9.5+ mobile app 2021-04-22 12:15:37 +02:00
Paul Holden 50fe1b9885 MDL-71200 mod_folder: ensure "Download folder" option is backed up. 2021-04-22 10:29:18 +01:00
Paul Holden f0db656002 MDL-70979 search: validate external user search parameters.
Clean return value in unit test for same.
2021-04-22 10:22:42 +01:00
Paul Holden 1c00938de9 MDL-71392 mod_quiz: don't display grade to pass if not set. 2021-04-22 09:53:21 +01:00
Mihail Geshoski 3b1c29d233 MDL-71400 assignfeedback_offline: Fix message after worksheet upload 2021-04-22 13:08:44 +08:00
Jun Pataleta 78672323e6 Merge branch 'MDL-71156-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-04-22 11:53:27 +08:00
Andrew Nicols 67f4a51f68 Merge branch 'MDL-69460-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-22 11:10:32 +08:00
Simey Lameze 10018bbc39 MDL-71156 core: machinery to recover orphaned calendar events
The machinery to fix orphaned calendar events that were broken by MDL-67494.

The solution consists of:

1) Upgrade step that checks if this site has executed the problematic upgrade steps and
   if positive, it will schedule a new run for calendar_fix_orphaned_events adhoc task.

2) Adhoc task that will self-spawn calling the recovery machinery, running until
   all the orphaned calendar events are fixed. It also sets the maximum runtime of
   60 seconds. It is also possible to override that number by specifing the desired
   number setting the ->calendareventsmaxseconds in your config.php

3) CLI script that will look for all the calendar events which userids
   where broken by a wrong upgrade step, affecting to Moodle 3.9.5
   and up.

   It performs checks to both:
     a) Detect if the site was affected (ran the wrong upgrade step).
     b) Look for orphaned calendar events, categorising them as:
       - standard: site / category / course / group / user events
       - subscription: events created via subscriptions.
       - action: normal action events, created to show common important dates.
       - override: user and group override events, particular, that some activities support.
       - custom: other events, not being any of the above, common or particular.

   By specifying it (--fix) try to recover as many broken events (missing userid) as
   possible. Standard, subscription, action, override events in core are fully supported but
   override or custom events should be fixed by each plugin as far as there isn't any standard
   API (plugin-wise) to launch a rebuild of the calendar events.

4) Unit tests and helper functions to generate calendar events. We have decided to
   keep the tests simple, testing only true and false and not using data generators because
   the code is purely to recover the calendar events and won't turn into an API or something
   and also due to the urgency of this issue.
   The helpers have been created in calendar/tests/helpers.php since there are no data generators
   for calendar.
2021-04-22 10:39:46 +08:00
Jun Pataleta 1ebb8d0264 Merge branch 'MDL-71288-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-04-22 10:29:16 +08:00
Andrew Nicols 2fb5cb74e9 Merge branch 'MDL-70412-311' of git://github.com/aanabit/moodle into MOODLE_311_STABLE 2021-04-22 10:08:22 +08:00
abgreeve bdd7f0a77c MDL-28452 profilefield_social: Setting the version number to today. 2021-04-22 10:05:04 +08:00
Simey Lameze 068f965a0a MDL-71288 completion: add fallback for plugins
This commits adds a fallback for plugins which does not have
custom_completion implementation.

For those cases, it will search for {modulename}_get_completion_state
callback in the plugin and call get_overall_completion() method in
cm_completion_details class to get the overall completion state for
a course module and user.
2021-04-22 09:46:19 +08:00
abgreeve 3f1727adcf Merge branch 'MDL-28452-311' of git://github.com/bmbrands/moodle into MOODLE_311_STABLE 2021-04-22 09:35:18 +08:00
Paul Holden a760a65c5e MDL-57831 theme_boost: accessibility update for message preferences.
The preferences table did not meet accessibility guidelines regarding
colour contrast between hovered rows and the disabled switch
elements.

Ensure white background is used for all table cells, and replace the
highlighted columns used to differentiate processors with borders.
2021-04-21 21:50:51 +01:00
Sara Arjona 4070ef538b Merge branch 'MDL-64336-m311' of https://github.com/NeillM/moodle into MOODLE_311_STABLE 2021-04-21 17:14:08 +02:00
Marina Glancy 855d6249dc MDL-71394 core_blog: fix incorrect default setting in form
the keys of the options are strings, in PHP8 strings are compared with 0 differently
2021-04-21 16:24:11 +02:00
Neill Magill e0da18119b MDL-64336 assign: Add missing PHP doc 2021-04-21 15:15:00 +01:00
Neill Magill cffc41c27c MDL-64336 assign: Teachers should be able to see all submissions
Before this change a teacher would be able to see users listed if:

* They have an active enrolment and can submit
* They have an an inactive enrolment for a role that can submit

After this change they will additonally be able to see users listed:

* That have an active enrolment and have submitted
* That have an inactive enrolment and have submitted

This means that if an assignment has it's context frozen all users
that have made some form of submission will still be listed.

It will also apply if the submission capability is removed from a
user.

If a user's enrolment is deleted they will not be listed.

The submission and grading counts have also been updated so
they will reflect the new rules.
2021-04-21 15:15:00 +01:00
Neill Magill be1c2eded5 MDL-64336 assign: Submissions should be visible while frozen
Before this change if a student visited an assignment that is
frozen they would only see the title and description even if
they had made a submission to it.

After the change they will be able to see the status of their
submission and any feedback and grades they have recived.

It will also make the Moodle app recognise that submission
should not happen because the assignment is frozen.

Tests based on ones created by Andrew Nicols
2021-04-21 15:14:59 +01:00
Marina Glancy 6d107d48c9 MDL-71389 various: changes to unittests due to php8 changes:
- some engine error messages changed
- some warning levels changed
- the carriage return symbol randomly appears
- one phpunit assertion fails and not really representative of anything
2021-04-21 12:39:02 +02:00
Bas Brands 698c57dc3a MDL-28452 core_user: add custom profilefield capability
Add a setting to show custom profilefields to self or others
with capability moodle/sit:viewuseridentity in the course context only
2021-04-21 11:24:36 +02:00
Bas Brands 6191a34c0f MDL-28452 core_user: add behat test for duplicate shortname warning 2021-04-21 11:24:36 +02:00
Bas Brands 37f26f211f MDL-28452 core_user: migrate social profile fields
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.

AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
2021-04-21 11:24:34 +02:00
Sara Arjona d68a8df7ea Merge branch 'dynreg-upgrade-squash-311' of https://github.com/cengage/moodle into MOODLE_311_STABLE 2021-04-21 09:58:38 +02:00
Jun Pataleta bcc9028f20 Merge branch 'MDL-71017-311-2' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-04-21 14:56:54 +08:00
abgreeve f0b4559bfe Merge branch 'MDL-71205_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2021-04-21 13:31:44 +08:00
Jake Dallimore 25716402c1 Merge branch 'MDL-71030-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-04-21 12:07:07 +08:00
abgreeve dfda661753 Merge branch '311_MDL-71174' of git://github.com/danmarsden/moodle into MOODLE_311_STABLE 2021-04-21 11:02:13 +08:00
Eloy Lafuente (stronk7) 52dff48650 Merge branch 'MDL-63381_311_v3' of https://github.com/TomoTsuyuki/moodle into MOODLE_311_STABLE 2021-04-20 23:58:48 +02:00
Claude Vervoort 2eaf60e01b MDL-70500 lti: dyn reg can be used to update tools 2021-04-20 17:13:18 -04:00
Sara Arjona 3c71c49d28 Merge branch 'MDL-62244_311_label_view' of https://github.com/sheesania/moodle into MOODLE_311_STABLE 2021-04-20 17:45:01 +02:00
Marina Glancy 79949dc508 MDL-70897 various: uasort callback can not return bool
Co-authored-by: Ruslan Kabalin <ruslan.kabalin@gmail.com>
2021-04-20 14:59:44 +01:00
Sara Arjona 003dadc64d on-demand release 3.11dev+ 2021-04-20 15:52:10 +02:00
Sara Arjona bfa5ef0ea0 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-04-20 15:52:07 +02:00
Paul Holden 86e161bb16 MDL-70970 quizaccess_seb: consistent property array sorting by key.
In PHP8.0 using `ksort` was producing incorrect results by sorting
keys differing only in case in the wrong order. This change makes
sorting consistent between PHP versions.

Co-Authored-By: Tim Hunt <T.J.Hunt@open.ac.uk>
2021-04-20 14:36:17 +01:00
Mikel Martín b98bcd1e38 MDL-70903 mod_h5p: Fix PHP8.0 warning 2021-04-20 15:17:39 +02:00
Marina Glancy 444a4a8c3e MDL-71017 oath2: configuration check fix and return types 2021-04-20 12:08:19 +02:00
David Matamoros d73cd7c778 MDL-70902 libraries: upgrade to version 6.4.1 of TCPDF 2021-04-20 12:00:40 +02:00
David Matamoros fc02628620 MDL-71017 tool_oauth2: Small fixes on Oauth 2 services UI and tests 2021-04-20 10:52:35 +02:00
Marina Glancy 8cc1bcb123 MDL-71017 tool_oauth2: show not configured services 2021-04-20 10:52:35 +02:00
Marina Glancy 720d74ebeb MDL-71017 oauth2: configure some oauth2 services for login only 2021-04-20 10:52:32 +02:00
Rajneel Totaram 97ba2d707c MDL-71376 mod_quiz: fix undefined object reference 2021-04-20 20:12:05 +12:00
Thong Bui 6a9063c588 MDL-71030 Quiz: Add 'who' made changes in question response history 2021-04-20 09:12:18 +07:00
Jun Pataleta e3bd87cae7 Merge branch 'MDL-71364_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-04-20 09:24:44 +08:00
AMOS bot 587afbb7ad Automatically generated installer lang files 2021-04-20 00:07:30 +00:00
Paul Holden 234ca0699c MDL-57831 message: Boostrap controls for notification preferences.
Switch from previous custom controls that caused problems with
overflowing labels when using long language strings.
2021-04-19 23:50:42 +01:00
Víctor Déniz 3de3ebc4f3 Merge branch 'MDL-71087-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-04-19 23:44:38 +01:00
Eloy Lafuente (stronk7) 5e0772ed8b Merge branch 'MDL-69256-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-04-20 00:04:56 +02:00
Víctor Déniz 6b9033f251 Merge branch 'MOODLE_311_STABLE_fix_gradeimport_csv' of https://github.com/intrajp/moodle into MOODLE_311_STABLE 2021-04-19 22:48:24 +01:00
Víctor Déniz 42a4fea40c Merge branch 'MDL-71118-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-04-19 19:44:08 +01:00
Eloy Lafuente (stronk7) 6c5c501504 Merge branch 'MDL-71181-311' of https://github.com/ettolrah/moodle into MOODLE_311_STABLE 2021-04-19 18:58:24 +02:00
Eloy Lafuente (stronk7) cb6cdc0fd3 Merge branch 'MOODLE_311_STABLE-MDL-71190-backup-lastaccess' of https://github.com/ScottVerbeek/moodle into MOODLE_311_STABLE 2021-04-19 18:52:30 +02:00
Sara Arjona ab308e8847 Merge branch 'MDL-71262_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2021-04-19 17:44:09 +02:00
Sara Arjona e4d4369b2f MDL-71225 questions: Remove duplicated empty line 2021-04-19 17:28:43 +02:00
Sara Arjona bcfa03c428 Merge branch 'MDL-71225_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2021-04-19 17:18:40 +02:00
Sara Arjona 8ec2411be7 Merge branch 'MDL-67882-message-config-log-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-04-19 16:22:54 +02:00
Dongsheng Cai 1dbdbb621c MDL-68747 mod_quiz: force LTR for quiz grading overview chart 2021-04-19 21:06:43 +10:00
Sara Arjona 103d168357 Merge branch 'MDL-71367_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-04-19 11:12:56 +02:00
Sara Arjona 350b49766a Merge branch 'MDL-71365_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-04-19 10:18:32 +02:00
Paul Holden e64eae866e MDL-71127 mod_quiz: fix thrown exception for invalid question columns. 2021-04-19 09:07:06 +01:00
Paul Holden 1f4ad415b5 MDL-71168 report_participation: fix select all users checkbox. 2021-04-19 09:05:19 +01:00
Paul Holden b35c0337d4 MDL-69460 admin: prevent CLI upgrade when stale files present. 2021-04-19 09:03:49 +01:00
Sara Arjona 5a2ae7ecde Merge branch 'MDL-66475-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-19 09:49:15 +02:00
Sara Arjona a569ba73b4 Merge branch 'MDL-65553-311' of git://github.com/aanabit/moodle into MOODLE_311_STABLE 2021-04-19 08:53:39 +02:00
Jun Pataleta 8224c9d6b7 Merge branch 'MDL-71324-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-04-19 12:31:27 +08:00
ScottVerbeek d687a56fed MDL-71190 backup: Include users last access to course
Backup the table user_lastaccess which holds data for when a user last accessed a course.
And also restore to the table user_lastaccess from the .xml file created in the backup.
2021-04-19 12:04:30 +10:00
Andrew Nicols 1e90af329d Merge branch 'MDL-71012-311' of https://github.com/jessansell/moodle into MOODLE_311_STABLE 2021-04-19 08:49:06 +08:00
Eloy Lafuente (stronk7) c86f286543 MDL-71367 unit tests: Add missing ->destroy() call to test backups
As part of the tests preparations, some backups are created, but
the tests aren't calling to their ->destroy() method at the end.

The destroy() method is needed to go cleaning and unsetting various
objects that, only then, will free resources, like memory, open files...

This isn't critical under Unix OSs... but Windows is really sensible
and keeps all open files locked, so any write operation on them fails.
2021-04-19 00:03:46 +02:00
Eloy Lafuente (stronk7) b98005ec2a Merge branch 'MDL-71031_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-04-18 17:08:51 +02:00
Eloy Lafuente (stronk7) 51a5d523a1 MDL-71031 external: Minor tweaks towards coding style and external rules
- Some small namespace/use/MOODLE_INTERNAL/requires reorganization.
- Move file phpdocs to class phpdocs.
- Move external method names to be new "execute" default ones.
- Move unit tests to matching core_grades\external namespace.
- Add missing clean_returnvalue() calls.
2021-04-18 11:53:09 +02:00
Peter Burnett 74a86a9880 MDL-71031 webservices: Extended gradecategory creation API
This adds a new webservice that creates gradecategories as a batch,
and deprecates the old single creation call, which is superseded.
It also patches a few small issues in the single WS, for any integrations
currently relying on that webservice.
2021-04-18 11:53:03 +02:00
AMOS bot eb45c21753 Automatically generated installer lang files 2021-04-18 00:07:28 +00:00
Eloy Lafuente (stronk7) e5441b439e MDL-71365 grunt: fix boost ignores order and missing LF @ EOF 2021-04-18 00:13:12 +02:00
Eloy Lafuente (stronk7) b086645bd7 MDL-71364 behat: fix randomness causes by "now" advancing
Some recent tests do set a date time element
to ##now## or tomorrow and, immediately after that
the look if, effectively, ##now## and #tomorrow#
have been set (with minutes resolution).

Problem is that, between the field is set and the field
is verified, it can happen that the time advances to
next minute (from H:M:59 to H:M+1:00) and then the
assertion fails.

To avoid this, we could have lowered the resolution to be
hours... but that doesn't solve the problem just makes it
to happen less often.

So, instead of that... we are setting the 2 now and tomorrow
cases to be "today noon" and "tomorrow noon" (12:00:00) so
we ensure they won't be ever in the risk of jumping of minute.
2021-04-17 12:32:35 +02:00
Luca Bösch e2b1ede0dd MDL-71324 course: Render hasinfo class only if necessary. 2021-04-17 11:49:28 +02:00
Luca Bösch c5446c9cc7 MDL-71118 core: Add grade (verb) string.
AMOS BEGIN
 CPY [grade,core],[gradenoun,core]
 CPY [grade,core],[gradeverb,core]
AMOS END
2021-04-17 11:45:57 +02:00
Luca Bösch 3256a63914 MDL-71118 gradereport_user: Display Grades (plural) in profile page. 2021-04-17 11:45:57 +02:00
Eloy Lafuente (stronk7) 8b9717935c Merge branch 'MDL-70099-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-17 09:40:28 +02:00
Eloy Lafuente (stronk7) 9b8427c455 Merge branch 'MDL-71334-311' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-04-16 19:59:45 +02:00
Sara Arjona 9600becce3 on-demand release 3.11dev+ 2021-04-16 17:06:23 +02:00
Sara Arjona dfbea60ac4 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-04-16 17:06:20 +02:00
Sara Arjona b3209c0ac5 MDL-69331 core_h5p: fix behat errors 2021-04-16 13:07:09 +02:00
Andrew Nicols b816aa102d Merge branch 'MOODLE_311_MDL-71233' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-04-16 08:06:23 +01:00
Jun Pataleta 03f21e4cc0 Merge branch 'MDL-48594-311' of https://github.com/nguyenphuctien/moodle into MOODLE_311_STABLE 2021-04-16 08:06:23 +01:00
Andrew Nicols c0db4805df Merge branch 'MDL-60490-missing_close_div-311' of https://github.com/leonstr/moodle into MOODLE_311_STABLE 2021-04-16 08:06:22 +01:00
Andrew Nicols 28d07f3373 Merge branch 'MDL-69415-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-04-16 08:06:22 +01:00
Paul Phillips 11a15b8b9c MDL-71167 mod_scorm: use full url in redirect 2021-04-16 08:06:22 +01:00
Jake Dallimore a7061af4fb Merge branch 'MDL-71342-311-2' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-16 08:06:22 +01:00
Andrew Nicols e1eff84dd2 Merge branch 'MOODLE_311_MDL-71254' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-04-16 08:06:22 +01:00
Andrew Nicols 6d6a57dda9 Merge branch 'MDL-71186-m311' of https://github.com/clransom/moodle into MOODLE_311_STABLE 2021-04-16 08:06:22 +01:00
Víctor Déniz 9976bacec2 Merge branch 'MDL-69331-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-04-16 08:06:21 +01:00
Sara Arjona 4fcc06b43e Merge branch 'MDL-70269_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-04-16 08:06:21 +01:00
Michael Hawkins 65dea75cc6 MDL-71334 mod_lti: Fix manual activity completion behat test 2021-04-16 14:10:27 +08:00
Tien Nguyen 5ad8101553 MDL-48594 Report: More filtering options on Activity Completion Report 2021-04-16 10:07:06 +07:00
Jun Pataleta 91170558ac MDL-71342 mod: Conditionally display activity info
* The activity information output component is still being displayed
even in the case when the activity does not have dates to show and
completion tracking is not enabled.
This also causes a horizontal line to be rendered in activity view pages
below the activity heading which does not serve much purpose when
there's no activity information to be shown.
The activity information output component should only be displayed
if there's completion information to show or if there are activty dates
to show. Otherwise, there's no need to render it.
2021-04-15 23:10:42 +08:00
Amaia Anabitarte e58d63f078 MDL-70412 groups: Improving create_group data generator
Increasing the size of the name for generated groups
to ensure we don't have problems with ordering.
2021-04-15 16:57:23 +02:00
Amaia Anabitarte 82093afe50 MDL-65553 core_analytics: Don't allow to flag predictions several times
Even if a prediction is hidden from the report once is flagged,
it can be flagged several times if the user visits detailed view via URL.
We remove the checkbox to select a prediction and flag it
once it has already been flagged.
2021-04-15 16:39:09 +02:00
Katie Ransom b4fdc7c1b0 MDL-71186 core_user: show custom user fields in group management screens 2021-04-15 15:30:54 +01:00
Sara Arjona cf42280164 Merge branch 'MDL-71090-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-15 11:56:46 +02:00
Sara Arjona d3b93906d5 MDL-69331 core_h5p: Add missing @core_h5p tag 2021-04-15 09:33:02 +02:00
Sara Arjona d0d7fc835e MDL-69331 core_h5p: Add missing library files to behat tests
Some of the pre-existing behat tests were creating content into the
content bank using the generator but the H5P content-type libraries
weren't uploaded.
Since MDL-69331, libraries need to be deployed previously (so fake
H5P content-type won't be displayed if these libraries don't exist).
2021-04-15 09:33:02 +02:00
Sara Arjona 8a81d74244 MDL-69331 core_contentbank: Hide disabled H5P content-types
If a H5P content-type is disabled:
- The content bank won't display existing contents having it as a
main library.
- The content bank won't allow to create new contents using it.
2021-04-15 09:32:58 +02:00
Sara Arjona 73a7133ef8 MDL-69331 core_h5p: Only upgrade enabled libraries
The core\task\h5p_get_content_types_task task will only download
content-type for enabled libraries.
2021-04-15 09:31:36 +02:00
Sara Arjona be7143381f MDL-69331 core_h5p: Display error when main library is disabled
H5P contents with the main library disabled won't be deployed; a
message error will be displayed instead of.
2021-04-15 09:31:36 +02:00
Sara Arjona dc77f13dab MDL-69331 core_h5p: Add enabled field to libraries
The "enabled" field has been added to the H5P libraries to let
admins decide whether a library should be used or not in the site.
2021-04-15 09:31:36 +02:00
Jake Dallimore c78aa10409 Merge branch 'MDL-71338-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-15 14:42:25 +08:00
Sara Arjona a1ce0a96d2 Merge branch 'MDL-71337-311' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-15 08:30:14 +02:00
Jake Dallimore d839e4f941 Merge branch 'MDL-61768-311-3' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-04-15 14:16:40 +08:00
abgreeve dfda0b1c19 Merge branch 'MDL-71007-courseidnumer-grade-ws-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-04-15 13:47:02 +08:00
Jun Pataleta 4c5d70b586 MDL-71337 mod_h5pactivity: Increase window size during test
The addition of the activity information moves the h5p content down
out of the window view on Firefox which causes the Check button to be
unclickable. This patch increases the window size to ensure that the
check button is visible and clickable.

Credits to Eloy <stronk7@moodle.org> for the thorough investigation
of the root cause of this issue :)
2021-04-15 12:45:56 +08:00
Mihail Geshoski 17bf8a2ef3 MDL-61768 repository_googledocs: Deprecate unused methods
Deprecates methods from the repository_googledocs class which are
no longer used.
2021-04-15 12:43:00 +08:00
Mihail Geshoski 598a072922 MDL-61768 repository_googledocs: Add unit tests
Adds unit tests for the newly introduced methods related to the content
browsing and searching functionallity across drives.
2021-04-15 12:43:00 +08:00
Mihail Geshoski bded723306 MDL-61768 repository_googledocs: Support shared drives
Enables the Google Drive repository to support browsing and searching
for content from the existing shared drives.
2021-04-15 12:42:58 +08:00
Mihail Geshoski 2950a9a024 MDL-61768 repository_googledocs: Rest API function to list shared drives
Adds a new rest API function in the googledocs repository which would
return the existing shared drives.
2021-04-15 12:41:41 +08:00
Jake Dallimore 38a54270c7 Merge branch 'MDL-70142-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-15 10:35:49 +08:00
Andrew Nicols dd62d97a1a Merge branch 'MDL-70311-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-04-15 09:19:50 +08:00
Jake Dallimore 946d0ea0cf Merge branch 'MDL-70649-M311' of https://github.com/xuangui2018/moodle into MOODLE_311_STABLE 2021-04-15 08:39:08 +08:00
Jake Dallimore 52f8e4001c Merge branch 'MDL-71119-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-04-15 08:32:04 +08:00
AMOS bot 7da38579f6 Automatically generated installer lang files 2021-04-15 00:07:38 +00:00
Paul Holden 5138937e79 MDL-71338 tool_usertours: correct Content-Type on tour export.
Replace existing code with standard file serving mechanism, in
turn correcting the previously incorrect Content-Type header.
2021-04-14 21:11:53 +01:00
Eloy Lafuente (stronk7) d1b2b063c9 Merge branch 'MDL-67999-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-04-14 19:30:24 +02:00
Mahmoud Kassaei d2d9a7200b MDL-71225 Questions: Default options for
ddimageortext, ddmarker and match qtypes
2021-04-14 17:54:54 +01:00
Mahmoud Kassaei 82a9fb50d0 MDL-71262 Questions: Default options for qtype_essay 2021-04-14 17:14:28 +01:00
Sara Arjona b199ebd0d5 MDL-67999 contentbank: Remove contentbank/upload.php
As the form to upload files to the content bank has been moved to
modal, this file is not required any more, so it has been removed.
2021-04-14 18:10:32 +02:00
Sara Arjona 03ab4546ed MDL-67999 contentbank: Make upload/replace files modal form
Once MDL-64554 landed, content bank can implement the original
proposal, using a modal form when uploading files.
2021-04-14 18:10:32 +02:00
Sara Arjona eb8c1fce66 MDL-67999 core_contentbank: Add namespace to upload form
The form to upload/replace files has been moved to classes/form
(it's where it should have been added when it was created).
Besides, this class has been renamed because now, with the
namespace, contentbank and form don't need to be in the name ;-)
2021-04-14 18:10:32 +02:00
Xuan Gui a32c076d0b MDL-70649 files: Alternative security helper
Augment all installed plugin's security helper if there is any.
Plugins function has to be defined as plugintype_pluginname_security_helper in pluginname/lib.php file.
2021-04-14 21:25:12 +10:00
Eloy Lafuente (stronk7) e0d45a6bc2 Merge branch 'MDL-70616-311-fix' of https://github.com/izendegi/moodle into MOODLE_311_STABLE 2021-04-14 12:45:11 +02:00
Iñigo Zendegi a8d4abf091 MDL-70616 gradingform_rubric: Filters not applied to rubric name 2021-04-14 11:52:16 +02:00
Sara Arjona f58c70ebd5 MDL-71119 core_badges: Add more information to errors
Some errors raised when calling external services were ignored.
Displaying this information helps to debug and find the real reasons
why some action, like connecting to an external backpack, can't be
done.
2021-04-14 10:56:00 +02:00
Sara Arjona 1fdf3adf51 MDL-71119 core_badges: Use basicauth and remove urlencode
Basic authorization header is required to get token. Besides, client
id and secret shouldn't call urlencode.
2021-04-14 10:55:59 +02:00
Sara Arjona 7dd480dde2 MDL-71119 core_badges: Initialise scopes param in backpack-connect.php
The scopes parameter should be passed when creating the OAuth2 badges
client. As it is an optional parameter, when it's empty, it will
be initilised with the supported scopes for the backpack issuer.

It will happen, for instance, when a call is done to oauth2callback.php
because, as defined in RFC6749, OAuth2 authorization response only
supports code and state.
2021-04-14 10:55:59 +02:00
Jun Pataleta 0ff857ca81 Merge branch 'MDL-71315-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-04-14 16:50:49 +08:00
Paul Holden 5a862117fd MDL-70772 mod_forum: check for valid usernode before making active. 2021-04-14 09:20:13 +01:00
Sara Arjona 119fb4b712 MDL-71315 core_badges: Fix warning when rendering badges 2021-04-14 09:06:35 +02:00
Andrew Nicols c42ccdd372 Merge branch 'MDL-71154_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-04-14 12:10:16 +08:00
Andrew Nicols 8e358c9983 Merge branch 'MDL-71169-311-execute' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-04-14 08:35:38 +08:00
AMOS bot 444291e71a Automatically generated installer lang files 2021-04-14 00:07:33 +00:00
Eloy Lafuente (stronk7) 2c13de9fc8 Merge branch 'MDL-69874-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-04-13 23:08:57 +02:00
Eloy Lafuente (stronk7) 1f2fbfe331 Merge branch 'MDL-70722-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-04-13 22:39:36 +02:00
Víctor Déniz c7e2a997a8 Merge branch 'MDL-71089-311' of git://github.com/roland04/moodle into MOODLE_311_STABLE 2021-04-13 19:40:09 +01:00
Eloy Lafuente (stronk7) 9c4a2b0d47 MDL-71154 ci: Prevent upstream branches and tags to be built
Both for travis and GHA:

- master and MOODLE_XXX_STABLE branches
- any vX.Y.Z tag

won't lead to a build anymore.
2021-04-13 16:55:46 +02:00
Mikel Martín 7c82ff41a3 MDL-71089 core: Add different Toast notification styling 'types' 2021-04-13 16:29:10 +02:00
Mikel Martín b27cb56296 MDL-71089 theme_boost: Add styles for different toast types 2021-04-13 16:29:10 +02:00
Sara Arjona 933d98cd50 Merge branch 'MDL-71011_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-04-13 12:27:00 +02:00
Sara Arjona 09851f5882 Merge branch 'MDL-65983-311' of git://github.com/jleyva/moodle into MOODLE_311_STABLE 2021-04-13 12:19:33 +02:00
Luca Bösch 4a67d78a4c MDL-69874 workshop: Title mentions received assessments in close phase. 2021-04-13 12:03:17 +02:00
Eloy Lafuente (stronk7) 7811d7ace4 on-demand release 3.11dev+ 2021-04-13 10:27:30 +02:00
Eloy Lafuente (stronk7) 9d2bb5eb6b Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-04-13 10:27:26 +02:00
Adrian Greeve 6dfbb08b53 Merge branch 'MDL-71161-311-4' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-13 11:41:22 +08:00
Tomo Tsuyuki c12ef07260 MDL-63381 backup: Have an option to import permissions
Add options to use permission settings for import / restore
2021-04-13 13:21:54 +10:00
Adrian Greeve f82793d840 Merge branch 'MDL-70821-311-5' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-13 11:14:08 +08:00
Eloy Lafuente (stronk7) efc8877c21 Merge branch 'MDL-71172-311' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_311_STABLE 2021-04-13 00:47:03 +02:00
Tim Hunt 52acec4989 MDL-71313 repositories: warn if get_instances context is wrong type 2021-04-12 20:32:35 +01:00
Michael Hawkins 5485896773 MDL-71161 mod_workshop: Display activity completion information 2021-04-13 01:25:31 +08:00
Michael Hawkins 51e5c13b4e MDL-71161 mod_wiki: Display activity completion information 2021-04-13 01:25:31 +08:00
Michael Hawkins 10a5c03ff3 MDL-71161 mod_url: Display activity completion information 2021-04-13 01:25:31 +08:00
Simey Lameze 5cc0484e01 MDL-71161 mod_survey: show survey activity info 2021-04-13 01:25:31 +08:00
Michael Hawkins f0d40c213c MDL-71161 mod_scorm: Display activity completion information 2021-04-13 01:25:31 +08:00
Michael Hawkins 2a0f56c0b6 MDL-71161 mod_resource: Display activity completion information 2021-04-13 01:25:31 +08:00
Michael Hawkins 18cb6e2fec MDL-71161 mod_quiz: Display activity completion information 2021-04-13 01:25:31 +08:00
Michael Hawkins 4c0b62f6d6 MDL-71161 mod_page: Display activity completion information 2021-04-13 01:25:31 +08:00
Michael Hawkins fdac35d12a MDL-71161 mod_lti: Display activity completion information 2021-04-13 01:25:30 +08:00
Michael Hawkins 63618f9648 MDL-71161 mod_lesson: Display activity completion information 2021-04-13 01:25:30 +08:00
Jun Pataleta 9d4b978c61 MDL-71161 mod_imscp: Display activity information output component 2021-04-13 01:25:30 +08:00
Jun Pataleta c2e643c77f MDL-71161 mod_h5pactivity: Display activity information output component 2021-04-13 01:25:30 +08:00
Simey Lameze abcbc5eb0c MDL-71161 mod_glossary: show glossary activity info 2021-04-13 01:25:30 +08:00
Simey Lameze 35bd229134 MDL-71161 mod_forum: show forum activity info 2021-04-13 01:25:30 +08:00
Jun Pataleta 1c9896e4fd MDL-71161 mod_folder: Display activity information output component 2021-04-13 01:25:30 +08:00
Simey Lameze ee324bc048 MDL-71161 mod_feedback: show feedback activity info 2021-04-13 01:25:30 +08:00
Simey Lameze d2e13ee385 MDL-71161 mod_data: show database activity info 2021-04-13 01:25:30 +08:00
Jun Pataleta ac6e083f9b MDL-71161 mod_chat: Display activity information output component 2021-04-13 01:25:30 +08:00
Jun Pataleta 04903e987d MDL-71161 mod_book: Display activity information output component 2021-04-13 01:25:30 +08:00
Simey Lameze f256097309 MDL-71161 mod_assign: show assign activity info 2021-04-13 01:25:30 +08:00
Jun Pataleta ff5955a829 MDL-70821 core_completion: Fix completion settings Behat tests 2021-04-13 01:05:01 +08:00
Jun Pataleta c9e92d1f5e MDL-70821 course: Render activity information only when necessary
Render the activity information output component in the course homepage
only if either completion details or activity dates are to be displayed.
This can help reduce the number of files being included when loading the
course homepage (e.g. the activity information template for each
activity in the course homepage).
2021-04-13 01:04:07 +08:00
Eloy Lafuente (stronk7) 9bd0f130ea MDL-71011 adodb: Update readme and thirdpartylibs
Small changes in readme and document the bump in xml
2021-04-12 18:50:59 +02:00
Eloy Lafuente (stronk7) 01c8cb9cda MDL-71011 php80: final private makes no sense, throwing warning
Ref: https://php.watch/versions/8.0/final-private-function#final-private

This applies #712 from upstream libraries.

Unrelated: I've also changed a occurrence of "private final"
by the correct (PSR-12) "final private" in the constructor
(the final&private combination is allowed in constructors)
in lib/classes/event/base.php, because it's the unique case
in core and phpcs was really insisting.
2021-04-12 18:50:59 +02:00
Eloy Lafuente (stronk7) 6baa6f0e25 MDL-71011 adodb: Bump to v5.21.0
Following the instructions @ readme_moodle.txt
2021-04-12 18:50:53 +02:00
Eloy Lafuente (stronk7) 2e13d30c9d Merge branch 'MDL-71064-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-12 17:36:31 +02:00
Sara Arjona e1b7284e33 Merge branch 'MDL-68716-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-12 17:24:40 +02:00
Sara Arjona 840a9f43db Merge branch 'MDL-71264_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-04-12 16:40:10 +02:00
Sara Arjona eef4dbb5ea Merge branch 'MDL-70595-311' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-04-12 16:01:35 +02:00
Sara Arjona 6a0c20aa7a Merge branch 'MDL-71107-11' of git://github.com/aanabit/moodle into MOODLE_311_STABLE 2021-04-12 12:41:09 +02:00
Anupama Sarjoshi 8c2e5b3997 MDL-71172 quiz: Improve quiz Behat tests 2021-04-12 11:37:58 +01:00
Juan Leyva fdb4792293 MDL-65983 airnotifier: Configuration check report 2021-04-12 11:23:40 +02:00
Jake Dallimore 37fcd2554f Merge branch 'MDL-71251-311' of git://github.com/jleyva/moodle into MOODLE_311_STABLE 2021-04-12 14:48:44 +08:00
Adrian Greeve aaf93840d0 Merge branch 'MDL-70821-311-5' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-12 14:44:58 +08:00
Jun Pataleta 24b48fd2e7 MDL-70821 course: Activity information fixes
* Make sure the activity is visible to the user (cm_info::uservisible)
before showing the activity completion information.
* Add to-do status for overridden automatic completion
2021-04-12 12:29:24 +08:00
Jun Pataleta 28a1a56762 MDL-70821 course: Check activity dates on course homepage
* Check the activity dates on the course homepage depending on
  the value of the showactivitydates course setting
* Plus use the new Behat steps for checking activity dates
2021-04-12 12:29:24 +08:00
Jun Pataleta d0f819e165 MDL-70821 course: New Behat steps for activity dates
* activity_date_in_activity_should_contain_text()
  - Checks the presence of the given text in the activity's date info.
* activity_dates_information_in_activity_should_exist()
  - Checks the presence of activity dates information in the activity
    information output component.
* activity_dates_information_in_activity_should_not_exist()
  - Checks the absence of activity dates information in the activity
    information output component.
2021-04-12 12:29:23 +08:00
Jun Pataleta 0da0a3d344 MDL-70821 behat: Use new activity completion steps for Behat tests
Replace usages of completion Behat steps that check for the completion
checkboxes with the new activity completion Behat steps.
2021-04-12 12:29:23 +08:00
Jun Pataleta bfedbc37c5 MDL-70821 completion: New Behat steps for activity completion
* activity_completion_condition_displayed_as()
  - Shows the status of an automatic completion condition for a given
    activity
* activity_should_have_the_completion_condition()
  - Checks that the activity displays the given completion condition
* manual_completion_button_displayed_as()
  - Shows the status of the manual completion button for a given
    activity
* the_manual_completion_button_for_activity_should_be_disabled()
  - Checks that the manual completion button for the given activity is
    disabled.
* there_should_be_no_completion_for_activity()
  - Checks that the activity does not show completion information
* toggle_the_manual_completion_state()
  - Toggles the manual completion button's state for a given activity
* overridden_manual_completion_button_displayed_as()
  - Checks the manual completion state of an activity.
* overridden_activity_completion_condition_displayed_as()
  - Checks if the activity with specified name is maked as complete.
2021-04-12 12:29:23 +08:00
Jun Pataleta b8afe46573 MDL-70821 course: activity_information template changes
* Add activity name for completion conditions labels. This would give
  better information to screen reader users the activity that the list
  of automatic completion conditions belong to. This would be useful
  especially when the completion conditions are displayed on the course
  homepage.
* Add data-region attributes to activity dates and completion
  information divs.
* Reorganise activity dates and completion information divs so they
  are only rendered when they have data to show.
2021-04-12 12:29:23 +08:00
Jun Pataleta 9f8a137211 MDL-70821 course: Remove old manual completion toggling
Remove the old ways of toggling manual completion via completion.js
and the ajax part of togglecompletion.php.
2021-04-12 12:29:23 +08:00
Jun Pataleta 6163123c8e MDL-70821 course: Deprecate course_section_cm_completion()
Deprecate \core_course_renderer::course_section_cm_completion(). It is
not being used anymore and is being replaced by
\core_renderer::activity_information().
2021-04-12 12:29:23 +08:00
Jun Pataleta b37b5e992d MDL-70821 course: Cover availability conditions for manual completion
When an activity has manual completion tracking, pressing the manual
completion checkbox reloads the page after toggling the completion
state when the activity is linked to availability conditions.
The "Mark as done" button needs to mimic this behaviour as well.

The approach being taken here is to add a core_course/view JS module
for the course homepage which listens for the manualCompletionToggled
event and reloads the page when the activity module has availability
conditions tied to it.

Perhaps for future development, instead of reloading the page, the
container of the restricted course sections/activities can reloaded via
AJAX as well.
2021-04-12 12:29:23 +08:00
Jun Pataleta 41d9edf9d5 MDL-70821 course: Create manualCompletionToggled event
Add a new "manualCompletionToggled" course event and dispatch this
when the manual completion state for an activity is toggled.
2021-04-12 12:29:23 +08:00
Jun Pataleta 9ec5602f7b MDL-70821 course: Render activity information output component in course
Includes fixup from Shamim Rezaie <shamim@moodle.com>
2021-04-12 12:29:23 +08:00
Eloy Lafuente (stronk7) 61004c89af Merge branch 'MDL-69102-311' of https://github.com/martygilbert/moodle into MOODLE_311_STABLE 2021-04-12 00:01:54 +02:00
Eloy Lafuente (stronk7) ecc8fc3974 MDL-69102 phpunit: Add test to cover ALL cohort criteria
That way we can check that the expectations are
working ok for every database. Previously only the
ANY case was being tested.

Also, convert them to course badges and check, via
review_all_criteria() that the SQL structures returned
by award_criteria_cohort->get_completed_criteria_sql()
doesn't fail and return the expected counters.
2021-04-10 12:39:45 -04:00
Marty Gilbert e4fabe4ae8 MDL-69102 badge: Fixes broken WHERE clause
When buildilng the 'WHERE' clause, the SQL generated
a query that selected any user who was a member of the
**last** group, not all of the groups.

I believe the query has to be re-worked so that it only
returns users who are in ALL of the groups. This can
be done by a GROUP BY and HAVING.
2021-04-10 12:26:16 -04:00
Issam Taboubi f3499b80c6 MDL-71303 core: HTML not escaped in block skip link 2021-04-09 17:27:51 -04:00
Mahmoud Kassaei 87a1a3ebed MDL-71205 Default options for qtype_numerical 2021-04-09 18:33:02 +01:00
Juan Leyva 5327284deb MDL-71251 qtype_essay: Return new min/max word limit settings via WS
Those settings are required by external clients such as the Moodle App
2021-04-09 17:16:23 +02:00
Dan Marsden 7e7b6daddf MDL-32226 plagiarism: add span around links.
Make it easier for Mobile app to parse.
2021-04-09 12:03:31 +02:00
AMOS bot 4a1a97ed78 Automatically generated installer lang files 2021-04-09 00:07:35 +00:00
Víctor Déniz f8f9911cbd Merge branch 'MDL-70769-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2021-04-09 00:54:45 +01:00
Eric Merrill c88ad5c182 MDL-52724 editor_atto: Scrub atto html for invalid ol, ul, and li tags
Try to correct broken ul/ol/li tags, as they have an outsized impact
on course layout. Uses basic regex and loops to track open and closed
tags.

Also adds a deep clean option to the HTML cleaner, that runs less
frequent, more intensive cleanings. This is because normally _cleanHTML
gets called after each keystroke, which could cause problems with
large content on weak systems.

Behat changes are a fix for setting multiline strings in Atto, and
creating a multiline match step.
2021-04-08 15:26:55 -04:00
Eloy Lafuente (stronk7) c1e84df96f Merge branch 'MDL-70802-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-04-08 18:34:10 +02:00
Sara Arjona 586814d928 Merge branch 'MDL-65616-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-08 17:46:05 +02:00
Eloy Lafuente (stronk7) 919943b742 Merge branch 'm311_MDL_32226' of https://github.com/danmarsden/moodle into MOODLE_311_STABLE 2021-04-08 17:30:33 +02:00
Víctor Déniz 33aaac019c Merge branch 'MDL-71116-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-04-08 01:05:06 +01:00
Víctor Déniz e48f35e850 Merge branch 'MDL-71178-311' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-07 16:09:51 +01:00
Amaia Anabitarte 13d89cdcb5 MDL-71107 core_contentbank: Behat test. Authoring when copying a course 2021-04-07 10:03:38 +02:00
Amaia Anabitarte 78a10f1724 MDL-71107 core_contentbank: Fill content author when copying a course
'usercreated' and 'usermodified' fields can not be always mapped.
We are filling those fields with 'old' users when working on the same
site, or with current user when working on a different instance.
2021-04-07 10:03:38 +02:00
Adrian Greeve 8d638989f1 Merge branch 'MDL-70935-311-4' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-04-07 15:40:28 +08:00
Shamim Rezaie 26856f48fa MDL-70935 mod_quiz: Custom completion implementation 2021-04-07 15:12:34 +08:00
Shamim Rezaie e5ac4fd1d9 MDL-70935 mod_quiz: combine 'pass' and 'attemptsexhausted' rules
Custom rules are combined using the AND operator. However, the
'completionpass' and 'completionattemptsexhausted' rules are exceptions
because they are combined together with OR, and form a single new rule
that then will be combined with the rest of the rules using AND.
This commit combines the mentioned rules into a single rule named
'completionpassorattemptsexhausted'.
2021-04-07 15:12:34 +08:00
Shamim Rezaie 1ef67caf2c MDL-70935 mod_quiz: Missing completionminattempts rule description
The mod_quiz_get_completion_active_rule_descriptions() function was not
returning the description for the 'completionminattempts' rule. Added
that.
2021-04-07 15:12:34 +08:00
Michael Hawkins d938c0f299 MDL-70935 mod_scorm: Custom completion implementation 2021-04-07 15:12:34 +08:00
Michael Hawkins 7d594cb0d3 MDL-70935 mod_lesson: Custom completion implementation 2021-04-07 15:12:34 +08:00
Peter Burnett 49e201b592 MDL-70233 cache: Disabled factory now gets writer from parent 2021-04-07 15:33:07 +10:00
Adrian Greeve a0f778a5bf Merge branch 'MDL-70820-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-04-07 13:25:24 +08:00
Simey Lameze 0484b4b91a MDL-70820 mod_forum: custom completion implementation 2021-04-07 12:18:16 +08:00
Simey Lameze 62c7ce69de MDL-70820 mod_glossary: custom completion implementation 2021-04-07 12:18:16 +08:00
Simey Lameze 58a575c5f2 MDL-70820 mod_assign: custom completion implementation 2021-04-07 12:18:16 +08:00
Simey Lameze 3429235bc6 MDL-70820 mod_data: custom completion implementation 2021-04-07 12:18:16 +08:00
Simey Lameze 716ba1224b MDL-70820 mod_feedback: custom completion implementation 2021-04-07 12:18:16 +08:00
Simey Lameze 8a578bad20 MDL-70820 mod_survey: custom completion implementation 2021-04-07 12:18:16 +08:00
Alex Rowe 69a8d5043e MDL-70049 assign: count_submissions_need_grading call when can't grade 2021-04-07 08:57:36 +10:00
Eloy Lafuente (stronk7) 947512995e Merge branch 'MDL-68635-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-06 22:23:26 +02:00
Víctor Déniz 033c5fd4ff Merge branch 'MDL-71128-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-04-06 19:50:54 +01:00
Eloy Lafuente (stronk7) 66dbfadd2d MDL-71264 behat: Change date(time) element update order
This includes 2 change to the order date(time) elements are filled,
each one addressing one type of problem, where current order is
problematic and can lead to unexpected dates.

1) Changing date, when current month only has X days and target
   month has more than X days. Example, being 1 April, change
   the date to 31 May.
     This is solved by changing the order of introduction
     from current D => M => Y to Y => M => D.
2) Changing date, when target month only has X days and current
   month has more that X days. Example, being 31 March, change
   the date to 28 Feb.
     This is solved by always setting the D to 1, before the
     Y => M => D sequence commented @ 1) begins.
2021-04-06 16:25:49 +02:00
Eloy Lafuente (stronk7) 42200cfd95 MDL-71264 behat: New feature covering all day/month/year date changes
Because of the order that dates and datetimes are filled by behat
sometimes there are some intermediate results that are impossible
and then the form (javascript) automatically reacts and fixes the
date, ultimate leading to a different date that the one we wanted
to set with Behat.

This is noticeable when switching between months (with some day
being the last day of the month) and the 2 months have a different
number of days. For example April date => March date (or the opposite).

This test covers all the critical changes (day, month and year),
back and forth. All times are Perth/Australia.
2021-04-06 16:25:49 +02:00
Sara Arjona 89cab88a3a on-demand release 3.11dev+ 2021-04-06 15:30:53 +02:00
Sara Arjona 26e3915793 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-04-06 15:30:51 +02:00
sam marshall fdcb789242 MDL-71215 Acceptance test: Missing Behat for webservice service_users 2021-04-06 15:18:01 +02:00
Adrian Greeve e7022adf8f Merge branch 'MDL-70817-311' of git://github.com/abgreeve/moodle into MOODLE_311_STABLE 2021-04-06 16:36:25 +08:00
Adrian Greeve 285011017c MDL-70817 lib: Update the install xml file to use the correct length.
The showactivitydates field had the wrong length of 4. This changes
it to 1.
2021-04-06 15:24:00 +08:00
Michael Hawkins 0adce7c350 MDL-70595 core: Updated security.txt expiry 2021-04-06 13:13:31 +08:00
Adrian Greeve 4025e4d726 Merge branch 'MDL-70817-311-8' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-06 12:55:32 +08:00
AMOS bot 14eb59b52b Automatically generated installer lang files 2021-04-06 00:07:41 +00:00
Paul Holden c3b4e76768 MDL-70099 enrol: increase accuracy of current enrolments by date.
By rounding the current time it was possible that the most recently
created user enrolments (e.g. self enrolments) were being excluded.

This would manifest itself in a user being enrolled on a course,
but it not appearing under "My courses" navigation or on their own
Dashboard until the rounded time had caught up with the current
time.
2021-04-05 19:32:25 +01:00
Paul Holden 28da12e05c MDL-71003 user: fix alignment of autocomplete participant filters. 2021-04-04 23:21:20 +01:00
Paul Holden 998ac6ac22 MDL-70917 tool_behat: fix profile/replace option comparison.
The `isset` call always returned true for the 'replace' option,
because even if not specified it receives a non-null value. The
`strpos` call now does a strict equality check rather than
greater-than-or-equal (which always returns true).
2021-04-04 23:18:30 +01:00
Paul Holden 969114e23d MDL-70763 core: export preferences for correct user.
Ensure we are using the ID of the given user rather than falling
back to that of the current user during privacy export.
2021-04-04 23:15:34 +01:00
Paul Holden 0747f473fb MDL-70763 quiz_overview: export preferences for correct user. 2021-04-04 23:15:34 +01:00
Paul Holden 95aa0b1802 MDL-70763 gradereport_grader: export preferences for correct user. 2021-04-04 23:15:34 +01:00
Paul Holden 7365786853 MDL-66475 task: fix random timing failures in logger cleanup test. 2021-04-04 23:12:49 +01:00
sam marshall 200d01b08e MDL-71215 core_user: User fields - remaining deprecated functions
This change removes references in code and comments to a few
deprecated functions that were accidentally missed in the larger
change.

The code changes only affect service_users.php. I made it support
custom user profile fields in this query, because it was easy
enough, rather than adding another TODO to fix later.
2021-04-04 15:50:47 +02:00
AMOS bot 3c466df88f Automatically generated installer lang files 2021-04-04 00:07:37 +00:00
Jun Pataleta 25ebbe21f0 MDL-70817 admin: Remove heading for showcompletionconditions
It should be under the "Completion tracking" subheading just like in
the course form.
2021-04-02 21:56:22 +08:00
Simey Lameze 5d1e66df65 MDL-70781 completion: behat coverage for new setting
Part of MDL-70817
2021-04-02 21:56:22 +08:00
Simey Lameze 94a8b91cd3 MDL-70781 course: setting for displaying completion conditions
Part of MDL-70817
2021-04-02 21:56:22 +08:00
Simey Lameze 79622a47c8 MDL-70782 course: behat coverage for new setting
Part of MDL-70817
2021-04-02 21:56:22 +08:00
Simey Lameze 8b47f16926 MDL-70782 course: add setting to show activity dates
Part of MDL-70817
2021-04-02 21:56:22 +08:00
Jun Pataleta 437b0ff331 MDL-70817 mod_choice: Behat tests for the activity completion info 2021-04-02 21:56:22 +08:00
Jun Pataleta dcba388e03 MDL-70817 mod_choice: Show choice activity info 2021-04-02 21:56:22 +08:00
Jun Pataleta cafe2f95ee MDL-70817 core_course: Create an activity information output component
The activity information output component displays information about
an activity module that can contain:
1. Activity dates
2. Completion information
   a. A manual completion button; or
   b. A list of automatic completion conditions and their statuses.

This patch also includes a new JS module called
core_course/manual_completion_toggle for toggling the
completion state of activities that support manual completion.
2021-04-02 21:56:22 +08:00
Jun Pataleta a1b3596cb8 MDL-70817 core_course: Add manual completion toggle to repository
Add the functionality of toggling the completion state of an
activity with manual completion to the core_course/repository
JS module.
2021-04-02 21:56:22 +08:00
Jun Pataleta 0d0d2db661 MDL-70817 core_course: Convert core_course/repository to ES6 2021-04-02 21:56:22 +08:00
Jun Pataleta 90e30c02cb MDL-70817 core: Allow the manual completion update WS function for AJAX
Allow the core_completion_update_activity_completion_status_manually
web service function to be called from AJAX as well. This is needed
by the new manual completion toggle button in the
core_course/completion_manual template.
2021-04-02 21:56:22 +08:00
Jun Pataleta 430d25d96f MDL-70817 core_completion: Unit tests for cm_completion_details 2021-04-02 21:56:22 +08:00
Jun Pataleta 34a690634d MDL-70817 core_completion: Course module completion details
* Class cm_completion_details builds the custom completion details
for an activity module.
2021-04-02 21:56:22 +08:00
AMOS bot b048ee4925 Automatically generated installer lang files 2021-04-02 00:07:28 +00:00
Alison Blomenberg 672ba41c1c MDL-62244 Resource: label view redirects to label, not course 2021-04-01 11:55:13 -06:00
Jess Ansell 77688321a6 MDL-71012 setup: Return 500 error code for setup errors. 2021-04-01 13:50:52 +01:00
Leon Stringer 092d278806 MDL-60490 tool_lp: Missing div close
Mustache template had opening <div> with missing </div>.
2021-04-01 12:18:52 +01:00
sam marshall 8d9fe81a12 MDL-70446 search_solr: File indexing can fail due to multipart upload
Due to Solr bug SOLR-15039, uploading files for indexing can fail if
it uses multipart upload. This changes it to use direct binary upload.

Unfortunately, the direct binary version in PHP curl only supports a
string, so we have to load the file into memory. I added extra code to
restrict the size of files indexed to (memory limit - 100MB), which is
usually 284MB unless configured differently because cron runs under
MEMORY_EXTRA.
2021-04-01 11:20:28 +01:00
Mikhail Golenkov 8660e9a168 MDL-71254 oauth2: Redirect to the login page in case of error 2021-04-01 13:37:53 +11:00
AMOS bot 4c9a2e4aa0 Automatically generated installer lang files 2021-04-01 00:07:30 +00:00
Jun Pataleta 74cef5e157 MDL-71178 completion: Rebuild course cache before completion reset
Before resetting completion states during module update, we need to
rebuild the course cache first in order to properly reset the completion
states. Otherwise, calls to methods that fetch course module info
via cache (e.g. cm_info::create()) will fetch outdated information.
2021-04-01 00:47:08 +08:00
Juan Leyva 5cfb30aa97 MDL-70863 mod_forum: Allow NULL in timecreated 2021-03-31 17:55:04 +02:00
Jun Pataleta 8eb16699ed Merge branch 'MDL-70895_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2021-03-31 21:26:33 +08:00
Mahmoud Kassaei 75614af822 MDL-70895 Questions: Default options when creating a question 2021-03-31 09:23:42 +01:00
Adrian Greeve 68964e7823 Merge branch 'MDL-37655_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-31 15:46:20 +08:00
Eloy Lafuente (stronk7) d1c41b4dbb MDL-37655 phpunit: Avoid having multiple testcase classes in 1 file
Note that there wasn't any case of multiple testcase classes in
1 file. All the cases reported in the issue were false positives
caused but other "mock/fixture" files being named _test.

So all this issue does is:

1) rename any _test suffixed class in test files, because we are
   going to start renaming a lot of test classes to _test.

2) ensure that the 2 test case classes modified in this issue,
   are already observing the filename = classname rule that will
   be implemented soon (and verigy it works).
2021-03-30 19:17:59 +02:00
Víctor Déniz 3c5a338cd4 on-demand release 3.11dev+ 2021-03-30 15:39:41 +01:00
Víctor Déniz 2cb1f59249 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-03-30 15:39:34 +01:00
Paul Holden 22d928d0bb MDL-65687 message: increase confirmation dialog zindex.
Make sure that confirmation dialogs (such as block/unblock user,
delete conversation) are shown with prominence in the messaging
drawer.
2021-03-30 10:50:40 +01:00
Tomo Tsuyuki cf176f2a7f MDL-71136 backup: Fix moodle_exception path. 2021-03-30 10:56:30 +11:00
Mikhail Golenkov 0b4161c14d MDL-71233 backup: Fix Moodle version for MDL-69418 2021-03-30 10:43:53 +11:00
Paul Holden 6dfbe60b9c MDL-68635 tool_cohortroles: observe user initial table filter. 2021-03-29 14:12:29 +01:00
Paul Holden 81900d5e57 MDL-68716 mod_forum: extra column sorting options in privacy export.
Accounts for extra sort options that were added in bc23cbaf.
2021-03-29 14:05:49 +01:00
Eloy Lafuente (stronk7) d24a83f5e7 Merge branch 'MDL-70963-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-29 12:39:49 +02:00
Sara Arjona c2c04214bb MDL-70963 core_badges: Use expected JSON format for OBv2.1
This patch adds some changes to guarantee that OpenBadges 2.1 (OBv2.1)
will return always the same JSON format that OBv2.0 (because the only
difference between both versions it's the BadgeConnect API).
2021-03-29 10:03:15 +02:00
Andrew Nicols d940eabc2c Merge branch 'MDL-70962-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-29 11:58:54 +08:00
Andrew Nicols 3815071676 Merge branch 'MDL-71004_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-29 11:54:13 +08:00
AMOS bot a557cc3998 Automatically generated installer lang files 2021-03-29 00:07:28 +00:00
Eloy Lafuente (stronk7) 859a5589b2 Merge branch 'MDL-68496-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-03-28 23:48:26 +02:00
Eloy Lafuente (stronk7) 0bbf27a673 Merge branch 'MDL-71131-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-03-28 23:21:45 +02:00
AMOS bot fdbf5546bb Automatically generated installer lang files 2021-03-28 00:07:26 +00:00
Eloy Lafuente (stronk7) b56163cbc1 Merge branch 'MDL-71099-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-03-27 10:17:51 +01:00
Dan Marsden ab69e730bd MDL-32226 mod_quiz: Add Plagiarism hooks to quiz and essay question. 2021-03-27 09:15:09 +13:00
Víctor Déniz baa15131af Merge branch 'MDL-70537-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-03-26 20:14:49 +00:00
Paul Holden 8576829c9b MDL-70142 admin: preserve selected cache definitions in the form.
By not redirecting when we are already on the purge caches page we
can preserve the submitted form data, allowing users to easily
repeat the previous action.
2021-03-26 13:09:24 +00:00
Sara Arjona a2e48a4645 MDL-70722 oauth2: move Nextcloud methods to service class 2021-03-26 09:21:11 +01:00
Sara Arjona ab810ed1f6 MDL-70722 oauth2: move Microsoft methods to service class 2021-03-26 09:21:11 +01:00
Sara Arjona a6c03da192 MDL-70722 oauth2: move Facebook methods to service class 2021-03-26 09:21:11 +01:00
Sara Arjona faef24307f MDL-70722 core_badges: minor fixes from MDL-70689
In MDL-70689, Eloy and Helen suggested some fixes to improve this patch.
As this is a followup issue to move the pending services, this
very first commit will fix pending things raised in the parent issue.
2021-03-26 09:21:11 +01:00
Shintaro Fujiwara e271fd3a79 MDL-69304 gradeimport_csv: Validate if the user id is numerical. 2021-03-26 10:35:51 +09:00
Paul Holden 35efccacee MDL-70962 forms: catch modal exceptions when getting body content.
They are thrown in the following circumstances:

 * The dynamic form class doesn't exist;
 * It does exist but it's `check_access` method throws exception

Co-Authored-By: Andrew Nicols <andrew@nicols.co.uk>
2021-03-25 17:26:33 +00:00
Víctor Déniz 67943be4af Merge branch 'MDL-71194-311' of git://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2021-03-25 15:13:50 +00:00
sam marshall 3c688fd9cb MDL-71131 Admin: Users page incorrectly showing all name fields 2021-03-25 13:50:08 +00:00
sam marshall 3dee5cd74c MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:48:04 +00:00
Víctor Déniz a4a5863645 Merge branch 'MDL-70842_311_v3' of https://github.com/TomoTsuyuki/moodle into MOODLE_311_STABLE 2021-03-25 12:59:09 +00:00
Noel De Martin c846c46e4e MDL-71194 behat: Fix app tests 2021-03-25 13:52:41 +01:00
Andrew Nicols 7ad0fea3b8 Merge branch 'MDL-70318-311' of https://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-03-25 12:31:44 +08:00
Andrew Nicols 4c9a7df3fb Merge branch 'MDL-65776-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-25 11:07:24 +08:00
Andrew Nicols dc6079cd39 Merge branch 'MDL-70871-311' of git://github.com/roland04/moodle into MOODLE_311_STABLE 2021-03-25 08:12:08 +08:00
AMOS bot 6c6c6c37af Automatically generated installer lang files 2021-03-25 00:07:31 +00:00
Andrew Nicols 66a719d48f Merge branch 'MDL-70980-311' of git://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2021-03-25 08:06:47 +08:00
Brendan Heywood 67fcd43d15 MDL-67882 message: Add notification setting changes to config_log 2021-03-25 10:37:16 +11:00
Eloy Lafuente (stronk7) 42484d7ae8 MDL-71004 git: Ignore moodle-plugin-ci.phar in any directory 2021-03-24 20:10:29 +01:00
Víctor Déniz c54de9bec2 weekly release 3.11dev 2021-03-24 14:20:41 +00:00
Víctor Déniz 3c3f39d5b8 Merge branch 'MDL-71149_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-24 13:36:32 +00:00
Eloy Lafuente (stronk7) a771fddb27 Merge branch 'MDL-71182-311-2' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-03-24 10:49:32 +01:00
Tim Hunt 8b7aefc1a1 MDL-70269 ClamAV: make retry the default option on failure 2021-03-24 09:35:38 +00:00
Simey Lameze 5efbb6402b MDL-71182 calendar: add logic for category events in get_context
This commit adds the missing logic for category events in
get_context() method. Without this fix, users will get errors
if they have category events with userid set to 0.
2021-03-24 17:33:50 +08:00
Tomo Tsuyuki 35892aedce MDL-70842 mod_assign: Add more cases to add file to archive 2021-03-24 16:02:02 +11:00
Andrew Nicols e36710af52 MDL-70802 javascript: Normalise component consistently in templates 2021-03-24 11:18:33 +08:00
Simey Lameze 41cbdeccab MDL-71182 calendar: Revert "Merge branch 'MDL-67494-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE"
This reverts commit 9f5794834e, reversing
changes made to d30b045210.
2021-03-24 09:18:16 +08:00
Víctor Déniz 7fb15daff2 Merge branch 'MDL-71022-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-23 23:01:00 +00:00
Dan Marsden b5070635c1 MDL-71174 core: Improve phpdoc for plagiarism_update_status 2021-03-24 11:41:47 +13:00
Víctor Déniz f33dec405a Merge branch 'MDL-70727-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-03-23 18:23:32 +00:00
Charlotte Peachey 32eec4b0f5 MDL-71181 Quiz: Pass grade not displayed on front page 2021-03-23 16:48:02 +00:00
Mikel Martín 75627cc770 MDL-70871 user: Move 'Show all X' functionality to dynamic_table 2021-03-23 09:57:52 +01:00
Mikel Martín 96668b7c35 MDL-70871 table: Add 'Show all X' functionality to dynamic_table 2021-03-23 09:57:52 +01:00
Paul Holden a071252a05 MDL-71090 tool_dataprivacy: convert cancellation of requests to ES6. 2021-03-23 08:49:15 +00:00
Paul Holden 2eee07daa4 MDL-71090 tool_dataprivacy: convert contact DPO to modal forms. 2021-03-23 08:49:15 +00:00
Travis CI 5a3e84a5a2 Merge branch 'MDL-69792-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-23 13:55:09 +08:00
Travis CI 474a3cecfe Merge branch 'MDL-71104-311-2' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-03-23 13:47:02 +08:00
Michael Hawkins e9b94ceb74 MDL-71104 core_completion: Fix fetching of grade completion status
We should be able to fetch the grade completion status for modules
that do not have custom completion configured. This also improves
unit testing coverage.
2021-03-23 12:49:30 +08:00
Jun Pataleta 2323a27150 MDL-71104 completion: Fix completion_info::get_data() unit tests
* Fixed inverted $sameuser test data.
* Fixed caching expectation check. Caching only relies on whether the
user accessing the completion data is the same user or not.
* Fixed checking for the caching of other modules. Should have been
checking cm ID and not instance ID.
* Additional test case when whole course parameter is passed as
true, but the requesting user is different from the target user.
2021-03-23 12:49:30 +08:00
Thinh Pham 746e349524 MDL-71087 File picker: Focus lost after 'Create folder' 2021-03-23 10:47:33 +07:00
Andrew Nicols fa58d33b66 Merge branch 'MDL-71039-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-23 11:18:24 +08:00
Andrew Nicols 13fcc7c4a6 Merge branch 'MDL-70313-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-03-23 10:00:19 +08:00
Andrew Nicols 93ad6a244e Merge branch 'MDL-69036-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-23 09:52:02 +08:00
Andrew Nicols 3488ff7aab Merge branch 'MDL-67870-311' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-03-23 09:24:41 +08:00
Andrew Nicols f0b3a74482 MDL-69256 tests: Fix random slow test failures in completion cron 2021-03-23 08:08:20 +08:00
David Mudrák 4983142e5a MDL-71169 external: Do not explicitly specify the default methodname 2021-03-22 15:49:59 +01:00
David Mudrák 9da861ea63 MDL-71169 external: Use execute as the default external method name
If the 'methodname' is not explicitly specified in db/services.php,
expect it to be 'execute'.
2021-03-22 15:35:52 +01:00
Mark Nelson e4453923aa MDL-71170 customfield_text: use correct error string 2021-03-22 21:56:35 +08:00
Sara Arjona eb813c0b95 MDL-69415 core_h5p: prepend H5P libraries in autoloader
Core and mod_hvp are using the same namespace for some H5P
libraries. This is causing some random errors.
In order to get the expected behaviour in Moodle core, this patch
prepends H5P libraries in order to guarantee they are loaded first.
Plugins using same libraries will need to use a different namespace
if they overlap and a different version of these libraries should
be used.
2021-03-22 12:40:56 +01:00
Ferran Recio d2591bd149 MDL-70980 mod_h5pactivity: fix review mode 2021-03-22 10:57:57 +01:00
Mihail Geshoski 66f592e71b MDL-67870 backup: Skip value change if setting is locked by hierarchy
The given condition in the if statement did not take into account cases
when the setting is locked by hierarchy. Settings which are locked by
hierarchy should should keep their current values which were inherited
from the parent.
2021-03-22 15:33:39 +08:00
Andrew Nicols bd12ca2001 MDL-68496 Grunt: Stylelint should only lint relevant component files
Prior to this change the Grunt stylelint command was too greedy when
determining which files hsould be linted.

This change modifies the watch command to only watch relevant files and
subdirectories of each component directories. This means that unrelated
CSS and SCSS files are no longer watched for changes, and has the added
benefit of significantly increaseing the startup speed of grunt.

Without this patch applied the watch tasks were checking for matches in
the node_modules, and vendor directories.
2021-03-22 15:18:47 +08:00
Andrew Nicols 608852f3a0 Merge branch 'MDL-70816-311-4' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-03-22 13:33:48 +08:00
Shamim Rezaie 0a2c40f76e MDL-70816 mod_choice: activity_dates implementation 2021-03-22 16:19:03 +11:00
Shamim Rezaie 7c16ba2fa4 MDL-70816 core: Activity date details base class
* Base class for fetching an activity module's important date for a user
2021-03-22 16:19:02 +11:00
Andrew Nicols eee0b6865c MDL-71159 output: Do not run content prefetch during install 2021-03-22 13:15:26 +08:00
Andrew Nicols 76b7da2e9f Merge branch 'MDL-71139-311-trademark' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-03-22 12:00:08 +08:00
Andrew Nicols 9882503572 Merge branch 'MDL-70919-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-22 07:48:42 +08:00
Eloy Lafuente (stronk7) 0fc17af158 MDL-71149 install: update the list of stale files for 3.11 2021-03-19 17:31:11 +01:00
Sara Arjona e2585ce116 MDL-65776 libraries: Set moodle files after jsbeautify upgrade 2021-03-19 15:23:06 +01:00
Sara Arjona ec602cf244 MDL-65776 libraries: Upgrade jsbeautify to 1.13 2021-03-19 15:23:05 +01:00
Sara Arjona 1517765cca MDL-69792 core_badges: deprecated backpack.js and BADGE_BACKPACKURL
Final deprecation for constant BADGE_BACKPACKURL (it has been removed)
and badges/backpack.js file (it has been removed too).
Besides, some methods have started the deprecation process too:
 - badges_check_backpack_accessibility
 - badges_setup_backpack_js()
 - badges_local_backpack_js()

Apart from that, string 'addbackpack' has been deprecated here
because it's not used anywhere.
2021-03-19 15:14:09 +01:00
Sara Arjona 66efa30293 MDL-71116 core_badges: Backpack URLs with more than 50 chars
Backpack URLs (web and API) can have up to 255. However, the form
for creating/editing them, doesn't allow URLs with more than 50
characters. This patch align limitation to DB value (255).
2021-03-19 15:09:02 +01:00
Eloy Lafuente (stronk7) c1db56b501 weekly release 3.11dev 2021-03-19 14:06:25 +01:00
Eloy Lafuente (stronk7) b120dc8a92 NOBUG: Fixed file access permissions 2021-03-19 14:06:25 +01:00
Eloy Lafuente (stronk7) c67cafdd64 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-03-19 14:06:21 +01:00
Ilya Tregubov c8edf4e5c8 MDL-70318 core: Moodle customisations. 2021-03-19 10:19:33 +02:00
Ilya Tregubov 62d1082bab MDL-70318 core: Upgrade CFPropertyList to 2.0.2. 2021-03-19 10:19:33 +02:00
Andrew Nicols 5394aac8db MDL-68496 grunt: Restructure grunt tasks into subdirectories
Prior to this change all Grunt features were in a single Gruntfile.js
but this has become difficult to manage and maintain.

This commit moves the existing dependencies for component calculation
and babel moduel definition into a new .grunt directory, and
restructures the existing tasks in Gruntfile.js into separate task
configuration files.

This improves the maintainability of the Grunt build system and allows
for easier future expansion.
2021-03-19 12:55:35 +08:00
sam marshall 45844a161c MDL-70537 Availability: Avoid recursive calls to $cm->name
These recursive calls didn't work in PHP 7.3 and below, but in PHP
7.4 they also cause a fatal error which means if you have invalid
availability data, the whole page might die.
2021-03-18 15:55:31 +00:00
Marina Glancy f878850277 MDL-70919 core_form: non-static method can not be called statically 2021-03-18 12:16:12 +01:00
Sujith Haridasan 2b0302d68f MDL-70769 libraries: Upgrade mimetex to 1.77 version
Upgrade mimetex to version 1.77. The steps followed
remained the same described in readme_moodle.txt.
This time we have made support for 64 bit architecture.
Hence all the binaries created now work with 64 bit only.
Following are the binaries which are upgraded:
1. Linux
2. Arm(aarch64)
3. Windows(exe)
4. Freebsd
5. Mac(darwin)

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-03-18 16:34:52 +05:30
Sujith Haridasan df05266852 MDL-70769 libraries: Upgrading mimetex binaries
Upgrading mimetex binaries to version 1.77

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-03-18 16:34:45 +05:30
Chris Brown 0d53b6cf84 MDL-71139 trademark: Improve the trademark messaging 2021-03-18 10:31:56 +01:00
Jun Pataleta 9f904c2b5e Merge branch 'MDL-70992-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-03-18 12:23:39 +08:00
Adrian Greeve b443f37f91 Merge branch 'MDL-70924-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-18 11:52:51 +08:00
Adrian Greeve 2b2e3e8ef8 Merge branch 'MDL-71048-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-18 11:10:59 +08:00
Adrian Greeve 79ed95d0c3 Merge branch 'MDL-70977-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-18 10:28:55 +08:00
Jun Pataleta 32d345ef1a Merge branch 'MDL-70978-311' of git://github.com/aanabit/moodle into MOODLE_311_STABLE 2021-03-18 09:55:53 +08:00
Adrian Greeve a2ace81606 Merge branch 'MDL-71068-protectusername-confirmed-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-03-18 09:52:10 +08:00
AMOS bot ad324a8543 Automatically generated installer lang files 2021-03-18 00:07:28 +00:00
Eloy Lafuente (stronk7) c0c276e49d Merge branch 'MDL-70901-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-18 00:40:55 +01:00
Eloy Lafuente (stronk7) 0ed97f8d8f Merge branch 'MDL-70896-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-18 00:34:13 +01:00
Eloy Lafuente (stronk7) d42107e093 Merge branch 'MDL-70968-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-18 00:29:46 +01:00
Eloy Lafuente (stronk7) 6f2b5817d6 Merge branch 'MDL-70893-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-18 00:23:36 +01:00
Eloy Lafuente (stronk7) b76e9b6551 Merge branch 'MDL-70689-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-17 23:20:50 +01:00
Jun Pataleta 3a9b41613c Merge branch 'MDL-71036_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-17 20:05:17 +08:00
Ilya Tregubov 6fb84d6003 MDL-70311 theme_boost: upgrade bootstrap to version 4.6.0 2021-03-17 12:27:19 +02:00
Brendan Heywood ccfe2c4aba MDL-71068 login: Fix edge cases with $CFG->protectusernames 2021-03-17 17:38:39 +11:00
sangnguyen 2929e6234f MDL-70992 Folder: Unnecessary tab stops to the left of files 2021-03-17 09:34:23 +07:00
Eloy Lafuente (stronk7) 20149b7cf7 Merge branch 'MDL-70565-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-16 22:49:05 +01:00
Eloy Lafuente (stronk7) 88847544c4 Merge branch 'MOODLE_311_MDL-71044_v3' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-03-16 22:39:02 +01:00
Paul Holden 649f2cd8c1 MDL-71128 mod_quiz: escape question idnumber on display. 2021-03-16 20:28:42 +00:00
Eloy Lafuente (stronk7) 50520ae4ad Merge branch 'MDL-67748-311-managewebservices' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-03-16 19:29:04 +01:00
David Mudrák 2df0bcc7fd MDL-67748 admin: Add Behat tests for tokens filtering features
Credit goes to Andrew for Behat data generators for webservices.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2021-03-16 10:47:01 +01:00
Sara Arjona e37ef529db Merge branch 'MDL-44613-integration-311' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-03-16 08:26:57 +01:00
Eloy Lafuente (stronk7) 24c62a15c5 MDL-69474 accessibility: page->url can be not set, protect against that
Both in unit tests, but also in other areas (say blocks, for example)
it's possible that page->url has not been set yet.

So, let's change current code to always check if we have something
(page->url) to compare.

Note the use of has_set_url() is needed, because page->url is magic
method and it doesn't work as expected. Hate magics!
2021-03-16 12:56:40 +08:00
Mihail Geshoski a7fb8415b8 MDL-44613 mod_assign: Fix behat failure in classic
The link to the calendar page is missing in the navigation block in
classic which causes a behat failure in the 'Set availibility dates
for an assignment' feature. The fix includes adding the calendar block
to the Course page which can be used to navigate to the calendar page.
2021-03-16 11:29:57 +08:00
Adrian Greeve 3972a25d6a Merge branch 'MDL-70780-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-03-16 11:15:12 +08:00
Paul Holden 3e5354717d MDL-71064 media_videojs: enable hotkeys support in player.
Hotkeys were enabled by default, except fullscreen (hotkey "f").
2021-03-15 22:39:11 +00:00
Paul Holden 29f4175b6f MDL-65616 message: always notify user after sending contact request. 2021-03-15 18:56:44 +00:00
David Mudrák 71e7806a18 MDL-67748 admin: Do not show missing capabilities for mobile app service
We used to display capabilities like "Manage any calendar entries",
"Delete evidence", "Manage competency frameworks", "View hidden courses"
and others as "Missing capabilities" for the mobile app service tokens.

This gave dangerous impression that the app will not work for students
without these capabilities granted. There are known cases of admins who
started to grant all these caps to the Authenticated user role because
they were afraid the app would not work for them.

The problem here is that the official mobile app service includes some
functions that have these capabilities declared as required. But they
are not really required to use the app. Either the app makes its own
clever checks of capabilities before calling the functions, or sometimes
the capabilities are not even correctly declared.

It is safer for everybody to display this information for custom
services only where the risk of the falsely missing caps is lower and
the information is more accurate.

Also, the help text has been improved so it does not suggest that these
capabilities must be always added. We do not know why the service has
them declared. In some cases, a service has capabilities declared just
because it makes use of them in the if-then fashion.

Additionally, the patch also displays the service short name because it
is actually needed to know.
2021-03-15 19:09:26 +01:00
David Mudrák bbeba0756d MDL-67748 admin: Show user identity fields on the manage tokens page
On sites with many users, the fullname itself may not be unique
identifier of users. Display the user identity fields below the token
owner's name.
2021-03-15 19:09:26 +01:00
David Mudrák 4d49f07bbb MDL-67748 admin: Add filter to the WS tokens management page
The patch adds ability to filter the list of token by the token value,
the user and the service. Also the button to create a new token is made
more prominent and easier to spot.
2021-03-15 19:09:26 +01:00
David Mudrák 741ea63a70 MDL-67748 admin: Improve the display of tokens the user cannot see 2021-03-15 19:09:26 +01:00
David Mudrák cb7d5a0939 MDL-67748 admin: Refactor tokens management as an external page
No need to have a dedicated admin_setting_managewebservicetokens admin
setting subclass, and yet do not use almost any of its features. So the
patch merges the list and the forms handling into a single external
page.

Similarly, it feels like overkill to have a renderer method for a
simple confirmation widget - especially given that the URLs were
hard-coded in it. So that one was dropped.
2021-03-15 19:09:26 +01:00
David Mudrák fb91df08b3 MDL-67748 admin: Improve the display of missing capabilities
The patch improves the display of the missing capabilities on the Manage
tokens page and the Select authorised users page. The list of
capabilities is rendered in a collapsible area and does not occupy too
much space by default.

Additionally on the later page, the patch improves the display of the
list of existing authorised users so that it respects the configured
identity fields.
2021-03-15 19:09:26 +01:00
David Mudrák 2a189a9fc2 MDL-67748 admin: Improve get_missing_capabilities_by_users()
The previous implementation falsely reported all implicit capabilities
inherited from the authenticated user archetype. That caused a lot of
capabilities reported as missing, even if they were correctly granted.

This new implementation uses a different logic. Instead of seeking for
explicitly assigned capabilities, it searches for capabilities that are
not assigned to any of the user's role across the system.

Please refer to the inline documentation. This should be still used for
informative reports only, not for actual permissions evaluation. The
context has been ignored here, as well as all the overrides etc. This
patch just makes it a lesser evil.
2021-03-15 19:09:26 +01:00
David Mudrák cd7c805d0a MDL-67748 admin: Simplify the webservice token form
We can now use the autocomplete element to select the user. No need to
for the legacy behaviour.
2021-03-15 19:09:26 +01:00
David Mudrák 29cfae4835 MDL-67748 admin: Respect the viewfullnames cap at manage tokens table 2021-03-15 19:09:26 +01:00
David Mudrák cf4dbc4097 MDL-67748 user: Add new core_user/form_user_selector JS module
The module provides AJAX support for the autocomplete form element.
2021-03-15 19:09:26 +01:00
David Mudrák b6be1e9822 MDL-67748 user: Add a new core_user_search_identity external function
The purpose of this external function is to provide data for
asynchronous user selectors and similar widgets. It allows to search
users matching the given query in their name or other available identity
fields.
2021-03-15 19:09:25 +01:00
Eloy Lafuente (stronk7) df5a880db6 Merge branch 'MDL-69474-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-03-15 16:54:51 +01:00
David Mudrák 4d68856c76 MDL-67748 user: Fix @link docs tag usage
Not related to this issue, just spotted while working on it.
2021-03-15 16:30:21 +01:00
David Mudrák 582745e5b9 MDL-67748 admin: Move the web service token form to its own file 2021-03-15 16:30:16 +01:00
David Mudrák 1ab5c29ead MDL-67748 admin: Move the web services under the server administration
I suppose the original reasoning was that the web services protocols are
pluggable and that plugins can provide external function. But those are
not good reasons to put the whole Web services section under plugins.
Web services are not a plugin type and they always felt very
counter-intuitive there.

From the server administrtaion perspective, web services are similar to
scheduled tasks and therefore, they should live in the same section.
2021-03-15 16:21:23 +01:00
Sara Arjona 3329494332 Merge branch 'MDL-44613-311-1' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-03-15 15:53:44 +01:00
Paul Holden 5543e99d6d MDL-70977 mod_forum: fix empty equality check updating post content.
Using the external method for updating posts, the check for empty
subject/message content wasn't correct (disallowed the string '0'),
in addition to being impossible to set a posts message format
property to FORMAT_MOODLE (integer 0).
2021-03-15 12:48:59 +00:00
Paul Holden e2e4b15285 MDL-70924 course: ensure required fields present when getting courses. 2021-03-15 12:46:41 +00:00
Jun Pataleta 38607b4b93 Merge branch 'MDL-66667-cache-course-image-MOODLE_311_STABLE' of https://github.com/dmitriim/moodle into MOODLE_311_STABLE 2021-03-15 17:18:59 +08:00
Adrian Greeve 8dad051443 Merge branch 'MDL-70306-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-03-15 11:16:01 +08:00
Peter Dias 17779918f9 MDL-70306 auth: Update the thirdpartylib.xml 2021-03-15 11:10:12 +08:00
Peter Dias e72dbd0752 MDL-70313 core: Update the thirdpartylib.xml 2021-03-15 10:28:03 +08:00
Peter Dias c4b0667582 MDL-70313 core: Rebuilt module files 2021-03-15 10:28:03 +08:00
Peter Dias 63b9f338ed MDL-70313 core: Update codemirror to 5.59.4 2021-03-15 10:28:03 +08:00
Dmitrii Metelkin 88a150467f MDL-66667 course: add course image cache 2021-03-15 12:53:40 +11:00
Mihail Geshoski 978348d189 MDL-44613 mod_assign: Automate testing of the assignment availability 2021-03-15 08:26:17 +08:00
Mihail Geshoski 8a7fadc4ee MDL-44613 tool_behat: Update datetime format usages to strftime
Updates all existing datetime format usages to strftime in the
'time to timestamp' transformation in tool_behat behat tests.
2021-03-15 08:26:17 +08:00
Mihail Geshoski 70ae4664e6 MDL-44613 core_message: Update datetime format usages to strftime
Updates all existing datetime format usages to strftime in the
'time to timestamp' transformation in core_message behat tests.
2021-03-15 08:26:17 +08:00
Mihail Geshoski 3bc58c98d0 MDL-44613 behat: strftime format in time to timestamp transformation
Modifies the 'string time to timestamp' behat trasformation to use
userdate() instead of date(). The userdate() method is generally used
throught Moodle for constructing formatted date strings and this change
will provide more consistency and prevent any potential behat failures.
Therefore, if the date format is defined in the given trasformation, it
has to be strftime compatible. Example:
'I should see "##tomorrow noon##%A, %d %B %Y, %I:%M %p##"'
2021-03-15 08:26:17 +08:00
AMOS bot c8a829ea3c Automatically generated installer lang files 2021-03-13 00:07:30 +00:00
Amaia Anabitarte c2c3148664 MDL-70978 core_contentbank: Increasing contrast for unlisted content 2021-03-12 12:49:20 +01:00
Sara Arjona c9110ffdce MDL-70689 oauth2: unit tests for new IMS OBv2.1
Apart from adding new unit tests for covering new IMS OBv2.1 issuer,
some extra tests have been added to test existing issuers and confirm
they are still working as expected after the changes.
2021-03-12 12:33:54 +01:00
Sara Arjona a7229e4ad9 MDL-70689 oauth2: deprecate unused strings 2021-03-12 12:33:54 +01:00
Sara Arjona 9941e04857 MDL-70689 oauth2: self-register IMS OBv2.1 services
IMS OBv2.1 services have a registration endpoint to get client id
and secret.
This patch adds and implements the "register" method for the IMS
Open Badges Connect discovery system, to get the proper client id
and secret values.
2021-03-12 12:33:54 +01:00
Sara Arjona 84e51fb0fd MDL-70689 oauth2: add support to IMS OBv2.1 service
In order to make easier to create and maintain new OAuth2 services,
a couple of classes have been added:

- discovery\* contains methods related to the discovery system. Until
now, only OpenID Connect was supported by Moodle so all the code was
centralised in api.php.
With this patch, as IMS OBv2.1 has a different discovery system, a new
abstract class (base_definition) has been added to be called and let
every discovery system (OpenID Connect, IMS Badge Connect...)
implement their own methods.

- service\* . Instead of keep adding methods to the api, the service
namespace has been created to store all the standard issuer services.
An interface (issuer_interface) has been created and all the services
should implement it.
This patch creates the "IMS OBv2.1" and "Custom" services and moves
the methods for "Google" service because it uses the OpenID connect
discovery system.
2021-03-12 12:33:53 +01:00
Paul Holden dbc7d37685 MDL-70565 user: filter course participants by country. 2021-03-12 09:50:02 +00:00
Eloy Lafuente (stronk7) 0357efb1fc MDL-71036 phpunit: Coding style changes, 99% whitespace only
I've gone over a few of the mofified files (those
which were showing warnings and errors to CiBoT. Some of them
have been fixed completely, while others only have fixed
for the lines belonging to this issue (lib/tests/moodlelib_test.php)
for example.
2021-03-11 23:07:31 +01:00
Eloy Lafuente (stronk7) e2e333c9cd MDL-71036 phpunit: Add all the noticeable changes to upgrade notes 2021-03-11 23:07:31 +01:00
Eloy Lafuente (stronk7) 790237a77f MDL-71036 phpunit: xml config - switch coverage info to new includes
This applies the "whitelist" => "include" changes to all the core
phpunit_coverage_info occurrences, so core won't emit any deprecation
warning (see previous commit).

At the same time, modified a bunch of comments in coverage files
to be more readable/understandable.
2021-03-11 23:07:31 +01:00
Eloy Lafuente (stronk7) a9c0c3d5a9 MDL-71036 phpunit: xml config - deprecate whitelist from coverage
Following the changes in the schema, from "whitelists" to "includes",
we are deprecating these two properties from phpunit_coverage_info:

- whitelistfolders => includelistfolders
- whitelistfiles   => includelistfiles

They will continue working over the deprecation period but the init/util
scripts will throw some warnings about them being deprecated for 3.11 and
the way to replace them.

Standard 2y deprecation applies with final removed to happen @ MDL-71067
2021-03-11 23:07:31 +01:00
Eloy Lafuente (stronk7) d786046e52 MDL-71036 phpunit: xml config - change dist file to spread them to final
Basically switch to 2-space indenting and small tweaks to comments,
so both the main phpunit.xml file and also the individual components
ones, all them based in the dist one will be consistent.
2021-03-11 23:07:31 +01:00
Eloy Lafuente (stronk7) 50e3bb8546 MDL-71036 phpunit: xml config - change generation code to follow xsd
This performs all the changes needed in the util generator to
produce XML files compliant with the new schema (see previous
commit for description of changes).

- All the occurrences in code of filter => coverage.
- All the occurrences in code of whitelist => include.
- Apply all the changes to comply with the new schema.

- Remove processUncoveredFilesFromWhitelist attribute, useless (false
    is its default value, and now have another name).
- Move from 4-spaces indented XML to 2-spaces indented.
- Small linefeed tweaks to generate better-looking XML.
2021-03-11 23:07:31 +01:00
Eloy Lafuente (stronk7) cf38a34904 MDL-71036 phpunit: xml config - add new (9.5) validation xsd
PHPUnit 9 comes with various changes in the XML
configuration file, namely:

  - the old "filter" section has been renamed to "coverage".
  - "whitelist" has been renamed to "include"
  - "exclude" is not a child of "include" anymore, but of "coverage".
  - "include" cannot have configuration attributes anymore, only
    "coverage" can"

Visually it means that the old section (invented example):
```
<filter>
  <whitelist attributes_may_go_here="xx">
    <directory suffix=".php">classes</directory>
    <directory suffix=".php">externallib.php</directory>
    <exclude>
      <directory suffix="_test.php">.</directory>
    </exclude>
  </whitelist>
</filter>
```
Now looks like:
```
<coverage attributes_may_go_here="xx">
  <include>
    <directory suffix=".php">classes</directory>
    <directory suffix=".php">externallib.php</directory>
  </include>
  <exclude>
    <directory suffix="_test.php">.</directory>
  </exclude>
</filter>
```

So, switching to the new xsd so we can validate the remaining changes.
2021-03-11 23:07:31 +01:00
Eloy Lafuente (stronk7) 2d693cda7a MDL-71036 phpunit: Mock->setMethods() silently deprecated
The current ->setMethods() has been silently (won't emit any
warning) in PHPUnit 9. And will stop working (current plans)
in PHPUnit 10.

Basically the now deprecated method has been split into:

- onlyMethods(): To point to existing methods in the mocked artifact.
- addMethods(): To point to non existing (yet) methods in the mocked
  artifact.

In practice that means that all our current setMethods() calls can be
converted to onlyMethods() (existing) and done. The addMethods() is
mostly useful on development phases, not final testing.

Finally note that <null> isn't accepted anymore as parameter to
double all the methods. Instead empty array [] must be used.

Link: https://github.com/sebastianbergmann/phpunit/issues/3770
2021-03-11 23:07:31 +01:00
Eloy Lafuente (stronk7) 3dd26fe334 MDL-71036 phpunit: assertContains() now performs strict comparison
The methods assertContains() and assertNotContains() now perform
strict (type and value) comparison, pretty much like assertSame()
does.

A couple of new assertContainsEquals() and assertNotContainsEquals()
methods have been created to provide old (non-strict) behavior, pretty
much like assertEquals() do.

Apart from replacing the calls needing a relaxed comparison to those
new methods, there are also a couple of alternative, about how to
fix this, depending of every case:

- If the test is making any array_values() conversion, then it's better
  to remove that conversion and use assertArrayHasKey(), that is not
  strict.
- Sometimes if may be also possible to, simply, cast the expectation
  to the exact type coming in the array. I've not applied this technique
  to any of the cases in core.

Link: https://github.com/sebastianbergmann/phpunit/issues/3426
2021-03-11 23:07:31 +01:00
Eloy Lafuente (stronk7) 8940f67486 MDL-71036 phpunit: ->at() matcher is deprecated
Mocke at() matcher is being deprecated with phpunit9 and
will be removed with phpunit10.

Source: https://github.com/sebastianbergmann/phpunit/issues/4297

Luckily we are using those deprecated matchers only in completionlib
tests, so there aren't many cases to modify. Now, we are using
supported matchers (once, exactly, never...) and the tests have
been reorganised to better represent the expected behavior (how
many times stuff is called, with which params and return values).
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7) ad249ced07 MDL-71036 phpunit: Remove custom autoloader
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see https://github.com/sebastianbergmann/phpunit/issues/4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
https://github.com/sebastianbergmann/phpunit/issues/4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7) 6d5eb09218 MDL-71036 phpunit: XML load() method has been moved to new loader class
Used by our custom assertTag() and assertNotTag() assertions, that some
day we should deprecate... the loading of XML content for further
processing has been moved to new classes within the PHPUnit utils. We
are just following the move here.
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7) 23f09c8c1a MDL-71036 phpunit: Fix param check, must be array
With stricter typed param checks in php73, the 7th param of the
getMockForAbstractClass() must be array, so previous code defaulting
to null now throws a TypeError.
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7) 3b37f318d4 MDL-71036 phpunit: Deprecated expectException for notice/warning/error
In PHP 9.1, the use of expectException(PHPUnit\Framework\Error\*) has
been deprecated, that is, when a Notice/Warning/Error/Deprecated
problem is reported. Instead, these new assertions must be used:

- expectDeprecation() for E_DEPRECATED and E_USER_DEPRECATED
- expectNotice() for E_NOTICE, E_USER_NOTICE, and E_STRICT
- expectWarning() for E_WARNING and E_USER_WARNING
- expectError() for everything else

More info:

https://github.com/sebastianbergmann/phpunit/blob/9.0.0/ChangeLog-9.0.md
https://github.com/sebastianbergmann/phpunit/issues/3775

Regexp to find all them:

ag 'expectException.*(Notice|Warning|Error|Deprecated)
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7) c989d6ec61 MDL-71036 phpunit: Renamed various regexp-related assertions
In PHPUnit 9.1, the following regexp-related assertions
have been deprecated and there are new alternatives for
all them:
    - assertRegExp()     -> assertMatchesRegularExpression()
    - assertNotRegExp()  -> assertDoesNotMatchRegularExpression()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

    ag 'assertRegExp|assertNotRegExp' -li
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7) cbf01aa79a MDL-71036 phpunit: Renamed various file-related assertions
In PHPUnit 9.1, the following file-related assertions
have been deprecated and there are new alternatives for
all them:
- assertNotIsReadable()         -> assertIsNotReadable()
- assertNotIsWritable()         -> assertIsNotWritable()
- assertDirectoryNotExists()    -> assertDirectoryDoesNotExist()
- assertDirectoryNotIsReadable()-> assertDirectoryIsNotReadable()
- assertDirectoryNotIsWritable()-> assertDirectoryIsNotWritable()
- assertFileNotExists()         -> assertFileDoesNotExist()
- assertFileNotIsReadable()     -> assertFileIsNotReadable()
- assertFileNotIsWritable()     -> assertFileIsNotWritable()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

ag 'assertNotIsReadable|assertNotIsWritable|assertDirectoryNotExists|\
assertDirectoryNotIsReadable|assertDirectoryNotIsWritable|\
assertFileNotExists|assertFileNotIsReadable|assertFileNotIsWritable'
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7) 87680e8b2b MDL-71036 phpunit: Stricter signature matching 2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7) 77f09eccfe MDL-71036 phpunit: Bump to phpunit 9.5.x 2021-03-11 19:34:28 +01:00
Sara Arjona 295901e6a1 weekly release 3.11dev 2021-03-11 17:18:44 +01:00
Sara Arjona 4d1323a8a8 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-03-11 17:18:42 +01:00
hiendinh c06b63113a MDL-69474 Accessibility: Profile image changes 2021-03-11 16:42:05 +07:00
Jun Pataleta 9fe5ab67f1 Merge branch 'MDL-70911-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-11 17:41:25 +08:00
Sara Arjona 9b74408a33 MDL-70911 core_badges: Add navigation menu in classic
Manage backpacks page wasn't displaying the navigation and administration
menus when using classic theme (it's unrelated to changes done here).
This patch fixes this unexpected behaviour (raised thanks to behat tests).
2021-03-11 09:02:23 +01:00
Adrian Greeve fefc5d6421 Merge branch 'MDL-66025-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-11 11:43:26 +08:00
Adrian Greeve 24ee5bc2c3 Merge branch 'MDL-71026-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-03-11 11:03:28 +08:00
Eloy Lafuente (stronk7) bb4d5dbc25 Merge branch 'MDL-70726-3.11' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-03-11 00:11:44 +01:00
Eloy Lafuente (stronk7) ca6b26fae7 Merge branch 'MDL-70789-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-10 23:52:46 +01:00
Eloy Lafuente (stronk7) 3841ce68cf Merge branch 'MDL-70891-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-10 23:40:07 +01:00
Eloy Lafuente (stronk7) 58afea8c59 Merge branch 'MDL-70967-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-10 23:39:15 +01:00
Sara Arjona 266742e6b4 Merge branch 'MDL-70287-311-3' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-03-10 20:48:57 +01:00
Jun Pataleta ad583bba25 MDL-70815 completion: Cast custom data to array
Since cm_info::customdata can be of any type, we need to cast it to an
array first before checking for custom completion rules. Otherwise,
an exception can be thrown (e.g. customdata has been set as an stdClass)
2021-03-10 19:23:04 +01:00
Jun Pataleta b535cf958a Merge branch 'MDL-45242-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-03-10 23:38:42 +08:00
sam marshall 3cc4d3d2e2 MDL-45242 Course: Enrol feature supports custom profile fields 2021-03-10 10:58:09 +00:00
sam marshall 4f435cc40f MDL-45242 Course: Participants list supports custom profile fields 2021-03-10 10:58:09 +00:00
sam marshall 1d7d3c984d MDL-45242 Admin: User list supports custom profile fields 2021-03-10 10:58:09 +00:00
sam marshall 0919a04311 MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:58:09 +00:00
Jun Pataleta 5e7aeb7841 Merge branch 'MDL-70911-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-10 16:15:36 +08:00
Sara Arjona 52fd43f54d MDL-70911 core_badges: Remove $CFG->badges_site_backpack
The $CFG->badges_site_backpack setting has been completely removed
because it's not required anymore. From now, the primary site
backpack will be the first one in the "Manage backpacks" list (so,
the one with lower sortorder value).
2021-03-10 09:10:32 +01:00
Sara Arjona 3de96274ff MDL-70911 core_badges: Add support to backpacks sortorder
Before removing $CFG->badges_site_backpack setting, admins should be
able to re-order the existing site-backpacks (because then, the first
one will be treated as the default one).
This patch adds the sort order feature to the backpack list.
2021-03-10 08:31:22 +01:00
Sara Arjona 1a2db1297b MDL-70911 core_badges: Move "External backpack" to badges settings
Setting "External backpack connection" has been moved from "Backpack
settings" to "Badges settings" in order to make easier to find and
configure it.
Some extra tests have been added to cover existing behaviour and
confirm is still working as expected.
2021-03-10 08:31:22 +01:00
AMOS bot d6d83cead2 Automatically generated installer lang files 2021-03-10 00:07:24 +00:00
Eloy Lafuente (stronk7) b7b508c5d2 Merge branch 'MDL-63961-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-10 00:19:58 +01:00
Paul Holden 1fc653d7e0 MDL-69036 theme_boost: consistent table row hovering for links.
When hovering over table rows with the `dimmed_text` class we
should consistently set the text/link colour.

Co-Authored-By: Mikel Martín <mikel@moodle.com>
2021-03-09 16:22:33 +00:00
Sara Arjona 6e2a35733d Merge branch 'MDL-70608-311-langimportasync' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-03-09 16:43:01 +01:00
Sara Arjona b8f38fc98b Merge branch 'MDL-70815-311-6' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-03-09 15:18:33 +01:00
Sara Arjona 3d10e6fd7f Merge branch 'MDL-70855-MOODLE_311_STABLE' of https://github.com/dmitriim/moodle into MOODLE_311_STABLE 2021-03-09 14:57:04 +01:00
Jun Pataleta 1292b31ac5 MDL-70815 completion: Test internal_get_state() with custom completion
Use the custom completion implementation for mod_choice to test
completion_info::get_state() to cover the case where the completion
state is being determined from the custom completion condition.
2021-03-09 20:19:00 +08:00
Jun Pataleta f2599eb895 MDL-70815 mod_choice: Unit tests for the custom completion class 2021-03-09 20:19:00 +08:00
Jun Pataleta 4a9aeeca59 MDL-70815 mod_choice: Custom completion implementation 2021-03-09 20:19:00 +08:00
Jun Pataleta ad5b613c86 MDL-70815 core_completion: Update completion_info
* Update completion_info::get_data() to add other completion
information from a new method called get_other_cm_completion_data().
This allows the storage of the completion statuses of the following
completion rules to completion_info objects:
  - 'Students must receive a grade' completion rule.
  - Any custom completion rule defined by an activity.
This allows detailed completion information to be fetched for course
modules.
It also allows custom completion statuses to be cached which will help
reduce DB queries when fetching completion statuses.
* Update update_state() to fetch overall completion state from the
module's activity_custom_completion implementation. Falls back to the
*_get_completion_state() callback function.
* Update internal_set_data() to include the other cm completion data
in the updated cache data for the module instance.
2021-03-09 20:18:59 +08:00
Jun Pataleta 31fcbfc2e2 MDL-70815 core_completion: completion_info::get_grade_completion()
Move the current logic for determining the completion status for the
"Student must receive grade" completion rule to a function so it cann
be reused.
Unit test included.
2021-03-09 20:18:59 +08:00
Jun Pataleta baa0001037 MDL-70815 core_completion: Fix unit tests
* Unit tests for completion_info::get_data() and
completion_info::internal_get_state are mocked which causes failures
with the new implementation. It's more straightforward and realistic
to generate real course and modules to test these methods.
2021-03-09 20:18:59 +08:00
Jun Pataleta e789f013b4 MDL-70815 core_completion: Unit tests for activity_custom_completion
Tests cover
 - get_overall_completion_state()
 - is_available()
 - validate_rule()
Tests don't cover
 - methods that rely on static methods such as:
   - is_defined()
 - static methods in the class because they can't be mocked
 - abstract methods that can be tested better by the plugins
   that extend activity_custom_completion such as:
   - get_state()
   - get_defined_custom_rules()
   - get_custom_rule_descriptions()
2021-03-09 20:18:59 +08:00
Jun Pataleta 6d2e36aa37 MDL-70815 core_completion: Activity custom completion details base class
* Base class for defining an activity module's custom completion details
2021-03-09 20:18:59 +08:00
Andrew Nicols 5a492fd886 MDL-70780 customfield: Rewrite management JS as ES6 2021-03-09 07:56:04 +08:00
Andrew Nicols c6f1ee2977 MDL-70780 customfield: Address random behat fails
A number of behat fails have been creeping in with the customfield code
as behat is moving onto the next step before the current step finishes.

This change introduces some additional pending JS tracking to prevent
this.
2021-03-09 07:52:24 +08:00
Sara Arjona 217377d30f Merge branch 'MDL-70766-auth-config-log-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-03-08 11:39:19 +01:00
sam marshall 5b7b1b9a06 MDL-45242 Lib: Replace direct references to ->showuseridentity 2021-03-08 09:17:04 +00:00
sam marshall 947d8c7806 MDL-45242 Lib: Deprecate field-related library functions 2021-03-08 09:17:04 +00:00
sam marshall 68e576b0ed MDL-45242 Lib: Allow custom profile fields in showuseridentity 2021-03-08 09:17:03 +00:00
sam marshall f21cf5bc86 MDL-45242 Testing: Generators for user profile fields 2021-03-08 09:17:03 +00:00
sam marshall 23c20dc23f MDL-45242 Admin: Added lazy-loading callback to multicheckbox
Currently admin_setting_configselect has lazy-loading support via a
callback function (so you don't have to make pointless single-use
classes for each unusual setting), but this is not present in other
similar types.

This commit adds identical support to
admin_setting_configmulticheckbox.
2021-03-08 09:17:03 +00:00
Mikhail Golenkov 68588a8f47 MDL-71044 backup: backup_cleanup_task task to remove old files 2021-03-07 21:48:47 +11:00
AMOS bot 2e4ed73845 Automatically generated installer lang files 2021-03-07 00:07:24 +00:00
AMOS bot f0b5d067bf Automatically generated installer lang files 2021-03-06 00:07:24 +00:00
Sara Arjona f23ffe6645 weekly release 3.11dev 2021-03-05 16:01:36 +01:00
Sara Arjona c644d61c34 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-03-05 16:01:34 +01:00
Amaia Anabitarte 291ff443a5 MDL-70726 behat: Fixing existing fail tests
Some of the current behat tests were wrong but not failing because of the bug in 'should not exist' step.
Once the bug is fixed, we must fix also wrong behats.
2021-03-05 14:06:43 +07:00
Ilya Tregubov 02af750568 MDL-69680 lib: Fix behat test backup_and_restore.feature 2021-03-04 22:51:18 +01:00
Paul Holden 99e1de9756 MDL-71048 lang: fix null equality check of lang string args. 2021-03-04 19:43:44 +00:00
Marina Glancy 8274935cb1 MDL-71039 core_form: support valuehtmlcallback in autocomplete inline 2021-03-04 13:39:45 +01:00
Thinh Pham 99a0d0e411 MDL-70727 Behat: function scrollIntoView not working in the app 2021-03-04 13:35:46 +07:00
Brendan Heywood f8fe2fabfe MDL-71007 grade_report: Add course idnumber to grade report api
The gradereport_user_get_grade_items now includes the idnumber
2021-03-04 16:20:52 +11:00
Ilya Tregubov 4bc3faf193 MDL-69680 lib: Replace deprecated jQuery functions 2021-03-04 12:48:06 +08:00
Ilya Tregubov f2e6985049 MDL-69680 lib: Update jQuery version in Moodle files 2021-03-04 12:48:06 +08:00
Ilya Tregubov a5712a54fa MDL-69680 lib: Upgrade jQuery lib to 3.5.1 2021-03-04 12:48:06 +08:00
Eloy Lafuente (stronk7) 67c851ff81 Merge branch 'MDL-70424-auth-avoid-changes-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-03-04 00:29:07 +01:00
Ilya Tregubov 6c399500e3 MDL-70767 feedback: Prevent xss in feedback answer text. 2021-03-03 23:08:50 +01:00
Sara Arjona 6c9e7f16f3 Merge branch 'MDL-68721-311' of git://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2021-03-03 17:51:23 +01:00
Ferran Recio f4a7aaf1f8 MDL-68721 mod_h5pactivity: report acceptance tests 2021-03-03 17:23:21 +01:00
Paul Holden 567529f722 MDL-65552 block_activity_results: correct Behat tests for idnumbers.
Teachers can see user idnumber fields only when they are configured
identity fields. Students cannot.
2021-03-03 23:14:54 +08:00
Marina Glancy 7ab4eafc02 MDL-65552 user: escape idnumber and email in table_sql 2021-03-03 23:14:54 +08:00
Paul Holden 2474bc765f MDL-65552 user: escape idnumber field on output.
This commit also corrects parameter definition of the field to
match core_user.
2021-03-03 23:14:54 +08:00
Sara Arjona 3fa69248c0 Merge branch 'MDL-70125_311-3' of git://github.com/mdjnelson/moodle into MOODLE_311_STABLE 2021-03-03 15:47:30 +01:00
Sara Arjona b4dcde4dc2 Merge branch 'MDL-70921-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-03 15:24:51 +01:00
Sara Arjona 9f5794834e Merge branch 'MDL-67494-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-03-03 11:47:00 +01:00
Sara Arjona d30b045210 Merge branch 'MDL-67119-311' of git://github.com/aanabit/moodle into MOODLE_311_STABLE 2021-03-03 11:11:35 +01:00
Ilya Tregubov 66a59ab03f MDL-71026 user: Fix incorrect get_string call. 2021-03-03 11:44:17 +02:00
Jun Pataleta 39627013bf Merge branch 'MDL-70987-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-03-03 16:42:11 +08:00
Sara Arjona 8110f4a2eb Merge branch 'MDL-70966-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-03 09:30:47 +01:00
Simey Lameze fe0a2248f1 MDL-67494 calendar: user_delete_user should delete all user events 2021-03-03 16:29:20 +08:00
Simey Lameze 0375020308 MDL-67494 calendar: privacy provider should not delete shared events 2021-03-03 16:29:20 +08:00
Simey Lameze 6bd9922957 MDL-67494 calendar: shared subscriptions should not set userid to 0 2021-03-03 16:29:20 +08:00
Simey Lameze a08b268b27 MDL-67494 calendar: only user overrides should retain userid 2021-03-03 16:29:20 +08:00
Simey Lameze 25f0a459c1 MDL-67494 calendar: set userid to zero for shared events 2021-03-03 16:29:19 +08:00
Simey Lameze 05540f0eef MDL-67494 calendar: step to set userid 0 to all shared events 2021-03-03 16:29:18 +08:00
Simey Lameze dc9701aa68 MDL-67494 calendar: add logic for category events in get_context 2021-03-03 16:27:00 +08:00
Jun Pataleta 768fb99ba4 Merge branch 'MDL-71009_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-03-03 16:22:44 +08:00
Sara Arjona 321ee59dbc Merge branch 'MDL-69097-311' of https://github.com/inigozendegi/moodle into MOODLE_311_STABLE 2021-03-03 09:06:52 +01:00
Jun Pataleta 28bdd2795b Merge branch 'MDL-70995-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-03 15:05:26 +08:00
Jun Pataleta 05b4006146 Merge branch 'MDL-69883-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-03 14:34:55 +08:00
Andrew Nicols 13bda0057c Merge branch 'MDL-70268-311-2' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-03-03 12:22:52 +08:00
Peter Dias ff411bebe1 MDL-70268 core: Update the oauthlib to exclude scope if none provided 2021-03-03 12:06:10 +08:00
AMOS bot 1484bd7348 Automatically generated installer lang files 2021-03-03 00:07:24 +00:00
Paul Holden 8a738cbf52 MDL-70822 enrol: respect capability to view other users profile.
When retrieving courses of another user via web services, we should
respect the capability to view that users profile in a given course.
2021-03-02 23:44:43 +01:00
Sander Wind 616070614e MDL-70668 auth: Fix secret validation during user confirmation
Co-authored-by: Michael Hawkins <michaelh@moodle.com>
2021-03-02 23:44:43 +01:00
Juan Leyva 7276dfd592 MDL-70340 mod_workshop: Do not apply format to peer comments
This text is not directly output to final users, it is used just in the textarea in both the site and the app.
Applying format, case issues like adding glossary links etc...
2021-03-02 23:32:55 +01:00
Víctor Déniz ee44d51aee Merge branch 'MDL-70676-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE
Fixed mod/workshop/db/upgrade.php: \xmldb_field::getNotNull()
does not verify if the column is nullable in the database.
2021-03-02 22:10:39 +00:00
Peter Dias 9e08079278 MDL-59293 block_onlineusers: Update behat tests 2021-03-02 16:05:08 +00:00
Peter Dias 950cdd5c06 MDL-59293 block_onlineusers: Check whether current user can view online users
- Removed block from site admin.
- Blocked guest from viewuserlist cap
2021-03-02 16:05:08 +00:00
Ilya Tregubov a81dda9fb2 MDL-70676 workshop: Allow empty grades. 2021-03-02 13:45:40 +02:00
Sara Arjona 56630bd392 Merge branch 'MDL-67515-311' of git://github.com/vmdef/moodle into MOODLE_311_STABLE 2021-03-02 11:21:27 +01:00
Jun Pataleta 4fe87411db Merge branch 'MDL-70457_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-02 17:39:29 +08:00
Víctor Déniz 01fc159374 Merge branch 'MDL-70172-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-03-02 09:16:53 +00:00
Paul Holden d1c9dc2ac0 MDL-71022 gradereport_history: prevent double escaping of users.
The user identity fields are already escaped by the AJAX endpoint
that returns them, we don't need to do it again at the client.
2021-03-02 09:14:32 +00:00
Víctor Déniz b46b9092b7 MDL-67515 tool_customlang: Ignore invalid component strings
After uninstalling a plugin, the translated strings remain in
tool_customlang table, throwing an exception when trying to localise
any strings. Currently there is no mechanism to
clean up customlang tables and files during the uninstall process,
so with this patch the invalid components will be ignored.
2021-03-02 09:09:08 +00:00
Sara Arjona e476171f85 Merge branch 'MDL-70877_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-02 09:29:26 +01:00
Jun Pataleta c9d57344b0 Merge branch 'MDL-70876_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-02 16:02:15 +08:00
AMOS bot 8963bb7c04 Automatically generated installer lang files 2021-03-02 00:07:22 +00:00
Eloy Lafuente (stronk7) 81761afcb1 Merge branch 'MDL-70898-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-01 22:50:41 +01:00
Eloy Lafuente (stronk7) 241cf14d71 Merge branch 'MDL-67974-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-01 22:33:26 +01:00
Eloy Lafuente (stronk7) 217698a385 Merge branch 'MDL-70916_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-03-01 21:58:55 +01:00
Eloy Lafuente (stronk7) f276e63dce Merge branch 'MDL-70899-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-01 20:20:53 +01:00
Shamim Rezaie e9e31ed1ff MDL-70172 output: pages with main logo should have a first-level header 2021-03-02 05:36:19 +11:00
Shamim Rezaie 9e17f08e97 MDL-70172 output: Fix empty links
The approach taken is inline with font-awesome documentation:
https://fontawesome.com/how-to-use/on-the-web/other-topics/accessibility
2021-03-02 05:36:19 +11:00
Eloy Lafuente (stronk7) 2baf0175f9 Merge branch 'MDL-70912-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-01 16:47:37 +01:00
Sara Arjona addd1937c1 Merge branch 'MDL-68735_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-03-01 16:17:32 +01:00
Eloy Lafuente (stronk7) 2ebc333858 Merge branch 'MDL-70913-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-01 14:22:12 +01:00
Sara Arjona 2e03630504 MDL-70913 core_badges: Use and update properly sortorder
Sortorder field in badge_external_backpack was updated with a wrong
value. This patch fixes this behaviour and adds sortorder as
sorting criteria for displaying the list of site backpacks.

In the phpunit method reviewed for covering this, a couple of
assertEquals() calls have been changed too to put the expected value
first.
2021-03-01 13:07:58 +01:00
Thong Bui 502c11cc5d MDL-70726 behat: should_not_exist function does not work correctly 2021-03-01 17:53:30 +07:00
Eloy Lafuente (stronk7) c886b6cf07 Merge branch 'MDL-70931-311-xmldbeol' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-03-01 10:01:05 +01:00
Eloy Lafuente (stronk7) b82d5f84f9 Merge branch 'MDL-70941-311' of git://github.com/dravek/moodle into MOODLE_311_STABLE 2021-03-01 09:54:09 +01:00
Eloy Lafuente (stronk7) 8e8240ff6e Merge branch 'MDL-70910-311' of git://github.com/dravek/moodle into MOODLE_311_STABLE 2021-03-01 09:50:08 +01:00
Eloy Lafuente (stronk7) 0085741f6f Merge branch 'MDL-70964-311-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-03-01 09:33:57 +01:00
Dmitrii Metelkin f38fc37008 MDL-70855 course: add extra callback for extending course module form 2021-03-01 13:34:46 +11:00
AMOS bot 43b4384913 Automatically generated installer lang files 2021-03-01 00:07:25 +00:00
Marina Glancy ac06e60ae1 MDL-70968 core: PHP8 compatibility, not allowed to pass extra parameters 2021-02-28 19:43:57 +01:00
Marina Glancy b2d8938431 MDL-70966 various: Under PHP8 empty string is no longer equals to 0 2021-02-28 19:16:53 +01:00
AMOS bot bb999f4ff5 Automatically generated installer lang files 2021-02-28 00:07:23 +00:00
AMOS bot 4afb746475 Automatically generated installer lang files 2021-02-27 00:07:29 +00:00
David Matamoros 52627c5f0f MDL-70910 contentbank: fix for using contentid not validated 2021-02-26 14:36:02 +01:00
Tim Hunt 0b661342dc MDL-71009 question bank: escape idnumbers when displayed 2021-02-26 12:47:33 +00:00
Eloy Lafuente (stronk7) bbe91c4828 MDL-70876 php80: 5th param removed from custom error handlers
It was deprecated in php72 and now it's gone.

Have used this regexp to find all the uses in core:

ag set_error_handler | uniq

And then checked all them manually, that parameter was not
being used in the 3 methods where we are removing it.
2021-02-26 13:08:31 +01:00
Eloy Lafuente (stronk7) 0cbda5bda4 MDL-68735 env: Moodle 3.8.x, 3.9.x and 3.10.x do not support PHP 8.0 2021-02-26 13:08:03 +01:00
Marina Glancy e87182d827 MDL-70877 php: remove final functions __clone and __wakeup
Implementing these functions as final does not prevent the object to be
cloned or serialized, so the comment to them was wrong.
However having these functions not public breaks in PHP 8.0.
It still does not make sense to clone or serialise file_system or external_settings classes
but there are a lot of classes in moodle that should not be cloned, no reason to have
a specific solution here.
2021-02-26 13:07:55 +01:00
David Matamoros f648e9d0fa MDL-70941 contentbank: fix empty equality check when renaming content 2021-02-26 12:01:51 +01:00
Eloy Lafuente (stronk7) 7b1dd2fbee MDL-70457 forms: php74 fix for the (not used in core) date element
Curly brackets to access by index to strings or arrays is
deprecated since php74.
2021-02-26 11:55:28 +01:00
Amaia Anabitarte a3cc4fd3b1 MDL-67119 core_analytics: Analyse users once per course
User's activity in a course should be analysed only once
no matter the number of enrolments the user has in that course.
2021-02-26 11:48:09 +01:00
Jun Pataleta 4652b66ee4 weekly release 3.11dev 2021-02-26 13:42:46 +08:00
Jun Pataleta cb75adc946 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-02-26 13:42:43 +08:00
Marina Glancy f2adb56be0 MDL-70921 repository: filter function can not accept argument by ref
PHP8.0 shows error that filter function accepts value by reference
The nested filtering was never working but also this function was never called on a tree with sub-levels,
so this logic is now removed
2021-02-25 18:25:05 +01:00
David Mudrák deb99d0c7e MDL-70964 lang: Use the fixed strings in tests 2021-02-25 16:32:11 +01:00
Helen Foster d37a1b7e9f MDL-70964 lang: Import fixed English strings (en_fix) 2021-02-25 16:31:43 +01:00
Jun Pataleta b5e913a5c4 Merge branch 'MDL-70169-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-02-25 12:30:11 +08:00
Jun Pataleta 71287b89ff Merge branch 'MDL-70768-langpack-admin-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-02-25 11:30:38 +08:00
AMOS bot da37a00736 Automatically generated installer lang files 2021-02-25 00:07:26 +00:00
Paul Holden 7aee6e2fb2 MDL-69883 message: fix lazy loading of conversations.
Set max-height on each container section rather than the container
itself, so that each can respond to the scrollBottom event within
the lazy loading module (which handles the overflow itself).
2021-02-24 22:01:34 +00:00
Paul Holden 18628ed5b9 MDL-70995 user: format group names in course participants filter. 2021-02-24 19:26:04 +00:00
Iñigo Zendegi 62f91770e2 MDL-69097 mod_forum: Apply filters to whole forum grading 2021-02-24 17:09:50 +01:00
Víctor Déniz 31ab9835e8 Merge branch 'MDL-51111-muc-reset-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-02-24 14:07:55 +00:00
Shamim Rezaie 4b73612459 MDL-70287 core_payment: Redirect user to the successurl after payment 2021-02-24 22:47:22 +11:00
Shamim Rezaie 058e57bc88 MDL-70287 core_payment: Add get_success_url to service_provider 2021-02-24 22:47:21 +11:00
Shamim Rezaie e37e06d194 MDL-70287 core_payment: Improving existing and missing phpdocs 2021-02-24 22:47:21 +11:00
Eloy Lafuente (stronk7) 70a7ba1edd Merge branch 'MDL-70828-311' of git://github.com/abgreeve/moodle into MOODLE_311_STABLE 2021-02-24 12:15:05 +01:00
Adrian Greeve e7c47b194c MDL-70828 performance: Allow session locking issue to be turned off.
If a developer has debugging on then they will recieve all debugging
messages for locking whether wanted or not. We already have a setting
to display these messages.
2021-02-24 11:28:06 +08:00
Brendan Heywood 27758f45f1 MDL-51111 cache: Don't lock and write the config file if unchanged 2021-02-24 12:43:42 +11:00
Andrew Nicols bcd05412b6 MDL-70987 core_form: Use correct id for elementid during validation
The id of the formid was being passed instead of the elementid.
2021-02-24 09:06:27 +08:00
Eloy Lafuente (stronk7) 9e59404425 Merge branch 'MDL-52817-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-23 19:08:04 +01:00
Eloy Lafuente (stronk7) 197775a6bb MDL-70314 lib: Remove a few more hidden files and add instructions 2021-02-23 18:39:24 +01:00
Eloy Lafuente (stronk7) 954212adf8 Merge branch 'MDL-70314-311' of https://github.com/Chocolate-lightning/moodle into MOODLE_311_STABLE 2021-02-23 18:34:07 +01:00
Eloy Lafuente (stronk7) 6e9c9f7f87 Merge branch 'MDL-70920-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-02-23 17:43:39 +01:00
Sara Arjona 2ac767233a MDL-67974 core_badges: Recovered expired stamp
Expired stamp icon displayed over the badge images has been added
again to CSS (it was lost at any point).
2021-02-23 15:32:41 +01:00
Sara Arjona 0e63ad9f4c MDL-67974 core_badges: Badge expiry date when hover
Text displayed for expired badges when the user hovers over the
warning (!) icon has been fixed in the "Issued badge information"
page.
2021-02-23 15:32:41 +01:00
Víctor Déniz fb8e9abd70 Merge branch 'MDL-70038-311' of https://github.com/jpahullo/moodle into MOODLE_311_STABLE 2021-02-23 12:23:14 +00:00
Jordi Pujol Ahulló 0846a76c68 MDL-70038 assign: add suport for pdftoppm tool
pdftoppm (from poppler-utils package) is several orders of
magnitude quicker than ghostscript extracting PNG images
from PDF documents.

We add support for this tool and use it whenever set up,
or using gs as before if missing.

Revisited code with peer review comments. In particular:

1. Make default path for pdftoppm empty string.
2. Fix a typo on the method description for get_gs_command_for_image.
3. Added more information why is useful pdftoppm into string pathtopdftoppm_help.
4. Check that path for pdftoppm is executable to prevent errors. Otherwise, use gs.
2021-02-23 08:08:23 +01:00
Brendan Heywood e4f011cf78 MDL-70424 auth: Avoid random changes to $CFG->auth 2021-02-23 11:41:34 +11:00
Eloy Lafuente (stronk7) 8a620aa0e9 Merge branch 'MDL-43697-311' of https://github.com/praxisdigital/moodle into MOODLE_311_STABLE 2021-02-22 23:10:03 +01:00
Marina Glancy e334bd9921 MDL-70967 enrol_meta: fix error in unittest 2021-02-22 18:06:38 +01:00
Marina Glancy 681c70017c MDL-70901 core: @ no longer masks errors in PHP 8.0 2021-02-22 16:19:37 +01:00
Marina Glancy 920331e74e MDL-70901 cache: @ no longer masks errors in unlink in php 8 2021-02-22 16:19:37 +01:00
Marina Glancy 03b198f45d MDL-70901 core_files: @ does no mask errors in php8 anymore 2021-02-22 16:19:37 +01:00
Marina Glancy 8b5bd4fb00 MDL-70901 backup: check handle before calling fclose()
@fclose no longer catches error in PHP 8.0 when handle is null
2021-02-22 16:19:37 +01:00
Sara Arjona 172dc36b46 MDL-63961 core_badges: Use high-resolution image
High-resolution image for a badge (f3) should be sent to external
backpacks through JSON and WS methods.
Besides, when a badge is cloned, the high-resolution image should be
used to avoid the copied looks blurry.
2021-02-22 12:52:04 +01:00
Mark Nelson 0f33c1b820 MDL-70125 core_grade: do not change overridden status during regrading 2021-02-22 17:35:53 +08:00
Mathew May e7268eff4b MDL-70314 lib: Change XLSX wrapper to no change the default styles
This is required due to changes in the base library see #1712
Summary is that if a column already has styling it can't be overpowered.
2021-02-22 15:33:56 +08:00
Mathew May f079df4ce2 MDL-70314 lib: Apply Moodle specific phpspreadsheet changes 2021-02-22 15:33:21 +08:00
Mathew May 8ff625ed61 MDL-70314 lib: Upgrade PhpSpreadsheet to 1.16.0 2021-02-22 15:33:21 +08:00
Andrew Nicols daaf5f372d MDL-69259 h5pactivity: Whitespace fix 2021-02-22 12:21:12 +08:00
Andrew Nicols f14b74138c Merge branch 'MDL-69259-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-02-22 12:19:33 +08:00
AMOS bot 542bfd1cb7 Automatically generated installer lang files 2021-02-22 00:07:26 +00:00
Andrew Nicols 3340e11074 Merge branch 'MDL-70879_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-02-22 07:50:15 +08:00
Marina Glancy 267fe07d4a MDL-70920 core: prevent calls to call_user_fun_array() with assoc array 2021-02-21 22:22:56 +01:00
Marina Glancy acc72a1f00 MDL-70920 backup: call_user_func_array can accept named arguments
Because arguments names do not match in associative array, we change it to regular array or arguments
2021-02-21 22:22:56 +01:00
Marina Glancy 19d1a2ee61 MDL-70891 core: fix the lang_string::__set_state()
The function must be static and actually has to do what it is supposed to. It also breaks PHP 8.0
2021-02-21 22:09:29 +01:00
Paul Holden b81f03d1da MDL-52817 dml: implement driver methods for SQL group concatenation. 2021-02-19 15:30:54 +00:00
David Mudrák d83ceadf07 MDL-70608 lang: Recommend running the scheduled task to update packs 2021-02-19 15:55:41 +01:00
David Mudrák b21d428307 MDL-70608 lang: Install langpacks asynchronously via ad hoc task
When multiple language packs are selected for installation, perform the
installation asynchronously in the background via ad hoc task.
2021-02-19 15:55:41 +01:00
Daniel Kristian Steffensen 94f2284bdb MDL-43697 backup: Archived badges are restored during course restore 2021-02-19 15:50:42 +01:00
Ilya Tregubov b263d9b720 MDL-69259 h5pactivity: Add get_user_attempts webservice 2021-02-19 16:09:23 +02:00
Eloy Lafuente (stronk7) 03df3f1c51 MDL-70879 behat: Bump to Behat 3.8.x (required for php80) 2021-02-19 14:49:15 +01:00
Víctor Déniz af0040445a weekly release 3.11dev 2021-02-19 12:39:06 +00:00
Víctor Déniz 6b4a466e16 NOBUG: Fixed file access permissions 2021-02-19 12:39:06 +00:00
Víctor Déniz 25d8c845e2 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-02-19 12:39:00 +00:00
Jake Dallimore f1feceffe4 Merge branch 'MDL-64554-311-fix2' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-02-19 11:53:40 +08:00
Andrew Nicols ba42ad4aa1 MDL-64554 user: Fix use of Private files page on classic
The "Private files" link does not exist in the site navigation when
using the classic theme, so it is not possible to test the dedicated
page via Behat at this time.
2021-02-19 09:34:40 +08:00
AMOS bot e2f1086226 Automatically generated installer lang files 2021-02-19 00:07:34 +00:00
Marina Glancy 5e343e277b MDL-64554 form: reset form change checker before triggering submit event 2021-02-18 13:08:33 +01:00
Jun Pataleta 7f23a739ed Merge branch 'MDL-47410-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-02-18 11:23:45 +08:00
Andrew Nicols 319a5f42af Merge branch 'MDL-64554-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-02-18 11:16:58 +08:00
Andrew Nicols f5e4e9cdbc MDL-64554 core_form: Rename class for dynamic form 2021-02-18 11:16:21 +08:00
Andrew Nicols c71876c818 Merge branch 'MDL-70880-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-18 10:48:05 +08:00
Andrew Nicols 0b09c2556f Merge branch 'MDL-64554-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-02-18 10:22:45 +08:00
Andrew Nicols aac6ad5f93 MDL-64554 core_form: CI fixes 2021-02-18 10:10:43 +08:00
Andrew Nicols 6b8b548779 MDL-47410 behat: Perform exact match for date_time selectors 2021-02-18 09:34:59 +08:00
Víctor Déniz dc054248ed Merge branch 'MDL-70536-reset-page-cli-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-02-18 00:34:45 +00:00
David Mudrák e2f81e4a8e MDL-70931 xmldb: Generate install.xml files with EOL and EOF
As discussed in MDLSITE-6397, all Moodle code files should end with
single Unix-style end of line character. Files created and edited
through the XMLDB editor should follow this rule, too.
2021-02-17 21:05:53 +01:00
Marina Glancy d58581358f MDL-64554 core_form: Move strings to outputrequirements.lib 2021-02-17 18:09:42 +01:00
Marina Glancy 4868d7b93e MDL-64554 user: make private files editor modal/ajax form 2021-02-17 18:09:42 +01:00
Marina Glancy 9f47d93ba6 MDL-64554 core_customfield: use modal forms for fields 2021-02-17 18:09:41 +01:00
Marina Glancy 1d33351fbb MDL-64554 core_form: new API for modal forms 2021-02-17 18:09:38 +01:00
Víctor Déniz 93034373df Merge branch 'MOODLE_311_MDL-70752' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-02-17 16:57:18 +00:00
Tim Hunt 9bc2094202 MDL-70916 Essay/Moodle XML: min and max word limits not imported 2021-02-17 11:32:56 +00:00
Eloy Lafuente (stronk7) 7591ad49c7 Merge branch 'MDL-70552-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-02-17 10:26:41 +01:00
Ilya Tregubov d208bc5353 MDL-70552 core_message: Show popup for teachers when anonymous
user completed feedback.
2021-02-17 08:43:21 +02:00
Andrew Nicols 52e980f548 MDL-68853 mod_h5pactivity: Whitespace fix 2021-02-17 12:03:20 +08:00
Andrew Nicols fd5822c4c3 Merge branch 'MDL-68853-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-02-17 12:03:17 +08:00
Andrew Nicols 5e99241c0c Merge branch 'MDL-47410-311' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-02-17 09:40:14 +08:00
AMOS bot 036a0fe243 Automatically generated installer lang files 2021-02-17 00:07:31 +00:00
Andrew Nicols 615541ceec Merge branch 'MDL-70264-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-02-17 07:26:37 +08:00
Eloy Lafuente (stronk7) d4b6fb8d32 Merge branch 'MDL-69562_311' of https://github.com/dvdcastro/moodle into MOODLE_311_STABLE 2021-02-16 22:39:25 +01:00
Eloy Lafuente (stronk7) a49d63db27 Merge branch 'MDL-66600_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2021-02-16 22:12:03 +01:00
Eloy Lafuente (stronk7) ad911e4f78 Merge branch 'MDL-70525_311' of https://github.com/TomoTsuyuki/moodle into MOODLE_311_STABLE 2021-02-16 19:56:20 +01:00
Eloy Lafuente (stronk7) 2ec39bb193 Merge branch 'MDL-48269-311-4' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-02-16 19:49:43 +01:00
Sara Arjona d0840f514c MDL-70912 mod_data: Add filepicker to the H5P Atto button
The filepicker wasn't displayed fot the H5P Atto button when a text
area database field was created because some options were missing
in the textarea field class.
2021-02-16 18:17:14 +01:00
Sara Arjona dfc9092c39 Merge branch 'MDL-69762_M311_STABLE' of https://github.com/grillonbleu/moodle into MOODLE_311_STABLE 2021-02-16 15:29:47 +01:00
Jun Pataleta ef9bf314c4 MDL-48269 core_backup: Prevent unwanted group icons from being restored
* Old backups might have hidepicture defined and set to 1 in which case
we must make sure to exclude the group picture for these groups from
being restored.
2021-02-16 22:28:43 +08:00
Jun Pataleta ce6a52f8c3 MDL-48269 mod_forum: Remove occurrences of hidepicture 2021-02-16 12:53:34 +08:00
Jun Pataleta 19a3252053 MDL-48269 messageoutput_email: Remove occurrences of hidepicture 2021-02-16 12:53:34 +08:00
Jun Pataleta 77c263c0c9 MDL-48269 group: Remove additional occurrences of hidepicture 2021-02-16 12:53:34 +08:00
Frederic Massart 2248714268 MDL-48269 language: Deprecating 'hidepicture' string 2021-02-16 12:53:34 +08:00
Frederic Massart 026d2d227b MDL-48269 group: Remove the option to hide the picture of a group
Plus additional amendments to Fred's original commit:
1. Updating the version numbers
2. Merging the original two-step upgrade below into one for simplicity:
   1. Deleting the pictures for groups with hidepicture set to 1; and
   2. Dropping the hidepicture field itself.
3. Converted array() usages to the short syntax [].
2021-02-16 12:53:30 +08:00
AMOS bot f013aa7c8e Automatically generated installer lang files 2021-02-16 00:07:28 +00:00
Eloy Lafuente (stronk7) 4b87850904 Merge branch 'MDL-70806-311' of git://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2021-02-15 22:29:24 +01:00
Eloy Lafuente (stronk7) 6b1cab3630 Merge branch 'MDL-70882-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-02-15 22:22:24 +01:00
François Moreau e8c98e17e6 MDL-69762 core_contentbank: let users hide their content 2021-02-15 13:49:57 -05:00
Marina Glancy a282cbd3f9 MDL-70896 mod: libxml_disable_entity_loader is deprecated in php 8.0 2021-02-15 19:00:40 +01:00
Marina Glancy d2d0cffd1d MDL-70893 various: optional function arguments must be in the end 2021-02-15 16:54:01 +01:00
Marina Glancy dbb31d14d6 MDL-70898 various: private functions can not be declared final 2021-02-15 16:37:05 +01:00
Marina Glancy 9a1ea11a0b MDL-70899 dml: set_db_handle() definition not compatible with parent 2021-02-15 16:31:26 +01:00
Mahmoud Kassaei 6b93f2cb9d MDL-66600 quiz manual grading: show any automated grading and feedback 2021-02-15 08:23:40 +00:00
Adrian Greeve 177491645f Merge branch 'MDL-70735-pdf-metadata-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-02-15 09:04:33 +08:00
Andrew Nicols fa64a7ce8d MDL-70882 performance: Revert "MDL-47456 core: Remove redundant DB call during bootstrap"
This reverts commit 522e4c6c76.

The DB calls are not redundant and have an impact in a number of edge
cases.
2021-02-15 08:21:20 +08:00
Paul Holden 1efc1a723c MDL-66025 user: require message content in bulk action.
Also import missing 'core/notification' dependency.
2021-02-14 20:10:32 +00:00
Paul Holden 7796421dea MDL-70880 message: preserve window scroll when close message drawer. 2021-02-14 19:29:26 +00:00
AMOS bot 87712caf89 Automatically generated installer lang files 2021-02-13 00:07:33 +00:00
Ilya Tregubov ea8175e141 MDL-68853 h5pactivity: Add a websevice to trigger report_viewed event. 2021-02-12 15:50:07 +02:00
Brendan Heywood 97a3fbdbb5 MDL-70735 tcpdf: Reduce information disclosure from TCPDF 2021-02-12 15:42:01 +11:00
Simey Lameze 0226aa3090 MDL-70169 login: fix accessibility issues 2021-02-12 12:12:45 +08:00
Paul Holden 7d7259f1b6 MDL-70789 theme_boost: fix double click on drawer hiding content.
If the drawer toggle button was clicked in quick succession to close
and then re-open, then the delayed Aria.hide method would be called
which hid the drawer content when it finished opening.
2021-02-11 21:45:49 +00:00
Sara Arjona a71954fc77 MDL-70264 badges: remove badges/oauth2callback.php
File badges/oauth2callback.php has been removed and now badges
API will use admin/oauth2callback.php because it makes no sense having
it twice.

Credits go to Andrew Nicols for raising it!
2021-02-11 16:58:41 +01:00
Sara Arjona a2fda1289f weekly release 3.11dev 2021-02-11 14:54:40 +01:00
Sara Arjona a61d1821b5 NOBUG: Fixed file access permissions 2021-02-11 14:54:40 +01:00
Sara Arjona 43aa3e828a Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-02-11 14:54:38 +01:00
Ferran Recio c7cbd92f8c MDL-70806 h5p: fix resize glitch 2021-02-11 13:12:12 +01:00
Mihail Geshoski b8a5e4463e MDL-47410 mod_assign: Update mod_assign behat tests
Updates the mod_assign behat tests to utilize the ability to
conviniently populate the datetime selector fields.
2021-02-11 12:11:06 +08:00
Mihail Geshoski ac28d4fc96 MDL-47410 behat: Support selection from the datetime selector element
Adds behat support for selecting date and time from a datetime selector
element. The passed values should represent a textual date and time
description wrapped in '##' (e.g. '##first day of January 2020 08:00##',
'##1 Jan 2020 10:30##'). Also, the value 'disabled' is valid and can be
used to disable the datetime selector element.
2021-02-11 12:11:06 +08:00
Mihail Geshoski f92c2e9eba MDL-47410 tool_licensemanager: Update tool_licensemanager behat tests
Updates the tool_licensemanager behat tests to utilize the ability to
conviniently populate the date selector fields.
2021-02-11 12:11:06 +08:00
Mihail Geshoski 8d7a6f740d MDL-47410 behat: Support date selection from the date selector element
Adds behat support for selecting a date from the date selector element.
The passed values should represent a textual date description wrapped
in '##' (e.g. '##first day of January 2020##', '##1 Jan 2020##'). Also,
the value 'disabled' is valid and can be used to disable the date
selector element.
2021-02-11 12:11:06 +08:00
Mihail Geshoski bcd7a97d33 MDL-47410 behat: Create custom selector for the date and datetime fields
Creates a custom field selector to locate the requested date or datetime
form fields.
2021-02-11 12:11:06 +08:00
Mihail Geshoski 44558f34ca MDL-47410 behat: Move logic from guess_type() to a separate method
Moves the logic from guess_type() to a separate protected method
get_field_instance_for_element(). This would be quite useful for
form field classes as they can now use this method when there is
a need to determine the type of a given node element.
2021-02-11 12:11:06 +08:00
Mihail Geshoski c70d7f624f MDL-47410 behat: Use data-fieldtype attribute to guess the field type
The data-fieldtype attribute (if present) should be also utilized in
guess_field_type() and match the behavior in get_field_node_type().
2021-02-11 12:11:05 +08:00
Mihail Geshoski 72ad6a2b2c MDL-47410 form: Add data-fieldtype attribute to checkbox inline element
Includes the data-fieldtype attribute to the checkbox inline form
element. This element does not extend the parent inline element
template due to its specific nature and therefore this attribute was
missing.
2021-02-11 12:11:05 +08:00
Tuan.Dinh 8aab39c1d2 MDL-70124 course: Activity names are now trimmed. 2021-02-11 11:11:12 +08:00
Adrian Greeve 1d44395512 Merge branch 'MDL-70755_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2021-02-11 10:53:35 +08:00
Adrian Greeve 3153941092 Merge branch 'MDL-70773_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2021-02-11 10:18:30 +08:00
Adrian Greeve bbb937067e Merge branch 'MDL-70513_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-02-11 10:06:15 +08:00
John Yao 4f998e5004 MDL-70627 filters: aarch64 mimetex type support for filter tex notation
Amended to correct permissions.
2021-02-11 02:41:05 +01:00
Adrian Greeve e2e91b493d Merge branch 'MDL-69867-311_display_grade_with_scale' of git://github.com/moffe42/moodle into MOODLE_311_STABLE 2021-02-11 09:24:15 +08:00
Brendan Heywood 33788af7b2 MDL-70768 tool_langimport: Make installed admin UI more consistent 2021-02-11 11:36:04 +11:00
AMOS bot 8701806622 Automatically generated installer lang files 2021-02-11 00:07:27 +00:00
Brendan Heywood 778c0e5fb3 MDL-70766 auth: Add all auth plugin changes to configlog 2021-02-11 11:05:53 +11:00
Sara Arjona d4868df65e Merge branch 'MDL-70732-311' of git://github.com/aanabit/moodle into MOODLE_311_STABLE 2021-02-10 17:20:29 +01:00
Sara Arjona 4611cf3b9f Merge branch 'MDL-70796_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-02-10 16:50:09 +01:00
Sara Arjona ea1407452c Merge branch 'MDL-69101_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-02-10 15:11:58 +01:00
Sara Arjona 8da0d08c22 Merge branch 'MDL-70631-311-unzip' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-02-10 12:38:11 +01:00
Sara Arjona cfc4b194db Merge branch 'MDL-70736_MOODLE_311_STABLE' of https://github.com/TomoTsuyuki/moodle into MOODLE_311_STABLE 2021-02-10 08:28:15 +01:00
Jacob Christiansen 78b1da0d74 MDL-69867 mod_assign: Display current grade with scale value
When using workflow we show the current grade with its scale value
instead of the internal index
2021-02-10 07:58:12 +01:00
Adrian Greeve e1e6547241 Merge branch 'MDL-70643-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-10 14:04:37 +08:00
Adrian Greeve 171be5c788 Merge branch 'MDL-52420-311' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2021-02-10 12:58:25 +08:00
Sara Arjona 878aaf5d7c Merge branch 'MOODLE_311_STABLE-MDL-65390' of https://github.com/yao9394/moodle into MOODLE_311_STABLE 2021-02-09 15:10:50 +01:00
Sara Arjona 578b4156c2 Merge branch 'MDL-68736-311' of git://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2021-02-09 15:05:34 +01:00
Sara Arjona d5b8ef98c2 Merge branch 'MDL-70282-oauth2_improve_error-311' of https://github.com/leonstr/moodle into MOODLE_311_STABLE 2021-02-09 11:05:05 +01:00
Sara Arjona b54bf76664 Merge branch 'MDL-70173-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-02-09 08:29:20 +01:00
Sara Arjona 4cd7f621ed Merge branch 'MDL-70377_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2021-02-09 08:23:30 +01:00
Shamim Rezaie cebee49bf7 MDL-70173 core: Use a meaningful first level header 2021-02-09 16:16:00 +11:00
Shamim Rezaie 1ac3fb7e0e MDL-70173 theme_boost: Fix empty link issue on the "Go to top" button
On behat, we have to use a more specific test step if we are looking
for a "Go" button on a modal. The reason is that the html of the modal
content is put after the html of the "Go to top" button, so behat
may find the "Go to top" button if we just look for "Go".
2021-02-09 16:16:00 +11:00
Shamim Rezaie a53037f5c6 MDL-70173 theme_boost: Increase the size of notification counter
WAVE considers any text with the size of 10px or below really small.
Increasing the font size of the navbar counter by 1px should not make a
big negative impact on the design, but improves accessibility.
2021-02-09 16:16:00 +11:00
Shamim Rezaie ca6a8dfb22 MDL-70173 output: All pages should have a heading
In MDL-63040, it was decided that the page header for the dashboad page
should be removed.
However, Based on Success Criteria 1.3.1 and 2.4.6 from the WebAIM's
WCAG 2 Checklist, all pages should have an <h1> element.
So I put an sr-only heading on the dashboard and all other pages, where
no page header is shown.
2021-02-09 16:16:00 +11:00
Shamim Rezaie 3fcb116eea MDL-70173 dashboard: ARIA role presentation conflicted the empty alt
The markup <img role="presentation" alt="alt text"> is contradictory.

According to https://www.w3.org/TR/2017/WD-wai-aria-practices-1.1-20170628/examples/presentation/PresentationRoleExamples.html
 It is recommended that authors instead use empty alt text (alt="")
 where they use role="presentation".
2021-02-09 16:16:00 +11:00
Shamim Rezaie d97a43417d MDL-70173 message: Fix empty link 2021-02-09 16:16:00 +11:00
Shamim Rezaie 766f52afb9 MDL-70173 output: use an empty alt to hide user pic from screen readers
There is no need to use WAI-ARIA to hide images from screen readers.
See https://www.w3.org/WAI/tutorials/images/decorative/
2021-02-09 16:16:00 +11:00
Tomo Tsuyuki b9812e022d MDL-70525 tool_profiling: Cannot import profiling file
Change type from int to integer to be able to have big numbers
2021-02-09 10:17:01 +11:00
Mahmoud Kassaei dcb319c441 MDL-70377 qtype_essay: When reviewing an attempt as a teacher
In the Response history table, Action Saved: does not display the value
of $a in the language string.
2021-02-08 17:05:03 +00:00
Sara Arjona 82de03b116 Merge branch 'MDL-51287-311' of https://github.com/SangNguyenAnh/moodle into MOODLE_311_STABLE 2021-02-08 11:29:08 +01:00
Andrew Nicols ee74321fa5 Merge branch 'MDL-70429-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-02-08 12:27:31 +08:00
Andrew Nicols f00b196906 Merge branch 'MDL-69898-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-08 10:53:45 +08:00
Andrew Nicols c012235654 Merge branch 'MDL-70614-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-08 10:35:54 +08:00
Andrew Nicols 92546105b9 Merge branch 'MDL-70725-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-02-08 10:30:17 +08:00
Andrew Nicols fd396798d0 Merge branch 'MDL-70719_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2021-02-08 09:47:21 +08:00
Brendan Heywood 21ace1f7a7 MDL-70536 cli: Fixed cli progress bar when 100% more than once 2021-02-07 00:36:30 +11:00
Brendan Heywood 7459503e31 MDL-70536 cli: Add cli for resetting all dashboards 2021-02-07 00:36:29 +11:00
AMOS bot d8951a8b7f Automatically generated installer lang files 2021-02-06 00:07:27 +00:00
Mahmoud Kassaei c13b829c00 MDL-70719 quiz overrides: only show Actions column header if needed 2021-02-05 15:40:51 +00:00
Tim Hunt 9ca6fd447c MDL-70796 count_words: match the count from LibraOffice & MS Word 2021-02-05 15:31:10 +00:00
Amaia Anabitarte a3d8c4a54c MDL-70732 behat: Adding second parameter to ExpectationException() 2021-02-05 11:01:31 +01:00
Tomo Tsuyuki 77b857714a MDL-70736 gradingform_guide: Fix loading marking guide template issue
Do not check grade item name if it is from shared template.
2021-02-05 10:54:33 +11:00
Sara Arjona d7dd8517fc weekly release 3.11dev 2021-02-04 14:56:13 +01:00
Sara Arjona 2dc9e93753 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-02-04 14:56:11 +01:00
Mikhail Golenkov f9c1978c5e MDL-70752 restore: Fix remote file recovery 2021-02-04 19:20:24 +11:00
sangnguyen a7ac52538e MDL-51287 Profile: Should notify users that changes are saved 2021-02-04 14:56:24 +07:00
Andrew Nicols bf9838f31c Merge branch 'MDL-69748-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-02-04 11:52:10 +08:00
Andrew Nicols 691cdcee88 Merge branch 'MDL-64866-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-02-04 11:40:48 +08:00
Shamim Rezaie d9cfd2ecc5 MDL-69748 core: Fix hideif issue with array elements
Changed the element selector to get all array elements,
whether named or unnamed. The previus selector was only
working for elements that thir names were like name="something[]".
It was not working for name="something[a]" elements.
2021-02-04 14:38:37 +11:00
Andrew Nicols 914f716b8a Merge branch 'MDL-70579-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-04 09:30:06 +08:00
Andrew Nicols 69165b6516 Merge branch 'MDL-70632-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-04 09:26:40 +08:00
AMOS bot c87420a59f Automatically generated installer lang files 2021-02-04 00:07:32 +00:00
Eloy Lafuente (stronk7) 30cc70ec2c MDL-70741 capability overview: missing whitespace after placeholder 2021-02-04 00:01:22 +01:00
Tim Hunt f143531c76 MDL-70513 quiz manual grading: use formchangechecker to avoid dataloss 2021-02-03 16:07:32 +00:00
David Mudrák 6d9412853c MDL-70631 files: Replace hard-coded value with FL_ENC_RAW constant
This is not related to the issue but I noticed it while trying to debug
it.

Back when this line was introduced in 9c140a681e, the ZipArchive had
not yet exposed this flag as a constant. It was added later with PHP
7.0.8 and we can switch to using it now.
2021-02-03 16:09:57 +01:00
David Mudrák db74c9f6fa MDL-70631 files: Fix performance of zip_packer::extract_to_pathname()
The original implementation was based on ZipArchive::getStream() which
turns out to be very slow and if the archive contains many files, the
unzipping performance is very slow.

The patch changes the implementation to use ZipArchive::extractTo()
unless the extracted entry path contains a folder name ending with dot
(such as some/path./to/file.txt). There is a known upstream bug in the
PHP ZIP extension #77214 (also #74619 and #69477) so that we fall back
to keep using the stream in those cases.
2021-02-03 16:09:57 +01:00
Sara Arjona 1605bb60f1 Merge branch 'MDL-70315-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-03 16:04:25 +01:00
Sara Arjona 66e33a14cc Merge branch 'MDL-70705-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-02-03 15:33:14 +01:00
Sara Arjona d5923517e8 Merge branch 'MDL-70316-311' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2021-02-03 15:29:33 +01:00
Luca Bösch ad04c622d8 MDL-70705 block_blog_recent: support multilang blog entry titles 2021-02-03 15:15:12 +01:00
Sara Arjona ac8130d0a4 Merge branch 'MDL-70741_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-02-03 14:49:43 +01:00
David Castro 8eae412d42 MDL-69562 admin: Allow getting IP from all sources. 2021-02-03 07:20:22 -05:00
Eloy Lafuente (stronk7) e912f3bb7a Merge branch 'MDL-70711-M311' of git://github.com/kordan/moodle into MOODLE_311_STABLE 2021-02-03 13:06:20 +01:00
Sara Arjona 6331fb14f0 Merge branch 'MDL-70439-311' of https://github.com/DinhHien0307/moodle into MOODLE_311_STABLE 2021-02-03 13:03:10 +01:00
Mahmoud Kassaei 963eaa3453 MDL-70773 Quiz overrides: User links don't point to user profile page 2021-02-03 11:45:07 +00:00
Sara Arjona 6e42f0380a Merge branch 'MDL-70163-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-03 12:25:35 +01:00
Sara Arjona 44c3d4354b Merge branch 'MDL-70634-311' of git://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2021-02-03 11:34:18 +01:00
Sara Arjona a05c39c117 Merge branch 'MDL-70535-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-03 11:19:26 +01:00
Paul Holden 21e728c7a4 MDL-70632 tool_langimport: search for available language packs. 2021-02-03 10:03:33 +00:00
Sara Arjona 48174f38b9 Merge branch 'MDL-67959-311-2' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-02-03 10:50:38 +01:00
Mahmoud Kassaei 90de909f53 MDL-70755 Quiz overrides: Broken layout for Group overrides 2021-02-03 09:26:07 +00:00
Sara Arjona c1dc87c2ed Merge branch 'MDL-66769-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-02-03 09:33:02 +01:00
Tim Hunt 1550b2a3e9 MDL-69101 Essay/Moodle XML: recent new settings not imported/exported 2021-02-03 08:10:55 +00:00
Sara Arjona 6085fa0604 Merge branch 'MDL-70621-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-02-03 09:02:51 +01:00
Sara Arjona 74dde403d6 Merge branch 'MDL-68970_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-02-03 08:51:18 +01:00
Luca Bösch 2cb1bdf427 MDL-70621 mod_glossary: use glossary rsstype string. 2021-02-03 08:35:14 +01:00
Luca Bösch cd6180b0d2 MDL-70621 mod_forum: use forum rsstype string. 2021-02-03 08:35:14 +01:00
Ilya Tregubov 8f52651988 MDL-66769 core_h5p: Clean up orphaned h5p records task. 2021-02-03 09:33:17 +02:00
Andrew Nicols eeec65dbb5 Merge branch 'MDL-56772-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-02-03 10:57:35 +08:00
Andrew Nicols 803b2374aa Merge branch 'MDL-66932_M311' of https://github.com/nadavkav/moodle into MOODLE_311_STABLE 2021-02-03 10:21:44 +08:00
Andrew Nicols a78d00b18c Merge branch 'MDL-68893-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-02-03 09:40:51 +08:00
Andrew Nicols d1157ec971 Merge branch 'MDL-68958-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-02-03 09:35:11 +08:00
Andrew Nicols 4a14262695 Merge branch 'MDL-70339-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-02-03 09:08:49 +08:00
Andrew Nicols fb537d0c39 Merge branch 'MDL-70583-cli-progress-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-02-03 08:28:17 +08:00
Brendan Heywood 52aac97590 MDL-70583 cli: Allow progress bars to be rendered in cli scripts 2021-02-02 22:07:53 +11:00
Sara Arjona b6ea9f0d8c Merge branch 'MDL-70309-311' of git://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2021-02-02 10:44:54 +01:00
Víctor Déniz 91cfc3ce08 Merge branch 'MDL-59782-311' of git://github.com/bmbrands/moodle into MOODLE_311_STABLE 2021-02-02 09:36:02 +00:00
Andrew Nicols 654a25c22f Merge branch 'MDL-70304-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-02-02 15:32:13 +08:00
Sara Arjona 82a6dc6dd1 Merge branch 'MDL-70574_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-02-02 08:20:25 +01:00
Sara Arjona a5304827cc Merge branch 'MDL-70288-311-2' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-02-02 07:59:36 +01:00
Ilya Tregubov e1f6c22780 MDL-70304 core: updated adapter.js to 7.4.0 2021-02-02 08:59:09 +02:00
Jun Pataleta 868af1cb0b MDL-70288 qtype: Remove unnecessary empty label string
* When a label is passed to an (advanced) checkbox and no text
  was provided, the label will be displayed on the right of the the
  checkbox element. So there's no point in passing an empty string for
  the label just to render the text to the right of the checkbox.
2021-02-02 14:22:15 +08:00
Jun Pataleta c7b0a60a3c MDL-70288 mod_lti: Remove unnecessary empty label string
* When a label is passed to an (advanced) checkbox and no text
  was provided, the label will be displayed on the right of the the
  checkbox element. So there's no point in passing an empty string for
  the label just to render the text to the right of the checkbox.
2021-02-02 14:22:15 +08:00
Jun Pataleta 9730348163 MDL-70288 core: Remove duplicate labels for checkbox elements
* If there's a label, the text will serve as the description of  the
element.
2021-02-02 14:22:15 +08:00
Jun Pataleta 03d6acbb57 MDL-70288 theme_boost: Manage aria-describedby on form validation
* The aria-describedby attribute can be a list of element IDs that
describe the element. On form validation, the ID of the error message
container is added to this attribute which may already be containing
another ID. So we need to properly add/remove the error message ID
so that we don't delete any existing ID(s) in the aria-describedby
attribute during form validation.
2021-02-02 14:22:15 +08:00
Sujith Haridasan 889d449265 MDL-52420 mod_assign: Save comment when save buttons are clicked
Save comment in the assignment when the Save changes
or Save and show next button are clicked at the bottom
of the page.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-02-02 10:52:48 +05:30
Eloy Lafuente (stronk7) de5a304746 Merge branch 'MDL-46256_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-02-01 23:20:11 +01:00
Eloy Lafuente (stronk7) 80cf455e48 Merge branch 'MDL-70648-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2021-02-01 19:17:45 +01:00
Sara Arjona 7eab65170c Merge branch 'MDL-70625-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-02-01 15:37:02 +01:00
Paul Holden da9f213b3a MDL-70643 admin: add summary argument to install database CLI.
Show warning for any unrecognised arguments.
2021-02-01 12:33:22 +00:00
Sara Arjona 1706d90d02 Merge branch 'MDL-70734-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-02-01 12:30:13 +01:00
Sara Arjona 9db1e485ee Merge branch 'MDL-70740-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-02-01 11:25:12 +01:00
Paul Holden f86f396226 MDL-69898 admin: link to config changes report from logged event. 2021-02-01 09:14:02 +00:00
Paul Holden 7ee621420d MDL-69898 report_configlog: allow searching settings by page parameter. 2021-02-01 09:14:02 +00:00
Paul Holden 58b31a5e75 MDL-70614 user: consistent roles spacing in course profile. 2021-02-01 07:54:56 +00:00
Andrew Nicols 5b51e88492 Merge branch 'MDL-58673-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-02-01 14:05:14 +08:00
Andrew Nicols d5ff729197 MDL-70734 behat: Increase the WebDriver Curl timeout 2021-02-01 09:49:54 +08:00
AMOS bot d5094e6846 Automatically generated installer lang files 2021-02-01 00:07:30 +00:00
Andrew Nicols ac2e94f946 MDL-70740 behat: Composer bump for new version of Mink Driver 2021-01-31 20:26:35 +08:00
AMOS bot db80653efa Automatically generated installer lang files 2021-01-31 00:07:26 +00:00
Luca Bösch 908f4ca718 MDL-68893 mod_data: use own RSS feed string.
AMOS BEGIN
 CPY [rsstype,core],[rsstype,mod_data]
AMOS END
2021-01-29 23:21:20 +01:00
Tim Hunt 341b7245df MDL-70741 capability overview: avoid errors from orphan contexts 2021-01-29 20:49:06 +00:00
Víctor Déniz fb9419ec0b weekly release 3.11dev 2021-01-29 17:12:59 +00:00
Víctor Déniz 01af47f95d Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-01-29 17:12:54 +00:00
Jake Dallimore 1cca977486 Merge branch 'MDL-66979-311-7' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-01-29 15:43:14 +08:00
Andrew Nicols 5a706a506c MDL-66979 behat: Mark some tests as being slow
Uses of the httpsreplace and customlang tools are known to be extremely
slow.

In our CI infrastructure on slwoer DBs, the customlang tool can take
over 90 seconds to load the page, whilst the httpsreplace tool can take
up to about 60 seconds.

These changes set appropriate timeout factors to increase the timeout
accordingly.
2021-01-29 14:18:51 +08:00
Andrew Nicols 3d89a661df MDL-66979 behat: Add a step to set a timeout factor for a test 2021-01-29 14:18:51 +08:00
Eloy Lafuente (stronk7) 909f1d7203 MDL-66979 behat: Goutte driver doesn't implement setTimeouts()
Also, change:

get_real_timeout(30000)

to:

get_real_timeout(30) * 1000

because the original functions are defined to use seconds, and
having the 1000 around will help us detecting cases in the case
of a hypothetical review of uses.
2021-01-29 14:18:45 +08:00
Jun Pataleta cd030a854b MDL-67959 mod_forum: Display group pictures in forum only if available
Displaying a default group picture in forum posts leads to confusion,
so better to not display a default group picture when the group
picture is not set for the group.
2021-01-29 12:30:06 +08:00
AMOS bot 39e785e4b0 Automatically generated installer lang files 2021-01-29 00:07:30 +00:00
Eloy Lafuente (stronk7) 01fd844e94 MDL-66979 behat: Goutte driver doesn't implement setTimeouts()
Also, change:

get_real_timeout(30000)

to:

get_real_timeout(30) * 1000

because the original functions are defined to use seconds, and
having the 1000 around will help us detecting cases in the case
of a hypothetical review of uses.
2021-01-28 17:12:05 +01:00
Sara Arjona 4a29cae1fb MDL-70429 repository_contentbank: set default returntype
Credits for Alexander Bias, for sharing the patch!

The content bank was designed for making easier to reuse content.
So "Link to the file" should be the default option when using the
contentbank repository, in order to let teachers modify their
content in the content bank and update automatically it everywhere
is used.
2021-01-28 16:45:50 +01:00
Leon Stringer 6a6cd2bb5d MDL-70282 oauth: Improve error information
If the request to the OAuth 2 token endpoint fails show the response
body the endpoint returned with its HTTP status (when debug: DEVELOPER).
If no response is available show any error returned by Curl.  Previously
none of this information was available making troubleshooting difficult.

If a token refresh fails in \core\oauth2\refresh_system_tokens_task an
exception is now thrown so that the result is shown as "Fail" on
admin/tasklogs.php?filter=core\oauth2\refresh_system_tokens_task
2021-01-28 10:02:58 +00:00
Eloy Lafuente (stronk7) dc7b085229 Merge branch 'MDL-66979-311-7' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-01-28 09:08:53 +01:00
Kordan 954bce987a MDL-70711 form: deleted useless if block
get_magic_quotes_gpc() always return false since PHP 5.3 so (1 == get_magic_quotes_gpc()) is never verified.
This allows me to safetly delete what I dropped out.
2021-01-28 08:40:42 +01:00
Andrew Nicols e631b8c5e1 MDL-66979 behat: Set script timeout with timeout factor 2021-01-28 15:27:49 +08:00
Andrew Nicols ec9bb74405 MDL-66979 behat: Correct selenium2 reference in config-dist 2021-01-28 15:08:10 +08:00
Andrew Nicols 7cff15dc4d MDL-66979 behat: Handle driver stop failure properly
An case was found where the webdriver stop() call could fail in an
AfterScenario hook, leading to a complete rerun if no other errors were
experienced.
2021-01-28 15:07:52 +08:00
Jun Pataleta 67ddc3a9a2 Merge branch 'MDL-70444-dashboard-reset-progress-311' of https://github.com/Peterburnett/moodle into MOODLE_311_STABLE 2021-01-28 09:53:56 +08:00
Andrew Nicols 0911cc0b1e Merge branch 'MDL-70048-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-01-28 08:04:22 +08:00
Peter Dias 384d1874ac MDL-70048 dropbox: Augmented unit tests to account for additional params 2021-01-28 07:32:20 +08:00
Peter Dias 0cc373fca6 MDL-70048 dropbox: Update the dropbox search URL.
- Update fetch_dropbox_data to allow different result nodes and version
- Update search to the new URL with new params
- Update the get entities function to account for the change in structure.
2021-01-28 07:32:20 +08:00
Víctor Déniz 40f7439381 Merge branch 'MDL-69816-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-01-27 18:23:12 +00:00
Sara Arjona 8c696c7f95 MDL-70725 oauth2: move expectException to separate method 2021-01-27 17:54:08 +01:00
Víctor Déniz c1f4d038d4 Merge branch 'MDL-70585-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-01-27 10:21:00 +00:00
hiendinh 6972d1a9d8 MDL-70439 Profile: Indicate user email address settings on own profile 2021-01-27 13:40:19 +07:00
Mihail Geshoski f752cd1a71 MDL-70316 core: Update the emoji categories in the emoji picker 2021-01-27 13:37:47 +08:00
Mihail Geshoski ef03523704 MDL-70316 core: Document emoji-data upgrade and update version in core 2021-01-27 13:37:47 +08:00
Mihail Geshoski ea2fac7ca2 MDL-70316 core: Upgrade emoji-data to 6.0.0 2021-01-27 13:37:47 +08:00
Mihail Geshoski 0dd59085a5 MDL-70316 core: Update the categories in the emoji data generator script
The emoji categories were modified in the newer versions of the
emoji-data library. Therefore, the category list in $categorysortorder
needs to be updated with the correct category names in order to properly
sort the categories in the generated emoji data file.
2021-01-27 13:37:47 +08:00
Mihail Geshoski d63aa867d6 MDL-70316 core: Detect category name changes in the emoji data generator
The emoji data generator script is enabled to detect inconsistencies
between the emoji category names used in the emoji-data library and the
ones used in Moodle. These inconsistencies should be fixed, as soon as
they are detected upon library upgrade.
2021-01-27 13:37:47 +08:00
John Yao 1a013d3fee MDL-65390 accessibility: correct focus after "Show more" clicked 2021-01-27 11:21:52 +11:00
AMOS bot 8194b3151c Automatically generated installer lang files 2021-01-27 00:07:30 +00:00
Eloy Lafuente (stronk7) cdb14d91f7 Merge branch 'MDL-66979-311-7' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-01-26 22:44:11 +01:00
Víctor Déniz d3e82b7640 Merge branch 'MDL-70528-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-01-26 14:05:22 +00:00
Ilya Tregubov f283de3d3e MDL-70528 h5pactivity: Fix block can't be added to h5pactivity page. 2021-01-26 15:44:26 +02:00
Ferran Recio 269449644d MDL-68736 h5pactivity: remove legacy log method 2021-01-26 11:16:14 +01:00
Paul Holden 1fc46d1583 MDL-70163 core: fix attachment validation when localrequestdir absent.
Switch the order of operations performed when collating list of paths
from which a user can include attachments.

First collect all normalised/absolute paths then filter empty entries,
which fixes an issue where $CFG->localrequestdir could be defined but
not exist. This would lead to an empty string being passed to strpos
which triggered a PHP warning.

Co-authored-by: Peter Burnett <peterburnett@catalyst-au.net>
2021-01-25 19:53:41 +00:00
Tim Hunt c68beeeedf MDL-68970 quiz: prevent page caching during attempts
This ensures that the page reloads if the student uses
the Back or Forwards buttons within an attempt. This
avoids questions being in a stale state, or
the timer showing the wrong time.

Thanks to Jake Dallimore and Russell Boyatt for suggestions
which lead to this fix.
2021-01-25 18:34:24 +00:00
Víctor Déniz 88bb658169 Merge branch 'MDL-65135-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-01-25 15:06:00 +00:00
Ferran Recio 68e1dd3c0b MDL-70634 h5p: minimizing height glitch 2021-01-25 13:54:40 +01:00
Peter Dias 9c08b2b8aa MDL-70339 mod_lti: Use the convenience function to get the right img 2021-01-25 13:39:02 +08:00
Peter Dias 4a6dfb94f2 MDL-68958 mod_imscp: Return manifestfilename as default response. 2021-01-25 13:23:15 +08:00
Peter Burnett 81b25fc274 MDL-70444 my: Improved robustness of bulk dashboard reset 2021-01-25 13:55:41 +10:00
Peter Dias 76f3835477 MDL-56772 core: Update the picker styles for rtl langs 2021-01-25 11:36:32 +08:00
Adrian Greeve 54b81d0f32 Merge branch 'MOODLE_311_MDL-69631-v3' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-01-25 08:14:43 +08:00
Andrew Nicols 0bac7faf90 MDL-66979 behat: Warn about old behat.yml file location 2021-01-23 20:44:23 +08:00
AMOS bot 6dd97088db Automatically generated installer lang files 2021-01-23 00:07:28 +00:00
Ferran Recio e134a42963 MDL-70309 libraries: upgrade mongodb integration files 2021-01-22 14:44:29 +01:00
Ferran Recio e941b105ac MDL-70309 libraries: upgrade mongodb to version 1.8.0 2021-01-22 14:44:29 +01:00
Paul Holden 4b01d3bea0 MDL-70585 course: deeper clean of path names in course export.
This fixes an issue on those systems that don't fully support unicode
characters within zip structures, which subsequently led to broken
links when browsing downloaded course content.
2021-01-22 08:15:25 +00:00
Ilya Tregubov 9874857540 MDL-64866 message: Remove message/defaultoutputs.php
and final deprecation of admin_page_defaultmessageoutputs class.
2021-01-22 09:45:54 +02:00
Andrew Nicols 19db0c4b44 MDL-66979 behat: Rename and warn on old config 2021-01-22 14:52:19 +08:00
Andrew Nicols dd4693ac0c MDL-66979 behat: Uncomment step disabled for old firefox 2021-01-22 14:52:18 +08:00
Andrew Nicols 6704b2b5a4 MDL-66979 behat: Pad messaging drawer
This works around an issue highlighted by MDL-70411 whereby some of the
messaging links are covered by the scrollbar in Firefox on MacOS.
2021-01-22 14:52:18 +08:00
Andrew Nicols d467f87bd7 MDL-66979 behat: Work around weird gradebook focus behaviour
I can't expand this one in a sane fashion but the older JS is doing some
weird and wonderful things with focus.

The only way I could get this to behave correctly was to move away from
the field, move back to it, and then move away again. Other combinations
failed in different browsers for different reasons.
2021-01-22 14:52:18 +08:00
Andrew Nicols 0bd971ebc0 MDL-66979 behat: availability field extends textarea
The availability behat field extends the textarea type, and therefore
needs to include this type.
2021-01-22 14:52:18 +08:00
Andrew Nicols 13c2654eb1 MDL-66979 behat: Improve chromeOptions configuration
Simplify the chromeOptions configuration to improve readability.
2021-01-22 14:52:18 +08:00
Andrew Nicols a85f7f83b9 MDL-66979 question: Improve behat test reliability
Expand all fieldsets rather than individual fieldsets.

This can fail in some situations where the page moves as the first
fieldset opens and HTML transitions take effect. This causes subsequent
fieldsets to move after WebDriver has calculated the click target.
2021-01-22 14:52:18 +08:00
Andrew Nicols c501f5fa25 MDL-66979 mod_assign: Stop clicking the user filters
Remove the documented hack which was re-opening a popup because it
"closes for some reason". It no longer randomly closes.
2021-01-22 14:52:18 +08:00
Andrew Nicols 3ab052e70d MDL-66979 behat: Switch to generators
These steps were creating content manually in an unnecessary fashion. I
had to debug some issues with features in these areas so took the time
to update them to make use of data generators, which are significantly
faster.
2021-01-22 14:52:18 +08:00
Andrew Nicols f60b5ea4db MDL-66979 behat: Remove unused var 2021-01-22 14:52:18 +08:00
Andrew Nicols ac88e330a6 MDL-66979 behat: Whitespace fix 2021-01-22 14:52:18 +08:00
Andrew Nicols be9e3ebd34 MDL-66979 behat: Remove manually triggered events
Behat should not trigger Synthetic browser events. It is incorrect to do
so as the UI should be used to trigger events correctly.

The W3C WebDriver specification explicitly states when and where these
events will be triggered from (the browser) and therefore there is no
ambiguity and no need to synthetically trigger them from Behat.
2021-01-22 14:52:18 +08:00
Andrew Nicols 74a156c3d0 MDL-66979 group: Replace direct element interaction with steps
The W3C WebDriver leads to faster operation of individual steps which
highlights where WebDriver is moving to a new step faster than the
browser can process it.

The solution here is to use the `execute` function to interact with the
browsers as this makes use of the various wait and check steps.
2021-01-22 14:52:17 +08:00
Andrew Nicols 2c967d8d07 MDL-66979 behat: Remove unnecessary steps which fail
These steps were completely pointless and were failing with the W3C
Webdriver becuase focus was never on the Update Profile button in the
first place.

At a minimum we should remove the Focus change step as it not valid, but
the following step is also pointless.
2021-01-22 14:52:17 +08:00
Andrew Nicols d2ceac9d3d MDL-66979 scorm: Increase behat window size
On Firefox there can be some issues with ensuring that all nodes are
visible in order to click them.

This is likely an upstream geckodriver bug and not one that can be
easily addressed across all of Moodle.

In this instance the "Next" button is just outside the Visible Window,
but it is in an iFrame which is fully visible. In this situation
Firefox is unable to click the button but does not error.
2021-01-22 14:52:17 +08:00
Andrew Nicols 45b0f89d87 MDL-66979 behat: Scroll nodes into view before hover
The W3C Specification does not require that a NodeElement be in the
current viewport before triggering a mouseOver. As a result the
mouseOver will generate an Exception because the element is not in the
viewport, and the X/Y co-ordinates are invalid.

To handle this the node is scrolled into view.
2021-01-22 14:52:17 +08:00
Andrew Nicols a6512819b3 MDL-66979 behat: Fix window switching
Normalise switching of window contexts by setting the main window name
to a null.

Where the window has no name (null/empty), then the root context is
selected.
2021-01-22 14:52:17 +08:00
Andrew Nicols 740c2e80d8 MDL-66979 behat: Use tab to blur current focus
The focus should be on something, rather than removed.

The way in which focus removal works can lead to side effects.
2021-01-22 14:52:17 +08:00
Andrew Nicols 44d9f77cae MDL-66979 behat: Update passwordunmask form field control
Update the passwordunmask form field type for behat to interact with the
form element as a human would rather than via synthetic event triggers.
2021-01-22 14:52:17 +08:00
Andrew Nicols 076ec2766f MDL-66979 behat: iFrames must have a name for switchTo
The W3C WebDriver protocol supports switching of contexts using a named
context, and not the class asscoiated with that context.
2021-01-22 14:52:17 +08:00
Andrew Nicols eb03e5c7b7 MDL-66979 mod_data: Improve behat chart data step
Charts data visibility is more reliable when checked via the
aria-expanded attribute.

The isVisible attribute can cause some failures under Firefox.
2021-01-22 14:52:17 +08:00
Andrew Nicols d196e8093b MDL-66979 behat: Handle JS on elements better
This change introduces a new function to execute Javascript directly on
a node.

This should not, ordinarily, be used directly by steps, but may be
required in other parts of the Behat interaction.
2021-01-22 14:52:17 +08:00
Andrew Nicols 2d68b303f9 MDL-66979 behat: Rename selenium config to webdriver
The PHP WebDriver Mink Driver does not necessarily require Selenium. It
supports Selenium 3 upwards, and can be used directly with ChromeDriver,
EdgeDriver, SafariDriver, GeckoDriver, and others.

It therefore uses a slightly different configuraitno path.
2021-01-22 14:52:17 +08:00
Andrew Nicols c5d25f9017 MDL-66979 behat: Core updates for W3C WebDriver
This commit updates core Behat features to make use of the
php-webdriver/webdriver library instead of the legacy Instaclick
library.

Most of these changes relate to use of features of WebDriver which we
are required to use directly rather than through the Mink Driver.
2021-01-22 14:52:16 +08:00
Andrew Nicols 675ff118f2 MDL-66979 behat: Switch to new W3C Behat driver
This commit updates the composer dependencies to make use of the updated
version of moodlehq/moodle-behat-extension which depends upon the
php-webdriver/webdriver and relevant Mink WebDriver.
2021-01-22 14:52:16 +08:00
Jake Dallimore 500bee1af0 weekly release 3.11dev 2021-01-22 11:30:46 +08:00
Jake Dallimore b9896f4a8e NOBUG: Fixed file access permissions 2021-01-22 11:30:46 +08:00
Jake Dallimore 6db835f666 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-01-22 11:30:43 +08:00
Tim Hunt 0dedf60a9a MDL-46256 count_words: fix handling of paragraphs 2021-01-21 09:54:01 +00:00
Tim Hunt 063dce507a MDL-46256 count_letters: an unit tests and fix HTML editity handling 2021-01-21 09:54:01 +00:00
Tim Hunt b4fd86591d MDL-46256 word count: Convert existing tests to a data provider 2021-01-21 09:54:01 +00:00
Paul Holden b19e413368 MDL-70315 libraries: upgrade Javascript polyfills.
* mdn-polyfills@5.20.0
 * url-polyfill@1.1.12
2021-01-21 08:58:46 +00:00
Jun Pataleta a10a3f94c7 Merge branch 'MDL-70297-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-01-21 12:19:04 +08:00
Adrian Greeve 23baaf8f61 Merge branch 'MDL-57020-311-allow_delete_unused_scale' of https://github.com/sharidas/moodle into MOODLE_311_STABLE 2021-01-21 12:02:10 +08:00
Sujith Haridasan 1215070d8d MDL-57020 scales: Allow deletion of unused scales in forum
Allow deletion of unused scales used in a
forum for the course.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-01-21 09:16:46 +05:30
Mikhail Golenkov 04298671e5 MDL-69631 assign: Add 'Draft' filter for grading table 2021-01-21 14:41:36 +11:00
Jun Pataleta 84922dc4fc Merge branch 'MDL-70301-311' of https://github.com/Chocolate-lightning/moodle into MOODLE_311_STABLE 2021-01-21 11:33:35 +08:00
Mathew May ec4d3aa389 MDL-70301 lib: Update thirdpartylibs scssphp 2021-01-21 10:35:24 +08:00
Mathew May 9a3e290efb MDL-70301 lib: Upgrade scssphp to 1.4.1 2021-01-21 10:35:10 +08:00
Adrian Greeve 1263d09396 Merge branch 'MDL-70302-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-01-21 09:48:34 +08:00
Peter Dias c60b950b87 MDL-70302 core: Update the lib's readme, xml and upgrade files 2021-01-21 09:34:33 +08:00
Eloy Lafuente (stronk7) b390eebb7a Merge branch 'MDL-70317-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-01-20 23:27:11 +01:00
Eloy Lafuente (stronk7) 85ae2babde Merge branch 'MDL-70134_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-01-20 22:47:30 +01:00
Luca Bösch beec305005 MDL-70317 filter_mathjaxloader: update default CDN to 2.7.9 2021-01-20 22:02:09 +01:00
Eloy Lafuente (stronk7) 2236ac67b0 Merge branch 'MDL-70055-MOODLE_311_STABLE' of https://github.com/kabalin/moodle into MOODLE_311_STABLE 2021-01-20 19:44:56 +01:00
Eloy Lafuente (stronk7) e24754693a Merge branch 'MDL-70291-311-1' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-01-20 19:18:07 +01:00
Sara Arjona e49ad9eeb6 MDL-70438 contentbank: fix behat issue with classic 2021-01-20 19:02:19 +01:00
Eloy Lafuente (stronk7) c5dd5a6fe1 Merge branch 'MDL-70296-311-1' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-01-20 17:19:40 +01:00
Jun Pataleta e4527dc68f Merge branch 'MDL-70319-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-01-20 22:40:35 +08:00
Jun Pataleta 93ae28874e Merge branch 'MDL-70300-311' of https://github.com/Chocolate-lightning/moodle into MOODLE_311_STABLE 2021-01-20 17:13:37 +08:00
Mathew May 95fa1e387e MDL-70300 core_lib: Update thirdpartylibs php-css-parser 2021-01-20 15:53:10 +08:00
Nadav Kavalerchik 99b1551e54 MDL-66932 theme/boost: Use LTR directionality to display user % grades 2021-01-20 09:29:38 +02:00
Jun Pataleta 7627763dfe Merge branch 'MDL-70562-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-01-20 15:01:27 +08:00
Jake Dallimore eebb226156 Merge branch 'MDL-69333-fingerprint-checks-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-01-20 11:24:42 +08:00
Adrian Greeve b2bad0b648 Merge branch 'MDL-70438-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-01-20 09:51:06 +08:00
Simey Lameze 3e2de0c6c9 MDL-70648 calendar: upgrade step to delete wrong cat events 2021-01-20 09:32:09 +08:00
Simey Lameze b0aa55a75a MDL-70648 calendar: add form validation for category events 2021-01-20 09:26:33 +08:00
Brendan Heywood 6f60d650d3 MDL-69333 report_security: Add checks for many public & private urls 2021-01-20 11:20:31 +11:00
Brendan Heywood 63e7f2a64f MDL-69333 error: Allow explicit http error codes in web server config
eg in Apache you could capture 403 errors and funnel them to this
error handler script and also transform them to 404s:

ErrorDocument 403 /error/index.php?code=404
2021-01-20 11:20:31 +11:00
Eloy Lafuente (stronk7) 4c698ab3d3 Merge branch 'MDL-70159-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-01-19 23:44:54 +01:00
Jun Pataleta dbd55e05ae Merge branch 'MDL-70292-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-01-20 00:12:11 +08:00
Sara Arjona 8510e9d881 Merge branch 'MDL-70303-311' of git://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2021-01-19 16:50:09 +01:00
Ferran Recio 8408a82960 MDL-70303 libraries: upgrade GeoIP to 2.11.0 and MaxMind DB to 1.9.0 2021-01-19 16:35:39 +01:00
Sara Arjona 92674c614a MDL-70438 contentbank: Add column to view mode for content uses 2021-01-19 16:08:50 +01:00
Sara Arjona d83b4b4abf MDL-70438 contentbank: Display content uses before removal 2021-01-19 16:08:50 +01:00
Sara Arjona a80dcdf641 MDL-70438 contentbank: Add method get_uses to content 2021-01-19 16:08:50 +01:00
Ilya Tregubov 78d39f360b MDL-70319 core: Moodle customizations. 2021-01-19 10:04:52 +02:00
Ilya Tregubov 4415ecbe7b MDL-70319 core: Upgrade php-enum to 1.7.7 2021-01-19 10:04:52 +02:00
Ilya Tregubov f12a16b991 MDL-70297 libraries: Moodle customizations. 2021-01-19 09:51:34 +02:00
Ilya Tregubov e060179098 MDL-70297 libraries: xhprof upgraded to 2.2.3 2021-01-19 09:51:34 +02:00
Adrian Greeve 58a3b7a8ad Merge branch 'MDL-69202_311' of https://github.com/ffhs/moodle into MOODLE_311_STABLE 2021-01-19 15:40:47 +08:00
Jake Dallimore 1773ffc774 Merge branch 'MDL-69522-custom-message-311' of https://github.com/Peterburnett/moodle into MOODLE_311_STABLE 2021-01-19 15:38:52 +08:00
Ilya Tregubov ef9dab903f MDL-70292 lib: fix unit tests. 2021-01-19 09:17:42 +02:00
Ilya Tregubov 1379a55025 MDL-70292 lib: Moodle customizations. 2021-01-19 09:17:42 +02:00
Ilya Tregubov a93d965968 MDL-70292 lib: update phpmailer to 6.2.0 2021-01-19 09:17:42 +02:00
Adrian Greeve e105a212b6 Merge branch 'MDL-70128-311' of git://github.com/jleyva/moodle into MOODLE_311_STABLE 2021-01-19 14:49:51 +08:00
Mathew May a18cf2c3a3 MDL-70300 lib: Apply php css parser patches 2021-01-19 11:01:38 +08:00
Mathew May 8e1cc98115 MDL-70300 lib: Upgrade php css parser to 8.3.1 2021-01-19 11:01:24 +08:00
Jun Pataleta f4b3440fb8 Merge branch 'MDL-70294-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-01-19 09:20:11 +08:00
Paul Holden 48cbfcc87b MDL-70294 libraries: document upgrade of TCPDF. 2021-01-18 21:07:41 +00:00
Paul Holden b369129642 MDL-70294 libraries: upgrade to version 6.3.5 of TCPDF. 2021-01-18 21:07:31 +00:00
Tim Hunt 296669ea36 MDL-70134 essay qtype: Provide options for smaller response boxes
And make the default box size 10
2021-01-18 09:24:57 +00:00
Tim Hunt c2f419bc75 MDL-70134 manual grading: make starting comment box size 3 lines
I am guessing most comments are short, and the box can be expanded if needed.
2021-01-18 09:24:57 +00:00
Sara Arjona d6fa4e499e Merge branch 'MDL-70290-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-01-18 09:23:40 +01:00
Sara Arjona fc67a37242 Merge branch 'MDL-70305-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2021-01-18 09:20:30 +01:00
Bas Brands a1ba936d59 MDL-59782 core_question: improve questionbank highlighting 2021-01-18 09:13:07 +01:00
Peter Dias 238e0646e2 MDL-70296 core: Update the moodle's readme, xml and upgrade files 2021-01-18 09:30:25 +08:00
Peter Dias fe91e572bb MDL-70296 core: Upgrade markdown lib 2021-01-18 09:30:25 +08:00
Peter Dias 56dece35b3 MDL-70291 core: Update lib readme, upgrade and xml files 2021-01-18 09:28:32 +08:00
Peter Dias 9bdf4fe1e9 MDL-70291 core: Add custom moodle patch to minify 2021-01-18 09:28:32 +08:00
Peter Dias 7c9cceed94 MDL-70291 core: Upgrade pathconverter lib to 1.1.3 2021-01-18 09:28:32 +08:00
Peter Dias ed3fbb505e MDL-70291 core: Upgrade minify lib to 1.3.63 2021-01-18 09:28:32 +08:00
Peter Dias 23df19225a MDL-70302 core: Upgrade spout to 3.1.0 2021-01-18 09:20:48 +08:00
AMOS bot 1e56e0626c Automatically generated installer lang files 2021-01-17 00:07:29 +00:00
Adrian Perez 0e365f283c MDL-69202 Restore backup: add getter method for oldmoduleid 2021-01-16 10:36:33 +01:00
Paul Holden dcb3381d77 MDL-58673 media_videojs: enable playback rates in player. 2021-01-15 14:06:19 +00:00
Paul Holden c9f5e23f9b MDL-70535 media_videojs: fallback to English language video player.
When current language doesn't have accompanying videojs language file
we should fallback to displaying the player in English, otherwise the
web service returns empty and a Javascript exception is triggered.
2021-01-15 13:50:59 +00:00
Luca Bösch 8bd0898ce3 MDL-70562 mod_quiz: "Edit quiz" and "Back to the course" button spacing 2021-01-15 11:59:26 +01:00
Sara Arjona fee3970787 weekly release 3.11dev 2021-01-15 08:25:42 +01:00
Sara Arjona ad14375609 NOBUG: Fixed file access permissions 2021-01-15 08:25:41 +01:00
Sara Arjona 5146b7e563 NOBUG: Fixed SVG browser compatibility 2021-01-15 08:25:39 +01:00
Sara Arjona 2943454ee8 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-01-15 08:25:39 +01:00
Sara Arjona 1520ae2cbd Merge branch 'MDL-69308_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-01-14 12:03:36 +01:00
Paul Holden d462ff4d30 MDL-65135 message: use full date in messaging drawer for old messages.
Messages sent in previous years will now include the year portion of
the date string.
2021-01-14 08:00:59 +00:00
Paul Holden 721b1b6168 MDL-70159 tool_capability: order capabilities by their name. 2021-01-14 07:32:53 +00:00
Jake Dallimore 9349702f8a Merge branch 'MDL-69877-311' of git://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-01-14 14:52:02 +08:00
Michael Hawkins 6d02c5fa1c MDL-69877 core: Added security.txt 2021-01-14 14:30:40 +08:00
Jun Pataleta 92c7d807bb Merge branch 'MDL-70312-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-01-14 11:54:26 +08:00
Jake Dallimore dc2b9a34c1 Merge branch 'MDL-68608-improve-readonly-debugging-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-01-14 08:48:46 +08:00
Adrian Greeve e07bba321d Merge branch 'MDL-68597_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-01-14 08:30:12 +08:00
AMOS bot bcb3e2cda7 Automatically generated installer lang files 2021-01-14 00:07:26 +00:00
Peter Dias fc26c95cd2 MDL-70290 core: Update the lib's xml and upgrade files 2021-01-14 07:59:10 +08:00
Peter Dias a14ee586d8 MDL-70290 core: HTMLPurifier upgrade to 4.13.0 2021-01-14 07:59:10 +08:00
Peter Dias 60c5c0e8df MDL-70305 lib: Update thirdpartylibs chartjs version 2021-01-14 07:55:25 +08:00
Peter Dias e193299876 MDL-70305 lib: Upgrade chartjs to 2.9.4 2021-01-14 07:55:25 +08:00
Eloy Lafuente (stronk7) 7cd9a3c4a0 Merge branch 'MDL-70408-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-01-13 23:59:50 +01:00
Eloy Lafuente (stronk7) 5aed7f4217 MDL-69308 upgrade: remove all the < 3.6.0 upgrade steps
This just deletes all the upgrade steps previous to 3.6.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2018120300 (v3.6.0) as anti-cheating measure.

Note that in this case, there wasn't any case of upgradelib
functions being used, hence we haven't to deprecate/remove
anything in codebase. When there is such a need, that is done
in separate commits (one for each function) and documented here.

See MDL-65809 commits for an example removing/deprecating a
good number of functions.
2021-01-13 19:28:39 +01:00
Eloy Lafuente (stronk7) aff5b5abb9 MDL-69308 github actions: Bump min PHP requirement to 7.3 2021-01-13 19:27:04 +01:00
Eloy Lafuente (stronk7) 0f7aafe1fe MDL-69308 travis: Bump min PHP requirement to 7.3 2021-01-13 19:27:00 +01:00
Eloy Lafuente (stronk7) c6fb18ef1d MDL-69308 environment: Apply agreed changes
- PHP 7.3 required.
- Moodle 3.6 required.
- SQL*Server 2017 (aka, 14.0) required.
- Sodium PHP extension required.
2021-01-13 19:26:54 +01:00
Eloy Lafuente (stronk7) 0c2d9d9db7 MDL-69308 environment: 3.11 base information
This is a direct copy of the 3.10 branch to have
the changes under control in next commits.
2021-01-13 19:26:48 +01:00
Sara Arjona e730802e08 Merge branch 'MDL-70299-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-01-13 17:20:00 +01:00
Shamim Rezaie 120e744a43 MDL-70625 core_calendar: Fix whitespace appearance in the id attribute 2021-01-14 01:58:52 +11:00
Sara Arjona 44012cdfe3 Merge branch 'MDL-70394-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-01-13 15:31:19 +01:00
Sara Arjona 4bd52c7ac3 Merge branch 'MDL-70387-311' of git://github.com/jleyva/moodle into MOODLE_311_STABLE 2021-01-13 14:56:12 +01:00
Juan Leyva 4f2cfe7af8 MDL-70387 files: New WS core_files_get_unused_draft_itemid 2021-01-13 13:03:00 +01:00
Sara Arjona 24b10d62da Merge branch 'MOODLE_311_MDL-70362' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-01-13 12:36:46 +01:00
Sara Arjona bc439a9dfc Merge branch 'MDL-68010-cron-run-disabled-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-01-13 11:28:21 +01:00
Mihail Geshoski 19e4e865ac MDL-68486 auth_shibboleth: Reset convert_data if it uses dataroot file
Upgrade step that resets the 'Data modification API' (convert_data)
setting to its default value if this setting is currently configured
to use a file located within the $CFG->dataroot directory.
2021-01-13 12:34:45 +08:00
Mihail Geshoski 2116878465 MDL-68486 auth_shibboleth: Prevent using dataroot files in convert_data
Prevents configuring the 'Data modification API' (convert_data) setting
to use files located within the $CFG->dataroot directory as it exposes
the site to security risks.
2021-01-13 12:34:45 +08:00
Jun Pataleta 5e4a7224a5 Merge branch 'MDL-70580-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-01-13 10:20:00 +08:00
AMOS bot 62fb6ac53a Automatically generated installer lang files 2021-01-13 00:07:28 +00:00
Paul Holden 5f9c1e5dd2 MDL-70580 core: retrieve closest tree node in click handler. 2021-01-12 20:17:22 +00:00
Tim Hunt 8306fc3f3e MDL-68597 qtype_essay: show the word count on the review screen 2021-01-12 19:53:01 +00:00
Tim Hunt 8d7b3b3fe7 MDL-68597 qtype_essay: switch the form to consistently use hideIf 2021-01-12 17:54:39 +00:00
Michael Hawkins da051fa484 MDL-69911 core: Clean content passed through TeX filter 2021-01-12 17:14:31 +01:00
Ferran Recio 8da4872464 MDL-67782 message: fix messages max length 2021-01-12 17:14:31 +01:00
Juan Segarra Montesinos c689df0a5d MDL-69797 core_grades: Implement authorization into fetch method 2021-01-12 17:14:31 +01:00
Juan Segarra Montesinos 3a02eccc2e MDL-69797 core_grades: Implement authorization into fetch method 2021-01-12 17:14:31 +01:00
Juan Segarra Montesinos dcbaed2862 MDL-69797 gradingform_rubric: Implement authorization into fetch method 2021-01-12 17:14:31 +01:00
Juan Segarra Montesinos 808ad0df73 MDL-69797 gradingform_guide: Implement authorization into fetch method 2021-01-12 17:14:31 +01:00
Sara Arjona 220ad68736 Merge branch 'MDL-70308-311' of git://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2021-01-12 17:04:28 +01:00
Sara Arjona 3d7d18adea Merge branch 'MDL-70298-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-01-12 15:58:41 +01:00
Ilya Tregubov b12594dbfa MDL-70298 lib_horde: Upgrade Horde library to 5.2.23 2021-01-12 15:58:36 +02:00
Sara Arjona 33da471284 Merge branch 'MDL-70009-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-01-12 10:21:02 +01:00
David Watson ad590f99db MDL-69431 course: validate section url param against maxsections 2021-01-12 17:08:44 +08:00
Sara Arjona 1e8ec8ef26 Merge branch 'MDL-68768-adhoc-task-faildelay-check-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-01-12 10:07:01 +01:00
Jake Dallimore 1e667ac167 Merge branch 'MDL-69529-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-01-12 16:48:10 +08:00
Ilya Tregubov dc4f973e62 MDL-70009 h5pactivity: Split get_pluginfile_hash in two methods. 2021-01-12 09:10:50 +02:00
Jun Pataleta 7ff1b6c79c Merge branch 'MDL-70580-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-01-12 13:15:50 +08:00
AMOS bot d37d56025f Automatically generated installer lang files 2021-01-12 00:07:37 +00:00
Andrew Nicols 1894ea0c5c MDL-70580 core: Tree nodes should check if they were clicked directly 2021-01-11 23:43:22 +00:00
Paul Holden 186879fca4 MDL-69816 tool_uploadcourse: configure course content download value. 2021-01-11 22:24:39 +00:00
Eloy Lafuente (stronk7) ae6c7b1f9d Merge branch 'MDL-70486-311-get_region_name' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-01-11 22:55:35 +01:00
Tim Hunt 48e0b24587 MDL-68597 essay word limits: fixes requested by the integrator 2021-01-11 20:32:24 +00:00
Mahmoud Kassaei 9b7439c3a8 MDL-68597 Qtype_Essay: Adding word min/max for online text input 2021-01-11 20:32:20 +00:00
Tim Hunt 7449ad7861 MDL-70574 qtype_multianswer: fractional scores should be possible 2021-01-11 17:35:51 +00:00
Michael Hawkins d8056de5c4 MDL-70571 lib: Added additional escaping to search_input template 2021-01-11 16:20:23 +01:00
Eloy Lafuente (stronk7) 19996b52b1 Merge branch 'MDL-70266_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-01-11 16:12:02 +01:00
Mark Nelson a64c837ae5 MDL-70034 gradingform_guide: use new API to retrieve grade item name 2021-01-11 15:20:05 +01:00
Sara Arjona 376b9d5a13 Merge branch 'MDL-70567-MOODLE_311_STABLE' of https://github.com/dmitriim/moodle into MOODLE_311_STABLE 2021-01-11 13:09:41 +01:00
Sara Arjona 6c330f2f76 Merge branch 'MDL-70578-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-01-11 12:58:11 +01:00
Sara Arjona 0c3ae37c2c Merge branch 'MDL-70352-MOODLE_311_STABLE' of https://github.com/dmitriim/moodle into MOODLE_311_STABLE 2021-01-11 12:23:57 +01:00
AMOS bot 29cde70458 Automatically generated installer lang files 2021-01-11 00:08:42 +00:00
Eloy Lafuente (stronk7) 7a62f6d76d Merge branch 'MDL-70550-311-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-01-09 13:17:43 +01:00
AMOS bot a061175fba Automatically generated installer lang files 2021-01-09 00:07:30 +00:00
Sara Arjona cf317d9712 Merge branch 'MDL-70558-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-01-08 17:07:16 +01:00
Sara Arjona 57f38e3de2 Merge branch 'MDL-70102-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-01-08 15:50:18 +01:00
Paul Holden 705bc7fdaa MDL-70299 libraries: upgrade to version 1.7.1 of loglevel. 2021-01-08 09:51:09 +00:00
David Mudrák 3a9b87a29c MDL-70550 lang: Use the fixed strings in Behat tests, too 2021-01-08 09:01:29 +01:00
Helen Foster af16c0310f MDL-70550 lang: Import fixed English strings (en_fix) 2021-01-08 09:00:42 +01:00
Jun Pataleta cb49142a6b Merge branch 'MDL-70310-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-01-08 14:47:23 +08:00
Luca Bösch 1fc4efa834 MDL-70578 cohorts: Add bootstrap classes to buttons 2021-01-08 07:28:25 +01:00
Jun Pataleta dab0910676 weekly release 3.11dev 2021-01-08 12:14:48 +08:00
Jun Pataleta 34545b649b Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-01-08 12:14:47 +08:00
AMOS bot eaac45decc Automatically generated installer lang files 2021-01-08 00:07:26 +00:00
Tomo Tsuyuki 943562e227 MDL-70245 core_grade: Fix grade_get_setting unit test failures
To fix the phpunit issue, change from static variable to use cache
2021-01-07 23:49:29 +01:00
Eloy Lafuente (stronk7) 35e0fb9f86 Merge branch 'MDL-70584-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-01-07 23:31:17 +01:00
sam marshall 13f8798c79 MDL-70102 PHPunit: Core test fails with weird added modules
Specifically it fails if the modules have unusual default capabilities
so that editingteacher doesn't have addinstance.
2021-01-07 16:11:10 +00:00
Marina Glancy 1fa27828ef MDL-70584 core_iplookup: increase tolerance in test 2021-01-07 14:46:38 +01:00
Tim Hunt 9082d68d54 MDL-70266 quiz overrides: respect show user identity setting 2021-01-07 10:46:11 +00:00
Ilya Tregubov 8af3db04d3 MDL-70310 user: Remove yahoo icon since domain no longer exists. 2021-01-07 09:15:21 +02:00
Jun Pataleta fa9c582da9 Merge branch 'MDL-70374_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-01-07 12:24:26 +08:00
Eloy Lafuente (stronk7) f6df48b48b Merge branch 'MDL-70476_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-01-07 00:27:57 +01:00
Eloy Lafuente (stronk7) 19b96bd3ba Merge branch 'MOODLE_311_MDL-70520' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-01-07 00:19:00 +01:00
Paul Holden eee8bf063f MDL-70579 course: filter site fullname when exporting course content. 2021-01-06 21:30:30 +00:00
Dmitrii Metelkin 835000c522 MDL-70567 task: fix broken result filter on logs page 2021-01-06 14:29:45 +11:00
Sébastien Mehr f5a317feed MDL-70482 template: add missing closing bracket 2021-01-06 11:26:03 +08:00
Dmitrii Metelkin 571df8fe10 MDL-70352 core: attach modal to a specific element 2021-01-06 11:16:15 +11:00
Jun Pataleta b9ca4b0e7e Merge branch 'MDL-57552-311' of git://github.com/aanabit/moodle into MOODLE_311_STABLE 2021-01-05 22:20:24 +08:00
Jun Pataleta ff06987784 Merge branch 'MOODLE_311_MDL-68792_v3' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2021-01-05 22:09:08 +08:00
Paul Holden 76693a564f MDL-70558 tool_langimport: sort available language packs. 2021-01-04 23:55:55 +00:00
Paul Holden c7f65e34bb MDL-70312 libraries: upgrade to version 2.3.5 of FPDI. 2021-01-04 09:33:58 +00:00
Ilya Tregubov 48238329ee MDL-69529 contentbank: Remove redundant code. 2021-01-04 09:28:41 +02:00
AMOS bot eaf6f58369 Automatically generated installer lang files 2020-12-27 00:07:28 +00:00
Ruslan Kabalin 921f8aee81 MDL-70055 pgsql DML: Support large number of SQL-IN parameters.
This patch adds a solution for Postgres that allows overriding IN
statement limit of 16bit (65535 values) by wrapping items in VALUES
list. This only takes place in number of items exceeds 65535, otherwise
parent class get_in_or_equal() function is used.
2020-12-24 14:40:22 +00:00
AMOS bot 288db59992 Automatically generated installer lang files 2020-12-24 00:07:29 +00:00
Eloy Lafuente (stronk7) 7eb99cedd4 weekly release 3.11dev 2020-12-23 20:24:32 +01:00
Eloy Lafuente (stronk7) 1c0811636b Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2020-12-23 20:24:29 +01:00
Ferran Recio 982e52b366 MDL-70308 libraries: upgrade videojs to 7.10.0 2020-12-23 10:38:23 +01:00
Jake Dallimore 52976d4eb3 Merge branch 'MDL-69399-311_lti_alpha' of https://github.com/haietza/moodle into MOODLE_311_STABLE 2020-12-23 11:36:54 +08:00
Eloy Lafuente (stronk7) c8855a36ab Merge branch 'MDL-56119-311' of https://github.com/inigozendegi/moodle into MOODLE_311_STABLE 2020-12-23 01:27:00 +01:00
Eloy Lafuente (stronk7) 518fbeb84e Merge branch 'MDL-70279-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2020-12-23 00:46:51 +01:00
Bas Brands fe68109683 MDL-70436 theme_boost: closebutton styles in moodle-dialog-fullscreen 2020-12-22 18:29:46 +01:00
Bas Brands c4f8590a9d MDL-70386 theme_boost: quizes correctness badges 2020-12-22 18:23:13 +01:00
Víctor Déniz 0d33e00c43 Merge branch 'MDL-70341-311-task-override-fix-disabled' of https://github.com/jamie-catalyst/moodle into MOODLE_311_STABLE 2020-12-22 10:35:46 +00:00
Jake Dallimore 6c5fc83f17 Merge branch 'MDL-70459-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2020-12-22 16:51:15 +08:00
Jake Dallimore cf02c19b01 Merge branch 'MDL-69422-311-2' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2020-12-22 15:58:45 +08:00
Jake Dallimore d8247c90f2 Merge branch 'MDL-70426-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2020-12-22 15:16:23 +08:00
Kristian Ringer 43f48b8828 MDL-64865 auth: Log changing auth config in get_enabled_auth_plugins 2020-12-22 13:39:21 +08:00
Mikhail Golenkov 1685058696 MDL-70520 mod_assign: Use task API to get scheduled task lastruntime 2020-12-22 15:29:24 +11:00
Mikhail Golenkov 5623d3bae6 MDL-70520 tasks: Keep lastruntime when a scheduled task is reset 2020-12-22 15:29:02 +11:00
Andrew Nicols d2ef283eb0 Merge branch 'MOODLE_311_MDL-65856' of https://github.com/hdagheda/moodle into MOODLE_311_STABLE 2020-12-22 09:41:48 +08:00
AMOS bot 8d5e440db7 Automatically generated installer lang files 2020-12-22 00:07:26 +00:00
Víctor Déniz b499883da2 Merge branch 'MDL-70355-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2020-12-21 23:19:46 +00:00
Eloy Lafuente (stronk7) 3e4d38868d Merge branch 'MDL-70430-311-oauth2refreshtoken' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2020-12-22 00:06:53 +01:00
Víctor Déniz 990f1d5b73 Merge branch 'MDL-70284-dynreg-bug-311' of https://github.com/cengage/moodle into MOODLE_311_STABLE 2020-12-21 13:43:17 +00:00
Heena Agheda 690d44219c MDL-65856 session: UX review of session timeout
Add new setting 'sessiontimeoutwarning', gives logged in user ability to extend session when there is no activity.
2020-12-21 09:11:10 +11:00
Sara Arjona cbee3f569c Merge branch 'MDL-69107-311-2' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2020-12-18 15:22:16 +01:00
Michelle Melton d2fd52c0b3 MDL-69399 LTI: Alphabetize LTI tool list in selection menu 2020-12-18 08:58:39 -05:00
Tim Hunt 7242488cc0 MDL-70374 qtype_multichoice: code cleanup
* Remove some obsoliete CSS.
* Put the CSS in a more logical order.
* Rename some variables in the renderer, for more clarity.
2020-12-18 13:14:04 +00:00
Tim Hunt 5426f8bc35 MDL-70374 qtype_multichoice: improve alignment of choices 2020-12-18 13:14:03 +00:00
Tim Hunt 4774aadd3e MDL-70476 permission overrides: role names double-escaped in tool tip 2020-12-18 13:02:32 +00:00
Mikhail Golenkov ffccb474b3 MDL-70362 admin_cli: Add showdebugging and showsql to uninstall_plugins 2020-12-18 12:17:12 +11:00
Mikhail Golenkov 478852d08f MDL-68792 theme_boost: Do not move blocks on embedded layout. 2020-12-18 12:07:26 +11:00
Mikhail Golenkov 64891ca0c7 MDL-68792 theme_boost: Show the fake blocks on embedded layout. 2020-12-18 12:07:26 +11:00
Sara Arjona 6531992043 MDL-70408 mod_h5pactivity: Add link to content bank content
If the activity uses a referenced H5P file from the content bank,
a link for displaying this specific content will be shown into the H5P
activity form instead of the generic one to the main content bank
page.
2020-12-17 18:35:26 +01:00
Luca Bösch 26345a0de5 MDL-70355 calendar: Filter popuptext for calendar entries. 2020-12-17 17:45:23 +01:00
Amaia Anabitarte c94cb31678 MDL-57552 core_course: Typo in view-combined class 2020-12-17 17:12:25 +01:00
Sara Arjona 21c367cee6 weekly release 3.11dev 2020-12-17 15:52:44 +01:00
Sara Arjona a734358dc6 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2020-12-17 15:52:42 +01:00
David Mudrák 34ae2bfdf4 MDL-70486 output: Improve check for block region name string existence
* The fact that non-existing strings are returned in certain format
  starting with the bracket, is kind of side debugging effect. The value
  is really undefined and should not be relied upon.
* The string could actually exist and be worded so that its first
  character is also the square bracket.
2020-12-17 10:03:42 +01:00
Jake Dallimore e596b517b2 Merge branch 'MDL-65284-311' of git://github.com/aanabit/moodle into MOODLE_311_STABLE 2020-12-17 11:07:08 +08:00
Jake Dallimore 24e842283c Merge branch 'MDL-66138-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2020-12-17 10:59:37 +08:00
Jun Pataleta d0d7861278 Merge branch 'MDL-68831_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2020-12-17 00:04:43 +08:00
Jun Pataleta 5855302aed Merge branch 'MDL-69735_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2020-12-16 23:01:37 +08:00
Ilya Tregubov b6621e64b1 MDL-66138 forum: Deprecate get_forum_discussions_paginated 2020-12-16 16:32:54 +02:00
Tim Hunt 5b59ead94f MDL-68831 quiz overrides: show a summary on the quiz info page 2020-12-16 14:24:55 +00:00
Shamim Rezaie f3a92acdd1 MDL-70394 paygw_paypal: Fix the incorrect foreign key 2020-12-17 00:24:45 +11:00
Víctor Déniz dc556668d3 Merge branch 'MDL-70261-311' of git://github.com/ilya-catalyst/moodle into MOODLE_311_STABLE 2020-12-16 12:32:01 +00:00
Amaia Anabitarte f9071947e9 MDL-65284 analytics: Final deprecation get_analysables() 2020-12-16 12:47:52 +01:00
Sara Arjona bb08b03b4f Merge branch 'MDL-70373_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2020-12-16 12:40:42 +01:00
Shamim Rezaie ff67cd2b87 MDL-70459 enrol_fee: Sort the list of currencies when displaying 2020-12-16 22:30:40 +11:00
Shamim Rezaie abe543bfa7 MDL-70459 core_payment: use array_merge to merge currencies 2020-12-16 22:30:40 +11:00
Sara Arjona 1b03e98d41 Merge branch 'MDL-70322-311' of git://github.com/roland04/moodle into MOODLE_311_STABLE 2020-12-16 12:04:12 +01:00
Jun Pataleta 0a7c652a83 Merge branch 'MDL-68481_311' of git://github.com/mdjnelson/moodle into MOODLE_311_STABLE 2020-12-16 15:20:19 +08:00
Jun Pataleta bb57afaa88 Merge branch 'MDL-68533_311-clean_param' of git://github.com/mdjnelson/moodle into MOODLE_311_STABLE 2020-12-16 12:48:54 +08:00
Jun Pataleta faea6bc0f7 Merge branch 'MDL-54907_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2020-12-16 10:34:23 +08:00
Andrew Nicols 6dae4aa3ad MDL-69107 user: Fix autocomplete usages 2020-12-16 07:50:56 +08:00
Sara Arjona d827df6fd0 Merge branch 'MDL-70422-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2020-12-15 16:42:54 +01:00
Sara Arjona 70b7066a9e Merge branch 'MDL-70409-311' of git://github.com/merrill-oakland/moodle into MOODLE_311_STABLE 2020-12-15 16:15:44 +01:00
Alexander Bias 91306f5f66 MDL-70342 block_timeline: Get rid of double quotes
This commit gets rid of double quotes around the activity name and course name
which have sneaked into block_timeline's view in MDL-65183.
2020-12-15 15:29:04 +01:00
Sara Arjona b98b5e10e5 Merge branch 'MDL-70357-311-cronlibthrowables' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2020-12-15 14:55:56 +01:00
Ilya Tregubov ef27ea9f90 MDL-70261 course: Allow update locked course custom fields
on course upload.
2020-12-15 14:39:56 +02:00
Jake Dallimore 716a38fafe Merge branch 'MDL-67623-311_blocks_myoverview_pagination_regression' of https://github.com/tomdickman/moodle into MOODLE_311_STABLE 2020-12-15 18:21:41 +08:00
Brendan Heywood feda75bdff MDL-68010 tool_task: Allow disable tasks to still be run manually 2020-12-15 17:00:26 +11:00
Jun Pataleta 83e20b9335 Merge branch 'MDL-70361-dlrlid-311' of https://github.com/cengage/moodle into MOODLE_311_STABLE 2020-12-15 11:17:07 +08:00
Brendan Heywood 5fd5aec1f0 MDL-68608 session: Improved the readonly session debugging 2020-12-15 13:44:18 +11:00
Brendan Heywood 2d935948ea MDL-68768 tool_tasks: Check for failing adhoc tasks 2020-12-15 13:42:17 +11:00
Andrew Nicols 119977e663 MDL-69107 form_autocomplete: Rewrite item selection
The form_autocomplete is essentially a custom element. Unfortunately the
`setValue()` function in Mink has undesired actions so it is necessary
to write our own handling for it.

The standard Mink `setValue()` function focuses the element, sets a
value, and then blurs the element. In the case of the autocomplete this
can cause the autocomplete suggestions list to be closed in some
situations. Instead of using the setValue we click, and type the value,
but do not immediately blur.
2020-12-15 09:08:05 +08:00
AMOS bot eb9f9a029a Automatically generated installer lang files 2020-12-15 00:07:27 +00:00
Sara Arjona 72f635ab12 Merge branch 'MDL-70397-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2020-12-14 17:12:00 +01:00
Jake Dallimore 306f024312 Merge branch 'MDL-70324-3.11' of https://github.com/JBThong/moodle into MOODLE_311_STABLE 2020-12-14 11:29:57 +08:00
Tom Dickman 761d070b76 MDL-67623 block overview: fix pagination regression
Fixed a regression caused by MDL-64194 resulting in Dashboard - Course
overview pagination not working from second page of courses onwards.

Course overview block should now do the following:
- Display no pagination controls when user has no courses
- Display no pagination controls when less than 12 courses to display
- Only display pagination controls up to the number of courses user is
enrolled in
- Work correctly when on a page greater than the second page.
2020-12-14 13:26:22 +11:00
AMOS bot c28e9297db Automatically generated installer lang files 2020-12-13 00:07:28 +00:00
Mark Nelson 374bbf59bc MDL-68481 mod_folder: stream files when creating zip 2020-12-12 12:50:54 +08:00
Mark Nelson aa8d0aac23 MDL-68533 mod_assign: stream files when creating zip 2020-12-12 12:45:36 +08:00
Mark Nelson f9810e2aff MDL-68533 core_files: add archive_writer API 2020-12-12 12:45:36 +08:00
AMOS bot 3d3ad1cc3e Automatically generated installer lang files 2020-12-12 00:07:32 +00:00
AMOS bot 59208e5f3f Merge branch 'MOODLE_311_STABLE' into install_311_STABLE 2020-12-12 00:07:31 +00:00
Tim Hunt 27bc291f71 MDL-69735 quiz: new capability for read-only view of setting overrides 2020-12-11 21:25:57 +00:00
Tim Hunt f226b6e1b9 MDL-69735 core renderer notifications: make closebutton option usable 2020-12-11 21:23:07 +00:00
Mikel Martín deaf34ee3a MDL-70322 core_search: consistent search icon 2020-12-11 15:42:35 +01:00
AMOS bot 64cedaa361 Automatically generated installer lang files 2020-12-11 00:07:33 +00:00
Víctor Déniz d328ef1c9d weekly release 3.11dev 2020-12-10 21:10:02 +00:00
Víctor Déniz 858ff2096a Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2020-12-10 21:09:55 +00:00
Huong Nguyen 0cc42a2047 MDL-70426 qtype_ddmarker: infinite markers keep duplicating 2020-12-10 15:52:09 +07:00
Shamim Rezaie 11987c1554 MDL-69301 theme_boost: Remove the special handling of Escape key 2020-12-10 15:02:33 +08:00
Jake Dallimore 435bb5ce2a Merge branch 'MDL-70320-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2020-12-10 12:01:11 +08:00
Andrew Nicols 8f3d77d228 MDL-70320 behat: User full path to page admin node 2020-12-10 07:55:50 +08:00
Víctor Déniz 46acc5d7ff Merge branch 'MDL-63683-311' of https://github.com/dravek/moodle into MOODLE_311_STABLE 2020-12-09 12:25:40 +00:00
Jake Dallimore 4abc3ab89a Merge branch 'MDL-70151-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2020-12-09 14:45:57 +08:00
Shamim Rezaie c16004ce15 MDL-69301 behat: comment a test out
The e.key is not filled correctly by Geckodriver on the verssion of
Firefox that we use.
2020-12-09 13:42:03 +08:00
Andrew Nicols 99ef1a78c1 Merge branch 'MDL-65186-311' of git://github.com/ilya-catalyst/moodle into MOODLE_311_STABLE 2020-12-09 13:34:42 +08:00
Andrew Nicols 94212ac598 Merge branch 'MDL-70295-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2020-12-09 12:11:08 +08:00
Andrew Nicols 72e6bd78aa Merge branch 'MDL-70320_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2020-12-09 11:57:54 +08:00
Andrew Nicols 666ba2d5b9 Merge branch 'MDL-70293-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2020-12-09 11:29:10 +08:00
Andrew Nicols 62ad3fe713 Merge branch 'MDL-69869-311' of git://github.com/ilya-catalyst/moodle into MOODLE_311_STABLE 2020-12-09 11:09:51 +08:00
Jake Dallimore 5eeab9a25f Merge branch 'MDL-69145-311-3' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2020-12-09 11:02:17 +08:00
Jun Pataleta a684f59d65 MDL-69145 core_user: Set default filter to ALL 2020-12-09 10:54:02 +08:00
Jun Pataleta bc7d1118b1 MDL-69145 core: Set the default filterset join type to ALL
* Plus minor PHPDoc type fix for the JOINTYPE_DEFAULT constants
2020-12-09 10:54:02 +08:00
Andrew Nicols 618835595c Merge branch 'MDL-62707-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2020-12-09 08:53:20 +08:00
David Mudrák 8017912028 MDL-70430 oauth2: Fix storing of the new refresh token
There was a typo - missing underscore. As a result, the new refresh
token was never updated in the database. Depending on the issuer and
whether or when theyu invalidate issued refresh tokens, this might or
might not make the token refresh stop working.
2020-12-08 11:26:14 +01:00
Jake Dallimore 98635e4444 Merge branch 'MDL-70285_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2020-12-08 16:33:20 +08:00
Ilya Tregubov 4afa3bfda4 MDL-69869 enrol: Fixing intendation for travis. 2020-12-08 09:15:35 +02:00
Ilya Tregubov a2d652e332 MDL-69869 enrol: Clean up - switch to [] from array(). 2020-12-08 09:15:35 +02:00
Ilya Tregubov 3401b6fb42 MDL-69869 enrol: Add ability to get suspended users through
core_enrol_get_enrolled_users webservice.
2020-12-08 09:15:35 +02:00
Ilya Tregubov 724b7606da MDL-65186 analytics: Deprecate add_builtin_models 2020-12-08 09:12:21 +02:00
AMOS bot fb93b22f71 Automatically generated installer lang files 2020-12-08 00:07:25 +00:00
Jamie Stamp 3b4eded721 MDL-70341 tasks: Allow disabled tasks to be overridden 2020-12-07 16:41:04 +00:00
Paul Holden e5e287396d MDL-70422 restore: fix for undefined question answer ordering in test. 2020-12-07 10:15:48 +00:00
Peter Burnett 292b0f2975 MDL-69522 antivirus: Added ability for scanners to set found message 2020-12-07 14:45:18 +10:00
Jake Dallimore 330927d2c4 Merge branch 'MDL-64982-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2020-12-07 12:04:01 +08:00
Jake Dallimore 6762c1e585 Merge branch 'MDL-65818-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2020-12-07 11:27:06 +08:00
Adrian Greeve 91f3377c2f Merge branch 'MDL-69301-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2020-12-07 09:55:35 +08:00
AMOS bot b624187e4d Automatically generated installer lang files 2020-12-06 00:07:30 +00:00
Eric Merrill 14c905a41e MDL-70409 chat: Use require_once to import lib.php 2020-12-04 10:52:00 -05:00
Paul Holden 0ce7a5e021 MDL-70279 tool_templatelibrary: preserve component search field value. 2020-12-04 14:55:35 +00:00
sam marshall 4045bfd723 MDL-65818 Security: Encryption API and admin setting for secure data 2020-12-04 14:40:18 +00:00
Paul Holden c19a18ecd4 MDL-62707 search: account for no matching courses when listing areas.
When limiting the list of courses during retrieval of the search areas
the user can access, make sure we have some contexts before looking
for blocks.
2020-12-04 09:43:07 +00:00
inigozendegi 227021b657 MDL-56119 gradingform_rubric: Rubric display layout issue 2020-12-04 09:41:45 +01:00
David Matamoros 10fa98fcf4 MDL-63683 enrol: Fix plugin settings when no role has student archetype 2020-12-04 09:24:56 +01:00
Shamim Rezaie a5b47b660b MDL-64982 behat: Remove deprecated behat timeout constants
Behat timeout constants behat_base::TIMEOUT, EXTENDED_TIMEOUT, and
REDUCED_TIMEOUT, which were deprecated in 3.7, have been removed.
2020-12-04 17:07:49 +11:00
Andrew Nicols 2881ad191f MDL-70397 behat: Prevent browser restarting after initial start 2020-12-04 12:07:05 +08:00
Jake Dallimore 329c04c1de weekly release 3.11dev 2020-12-04 08:42:38 +08:00
Jake Dallimore a52882b521 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2020-12-04 08:42:35 +08:00
Juan Leyva f677721abe MDL-70128 webservice: New entry point for draftfiles 2020-12-03 14:28:36 +01:00
Jake Dallimore b1dbb286de Merge branch 'MDL-70326-MOODLE_311_STABLE' of https://github.com/durzo/moodle into MOODLE_311_STABLE 2020-12-03 11:54:31 +08:00
Andrew Nicols b9af298885 Merge branch 'MDL-70327-311' of git://github.com/cescobedo/moodle into MOODLE_311_STABLE 2020-12-03 11:50:18 +08:00
Andrew Nicols c80610ac49 Merge branch 'MDL-70321_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2020-12-03 11:41:19 +08:00
Jake Dallimore 718453d393 Merge branch 'MDL-69411-311' of git://github.com/dravek/moodle into MOODLE_311_STABLE 2020-12-03 11:36:45 +08:00
Jake Dallimore e0302e5412 Merge branch 'MDL-67460-311_profile_secure' of https://github.com/beenet-dev/moodle into MOODLE_311_STABLE 2020-12-03 11:15:49 +08:00
Adrian Greeve 79a2c32236 Merge branch 'wip_MDL-70267_m311' of git://github.com/gjb2048/moodle into MOODLE_311_STABLE 2020-12-03 10:57:50 +08:00
Peter Dias 30d259a68b MDL-65319 core: Final deprecation get_courses_page 2020-12-03 10:29:35 +08:00
Peter Dias d8c62285c3 MDL-65086 analytics: Deprecate get_enabled_time_splitting_methods 2020-12-03 10:15:43 +08:00
Adrian Greeve 680b096c8b Merge branch 'MDL-70167-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2020-12-03 09:59:18 +08:00
AMOS bot d85c512ed6 Automatically generated installer lang files 2020-12-03 00:07:28 +00:00
Andrew Nicols c3c4974d93 Merge branch 'MDL-69868-311' of git://github.com/ilya-catalyst/moodle into MOODLE_311_STABLE 2020-12-03 07:47:31 +08:00
Tim Hunt a3cf931e3d MDL-70373 qtype_essay: missing border on atto input 2020-12-02 20:09:43 +00:00
Shamim Rezaie 1320da3240 MDL-69301 theme_boost: Use event.key in aria.js
Both event.which and event.keyCode are deprecated. So
We switched to using event.key. We can only do so now
because IE is no longer supported.
2020-12-03 04:21:53 +11:00
Shamim Rezaie 049e9e835c MDL-69301 course: Remove custom keyboard navigation code 2020-12-03 04:21:53 +11:00
Shamim Rezaie c4430d6a66 MDL-69301 core: Enhanced WAI-ARIA support for tab elements 2020-12-03 04:21:53 +11:00
Shamim Rezaie bede777bed MDL-69301 theme_boost: convert aria.js to es6 module 2020-12-03 04:21:53 +11:00
Jake Dallimore a265ba6148 Merge branch 'MDL-67514-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2020-12-02 16:23:34 +08:00
Andrew Nicols 348e288f08 Merge branch 'MDL-57614-311-4' of git://github.com/mihailges/moodle into MOODLE_311_STABLE 2020-12-02 15:12:28 +08:00
Mihail Geshoski 671a566121 MDL-57614 core: Fetch blocks through a webservice in add block modal 2020-12-02 13:47:55 +08:00
Mihail Geshoski d65d1b4185 MDL-57614 core_block: Create webservice that returns the addable blocks
Creates a webservice that returns the addable blocks in a given page.
The webservice expects the page context id, page type and page layout as
parameters and returns the block name and block title for each available
block.
2020-12-02 13:47:54 +08:00
AMOS bot 020e91f176 Automatically generated installer lang files 2020-12-02 00:07:26 +00:00
Thong Bui c2cb01662a MDL-70324 Question: get_all_response_file_areas() not work correctly 2020-12-01 16:08:37 +07:00
Sara Arjona 0bdfb78bfd Merge branch 'MDL-70037-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2020-12-01 08:00:38 +01:00
AMOS bot 767fdd1661 Automatically generated installer lang files 2020-12-01 00:07:33 +00:00
Paul Holden 4380745602 MDL-70037 mod_forum: include post modified date in external structure. 2020-12-01 00:04:35 +00:00
Claude Vervoort e2a22320ca MDL-70361 mod_lti: deeplinking multiple preserve resourceid and tag 2020-11-30 15:01:21 -05:00
David Mudrák afb99e900b MDL-70357 cron: Catch Throwables not just Exceptions when running tasks
Starting from PHP 7, most language errors throw Error exceptions. We
want to deal with those equally as with any other exception so we need
to catch all Throwables here.
2020-11-30 17:40:52 +01:00
Dan Marsden 7e6b9d8d7e MDL-68052 analytics: Clean up analytics_indicator_calc records. 2020-11-30 09:40:53 +08:00
Gareth Barnard 6756cf3dd9 MDL-70267 ux, theme: Course user profile inconsistent page layout. 2020-11-29 23:45:15 +00:00
AMOS bot 4ffb2fe37c Automatically generated installer lang files 2020-11-29 00:07:35 +00:00
AMOS bot cba8e995c3 Merge branch 'MOODLE_311_STABLE' into install_311_STABLE 2020-11-28 00:07:28 +00:00
Tim Hunt 5f4d8a800c MDL-54907 quiz unit tests: clean up code style in attempts_test.php 2020-11-27 18:30:57 +00:00
Tim Hunt 847f22b59e MDL-54907 quiz: better timefinish for attempts finished asynchronously
There are serveral ways a quiz attempt can be submitted:

1. The student click the Submit and finish button. In this case,
   no problem. We record the current time as the finish time
   for the quiz attempt.

2. The student is activly working away at the quiz, and the
   count-down timer reachers zero. In this case, we also record
   the current time. Note that, if the server is under high load,
   then this could well end up being a few seconds after the
   theoretical end time, so you could have a quiz with a 30 minute
   time limit, with an attempt that lasted 30:07. However, this
   is just an accurate reflection of what happened, so should
   be recorded like this.

3. If the student is offline when the time expires, then
   (depending on the quiz settings) the attempt may be
   automatically submitted by cron, but this will happen with
   at least some delay (to prevent race conditions between cron
   and a student working online) and if cron is running slow
   on the server, it could be a lot later. Previously, this led
   to, say, a 30 minute quiz where an attempt seemed to have
   lasted 67 minutes, which confused people.

   Now, in this situation, the finsh time for the quiz attempt is
   recorded as the time when the time limit ran out. This is not
   just less confusing for teachers looking at the quiz report,
   it is also more accurate. That is the latest time at which
   students could have made any changes to their responses.
2020-11-27 18:30:56 +00:00
Tim Hunt 82fb0fbc69 MDL-54907 quiz generator: defaults should match a new Moodle install 2020-11-27 18:30:56 +00:00
Tim Hunt 91aa099907 MDL-54907 dml: Correct incorrect PHPdoc 2020-11-27 18:30:56 +00:00
Jun Pataleta 0f05c1dc0b MDL-69422 mod_data: Deprecate unused 'unsupportedexport' string 2020-11-27 23:28:25 +08:00
Jun Pataleta b92ff2923c MDL-69422 mod_data: Export form accessibility fixes
* Set appropriate heading element IDs
* Replace usages of deprecated HTML tag acronym with abbr instead.
* Add a label for the export fields fieldset.
* Move the CSV delimiter list outside the radio group.
* Fix div under a label element and duplicate labels
for the checkboxes of the fields to be exported by showing the field
name and type together.
* Group the fields to be exported as a fieldset.
* Move unsupported fields into a separate list.
* Move export options into its own section and group the options as a
fieldset.
2020-11-27 23:28:25 +08:00
Jun Pataleta 5f040a5ac8 MDL-69422 core: Convert required and help button container to div
* A span element cannot have a div as a child.
2020-11-27 23:28:25 +08:00
Sara Arjona c8a6134c8c weekly release 3.11dev 2020-11-27 07:50:38 +01:00
AMOS bot 1edb7aabf4 Automatically generated installer lang files 2020-11-27 06:21:10 +00:00
Sara Arjona fd478e6c1a Merge branch 'MDL-70276_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2020-11-26 15:04:21 +01:00
Peter Dias 729a45dc64 MDL-65215 core: Deprecate i_dock_block 2020-11-26 12:51:53 +01:00
Andrew Nicols 0873a544ed Merge branch 'MDL-63266-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2020-11-26 12:51:53 +01:00
Andrew Nicols 41e1eecf36 MDL-70153 qtype_essay: Whitespace/behat fixes 2020-11-26 12:51:53 +01:00
Andrew Nicols f225783ae8 Merge branch 'MDL-70153-311' of git://github.com/dpalou/moodle into MOODLE_311_STABLE 2020-11-26 12:51:53 +01:00
Andrew Nicols 7c40a570d4 Merge branch 'MDL-70237-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2020-11-26 12:51:53 +01:00
Marina Glancy fe9a2acbcc MDL-70242 auth_oauth2: set page context and url 2020-11-26 12:51:53 +01:00
Andrew Nicols d8f1f5e8b8 Merge branch 'MDL-65852-311' of git://github.com/ilya-catalyst/moodle into MOODLE_311_STABLE 2020-11-26 12:51:53 +01:00
Eloy Lafuente (stronk7) 9db57a69d2 Merge branch 'MDL-42382-311' of git://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2020-11-26 12:51:53 +01:00
Sara Arjona 029be97d37 Merge branch 'MDL-70248-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2020-11-26 12:51:52 +01:00
Sara Arjona 0f3f0c297c Merge branch 'MDL-70265_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2020-11-26 12:51:52 +01:00
Bas Brands 2d81fc6f65 MDL-69878 core_message: always show message drawer close icon 2020-11-26 12:51:52 +01:00
Andrew Nicols 9851292212 Merge branch 'MDL-70192_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2020-11-26 12:51:52 +01:00
Ilya Tregubov 5cb529630c MDL-69868 h5pactivity: Prevent breaking $USER when seeing
attempt report.
2020-11-26 12:40:23 +02:00
Eloy Lafuente (stronk7) 83875bc586 MDL-70276 github actions: First cut, phpunit and grunt checks
First working version, supports phpunit (using build matrix):

- php72 (lowest), running mysql.
- php74 (highest), running postgres.

Also verifies that the branch has been "gruntified" and there
isn't any missing change (build js/css files).

TODO: Verify the remaining checks currently in .travis.yml, namely:
 - CITEST
 - Add caching
 - Better health-check for DB images.
 - Support from the tracker (satus badges and enable check).
 - Support from CiBoT (status and enable check).
 - Consider moving both the common setup (git, composer...)
   and the database (mysql, postgres) to own actions for
   easier tweaking.
2020-11-26 00:25:42 +01:00
Paul Holden 3eab26586b MDL-70295 libraries: upgrade to version 4.3.1 of Html2Text. 2020-11-25 21:42:05 +00:00
Tim Hunt 7de93d7a6b MDL-70320 permission overrides: role names were double-escaped 2020-11-25 21:21:10 +00:00
Paul Holden 48cce80561 MDL-70293 libraries: upgrade to version 1.5.6 of SimplePie. 2020-11-25 21:03:46 +00:00
Claude Vervoort ce5bed44ca MDL-70284 mod_lti: dynreg fix response claims 2020-11-25 10:51:45 -05:00
cescobedo 38914ee3cd MDL-70327 core_h5p: Add preventredirect to the player 2020-11-25 16:30:43 +01:00
Jordan Tomkinson c59d3c606f MDL-70326 antivirus: fixing regression in MDL-66222 2020-11-25 11:30:58 +01:00
Ilya Tregubov 375af0e6c3 MDL-65852 user: Fix permission check to download course participants. 2020-11-25 11:27:41 +02:00
Jamie Stamp b0c2b85310 MDL-69121 core: Add ZSTD/Gzip compression options to Redis sessions 2020-11-24 23:16:30 +01:00
Sara Arjona e16deb2c2b Merge branch 'MOODLE_311_MDL-69773_v2' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2020-11-24 17:24:49 +01:00
Tim Hunt 48eadbc999 MDL-70321 question backup: fix MDL-47178 unit tests
They were failing if you had CodeRunner installed
2020-11-24 15:29:23 +00:00
Simon Mok b85314b06f MDL-67460 profile: User profile link to use HTTPS 2020-11-24 20:47:32 +08:00
Adrian Greeve e2ea199759 Merge branch 'MDL-64776-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2020-11-24 08:55:17 +08:00
Mikhail Golenkov 64e7678c47 MDL-69773 block_section_links: Add an option to display section name 2020-11-24 11:34:38 +11:00
Tim Hunt fa2e457944 MDL-70285 completion upgrade: fix performance of the MDL-69687 code 2020-11-23 20:49:56 +00:00
David Matamoros 873e8961e5 MDL-69411 core_message: Fix return structure for empty result set
Passing a timefrom higher than last message timecreated needs to
return a formatted response so it does not break ws.
2020-11-23 19:25:42 +01:00
Eloy Lafuente (stronk7) a014ebdc6a MDL-70265 travis: Completely remove the UPGRADE check
It was broken since ages ago, see MDL-64874, so no sense
to keep it eating minutes for nothing.
2020-11-23 13:42:36 +01:00
Adrian Greeve 13c3289335 Merge branch 'MDL-67668-311-2' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2020-11-23 15:39:16 +08:00
Peter Burnett 08c6aad9a7 MDL-70160 cache: plugin_functions checks for function_exists() 2020-11-23 15:22:27 +08:00
Adrian Hutchinson 50baaebc31 MDL-67028 mod_lti: Support CourseSection.timeFrame custom parameters 2020-11-23 14:07:18 +08:00
Andrew Nicols 62763b84d4 MDL-70151 assign: Fix bulk change for behat
Behat does not play well with confirmation dialogues and in some
situations it does not wait for the page to reload before starting the
next step.

This change adds a pending_js call which is only resolved if the cancel
button was pressed, otherwise it remains in-progress until the page
reloads resetting the entire state of it.
2020-11-23 11:11:50 +08:00
Andrew Nicols 9bec65f04f MDL-70167 behat: Rewrite attribute check steps
This commit updates the following steps to use the
`the_attribute_of_should_be_set` step under the hood:
- the [element] [type] should be disabled
- the [element] [type] should be enabled
- the [element] [type] should be readonly
- the [element] [type] should not be readonly

This reduces unnecssary code duplication.
2020-11-23 11:03:15 +08:00
Andrew Nicols 5654ddc32e MDL-70167 behat: Boolean attributes should either exist or not 2020-11-23 11:03:15 +08:00
Andrew Nicols 94a492a0f4 MDL-67668 behat: Update tests for inplace editable field type 2020-11-23 09:00:46 +08:00
Andrew Nicols 7a2006b499 MDL-67668 behat: Add inplace editable field type
This commit promotes the Inplace Editable field to a first-class form
element by introducing a new partial selector for inplace editable
fields, and teaching the field manager how to recognise these, then
introducing a new field type which can handle setting values for this
field.
2020-11-23 09:00:46 +08:00
Andrew Nicols 75801895aa MDL-67668 behat: Share behat_behat functionality with forms
Behat form fields are implemented in a way completely isolated from the
rest of the Behat Context system. Whereas regular step definitions have
access to execute steps, to call `find`, check for JS running, and other
related functionality, the Moodle implementation of a field type does
not have any access to this.

By moving the core functionality of behat_base to a new trait, and the
constants to a new interface, the functionality can also be used in
behat form fields in the same way as elsewhere.
2020-11-23 09:00:46 +08:00
Andrew Nicols a53c5b847e MDL-67668 behat: Correct js pending check
Pending checks should only run when JS is running, but some uses were
not apply this check.
2020-11-23 09:00:46 +08:00
Andrew Nicols 621199b331 MDL-67668 behat: Support NodeElement when fetching node in container
This is similar to change made in MDL-69136 to allow an already-fetched
NodeElement to be provided to the get_node_in_container() function and
makes it easier to be deterministic when writing steps.
2020-11-23 09:00:46 +08:00
Eloy Lafuente (stronk7) 89a9b87c95 MDL-70265 travis: Only run highest phpunit if configured via env
By default only lowest php version will be executed, and only pgsql.

This default behavior can be changed with a new variable:

MOODLE_PHP = [all]
MOODLE_DATABASE = [pgsql | mysqli | all]
2020-11-21 11:28:35 +01:00
Eloy Lafuente (stronk7) 788a74ad05 MDL-70192 composer: bump to moodle-behat-extension 3.311.0
Generated following the instructions @:

https://docs.moodle.org/dev/Composer#How_to_prepare_and_submit_composer_changes

(using php72)
2020-11-21 11:28:06 +01:00
Eloy Lafuente (stronk7) ae8e7f90ad weekly release 3.11dev 2020-11-20 23:16:46 +01:00
Huong Nguyen d921cbb41f MDL-70248 qtype_ddimageortext: Drop zones have UI issue in Editing form 2020-11-19 17:02:55 +07:00
Peter Dias e339a551d2 MDL-64776 book: Final deprecation booktool_print_get_toc 2020-11-19 17:03:08 +08:00
Peter Dias b505b893fc MDL-63266 core: Final deprecation enrol/cli/sync.php 2020-11-19 16:22:14 +08:00
Shamim Rezaie 118c309a87 MDL-70237 payment: Allow html tags in gateway description 2020-11-19 16:09:16 +11:00
John Yao 738449323a MDL-67636 gradebook: Prevent exposing hidden grade in locked category 2020-11-19 11:58:48 +08:00
Brendan Heywood a25c20edea MDL-67081 xhprof: Allow conditional profiling from CLI using env vars 2020-11-19 11:42:28 +08:00
Jamie Stamp 30d2f286b6 MDL-65843 tasks: Allow schedules to be overridden in config 2020-11-19 11:31:08 +08:00
Adrian Greeve b4d21549b5 Merge branch 'MDL-56653-311' of git://github.com/lameze/moodle into MOODLE_311_STABLE 2020-11-19 11:09:59 +08:00
Paul Holden c7e5d1c422 MDL-69809 mod_folder: include forcedownload setting in WS responses. 2020-11-19 10:42:20 +08:00
Paul Holden 4ddb0590ea MDL-67702 gradereport_grader: user filters per report instance. 2020-11-19 10:35:59 +08:00
Paul Holden fcc605cfd2 MDL-67702 mod_assign: distinct uniqueid value for grading tables.
This has the effect of making table sorting and filtering by initials
apply only to the current table instance, rather than to all of them.
2020-11-19 10:35:59 +08:00
Jun Pataleta d31ac2f343 Merge branch 'MDL-70094-311' of https://github.com/SangNguyen2601/moodle into MOODLE_311_STABLE 2020-11-19 09:37:58 +08:00
Brendan Heywood b6f59eb325 MDL-47456 core: Remove redundant DB call during bootstrap 2020-11-19 08:54:13 +08:00
Brendan Heywood 9fa0decc04 MDL-70107 tool_task: Unlock session on long running tasks in UI 2020-11-18 23:07:30 +01:00
Paul Holden e6a54ae764 MDL-69201 core: consistent table primary sort column/order. 2020-11-18 23:01:23 +01:00
Dani Palou 5047eac57e MDL-70153 qtype_essay: Add behat test for attachments max size 2020-11-18 10:48:08 +01:00
Dani Palou 4657c380a6 MDL-70153 qtype_essay: Fix max size displayed for attachments 2020-11-18 10:48:08 +01:00
Vitaly 88d12b5dff MDL-56653 enrol_meta: a single DB query in edit_instance_validation
The 'edit_instance_validation()' method checks for existing meta enrolment instances.
The fix replaces DB queries in a loop for each course with a single query for all courses.
Also, a new testing method 'test_edit_instance_validation_with_existing_courses()'
was added to /enrol/meta/tests/plugin_test.php to test if the new implementation
returns an error in case of trying to save the already linked courses in the 'customint1' field.
2020-11-18 15:10:46 +08:00
sangnguyen2601 6b29dca9fb MDL-70094 Question: Technical info section expands if click help icon 2020-11-18 13:28:36 +07:00
Paul Holden 3d1f7d39c7 MDL-70158 tool_templatelibrary: group and sort list of components. 2020-11-18 10:18:35 +08:00
Sam Hemelryk 8bf2d6eb60 MDL-68896 mod_scorm: improved sendBeacon use when unloading 2020-11-18 09:49:56 +08:00
Paul Holden 4c37e43e6a MDL-67514 customfield: correct external usescategories return type. 2020-11-17 22:13:14 +00:00
Eloy Lafuente (stronk7) b3268aeead Merge branch 'MDL-70148-311' of git://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2020-11-17 23:13:07 +01:00
Noel De Martin 86565e4a36 MDL-42382 admin: Add replace filters button
Co-authored-by: Luca Bösch <luca.boesch@bfh.ch>
Co-authored-by: Andrei Bautu <abautu@gmail.com>
2020-11-17 10:11:12 +01:00
Andrew Nicols c7d3bc62fe MDL-70148 gradereport_grader: Improve reliability of keyboard usage
In some browsers the ajax grade select does not properly update the
grade after setting values. The previous solution was to press the
[enter] key, but doing this with the new key type step opens the select
box again. This is what happens when a real user presses enter on the
select.

This is the last possible field in the report, so pressing the tab key
to move to the next gradable element does not work.

The solution uses a shift-tab to move the focus away to the previous
gradale element. In this case it must also be moved to an earlier step
because the previously selected value must be checked in the Then
section of the test and if it is selected then its value cannot be
checked.
2020-11-17 15:14:43 +08:00
Andrew Nicols f4a38bbaac MDL-70148 qtype: Update qtype steps to new key interaction
Note: The ddmarker question type was previously getting the number of
keypresses wrong. This was because it was using both keyDown/keyUp, and
also keyPress. As a result each keypress was essentially happening two
times.
2020-11-17 15:14:43 +08:00
Andrew Nicols 5b9b1f07e6 MDL-70148 behat: Update steps for keyboard 2020-11-17 15:14:43 +08:00
Andrew Nicols 346fdae360 MDL-70148 behat: Add steps to send keys without an element 2020-11-17 15:14:43 +08:00
Andrew Nicols 57672107a1 Merge branch 'MDL-69526-311' of git://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2020-11-17 14:54:16 +08:00
Adrian Greeve c6e649f5ed Merge branch 'MDL-50955-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE 2020-11-17 13:05:57 +08:00
Peter Dias 443a35d18c MDL-50955 core: Reset lessons completion criteria if grade type is none 2020-11-17 11:23:21 +08:00
Paul Holden 47b60c97ed MDL-69964 course: toggle participant checkboxes in root element.
For a given toggleGroup, the relevant action elements are not
necessarily descendants of the same tableRoot element, on the
course participants page.
2020-11-17 10:23:37 +08:00
Andrew Nicols 725a75e064 MDL-67513 core: Only move modal to body if currently attached
A previous change as part of this commitset was intended to move the
modal to the document.body, but where the modal had been destroyed it
was instead added back to the body.
2020-11-16 09:34:01 +01:00
Luca Bösch 6ef1b21b64 MDL-69526 block_myoverview: custom course fields natural sorting 2020-11-16 01:47:14 +01:00
Neill Magill 0c6d8a96ce MDL-67513 forum: View conversations while fullscreen grading
Before this change when a modal was shown and an element on the page
was fullscreen the modal would be created behind it.

This change ensures that the modal will be inside an element that is
fullscreen so that it will be correctly displayed.
2020-11-16 08:27:16 +08:00
Neill Magill dd25aa095e MDL-67513 forum: Test that discussions can be viewed while grading 2020-11-16 08:27:16 +08:00
Eloy Lafuente (stronk7) b4274fe6da weekly release 3.11dev 2020-11-14 19:54:10 +01:00
Eloy Lafuente (stronk7) 5ba86bc8f5 Merge branch 'MDL-70229_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2020-11-14 19:50:45 +01:00
Eloy Lafuente (stronk7) adb8fe4c42 MDL-70229 install: Changes to continue working with parallel branches
- Main version (version, release, branch and maturity), guaranteeing
  we are diverging from previous stable branch and won't overlap any more.
- Backup release, to match new branch.
- CI configuration files (.travis.yml in this case), to match new branch.

For changes needed to START working with parallel branches, see MDL-69475
2020-11-14 17:10:41 +01:00
5556 changed files with 205078 additions and 93040 deletions
-95
View File
@@ -1,95 +0,0 @@
# Generated by "grunt ignorefiles"
*/**/yui/src/*/meta/
*/**/build/
node_modules/
vendor/
admin/tool/policy/amd/src/jquery-eu-cookie-law-popup.js
auth/cas/CAS/
cache/stores/mongodb/MongoDB/
enrol/lti/ims-blti/
filter/algebra/AlgParser.pm
filter/tex/mimetex.*
h5p/h5plib/v124/joubel/core/
h5p/h5plib/v124/joubel/editor/
lib/editor/atto/plugins/html/yui/src/codemirror/
lib/editor/atto/plugins/html/yui/src/beautify/
lib/editor/atto/yui/src/rangy/js/*.*
lib/editor/tinymce/plugins/pdw/tinymce/
lib/editor/tinymce/plugins/spellchecker/rpc.php
lib/editor/tinymce/tiny_mce/
lib/mlbackend/php/phpml/
lib/adodb/
lib/behat/axe/
lib/bennu/
lib/evalmath/
lib/phpspreadsheet/
lib/google/
lib/htmlpurifier/
lib/jabber/
lib/minify/matthiasmullie-minify/
lib/minify/matthiasmullie-pathconverter/
lib/pear/HTML/Common.php
lib/pear/HTML/QuickForm.php
lib/pear/HTML/QuickForm/
lib/pear/PEAR.php
lib/phpmailer/
lib/simplepie/
lib/tcpdf/
lib/typo3/
lib/yuilib/
lib/yuilib/gallery/
lib/jquery/
lib/html2text/
lib/markdown/
lib/xhprof/
lib/horde/
lib/requirejs/
lib/amd/src/loglevel.js
lib/mustache/
lib/amd/src/mustache.js
lib/graphlib.php
lib/php-css-parser/
lib/rtlcss/
lib/scssphp/
lib/spout/
lib/amd/src/chartjs-lazy.js
lib/maxmind/GeoIp2/
lib/maxmind/MaxMind/
lib/ltiprovider/
lib/amd/src/truncate.js
lib/fonts/
lib/amd/src/adapter.js
lib/validateurlsyntax.php
lib/amd/src/popper.js
lib/geopattern-php/
lib/php-jwt/
lib/babel-polyfill/
lib/polyfills/
lib/emoji-data/
lib/plist/
lib/zipstream/
lib/php-enum/
lib/http-message/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js
media/player/videojs/videojs/
media/player/videojs/amd/src/videojs-flash-lazy.js
media/player/videojs/videojs/video-js.swf
mod/assign/feedback/editpdf/fpdi/
repository/s3/S3.php
theme/boost/scss/bootstrap/
theme/boost/amd/src/bootstrap/alert.js
theme/boost/amd/src/bootstrap/button.js
theme/boost/amd/src/bootstrap/carousel.js
theme/boost/amd/src/bootstrap/collapse.js
theme/boost/amd/src/bootstrap/dropdown.js
theme/boost/amd/src/bootstrap/index.js
theme/boost/amd/src/bootstrap/modal.js
theme/boost/amd/src/bootstrap/popover.js
theme/boost/amd/src/bootstrap/tools/sanitizer.js
theme/boost/amd/src/bootstrap/scrollspy.js
theme/boost/amd/src/bootstrap/tab.js
theme/boost/amd/src/bootstrap/toast.js
theme/boost/amd/src/bootstrap/tooltip.js
theme/boost/amd/src/bootstrap/util.js
theme/boost/scss/fontawesome/
+62 -4
View File
@@ -2,6 +2,7 @@
'plugins': [
'babel',
'promise',
'jsdoc',
],
'env': {
'browser': true,
@@ -191,7 +192,6 @@
'property': 'str',
'message': 'Use AMD module "core/str" or M.util.get_string()'
}],
},
overrides: [
{
@@ -200,11 +200,27 @@
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off'
'no-unused-expressions': 'off',
// === JSDocs ===
"jsdoc/check-access": 'off',
"jsdoc/check-alignment": 'off',
"jsdoc/check-param-names": 'off',
"jsdoc/check-property-names": 'off',
"jsdoc/empty-tags": 'off',
"jsdoc/implements-on-classes": 'off',
"jsdoc/multiline-blocks": 'off',
"jsdoc/require-jsdoc": 'off',
"jsdoc/require-param": 'off',
"jsdoc/require-param-name": 'off',
"jsdoc/require-param-type": 'off',
"jsdoc/require-property": 'off',
"jsdoc/require-property-name": 'off',
"jsdoc/require-property-type": 'off',
}
},
{
files: ["**/amd/src/*.js", "**/amd/src/**/*.js", "Gruntfile*.js", "babel-plugin-add-module-to-define.js"],
files: ["**/amd/src/*.js", "**/amd/src/**/*.js", "Gruntfile.js", ".grunt/*.js", ".grunt/tasks/*.js", "jsdoc.conf.js"],
// We support es6 now. Woot!
env: {
es6: true
@@ -238,7 +254,49 @@
// === Promises ===
// We have Promise now that we're using ES6.
'promise/no-native': 'off',
'promise/avoid-new': 'off'
'promise/avoid-new': 'off',
// === JSDocs ===
"jsdoc/check-access": [
'error',
],
"jsdoc/check-alignment": 1, // Recommended.
"jsdoc/check-param-names": [
'error',
],
"jsdoc/check-property-names": [
'error',
],
"jsdoc/empty-tags": [
'error',
],
"jsdoc/implements-on-classes": [
'error',
],
"jsdoc/multiline-blocks": [
'error',
],
"jsdoc/require-jsdoc": [
'error',
],
"jsdoc/require-param": [
'error',
],
"jsdoc/require-param-name": [
'error',
],
"jsdoc/require-param-type": [
'error',
],
"jsdoc/require-property": [
'error',
],
"jsdoc/require-property-name": [
'error',
],
"jsdoc/require-property-type": [
'error',
],
},
parserOptions: {
'ecmaVersion': 9,
+71
View File
@@ -0,0 +1,71 @@
<?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/>.
/**
* Template configuraton file for github actions CI/CD.
*
* @package core
* @copyright 2020 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// This cannot be used out from a github actions workflow, so just exit.
getenv('GITHUB_WORKFLOW') || die; // phpcs:ignore moodle.Files.MoodleInternal.MoodleInternalGlobalState
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = getenv('dbtype');
$CFG->dblibrary = 'native';
$CFG->dbhost = '127.0.0.1';
$CFG->dbname = 'test';
$CFG->dbuser = 'test';
$CFG->dbpass = 'test';
$CFG->prefix = 'm_';
$CFG->dboptions = ['dbcollation' => 'utf8mb4_bin'];
$host = 'localhost';
$CFG->wwwroot = "http://{$host}";
$CFG->dataroot = realpath(dirname(__DIR__)) . '/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
// Debug options - possible to be controlled by flag in future.
$CFG->debug = (E_ALL | E_STRICT); // DEBUG_DEVELOPER.
$CFG->debugdisplay = 1;
$CFG->debugstringids = 1; // Add strings=1 to url to get string ids.
$CFG->perfdebug = 15;
$CFG->debugpageinfo = 1;
$CFG->allowthemechangeonurl = 1;
$CFG->passwordpolicy = 0;
$CFG->cronclionly = 0;
$CFG->pathtophp = getenv('pathtophp');
$CFG->phpunit_dataroot = realpath(dirname(__DIR__)) . '/phpunitdata';
$CFG->phpunit_prefix = 't_';
define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost:8080');
define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://localhost:8080');
define('TEST_SESSION_REDIS_HOST', 'localhost');
define('TEST_CACHESTORE_REDIS_TESTSERVERS', 'localhost');
// TODO: add others (solr, mongodb, memcached, ldap...).
// Too much for now: define('PHPUNIT_LONGTEST', true); // Only leaves a few tests out and they are run later by CI.
require_once(__DIR__ . '/lib/setup.php');
+113
View File
@@ -0,0 +1,113 @@
name: Core
on:
push:
branches-ignore:
- master
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
env:
php: 8.0
jobs:
Grunt:
runs-on: ubuntu-18.04
steps:
- name: Checking out code
uses: actions/checkout@v2
- name: Configuring node & npm
shell: bash -l {0}
run: nvm install
- name: Installing node stuff
run: npm install
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
php: 7.3
extensions:
db: mysqli
- os: ubuntu-18.04
php: 8.0
db: pgsql
extensions: xmlrpc-beta
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: johanmeiring/mysql-action@tmpfs-patch
with:
collation server: utf8mb4_bin
mysql version: 5.7
mysql database: test
mysql user: test
mysql password: test
use tmpfs: true
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
uses: m4nu56/postgresql-action@v1
with:
postgresql version: 9.6
postgresql db: test
postgresql user: test
postgresql password: test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v3.x
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v2
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
sudo locale-gen en_AU.UTF-8
php admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
run: vendor/bin/phpunit -v
+5
View File
@@ -26,6 +26,7 @@
/cscope.*
/.patches/
/.idea/
.phpstorm.*
/nbproject/
CVS
.DS_Store
@@ -46,3 +47,7 @@ composer.phar
atlassian-ide-plugin.xml
/node_modules/
/.vscode/
moodle-plugin-ci.phar
.eslintignore
.stylelintignore
/jsdoc
@@ -39,7 +39,7 @@ module.exports = ({template, types}) => {
const fs = require('fs');
const path = require('path');
const cwd = process.cwd();
const ComponentList = require(path.resolve('GruntfileComponents.js'));
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
/**
* Search the list of components that match the given file name
@@ -92,6 +92,16 @@ const fetchComponentData = () => {
return componentData;
};
/**
* Get the list of component paths.
*
* @param {string} relativeTo
* @returns {array}
*/
const getComponentPaths = (relativeTo = '') => fetchComponentData().pathList.map(componentPath => {
return componentPath.replace(relativeTo, '');
});
/**
* Get the list of paths to build AMD sources.
*
@@ -140,6 +150,49 @@ const getThirdPartyLibsList = relativeTo => {
.sort();
};
/**
* Get the list of thirdparty library paths.
*
* @returns {array}
*/
const getThirdPartyPaths = () => {
const DOMParser = require('xmldom').DOMParser;
const fs = require('fs');
const path = require('path');
const xpath = require('xpath');
const thirdpartyfiles = getThirdPartyLibsList(fs.realpathSync('./'));
const libs = ['node_modules/', 'vendor/'];
const addLibToList = lib => {
if (!lib.match('\\*') && fs.statSync(lib).isDirectory()) {
// Ensure trailing slash on dirs.
lib = lib.replace(/\/?$/, '/');
}
// Look for duplicate paths before adding to array.
if (libs.indexOf(lib) === -1) {
libs.push(lib);
}
};
thirdpartyfiles.forEach(function(file) {
const dirname = path.dirname(file);
const xmlContent = fs.readFileSync(file, 'utf8');
const doc = new DOMParser().parseFromString(xmlContent);
const nodes = xpath.select("/libraries/library/location/text()", doc);
nodes.forEach(function(node) {
let lib = path.posix.join(dirname, node.toString());
addLibToList(lib);
});
});
return libs;
};
/**
* Find the name of the component matching the specified path.
*
@@ -182,7 +235,9 @@ const getOwningComponentDirectory = checkPath => {
module.exports = {
getAmdSrcGlobList,
getComponentFromPath,
getComponentPaths,
getOwningComponentDirectory,
getYuiSrcGlobList,
getThirdPartyLibsList,
getThirdPartyPaths,
};
+19
View File
@@ -0,0 +1,19 @@
# Moodle JavaScript Documentation
```
.-..-.
_____ | || |
/____/-.---_ .---. .---. .-.| || | .---.
| | _ _ |/ _ \/ _ \/ _ || |/ __ \
* | | | | | || |_| || |_| || |_| || || |___/
|_| |_| |_|\_____/\_____/\_____||_|\_____)
Moodle - the world's open source learning platform
```
## About
This generated documentation includes API documentation for JavaScript written in the AMD and ES2015 module formats within Moodle.
## Related information
See [https://docs.moodle.org/dev](https://docs.moodle.org/dev) for other related Developer Documentation.
+131
View File
@@ -0,0 +1,131 @@
// 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/>.
/**
* Helper functions for working with Moodle component names, directories, and sources.
*
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
// Do not include any plugins as stanard.
const plugins = [];
plugins.push('plugins/markdown');
/**
* Get the source configuration.
*
* @return {Object}
*/
const getSource = () => {
const glob = require('glob');
const path = require('path');
const ComponentList = require(path.resolve('.grunt/components.js'));
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
const source = {
include: [],
includePattern: ".+\\.js$",
};
let includeList = [];
ComponentList.getAmdSrcGlobList().forEach(async pattern => {
includeList.push(...glob.sync(pattern));
});
const cwdLength = process.cwd().length + 1;
includeList.forEach(path => {
if (source.include.indexOf(path) !== -1) {
// Ensure no duplicates.
return;
}
const relPath = path.substring(cwdLength);
if (thirdPartyPaths.indexOf(relPath) !== -1) {
return;
}
source.include.push(path);
});
source.include.push('.grunt/jsdoc/README.md');
return source;
};
const tags = {
// Allow the use of unknown tags.
// We have a lot of legacy uses of these.
allowUnknownTags: true,
// We make use of jsdoc and closure dictionaries as standard.
dictionaries: [
'jsdoc',
'closure',
],
};
// Template configuraiton.
const templates = {
cleverLinks: false,
monospaceLinks: false,
};
module.exports = {
opts: {
destination: "./jsdoc/",
template: "node_modules/docdash",
},
plugins,
recurseDepth: 10,
source: getSource(),
sourceType: 'module',
tags,
templates,
docdash: {
collapse: true,
search: true,
sort: true,
sectionOrder: [
"Namespaces",
"Modules",
"Events",
"Classes",
"Externals",
"Mixins",
"Tutorials",
"Interfaces"
],
"menu": {
"Developer Docs": {
href: "https://docs.moodle.org/dev",
target: "_blank",
"class": "menu-item",
id: "devdocs"
},
"MDN Docs": {
href: "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
target: "_blank",
"class": "menu-item",
id: "mdndocs",
},
},
typedefs: true,
},
};
+64
View File
@@ -0,0 +1,64 @@
// 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 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
const files = grunt.moodleEnv.files;
// Project configuration.
grunt.config.merge({
eslint: {
// Even though warnings dont stop the build we don't display warnings by default because
// at this moment we've got too many core warnings.
// To display warnings call: grunt eslint --show-lint-warnings
// To fail on warnings call: grunt eslint --max-lint-warnings=0
// Also --max-lint-warnings=-1 can be used to display warnings but not fail.
options: {
quiet: (!grunt.option('show-lint-warnings')) && (typeof grunt.option('max-lint-warnings') === 'undefined'),
maxWarnings: ((typeof grunt.option('max-lint-warnings') !== 'undefined') ? grunt.option('max-lint-warnings') : -1)
},
// Check AMD src files.
amd: {src: files ? files : grunt.moodleEnv.amdSrc},
// Check YUI module source files.
yui: {src: files ? files : grunt.moodleEnv.yuiSrc},
},
});
grunt.loadNpmTasks('grunt-eslint');
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('eslint.amd.src', files);
grunt.config('eslint.yui.src', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', (action, filepath) => {
changedFiles[filepath] = action;
onChange();
});
};
+89
View File
@@ -0,0 +1,89 @@
// 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 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Get the list of feature files to pass to the gherkin linter.
*
* @returns {Array}
*/
const getGherkinLintTargets = () => {
if (grunt.moodleEnv.files) {
// Specific files were requested. Only check these.
return grunt.moodleEnv.files;
}
if (grunt.moodleEnv.inComponent) {
return [`${grunt.moodleEnv.runDir}/tests/behat/*.feature`];
}
return ['**/tests/behat/*.feature'];
};
const handler = function() {
const done = this.async();
const options = grunt.config('gherkinlint.options');
// Grab the gherkin-lint linter and required scaffolding.
const linter = require('gherkin-lint/dist/linter.js');
const featureFinder = require('gherkin-lint/dist/feature-finder.js');
const configParser = require('gherkin-lint/dist/config-parser.js');
const formatter = require('gherkin-lint/dist/formatters/stylish.js');
// Run the linter.
return linter.lint(
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
configParser.getConfiguration(configParser.defaultConfigFileName)
)
.then(results => {
// Print the results out uncondtionally.
formatter.printResults(results);
return results;
})
.then(results => {
// Report on the results.
// The done function takes a bool whereby a falsey statement causes the task to fail.
return results.every(result => result.errors.length === 0);
})
.then(done); // eslint-disable-line promise/no-callback-in-promise
};
grunt.registerTask('gherkinlint', 'Run gherkinlint against the current directory', handler);
grunt.config.set('gherkinlint', {
options: {
files: getGherkinLintTargets(),
}
});
grunt.config.merge({
watch: {
gherkinlint: {
files: [grunt.moodleEnv.inComponent ? 'tests/behat/*.feature' : '**/tests/behat/*.feature'],
tasks: ['gherkinlint'],
},
},
});
return handler;
};
+60
View File
@@ -0,0 +1,60 @@
// 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 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
const handler = function() {
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// An array of paths to third party directories.
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
// Generate .eslintignore.
const eslintIgnores = [
'# Generated by "grunt ignorefiles"',
// Do not ignore the .grunt directory.
'!/.grunt',
// Ignore all yui/src meta directories and build directories.
'*/**/yui/src/*/meta/',
'*/**/build/',
].concat(thirdPartyPaths);
grunt.file.write('.eslintignore', eslintIgnores.join('\n') + '\n');
// Generate .stylelintignore.
const stylelintIgnores = [
'# Generated by "grunt ignorefiles"',
'**/yui/build/*',
'theme/boost/style/moodle.css',
'theme/classic/style/moodle.css',
'jsdoc/styles/*.css',
].concat(thirdPartyPaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n') + '\n');
};
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', handler);
return handler;
};
+147
View File
@@ -0,0 +1,147 @@
// 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 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Function to generate the destination for the uglify task
* (e.g. build/file.min.js). This function will be passed to
* the rename property of files array when building dynamically:
* http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
*
* @param {String} destPath the current destination
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
*/
const babelRename = function(destPath, srcPath) {
destPath = srcPath.replace('src', 'build');
destPath = destPath.replace('.js', '.min.js');
return destPath;
};
module.exports = grunt => {
// Load the Ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Shifter tasks.
require('./shifter')(grunt);
// Load ESLint.
require('./eslint')(grunt);
// Load JSDoc.
require('./jsdoc')(grunt);
const path = require('path');
// Register JS tasks.
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
grunt.registerTask('amd', ['ignorefiles', 'eslint:amd', 'babel']);
grunt.registerTask('js', ['amd', 'yui']);
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
// Load the Babel tasks and config.
grunt.loadNpmTasks('grunt-babel');
grunt.config.merge({
babel: {
options: {
sourceMaps: true,
comments: false,
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('.grunt/babel-plugin-add-module-to-define.js'),
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', {'loose': false}],
'@babel/plugin-proposal-json-strings'
],
presets: [
['minify', {
// This minification plugin needs to be disabled because it breaks the
// source map generation and causes invalid source maps to be output.
simplify: false,
builtIns: false
}],
['@babel/preset-env', {
targets: {
browsers: [
">0.25%",
"last 2 versions",
"not ie <= 10",
"not op_mini all",
"not Opera > 0",
"not dead"
]
},
modules: false,
useBuiltIns: false
}]
]
},
dist: {
files: [{
expand: true,
src: grunt.moodleEnv.files ? grunt.moodleEnv.files : grunt.moodleEnv.amdSrc,
rename: babelRename
}]
}
},
});
grunt.config.merge({
watch: {
amd: {
files: grunt.moodleEnv.inComponent
? ['amd/src/*.js', 'amd/src/**/*.js']
: ['**/amd/src/**/*.js'],
tasks: ['amd']
},
},
});
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('babel.dist.files', [{expand: true, src: files, rename: babelRename}]);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', function(action, filepath) {
changedFiles[filepath] = action;
onChange();
});
return {
babelRename,
};
};
+36
View File
@@ -0,0 +1,36 @@
// 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 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
// Project configuration.
grunt.config.merge({
jsdoc: {
dist: {
options: {
configure: ".grunt/jsdoc/jsdoc.conf.js",
},
},
},
});
grunt.loadNpmTasks('grunt-jsdoc');
};
+40
View File
@@ -0,0 +1,40 @@
// 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 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
grunt.loadNpmTasks('grunt-sass');
grunt.config.merge({
sass: {
dist: {
files: {
"theme/boost/style/moodle.css": "theme/boost/scss/preset/default.scss",
"theme/classic/style/moodle.css": "theme/classic/scss/classicgrunt.scss"
}
},
options: {
implementation: require('node-sass'),
includePaths: ["theme/boost/scss/", "theme/classic/scss/"]
}
},
});
};
+155
View File
@@ -0,0 +1,155 @@
// 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 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/* eslint-env node */
module.exports = grunt => {
/**
* Shifter task. Is configured with a path to a specific file or a directory,
* in the case of a specific file it will work out the right module to be built.
*
* Note that this task runs the invidiaul shifter jobs async (becase it spawns
* so be careful to to call done().
*/
const handler = function() {
const done = this.async();
const options = grunt.config('shifter.options');
const async = require('async');
const path = require('path');
// Run the shifter processes one at a time to avoid confusing output.
async.eachSeries(options.paths, function(src, filedone) {
var args = [];
args.push(path.normalize(process.cwd() + '/node_modules/shifter/bin/shifter'));
// Always ignore the node_modules directory.
args.push('--excludes', 'node_modules');
// Determine the most appropriate options to run with based upon the current location.
if (grunt.file.isMatch('**/yui/**/*.js', src)) {
// When passed a JS file, build our containing module (this happen with
// watch).
grunt.log.debug('Shifter passed a specific JS file');
src = path.dirname(path.dirname(src));
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src', src)) {
// When in a src directory --walk all modules.
grunt.log.debug('In a src directory');
args.push('--walk');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*', src)) {
// When in module, only build our module.
grunt.log.debug('In a module directory');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*/js', src)) {
// When in module src, only build our module.
grunt.log.debug('In a source directory');
src = path.dirname(src);
options.recursive = false;
}
if (grunt.option('watch')) {
grunt.fail.fatal('The --watch option has been removed, please use `grunt watch` instead');
}
// Add the stderr option if appropriate
if (grunt.option('verbose')) {
args.push('--lint-stderr');
}
if (grunt.option('no-color')) {
args.push('--color=false');
}
var execShifter = function() {
grunt.log.ok("Running shifter on " + src);
grunt.util.spawn({
cmd: "node",
args: args,
opts: {cwd: src, stdio: 'inherit', env: process.env}
}, function(error, result, code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
grunt.log.ok('Shifter build complete.');
filedone();
}
});
};
// Actually run shifter.
if (!options.recursive) {
execShifter();
} else {
// Check that there are yui modules otherwise shifter ends with exit code 1.
if (grunt.file.expand({cwd: src}, '**/yui/src/**/*.js').length > 0) {
args.push('--recursive');
execShifter();
} else {
grunt.log.ok('No YUI modules to build.');
filedone();
}
}
}, done);
};
// Register the shifter task.
grunt.registerTask('shifter', 'Run Shifter against the current directory', handler);
// Configure it.
grunt.config.set('shifter', {
options: {
recursive: true,
// Shifter takes a relative path.
paths: grunt.moodleEnv.files ? grunt.moodleEnv.files : [grunt.moodleEnv.runDir]
}
});
grunt.config.merge({
watch: {
yui: {
files: grunt.moodleEnv.inComponent
? ['yui/src/*.json', 'yui/src/**/*.js']
: ['**/yui/src/**/*.js'],
tasks: ['yui']
},
},
});
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('shifter.options.paths', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', (action, filepath) => {
changedFiles[filepath] = action;
onChange();
});
return handler;
};
+48
View File
@@ -0,0 +1,48 @@
// 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 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
const handler = function() {
const path = require('path');
// Are we in a YUI directory?
if (path.basename(path.resolve(grunt.moodleEnv.cwd, '../../')) == 'yui') {
grunt.task.run('yui');
// Are we in an AMD directory?
} else if (grunt.moodleEnv.inAMD) {
grunt.task.run('amd');
} else {
// Run them all!.
grunt.task.run('css');
grunt.task.run('js');
grunt.task.run('gherkinlint');
}
};
// Register the startup task.
grunt.registerTask('startup', 'Run the correct tasks for the current directory', handler);
return handler;
};
+32
View File
@@ -0,0 +1,32 @@
// 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 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
// Load the ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Style Lint tasks.
require('./stylelint')(grunt);
// Load the SASS tasks.
require('./sass')(grunt);
};
+183
View File
@@ -0,0 +1,183 @@
// 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 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
const getCssConfigForFiles = files => {
return {
stylelint: {
css: {
// Use a fully-qualified path.
src: files,
options: {
configOverrides: {
rules: {
// These rules have to be disabled in .stylelintrc for scss compat.
"at-rule-no-unknown": true,
}
}
}
},
},
};
};
const getScssConfigForFiles = files => {
return {
stylelint: {
scss: {
options: {syntax: 'scss'},
src: files,
},
},
};
};
/**
* Register any stylelint tasks.
*
* @param {Object} grunt
* @param {Array} files
* @param {String} fullRunDir
*/
const registerStyleLintTasks = () => {
const glob = require('glob');
// The stylelinters do not handle the case where a configuration was provided but no files were included.
// Keep track of whether any files were found.
let hasCss = false;
let hasScss = false;
// The stylelint processors do not take a path argument. They always check all provided values.
// As a result we must check through each glob and determine if any files match the current directory.
const scssFiles = [];
const cssFiles = [];
const requestedFiles = grunt.moodleEnv.files;
if (requestedFiles) {
// Grunt was called with a files argument.
// Check whether each of the requested files matches either the CSS or SCSS source file list.
requestedFiles.forEach(changedFilePath => {
let matchesGlob;
// Check whether this watched path matches any watched SCSS file.
matchesGlob = grunt.moodleEnv.scssSrc.some(watchedPathGlob => {
return glob.sync(watchedPathGlob).indexOf(changedFilePath) !== -1;
});
if (matchesGlob) {
scssFiles.push(changedFilePath);
hasScss = true;
}
// Check whether this watched path matches any watched CSS file.
matchesGlob = grunt.moodleEnv.cssSrc.some(watchedPathGlob => {
return glob.sync(watchedPathGlob).indexOf(changedFilePath) !== -1;
});
if (matchesGlob) {
cssFiles.push(changedFilePath);
hasCss = true;
}
});
} else {
// Grunt was called without a list of files.
// The start directory (runDir) may be a child dir of the project.
// Check each scssSrc file to see if it's in the start directory.
// This means that we can lint just mod/*/styles.css if started in the mod directory.
grunt.moodleEnv.scssSrc.forEach(path => {
if (path.startsWith(grunt.moodleEnv.runDir)) {
scssFiles.push(path);
hasScss = true;
}
});
grunt.moodleEnv.cssSrc.forEach(path => {
if (path.startsWith(grunt.moodleEnv.runDir)) {
cssFiles.push(path);
hasCss = true;
}
});
}
// Register the tasks.
const scssTasks = ['sass'];
if (hasScss) {
grunt.config.merge(getScssConfigForFiles(scssFiles));
scssTasks.unshift('stylelint:scss');
}
scssTasks.unshift('ignorefiles');
const cssTasks = ['ignorefiles'];
if (hasCss) {
grunt.config.merge(getCssConfigForFiles(cssFiles));
cssTasks.push('stylelint:css');
}
// The tasks must be registered, even if empty to ensure a consistent command list.
// They jsut won't run anything.
grunt.registerTask('scss', scssTasks);
grunt.registerTask('rawcss', cssTasks);
};
// Register CSS tasks.
grunt.loadNpmTasks('grunt-stylelint');
// Register the style lint tasks.
registerStyleLintTasks();
grunt.registerTask('css', ['scss', 'rawcss']);
const getCoreThemeMatches = () => {
const scssMatch = 'scss/**/*.scss';
if (grunt.moodleEnv.inTheme) {
return [scssMatch];
}
if (grunt.moodleEnv.runDir.startsWith('theme')) {
return [`*/${scssMatch}`];
}
return [`theme/*/${scssMatch}`];
};
// Add the watch configuration for rawcss, and scss.
grunt.config.merge({
watch: {
rawcss: {
files: [
'**/*.css',
],
excludes: [
'**/moodle.css',
'**/editor.css',
'jsdoc/styles/*.css',
],
tasks: ['rawcss']
},
scss: {
files: getCoreThemeMatches(),
tasks: ['scss']
},
},
});
};
+272
View File
@@ -0,0 +1,272 @@
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
/* eslint-env node */
module.exports = grunt => {
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
const watchHandler = function() {
const async = require('async');
const watchTaskDone = this.async();
let watchInitialised = false;
let watchTaskQueue = {};
let processingQueue = false;
const watchman = require('fb-watchman');
const watchmanClient = new watchman.Client();
// Grab the tasks and files that have been queued up and execute them.
var processWatchTaskQueue = function() {
if (!Object.keys(watchTaskQueue).length || processingQueue) {
// If there is nothing in the queue or we're already processing then wait.
return;
}
processingQueue = true;
// Grab all tasks currently in the queue.
var queueToProcess = watchTaskQueue;
// Reset the queue.
watchTaskQueue = {};
async.forEachSeries(
Object.keys(queueToProcess),
function(task, next) {
var files = queueToProcess[task];
var filesOption = '--files=' + files.join(',');
grunt.log.ok('Running task ' + task + ' for files ' + filesOption);
// Spawn the task in a child process so that it doesn't kill this one
// if it failed.
grunt.util.spawn(
{
// Spawn with the grunt bin.
grunt: true,
// Run from current working dir and inherit stdio from process.
opts: {
cwd: grunt.moodleEnv.fullRunDir,
stdio: 'inherit'
},
args: [task, filesOption]
},
function(err, res, code) {
if (code !== 0) {
// The grunt task failed.
grunt.log.error(err);
}
// Move on to the next task.
next();
}
);
},
function() {
// No longer processing.
processingQueue = false;
// Once all of the tasks are done then recurse just in case more tasks
// were queued while we were processing.
processWatchTaskQueue();
}
);
};
const originalWatchConfig = grunt.config.get(['watch']);
const watchConfig = Object.keys(originalWatchConfig).reduce(function(carry, key) {
if (key == 'options') {
return carry;
}
const value = originalWatchConfig[key];
const taskNames = value.tasks;
const files = value.files;
let excludes = [];
if (value.excludes) {
excludes = value.excludes;
}
taskNames.forEach(function(taskName) {
carry[taskName] = {
files,
excludes,
};
});
return carry;
}, {});
watchmanClient.on('error', function(error) {
// We have to add an error handler here and parse the error string because the
// example way from the docs to check if Watchman is installed doesn't actually work!!
// See: https://github.com/facebook/watchman/issues/509
if (error.message.match('Watchman was not found')) {
// If watchman isn't installed then we should fallback to the other watch task.
grunt.log.ok('It is recommended that you install Watchman for better performance using the "watch" command.');
// Fallback to the old grunt-contrib-watch task.
grunt.renameTask('watch-grunt', 'watch');
grunt.task.run(['watch']);
// This task is finished.
watchTaskDone(0);
} else {
grunt.log.error(error);
// Fatal error.
watchTaskDone(1);
}
});
watchmanClient.on('subscription', function(resp) {
if (resp.subscription !== 'grunt-watch') {
return;
}
resp.files.forEach(function(file) {
grunt.log.ok('File changed: ' + file.name);
var fullPath = grunt.moodleEnv.fullRunDir + '/' + file.name;
Object.keys(watchConfig).forEach(function(task) {
const fileGlobs = watchConfig[task].files;
var match = fileGlobs.some(function(fileGlob) {
return grunt.file.isMatch(`**/${fileGlob}`, fullPath);
});
if (match) {
// If we are watching a subdirectory then the file.name will be relative
// to that directory. However the grunt tasks expect the file paths to be
// relative to the Gruntfile.js location so let's normalise them before
// adding them to the queue.
var relativePath = fullPath.replace(grunt.moodleEnv.gruntFilePath + '/', '');
if (task in watchTaskQueue) {
if (!watchTaskQueue[task].includes(relativePath)) {
watchTaskQueue[task] = watchTaskQueue[task].concat(relativePath);
}
} else {
watchTaskQueue[task] = [relativePath];
}
}
});
});
processWatchTaskQueue();
});
process.on('SIGINT', function() {
// Let the user know that they may need to manually stop the Watchman daemon if they
// no longer want it running.
if (watchInitialised) {
grunt.log.ok('The Watchman daemon may still be running and may need to be stopped manually.');
}
process.exit();
});
// Initiate the watch on the current directory.
watchmanClient.command(['watch-project', grunt.moodleEnv.fullRunDir], function(watchError, watchResponse) {
if (watchError) {
grunt.log.error('Error initiating watch:', watchError);
watchTaskDone(1);
return;
}
if ('warning' in watchResponse) {
grunt.log.error('warning: ', watchResponse.warning);
}
var watch = watchResponse.watch;
var relativePath = watchResponse.relative_path;
watchInitialised = true;
watchmanClient.command(['clock', watch], function(clockError, clockResponse) {
if (clockError) {
grunt.log.error('Failed to query clock:', clockError);
watchTaskDone(1);
return;
}
// Generate the expression query used by watchman.
// Documentation is limited, but see https://facebook.github.io/watchman/docs/expr/allof.html for examples.
// We generate an expression to match any value in the files list of all of our tasks, but excluding
// all value in the excludes list of that task.
//
// [anyof, [
// [allof, [
// [anyof, [
// ['match', validPath, 'wholename'],
// ['match', validPath, 'wholename'],
// ],
// [not,
// [anyof, [
// ['match', invalidPath, 'wholename'],
// ['match', invalidPath, 'wholename'],
// ],
// ],
// ],
var matchWholeName = fileGlob => ['match', fileGlob, 'wholename'];
var matches = Object.keys(watchConfig).map(function(task) {
const matchAll = [];
matchAll.push(['anyof'].concat(watchConfig[task].files.map(matchWholeName)));
if (watchConfig[task].excludes.length) {
matchAll.push(['not', ['anyof'].concat(watchConfig[task].excludes.map(matchWholeName))]);
}
return ['allof'].concat(matchAll);
});
matches = ['anyof'].concat(matches);
var sub = {
expression: matches,
// Which fields we're interested in.
fields: ["name", "size", "type"],
// Add our time constraint.
since: clockResponse.clock
};
if (relativePath) {
/* eslint-disable camelcase */
sub.relative_root = relativePath;
}
watchmanClient.command(['subscribe', watch, 'grunt-watch', sub], function(subscribeError) {
if (subscribeError) {
// Probably an error in the subscription criteria.
grunt.log.error('failed to subscribe: ', subscribeError);
watchTaskDone(1);
return;
}
grunt.log.ok('Listening for changes to files in ' + grunt.moodleEnv.fullRunDir);
});
});
});
};
// Rename the grunt-contrib-watch "watch" task because we're going to wrap it.
grunt.renameTask('watch', 'watch-grunt');
// Register the new watch handler.
grunt.registerTask('watch', 'Run tasks on file changes', watchHandler);
grunt.config.merge({
watch: {
options: {
nospawn: true // We need not to spawn so config can be changed dynamically.
},
},
});
return watchHandler;
};
+1 -1
View File
@@ -1 +1 @@
v14.15.0
v14.18.0
-96
View File
@@ -1,96 +0,0 @@
# Generated by "grunt ignorefiles"
**/yui/build/*
theme/boost/style/moodle.css
theme/classic/style/moodle.css
node_modules/
vendor/
admin/tool/policy/amd/src/jquery-eu-cookie-law-popup.js
auth/cas/CAS/
cache/stores/mongodb/MongoDB/
enrol/lti/ims-blti/
filter/algebra/AlgParser.pm
filter/tex/mimetex.*
h5p/h5plib/v124/joubel/core/
h5p/h5plib/v124/joubel/editor/
lib/editor/atto/plugins/html/yui/src/codemirror/
lib/editor/atto/plugins/html/yui/src/beautify/
lib/editor/atto/yui/src/rangy/js/*.*
lib/editor/tinymce/plugins/pdw/tinymce/
lib/editor/tinymce/plugins/spellchecker/rpc.php
lib/editor/tinymce/tiny_mce/
lib/mlbackend/php/phpml/
lib/adodb/
lib/behat/axe/
lib/bennu/
lib/evalmath/
lib/phpspreadsheet/
lib/google/
lib/htmlpurifier/
lib/jabber/
lib/minify/matthiasmullie-minify/
lib/minify/matthiasmullie-pathconverter/
lib/pear/HTML/Common.php
lib/pear/HTML/QuickForm.php
lib/pear/HTML/QuickForm/
lib/pear/PEAR.php
lib/phpmailer/
lib/simplepie/
lib/tcpdf/
lib/typo3/
lib/yuilib/
lib/yuilib/gallery/
lib/jquery/
lib/html2text/
lib/markdown/
lib/xhprof/
lib/horde/
lib/requirejs/
lib/amd/src/loglevel.js
lib/mustache/
lib/amd/src/mustache.js
lib/graphlib.php
lib/php-css-parser/
lib/rtlcss/
lib/scssphp/
lib/spout/
lib/amd/src/chartjs-lazy.js
lib/maxmind/GeoIp2/
lib/maxmind/MaxMind/
lib/ltiprovider/
lib/amd/src/truncate.js
lib/fonts/
lib/amd/src/adapter.js
lib/validateurlsyntax.php
lib/amd/src/popper.js
lib/geopattern-php/
lib/php-jwt/
lib/babel-polyfill/
lib/polyfills/
lib/emoji-data/
lib/plist/
lib/zipstream/
lib/php-enum/
lib/http-message/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js
media/player/videojs/videojs/
media/player/videojs/amd/src/videojs-flash-lazy.js
media/player/videojs/videojs/video-js.swf
mod/assign/feedback/editpdf/fpdi/
repository/s3/S3.php
theme/boost/scss/bootstrap/
theme/boost/amd/src/bootstrap/alert.js
theme/boost/amd/src/bootstrap/button.js
theme/boost/amd/src/bootstrap/carousel.js
theme/boost/amd/src/bootstrap/collapse.js
theme/boost/amd/src/bootstrap/dropdown.js
theme/boost/amd/src/bootstrap/index.js
theme/boost/amd/src/bootstrap/modal.js
theme/boost/amd/src/bootstrap/popover.js
theme/boost/amd/src/bootstrap/tools/sanitizer.js
theme/boost/amd/src/bootstrap/scrollspy.js
theme/boost/amd/src/bootstrap/tab.js
theme/boost/amd/src/bootstrap/toast.js
theme/boost/amd/src/bootstrap/tooltip.js
theme/boost/amd/src/bootstrap/util.js
theme/boost/scss/fontawesome/
+40 -75
View File
@@ -10,36 +10,20 @@ language: php
os: linux
dist: xenial
dist: bionic
services:
- mysql
- docker
php:
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
- 7.4
- 7.2
addons:
postgresql: "9.6"
env:
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
# start first so that the total run time is not too high.
#
# We only run MySQL on PHP 7.2, so run that first.
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
# Postgres is significantly is pretty reasonable in its run-time.
# Run CI Tests without running PHPUnit.
- DB=none TASK=CITEST
# Run unit tests on Postgres
- DB=pgsql TASK=PHPUNIT
# Perform an upgrade test too.
- DB=pgsql TASK=UPGRADE
branches:
except:
- master
- /MOODLE_[0-9]+_STABLE/
- /^v[0-9]+\.[0-9]+\.[0-9]+.*/
jobs:
# Enable fast finish.
@@ -48,12 +32,35 @@ jobs:
fast_finish: true
include:
# Run mysql only on highest - it's just too slow
- php: 7.4
# First all the lowest php ones (7.3)
- php: 7.3
env: DB=none TASK=CITEST
- php: 7.3
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
- if: env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present
php: 7.3
env: DB=pgsql TASK=PHPUNIT
- if: env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all"
php: 7.3
env: DB=mysqli TASK=PHPUNIT
# Then, conditionally, all the highest php ones (8.0)
- if: env(MOODLE_PHP) = "all"
php: 8.0
env: DB=none TASK=CITEST
- if: env(MOODLE_PHP) = "all"
php: 8.0
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
- 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
env: DB=pgsql TASK=PHPUNIT
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all")
php: 8.0
env: DB=mysqli TASK=PHPUNIT
# Run grunt/npm install on highest version too ('node' is an alias for the latest node.js version.)
- php: 7.4
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
cache:
directories:
@@ -111,9 +118,11 @@ install:
fi
before_script:
- if [[ ${TRAVIS_PHP_VERSION:0:1} -gt 7 ]]; then pecl install xmlrpc-beta; fi
- echo 'max_input_vars=5000' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- phpenv config-rm xdebug.ini
- >
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
if [ "$TASK" = 'PHPUNIT' ];
then
# Copy generic configuration in place.
cp config-dist.php config.php ;
@@ -180,10 +189,9 @@ before_script:
sed -i \
-e "/require_once/i \\define('TEST_CACHESTORE_REDIS_TESTSERVERS', '127.0.0.1');" \
config.php ;
# Redis session tests, but not for PHP 7.2 and up. See MDL-60978 for more info.
redissession="define('TEST_SESSION_REDIS_HOST', '127.0.0.1');"
# Redis session tests
sed -i \
-e "/require_once/i \\${redissession}" \
-e "/require_once/i \\define('TEST_SESSION_REDIS_HOST', '127.0.0.1');" \
config.php ;
# Initialise PHPUnit for Moodle.
@@ -213,7 +221,7 @@ before_script:
# We need the official upstream for comparison
git remote add upstream https://github.com/moodle/moodle.git;
git fetch upstream MOODLE_310_STABLE;
git fetch upstream MOODLE_311_STABLE;
export GIT_PREVIOUS_COMMIT="`git merge-base FETCH_HEAD $TRAVIS_COMMIT`";
export GIT_COMMIT="$TRAVIS_COMMIT";
export UPSTREAM_FETCH_HEAD=`git rev-parse FETCH_HEAD`
@@ -224,32 +232,6 @@ before_script:
export phpcmd=`which php`;
fi
########################################################################
# Upgrade test
########################################################################
- >
if [ "$TASK" = 'UPGRADE' ];
then
# We need the official upstream.
git remote add upstream https://github.com/moodle/moodle.git;
# Checkout 30 STABLE branch (the first version compatible with PHP 7.x)
git fetch upstream MOODLE_30_STABLE;
git checkout MOODLE_30_STABLE;
# Perform the upgrade
php admin/cli/install_database.php --agree-license --adminpass=Password --adminemail=admin@example.com --fullname="Upgrade test" --shortname=Upgrade;
# Return to the previous commit
git checkout -;
# Perform the upgrade
php admin/cli/upgrade.php --non-interactive --allow-unstable ;
# The local_ci repository can be used to check upgrade savepoints.
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci ;
fi
script:
- >
if [ "$TASK" = 'PHPUNIT' ];
@@ -275,23 +257,6 @@ script:
git diff --cached --exit-code ;
fi
########################################################################
# Upgrade test
########################################################################
- >
if [ "$TASK" = 'UPGRADE' ];
then
cp local/ci/check_upgrade_savepoints/check_upgrade_savepoints.php ./check_upgrade_savepoints.php
result=`php check_upgrade_savepoints.php`;
# Check if there are problems
count=`echo "$result" | grep -P "ERROR|WARN" | wc -l` ;
if (($count > 0));
then
echo "$result"
exit 1 ;
fi
fi
after_script:
- >
if [ "$TASK" = 'PHPUNIT' ];
+162 -759
View File
@@ -16,147 +16,129 @@
/* eslint-env node */
/**
* Grunt configuration for Moodle.
*
* @copyright 2014 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/* eslint-env node */
/**
* Calculate the cwd, taking into consideration the `root` option (for Windows).
* Setup the Grunt Moodle environment.
*
* @param {Object} grunt
* @returns {String} The current directory as best we can determine
* @param {Grunt} grunt
* @returns {Object}
*/
const getCwd = grunt => {
const setupMoodleEnvironment = grunt => {
const fs = require('fs');
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
let cwd = fs.realpathSync(process.env.PWD || process.cwd());
const getAmdConfiguration = () => {
// If the cwd is the amd directory in the current component then it will be empty.
// If the cwd is a child of the component's AMD directory, the relative directory will not start with ..
let inAMD = !path.relative(`${componentDirectory}/amd`, cwd).startsWith('..');
// Windows users can't run grunt in a subdirectory, so allow them to set
// the root by passing --root=path/to/dir.
if (grunt.option('root')) {
const root = grunt.option('root');
if (grunt.file.exists(__dirname, root)) {
cwd = fs.realpathSync(path.join(__dirname, root));
grunt.log.ok('Setting root to ' + cwd);
// Globbing pattern for matching all AMD JS source files.
let amdSrc = [];
if (inComponent) {
amdSrc.push(
componentDirectory + "/amd/src/*.js",
componentDirectory + "/amd/src/**/*.js"
);
} else {
grunt.fail.fatal('Setting root to ' + root + ' failed - path does not exist');
amdSrc = ComponentList.getAmdSrcGlobList();
}
}
return cwd;
};
/**
* Register any stylelint tasks.
*
* @param {Object} grunt
* @param {Array} files
* @param {String} fullRunDir
*/
const registerStyleLintTasks = (grunt, files, fullRunDir) => {
const getCssConfigForFiles = files => {
return {
stylelint: {
css: {
// Use a fully-qualified path.
src: files,
options: {
configOverrides: {
rules: {
// These rules have to be disabled in .stylelintrc for scss compat.
"at-rule-no-unknown": true,
}
}
}
},
},
inAMD,
amdSrc,
};
};
const getScssConfigForFiles = files => {
const getYuiConfiguration = () => {
let yuiSrc = [];
if (inComponent) {
yuiSrc.push(componentDirectory + "/yui/src/**/*.js");
} else {
yuiSrc = ComponentList.getYuiSrcGlobList(gruntFilePath + '/');
}
return {
stylelint: {
scss: {
options: {syntax: 'scss'},
src: files,
},
},
yuiSrc,
};
};
let hasCss = true;
let hasScss = true;
const getStyleConfiguration = () => {
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// Build the cssSrc and scssSrc.
// Valid paths are:
// [component]/styles.css; and either
// [theme/[themename]]/scss/**/*.scss; or
// [theme/[themename]]/style/*.css.
//
// If a theme has scss, then it is assumed that the style directory contains generated content.
let cssSrc = [];
let scssSrc = [];
if (files) {
// Specific files were passed. Just set them up.
grunt.config.merge(getCssConfigForFiles(files));
grunt.config.merge(getScssConfigForFiles(files));
} else {
// The stylelint system does not handle the case where there was no file to lint.
// Check whether there are any files to lint in the current directory.
const glob = require('glob');
const checkComponentDirectory = componentDirectory => {
const isTheme = componentDirectory.startsWith('theme/');
if (isTheme) {
const scssDirectory = `${componentDirectory}/scss`;
const scssSrc = [];
glob.sync(`${fullRunDir}/**/*.scss`).forEach(path => scssSrc.push(path));
if (fs.existsSync(scssDirectory)) {
// This theme has an SCSS directory.
// Include all scss files within it recursively, but do not check for css files.
scssSrc.push(`${scssDirectory}/*.scss`);
scssSrc.push(`${scssDirectory}/**/*.scss`);
} else {
// This theme has no SCSS directory.
// Only hte CSS files in the top-level directory are checked.
cssSrc.push(`${componentDirectory}/style/*.css`);
}
} else {
// This is not a theme.
// All other plugin types are restricted to a single styles.css in their top level.
cssSrc.push(`${componentDirectory}/styles.css`);
}
};
if (scssSrc.length) {
grunt.config.merge(getScssConfigForFiles(scssSrc));
if (inComponent) {
checkComponentDirectory(componentDirectory);
} else {
hasScss = false;
ComponentList.getComponentPaths(`${gruntFilePath}/`).forEach(componentPath => {
checkComponentDirectory(componentPath);
});
}
const cssSrc = [];
glob.sync(`${fullRunDir}/**/*.css`).forEach(path => cssSrc.push(path));
return {
cssSrc,
scssSrc,
};
};
if (cssSrc.length) {
grunt.config.merge(getCssConfigForFiles(cssSrc));
} else {
hasCss = false;
/**
* Calculate the cwd, taking into consideration the `root` option (for Windows).
*
* @param {Object} grunt
* @returns {String} The current directory as best we can determine
*/
const getCwd = grunt => {
let cwd = fs.realpathSync(process.env.PWD || process.cwd());
// Windows users can't run grunt in a subdirectory, so allow them to set
// the root by passing --root=path/to/dir.
if (grunt.option('root')) {
const root = grunt.option('root');
if (grunt.file.exists(__dirname, root)) {
cwd = fs.realpathSync(path.join(__dirname, root));
grunt.log.ok('Setting root to ' + cwd);
} else {
grunt.fail.fatal('Setting root to ' + root + ' failed - path does not exist');
}
}
}
const scssTasks = ['sass'];
if (hasScss) {
scssTasks.unshift('stylelint:scss');
}
grunt.registerTask('scss', scssTasks);
const cssTasks = [];
if (hasCss) {
cssTasks.push('stylelint:css');
}
grunt.registerTask('rawcss', cssTasks);
grunt.registerTask('css', ['scss', 'rawcss']);
};
/**
* Grunt configuration.
*
* @param {Object} grunt
*/
module.exports = function(grunt) {
const path = require('path');
const tasks = {};
const async = require('async');
const DOMParser = require('xmldom').DOMParser;
const xpath = require('xpath');
const semver = require('semver');
const watchman = require('fb-watchman');
const watchmanClient = new watchman.Client();
const fs = require('fs');
const ComponentList = require(path.resolve('GruntfileComponents.js'));
const sass = require('node-sass');
// Verify the node version is new enough.
var expected = semver.validRange(grunt.file.readJSON('package.json').engines.node);
var actual = semver.valid(process.version);
if (!semver.satisfies(actual, expected)) {
grunt.fail.fatal('Node version not satisfied. Require ' + expected + ', version installed: ' + actual);
}
return cwd;
};
// Detect directories:
// * gruntFilePath The real path on disk to this Gruntfile.js
@@ -171,8 +153,19 @@ module.exports = function(grunt) {
const relativeCwd = path.relative(gruntFilePath, cwd);
const componentDirectory = ComponentList.getOwningComponentDirectory(relativeCwd);
const inComponent = !!componentDirectory;
const inTheme = !!componentDirectory && componentDirectory.startsWith('theme/');
const runDir = inComponent ? componentDirectory : relativeCwd;
const fullRunDir = fs.realpathSync(gruntFilePath + path.sep + runDir);
const {inAMD, amdSrc} = getAmdConfiguration();
const {yuiSrc} = getYuiConfiguration();
const {cssSrc, scssSrc} = getStyleConfiguration();
let files = null;
if (grunt.option('files')) {
// Accept a comma separated list of files to process.
files = grunt.option('files').split(',');
}
grunt.log.debug('============================================================================');
grunt.log.debug(`= Node version: ${process.versions.node}`);
grunt.log.debug(`= grunt version: ${grunt.package.version}`);
@@ -192,667 +185,77 @@ module.exports = function(grunt) {
grunt.log.ok(`Running tasks for component directory ${componentDirectory}`);
}
let files = null;
if (grunt.option('files')) {
// Accept a comma separated list of files to process.
files = grunt.option('files').split(',');
return {
amdSrc,
componentDirectory,
cwd,
cssSrc,
files,
fullRunDir,
gruntFilePath,
inAMD,
inComponent,
inTheme,
relativeCwd,
runDir,
scssSrc,
yuiSrc,
};
};
/**
* Verify tha tthe current NodeJS version matches the required version in package.json.
*
* @param {Grunt} grunt
*/
const verifyNodeVersion = grunt => {
const semver = require('semver');
// Verify the node version is new enough.
var expected = semver.validRange(grunt.file.readJSON('package.json').engines.node);
var actual = semver.valid(process.version);
if (!semver.satisfies(actual, expected)) {
grunt.fail.fatal('Node version not satisfied. Require ' + expected + ', version installed: ' + actual);
}
};
// If the cwd is the amd directory in the current component then it will be empty.
// If the cwd is a child of the component's AMD directory, the relative directory will not start with ..
const inAMD = !path.relative(`${componentDirectory}/amd`, cwd).startsWith('..');
/**
* Grunt configuration.
*
* @param {Grunt} grunt
*/
module.exports = function(grunt) {
// Verify that the Node version meets our requirements.
verifyNodeVersion(grunt);
// Globbing pattern for matching all AMD JS source files.
let amdSrc = [];
if (inComponent) {
amdSrc.push(componentDirectory + "/amd/src/*.js");
amdSrc.push(componentDirectory + "/amd/src/**/*.js");
} else {
amdSrc = ComponentList.getAmdSrcGlobList();
}
let yuiSrc = [];
if (inComponent) {
yuiSrc.push(componentDirectory + "/yui/src/**/*.js");
} else {
yuiSrc = ComponentList.getYuiSrcGlobList(gruntFilePath + '/');
}
// Setup the Moodle environemnt within the Grunt object.
grunt.moodleEnv = setupMoodleEnvironment(grunt);
/**
* Function to generate the destination for the uglify task
* (e.g. build/file.min.js). This function will be passed to
* the rename property of files array when building dynamically:
* http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
* Add the named task.
*
* @param {String} destPath the current destination
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
* @param {string} name
* @param {Grunt} grunt
*/
var babelRename = function(destPath, srcPath) {
destPath = srcPath.replace('src', 'build');
destPath = destPath.replace('.js', '.min.js');
return destPath;
const addTask = (name, grunt) => {
const path = require('path');
const taskPath = path.resolve(`./.grunt/tasks/${name}.js`);
grunt.log.debug(`Including tasks for ${name} from ${taskPath}`);
require(path.resolve(`./.grunt/tasks/${name}.js`))(grunt);
};
/**
* Find thirdpartylibs.xml and generate an array of paths contained within
* them (used to generate ignore files and so on).
*
* @return {array} The list of thirdparty paths.
*/
var getThirdPartyPathsFromXML = function() {
const thirdpartyfiles = ComponentList.getThirdPartyLibsList(gruntFilePath + '/');
const libs = ['node_modules/', 'vendor/'];
thirdpartyfiles.forEach(function(file) {
const dirname = path.dirname(file);
// Add Moodle task configuration.
addTask('gherkinlint', grunt);
addTask('ignorefiles', grunt);
const doc = new DOMParser().parseFromString(grunt.file.read(file));
const nodes = xpath.select("/libraries/library/location/text()", doc);
addTask('javascript', grunt);
addTask('style', grunt);
nodes.forEach(function(node) {
let lib = path.posix.join(dirname, node.toString());
if (grunt.file.isDir(lib)) {
// Ensure trailing slash on dirs.
lib = lib.replace(/\/?$/, '/');
}
// Look for duplicate paths before adding to array.
if (libs.indexOf(lib) === -1) {
libs.push(lib);
}
});
});
return libs;
};
/**
* Get the list of feature files to pass to the gherkin linter.
*
* @returns {Array}
*/
const getGherkinLintTargets = () => {
if (files) {
// Specific files were requested. Only check these.
return files;
}
if (inComponent) {
return [`${runDir}/tests/behat/*.feature`];
}
return ['**/tests/behat/*.feature'];
};
// Project configuration.
grunt.initConfig({
eslint: {
// Even though warnings dont stop the build we don't display warnings by default because
// at this moment we've got too many core warnings.
// To display warnings call: grunt eslint --show-lint-warnings
// To fail on warnings call: grunt eslint --max-lint-warnings=0
// Also --max-lint-warnings=-1 can be used to display warnings but not fail.
options: {
quiet: (!grunt.option('show-lint-warnings')) && (typeof grunt.option('max-lint-warnings') === 'undefined'),
maxWarnings: ((typeof grunt.option('max-lint-warnings') !== 'undefined') ? grunt.option('max-lint-warnings') : -1)
},
amd: {src: files ? files : amdSrc},
// Check YUI module source files.
yui: {src: files ? files : yuiSrc},
},
babel: {
options: {
sourceMaps: true,
comments: false,
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('babel-plugin-add-module-to-define.js'),
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', {'loose': false}],
'@babel/plugin-proposal-json-strings'
],
presets: [
['minify', {
// This minification plugin needs to be disabled because it breaks the
// source map generation and causes invalid source maps to be output.
simplify: false,
builtIns: false
}],
['@babel/preset-env', {
targets: {
browsers: [
">0.25%",
"last 2 versions",
"not ie <= 10",
"not op_mini all",
"not Opera > 0",
"not dead"
]
},
modules: false,
useBuiltIns: false
}]
]
},
dist: {
files: [{
expand: true,
src: files ? files : amdSrc,
rename: babelRename
}]
}
},
sass: {
dist: {
files: {
"theme/boost/style/moodle.css": "theme/boost/scss/preset/default.scss",
"theme/classic/style/moodle.css": "theme/classic/scss/classicgrunt.scss"
}
},
options: {
implementation: sass,
includePaths: ["theme/boost/scss/", "theme/classic/scss/"]
}
},
watch: {
options: {
nospawn: true // We need not to spawn so config can be changed dynamically.
},
amd: {
files: inComponent
? ['amd/src/*.js', 'amd/src/**/*.js']
: ['**/amd/src/**/*.js'],
tasks: ['amd']
},
boost: {
files: [inComponent ? 'scss/**/*.scss' : 'theme/boost/scss/**/*.scss'],
tasks: ['scss']
},
rawcss: {
files: [
'**/*.css',
],
excludes: [
'**/moodle.css',
'**/editor.css',
],
tasks: ['rawcss']
},
yui: {
files: inComponent
? ['yui/src/*.json', 'yui/src/**/*.js']
: ['**/yui/src/**/*.js'],
tasks: ['yui']
},
gherkinlint: {
files: [inComponent ? 'tests/behat/*.feature' : '**/tests/behat/*.feature'],
tasks: ['gherkinlint']
}
},
shifter: {
options: {
recursive: true,
// Shifter takes a relative path.
paths: files ? files : [runDir]
}
},
gherkinlint: {
options: {
files: getGherkinLintTargets(),
}
},
});
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
tasks.ignorefiles = function() {
// An array of paths to third party directories.
const thirdPartyPaths = getThirdPartyPathsFromXML();
// Generate .eslintignore.
const eslintIgnores = [
'# Generated by "grunt ignorefiles"',
'*/**/yui/src/*/meta/',
'*/**/build/',
].concat(thirdPartyPaths);
grunt.file.write('.eslintignore', eslintIgnores.join('\n'));
// Generate .stylelintignore.
const stylelintIgnores = [
'# Generated by "grunt ignorefiles"',
'**/yui/build/*',
'theme/boost/style/moodle.css',
'theme/classic/style/moodle.css',
].concat(thirdPartyPaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n'));
};
/**
* Shifter task. Is configured with a path to a specific file or a directory,
* in the case of a specific file it will work out the right module to be built.
*
* Note that this task runs the invidiaul shifter jobs async (becase it spawns
* so be careful to to call done().
*/
tasks.shifter = function() {
var done = this.async(),
options = grunt.config('shifter.options');
// Run the shifter processes one at a time to avoid confusing output.
async.eachSeries(options.paths, function(src, filedone) {
var args = [];
args.push(path.normalize(__dirname + '/node_modules/shifter/bin/shifter'));
// Always ignore the node_modules directory.
args.push('--excludes', 'node_modules');
// Determine the most appropriate options to run with based upon the current location.
if (grunt.file.isMatch('**/yui/**/*.js', src)) {
// When passed a JS file, build our containing module (this happen with
// watch).
grunt.log.debug('Shifter passed a specific JS file');
src = path.dirname(path.dirname(src));
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src', src)) {
// When in a src directory --walk all modules.
grunt.log.debug('In a src directory');
args.push('--walk');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*', src)) {
// When in module, only build our module.
grunt.log.debug('In a module directory');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*/js', src)) {
// When in module src, only build our module.
grunt.log.debug('In a source directory');
src = path.dirname(src);
options.recursive = false;
}
if (grunt.option('watch')) {
grunt.fail.fatal('The --watch option has been removed, please use `grunt watch` instead');
}
// Add the stderr option if appropriate
if (grunt.option('verbose')) {
args.push('--lint-stderr');
}
if (grunt.option('no-color')) {
args.push('--color=false');
}
var execShifter = function() {
grunt.log.ok("Running shifter on " + src);
grunt.util.spawn({
cmd: "node",
args: args,
opts: {cwd: src, stdio: 'inherit', env: process.env}
}, function(error, result, code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
grunt.log.ok('Shifter build complete.');
filedone();
}
});
};
// Actually run shifter.
if (!options.recursive) {
execShifter();
} else {
// Check that there are yui modules otherwise shifter ends with exit code 1.
if (grunt.file.expand({cwd: src}, '**/yui/src/**/*.js').length > 0) {
args.push('--recursive');
execShifter();
} else {
grunt.log.ok('No YUI modules to build.');
filedone();
}
}
}, done);
};
tasks.gherkinlint = function() {
const done = this.async();
const options = grunt.config('gherkinlint.options');
// Grab the gherkin-lint linter and required scaffolding.
const linter = require('gherkin-lint/dist/linter.js');
const featureFinder = require('gherkin-lint/dist/feature-finder.js');
const configParser = require('gherkin-lint/dist/config-parser.js');
const formatter = require('gherkin-lint/dist/formatters/stylish.js');
// Run the linter.
return linter.lint(
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
configParser.getConfiguration(configParser.defaultConfigFileName)
)
.then(results => {
// Print the results out uncondtionally.
formatter.printResults(results);
return results;
})
.then(results => {
// Report on the results.
// The done function takes a bool whereby a falsey statement causes the task to fail.
return results.every(result => result.errors.length === 0);
})
.then(done); // eslint-disable-line promise/no-callback-in-promise
};
tasks.startup = function() {
// Are we in a YUI directory?
if (path.basename(path.resolve(cwd, '../../')) == 'yui') {
grunt.task.run('yui');
// Are we in an AMD directory?
} else if (inAMD) {
grunt.task.run('amd');
} else {
// Run them all!.
grunt.task.run('css');
grunt.task.run('js');
grunt.task.run('gherkinlint');
}
};
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
tasks.watch = function() {
var watchTaskDone = this.async();
var watchInitialised = false;
var watchTaskQueue = {};
var processingQueue = false;
// Grab the tasks and files that have been queued up and execute them.
var processWatchTaskQueue = function() {
if (!Object.keys(watchTaskQueue).length || processingQueue) {
// If there is nothing in the queue or we're already processing then wait.
return;
}
processingQueue = true;
// Grab all tasks currently in the queue.
var queueToProcess = watchTaskQueue;
// Reset the queue.
watchTaskQueue = {};
async.forEachSeries(
Object.keys(queueToProcess),
function(task, next) {
var files = queueToProcess[task];
var filesOption = '--files=' + files.join(',');
grunt.log.ok('Running task ' + task + ' for files ' + filesOption);
// Spawn the task in a child process so that it doesn't kill this one
// if it failed.
grunt.util.spawn(
{
// Spawn with the grunt bin.
grunt: true,
// Run from current working dir and inherit stdio from process.
opts: {
cwd: fullRunDir,
stdio: 'inherit'
},
args: [task, filesOption]
},
function(err, res, code) {
if (code !== 0) {
// The grunt task failed.
grunt.log.error(err);
}
// Move on to the next task.
next();
}
);
},
function() {
// No longer processing.
processingQueue = false;
// Once all of the tasks are done then recurse just in case more tasks
// were queued while we were processing.
processWatchTaskQueue();
}
);
};
const originalWatchConfig = grunt.config.get(['watch']);
const watchConfig = Object.keys(originalWatchConfig).reduce(function(carry, key) {
if (key == 'options') {
return carry;
}
const value = originalWatchConfig[key];
const taskNames = value.tasks;
const files = value.files;
let excludes = [];
if (value.excludes) {
excludes = value.excludes;
}
taskNames.forEach(function(taskName) {
carry[taskName] = {
files,
excludes,
};
});
return carry;
}, {});
watchmanClient.on('error', function(error) {
// We have to add an error handler here and parse the error string because the
// example way from the docs to check if Watchman is installed doesn't actually work!!
// See: https://github.com/facebook/watchman/issues/509
if (error.message.match('Watchman was not found')) {
// If watchman isn't installed then we should fallback to the other watch task.
grunt.log.ok('It is recommended that you install Watchman for better performance using the "watch" command.');
// Fallback to the old grunt-contrib-watch task.
grunt.renameTask('watch-grunt', 'watch');
grunt.task.run(['watch']);
// This task is finished.
watchTaskDone(0);
} else {
grunt.log.error(error);
// Fatal error.
watchTaskDone(1);
}
});
watchmanClient.on('subscription', function(resp) {
if (resp.subscription !== 'grunt-watch') {
return;
}
resp.files.forEach(function(file) {
grunt.log.ok('File changed: ' + file.name);
var fullPath = fullRunDir + '/' + file.name;
Object.keys(watchConfig).forEach(function(task) {
const fileGlobs = watchConfig[task].files;
var match = fileGlobs.some(function(fileGlob) {
return grunt.file.isMatch(`**/${fileGlob}`, fullPath);
});
if (match) {
// If we are watching a subdirectory then the file.name will be relative
// to that directory. However the grunt tasks expect the file paths to be
// relative to the Gruntfile.js location so let's normalise them before
// adding them to the queue.
var relativePath = fullPath.replace(gruntFilePath + '/', '');
if (task in watchTaskQueue) {
if (!watchTaskQueue[task].includes(relativePath)) {
watchTaskQueue[task] = watchTaskQueue[task].concat(relativePath);
}
} else {
watchTaskQueue[task] = [relativePath];
}
}
});
});
processWatchTaskQueue();
});
process.on('SIGINT', function() {
// Let the user know that they may need to manually stop the Watchman daemon if they
// no longer want it running.
if (watchInitialised) {
grunt.log.ok('The Watchman daemon may still be running and may need to be stopped manually.');
}
process.exit();
});
// Initiate the watch on the current directory.
watchmanClient.command(['watch-project', fullRunDir], function(watchError, watchResponse) {
if (watchError) {
grunt.log.error('Error initiating watch:', watchError);
watchTaskDone(1);
return;
}
if ('warning' in watchResponse) {
grunt.log.error('warning: ', watchResponse.warning);
}
var watch = watchResponse.watch;
var relativePath = watchResponse.relative_path;
watchInitialised = true;
watchmanClient.command(['clock', watch], function(clockError, clockResponse) {
if (clockError) {
grunt.log.error('Failed to query clock:', clockError);
watchTaskDone(1);
return;
}
// Generate the expression query used by watchman.
// Documentation is limited, but see https://facebook.github.io/watchman/docs/expr/allof.html for examples.
// We generate an expression to match any value in the files list of all of our tasks, but excluding
// all value in the excludes list of that task.
//
// [anyof, [
// [allof, [
// [anyof, [
// ['match', validPath, 'wholename'],
// ['match', validPath, 'wholename'],
// ],
// [not,
// [anyof, [
// ['match', invalidPath, 'wholename'],
// ['match', invalidPath, 'wholename'],
// ],
// ],
// ],
var matchWholeName = fileGlob => ['match', fileGlob, 'wholename'];
var matches = Object.keys(watchConfig).map(function(task) {
const matchAll = [];
matchAll.push(['anyof'].concat(watchConfig[task].files.map(matchWholeName)));
if (watchConfig[task].excludes.length) {
matchAll.push(['not', ['anyof'].concat(watchConfig[task].excludes.map(matchWholeName))]);
}
return ['allof'].concat(matchAll);
});
matches = ['anyof'].concat(matches);
var sub = {
expression: matches,
// Which fields we're interested in.
fields: ["name", "size", "type"],
// Add our time constraint.
since: clockResponse.clock
};
if (relativePath) {
/* eslint-disable camelcase */
sub.relative_root = relativePath;
}
watchmanClient.command(['subscribe', watch, 'grunt-watch', sub], function(subscribeError) {
if (subscribeError) {
// Probably an error in the subscription criteria.
grunt.log.error('failed to subscribe: ', subscribeError);
watchTaskDone(1);
return;
}
grunt.log.ok('Listening for changes to files in ' + fullRunDir);
});
});
});
};
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
var changedFiles = Object.create(null);
var onChange = grunt.util._.debounce(function() {
var files = Object.keys(changedFiles);
grunt.config('eslint.amd.src', files);
grunt.config('eslint.yui.src', files);
grunt.config('shifter.options.paths', files);
grunt.config('gherkinlint.options.files', files);
grunt.config('babel.dist.files', [{expand: true, src: files, rename: babelRename}]);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', function(action, filepath) {
changedFiles[filepath] = action;
onChange();
});
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-stylelint');
grunt.loadNpmTasks('grunt-babel');
// Rename the grunt-contrib-watch "watch" task because we're going to wrap it.
grunt.renameTask('watch', 'watch-grunt');
// Register JS tasks.
grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
grunt.registerTask('gherkinlint', 'Run gherkinlint against the current directory', tasks.gherkinlint);
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', tasks.ignorefiles);
grunt.registerTask('watch', 'Run tasks on file changes', tasks.watch);
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
grunt.registerTask('amd', ['eslint:amd', 'babel']);
grunt.registerTask('js', ['amd', 'yui']);
// Register CSS tasks.
registerStyleLintTasks(grunt, files, fullRunDir);
// Register the startup task.
grunt.registerTask('startup', 'Run the correct tasks for the current directory', tasks.startup);
addTask('watch', grunt);
addTask('startup', grunt);
// Register the default task.
grunt.registerTask('default', ['startup']);
+1 -1
View File
@@ -2,7 +2,7 @@ MOODLE TRADEMARKS POLICY
========================
The word "Moodle" is trademarked in many countries around the world. The word
was originally an acronym: Modular Object-Oriented Dynamic Learning
was originally coined as an acronym: Modular Object-Oriented Dynamic Learning
Environment. The trademark is owned by Martin Dougiamas, Founder and Director
of Moodle.
+13 -4
View File
@@ -44,7 +44,9 @@ switch ($action) {
$key = array_search($auth, $authsenabled);
if ($key !== false) {
unset($authsenabled[$key]);
set_config('auth', implode(',', $authsenabled));
$value = implode(',', $authsenabled);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
}
if ($auth == $CFG->registerauth) {
@@ -59,8 +61,11 @@ switch ($action) {
if (!in_array($auth, $authsenabled)) {
$authsenabled[] = $auth;
$authsenabled = array_unique($authsenabled);
set_config('auth', implode(',', $authsenabled));
$value = implode(',', $authsenabled);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
}
\core\session\manager::gc(); // Remove stale sessions.
core_plugin_manager::reset_caches();
break;
@@ -76,7 +81,9 @@ switch ($action) {
$fsave = $authsenabled[$key];
$authsenabled[$key] = $authsenabled[$key + 1];
$authsenabled[$key + 1] = $fsave;
set_config('auth', implode(',', $authsenabled));
$value = implode(',', $authsenabled);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
}
break;
@@ -91,7 +98,9 @@ switch ($action) {
$fsave = $authsenabled[$key];
$authsenabled[$key] = $authsenabled[$key - 1];
$authsenabled[$key - 1] = $fsave;
set_config('auth', implode(',', $authsenabled));
$value = implode(',', $authsenabled);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
}
break;
-2
View File
@@ -171,8 +171,6 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
// limit for the setting name is 100.
continue;
}
} elseif ($fieldname == 'url') {
$fieldname = get_string('webpage');
} else {
$fieldname = get_string($fieldname);
}
+5
View File
@@ -158,4 +158,9 @@ echo $outputhtml;
echo html_writer::end_tag('fieldset');
echo html_writer::end_tag('form');
$PAGE->requires->yui_module('moodle-core-formchangechecker', 'M.core_formchangechecker.init', [[
'formid' => 'adminsettings'
]]);
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
echo $OUTPUT->footer();
+3 -1
View File
@@ -126,6 +126,7 @@ class filesize extends \admin_setting {
if (is_null($bytes)) {
return null;
}
$bytes = intval($bytes);
return self::parse_bytes($bytes);
}
@@ -145,9 +146,10 @@ class filesize extends \admin_setting {
return get_string('errorsetting', 'admin');
}
// Calculate size in bytes, ensuring we don't overflow PHP_INT_MAX.
$bytes = $data['v'] * $data['u'];
$result = (is_int($bytes) && $this->config_write($this->name, $bytes));
$result = $this->config_write($this->name, $bytes);
return ($result ? '' : get_string('errorsetting', 'admin'));
}
+3 -2
View File
@@ -124,8 +124,9 @@ class task_log_table extends \table_sql {
$sort = "ORDER BY $sort";
}
$extrafields = get_extra_user_fields(\context_system::instance());
$userfields = \user_picture::fields('u', $extrafields, 'userid2', 'user');
// TODO Does not support custom user profile fields (MDL-70456).
$userfieldsapi = \core_user\fields::for_identity(\context_system::instance(), false)->with_userpic();
$userfields = $userfieldsapi->get_sql('u', false, 'user', 'userid2', false)->selects;
$where = '';
if (!empty($this->sql->where)) {
+8 -1
View File
@@ -120,7 +120,14 @@ if ($options['unset'] || $options['set'] !== null) {
}
// Check that the variable is not hard-set in the main config.php already.
if (array_key_exists($options['name'], $CFG->config_php_settings)) {
$component = $options['component'];
if (!empty($component)) {
$componentsettings = $CFG->forced_plugin_settings[$component] ?? [];
$settinginconfig = array_key_exists($options['name'], $componentsettings);
} else {
$settinginconfig = array_key_exists($options['name'], $CFG->config_php_settings);
}
if ($settinginconfig) {
cli_error('The configuration variable is hard-set in the config.php, unable to change.', 4);
}
+65
View File
@@ -0,0 +1,65 @@
<?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/>.
/**
* CLI script to reset dashboards.
*
* @package core
* @subpackage cli
* @copyright 2021 Brendan Heywood (brendan@catalyst-au.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->dirroot.'/my/lib.php');
list($options, $unrecognized) = cli_get_params([
'help' => false,
'execute' => false,
], [
'h' => 'help',
'e' => 'execute',
]);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized), 2);
}
if (!$options['execute']) {
$help = <<<EOF
Resets Moodle dashboards for all users
Options:
-h, --help Print out this help
-e, --execute Actually run the reset
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/dashboard_reset.php -e
EOF;
echo $help;
exit(0);
}
$progressbar = new progress_bar();
$progressbar->create();
my_reset_page_for_all_users(MY_PAGE_PRIVATE, 'my-index', $progressbar);
+138
View File
@@ -0,0 +1,138 @@
<?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/>.
/**
* Fix orphaned calendar events that were broken by MDL-67494.
*
* This script will look for all the calendar events which userids
* where broken by a wrong upgrade step, affecting to Moodle 3.9.5
* and up.
*
* It performs checks to both:
* a) Detect if the site was affected (ran the wrong upgrade step).
* b) Look for orphaned calendar events, categorising them as:
* - standard: site / category / course / group / user events
* - subscription: events created via subscriptions.
* - action: normal action events, created to show common important dates.
* - override: user and group override events, particular, that some activities support.
* - custom: other events, not being any of the above, common or particular.
* By specifying it (--fix) try to recover as many broken events (missing userid) as
* possible. Standard, subscription, action, override events in core are fully supported but
* override or custom events should be fixed by each plugin as far as there isn't any standard
* API (plugin-wise) to launch a rebuild of the calendar events.
*
* @package core
* @copyright 2021 onwards Simey Lameze <simey@moodle.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir . "/clilib.php");
require_once($CFG->libdir . '/db/upgradelib.php');
// Supported options.
$long = ['fix' => false, 'help' => false];
$short = ['f' => 'fix', 'h' => 'help'];
// CLI options.
[$options, $unrecognized] = cli_get_params($long, $short);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help = <<<EOT
Fix orphaned calendar events.
This script detects calendar events that have had their
userid lost. By default it will perform various checks
and report them, showing the site status in an easy way.
Also, optionally (--fix), it wil try to recover as many
lost userids as possible from different sources. Note that
this script aims to process well-know events in core,
leaving custom events in 3rd part plugins mostly unmodified
because there isn't any consistent way to regenerate them.
For more details: https://tracker.moodle.org/browse/MDL-71156
Options:
-h, --help Print out this help.
-f, --fix Fix the orphaned calendar events in the DB.
If not specified only check and report problems to STDERR.
Usage:
- Only report: \$ sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_calendar_events.php
- Report and fix: \$ sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_calendar_events.php -f
EOT;
cli_writeln($help);
die;
}
// Check various usual pre-requisites.
if (empty($CFG->version)) {
cli_error('Database is not yet installed.');
}
$admin = get_admin();
if (!$admin) {
cli_error('Error: No admin account was found.');
}
if (moodle_needs_upgrading()) {
cli_error('Moodle upgrade pending, script execution suspended.');
}
// Do everything as admin by default.
\core\session\manager::set_user($admin);
// Report current site status.
cli_heading('Checking the site status');
$needsfix = upgrade_calendar_site_status();
// Report current calendar events status.
cli_heading('Checking the calendar events status');
$info = upgrade_calendar_events_status();
$hasbadevents = $info['total']->bad > 0 || $info['total']->bad != $info['other']->bad;
$needsfix = $needsfix || $hasbadevents;
// If, selected, fix as many calendar events as possible.
if ($options['fix']) {
// If the report has told us that the fix was not needed... ask for confirmation!
if (!$needsfix) {
cli_writeln("This site DOES NOT NEED to run the calendar events fix.");
$input = cli_input('Are you completely sure that you want to run the fix? (y/N)', 'N', ['y', 'Y', 'n', 'N']);
if (strtolower($input) != 'y') {
exit(0);
}
cli_writeln("");
}
cli_heading('Fixing as many as possible calendar events');
upgrade_calendar_events_fix_remaining($info);
// Report current (after fix) calendar events status.
cli_heading('Checking the calendar events status (after fix)');
upgrade_calendar_events_status();
} else if ($needsfix) {
// Fix option was not provided but problem events have been found. Notify the user and provide info how to fix these events.
cli_writeln("This site NEEDS to run the calendar events fix!");
cli_writeln("To fix the calendar events, re-run this script with the --fix option.");
}
+79
View File
@@ -0,0 +1,79 @@
<?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/>.
/**
* Generates a secure key for the current server (presuming it does not already exist).
*
* @package core_admin
* @copyright 2020 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use \core\encryption;
define('CLI_SCRIPT', true);
require(__DIR__ . '/../../config.php');
require_once($CFG->libdir . '/clilib.php');
// Get cli options.
[$options, $unrecognized] = cli_get_params(
['help' => false, 'method' => null],
['h' => 'help']);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
// TODO: MDL-71421 - Remove the openssl alternative once sodium becomes a requirement in Moodle 4.2.
if ($options['help']) {
echo "Generate secure key
This script manually creates a secure key within the secret data root folder (configured in
config.php as \$CFG->secretdataroot). You must run it using an account with access to write
to that folder.
In normal use Moodle automatically creates the key; this script is intended when setting up
a new Moodle system, for cases where the secure folder is not on shared storage and the key
may be manually installed on multiple servers.
Options:
-h, --help Print out this help
--method <method> Generate key for specified encryption method instead of default.
* sodium
* openssl-aes-256-ctr
Example:
php admin/cli/generate_key.php
";
exit;
}
$method = $options['method'];
if (encryption::key_exists($method)) {
echo 'Key already exists: ' . encryption::get_key_file($method) . "\n";
exit;
}
// Creates key with default permissions (no chmod).
echo "Generating key...\n";
encryption::create_key($method, false);
echo "\nKey created: " . encryption::get_key_file($method) . "\n\n";
echo "If the key folder is not shared storage, then key files should be copied to all servers.\n";
+7
View File
@@ -56,6 +56,7 @@ Options:
--agree-license Indicates agreement with software license.
--fullname=STRING Name of the site
--shortname=STRING Name of the site
--summary=STRING The summary to be displayed on the front page
-h, --help Print out this help
Example:
@@ -96,6 +97,7 @@ list($options, $unrecognized) = cli_get_params(
'adminemail' => '',
'fullname' => '',
'shortname' => '',
'summary' => '',
'agree-license' => false,
'help' => false
),
@@ -104,6 +106,11 @@ list($options, $unrecognized) = cli_get_params(
)
);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
// We show help text even if tables are installed.
if ($options['help']) {
echo $help;
+8 -8
View File
@@ -119,7 +119,7 @@ if (!empty($options['collation'])) {
if ($dbcollation->value !== $collation || $dbcharset->value !== $charset) {
// Try to convert the DB.
echo "Converting database to '$collation' for $CFG->wwwroot:\n";
$sql = "ALTER DATABASE $CFG->dbname DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation";
$sql = "ALTER DATABASE `$CFG->dbname` DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation";
try {
$DB->change_database_structure($sql);
} catch (exception $e) {
@@ -146,7 +146,7 @@ if (!empty($options['collation'])) {
} else {
try {
$DB->change_database_structure("ALTER TABLE $table->name CONVERT TO CHARACTER SET $charset COLLATE $collation");
$DB->change_database_structure("ALTER TABLE `$table->name` CONVERT TO CHARACTER SET $charset COLLATE $collation");
echo "CONVERTED\n";
$converted++;
} catch (ddl_exception $e) {
@@ -163,7 +163,7 @@ if (!empty($options['collation'])) {
}
}
$sql = "SHOW FULL COLUMNS FROM $table->name WHERE collation IS NOT NULL";
$sql = "SHOW FULL COLUMNS FROM `$table->name` WHERE collation IS NOT NULL";
$rs2 = $DB->get_recordset_sql($sql);
foreach ($rs2 as $column) {
$column = (object)array_change_key_case((array)$column, CASE_LOWER);
@@ -181,7 +181,7 @@ if (!empty($options['collation'])) {
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
$default = (!is_null($column->default) and $column->default !== '') ? "DEFAULT '$column->default'" : '';
// primary, unique and inc are not supported for texts
$sql = "ALTER TABLE $table->name
$sql = "ALTER TABLE `$table->name`
MODIFY COLUMN $column->field $column->type
CHARACTER SET $charset
COLLATE $collation $notnull $default";
@@ -192,11 +192,11 @@ if (!empty($options['collation'])) {
$default = !is_null($column->default) ? "DEFAULT '$column->default'" : '';
if ($rowformat != '') {
$sql = "ALTER TABLE $table->name $rowformat";
$sql = "ALTER TABLE `$table->name` $rowformat";
$DB->change_database_structure($sql);
}
$sql = "ALTER TABLE $table->name
$sql = "ALTER TABLE `$table->name`
MODIFY COLUMN $column->field $column->type
CHARACTER SET $charset
COLLATE $collation $notnull $default";
@@ -315,8 +315,8 @@ function mysql_set_row_format($tablename, $charset, $collation, $engine) {
if ($rs->row_format == 'Compact' || $rs->row_format == 'Redundant') {
$rowformat = $DB->get_row_format_sql($engine, $collation);
// Try to convert to compressed format and then try updating the collation again.
$DB->change_database_structure("ALTER TABLE $tablename $rowformat");
$DB->change_database_structure("ALTER TABLE $tablename CONVERT TO CHARACTER SET $charset COLLATE $collation");
$DB->change_database_structure("ALTER TABLE `$tablename` $rowformat");
$DB->change_database_structure("ALTER TABLE `$tablename` CONVERT TO CHARACTER SET $charset COLLATE $collation");
} else {
// Row format may not be the problem. Can not diagnose problem. Send fail reply.
return false;
+2 -2
View File
@@ -158,7 +158,7 @@ if (!empty($options['info'])) {
}
foreach ($fixtables as $table) {
$DB->change_database_structure("ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed");
$DB->change_database_structure("ALTER TABLE `{$prefix}$table` ROW_FORMAT=Compressed");
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT) . " ... Compressed\n";
}
@@ -189,7 +189,7 @@ if (!empty($options['info'])) {
echo "SET GLOBAL innodb_file_per_table=1;\n";
echo "SET GLOBAL innodb_file_format=Barracuda;\n";
foreach ($fixtables as $table) {
echo "ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed;\n";
echo "ALTER TABLE `{$prefix}$table` ROW_FORMAT=Compressed;\n";
}
echo "\n";
exit(0);
+12
View File
@@ -39,6 +39,8 @@ Options:
--purge-missing Uninstall all missing from disk plugins.
--plugins=<plugin name> A comma separated list of plugins to be uninstalled. E.g. mod_assign,mod_forum
--run Execute uninstall. If this option is not set, then the script will be run in a dry mode.
--showsql Show sql queries before they are executed.
--showdebugging Show developer level debugging information.
Examples:
@@ -72,6 +74,8 @@ list($options, $unrecognised) = cli_get_params([
'purge-missing' => false,
'plugins' => false,
'run' => false,
'showsql' => false,
'showdebugging' => false,
], [
'h' => 'help'
]);
@@ -86,6 +90,14 @@ if ($options['help']) {
exit(0);
}
if ($options['showdebugging']) {
set_debugging(DEBUG_DEVELOPER, true);
}
if ($options['showsql']) {
$DB->set_debug(true);
}
$pluginman = core_plugin_manager::instance();
$plugininfo = $pluginman->get_plugins();
+9
View File
@@ -135,6 +135,15 @@ if (!$envstatus) {
exit(1);
}
// Make sure there are no files left over from previous versions.
if (upgrade_stale_php_files_present()) {
cli_problem(get_string('upgradestalefiles', 'admin'));
// Stale file info contains HTML elements which aren't suitable for CLI.
$upgradestalefilesinfo = get_string('upgradestalefilesinfo', 'admin', get_docs_url('Upgrading'));
cli_error(strip_tags($upgradestalefilesinfo));
}
// Test plugin dependencies.
$failed = array();
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed, $CFG->branch)) {
+387
View File
@@ -2815,6 +2815,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.1.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2996,6 +2997,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.2.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -3161,6 +3163,11 @@
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_igbinary322_version" level="optional">
<FEEDBACK>
<ON_CHECK message="igbinary322buggyversion" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.10" requires="3.5">
@@ -3177,6 +3184,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.2.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -3342,6 +3350,385 @@
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_igbinary322_version" level="optional">
<FEEDBACK>
<ON_CHECK message="igbinary322buggyversion" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.11" requires="3.6">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="9.6" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.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="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</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_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_CHECKS>
</MOODLE>
<MOODLE version="4.0" requires="3.6">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="10" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.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="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</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_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+9
View File
@@ -119,10 +119,19 @@ if (($form = data_submitted()) && confirm_sesskey()) {
// Save processors enabled/disabled status.
foreach ($allprocessors as $processor) {
$enabled = isset($form->{$processor->name});
if ($enabled != $processor->enabled) {
add_to_config_log($processor->name, $processor->enabled, $enabled, 'core');
}
\core_message\api::update_processor_status($processor, $enabled);
}
foreach ($newpreferences as $name => $value) {
$old = isset($preferences->$name) ? $preferences->$name : '';
if ($old != $value) {
add_to_config_log($name, $old, $value, 'core');
}
set_config($name, $value, 'message');
}
$transaction->allow_commit();
+6 -4
View File
@@ -34,11 +34,12 @@ $error = optional_param('error', '', PARAM_RAW);
if ($error) {
$message = optional_param('error_description', '', PARAM_RAW);
if ($message) {
print_error($message);
$SESSION->loginerrormsg = $message;
redirect(new moodle_url(get_login_url()));
} else {
print_error($error);
$SESSION->loginerrormsg = $error;
redirect(new moodle_url(get_login_url()));
}
die();
}
// The authorization code generated by the authorization server.
@@ -53,5 +54,6 @@ if (isset($params['sesskey']) and confirm_sesskey($params['sesskey'])) {
$redirecturl->param('oauth2code', $code);
redirect($redirecturl);
} else {
print_error('invalidsesskey');
$SESSION->loginerrormsg = get_string('invalidsesskey', 'error');
redirect(new moodle_url(get_login_url()));
}
+7 -1
View File
@@ -52,8 +52,14 @@ if ($data = $form->get_data()) {
$message = get_string('purgecachesfinished', 'admin');
}
// Redirect and/or show notification message confirming cache(s) were purged.
if (isset($message)) {
redirect($returnurl, $message);
if (!$PAGE->url->compare($returnurl, URL_MATCH_BASE)) {
redirect($returnurl, $message);
}
// We are already on the purge caches page, add the notification.
\core\notification::add($message, \core\output\notification::NOTIFY_INFO);
}
// Otherwise, show a form to actually purge the caches.
+27 -16
View File
@@ -220,7 +220,7 @@ class core_admin_renderer extends plugin_renderer_base {
$output .= $this->container_end();
}
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get', true);
$button->class = 'continuebutton';
$output .= $this->render($button);
$output .= $this->footer();
@@ -1616,12 +1616,18 @@ class core_admin_renderer extends plugin_renderer_base {
$plugininfo = $pluginman->get_plugins();
$numtotal = $numextension = $numupdatable = 0;
$numtotal = $numextension = $numupdatable = $numinstallable = 0;
foreach ($plugininfo as $type => $plugins) {
foreach ($plugins as $name => $plugin) {
if ($plugin->available_updates()) {
if ($res = $plugin->available_updates()) {
$numupdatable++;
foreach ($res as $updateinfo) {
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason, false)) {
$numinstallable++;
break;
}
}
}
if ($plugin->get_status() === core_plugin_manager::PLUGIN_STATUS_MISSING) {
continue;
@@ -1664,16 +1670,13 @@ class core_admin_renderer extends plugin_renderer_base {
$out .= $this->output->heading(get_string('overviewext', 'core_plugin'), 3);
}
if ($numupdatable) {
$installableupdates = $pluginman->filter_installable($pluginman->available_updates());
if ($installableupdates) {
$out .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', count($installableupdates)),
'post',
array('class' => 'singlebutton updateavailableinstallall')
);
}
if ($numinstallable) {
$out .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', $numinstallable),
'post',
array('class' => 'singlebutton updateavailableinstallall')
);
}
$out .= html_writer::div($infoall, 'info info-all').
@@ -1907,7 +1910,7 @@ class core_admin_renderer extends plugin_renderer_base {
'infos'
);
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason)) {
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason, false)) {
$box .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdate' => $updateinfo->component,
'installupdateversion' => $updateinfo->version)),
@@ -2127,8 +2130,16 @@ class core_admin_renderer extends plugin_renderer_base {
$output .= $this->container_start('upgradekeyreq');
$output .= $this->heading(get_string('upgradekeyreq', 'core_admin'));
$output .= html_writer::start_tag('form', array('method' => 'POST', 'action' => $url));
$output .= html_writer::empty_tag('input', array('name' => 'upgradekey', 'type' => 'password'));
$output .= html_writer::empty_tag('input', array('value' => get_string('submit'), 'type' => 'submit'));
$output .= html_writer::empty_tag('input', [
'name' => 'upgradekey',
'type' => 'password',
'class' => 'form-control w-auto',
]);
$output .= html_writer::empty_tag('input', [
'type' => 'submit',
'value' => get_string('submit'),
'class' => 'btn btn-primary mt-3',
]);
$output .= html_writer::end_tag('form');
$output .= $this->container_end();
$output .= $this->footer();
+2 -1
View File
@@ -271,7 +271,8 @@ if ($roleid) {
foreach ($assignableroles as $roleid => $notused) {
$roleusers = '';
if (0 < $assigncounts[$roleid] && $assigncounts[$roleid] <= MAX_USERS_TO_LIST_PER_ROLE) {
$userfields = 'u.id, u.username, ' . get_all_user_name_fields(true, 'u');
$userfieldsapi = \core_user\fields::for_name();
$userfields = 'u.id, u.username' . $userfieldsapi->get_sql('u')->selects;
$roleusers = get_role_users($roleid, $context, false, $userfields);
if (!empty($roleusers)) {
$strroleusers = array();
+15
View File
@@ -144,5 +144,20 @@ if ($hassiteconfig && \core_analytics\manager::is_analytics_enabled()) {
$settings->add(new admin_setting_configduration('analytics/modeltimelimit', new lang_string('modeltimelimit', 'analytics'),
new lang_string('modeltimelimitinfo', 'analytics'), 20 * MINSECS));
$options = array(
0 => new lang_string('neverdelete', 'analytics'),
1000 => new lang_string('numdays', '', 1000),
365 => new lang_string('numdays', '', 365),
180 => new lang_string('numdays', '', 180),
150 => new lang_string('numdays', '', 150),
120 => new lang_string('numdays', '', 120),
90 => new lang_string('numdays', '', 90),
60 => new lang_string('numdays', '', 60),
35 => new lang_string('numdays', '', 35));
$settings->add(new admin_setting_configselect('analytics/calclifetime',
new lang_string('calclifetime', 'analytics'),
new lang_string('configlcalclifetime', 'analytics'), 35, $options));
}
}
-1
View File
@@ -269,7 +269,6 @@ preferences,moodle|/user/preferences.php|t/preferences',
$setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1);
$setting->set_updatedcallback('js_reset_all_caches');
$temp->add($setting);
$temp->add(new admin_setting_configcheckbox('modchooserdefault', new lang_string('modchooserdefault', 'admin'), new lang_string('configmodchooserdefault', 'admin'), 1));
$ADMIN->add('appearance', $temp);
// Link to tag management interface.
+4 -23
View File
@@ -57,20 +57,14 @@ if (($hassiteconfig || has_any_capability(array(
new lang_string('badgesalt_desc', 'badges'),
'badges' . $SITE->timecreated, PARAM_ALPHANUM));
$backpacks = badges_get_site_backpacks();
$choices = array();
$defaultchoice = 0;
foreach ($backpacks as $backpack) {
$choices[$backpack->id] = $backpack->backpackweburl;
if ($backpack->backpackweburl == BADGRIO_BACKPACKWEBURL) {
$defaultchoice = $backpack->id;
}
}
$globalsettings->add(new admin_setting_configcheckbox('badges_allowcoursebadges',
new lang_string('allowcoursebadges', 'badges'),
new lang_string('allowcoursebadges_desc', 'badges'), 1));
$globalsettings->add(new admin_setting_configcheckbox('badges_allowexternalbackpack',
new lang_string('allowexternalbackpack', 'badges'),
new lang_string('allowexternalbackpack_desc', 'badges'), 1));
$ADMIN->add('badges', $globalsettings);
$ADMIN->add('badges',
@@ -97,19 +91,6 @@ if (($hassiteconfig || has_any_capability(array(
array('moodle/badges:createbadge'), empty($CFG->enablebadges)
)
);
$backpacksettings = new admin_settingpage('backpacksettings', new lang_string('backpacksettings', 'badges'),
array('moodle/badges:manageglobalsettings'), empty($CFG->enablebadges));
$backpacksettings->add(new admin_setting_configcheckbox('badges_allowexternalbackpack',
new lang_string('allowexternalbackpack', 'badges'),
new lang_string('allowexternalbackpack_desc', 'badges'), 1));
$backpacksettings->add(new admin_setting_configselect('badges_site_backpack',
new lang_string('sitebackpack', 'badges'),
new lang_string('sitebackpack_help', 'badges'),
$defaultchoice, $choices));
$ADMIN->add('badges', $backpacksettings);
$ADMIN->add('badges',
new admin_externalpage('managebackpacks',
+24
View File
@@ -139,6 +139,13 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
new lang_string('coursehelpshowgrades'), 1, array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
$temp->add(new admin_setting_configselect('moodlecourse/showreports', new lang_string('showreports'), '', 0,
array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
$temp->add(new admin_setting_configselect('moodlecourse/showactivitydates',
new lang_string('showactivitydates'),
new lang_string('showactivitydates_help'), 1, [
0 => new lang_string('no'),
1 => new lang_string('yes')
]
));
// Files and uploads.
$temp->add(new admin_setting_heading('filesanduploadshdr', new lang_string('filesanduploads'), ''));
@@ -163,6 +170,15 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', new lang_string('completion', 'completion'),
new lang_string('enablecompletion_help', 'completion'), 1, array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
// Display completion conditions.
$temp->add(new admin_setting_configselect('moodlecourse/showcompletionconditions',
new lang_string('showcompletionconditions', 'completion'),
new lang_string('showcompletionconditions_help', 'completion'), 1, [
0 => new lang_string('no'),
1 => new lang_string('yes')
]
));
// Groups.
$temp->add(new admin_setting_heading('groups', new lang_string('groups', 'group'), ''));
$choices = array();
@@ -327,6 +343,11 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
// Import defaults section.
$temp->add(new admin_setting_heading('importsettings', new lang_string('importsettings', 'backup'), ''));
$temp->add(new admin_setting_configcheckbox_with_lock(
'backup/backup_import_permissions',
new lang_string('generalpermissions', 'backup'),
new lang_string('configgeneralpermissions', 'backup'),
array('value' => 0, 'locked' => 0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
@@ -501,6 +522,9 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_role_assignments',
new lang_string('generalroleassignments', 'backup'),
new lang_string('configrestoreroleassignments', 'backup'), array('value' => 1, 'locked' => 0)));
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_permissions',
new lang_string('generalpermissions', 'backup'),
new lang_string('configrestorepermissions', 'backup'), array('value' => 1, 'locked' => 0)));
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_activities',
new lang_string('generalactivities', 'backup'),
new lang_string('configrestoreactivities', 'backup'), array('value' => 1, 'locked' => 0)));
+2 -1
View File
@@ -38,7 +38,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
// "debugging" settingpage
$temp = new admin_settingpage('debugging', new lang_string('debugging', 'admin'));
$temp->add(new admin_setting_special_debug());
$temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'), new lang_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
$temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'),
new lang_string('configdebugdisplay', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('perfdebug', new lang_string('perfdebug', 'admin'), new lang_string('configperfdebug', 'admin'), '7', '15', '7'));
$temp->add(new admin_setting_configcheckbox('debugstringids', new lang_string('debugstringids', 'admin'), new lang_string('debugstringids_desc', 'admin'), 0));
$temp->add(new admin_setting_configselect('debugsqltrace',
-49
View File
@@ -401,55 +401,6 @@ if ($hassiteconfig) {
/** @var \core\plugininfo\repository $plugin */
$plugin->load_settings($ADMIN, 'repositorysettings', $hassiteconfig);
}
/// Web services
$ADMIN->add('modules', new admin_category('webservicesettings', new lang_string('webservices', 'webservice')));
/// overview page
$temp = new admin_settingpage('webservicesoverview', new lang_string('webservicesoverview', 'webservice'));
$temp->add(new admin_setting_webservicesoverview());
$ADMIN->add('webservicesettings', $temp);
//API documentation
$ADMIN->add('webservicesettings', new admin_externalpage('webservicedocumentation', new lang_string('wsdocapi', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/documentation.php", 'moodle/site:config', false));
/// manage service
$temp = new admin_settingpage('externalservices', new lang_string('externalservices', 'webservice'));
$temp->add(new admin_setting_heading('manageserviceshelpexplaination', new lang_string('information', 'webservice'), new lang_string('servicehelpexplanation', 'webservice')));
$temp->add(new admin_setting_manageexternalservices());
$ADMIN->add('webservicesettings', $temp);
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', new lang_string('editaservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service.php", 'moodle/site:config', true));
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', new lang_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php", 'moodle/site:config', true));
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', new lang_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_users.php", 'moodle/site:config', true));
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusersettings', new lang_string('serviceusersettings', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_user_settings.php", 'moodle/site:config', true));
/// manage protocol page link
$temp = new admin_settingpage('webserviceprotocols', new lang_string('manageprotocols', 'webservice'));
$temp->add(new admin_setting_managewebserviceprotocols());
if (empty($CFG->enablewebservices)) {
$temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
}
// We cannot use $OUTPUT this early, doing so means that we lose the ability
// to set the page layout on all admin pages.
// $wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key');
$url = new moodle_url(get_docs_url('How_to_get_a_security_key'));
$wsdoclink = html_writer::tag('a', new lang_string('supplyinfo', 'webservice'), array('href'=>$url));
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', new lang_string('enablewsdocumentation',
'admin'), new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
$ADMIN->add('webservicesettings', $temp);
/// links to protocol pages
$plugins = core_plugin_manager::instance()->get_plugins_of_type('webservice');
core_collator::asort_objects_by_property($plugins, 'displayname');
foreach ($plugins as $plugin) {
/** @var \core\plugininfo\webservice $plugin */
$plugin->load_settings($ADMIN, 'webservicesettings', $hassiteconfig);
}
/// manage token page link
$ADMIN->add('webservicesettings', new admin_externalpage('addwebservicetoken', new lang_string('managetokens', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/tokens.php", 'moodle/site:config', true));
$temp = new admin_settingpage('webservicetokens', new lang_string('managetokens', 'webservice'));
$temp->add(new admin_setting_managewebservicetokens());
if (empty($CFG->enablewebservices)) {
$temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
}
$ADMIN->add('webservicesettings', $temp);
}
// Question type settings
+81
View File
@@ -38,6 +38,8 @@ if ($hassiteconfig) {
new lang_string('pathtodot_help', 'admin'), ''));
$temp->add(new admin_setting_configexecutable('pathtogs', new lang_string('pathtogs', 'admin'),
new lang_string('pathtogs_help', 'admin'), '/usr/bin/gs'));
$temp->add(new admin_setting_configexecutable('pathtopdftoppm', new lang_string('pathtopdftoppm', 'admin'),
new lang_string('pathtopdftoppm_help', 'admin'), ''));
$temp->add(new admin_setting_configexecutable('pathtopython', new lang_string('pathtopython', 'admin'),
new lang_string('pathtopythondesc', 'admin'), ''));
$ADMIN->add('server', $temp);
@@ -73,6 +75,22 @@ if ($hassiteconfig) {
$temp->add(new admin_setting_configduration('sessiontimeout', new lang_string('sessiontimeout', 'admin'),
new lang_string('configsessiontimeout', 'admin'), 8 * 60 * 60));
$sessiontimeoutwarning = new admin_setting_configduration('sessiontimeoutwarning',
new lang_string('sessiontimeoutwarning', 'admin'),
new lang_string('configsessiontimeoutwarning', 'admin'), 20 * 60);
$sessiontimeoutwarning->set_validate_function(function(int $value): string {
global $CFG;
// Check sessiontimeoutwarning is less than sessiontimeout.
if ($CFG->sessiontimeout <= $value) {
return get_string('configsessiontimeoutwarningcheck', 'admin');
} else {
return '';
}
});
$temp->add($sessiontimeoutwarning);
$temp->add(new admin_setting_configtext('sessioncookie', new lang_string('sessioncookie', 'admin'),
new lang_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
$temp->add(new admin_setting_configtext('sessioncookiepath', new lang_string('sessioncookiepath', 'admin'),
@@ -528,4 +546,67 @@ if ($hassiteconfig) {
new lang_string('updatenotifybuilds_desc', 'core_admin'), 0));
$ADMIN->add('server', $temp);
}
// Web services.
$ADMIN->add('server', new admin_category('webservicesettings', new lang_string('webservices', 'webservice')));
// Web services > Overview.
$temp = new admin_settingpage('webservicesoverview', new lang_string('webservicesoverview', 'webservice'));
$temp->add(new admin_setting_webservicesoverview());
$ADMIN->add('webservicesettings', $temp);
// Web services > API documentation.
$ADMIN->add('webservicesettings', new admin_externalpage('webservicedocumentation', new lang_string('wsdocapi', 'webservice'),
"{$CFG->wwwroot}/{$CFG->admin}/webservice/documentation.php", 'moodle/site:config', false));
// Web services > External services.
$temp = new admin_settingpage('externalservices', new lang_string('externalservices', 'webservice'));
$temp->add(new admin_setting_heading('manageserviceshelpexplaination', new lang_string('information', 'webservice'),
new lang_string('servicehelpexplanation', 'webservice')));
$temp->add(new admin_setting_manageexternalservices());
$ADMIN->add('webservicesettings', $temp);
$ADMIN->add('webservicesettings', new admin_externalpage('externalservice', new lang_string('editaservice', 'webservice'),
"{$CFG->wwwroot}/{$CFG->admin}/webservice/service.php", 'moodle/site:config', true));
$ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions',
new lang_string('externalservicefunctions', 'webservice'), "{$CFG->wwwroot}/{$CFG->admin}/webservice/service_functions.php",
'moodle/site:config', true));
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers',
new lang_string('externalserviceusers', 'webservice'), "{$CFG->wwwroot}/{$CFG->admin}/webservice/service_users.php",
'moodle/site:config', true));
$ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusersettings',
new lang_string('serviceusersettings', 'webservice'), "{$CFG->wwwroot}/{$CFG->admin}/webservice/service_user_settings.php",
'moodle/site:config', true));
// Web services > Manage protocols.
$temp = new admin_settingpage('webserviceprotocols', new lang_string('manageprotocols', 'webservice'));
$temp->add(new admin_setting_managewebserviceprotocols());
if (empty($CFG->enablewebservices)) {
$temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
}
// We cannot use $OUTPUT->doc_link() this early, we would lose the ability to set the page layout on all admin pages.
$url = new moodle_url(get_docs_url('How_to_get_a_security_key'));
$wsdoclink = html_writer::link($url, new lang_string('supplyinfo', 'webservice'), ['target' => '_blank']);
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', new lang_string('enablewsdocumentation', 'admin'),
new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
$ADMIN->add('webservicesettings', $temp);
$plugins = core_plugin_manager::instance()->get_plugins_of_type('webservice');
core_collator::asort_objects_by_property($plugins, 'displayname');
foreach ($plugins as $plugin) {
/** @var \core\plugininfo\webservice $plugin */
$plugin->load_settings($ADMIN, 'webservicesettings', $hassiteconfig);
}
// Web services > Manage tokens.
$ADMIN->add('webservicesettings', new admin_externalpage('webservicetokens', new lang_string('managetokens', 'webservice'),
new moodle_url('/admin/webservice/tokens.php')));
}
+39 -19
View File
@@ -87,6 +87,14 @@ if ($hassiteconfig
$choices['1'] = new lang_string('trackforumsyes');
$temp->add(new admin_setting_configselect('defaultpreference_trackforums', new lang_string('trackforums'),
'', 0, $choices));
$choices = [];
$choices[\core_contentbank\content::VISIBILITY_PUBLIC] = new lang_string('visibilitychoicepublic', 'core_contentbank');
$choices[\core_contentbank\content::VISIBILITY_UNLISTED] = new lang_string('visibilitychoiceunlisted', 'core_contentbank');
$temp->add(new admin_setting_configselect('defaultpreference_core_contentbank_visibility',
new lang_string('visibilitypref', 'core_contentbank'),
new lang_string('visibilitypref_help', 'core_contentbank'),
\core_contentbank\content::VISIBILITY_PUBLIC, $choices));
}
$ADMIN->add('accounts', $temp);
@@ -188,12 +196,6 @@ if ($hassiteconfig
'country' => new lang_string('country'),
'moodlenetprofile' => new lang_string('moodlenetprofile', 'user'),
'timezone' => new lang_string('timezone'),
'webpage' => new lang_string('webpage'),
'icqnumber' => new lang_string('icqnumber'),
'skypeid' => new lang_string('skypeid'),
'yahooid' => new lang_string('yahooid'),
'aimid' => new lang_string('aimid'),
'msnid' => new lang_string('msnid'),
'firstaccess' => new lang_string('firstaccess'),
'lastaccess' => new lang_string('lastaccess'),
'lastip' => new lang_string('lastip'),
@@ -206,21 +208,39 @@ if ($hassiteconfig
// with moodle/site:viewuseridentity).
// Options include fields from the user table that might be helpful to
// distinguish when adding or listing users ('I want to add the John
// Smith from Science faculty').
// Custom user profile fields are not currently supported.
// Smith from Science faculty') and any custom profile fields.
$temp->add(new admin_setting_configmulticheckbox('showuseridentity',
new lang_string('showuseridentity', 'admin'),
new lang_string('showuseridentity_desc', 'admin'), array('email' => 1), array(
'username' => new lang_string('username'),
'idnumber' => new lang_string('idnumber'),
'email' => new lang_string('email'),
'phone1' => new lang_string('phone1'),
'phone2' => new lang_string('phone2'),
'department' => new lang_string('department'),
'institution' => new lang_string('institution'),
'city' => new lang_string('city'),
'country' => new lang_string('country'),
)));
new lang_string('showuseridentity_desc', 'admin'), ['email' => 1],
function() {
global $CFG;
require_once($CFG->dirroot.'/user/profile/lib.php');
// Basic fields available in user table.
$fields = [
'username' => new lang_string('username'),
'idnumber' => new lang_string('idnumber'),
'email' => new lang_string('email'),
'phone1' => new lang_string('phone1'),
'phone2' => new lang_string('phone2'),
'department' => new lang_string('department'),
'institution' => new lang_string('institution'),
'city' => new lang_string('city'),
'country' => new lang_string('country'),
];
// Custom profile fields.
$profilefields = profile_get_custom_fields();
foreach ($profilefields as $field) {
// Only reasonable-length text fields can be used as identity fields.
if ($field->param2 > 255 || $field->datatype != 'text') {
continue;
}
$fields['profile_field_' . $field->shortname] = $field->name . ' *';
}
return $fields;
}));
$setting = new admin_setting_configtext('fullnamedisplay', new lang_string('fullnamedisplay', 'admin'),
new lang_string('configfullnamedisplay', 'admin'), 'language', PARAM_TEXT, 50);
$setting->set_force_ltr(true);
+1
View File
@@ -32,6 +32,7 @@ $result = optional_param('result', null, PARAM_INT);
$pageurl = new \moodle_url('/admin/tasklogs.php');
$pageurl->param('filter', $filter);
$pageurl->param('result', $result);
$PAGE->set_url($pageurl);
$PAGE->set_context(context_system::instance());
@@ -0,0 +1,64 @@
{{!
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/>.
}}
{{!
@template core_admin/admin_setting_encryptedpassword
Admin encrypted password template.
Context variables required for this template:
* name - form element name
* set - whether it is set or empty
* id - element id
Example context (json):
{
"name": "test",
"id": "test0",
"set": true
}
}}
<div class="core_admin_encryptedpassword" data-encryptedpasswordid="{{ id }}"
{{#novalue}}data-novalue="y"{{/novalue}}>
{{#set}}
<span>{{# str }} encryptedpassword_set, admin {{/ str }}</span>
{{/set}}
{{^set}}
<a href="#" title="{{# str }} encryptedpassword_edit, admin {{/ str }}">
<span>{{# str }} novalueclicktoset, form {{/ str }}</span>
{{# pix }} t/passwordunmask-edit, core, {{# str }} passwordunmaskedithint, form {{/ str }}{{/ pix }}
</a>
{{/set}}
<input style="display: none" type="password" name="{{name}}" disabled>
{{!
Using buttons instead of links here allows them to be connected to the label, so the button
works if you click the label.
}}
{{#set}}
<button type="button" id="{{id}}" title="{{# str }} encryptedpassword_edit, admin {{/ str }}" class="btn btn-link" data-editbutton>
{{# pix }} t/passwordunmask-edit, core, {{/ pix }}
</button>
{{/set}}
<button type="button" style="display: none" title="{{# str }} cancel {{/ str }}" class="btn btn-link" data-cancelbutton>
<i class="icon fa fa-times"></i>
</button>
</div>
{{#js}}
require(['core_form/encryptedpassword'], function(encryptedpassword) {
new encryptedpassword.EncryptedPassword("{{ id }}");
});
{{/js}}
+12 -6
View File
@@ -53,11 +53,8 @@ class behat_admin extends behat_base {
}
foreach ($data as $label => $value) {
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', [get_string('administrationsite')]);
// Search by label.
$this->execute('behat_forms::i_set_the_field_to', [get_string('search'), $label]);
$this->execute("behat_forms::press_button", get_string('search', 'admin'));
// Navigate straight to the search results fo rthis label.
$this->execute('behat_general::i_visit', ["/admin/search.php?query=" . urlencode($label)]);
// Admin settings does not use the same DOM structure than other moodle forms
// but we also need to use lib/behat/form_field/* to deal with the different moodle form elements.
@@ -89,7 +86,7 @@ class behat_admin extends behat_base {
}
/**
* Sets the specified site settings. A table with | config | value | (optional)plugin | is expected.
* Sets the specified site settings. A table with | config | value | (optional)plugin | (optional)encrypted | is expected.
*
* @Given /^the following config values are set as admin:$/
* @param TableNode $table
@@ -103,11 +100,20 @@ class behat_admin extends behat_base {
foreach ($data as $config => $value) {
// Default plugin value is null.
$plugin = null;
$encrypted = false;
if (is_array($value)) {
$plugin = $value[1];
if (array_key_exists(2, $value)) {
$encrypted = $value[2] === 'encrypted';
}
$value = $value[0];
}
if ($encrypted) {
$value = \core\encryption::encrypt($value);
}
set_config($config, $value, $plugin);
}
}
+59
View File
@@ -0,0 +1,59 @@
@core @core_admin
Feature: An administrator can browse user accounts
In order to find the user accounts I am looking for
As an admin
I can browse users and see their basic information
Background:
Given the following "custom profile fields" exist:
| datatype | shortname | name |
| text | frog | Favourite frog |
And the following "users" exist:
| username | firstname | lastname | email | department | profile_field_frog | firstnamephonetic |
| user1 | User | One | one@example.com | Attack | Kermit | Yewzer |
| user2 | User | Two | two@example.com | Defence | Tree | Yoozare |
And I log in as "admin"
Scenario: User accounts display default fields
When I navigate to "Users > Accounts > Browse list of users" in site administration
# Name field always present, email field is default for showidentity.
Then the following should exist in the "users" table:
| First name / Surname | Email address |
| User One | one@example.com |
| User Two | two@example.com |
# Should not see other identity fields or non-default name fields.
And I should not see "Department" in the "table" "css_element"
And I should not see "Attack"
And I should not see "Favourite frog" in the "table" "css_element"
And I should not see "Kermit"
And I should not see "First name - phonetic" in the "table" "css_element"
And I should not see "Yoozare"
Scenario: User accounts with extra name fields
Given the following config values are set as admin:
| alternativefullnameformat | firstnamephonetic lastname |
When I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "users" table:
| First name - phonetic / Surname | Email address |
| Yewzer One | one@example.com |
| Yoozare Two | two@example.com |
Scenario: User accounts with specified identity fields
Given the following config values are set as admin:
| showuseridentity | department,profile_field_frog |
When I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "users" table:
| First name / Surname | Favourite frog | Department |
| User One | Kermit | Attack |
| User Two | Tree | Defence |
And I should not see "Email address" in the "table" "css_element"
And I should not see "one@example.com"
Scenario: Sort user accounts by custom profile field
Given the following config values are set as admin:
| showuseridentity | profile_field_frog |
When I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "Favourite frog"
Then "Kermit" "text" should appear before "Tree" "text"
And I follow "Favourite frog"
Then "Tree" "text" should appear before "Kermi" "text"
+27 -6
View File
@@ -5,12 +5,16 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
I need to filter the users account list using different filter
Background:
Given the following "users" exist:
| username | firstname | lastname | email | auth | confirmed | lastip | institution | department |
| user1 | User | One | one@example.com | manual | 0 | 127.0.1.1 | moodle | red |
| user2 | User | Two | two@example.com | ldap | 1 | 0.0.0.0 | moodle | blue |
| user3 | User | Three | three@example.com | manual | 1 | 0.0.0.0 | | |
| user4 | User | Four | four@example.com | ldap | 0 | 127.0.1.2 | | |
Given the following "custom profile fields" exist:
| datatype | shortname | name |
| text | frog | Favourite frog |
| text | undead | Type of undead |
And the following "users" exist:
| username | firstname | lastname | email | auth | confirmed | lastip | institution | department | profile_field_frog | profile_field_undead |
| user1 | User | One | one@example.com | manual | 0 | 127.0.1.1 | moodle | red | Kermit | |
| user2 | User | Two | two@example.com | ldap | 1 | 0.0.0.0 | moodle | blue | Mr Toad | Zombie |
| user3 | User | Three | three@example.com | manual | 1 | 0.0.0.0 | | | | |
| user4 | User | Four | four@example.com | ldap | 0 | 127.0.1.2 | | | | |
And the following "cohorts" exist:
| name | idnumber |
| Cohort 1 | CH1 |
@@ -116,3 +120,20 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
And I press "Add filter"
And I should see "User One"
And I should not see "User Two"
Scenario: Filter users by custom profile field (specific or any)
When I set the field "id_profile_fld" to "Favourite frog"
And I set the field "id_profile" to "Kermit"
And I press "Add filter"
Then I should see "User One"
And I should not see "User Two"
And I should not see "User Three"
And I should not see "User Four"
And I press "Remove all filters"
And I set the field "id_profile_fld" to "any field"
And I set the field "id_profile" to "Zombie"
And I press "Add filter"
And I should see "User Two"
And I should not see "User One"
And I should not see "User Three"
And I should not see "User Four"
+65 -16
View File
@@ -1,27 +1,76 @@
@core @core_admin
Feature: Manage tokens
In order to manage webservice usage
Feature: Manage external services tokens
In order to manage external service usage
As an admin
I need to be able to create and delete tokens
I need to be able to create, filter and delete tokens
Background:
Given the following "users" exist:
| username | password | firstname | lastname |
| testuser | testuser | Joe | Bloggs |
| testuser2 | testuser2 | TestFirstname | TestLastname |
| username | password | firstname | lastname |
| user1 | user1 | Firstname1 | Lastname1 |
| user2 | user2 | Firstname2 | Lastname2 |
| user3 | user3 | Firstname3 | Lastname3 |
| user4 | user4 | Firstname4 | Lastname4 |
And I change window size to "small"
And I log in as "admin"
And I am on site homepage
@javascript
Scenario: Add & delete a token
Given I navigate to "Plugins > Web services > Manage tokens" in site administration
And I follow "Add"
And I set the field "User" to "Joe Bloggs"
Scenario: Add a token to user identified by name and then delete that token
Given I log in as "admin"
And I am on site homepage
And I navigate to "Server > Web services > Manage tokens" in site administration
And I press "Create token"
And I set the field "User" to "Firstname1 Lastname1"
And I set the field "Service" to "Moodle mobile web service"
And I set the field "IP restriction" to "127.0.0.1"
When I press "Save changes"
Then I should see "Joe Bloggs"
And I should see "127.0.0.1"
And I follow "Delete"
Then I should see "Moodle mobile web service" in the "Firstname1 Lastname1" "table_row"
And I should see "127.0.0.1" in the "Firstname1 Lastname1" "table_row"
And I click on "Delete" "link" in the "Firstname1 Lastname1" "table_row"
And I should see "Do you really want to delete this web service token for Firstname1 Lastname1 on the service Moodle mobile web service?"
And I press "Delete"
And I should not see "Joe Bloggs"
And "Firstname1 Lastname1" "table_row" should not exist
@javascript @skip_chrome_zerosize
Scenario: Tokens can be filtered by user and by service
Given the following "core_webservice > Service" exists:
| name | Site information |
| shortname | siteinfo |
| enabled | 1 |
And the following "core_webservice > Service function" exists:
| service | siteinfo |
| functions | core_webservice_get_site_info |
And the following "core_webservice > Tokens" exist:
| user | service |
| user2 | siteinfo |
| user3 | moodle_mobile_app |
| user4 | siteinfo |
When I log in as "admin"
And I navigate to "Server > Web services > Manage tokens" in site administration
# All created tokens are shown by default.
And "Firstname1 Lastname1" "table_row" should not exist
And I should see "Site information" in the "Firstname2 Lastname2" "table_row"
And I should see "Moodle mobile web service" in the "Firstname3 Lastname3" "table_row"
And I should see "Site information" in the "Firstname4 Lastname4" "table_row"
# Filter tokens by user (note we can select the user by the identity field here).
When I click on "Tokens filter" "link"
And I set the field "User" to "user2@example.com"
And I press "Show only matching tokens"
Then "Firstname3 Lastname3" "table_row" should not exist
And "Firstname4 Lastname4" "table_row" should not exist
And I should see "Site information" in the "Firstname2 Lastname2" "table_row"
# Reset the filter.
And I press "Show all tokens"
And I should see "Site information" in the "Firstname2 Lastname2" "table_row"
And I should see "Moodle mobile web service" in the "Firstname3 Lastname3" "table_row"
And I should see "Site information" in the "Firstname4 Lastname4" "table_row"
# Filter tokens by service.
And I click on "Tokens filter" "link"
And I set the field "Service" to "Site information"
And I press "Show only matching tokens"
And I should see "Site information" in the "Firstname2 Lastname2" "table_row"
And I should see "Site information" in the "Firstname4 Lastname4" "table_row"
And "Firstname3 Lastname3" "table_row" should not exist
@@ -0,0 +1,31 @@
@core @core_admin
Feature: Web service user settings
In order to configure authorised users for a web service
As an admin
I need to use the page that lets you do that
Background:
# Include a custom profile field so we can check it gets displayed
Given the following "custom profile fields" exist:
| datatype | shortname | name | param2 |
| text | frog | Favourite frog | 100 |
And the following config values are set as admin:
| showuseridentity | email,profile_field_frog |
And the following "users" exist:
| username | firstname | lastname | email | profile_field_frog |
| user1 | User | One | 1@example.org | Kermit |
And the following "core_webservice > Service" exists:
| name | Silly service |
| shortname | silly |
| restrictedusers | 1 |
| enabled | 1 |
Scenario: Add a user to a web service
When I log in as "admin"
And I navigate to "Server > Web services > External services" in site administration
And I click on "Authorised users" "link" in the "Silly service" "table_row"
And I set the field "Not authorised users" to "User One"
And I press "Add"
Then I should see "User One" in the ".alloweduserlist" "css_element"
And I should see "1@example.org" in the ".alloweduserlist" "css_element"
And I should see "Kermit" in the ".alloweduserlist" "css_element"
@@ -1 +1 @@
{"version":3,"sources":["../src/log_info.js"],"names":["define","$","str","ModalFactory","Notification","loadInfo","id","info","link","get_string","then","langString","bodyInfo","forEach","item","append","create","title","body","html","large","catch","exception"],"mappings":"AAwBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,oBAAvB,CAA6C,mBAA7C,CAAD,CAAoE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+BC,CAA/B,CAA6C,CAEnH,MAAoD,CAShDC,QAAQ,CAAE,kBAASC,CAAT,CAAaC,CAAb,CAAmB,CAEzB,GAAIC,CAAAA,CAAI,CAAGP,CAAC,CAAC,wBAAyBK,CAAzB,CAA8B,KAA/B,CAAZ,CACAJ,CAAG,CAACO,UAAJ,CAAe,SAAf,CAA0B,gBAA1B,EAA4CC,IAA5C,CAAiD,SAASC,CAAT,CAAqB,CAElE,GAAIC,CAAAA,CAAQ,CAAGX,CAAC,CAAC,MAAD,CAAhB,CACAM,CAAI,CAACM,OAAL,CAAa,SAASC,CAAT,CAAe,CACxBF,CAAQ,CAACG,MAAT,CAAgB,OAASD,CAAT,CAAgB,OAAhC,CACH,CAFD,EAGAF,CAAQ,CAACG,MAAT,CAAgB,OAAhB,EAEA,MAAOZ,CAAAA,CAAY,CAACa,MAAb,CAAoB,CACvBC,KAAK,CAAEN,CADgB,CAEvBO,IAAI,CAAEN,CAAQ,CAACO,IAAT,EAFiB,CAGvBC,KAAK,GAHkB,CAApB,CAIJZ,CAJI,CAMV,CAdD,EAcGa,KAdH,CAcSjB,CAAY,CAACkB,SAdtB,CAeH,CA3B+C,CA6BvD,CA/BK,CAAN","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\n/**\n * Shows a dialogue with info about this logs.\n *\n * @module tool_analytics/log_info\n * @class log_info\n * @package tool_analytics\n * @copyright 2017 David Monllao {@link http://www.davidmonllao.com}\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], function($, str, ModalFactory, Notification) {\n\n return /** @alias module:tool_analytics/log_info */ {\n\n /**\n * Prepares a modal info for a log's results.\n *\n * @method loadInfo\n * @param {int} id\n * @param {string[]} info\n */\n loadInfo: function(id, info) {\n\n var link = $('[data-model-log-id=\"' + id + '\"]');\n str.get_string('loginfo', 'tool_analytics').then(function(langString) {\n\n var bodyInfo = $(\"<ul>\");\n info.forEach(function(item) {\n bodyInfo.append('<li>' + item + '</li>');\n });\n bodyInfo.append(\"</ul>\");\n\n return ModalFactory.create({\n title: langString,\n body: bodyInfo.html(),\n large: true,\n }, link);\n\n }).catch(Notification.exception);\n }\n };\n});\n"],"file":"log_info.min.js"}
{"version":3,"sources":["../src/log_info.js"],"names":["define","$","str","ModalFactory","Notification","loadInfo","id","info","link","get_string","then","langString","bodyInfo","forEach","item","append","create","title","body","html","large","catch","exception"],"mappings":"AAsBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,oBAAvB,CAA6C,mBAA7C,CAAD,CAAoE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+BC,CAA/B,CAA6C,CAEnH,MAAoD,CAShDC,QAAQ,CAAE,kBAASC,CAAT,CAAaC,CAAb,CAAmB,CAEzB,GAAIC,CAAAA,CAAI,CAAGP,CAAC,CAAC,wBAAyBK,CAAzB,CAA8B,KAA/B,CAAZ,CACAJ,CAAG,CAACO,UAAJ,CAAe,SAAf,CAA0B,gBAA1B,EAA4CC,IAA5C,CAAiD,SAASC,CAAT,CAAqB,CAElE,GAAIC,CAAAA,CAAQ,CAAGX,CAAC,CAAC,MAAD,CAAhB,CACAM,CAAI,CAACM,OAAL,CAAa,SAASC,CAAT,CAAe,CACxBF,CAAQ,CAACG,MAAT,CAAgB,OAASD,CAAT,CAAgB,OAAhC,CACH,CAFD,EAGAF,CAAQ,CAACG,MAAT,CAAgB,OAAhB,EAEA,MAAOZ,CAAAA,CAAY,CAACa,MAAb,CAAoB,CACvBC,KAAK,CAAEN,CADgB,CAEvBO,IAAI,CAAEN,CAAQ,CAACO,IAAT,EAFiB,CAGvBC,KAAK,GAHkB,CAApB,CAIJZ,CAJI,CAMV,CAdD,EAcGa,KAdH,CAcSjB,CAAY,CAACkB,SAdtB,CAeH,CA3B+C,CA6BvD,CA/BK,CAAN","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\n/**\n * Shows a dialogue with info about this logs.\n *\n * @module tool_analytics/log_info\n * @copyright 2017 David Monllao {@link http://www.davidmonllao.com}\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], function($, str, ModalFactory, Notification) {\n\n return /** @alias module:tool_analytics/log_info */ {\n\n /**\n * Prepares a modal info for a log's results.\n *\n * @method loadInfo\n * @param {int} id\n * @param {string[]} info\n */\n loadInfo: function(id, info) {\n\n var link = $('[data-model-log-id=\"' + id + '\"]');\n str.get_string('loginfo', 'tool_analytics').then(function(langString) {\n\n var bodyInfo = $(\"<ul>\");\n info.forEach(function(item) {\n bodyInfo.append('<li>' + item + '</li>');\n });\n bodyInfo.append(\"</ul>\");\n\n return ModalFactory.create({\n title: langString,\n body: bodyInfo.html(),\n large: true,\n }, link);\n\n }).catch(Notification.exception);\n }\n };\n});\n"],"file":"log_info.min.js"}
@@ -1 +1 @@
{"version":3,"sources":["../src/potential-contexts.js"],"names":["define","$","Ajax","processResults","selector","results","contexts","isArray","each","index","context","push","value","id","label","name","transport","query","success","failure","promise","modelid","attr","call","methodname","args","then","fail"],"mappings":"AAyBAA,OAAM,qCAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAE9C,MAA8D,CAE1DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAQ,CAAG,EAAf,CACA,GAAIL,CAAC,CAACM,OAAF,CAAUF,CAAV,CAAJ,CAAwB,CACpBJ,CAAC,CAACO,IAAF,CAAOH,CAAP,CAAgB,SAASI,CAAT,CAAgBC,CAAhB,CAAyB,CACrCJ,CAAQ,CAACK,IAAT,CAAc,CACVC,KAAK,CAAEF,CAAO,CAACG,EADL,CAEVC,KAAK,CAAEJ,CAAO,CAACK,IAFL,CAAd,CAIH,CALD,EAMA,MAAOT,CAAAA,CAEV,CATD,IASO,CACH,MAAOD,CAAAA,CACV,CACJ,CAhByD,CAkB1DW,SAAS,CAAE,mBAASZ,CAAT,CAAmBa,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAG/CC,CAAO,CAAGpB,CAAC,CAACG,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,SAAjB,GAA+B,IAHM,CAInDF,CAAO,CAAGlB,CAAI,CAACqB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,mCADK,CAEjBC,IAAI,CAAE,CACFR,KAAK,CAAEA,CADL,CAEFI,OAAO,CAAEA,CAFP,CAFW,CAAD,CAAV,CAAV,CAQAD,CAAO,CAAC,CAAD,CAAP,CAAWM,IAAX,CAAgBR,CAAhB,EAAyBS,IAAzB,CAA8BR,CAA9B,CACH,CA/ByD,CAmCjE,CArCK,CAAN","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\n/**\n * Potential contexts selector module.\n *\n * @module tool_analytics/potential-contexts\n * @class potential-contexts\n * @package tool_analytics\n * @copyright 2019 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n return /** @alias module:tool_analytics/potential-contexts */ {\n\n processResults: function(selector, results) {\n var contexts = [];\n if ($.isArray(results)) {\n $.each(results, function(index, context) {\n contexts.push({\n value: context.id,\n label: context.name\n });\n });\n return contexts;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n let modelid = $(selector).attr('modelid') || null;\n promise = Ajax.call([{\n methodname: 'tool_analytics_potential_contexts',\n args: {\n query: query,\n modelid: modelid\n }\n }]);\n\n promise[0].then(success).fail(failure);\n }\n\n };\n\n});\n"],"file":"potential-contexts.min.js"}
{"version":3,"sources":["../src/potential-contexts.js"],"names":["define","$","Ajax","processResults","selector","results","contexts","isArray","each","index","context","push","value","id","label","name","transport","query","success","failure","promise","modelid","attr","call","methodname","args","then","fail"],"mappings":"AAuBAA,OAAM,qCAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAE9C,MAA8D,CAE1DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAQ,CAAG,EAAf,CACA,GAAIL,CAAC,CAACM,OAAF,CAAUF,CAAV,CAAJ,CAAwB,CACpBJ,CAAC,CAACO,IAAF,CAAOH,CAAP,CAAgB,SAASI,CAAT,CAAgBC,CAAhB,CAAyB,CACrCJ,CAAQ,CAACK,IAAT,CAAc,CACVC,KAAK,CAAEF,CAAO,CAACG,EADL,CAEVC,KAAK,CAAEJ,CAAO,CAACK,IAFL,CAAd,CAIH,CALD,EAMA,MAAOT,CAAAA,CAEV,CATD,IASO,CACH,MAAOD,CAAAA,CACV,CACJ,CAhByD,CAkB1DW,SAAS,CAAE,mBAASZ,CAAT,CAAmBa,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAG/CC,CAAO,CAAGpB,CAAC,CAACG,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,SAAjB,GAA+B,IAHM,CAInDF,CAAO,CAAGlB,CAAI,CAACqB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,mCADK,CAEjBC,IAAI,CAAE,CACFR,KAAK,CAAEA,CADL,CAEFI,OAAO,CAAEA,CAFP,CAFW,CAAD,CAAV,CAAV,CAQAD,CAAO,CAAC,CAAD,CAAP,CAAWM,IAAX,CAAgBR,CAAhB,EAAyBS,IAAzB,CAA8BR,CAA9B,CACH,CA/ByD,CAmCjE,CArCK,CAAN","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\n/**\n * Potential contexts selector module.\n *\n * @module tool_analytics/potential-contexts\n * @copyright 2019 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n return /** @alias module:tool_analytics/potential-contexts */ {\n\n processResults: function(selector, results) {\n var contexts = [];\n if ($.isArray(results)) {\n $.each(results, function(index, context) {\n contexts.push({\n value: context.id,\n label: context.name\n });\n });\n return contexts;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n let modelid = $(selector).attr('modelid') || null;\n promise = Ajax.call([{\n methodname: 'tool_analytics_potential_contexts',\n args: {\n query: query,\n modelid: modelid\n }\n }]);\n\n promise[0].then(success).fail(failure);\n }\n\n };\n\n});\n"],"file":"potential-contexts.min.js"}
-2
View File
@@ -17,8 +17,6 @@
* Shows a dialogue with info about this logs.
*
* @module tool_analytics/log_info
* @class log_info
* @package tool_analytics
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -17,8 +17,6 @@
* Potential contexts selector module.
*
* @module tool_analytics/potential-contexts
* @class potential-contexts
* @package tool_analytics
* @copyright 2019 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+1 -1
View File
@@ -137,7 +137,7 @@ if (!empty($validdatasets) && !$model->is_enabled() && $options['non-interactive
}
// Refresh the instance to prevent unexpected issues.
$model = new \core_analytics\model($modelobj);
$model = new \core_analytics\model($options['modelid']);
// Set the time splitting method file and enable it.
$model->enable($input);
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2020110900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2020110300; // Requires this Moodle version.
$plugin->version = 2021051700; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2021051100; // Requires this Moodle version.
$plugin->component = 'tool_analytics'; // Full name of the plugin (used for diagnostics).
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2020110900;
$plugin->requires = 2020110300;
$plugin->version = 2021051700;
$plugin->requires = 2021051100;
$plugin->component = 'tool_availabilityconditions';
+5 -4
View File
@@ -45,7 +45,7 @@ list($options, $unrecognised) = cli_get_params(
array(
'stop-on-failure' => 0,
'verbose' => false,
'replace' => false,
'replace' => '',
'help' => false,
'tags' => '',
'profile' => '',
@@ -70,7 +70,7 @@ $help = "
Behat utilities to run behat tests in parallel
Usage:
php run.php [--BEHAT_OPTION=\"value\"] [--feature=\"value\"] [--replace] [--fromrun=value --torun=value] [--help]
php run.php [--BEHAT_OPTION=\"value\"] [--feature=\"value\"] [--replace=\"{run}\"] [--fromrun=value --torun=value] [--help]
Options:
--BEHAT_OPTION Any combination of behat option specified in http://behat.readthedocs.org/en/v2.5/guides/6.cli.html
@@ -144,9 +144,10 @@ $extraopts = $unrecognised;
if ($options['profile']) {
$profile = $options['profile'];
// If profile passed is not set, then exit.
// If profile passed is not set, then exit (note we skip if the 'replace' option is found within the 'profile' value).
if (!isset($CFG->behat_config[$profile]) && !isset($CFG->behat_profiles[$profile]) &&
!(isset($options['replace']) && (strpos($options['profile'], $options['replace']) >= 0 ))) {
!($options['replace'] && (strpos($profile, (string) $options['replace']) !== false))) {
echo "Invalid profile passed: " . $profile . PHP_EOL;
exit(1);
}
+1
View File
@@ -46,6 +46,7 @@ $string['stepsdefinitionstype'] = 'Type';
$string['theninfo'] = 'Then. Checkings to ensure the outcomes are the expected ones';
$string['unknownexceptioninfo'] = 'There was a problem with Selenium or your browser. Please ensure you are using the latest version of Selenium. Error:';
$string['viewsteps'] = 'Filter';
$string['warndirrootconfigfound'] = 'A configuration file was found at {$a}. This file is not automatically updated and may become stale. We recommend removing this file.';
$string['wheninfo'] = 'When. Action that provokes an event';
$string['wrongbehatsetup'] = 'Something is wrong with the behat setup and so step definitions cannot be listed: <b>{$a->errormsg}</b><br/><br/>Please check:<ul>
<li>$CFG->behat_dataroot, $CFG->behat_prefix and $CFG->behat_wwwroot are set in config.php with different values from $CFG->dataroot, $CFG->prefix and $CFG->wwwroot.</li>
@@ -156,7 +156,7 @@ Feature: Set up contextual data for tests
And I log in as "user5"
And I should see "You are logged in as"
And I am on "Course 1" course homepage
And I should see "You can not enrol yourself in this course."
And I should see "You cannot enrol yourself in this course."
Scenario: Add modules
Given the following "courses" exist:
@@ -21,5 +21,5 @@ Feature: Transform date time string arguments
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I should see "##yesterday##l, j F Y##"
And I should see "##yesterday##%d %B %Y##"
And I log out
@@ -6,14 +6,18 @@ Feature: Edit capabilities
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| username | firstname | lastname |
| teacher1 | Teacher | 1 |
| tutor | Teaching | Assistant |
| student | Student | One |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| user | course | role |
| teacher1 | C1 | editingteacher |
| tutor | C1 | teacher |
| student | C1 | student |
Scenario: Default system capabilities modification
Given I log in as "admin"
@@ -45,10 +49,14 @@ Feature: Edit capabilities
Scenario: Module capabilities overrides
Given I log in as "teacher1"
And the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | 00001 |
| name | I'm the name |
| intro | I'm the introduction |
| section | 1 |
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | I'm the name |
| Description | I'm the introduction |
And I follow "I'm the name"
And I navigate to "Permissions" in current page administration
And I override the system permissions of "Student" role with:
@@ -60,3 +68,25 @@ Feature: Edit capabilities
Then "mod/forum:deleteanypost" capability has "Prohibit" permission
And "mod/forum:editanypost" capability has "Prevent" permission
And "mod/forum:addquestion" capability has "Allow" permission
@javascript
Scenario: Edit permissions escapes role names correctly
When I am on the "C1" "Course" page logged in as "admin"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Your word for 'Teacher' | Teacher >= editing |
| Your word for 'Non-editing teacher' | Teacher < "editing" |
| Your word for 'Student' | Studier & 'learner' |
And I press "Save and display"
And I navigate to course participants
Then I should see "Teacher >= editing (Teacher)" in the "Teacher 1" "table_row"
And I should see "Teacher < \"editing\" (Non-editing teacher)" in the "Teaching Assistant" "table_row"
And I should see "Studier & 'learner' (Student)" in the "Student One" "table_row"
And I navigate to "Users > Permissions" in current page administration
And I should see "Teacher >= editing" in the "mod/forum:replypost" "table_row"
And I should see "Teacher < \"editing\"" in the "mod/forum:replypost" "table_row"
And I should see "Studier & 'learner'" in the "mod/forum:replypost" "table_row"
And I follow "Prohibit"
And "Teacher >= editing" "button" in the "Prohibit role" "dialogue" should be visible
And "Teacher < \"editing\"" "button" in the "Prohibit role" "dialogue" should be visible
And "Studier & 'learner'" "button" in the "Prohibit role" "dialogue" should be visible
@@ -48,7 +48,7 @@ Feature: Verify that all form fields values can be get and set
And the "Unenrol users" select box should not contain "Baker"
And the "Unenrol users" select box should not contain "President, Baker"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I press "Create page"
# Text (textarea & editor) & Select (multi-select) - Checking "I set the following fields to these values".
When I set the following fields to these values:
@@ -61,8 +61,7 @@ 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 should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value "1"
@@ -70,8 +69,7 @@ Feature: Verify that all form fields values can be get and set
# 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 should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value ""
@@ -80,8 +78,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 should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
@@ -92,8 +89,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 should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
@@ -115,16 +111,24 @@ Feature: Verify that all form fields values can be get and set
| Wiki name | Test this one baby |
| Default format | HTML |
And I press "Cancel"
And I am on "Course 1" course homepage
# Radio - Checking "I set the field" and "the field matches value".
And I add a "Choice" to section "1" and I fill the form with:
| Choice name | Test choice name |
| Description | Test choice description |
| Allow choice to be updated | Yes |
| Option 1 | one |
| Option 2 | two |
| Option 3 | three |
And I follow "Test choice name"
And the following "activity" exists:
| activity | choice |
| course | C1 |
| idnumber | choice1 |
| intro | Test choice description |
| name | Test choice name |
| choice1 | Option 1, Option 2, Option 3 |
| section | 1 |
| allowupdate | 1 |
And I am on "Course 1" course homepage
And I am on the "Test choice name" "choice activity editing" page
And I set the field "Option 1" to "one"
And I set the field "Option 2" to "two"
And I set the field "Option 3" to "three"
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I am on the "Test choice name" "choice activity" page
And I set the field "one" to "1"
And I press "Save my choice"
And the field "one" matches value "1"
@@ -174,31 +178,23 @@ Feature: Verify that all form fields values can be get and set
And I press "Cancel"
# Advanced checkbox requires real browser to allow uncheck to work. MDL-58681. MDL-55386.
# Advanced checkbox - Checking "I set the field" and "The field matches value" ticked.
And I am on "Course 1" course homepage
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And I set the field "Display description on course page" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value "1"
And the field "Display description on course page" does not match value ""
# Advanced checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Display description on course page" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value ""
And the field "Display description on course page" does not match value "1"
# Advanced checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" ticked.
And I set the following fields to these values:
| Display description on course page | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | 1 |
And the following fields do not match these values:
@@ -207,9 +203,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Display description on course page | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | |
And the following fields do not match these values:
@@ -0,0 +1,85 @@
@tool @tool_behat
Feature: Use core page resolvers for the I am on the page steps
In order to write tests correctly
As a developer
I need to have steps which take me straight to a page
Scenario Outline: When I am on an instance
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
And the following "activity" exists:
| course | ECON101 |
| activity | forum |
| name | Fundamentals of Economics |
| idnumber | fundamentalsofeconomics |
And I log in as "admin"
When I am on the <identifier> <type> page
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Scenario Outline: When I am on an instance logged in as
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
And the following "activity" exists:
| course | ECON101 |
| activity | forum |
| name | Fundamentals of Economics |
| idnumber | fundamentalsofeconomics |
When I am on the <identifier> <type> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Scenario Outline: When I am on a named page
Given I log in as "admin"
When I am on the <identifier> page
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
Scenario Outline: When I am on a named page logged in as
When I am on the <identifier> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
@@ -0,0 +1,30 @@
@tool_behat
Feature: Verify that the inplace editable field works as expected
In order to use behat step definitions
As a test write
I need to ensure that the inplace editable works in forms
Background:
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
And the following "activities" exist:
| activity | course | name | idnumber |
| forum | C1 | My first forum | forum1 |
| assign | C1 | My first assignment | assign1 |
| quiz | C1 | My first quiz | quiz1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Using an inplace editable updates the name of an activity
When I set the field "Edit title" in the "My first assignment" "activity" to "Coursework submission"
Then I should see "Coursework submission"
And I should not see "My first assignment"
But I should see "My first forum"
And I should see "My first quiz"
And I set the field "Edit title" in the "Coursework submission" "activity" to "My first assignment"
And I should not see "Coursework submission"
But I should see "My first assignment"
And I should see "My first forum"
And I should see "My first quiz"
@@ -0,0 +1,52 @@
@tool_behat
Feature: Verify that keyboard steps work as expected
In order to use behat step definitions
As a test writer
I need to verify that the keyboard steps work as expected
@javascript
Scenario: Typing keys into a field causes them to be input
Given the following "users" exist:
| username | email | firstname | lastname | password |
| saffronr | saffron.rutledge@example.com | Saffron | Rutledge | flowerpower |
Given I click on "Log in" "link"
And I click on "Username" "field"
When I type "saffronr"
And I press the tab key
And I type "flowerpower"
And I press enter
Then I should see "You are logged in as Saffron Rutledge"
@javascript
Scenario: Using tab changes focus to the next or previous field
Given I click on "Log in" "link"
And I click on "Username" "field"
And the focused element is "Username" "field"
When I press the tab key
Then the focused element is "Password" "field"
And I press the shift tab key
And the focused element is "Username" "field"
@javascript
Scenario: Using the arrow keys allows me to navigate through menus
Given the following "users" exist:
| username | email | firstname | lastname |
| saffronr | saffron.rutledge@example.com | Saffron | Rutledge |
And I log in as "saffronr"
And I click on "Saffron Rutledge" "link" in the ".usermenu" "css_element"
When I press the up key
Then the focused element is "Log out" "link"
@javascript
Scenario: The escape key can be used to close a dialogue
Given the following "course" exists:
| fullname | C1|
| shortname | C1 |
And I log in as "admin"
And I am on "C1" course homepage
And I navigate to course participants
And I press "Enrol users"
And "Enrol users" "dialogue" should be visible
When I press the escape key
Then "Enrol users" "dialogue" should not be visible
@@ -0,0 +1,110 @@
@tool_behat
Feature: Verify that the behat login and logout steps work as expected
In order to use behat login and log out steps
As a test writer
I need to verify that login and logout happen when the steps are used
Scenario: Log in as a user using the step
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
When I log in as "traverst1"
Then I should see "Thomas Travers"
@javascript
Scenario: Log in as a user using the step (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
When I log in as "traverst1"
Then I should see "Thomas Travers"
Scenario: Log out using the log out step
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And I am logged in as traverst1
When I log out
Then I should not see "Thomas Travers"
And I should see "You are not logged in"
@javascript
Scenario: Log out using the log out step (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And I am logged in as traverst1
When I log out
Then I should not see "Thomas Travers"
And I should see "You are not logged in"
Scenario: Log in step should automatically log user out if already logged in
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And I am logged in as traverst1
When I log in as "emeryj"
Then I should not see "Thomas Travers"
And I should see "Jane Emery"
@javascript
Scenario: Log in step should automatically log user out if already logged in (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And I am logged in as traverst1
When I log in as "emeryj"
Then I should not see "Thomas Travers"
And I should see "Jane Emery"
Scenario: I am on page logged in as should redirect to correct page
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
@javascript
Scenario: I am on page logged in as should redirect to correct page (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
Scenario: I am on page logged in as should redirect to correct page when automatically logging a user out
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
And I am logged in as emeryj
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
@javascript
Scenario: I am on page logged in as should redirect to correct page when automatically logging a user out (javacript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
And I am logged in as emeryj
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
@@ -14,8 +14,6 @@ Feature: Forms manipulation
Then the field "First name" matches value "Field value"
And the "Select a country" select box should contain "Japan"
And the field "New password" matches value "TestPass"
And I take focus off "Update profile" "button"
And I press "Update profile"
@javascript
Scenario: Expand all fieldsets and advanced elements
+7 -7
View File
@@ -149,7 +149,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
public function test_get_config_file_contents_with_single_run() {
$mockbuilder = $this->getMockBuilder('behat_config_util');
$mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));
$mockbuilder->onlyMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));
$behatconfigutil = $mockbuilder->getMock();
@@ -188,7 +188,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
public function test_get_config_file_contents_with_single_run_no_theme() {
$mockbuilder = $this->getMockBuilder('behat_config_util');
$mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));
$mockbuilder->onlyMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));
$behatconfigutil = $mockbuilder->getMock();
@@ -242,7 +242,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
public function test_get_config_file_contents_with_parallel_run() {
$mockbuilder = $this->getMockBuilder('behat_config_util');
$mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));
$mockbuilder->onlyMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));
$behatconfigutil = $mockbuilder->getMock();
@@ -345,7 +345,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
public function test_get_config_file_contents_with_parallel_run_optimize_tags() {
$mockbuilder = $this->getMockBuilder('behat_config_util');
$mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));
$mockbuilder->onlyMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));
$behatconfigutil = $mockbuilder->getMock();
@@ -489,7 +489,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
public function test_get_config_file_contents_with_blacklisted_tags() {
$mockbuilder = $this->getMockBuilder('behat_config_util');
$mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_blacklisted_tests_for_theme',
$mockbuilder->onlyMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_blacklisted_tests_for_theme',
'get_default_theme', 'get_theme_config'));
$behatconfigutil = $mockbuilder->getMock();
@@ -553,7 +553,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
public function test_get_config_file_contents_with_blacklisted_features_contexts() {
$mockbuilder = $this->getMockBuilder('behat_config_util');
$mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_blacklisted_tests_for_theme',
$mockbuilder->onlyMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_blacklisted_tests_for_theme',
'get_default_theme', 'get_theme_config'));
$behatconfigutil = $mockbuilder->getMock();
@@ -632,7 +632,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
public function test_core_features_to_include_in_specified_theme() {
$mockbuilder = $this->getMockBuilder('behat_config_util');
$mockbuilder->setMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));
$mockbuilder->onlyMethods(array('get_theme_test_directory', 'get_list_of_themes', 'get_default_theme', 'get_theme_config'));
$behatconfigutil = $mockbuilder->getMock();
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2020110300; // Requires this Moodle version
$plugin->version = 2021051700; // 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)
+219
View File
@@ -0,0 +1,219 @@
PLEASE NOTE:
There are included libraries in the directory quail/common/services which might have different (but compatible) licenses than the one covered in this file. Current licenses include:
*The current BSD:
*services/readability/php-text-statistics
*The MIT License:
*common/css.php The function parseSelector is from the PHPQuery project:
*http://code.google.com/p/phpquery
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
ÒThis LicenseÓ refers to version 3 of the GNU General Public License.
ÒCopyrightÓ also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
ÒThe ProgramÓ refers to any copyrightable work licensed under this License. Each licensee is addressed as ÒyouÓ. ÒLicenseesÓ and ÒrecipientsÓ may be individuals or organizations.
To ÒmodifyÓ a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a Òmodified versionÓ of the earlier work or a work Òbased onÓ the earlier work.
A Òcovered workÓ means either the unmodified Program or a work based on the Program.
To ÒpropagateÓ a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To ÒconveyÓ a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays ÒAppropriate Legal NoticesÓ to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The Òsource codeÓ for a work means the preferred form of the work for making modifications to it. ÒObject codeÓ means any non-source form of a work.
A ÒStandard InterfaceÓ means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The ÒSystem LibrariesÓ of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A ÒMajor ComponentÓ, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The ÒCorresponding SourceÓ for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
* a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
* b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to Òkeep intact all noticesÓ.
* c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
* d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an ÒaggregateÓ if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
* a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
* b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
* c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
* d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
* e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A ÒUser ProductÓ is either (1) a Òconsumer productÓ, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, Ònormally usedÓ refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
ÒInstallation InformationÓ for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
ÒAdditional permissionsÓ are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
* a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
* b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
* c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
* d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
* e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
* f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered Òfurther restrictionsÓ within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An Òentity transactionÓ is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A ÒcontributorÓ is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's Òcontributor versionÓ.
A contributor's Òessential patent claimsÓ are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, ÒcontrolÓ includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a Òpatent licenseÓ is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To ÒgrantÓ such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. ÒKnowingly relyingÓ means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is ÒdiscriminatoryÓ if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License Òor any later versionÓ applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ÒAS ISÓ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS FOR QUAIL LIBRARY
THE FOLLOWING LICENSE COVERS PORTIONS OF THE FILE LOCATED AT common/css.php, NAMELY THE FUNCTION parseSelector:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+23
View File
@@ -0,0 +1,23 @@
# Brickfield accessibility tool plugin #
Copyright (C) 2021 [Brickfield Education Labs](https://www.brickfield.ie/)
The Accessibility admin tool plugin provides a simple means of checking content for any accessibility issues.
Created by an enthusiastic team from Brickfield Education Labs, including:
* Karen Holland
* Gavin Henrick
* Mike Churchward
* Renée Mackey
* Laia Joana Canet
* Jay Churchward
* Paul Ffrench
* Holly Lynn
* Michael Pound
* Max Larkin
with a little help from our friends.
Portions of the htmlchecker files were derived from the ["Quail PHP Accessibility Library"](https://code.google.com/archive/p/quail-lib/).
The Quail library (Copyright (C) 2009 Kevin Miller) is licensed under [GNU GPL v3](http://www.gnu.org/licenses/gpl.html).
See the LICENSE_QUAIL.txt file in this directory for original Quail license information.
@@ -0,0 +1,576 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield;
use context_system;
use moodle_exception;
use moodle_url;
use stdClass;
use tool_brickfield\local\tool\filter;
/**
* Provides the Brickfield Accessibility toolkit API.
*
* @package tool_brickfield
* @copyright 2020 onward Brickfield Education Labs Ltd, https://www.brickfield.ie
* @author Mike Churchward (mike@brickfieldlabs.ie)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class accessibility {
/** @var string The component sub path */
private static $pluginpath = 'tool/brickfield';
/** @var string Supported format of topics */
const TOOL_BRICKFIELD_FORMAT_TOPIC = 'topics';
/** @var string Supported format of weeks */
const TOOL_BRICKFIELD_FORMAT_WEEKLY = 'weeks';
/**
* Return the state of the site enable condition.
* @return bool
*/
public static function is_accessibility_enabled(): bool {
global $CFG;
if (isset($CFG->enableaccessibilitytools)) {
return $CFG->enableaccessibilitytools;
}
// Enabled by default.
return true;
}
/**
* Throw an error if the toolkit is not enabled.
* @return bool
* @throws moodle_exception
*/
public static function require_accessibility_enabled(): bool {
if (!static::is_accessibility_enabled()) {
throw new moodle_exception('accessibilitydisabled', manager::PLUGINNAME);
}
return true;
}
/**
* Get a URL for a page within the plugin.
*
* This takes into account the value of the admin config value.
*
* @param string $url The URL within the plugin
* @return moodle_url
*/
public static function get_plugin_url(string $url = ''): moodle_url {
$url = ($url == '') ? 'index.php' : $url;
$pluginpath = self::$pluginpath;
return new moodle_url("/admin/{$pluginpath}/{$url}");
}
/**
* Get a file path for a file within the plugin.
*
* This takes into account the value of the admin config value.
*
* @param string $path The path within the plugin
* @return string
*/
public static function get_file_path(string $path): string {
global $CFG;
return implode(DIRECTORY_SEPARATOR, [$CFG->dirroot, $CFG->admin, self::$pluginpath, $path, ]);
}
/**
* Get the canonicalised name of a capability.
*
* @param string $capability
* @return string
*/
public static function get_capability_name(string $capability): string {
return self::$pluginpath . ':' . $capability;
}
/**
* Get the relevant title.
* @param filter $filter
* @param int $countdata
* @return string
* @throws \coding_exception
* @throws \dml_exception
* @throws \moodle_exception
*/
public static function get_title(filter $filter, int $countdata): string {
global $DB;
$tmp = new \stdClass();
$tmp->count = $countdata;
$langstr = 'title' . $filter->tab . 'partial';
if ($filter->courseid != 0) {
$thiscourse = get_fast_modinfo($filter->courseid)->get_course();
$tmp->name = $thiscourse->fullname;
} else {
$langstr = 'title' . $filter->tab . 'all';
}
return get_string($langstr, manager::PLUGINNAME, $tmp);
}
/**
* Function to be run periodically according to the scheduled task.
* Return true if a process was completed. False if no process executed.
* Finds all unprocessed courses for bulk batch processing and completes them.
* @param int $batch
* @return bool
* @throws \ReflectionException
* @throws \coding_exception
* @throws \ddl_exception
* @throws \ddl_table_missing_exception
* @throws \dml_exception
*/
public static function bulk_process_courses_cron(int $batch = 0): bool {
global $PAGE;
// Run a registration check.
if (!(new registration())->validate()) {
return false;
}
if (analysis::is_enabled()) {
$PAGE->set_context(context_system::instance());
mtrace("Starting cron for bulk_process_courses");
// Do regular processing. True if full deployment type isn't selected as well.
static::bulk_processing($batch);
mtrace("Ending cron for bulk_process_courses");
return true;
} else {
mtrace('Content analysis is currently disabled in settings.');
return false;
}
}
/**
* Bulk processing.
* @param int $batch
* @return bool
*/
protected static function bulk_processing(int $batch = 0): bool {
manager::check_course_updates();
mtrace("check_course_updates completed at " . time());
$recordsprocessed = manager::check_scheduled_areas($batch);
mtrace("check_scheduled_areas completed at " . time());
manager::check_scheduled_deletions();
mtrace("check_scheduled_deletions completed at " . time());
manager::delete_historical_data();
mtrace("delete_historical_data completed at " . time());
return $recordsprocessed;
}
/**
* Function to be run periodically according to the scheduled task.
* Finds all unprocessed courses for cache processing and completes them.
*/
public static function bulk_process_caches_cron() {
global $DB;
// Run a registration check.
if (!(new registration())->validate()) {
return;
}
if (analysis::is_enabled()) {
mtrace("Starting cron for bulk_process_caches");
// Monitor ongoing caching requests.
$fields = 'DISTINCT courseid';
$reruns = $DB->get_records(manager::DB_PROCESS, ['item' => 'cache'], '', $fields);
foreach ($reruns as $rerun) {
mtrace("Running rerun caching for Courseid " . $rerun->courseid);
manager::store_result_summary($rerun->courseid);
mtrace("rerun cache completed at " . time());
$DB->delete_records(manager::DB_PROCESS, ['courseid' => $rerun->courseid, 'item' => 'cache']);
}
mtrace("Ending cron for bulk_process_caches at " . time());
} else {
mtrace('Content analysis is currently disabled in settings.');
}
}
/**
* This function runs the checks on the html item
*
* @param string $html The html string to be analysed; might be NULL.
* @param int $contentid The content area ID
* @param int $processingtime
* @param int $resultstime
*/
public static function run_check(string $html, int $contentid, int &$processingtime, int &$resultstime) {
global $DB;
// Change the limit if 10,000 is not appropriate.
$bulkrecordlimit = manager::BULKRECORDLIMIT;
$bulkrecordcount = 0;
$checkids = static::checkids();
$checknameids = array_flip($checkids);
$testname = 'brickfield';
$stime = time();
// Swapping in new library.
$htmlchecker = new local\htmlchecker\brickfield_accessibility($html, $testname, 'string');
$htmlchecker->run_check();
$tests = $htmlchecker->guideline->get_tests();
$report = $htmlchecker->get_report();
$processingtime += (time() - $stime);
$records = [];
foreach ($tests as $test) {
$records[$test]['count'] = 0;
$records[$test]['errors'] = [];
}
foreach ($report['report'] as $a) {
if (!isset($a['type'])) {
continue;
}
$type = $a['type'];
$records[$type]['errors'][] = $a;
if (!isset($records[$type]['count'])) {
$records[$type]['count'] = 0;
}
$records[$type]['count']++;
}
$stime = time();
$returnchecks = [];
$errors = [];
// Build up records for inserting.
foreach ($records as $key => $rec) {
$recordres = new stdClass();
// Handling if checkid is unknown.
$checkid = (isset($checknameids[$key])) ? $checknameids[$key] : 0;
$recordres->contentid = $contentid;
$recordres->checkid = $checkid;
$recordres->errorcount = $rec['count'];
// Build error inserts if needed.
if ($rec['count'] > 0) {
foreach ($rec['errors'] as $tmp) {
$error = new stdClass();
$error->resultid = 0;
$error->linenumber = $tmp['lineNo'];
$error->htmlcode = $tmp['html'];
$error->errordescription = $tmp['title'];
// Add contentid and checkid so that we can query for the results record id later.
$error->contentid = $contentid;
$error->checkid = $checkid;
$errors[] = $error;
}
}
$returnchecks[] = $recordres;
$bulkrecordcount++;
// If we've hit the bulk limit, write the results records and reset.
if ($bulkrecordcount > $bulkrecordlimit) {
$DB->insert_records(manager::DB_RESULTS, $returnchecks);
$bulkrecordcount = 0;
$returnchecks = [];
// Get the results id value for each error record and write the errors.
foreach ($errors as $key2 => $error) {
$errors[$key2]->resultid = $DB->get_field(manager::DB_RESULTS, 'id',
['contentid' => $error->contentid, 'checkid' => $error->checkid]);
unset($errors[$key2]->contentid);
unset($errors[$key2]->checkid);
}
$DB->insert_records(manager::DB_ERRORS, $errors);
$errors = [];
}
}
// Write any leftover records.
if ($bulkrecordcount > 0) {
$DB->insert_records(manager::DB_RESULTS, $returnchecks);
// Get the results id value for each error record and write the errors.
foreach ($errors as $key => $error) {
$errors[$key]->resultid = $DB->get_field(manager::DB_RESULTS, 'id',
['contentid' => $error->contentid, 'checkid' => $error->checkid]);
unset($errors[$key]->contentid);
unset($errors[$key]->checkid);
}
$DB->insert_records(manager::DB_ERRORS, $errors);
}
$resultstime += (time() - $stime);
}
/**
* This function runs one specified check on the html item
*
* @param string $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
* @param int $processingtime
* @param int $resultstime
* @throws \coding_exception
* @throws \dml_exception
*/
public static function run_one_check(
string $html = null,
int $contentid,
int $errid,
string $check,
int &$processingtime,
int &$resultstime
) {
global $DB;
$stime = time();
$checkdata = $DB->get_record(manager::DB_CHECKS, ['shortname' => $check], 'id,shortname,severity');
$testname = 'brickfield';
// Swapping in new library.
$htmlchecker = new local\htmlchecker\brickfield_accessibility($html, $testname, 'string');
$htmlchecker->run_check();
$report = $htmlchecker->get_test($check);
$processingtime += (time() - $stime);
$record = [];
$record['count'] = 0;
$record['errors'] = [];
foreach ($report as $a) {
$a->html = $a->get_html();
$record['errors'][] = $a;
$record['count']++;
}
// Build up record for inserting.
$recordres = new stdClass();
// Handling if checkid is unknown.
$checkid = (isset($checkdata->id)) ? $checkdata->id : 0;
$recordres->contentid = $contentid;
$recordres->checkid = $checkid;
$recordres->errorcount = $record['count'];
if ($exists = $DB->get_record(manager::DB_RESULTS, ['contentid' => $contentid, 'checkid' => $checkid])) {
$resultid = $exists->id;
$DB->set_field(manager::DB_RESULTS, 'errorcount', $record['count'], ['id' => $resultid]);
// Remove old error records for specific resultid, if existing.
$DB->delete_records(manager::DB_ERRORS, ['id' => $errid]);
} else {
$resultid = $DB->insert_record(manager::DB_RESULTS, $recordres);
}
$errors = [];
// Build error inserts if needed.
if ($record['count'] > 0) {
// Reporting all found errors for this check, so need to ignore existing other error records.
foreach ($record['errors'] as $tmp) {
// Confirm if error is reported separately.
if ($DB->record_exists_select(manager::DB_ERRORS,
'resultid = ? AND ' . $DB->sql_compare_text('htmlcode', 255) . ' = ' . $DB->sql_compare_text('?', 255),
[$resultid, html_entity_decode($tmp->html)])) {
continue;
}
$error = new stdClass();
$error->resultid = $resultid;
$error->linenumber = $tmp->line;
$error->htmlcode = html_entity_decode($tmp->html);
$errors[] = $error;
}
$DB->insert_records(manager::DB_ERRORS, $errors);
}
$resultstime += (time() - $stime);
}
/**
* Returns all of the id's and shortnames of all of the checks.
* @param int $status
* @return array
* @throws \dml_exception
*/
public static function checkids(int $status = 1): array {
global $DB;
$checks = $DB->get_records_menu(manager::DB_CHECKS, ['status' => $status], 'id ASC', 'id,shortname');
return $checks;
}
/**
* Returns an array of translations from htmlchecker of all of the checks, and their descriptions.
* @return array
* @throws \dml_exception
*/
public static function get_translations(): array {
global $DB;
$htmlchecker = new local\htmlchecker\brickfield_accessibility('test', 'brickfield', 'string');
$htmlchecker->run_check();
ksort($htmlchecker->guideline->translations);
// Need to limit to active checks.
$activechecks = $DB->get_fieldset_select(manager::DB_CHECKS, 'shortname', 'status = :status', ['status' => 1]);
$translations = [];
foreach ($htmlchecker->guideline->translations as $key => $trans) {
if (in_array($key, $activechecks)) {
$translations[$key] = $trans;
}
}
return $translations;
}
/**
* Returns an array of all of the course id's for a given category.
* @param int $categoryid
* @return array|null
* @throws \dml_exception
*/
public static function get_category_courseids(int $categoryid): ?array {
global $DB;
if (!$DB->record_exists('course_categories', ['id' => $categoryid])) {
return null;
}
$sql = "SELECT {course}.id
FROM {course}, {course_categories}
WHERE {course}.category = {course_categories}.id
AND (
" . $DB->sql_like('path', ':categoryid1') . "
OR " . $DB->sql_like('path', ':categoryid2') . "
)";
$params = ['categoryid1' => "%/$categoryid/%", 'categoryid2' => "%/$categoryid"];
$courseids = $DB->get_fieldset_sql($sql, $params);
return $courseids;
}
/**
* Get summary data for this site.
* @param int $id
* @return \stdClass
* @throws \dml_exception
*/
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;
$summarydata->numcourses = $DB->count_records('course') - 1;
$summarydata->numusers = $DB->count_records('user', array('deleted' => 0));
$summarydata->numfiles = $DB->count_records('files');
$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->contenttypeerrors = static::get_contenttypeerrors();
$summarydata->percheckerrors = static::get_percheckerrors();
return $summarydata;
}
/**
* Get content type results.
* @param int $id
* @param array $components
* @return \stdClass
*/
private static function get_contenttyperesults(int $id, array $components): \stdClass {
$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);
}
$contenttyperesults->summarydatastorage = static::get_summary_data_storage();
$contenttyperesults->datachecked = time(); // Correct??
return $contenttyperesults;
}
/**
* Get per check errors.
* @return stdClass
* @throws dml_exception
*/
private static function get_percheckerrors(): stdClass {
global $DB;
$sql = 'SELECT ' . $DB->sql_concat_join("'_'", ['courseid', 'checkid']) . ' as tmpid,
ca.courseid, ca.status, ca.checkid, ch.shortname, ca.checkcount, ca.errorcount
FROM {' . manager::DB_CACHECHECK . '} ca
INNER JOIN {' . manager::DB_CHECKS . '} ch on ch.id = ca.checkid
ORDER BY courseid, checkid ASC';
$combo = $DB->get_records_sql($sql);
return (object) [
'percheckerrors' => $combo,
];
}
/**
* Get content type errors.
* @return stdClass
* @throws dml_exception
*/
private static function get_contenttypeerrors(): stdClass {
global $DB;
$fields = 'courseid, status, activities, activitiespassed, activitiesfailed,
errorschecktype1, errorschecktype2, errorschecktype3, errorschecktype4,
errorschecktype5, errorschecktype6, errorschecktype7,
failedchecktype1, failedchecktype2, failedchecktype3, failedchecktype4,
failedchecktype5, failedchecktype6, failedchecktype7,
percentchecktype1, percentchecktype2, percentchecktype3, percentchecktype4,
percentchecktype5, percentchecktype6, percentchecktype7';
$combo = $DB->get_records(manager::DB_SUMMARY, null, 'courseid ASC', $fields);
return (object) [
'typeerrors' => $combo,
];
}
/**
* Get summary data storage.
* @return array
* @throws dml_exception
*/
private static function get_summary_data_storage(): array {
global $DB;
$fields = $DB->sql_concat_join("''", ['component', 'courseid']) . ' as tmpid,
courseid, component, errorcount, totalactivities, failedactivities, passedactivities';
$combo = $DB->get_records(manager::DB_CACHEACTS, null, 'courseid, component ASC', $fields);
return $combo;
}
}
@@ -0,0 +1,95 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield;
use tool_brickfield\task\process_analysis_requests;
/**
* Analysis and deployment class.
*
* @package tool_brickfield
* @copyright 2020 Brickfield Education Labs https://www.brickfield.ie
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class analysis {
/**
* Indicates that analysis of content has been enabled.
*/
const ANALYSISDISABLED = '0';
/**
* Indicates that analysis is enabled and using request method.
*/
const ANALYSISBYREQUEST = '1';
/**
* Return the type of analysis being used (currently only request).
*
* @return false|mixed|object|string|null
* @throws \dml_exception
*/
public static function get_type() {
// Moodle caches these calls, so it's not expensive.
return get_config(manager::PLUGINNAME, 'analysistype');
}
/**
* Return true is analysis has been enabled.
*
* @return bool
* @throws \dml_exception
*/
public static function is_enabled(): bool {
$analysistype = static::get_type();
return ($analysistype !== false) && ($analysistype !== self::ANALYSISDISABLED);
}
/**
* Return true if analysis is by request method.
*
* @return bool
* @throws \dml_exception
*/
public static function type_is_byrequest(): bool {
return static::get_type() === self::ANALYSISBYREQUEST;
}
/**
* Return true if the course has been analyzed.
*
* @param int $courseid
* @return bool
* @throws \dml_exception
*/
public static function is_course_analyzed(int $courseid): bool {
return scheduler::is_course_analyzed($courseid);
}
/**
* Return a redirect message with the earliest time expected for analysis to complete.
* @return \lang_string|string
* @throws \coding_exception
*/
public static function redirect_message() {
$epoch = new process_analysis_requests;
$time = userdate($epoch->get_next_scheduled_time(), get_string('strftimetime', 'core_langconfig'));
$message = get_string('confirmationmessage', manager::PLUGINNAME, $time);
return $message;
}
}
+219
View File
@@ -0,0 +1,219 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield;
/**
* Area base class.
*
* @package tool_brickfield
* @copyright 2020 Brickfield Education Labs https://www.brickfield.ie
*/
abstract class area_base {
/**
* Defines the unknown for the 'checkgroup' field in the tool_brickfield_checks table.
*/
const CHECKGROUP_UNKNOWN = 0;
/**
* Defines the form for the 'checkgroup' field in the tool_brickfield_checks table.
*/
const CHECKGROUP_FORM = 1;
/**
* Defines the image for the 'checkgroup' field in the tool_brickfield_checks table.
*/
const CHECKGROUP_IMAGE = 2;
/**
* Defines the layout for the 'checkgroup' field in the tool_brickfield_checks table.
*/
const CHECKGROUP_LAYOUT = 3;
/**
* Defines the link for the 'checkgroup' field in the tool_brickfield_checks table.
*/
const CHECKGROUP_LINK = 4;
/**
* Defines the media for the 'checkgroup' field in the tool_brickfield_checks table.
*/
const CHECKGROUP_MEDIA = 5;
/**
* Defines the table for the 'checkgroup' field in the tool_brickfield_checks table.
*/
const CHECKGROUP_TABLE = 6;
/**
* Defines the text for the 'checkgroup' field in the tool_brickfield_checks table.
*/
const CHECKGROUP_TEXT = 7;
/** @var string[] Array for quick access of string names for 'checkgroups'. */
const CHECKGROUP_NAMES = [
self::CHECKGROUP_UNKNOWN => 'unknown',
self::CHECKGROUP_FORM => 'form',
self::CHECKGROUP_IMAGE => 'image',
self::CHECKGROUP_LAYOUT => 'layout',
self::CHECKGROUP_LINK => 'link',
self::CHECKGROUP_MEDIA => 'media',
self::CHECKGROUP_TABLE => 'table',
self::CHECKGROUP_TEXT => 'text'
];
/**
* Defines field value.
*/
const TYPE_FIELD = 0;
/**
* Defines file value.
*/
const TYPE_FILE = 1;
/**
* Return the name for the specified checkgroup value, or 'unknown' if no valid name for the value. Preferably, use this rather
* than direct access to CHECKGROUP_NAMES, since it checks value boundaries.
* @param int $checkgroupvalue
* @return string
*/
final public static function checkgroup_name(int $checkgroupvalue): string {
if (($checkgroupvalue < 0) || ($checkgroupvalue >= count(self::CHECKGROUP_NAMES))) {
return self::CHECKGROUP_NAMES[self::CHECKGROUP_UNKNOWN];
} else {
return self::CHECKGROUP_NAMES[$checkgroupvalue];
}
}
/**
* Return the value for the specified checkgroup name, or the unknown value if no valid value for the name.
* @param string $checkgroupname
* @return int
*/
final public static function checkgroup_value(string $checkgroupname): int {
$value = array_search($checkgroupname, self::CHECKGROUP_NAMES);
return ($value !== false) ? $value : self::CHECKGROUP_UNKNOWN;
}
/**
* Return the defined content type.
* @return int
*/
protected function get_type(): int {
return self::TYPE_FIELD;
}
/**
* Return the component from the full class name.
* @return mixed|string
*/
public function get_component(): string {
$parts = preg_split('|\\\\|', get_class($this));
return $parts[3];
}
/**
* Check if the system plugin is avaliable.
* @return bool
*/
public function is_available(): bool {
list($type, $plugin) = \core_component::normalize_component($this->get_component());
if ($type === 'core') {
// We assume that all core components are defined corretly.
return true;
}
// Some contrib plugins may not be installed.
return ($dir = \core_component::get_component_directory($this->get_component()))
&& file_exists($dir . '/version.php');
}
/**
* Return the name of the database table where information is stored
* @return string
*/
abstract public function get_tablename(): string;
/**
* Return the name of the reference data table name.
* @return string
*/
public function get_ref_tablename(): string {
return '';
}
/**
* Return the name of the field in the table that has the content
* @return string
*/
abstract public function get_fieldname(): string;
/**
* Return a recordset of the relevant areas for the component/module.
* @param \core\event\base $event
* @return \moodle_recordset|null
*/
abstract public function find_relevant_areas(\core\event\base $event): ?\moodle_recordset;
/**
* Return a recordset of the course areas for the course id.
* @param int $courseid
* @return \moodle_recordset|null
*/
abstract public function find_course_areas(int $courseid): ?\moodle_recordset;
/**
* Return an array of area objects that contain content at the site and system levels only. Override this where necessary.
* @return \moodle_recordset|null
*/
public function find_system_areas(): ?\moodle_recordset {
return null;
}
/**
* The standard Moodle parameter DML parameter substitution doesn't work on all versions of MySQL or Postgres, so we need to use
* inline function substitution to ensure that the left side is a string.
* @return string
*/
public function get_standard_area_fields_sql(): string {
return '\'' . $this->get_component() . '\' AS component,
\'' . $this->get_tablename() . '\' AS tablename,
\'' . $this->get_fieldname() . '\' AS fieldorarea, ';
}
/**
* The standard Moodle parameter DML parameter substitution doesn't work on all versions of MySQL or Postgres, so we need to use
* inline function substitution to ensure that the left side is a string.
* @return string
*/
public function get_reftable_field_sql(): string {
return '\'' . $this->get_ref_tablename() . '\' AS reftable, ';
}
/**
* Processes any sql filtering data. Implement in extensions.
*
* @return null
* @throws \coding_exception
* @throws \dml_exception
*/
public function get_courseid_filtering() {
$this->filter = '';
$this->filterparams = [];
return null;
}
}
@@ -0,0 +1,258 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield;
defined('MOODLE_INTERNAL') || die;
// The curl class is in filelib.
global $CFG;
require_once("{$CFG->libdir}/filelib.php");
use curl;
use moodle_url;
/**
* Class brickfieldconnect. Contains all function to connect to Brickfield external services.
*
* @package tool_brickfield
* @author 2020 Onwards Mike Churchward <mike@brickfieldlabs.ie>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
*/
class brickfieldconnect extends curl {
/** @var string The base api uri. */
private static $baseapiuri = 'https://api.mybrickfield.ie/moodle/';
/** @var array Endpoint details for setting and checking a site registration */
const ACTION_CHECK_REGISTRATION = [
'endpoint' => 'checkRegister',
'method' => 'get',
];
/** @var array Endpoint details for sending site summary data */
const ACTION_SEND_SUMMARY = [
'endpoint' => 'summary',
'method' => 'post',
];
/**
* Object method to test whether site is already registered.
* @return bool
*/
public function is_registered(): bool {
return !empty($this->get_registration_id_for_credentials());
}
/**
* Update registration of this site.
* @param string $apikey The API key to use for the registration attempt
* @param string $secretkey The secret key to use
* @return bool
*/
public function update_registration(string $apikey, string $secretkey): bool {
$registrationid = $this->get_registration_id_for_credentials($apikey, $secretkey);
if (empty($registrationid)) {
return false;
}
(new registration())->set_siteid($registrationid);
return true;
}
/**
* Send the summary data to Brickfield.
* @return bool
* @throws \dml_exception
*/
public function send_summary(): bool {
// Run a registration check.
if (!(new registration())->validate()) {
return false;
}
$headers = $this->get_common_headers();
// Sanity-check $headers 'id' value.
if (!isset($headers['id'])) {
return false;
}
$this->set_headers($headers);
$summary = accessibility::get_summary_data($headers['id']);
$body = json_encode($summary, JSON_UNESCAPED_SLASHES);
$result = json_decode($this->call(self::ACTION_SEND_SUMMARY, $body));
if (is_object($result) && ((int)$result->statusCode === 200)) {
return true;
} else {
return false;
}
}
/**
* Get the URL required for the command.
*
* @param array $command The command to call, for example see self::ACTION_REGISTER
* @return string The complete URL
*/
protected function get_url_for_command(array $command): string {
return $this->get_baseapiuri() . $command['endpoint'];
}
/**
* Call the specified command.
*
* @param array $command The command to call, for example see self::ACTION_REGISTER
* @param array|string $params The params provided to the call
* @return string The response body
*/
protected function call(array $command, $params = ''): string {
$url = $this->get_url_for_command($command);
if ($command['method'] === 'get') {
return $this->get($url, $params);
}
if ($command['method'] === 'post') {
return $this->post($url, $params);
}
return '';
}
/**
* Get the common headers used for all calls to the Brickfields endpoints.
*
* @return array
*/
protected function get_common_headers(): array {
$headers = [
'Cache-Control' => 'no-cache',
'Content-Type' => 'application/json',
'siteurl' => static::get_siteurl(),
];
if (static::has_registration_key()) {
$registration = new registration();
$headers['secret'] = $registration->get_api_key();
$headers['userhash'] = $registration->get_secret_key();
$headers['id'] = $registration->get_siteid();
}
return $headers;
}
/**
* Set headers on the request from the specified list of headers.
*
* @param array $headers An array of header name => value
*/
protected function set_headers(array $headers) {
foreach ($headers as $key => $value) {
$this->setHeader("{$key}: {$value}");
}
}
/**
* Whether the site currently has a registration key stored.
*
* @return bool
*/
protected function has_registration_key(): bool {
$registration = new registration();
$localkey = $registration->get_api_key();
$localhash = $registration->get_secret_key();
$localid = $registration->get_siteid();
if (!$localhash || !$localkey || !$localid) {
return false;
}
return true;
}
/**
* Get a normalised URL for the site.
*
* @return string
*/
protected function get_siteurl(): string {
return (new moodle_url('/'))->out(false);
}
/**
* Get the registration ID for the given set of credentials.
* @param null|string $apikey The API key to use for the registration attempt
* @param null|string $secretkey The secret key to use
* @return null|string The registration ID if registration was successful, or null if not
*/
protected function get_registration_id_for_credentials(string $apikey = null, string $secretkey = null): string {
$headers = $this->get_common_headers();
if ($apikey || $secretkey) {
$headers['secret'] = $apikey;
$headers['userhash'] = $secretkey;
} else if (!$this->has_registration_key()) {
return '';
}
$this->set_headers($headers);
$response = $this->call(self::ACTION_CHECK_REGISTRATION);
if ((int)$this->info['http_code'] !== 200) {
// The response was unsuccessful.
return '';
}
$result = json_decode($response);
if (!$result) {
// The response could not be decoded.
return '';
}
if ((int)$result->statusCode !== 200) {
// The data from the response suggests a failure.
return '';
}
// Decode the actual result.
$registrationdata = json_decode($result->body);
if (empty($registrationdata) || !is_array($registrationdata)) {
// Unable to decode the body of the response.
return '';
}
if (!property_exists($registrationdata[0], 'id') || !property_exists($registrationdata[0]->id, 'N')) {
// Unable to find a valid id in the response.
return '';
}
return $registrationdata[0]->id->N;
}
/**
* Get the check registration API URI.
* @return string
* @throws dml_exception
*/
protected function get_baseapiuri(): string {
$baseapiuri = get_config(manager::PLUGINNAME, 'baseapiuri');
if (!empty($baseapiuri)) {
return $baseapiuri;
} else {
set_config('baseapiuri', self::$baseapiuri, manager::PLUGINNAME);
return self::$baseapiuri;
}
}
}
@@ -0,0 +1,54 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\event;
use tool_brickfield\manager;
/**
* Class analysis_requested
*
* @package tool_brickfield
* @copyright 2020 onward Brickfield Education Labs, https://www.brickfield.ie
* @author Mike Churchward <mike@brickfieldlabs.ie>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
*/
class analysis_requested extends \core\event\base {
/**
* Init function.
*/
protected function init() {
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_OTHER;
}
/**
* Get name.
* @return \lang_string|string
*/
public static function get_name() {
return get_string('eventanalysis_requested', manager::PLUGINNAME);
}
/**
* Get description.
* @return \lang_string|string|null
*/
public function get_description() {
return get_string('eventanalysis_requesteddesc', manager::PLUGINNAME, $this->other['course']);
}
}
@@ -0,0 +1,54 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\event;
use tool_brickfield\manager;
/**
* Class report_downloaded
*
* @package tool_brickfield
* @copyright 2020 onward Brickfield Education Labs, https://www.brickfield.ie
* @author Mike Churchward <mike@brickfieldlabs.ie>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
*/
class report_downloaded extends \core\event\base {
/**
* Init function.
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_OTHER;
}
/**
* Get name.
* @return \lang_string|string
*/
public static function get_name() {
return get_string('eventreport_downloaded', manager::PLUGINNAME);
}
/**
* Get description.
* @return \lang_string|string|null
*/
public function get_description() {
return get_string('eventreport_downloadeddesc', manager::PLUGINNAME, $this->courseid);
}
}
@@ -0,0 +1,54 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\event;
use tool_brickfield\manager;
/**
* Class report_viewed
*
* @package tool_brickfield
* @copyright 2020 onward Brickfield Education Labs, https://www.brickfield.ie
* @author Mike Churchward <mike@brickfieldlabs.ie>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
*/
class report_viewed extends \core\event\base {
/**
* Init function.
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_OTHER;
}
/**
* Get name.
* @return \lang_string|string
*/
public static function get_name() {
return get_string('eventreport_viewed', manager::PLUGINNAME);
}
/**
* Get description.
* @return \lang_string|string|null
*/
public function get_description() {
return get_string('eventreport_vieweddesc', manager::PLUGINNAME, (object)$this->other);
}
}
@@ -0,0 +1,438 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield;
use core\event\base;
use stdClass;
/**
* Observer class containing methods monitoring various events.
*
* @package tool_brickfield
* @copyright 2020 Brickfield Education Labs https://www.brickfield.ie
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
*/
class eventobservers {
/**
* For course events to be handled, the accessibility tool needs to be enabled, and if a courseid is specified, the course
* has to have been added to the scheduler.
* @param int $courseid
* @return bool
* @throws \dml_exception
*/
private static function course_event_should_be_handled(int $courseid): bool {
return accessibility::is_accessibility_enabled() && analysis::is_enabled() &&
(empty($courseid) || (isset($courseid) && scheduler::is_course_in_schedule($courseid)));
}
/**
* Content area altered event observer.
* @param base $event The area altered event.
* @throws \ReflectionException
* @throws \dml_exception
*/
private static function area_altered(base $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
manager::find_new_or_updated_areas($event);
}
}
/**
* Course event observers.
* These observer monitors course created / restored / updated events,
* then its HTML content is processed with accessibility checking.
*/
/**
* Course created event observer.
* @param \core\event\course_created $event The course created event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_created(\core\event\course_created $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
// Need to trigger rerun check for automatically created forum...
$data = new stdClass();
$data->courseid = $event->courseid;
$data->item = 'coursererun';
static::observer_insert($data);
static::course_altered($event);
}
}
/**
* Course deleted event observer.
* @param \core\event\course_deleted $event The course deleted event.
* @throws \dml_exception
*/
public static function course_deleted(\core\event\course_deleted $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
$data = new stdClass();
$data->courseid = $event->courseid;
$data->contextid = -1;
$data->item = 'core_course';
static::observer_insert($data);
}
}
/**
* Course restored event observer.
* @param \core\event\course_restored $event The course restored event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_restored(\core\event\course_restored $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
$data = new stdClass();
$data->courseid = $event->courseid;
$data->item = 'coursererun';
static::observer_insert($data);
static::course_altered($event);
}
}
/**
* Course update event observer.
* @param \core\event\course_updated $event The course updated event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_updated(\core\event\course_updated $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
static::course_altered($event);
}
}
/**
* Course update event observer. This is called on both course_created and course_updated, so use the base class as a type hint.
* @param base $event The course updated event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_altered(base $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
// Need to rerun caching of allowed courseid, from category white/blacklist.
$data = new stdClass();
$data->courseid = $data->contextid = $event->courseid;
$data->contextid = -1;
$data->item = 'category';
static::observer_insert($data);
static::area_altered($event);
}
}
/**
* Course section created event observer.
* @param \core\event\course_section_created $event The course section created event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_section_created(\core\event\course_section_created $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
static::area_altered($event);
}
}
/**
* Course section deleted event observer.
* @param \core\event\course_section_deleted $event The course section deleted event.
* @throws \dml_exception
*/
public static function course_section_deleted(\core\event\course_section_deleted $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
$data = new stdClass();
$data->courseid = $event->courseid;
$data->contextid = -1;
$data->innercontextid = $event->objectid;
$data->item = 'course_sections';
static::observer_insert($data);
}
}
/**
* Course section update event observer.
* @param \core\event\course_section_updated $event The course section updated event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_section_updated(\core\event\course_section_updated $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
static::area_altered($event);
}
}
/**
* Course module event observers.
* These observer monitors course module created / restored / updated events,
* then its HTML content is processed with accessibility checking.
*/
/**
* Course module created event observer.
* @param \core\event\course_module_created $event The course module created event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_module_created(\core\event\course_module_created $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
static::area_altered($event);
}
}
/**
* Course module deleted event observer.
* @param \core\event\course_module_deleted $event The course module deleted event.
* @throws \dml_exception
*/
public static function course_module_deleted(\core\event\course_module_deleted $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
$data = new stdClass();
$data->courseid = $event->courseid;
$data->contextid = -1;
$data->innercontextid = $event->other['instanceid'];
$data->item = 'mod_' . $event->other['modulename'];
static::observer_insert($data);
}
}
/**
* Course module restored event observer.
* @param \core\event\course_module_restored $event The course module restored event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_module_restored(\core\event\course_module_restored $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
static::area_altered($event);
}
}
/**
* Course module updated event observer.
* @param \core\event\course_module_updated $event The course module updated event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_module_updated(\core\event\course_module_updated $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
static::area_altered($event);
}
}
/**
* course_category created event observer.
* @param \core\event\course_category_created $event The course_category created event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_category_created(\core\event\course_category_created $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
static::area_altered($event);
}
}
/**
* course_category deleted event observer.
* @param \core\event\course_category_deleted $event The course_category deleted event.
* @throws \dml_exception
*/
public static function course_category_deleted(\core\event\course_category_deleted $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
$data = new stdClass();
$data->contextid = $data->courseid = -1;
$data->innercontextid = $event->objectid;
$data->item = 'course_categories';
static::observer_insert($data);
}
}
/**
* course_category update event observer.
* @param \core\event\course_category_updated $event The course_category updated event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function course_category_updated(\core\event\course_category_updated $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
static::area_altered($event);
}
}
/**
* mod_lesson_page created event observer.
* @param \mod_lesson\event\page_created $event The mod_lesson page created event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function mod_lesson_page_created(\mod_lesson\event\page_created $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
static::area_altered($event);
}
}
/**
* mod_lesson_page deleted event observer.
* @param \mod_lesson\event\page_deleted $event The mod_lesson page deleted event.
* @throws \dml_exception
*/
public static function mod_lesson_page_deleted(\mod_lesson\event\page_deleted $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
$data = new stdClass();
$data->courseid = $event->courseid;
$data->contextid = -1;
$data->innercontextid = $event->objectid;
$data->item = 'lesson_pages';
static::observer_insert($data);
}
}
/**
* mod_lesson_page updated event observer.
* @param \mod_lesson\event\page_updated $event The mod_lesson page updated event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function mod_lesson_page_updated(\mod_lesson\event\page_updated $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
static::area_altered($event);
}
}
/**
* core_question created observer
* @param \core\event\question_created $event The core_question created event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function core_question_created(\core\event\question_created $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
manager::find_new_or_updated_areas($event);
}
}
/**
* core_question updated observer
* @param \core\event\question_updated $event The core_question created event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function core_question_updated(\core\event\question_updated $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
manager::find_new_or_updated_areas($event);
}
}
/**
* core_question deleted observer
* @param \core\event\question_deleted $event The core_question deleted event.
* @throws \dml_exception
*/
public static function core_question_deleted(\core\event\question_deleted $event) {
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($event->courseid)) {
$data = new stdClass();
$data->courseid = $event->courseid;
$data->contextid = -1;
$data->innercontextid = $event->objectid;
$data->item = $event->objecttable;
static::observer_insert($data);
}
}
/**
* Book chapter created event observer.
* @param \mod_book\event\chapter_created $event The book chapter created event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function book_chapter_created(\mod_book\event\chapter_created $event) {
// If this feature has been disabled, do nothing.
if (accessibility::is_accessibility_enabled()) {
static::area_altered($event);
}
}
/**
* Book chapter deleted event observer.
* @param \mod_book\event\chapter_deleted $event The book chapter deleted event.
* @throws \dml_exception
*/
public static function book_chapter_deleted(\mod_book\event\chapter_deleted $event) {
// If this feature has been disabled, do nothing.
if (accessibility::is_accessibility_enabled()) {
$data = new stdClass();
$data->courseid = $event->courseid;
$data->contextid = -1;
$data->innercontextid = $event->objectid;
$data->item = 'book_chapters';
static::observer_insert($data);
}
}
/**
* Book chapter update event observer.
* @param \mod_book\event\chapter_updated $event The book chapter updated event.
* @throws \ReflectionException
* @throws \dml_exception
*/
public static function book_chapter_updated(\mod_book\event\chapter_updated $event) {
// If this feature has been disabled, do nothing.
if (accessibility::is_accessibility_enabled()) {
static::area_altered($event);
}
}
/**
* Add an observer record if appropriate.
* @param stdClass $data
* @throws \dml_exception
*/
private static function observer_insert(stdClass $data) {
global $DB;
// Handle if this feature is enabled and this course is in the schedule.
if (static::course_event_should_be_handled($data->courseid)) {
$data->timecreated = time();
$data->timecompleted = 0;
$DB->insert_record(manager::DB_PROCESS, $data);
}
}
}
@@ -0,0 +1,149 @@
<?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/>.
/**
* Class registration_form
*
* @package tool_brickfield
* @copyright 2021 Brickfield Education Labs https://www.brickfield.ie
* @author 2020 JM Tomas <jmtomas@tresipunt.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
*/
namespace tool_brickfield\form;
defined('MOODLE_INTERNAL') || die();
use coding_exception;
use dml_exception;
use html_writer;
use moodle_exception;
use moodleform;
use stdClass;
use tool_brickfield\manager;
use tool_brickfield\registration;
global $CFG;
require_once($CFG->libdir . '/formslib.php');
/**
* Class registration_form
*
* @package tool_brickfield
* @author 2020 JM Tomas <jmtomas@tresipunt.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
*/
class registration_form extends moodleform {
/**
* Form definition.
* @throws moodle_exception
*/
public function definition() {
$mform = & $this->_form;
$required = get_string('required');
$info = $this->get_defaultinfo();
$registration = new registration();
$key = $registration->get_api_key();
$hash = $registration->get_secret_key();
$mform->addElement('header', 'activationheader', get_string('activationheader', manager::PLUGINNAME));
$mform->addElement('text', 'key', get_string('secretkey', manager::PLUGINNAME));
$mform->setType('key', PARAM_TEXT);
$mform->setDefault('key', !empty($key) ? $key : '');
$mform->addHelpButton('key', 'secretkey', manager::PLUGINNAME);
$mform->addElement('text', 'hash', get_string('sitehash', manager::PLUGINNAME));
$mform->setType('hash', PARAM_TEXT);
$mform->setDefault('hash', !empty($hash) ? $hash : '');
$mform->addHelpButton('hash', 'sitehash', manager::PLUGINNAME);
$mform->addElement('header', 'moreinfo', get_string('moreinfo', manager::PLUGINNAME));
$mform->addElement('static', 'siteinfosummary', '',
get_string('sendfollowinginfo', manager::PLUGINNAME, $info->moreinfostring));
$mform->addElement('hidden', 'lang', $info->languagecode);
$mform->setType('lang', PARAM_TEXT);
$mform->addElement('hidden', 'countrycode', $info->country);
$mform->setType('countrycode', PARAM_TEXT);
$mform->addElement('hidden', 'url', $info->url);
$mform->setType('url', PARAM_URL);
$this->add_action_buttons(false, get_string('activate', manager::PLUGINNAME, '#'));
}
/**
* Get default data for registration form
*
* @throws moodle_exception
* @return stdClass
*/
protected function get_defaultinfo(): stdClass {
global $CFG;
$admin = get_admin();
$site = get_site();
$data = new stdClass();
$data->name = $site->fullname;
$data->url = $CFG->wwwroot;
$data->language = get_string('thislanguage', 'langconfig');
$data->languagecode = $admin->lang ?: $CFG->lang;
$data->country = $admin->country ?: $CFG->country;
$data->email = $admin->email;
$data->moreinfo = self::get_moreinfo();
$data->moreinfostring = self::get_moreinfostring($data->moreinfo);
return $data;
}
/**
* Get more information.
* @return array
* @throws dml_exception
*/
private static function get_moreinfo(): array {
global $CFG, $DB;
$moreinfo = array();
$moodlerelease = $CFG->release;
if (preg_match('/^(\d+\.\d.*?)[. ]/', $moodlerelease, $matches)) {
$moodlerelease = $matches[1];
}
$moreinfo['release'] = $moodlerelease;
$moreinfo['numcourses'] = $DB->count_records('course') - 1;
$moreinfo['numusers'] = $DB->count_records('user', array('deleted' => 0));
$moreinfo['numfiles'] = $DB->count_records('files');
$moreinfo['numfactivities'] = $DB->count_records('course_modules');
$moreinfo['mobileservice'] = empty($CFG->enablemobilewebservice) ? 0 : $CFG->enablemobilewebservice;
$moreinfo['usersmobileregistered'] = $DB->count_records('user_devices');
$moreinfo['contentyperesults'] = '';
$moreinfo['contenttypeerrors'] = '';
$moreinfo['percheckerrors'] = '';
return $moreinfo;
}
/**
* Get HTML list for more information.
*
* @param array $moreinfo
* @return string
* @throws coding_exception
*/
private static function get_moreinfostring(array $moreinfo): string {
$html = html_writer::start_tag('ul');
foreach ($moreinfo as $key => $value) {
$html .= html_writer::tag('li', get_string($key, manager::PLUGINNAME, $value));
}
$html .= html_writer::end_tag('ul');
return $html;
}
}
@@ -0,0 +1,118 @@
<?php
// This file is part of the Query submission plugin
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\local\areas\core_course;
use core\event\course_created;
use core\event\course_updated;
use core\event\course_restored;
use tool_brickfield\area_base;
/**
* Base class for various course-related areas
*
* This is an abstract class so it will be skipped by manager when it finds all areas
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class base extends area_base {
/**
* Find recordset of the relevant areas.
* @param \core\event\base $event
* @return \moodle_recordset|null
* @throws \coding_exception
* @throws \dml_exception
*/
public function find_relevant_areas(\core\event\base $event): ?\moodle_recordset {
if ($event instanceof course_created) {
return $this->find_fields_in_course_table(['courseid' => $event->courseid]);
} else if ($event instanceof course_restored) {
return $this->find_fields_in_course_table(['courseid' => $event->courseid]);
} else if ($event instanceof course_updated) {
return $this->find_fields_in_course_table(['courseid' => $event->courseid]);
}
return null;
}
/**
* Find recordset of the course areas.
* @param int $courseid
* @return \moodle_recordset
* @throws \coding_exception
* @throws \dml_exception
*/
public function find_course_areas(int $courseid): ?\moodle_recordset {
return $this->find_fields_in_course_table(['courseid' => $courseid]);
}
/**
* Return an array of area objects that contain content at the site and system levels only.
* @return mixed
*/
public function find_system_areas(): ?\moodle_recordset {
return null;
}
/**
* Helper method that can be used by the classes that define a field in the 'course' table
*
* @param array $params
* @return \moodle_recordset
* @throws \coding_exception
* @throws \dml_exception
*/
protected function find_fields_in_course_table(array $params = []): \moodle_recordset {
global $DB;
$where = [];
if (!empty($params['courseid'])) {
$where[] = 't.id = :courseid';
}
$rs = $DB->get_recordset_sql('SELECT
' . $this->get_type() . ' AS type,
ctx.id AS contextid,
' . $this->get_standard_area_fields_sql() . '
t.id AS itemid,
t.id AS courseid,
t.'.$this->get_fieldname().' AS content
FROM {'.$this->get_tablename().'} t
JOIN {context} ctx ON ctx.instanceid = t.id AND ctx.contextlevel = :pctxlevelcourse '.
($where ? 'WHERE ' . join(' AND ', $where) : '') . '
ORDER BY t.id',
['pctxlevelcourse' => CONTEXT_COURSE] + $params);
return $rs;
}
/**
* Returns the moodle_url of the page to edit the error.
* @param \stdClass $componentinfo
* @return \moodle_url
*/
public static function get_edit_url(\stdClass $componentinfo): \moodle_url {
if ($componentinfo->tablename == 'course_sections') {
return new \moodle_url('/course/editsection.php', ['id' => $componentinfo->itemid, 'sr' => '']);
} else if ($componentinfo->tablename == 'course_categories') {
return new \moodle_url('/course/editcategory.php', ['id' => $componentinfo->itemid]);
} else {
return new \moodle_url('/course/edit.php', ['id' => $componentinfo->courseid]);
}
}
}
@@ -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/>.
namespace tool_brickfield\local\areas\core_course;
use core\event\course_category_created;
use core\event\course_category_updated;
use tool_brickfield\area_base;
/**
* Base class for all areas that represent a field from the course_categories table (such as 'intro' or 'name')
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class category_base extends area_base {
/**
* Find recordset of the relevant areas.
* @param \core\event\base $event
* @return \moodle_recordset|null
* @throws \dml_exception
*/
public function find_relevant_areas(\core\event\base $event): ?\moodle_recordset {
if ($event instanceof course_category_updated || $event instanceof course_category_created) {
return $this->find_fields_in_course_categories_table(['itemid' => $event->objectid]);
}
return null;
}
/**
* Find recordset of the course areas.
* @param int $courseid
* @return \moodle_recordset|null
*/
public function find_course_areas(int $courseid): ?\moodle_recordset {
return null;
}
/**
* Return an array of area objects that contain content at the site and system levels only. All category content is considered
* system level.
* @return mixed
*/
public function find_system_areas(): ?\moodle_recordset {
return $this->find_fields_in_course_categories_table();
}
/**
* Helper method that can be used by the classes that define a field in the respective module table
*
* @param array $params
* @return \moodle_recordset
* @throws \dml_exception
*/
protected function find_fields_in_course_categories_table(array $params = []): \moodle_recordset {
global $DB;
$where = [];
if (!empty($params['itemid'])) {
$where[] = 't.id = :itemid';
}
$rs = $DB->get_recordset_sql('SELECT
' . $this->get_type() . ' AS type,
ctx.id AS contextid,
' . $this->get_standard_area_fields_sql() . '
t.id AS itemid,
t.id AS categoryid,
t.'.$this->get_fieldname().' AS content
FROM {'.$this->get_tablename().'} t
JOIN {context} ctx ON ctx.instanceid = t.id AND ctx.contextlevel = :pctxlevelcategory '.
($where ? 'WHERE ' . join(' AND ', $where) : '') . '
ORDER BY t.id',
['pctxlevelcategory' => CONTEXT_COURSECAT] + $params);
return $rs;
}
}
@@ -0,0 +1,43 @@
<?php
// This file is part of the Query submission plugin
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\local\areas\core_course;
/**
* Category description observer.
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class category_description extends category_base {
/**
* Get table name.
* @return string
*/
public function get_tablename(): string {
return 'course_categories';
}
/**
* Get field name.
* @return string
*/
public function get_fieldname(): string {
return 'description';
}
}
@@ -0,0 +1,43 @@
<?php
// This file is part of the Query submission plugin
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\local\areas\core_course;
/**
* Category name observer.
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class category_name extends category_base {
/**
* Get table name.
* @return string
*/
public function get_tablename(): string {
return 'course_categories';
}
/**
* Get field name.
* @return string
*/
public function get_fieldname(): string {
return 'name';
}
}
@@ -0,0 +1,43 @@
<?php
// This file is part of the Query submission plugin
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\local\areas\core_course;
/**
* Course full name observer.
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class fullname extends base {
/**
* Get table name.
* @return string
*/
public function get_tablename(): string {
return 'course';
}
/**
* Get field name.
* @return string
*/
public function get_fieldname(): string {
return 'fullname';
}
}
@@ -0,0 +1,126 @@
<?php
// This file is part of the Query submission plugin
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\local\areas\core_course;
use core\event\course_section_created;
use core\event\course_section_updated;
use tool_brickfield\area_base;
/**
* Course section name observer.
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class sectionname extends area_base {
/**
* Get table name.
* @return string
*/
public function get_tablename(): string {
return 'course_sections';
}
/**
* Get field name.
* @return string
*/
public function get_fieldname(): string {
return 'name';
}
/**
* Get table name reference.
* @return string
*/
public function get_ref_tablename(): string {
return 'course';
}
/**
* Find recordset of the relevant areas.
* @param \core\event\base $event
* @return \moodle_recordset|null
* @throws \coding_exception
* @throws \dml_exception
*/
public function find_relevant_areas(\core\event\base $event): ?\moodle_recordset {
if ($event instanceof course_section_created) {
return $this->find_fields_in_course_sections_table(['courseid' => $event->courseid, 'sectionid' => $event->objectid]);
} else if ($event instanceof course_section_updated) {
return $this->find_fields_in_course_sections_table(['courseid' => $event->courseid, 'sectionid' => $event->objectid]);
}
return null;
}
/**
* Find recordset of the course areas.
* @param int $courseid
* @return \moodle_recordset
* @throws \coding_exception
* @throws \dml_exception
*/
public function find_course_areas(int $courseid): ?\moodle_recordset {
return $this->find_fields_in_course_sections_table(['courseid' => $courseid]);
}
/**
* Helper method that can be used by the classes that define a field in the 'course_sections' table
*
* @param array $params
* @return \moodle_recordset
* @throws \coding_exception
* @throws \dml_exception
*/
protected function find_fields_in_course_sections_table(array $params = []): \moodle_recordset {
global $DB;
$where = [];
if (!empty($params['courseid'])) {
$where[] = 't.course = :courseid';
}
if (!empty($params['sectionid'])) {
$where[] = 't.id = :sectionid';
}
// Filter against approved / non-approved course category listings.
$this->filterfieldname = 'co.id';
$this->get_courseid_filtering();
if ($this->filter != '') {
$params = $params + $this->filterparams;
}
$rs = $DB->get_recordset_sql('SELECT
' . $this->get_type() . ' AS type,
ctx.id AS contextid,
' . $this->get_standard_area_fields_sql() . '
t.id AS itemid,
' . $this->get_reftable_field_sql() . '
t.course AS refid,
t.course AS courseid,
t.'.$this->get_fieldname().' AS content
FROM {'.$this->get_tablename().'} t
JOIN {course} co ON co.id = t.course
JOIN {context} ctx ON ctx.instanceid = co.id AND ctx.contextlevel = :pctxlevelcourse '.
($where ? 'WHERE ' . join(' AND ', $where) : '') . $this->filter . '
ORDER BY t.course',
['pctxlevelcourse' => CONTEXT_COURSE] + $params);
return $rs;
}
}
@@ -0,0 +1,126 @@
<?php
// This file is part of the Query submission plugin
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\local\areas\core_course;
use core\event\course_section_created;
use core\event\course_section_updated;
use tool_brickfield\area_base;
/**
* Course section summary observer.
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class sectionsummary extends area_base {
/**
* Get table name.
* @return string
*/
public function get_tablename(): string {
return 'course_sections';
}
/**
* Get field name.
* @return string
*/
public function get_fieldname(): string {
return 'summary';
}
/**
* Get table name reference.
* @return string
*/
public function get_ref_tablename(): string {
return 'course';
}
/**
* Find recordset of the relevant areas.
* @param \core\event\base $event
* @return \moodle_recordset|null
* @throws \coding_exception
* @throws \dml_exception
*/
public function find_relevant_areas(\core\event\base $event): ?\moodle_recordset {
if ($event instanceof course_section_created) {
return $this->find_fields_in_course_sections_table(['courseid' => $event->courseid, 'sectionid' => $event->objectid]);
} else if ($event instanceof course_section_updated) {
return $this->find_fields_in_course_sections_table(['courseid' => $event->courseid, 'sectionid' => $event->objectid]);
}
return null;
}
/**
* Find recordset of the course areas.
* @param int $courseid
* @return \moodle_recordset
* @throws \coding_exception
* @throws \dml_exception
*/
public function find_course_areas(int $courseid): ?\moodle_recordset {
return $this->find_fields_in_course_sections_table(['courseid' => $courseid]);
}
/**
* Helper method that can be used by the classes that define a field in the 'course_sections' table
*
* @param array $params
* @return \moodle_recordset
* @throws \coding_exception
* @throws \dml_exception
*/
protected function find_fields_in_course_sections_table(array $params = []): \moodle_recordset {
global $DB;
$where = [];
if (!empty($params['courseid'])) {
$where[] = 't.course = :courseid';
}
if (!empty($params['sectionid'])) {
$where[] = 't.id = :sectionid';
}
// Filter against approved / non-approved course category listings.
$this->filterfieldname = 'co.id';
$this->get_courseid_filtering();
if ($this->filter != '') {
$params = $params + $this->filterparams;
}
$rs = $DB->get_recordset_sql('SELECT
' . $this->get_type() . ' AS type,
ctx.id AS contextid,
' . $this->get_standard_area_fields_sql() . '
t.id AS itemid,
' . $this->get_reftable_field_sql() . '
t.course AS refid,
t.course AS courseid,
t.'.$this->get_fieldname().' AS content
FROM {'.$this->get_tablename().'} t
JOIN {course} co ON co.id = t.course
JOIN {context} ctx ON ctx.instanceid = co.id AND ctx.contextlevel = :pctxlevelcourse '.
($where ? 'WHERE ' . join(' AND ', $where) : '') . $this->filter . '
ORDER BY t.section',
['pctxlevelcourse' => CONTEXT_COURSE] + $params);
return $rs;
}
}
@@ -0,0 +1,43 @@
<?php
// This file is part of the Query submission plugin
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\local\areas\core_course;
/**
* Course shortname observer.
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class shortname extends base {
/**
* Get table name.
* @return string
*/
public function get_tablename(): string {
return 'course';
}
/**
* Get field name.
* @return string
*/
public function get_fieldname(): string {
return 'shortname';
}
}
@@ -0,0 +1,43 @@
<?php
// This file is part of the Query submission plugin
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\local\areas\core_course;
/**
* Course summary observer.
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class summary extends base {
/**
* Get table name.
* @return string
*/
public function get_tablename(): string {
return 'course';
}
/**
* Get field name.
* @return string
*/
public function get_fieldname(): string {
return 'summary';
}
}

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