Compare commits

..

499 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 08534dff50 Moodle release 3.10.8 2021-11-06 10:34:22 +01:00
Ilya Tregubov b6936f521b weekly release 3.10.7+ 2021-11-05 19:18:36 +02:00
Ilya Tregubov bf29fabccd Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-11-05 19:18:35 +02:00
Huong Nguyen 05ffb4680d MDL-71918 Calendar: Improve capability checks when fetching events 2021-11-05 13:16:04 +08:00
Jun Pataleta 47a3349629 Merge branch 'MDL-72667-310-fix' of https://github.com/lameze/moodle into MOODLE_310_STABLE 2021-11-05 12:45:04 +08:00
Simey Lameze 2cc0e5e744 MDL-72667 assign: change overdue message to darker red 2021-11-05 12:42:23 +08:00
Jun Pataleta 064306fd31 Merge branch 'MDL-72679-310' of git://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2021-11-05 12:41:01 +08:00
Andrew Nicols 03430b4e2f Merge branch 'MDL-72990-310' of https://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-11-05 11:58:52 +08:00
Andrew Nicols 415de33156 MDL-71439 core_grade: Coding style tidyup 2021-11-05 11:33:34 +08:00
Andrew Nicols 41a4a08a07 Merge branch 'MDL-71439_310' of https://github.com/mdjnelson/moodle into MOODLE_310_STABLE 2021-11-05 11:33:27 +08:00
Jun Pataleta 33e0235236 Merge branch 'MDL-72688-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-11-05 11:23:50 +08:00
Víctor Déniz 10477794b9 Merge branch 'MDL-72945-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-11-05 01:48:04 +00:00
Shamim Rezaie c562f8bb87 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:43:52 +11:00
Shamim Rezaie f9053d932e 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:38:32 +11:00
Víctor Déniz 47e5bf72af Merge branch 'MDL-72969-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-11-05 01:20:10 +00:00
AMOS bot ba40dbce29 Automatically generated installer lang files 2021-11-05 00:07:22 +00:00
Jun Pataleta 55f08b61ca Merge branch 'MDL-72667-310' of https://github.com/lameze/moodle into MOODLE_310_STABLE 2021-11-04 22:06:10 +08:00
Simey Lameze 17f1558a63 MDL-72667 message: fix contrast issue in the drawer 2021-11-04 21:21:12 +08:00
Simey Lameze 623b759934 MDL-72667 notifications: improve colour contrast 2021-11-04 21:21:11 +08:00
Simey Lameze 2afc498820 MDL-72667 lesson: improve colour contrast of correct text 2021-11-04 21:20:33 +08:00
Simey Lameze bee3b5656a MDL-72667 assign: improve contrast of not graded text 2021-11-04 21:20:33 +08:00
Jun Pataleta 6e8eb03e59 Merge branch 'MDL-72672-310' of https://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-11-04 18:23:10 +08:00
Simey Lameze cb57a6569a MDL-72672 lesson: make edit collapsed table responsive 2021-11-04 18:20:54 +08:00
Simey Lameze 898dbbb0ed MDL-72672 lesson: make detailed stats table responsive 2021-11-04 18:20:53 +08:00
Simey Lameze 9d83452a4c MDL-72672 lesson: make attempts table responsive 2021-11-04 18:20:52 +08:00
Simey Lameze fa90465f37 MDL-72672 lesson: add label for true/false checkboxes 2021-11-04 18:20:50 +08:00
Simey Lameze 4546974e30 MDL-72672 lesson: add label for multichoice checkboxes 2021-11-04 18:20:49 +08:00
Simey Lameze 516ca4373d MDL-72672 lesson: remove unnecessary nowrap
This commit also remove some deprecated table properties as well.
2021-11-04 18:20:48 +08:00
Simey Lameze baa337515e MDL-72672 mod_lesson: add aria-label to actions select element 2021-11-04 18:20:47 +08:00
Sara Arjona 1e9568597f Merge branch 'MDL-72949-310' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-11-04 10:33:41 +01:00
Nathan Nguyen e10cbb53f6 MDL-72679 qtype_ddmarker: Fix incorrect positions in multiple viewportss
Co-authored-by: Huong Nguyen <huongnv13@gmail.com>
2021-11-04 14:44:48 +07:00
Jun Pataleta c5cd2bbb13 Merge branch 'MDL-72668-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-11-04 12:04:27 +08:00
Shamim Rezaie 0843836725 MDL-72990 badges: Use imagecaption as alternative text for badge image 2021-11-04 15:04:14 +11:00
Shamim Rezaie b9a9967996 MDL-72668 block_badges: Add alt attribute to badge images 2021-11-04 14:20:10 +11:00
Shamim Rezaie 105cd1d7a0 MDL-72668 core: Highlight the focused tree item in a tree. 2021-11-04 14:20:10 +11:00
Shamim Rezaie 2d3e43ec62 MDL-72668 block_private_files: Switched from YUI to core/tree AMD 2021-11-04 14:20:07 +11:00
Víctor Déniz df9d3c744f Merge branch 'MDL-72895-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-11-04 01:50:56 +00:00
Paul Holden e36157f765 MDL-70823 qtype_ddwtos: new method for safer feedback unserializing. 2021-11-03 16:57:24 +01:00
Paul Holden f43285a28d MDL-70823 mod: safely parse module display options array. 2021-11-03 16:57:24 +01:00
Paul Holden f18f500a11 MDL-70823 blocks: safer unserializing during block restore. 2021-11-03 16:57:24 +01:00
Paul Holden dd66a550cb MDL-70823 core: safer alternative for unserializing objects. 2021-11-03 16:57:24 +01:00
sangnguyena 802f1a7a87 MDL-72949 WS: Return coursegraceperiod setting in tool_mobile_get_config 2021-11-03 16:09:53 +07:00
Ilya Tregubov 90a83f1ef3 Merge branch 'MOODLE_310_MDL-72953' of https://github.com/golenkovm/moodle into MOODLE_310_STABLE 2021-11-03 10:35:50 +02:00
Andrew Nicols 209f4292fc MDL-72894 courseexport: Whitespace fix 2021-11-03 16:12:01 +08:00
Andrew Nicols 34696d4a36 Merge branch 'MDL-72894-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-11-03 16:11:55 +08:00
Sara Arjona 46f2c2471f Merge branch 'MDL-72977-310' of https://github.com/juancs/moodle into MOODLE_310_STABLE 2021-11-03 09:04:07 +01:00
Ilya Tregubov 662639ba34 Merge branch 'MDL-71872-310' of https://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2021-11-03 09:27:39 +02:00
Jun Pataleta 106ac6b81e Merge branch 'MDL-72687-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-11-03 11:57:22 +08:00
Mikhail Golenkov 1b158e1e45 MDL-72953 core_lang: Add string for new timezone Pacific/Kanton 2021-11-03 11:40:10 +11:00
AMOS bot 4251c2a010 Automatically generated installer lang files 2021-11-03 00:07:22 +00:00
Paul Holden fc42ef155a MDL-72370 badges: require sesskey to remove related badge. 2021-11-02 18:04:16 +01:00
Ilya Tregubov faabe30597 MDL-70887 mlbackend_python: Update to latest version. 2021-11-02 18:04:16 +01:00
Simey Lameze 1dcb4f9aa3 MDL-72571 tool_filetypes: change extension param to PARAM_ALPHANUMEXT 2021-11-02 18:04:16 +01:00
Sara Arjona 4d084e8a11 Merge branch 'MDL-72857-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-11-02 18:01:41 +01:00
Eloy Lafuente (stronk7) 58f859fda6 weekly release 3.10.7+ 2021-11-02 14:07:57 +01:00
Eloy Lafuente (stronk7) ebfa38561a Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-11-02 14:07:56 +01:00
Juan Segarra Montesinos 297edf518d MDL-72977 qtype_essay: Honor Information for graders text format. 2021-11-02 12:22:22 +01:00
Simey Lameze f6eddf3ef8 MDL-72687 assign: move labels for toggle zoom icons to the <a> 2021-11-02 13:56:57 +08:00
Simey Lameze 4b2d40ec24 MDL-72687 assign: move labels for collapse buttons to the button 2021-11-02 13:56:57 +08:00
Simey Lameze 6fc89d13f2 MDL-72687 assign: remove title attr from view all submissions link 2021-11-02 13:56:56 +08:00
Simey Lameze 6b5eb6c2f4 MDL-72687 assign: move label from the edit settings icon to <a> 2021-11-02 13:56:56 +08:00
Simey Lameze 5ab92e459c MDL-72687 assign: remove presentation role from profile image 2021-11-02 13:56:56 +08:00
Simey Lameze aaea00fac4 MDL-72687 assign: fix email and due date cut off whem zooming 2021-11-02 13:56:56 +08:00
Simey Lameze 8af2a0d1e5 MDL-72687 assign: fix colour picker broken aria menu 2021-11-02 13:56:56 +08:00
Simey Lameze d823a6a109 MDL-72687 assign: fix stamp picker broken aria menu 2021-11-02 13:56:56 +08:00
Simey Lameze 9bde57d68b MDL-72687 assign: fix change filter element tab navigation 2021-11-02 13:56:56 +08:00
Simey Lameze 6d46bde5df MDL-72687 assign: use correct aria role for toolbar 2021-11-02 13:56:56 +08:00
Simey Lameze af6ac19818 MDL-72687 assign: add missing label to change user element 2021-11-02 13:56:55 +08:00
Simey Lameze 8e9a244acb MDL-72687 assign: display a more friendly link when not graded 2021-11-02 13:56:55 +08:00
Simey Lameze bff8d68915 MDL-72687 assign: add missing aria-label to prev/next arrows 2021-11-02 13:56:55 +08:00
Simey Lameze a852f9c33c MDL-72687 form: only add legend tag if a label is set 2021-11-02 13:56:55 +08:00
Andrew Nicols 6046c252e6 Merge branch 'MDL-72884-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-11-02 11:34:11 +08:00
Andrew Nicols 0af5f15eb7 Merge branch 'MDL-72767-m310' of https://github.com/NeillM/moodle into MOODLE_310_STABLE 2021-11-02 11:29:04 +08:00
AMOS bot f890546135 Automatically generated installer lang files 2021-11-02 00:07:23 +00:00
Paul Holden 6ad94202c3 MDL-72969 output: correct ansi colour format codes for check results. 2021-11-01 17:12:21 +00:00
Huong Nguyen 7ffc6c9e09 MDL-71872 Questions: The placeholder disappears when double-clicking 2021-11-01 17:30:24 +07:00
Paul Holden 13f3015dd6 MDL-72857 badges: filter site/course name when showing issued badge. 2021-11-01 10:20:45 +00:00
Neill Magill a83bc1c40c 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:51:26 +00:00
Neill Magill cda586322e 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:51:25 +00:00
Neill Magill 9761c06bd4 MDL-72767 forum: Fix PHPDoc 2021-11-01 08:51:25 +00:00
Andrew Nicols 7e528a6da8 Merge branch 'MDL-72921_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-11-01 08:56:00 +08:00
AMOS bot fbbddaa3e5 Automatically generated installer lang files 2021-10-30 00:07:21 +00:00
Eloy Lafuente (stronk7) 2b140aac6c 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:50 +02:00
Eloy Lafuente (stronk7) 96911f0c1a weekly release 3.10.7+ 2021-10-29 17:10:15 +02:00
Eloy Lafuente (stronk7) b45b272a45 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-29 17:10:14 +02:00
Eloy Lafuente (stronk7) 06eb5a762f 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 14:00:41 +02:00
Huong Nguyen 6742fa55be MDL-72895 Assignment: Fix colour contrast for grading navigation 2021-10-29 18:53:22 +08:00
Shamim Rezaie c0d9cbcced Merge branch 'MDL-72874-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-10-29 03:35:33 +11:00
Shamim Rezaie c72f637d37 Merge branch 'MDL-72924-fix-component-initialisation-for-performance-checks-MOODLE_310_STABLE' of https://github.com/keevan/moodle into MOODLE_310_STABLE 2021-10-29 02:57:23 +11:00
Sara Arjona 054d49fe3d MDL-72945 badges: use default issuer contact
The defaultissuercontact was ignored if the sitebackpack email was set
to empty string..
2021-10-28 17:45:10 +02:00
Víctor Déniz dab1898dd1 Merge branch 'MDL-72912_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-10-28 15:45:40 +01:00
Víctor Déniz dfe37f0c6b Merge branch 'MDL-72901_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-10-28 13:49:25 +01:00
Eloy Lafuente (stronk7) d16a375088 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:51 +02:00
Eloy Lafuente (stronk7) 2572fdc856 Merge branch 'MDL-72743-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-28 13:11:47 +02:00
Andrew Nicols c5e217856a Merge branch 'MDL-72871_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-10-28 14:16:32 +08:00
Jun Pataleta dda001d3d3 Merge branch 'MDL-72316-310-2' of git://github.com/mickhawkins/moodle into MOODLE_310_STABLE 2021-10-28 13:50:35 +08:00
Michael Hawkins 29cfeda7b5 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 13:06:07 +08:00
Kevin Pham 48f390046d MDL-72924 check: Fix component initialisation for performance checks 2021-10-28 14:22:41 +11:00
Eloy Lafuente (stronk7) 6a6e407f70 Merge branch 'MDL-72879-310-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-10-27 22:12:41 +02:00
Jun Pataleta 955800114b Merge branch 'MDL-72669-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-10-27 15:07:52 +08:00
Mark Nelson e89ba50b71 MDL-71439 core_grades: return a blank mustache template for letters 2021-10-27 12:20:34 +08:00
Mark Nelson 569024b0d9 MDL-71439 mod_forum: display user grade from web service 2021-10-27 12:20:34 +08:00
Mark Nelson ef9594be52 MDL-71439 core_grades: return result of new method in web services 2021-10-27 12:20:34 +08:00
Mark Nelson a93e25a05f MDL-71439 core_grades: add new method 'get_formatted_grade_for_user' 2021-10-27 12:20:34 +08:00
Mark Nelson d46acf02fa MDL-71439 core_grades: fixed undefined class issues 2021-10-27 12:20:33 +08:00
Mark Nelson dd7d81b872 MDL-71439 core_grades: remove returning null when not possible
The method explicitly declares 'stdClass' as the return type.
2021-10-27 12:20:33 +08:00
AMOS bot fb4878f231 Automatically generated installer lang files 2021-10-27 00:07:22 +00:00
Eloy Lafuente (stronk7) 612f688949 Merge branch 'MDL-72913-310' of git://github.com/NoelDeMartin/moodle into MOODLE_310_STABLE 2021-10-26 17:22:17 +02:00
Eloy Lafuente (stronk7) 9424c7464e 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:22 +02:00
Víctor Déniz 9fd7f2c0be weekly release 3.10.7+ 2021-10-26 13:44:11 +01:00
Víctor Déniz c4372bb149 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-26 13:44:09 +01:00
Tim Hunt 466b94469e MDL-72912 questions: fix type of question_display_options::$context 2021-10-26 08:06:37 +01:00
Noel De Martin ee3caf8593 MDL-72913 course: Fix require statement 2021-10-26 08:53:22 +02:00
Helen Foster a7b0d7cb7b MDL-72879 lang: Import fixed English strings (en_fix) 2021-10-25 21:01:52 +02:00
Paul Holden 8f592b3e3b 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:07:58 +01:00
Andrew Nicols 35bbdfbef5 Merge branch 'MDL-71750-310' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-10-25 13:58:46 +08:00
AMOS bot 3287734e73 Automatically generated installer lang files 2021-10-24 00:07:24 +00:00
Tim Hunt 0260a426c8 MDL-72901 question: add missing {$a} in string attemptfinishedsubmitting 2021-10-22 23:16:44 +01:00
Ilya Tregubov 01bdec3021 weekly release 3.10.7+ 2021-10-22 12:49:06 +02:00
Shamim Rezaie 6bf3f5f911 MDL-72669 qtype_multianswer: Replace empty option with NBSP 2021-10-22 16:02:32 +11:00
Víctor Déniz 884bf887b2 Merge branch 'MDL-72607-fix_media_vimeo_url_parser' of https://github.com/praxisdigital/moodle into MOODLE_310_STABLE 2021-10-22 00:03:34 +01:00
Paul Holden d42c4f2fff 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:37 +01:00
Paul Holden 08076fbff0 MDL-72743 mod_quiz: verify user mapping prior to restoring attempts. 2021-10-21 08:26:33 +01:00
Eloy Lafuente (stronk7) d277a76ec0 Merge branch 'MDL-72013-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-10-21 09:17:17 +02:00
Andrew Nicols aac3479ad8 Merge branch 'MDL-72507-310' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-10-21 13:00:32 +08:00
Andrew Nicols 04ce020099 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:16 +08:00
Andrew Nicols e7c219aa59 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 bc301d0b55 MDL-72013 js: Add eslint-jsdoc plugin 2021-10-21 08:52:57 +08:00
Andrew Nicols e7f1069aa3 MDL-72013 js: Fix jsdocs to meet stricter eslint 2021-10-21 08:52:57 +08:00
Ilya Tregubov 8dbfccfaf4 Merge branch 'MDL-72639-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-20 13:01:36 +02:00
Eloy Lafuente (stronk7) 551584fdb5 Merge branch 'MDL-72849-m310' of https://github.com/sammarshallou/moodle into MOODLE_310_STABLE 2021-10-19 22:17:23 +02:00
sam marshall 908175aa5a 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:50:49 +01:00
Ilya Tregubov 81c2310aec Merge branch 'MDL-71270-310' of git://github.com/mickhawkins/moodle into MOODLE_310_STABLE 2021-10-19 14:46:56 +02:00
Eloy Lafuente (stronk7) cce486dfc5 weekly release 3.10.7+ 2021-10-19 12:51:53 +02:00
Eloy Lafuente (stronk7) 84aa260b18 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-19 12:51:51 +02:00
Andrew Nicols e909b6ac53 MDL-71785 mod_quiz: Correct string as per reviewer feedback 2021-10-19 11:20:57 +08:00
Andrew Nicols d98071bad5 Merge branch 'MDL-71785_310' of https://github.com/StudiUM/moodle into MOODLE_310_STABLE 2021-10-19 11:20:55 +08:00
Sara Arjona d0e4af123c Merge branch 'MDL-72590-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-10-18 17:38:45 +02:00
Luca Bösch 1d5a547027 MDL-72590 enrol: Course in success message after unenroll passes filter 2021-10-18 16:38:19 +02:00
Sara Arjona 281b23d7d2 Merge branch 'MDL-72064-310' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-10-18 12:59:51 +02:00
Michael Hawkins 33a68275a3 MDL-71270 core: Updated security.txt expiry 2021-10-18 17:14:17 +08:00
Sam Møller 6b93cb6a3a 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:43:08 +02:00
Andrew Nicols 61e3074574 Merge branch 'MDL-65943-310' of git://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2021-10-18 14:05:29 +08:00
Huong Nguyen 0df31d4324 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 12:00:37 +07:00
AMOS bot 14b8cba9f3 Automatically generated installer lang files 2021-10-16 00:07:29 +00:00
Shamim Rezaie cede428cc4 weekly release 3.10.7+ 2021-10-16 00:29:25 +11:00
Shamim Rezaie 30837de74c Merge branch 'MDL-71344-310' of git://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2021-10-15 14:27:42 +11:00
Jun Pataleta b26ee161cb Merge branch 'MDL-72623_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-10-15 09:47:03 +08:00
Jun Pataleta cc259e05d1 Merge branch 'MDL-72807_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-10-15 09:08:15 +08:00
Eloy Lafuente (stronk7) 3d207d282c Merge branch 'MDL-26633-310-workshopnumofreviews' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-10-14 22:41:02 +02:00
Eloy Lafuente (stronk7) d3b0abf253 Merge branch 'MDL-68325-310' of git://github.com/odeialba/moodle into MOODLE_310_STABLE 2021-10-14 22:19:40 +02:00
Eloy Lafuente (stronk7) 56297afaf4 Merge branch 'MDL-72464-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-14 22:02:36 +02:00
Eloy Lafuente (stronk7) 344ff84559 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:17:20 +02:00
Eloy Lafuente (stronk7) ea0adf9302 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:58 +02:00
Andrew Nicols 2805514fb4 weekly release 3.10.7+ 2021-10-13 09:40:53 +08:00
Andrew Nicols 1699daee3b Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-13 09:40:52 +08:00
AMOS bot 037c988ffa Automatically generated installer lang files 2021-10-13 00:07:21 +00:00
Víctor Déniz fc5b9dcd66 Merge branch 'MDL-72498-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-12 15:34:49 +08:00
Huong Nguyen b7adb5da3f MDL-71344 questions: Improve event handler for Drag n Drop family 2021-10-11 11:05:23 +07:00
Andrew Nicols c8530a1956 Merge branch 'MDL-66203-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-10-11 08:37:37 +08:00
Paul Holden fac4ab52e0 MDL-72639 admin: consistent primary buttons during site upgrade. 2021-10-10 20:43:26 +01:00
Paul Holden 9e1cc7c039 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:49 +01:00
Paul Holden 2163c70d1c MDL-72464 webservice: fix detection of non-expiring external tokens. 2021-10-10 20:40:47 +01:00
David Mudrák f5bb18e153 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:35:43 +02:00
Sara Arjona 7cef80d284 weekly release 3.10.7+ 2021-10-08 12:43:24 +02:00
Sara Arjona 63f8c08bb6 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-08 12:43:23 +02:00
AMOS bot 571e9516b4 Automatically generated installer lang files 2021-10-08 00:07:23 +00:00
Víctor Déniz 815c4943fa Merge branch 'MOODLE_310_MDL-64576' of https://github.com/golenkovm/moodle into MOODLE_310_STABLE 2021-10-07 22:28:24 +01:00
Eloy Lafuente (stronk7) 37cbcfabc3 Merge branch 'MDL-71306-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-07 23:10:17 +02:00
Eloy Lafuente (stronk7) 36f64e7023 Merge branch 'MDL-72674-310' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-10-07 22:54:14 +02:00
Eloy Lafuente (stronk7) 49e05ee653 Merge branch 'MDL-72309-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-07 22:43:05 +02:00
Eloy Lafuente (stronk7) dba8c123ad Merge branch 'MDL-72635-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-10-07 22:39:12 +02:00
Eloy Lafuente (stronk7) a2a370818d Merge branch 'MDL-72621-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-10-07 21:10:45 +02:00
AMOS bot be04192910 Automatically generated installer lang files 2021-10-07 00:07:21 +00:00
Jun Pataleta be71182f32 Merge branch 'MDL-72339-m310' of https://github.com/sammarshallou/moodle into MOODLE_310_STABLE 2021-10-06 22:44:26 +08:00
sam marshall ca7b088d44 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:27:42 +01:00
Andrew Nicols ad360f54fd Merge branch 'MDL-72515-310' of git://github.com/marinaglancy/moodle into MOODLE_310_STABLE 2021-10-06 13:17:37 +08:00
Ilya Tregubov c1e2d9c2ff Merge branch 'MDL-72452-resource-filter-310' of https://github.com/Peterburnett/moodle into MOODLE_310_STABLE 2021-10-06 10:56:21 +07:00
Andrew Nicols fc79234d6d Merge branch 'MDL-72599-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-06 09:13:27 +08:00
Eloy Lafuente (stronk7) 278c3dfb4d weekly release 3.10.7+ 2021-10-06 00:24:55 +02:00
Ilya Tregubov 586d84ad0b Merge branch 'MDL-56773-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-10-05 23:32:54 +02:00
Jun Pataleta d92ed8b795 Merge branch 'MDL-39324-moodle310' of https://github.com/kiratskitizing/moodle into MOODLE_310_STABLE 2021-10-05 23:32:54 +02:00
Simey Lameze b7c34fb5e3 MDL-72635 calendar: fix typo in data attribute 2021-10-05 06:30:57 +08:00
Paul Holden a9046afce1 MDL-71306 cohort: ignore empty values in form autocomplete element. 2021-10-04 21:14:53 +01:00
Joshua Ebarvia 51e35ec47d MDL-39324 mod_url: Fix icon when URL has params 2021-10-04 20:02:02 +10:30
Marina Glancy 374717d6ec MDL-72515 admin: do not call curl unnecessary on plugins page 2021-10-04 10:01:18 +02:00
Paul Holden 56f275036b 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:47 +01:00
Mikhail Golenkov 3f128992d2 MDL-64576 completion: Fix criteria and course completion dates 2021-10-04 10:53:34 +11:00
Shamim Rezaie 85f18da71d MDL-66203 mod_assign: Reset submission status when removing a submission 2021-10-04 02:13:54 +11:00
Eloy Lafuente (stronk7) e57b280e00 weekly release 3.10.7+ 2021-10-02 22:05:17 +02:00
Eloy Lafuente (stronk7) 1c38736a13 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-02 22:05:16 +02:00
Eloy Lafuente (stronk7) 0009f62945 Merge branch 'MDL-72714_310' of git://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-10-02 15:29:53 +02:00
Eloy Lafuente (stronk7) e29998cf8e 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:25 +02:00
Eloy Lafuente (stronk7) e2d9c69819 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:25 +02:00
abgreeve 3b8c9e1a99 Merge branch 'MDL-69682-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-01 11:27:09 +08:00
Jun Pataleta 2e9e4ca1df 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:40:18 +08:00
Andrew Nicols b21aa1e011 Merge branch 'MDL-72673-310' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-10-01 10:24:09 +08:00
Eloy Lafuente (stronk7) a5a7b1d2c5 Merge branch 'MDL-72484-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-30 23:19:24 +02:00
Víctor Déniz 8645227c34 Merge branch 'MDL-72399_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-09-30 16:10:18 +01:00
Víctor Déniz d62f2e79b7 Merge branch 'MDL-72496-310_assert_tag' of https://github.com/call-learning/moodle into MOODLE_310_STABLE 2021-09-30 15:40:49 +01:00
Laurent David 5d5cd02239 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:51 +02:00
Thong Bui f28abb53e0 MDL-72507 Quiz: Quiz auto-save does not detect uploaded files 2021-09-30 12:18:44 +07:00
abgreeve edafd88b34 Merge branch 'MDL-72275-310-2' of git://github.com/mickhawkins/moodle into MOODLE_310_STABLE 2021-09-30 10:08:26 +08:00
AMOS bot d126cf25ae Automatically generated installer lang files 2021-09-30 00:07:22 +00:00
Eloy Lafuente (stronk7) 0eeec9ead8 Merge branch 'MDL-71970-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-09-29 23:27:34 +02:00
Andrew Nicols 82d04b0144 MDL-72621 admin: Add environment check for admin deprecation 2021-09-29 22:39:32 +08:00
Shamim Rezaie 89e834ef1e Merge branch 'MDL-72060-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-09-28 20:13:41 +10:00
Adrian Perez 3399c49298 MDL-72060 mod_lti: fix comparison if user is gradable 2021-09-28 17:26:25 +08:00
AMOS bot 708943ec2e Automatically generated installer lang files 2021-09-28 00:07:29 +00:00
Paul Holden 88c1da303c MDL-72484 report_eventlist: looser check for event 'other' docs. 2021-09-27 18:21:27 +01:00
Sara Arjona 23fb47e2cf 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:43:37 +02:00
Sara Arjona f8cffbbf7e 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:43:37 +02:00
Sara Arjona ae3066690c 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:43:37 +02:00
Jun Pataleta d09bbc9f14 MDL-72673 mod_glossary: Generate unique ID for Keywords select element 2021-09-24 18:31:34 +08:00
Paul Holden 9a0e343654 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:52 +01:00
Michael Hawkins 0f65d529fd 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:24:49 +08:00
Michael Hawkins e65db9fe04 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:24:49 +08:00
Michael Hawkins 1b29aea633 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:24:49 +08:00
Michael Hawkins dcf2239198 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:24:49 +08:00
AMOS bot 83b6ed8fd1 Automatically generated installer lang files 2021-09-24 00:07:28 +00:00
Eloy Lafuente (stronk7) 9675c9e914 MDL-72399 GHA: Go back to use upstream igbinary extension
With igbinary >=3.2.6 already built, see

https://launchpad.net/~ondrej/+archive/ubuntu/php/+packages?field.name_filter=igbinary&field.status_filter=published

We can revert the temporal workaround applied few weeks ago (that
sometimes is failing). So this is a simple revert of the original commit.

Revert "MDL-72312 GHA: Force use of igbinary working version"

This reverts commit ced1550177.
2021-09-23 19:37:55 +02:00
Ilya Tregubov 0360329c46 weekly release 3.10.7+ 2021-09-23 18:21:54 +02:00
Ilya Tregubov d9dfcb86a3 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-09-23 18:21:54 +02:00
Jun Pataleta 3ee6448d1d Merge branch 'MDL-72426-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-09-23 12:24:00 +08:00
Thong Bui 5e8baa62f3 MDL-71750 File upload: Disable submittion when uploading multiple files 2021-09-23 09:13:02 +07:00
AMOS bot 9a2ab7641a Automatically generated installer lang files 2021-09-23 00:07:24 +00:00
Eloy Lafuente (stronk7) f0b48631c1 Merge branch 'MDL-72110-310' of https://github.com/sharidas/moodle into MOODLE_310_STABLE 2021-09-22 20:12:27 +02:00
Eloy Lafuente (stronk7) 7268b98f0d Merge branch 'MDL-72593-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-09-22 10:48:28 +02:00
Jun Pataleta 63706d6044 Merge branch 'MDL-51165-moodle310' of https://github.com/kiratskitizing/moodle into MOODLE_310_STABLE 2021-09-22 10:51:52 +08:00
AMOS bot 0ca10e3942 Automatically generated installer lang files 2021-09-22 00:07:25 +00:00
Eloy Lafuente (stronk7) fdfbf416b3 Merge branch 'MDL-71352-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-09-21 23:19:47 +02:00
Eloy Lafuente (stronk7) 70d5ba992d Merge branch 'MDL-69364-310-alt' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-09-21 18:19:43 +02:00
Andrew Nicols 24d9c5e6ce 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:50 +08:00
Andrew Nicols 3d82fe756c 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:49 +08:00
Andrew Nicols 4d5b16b22b MDL-69364 enrol: Improve setting of save button 2021-09-20 12:07:58 +08:00
Andrew Nicols 871ee28e3b MDL-69364 enrol: Improve cohort test 2021-09-20 12:07:58 +08:00
Joshua Ebarvia 843988882f MDL-51165 mod_url: allow directory index url direct access 2021-09-19 12:07:28 +09:30
Marie-Eve Lévesque f2c42a1fe3 MDL-71785 core_quiz: Empty quiz section name behaves like new page 2021-09-17 11:32:52 -04:00
Paul Holden 8825279be6 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:54 +01:00
Luca Bösch e3958e5a8c MDL-71352 gradereport_grader: Add icons for pass/fail. 2021-09-17 12:12:29 +02:00
Ilya Tregubov 41cfb8996a weekly release 3.10.7+ 2021-09-17 08:58:36 +02:00
Ilya Tregubov 0ccf676b79 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-09-17 08:58:35 +02:00
Ilya Tregubov 5ee956d6c9 Merge branch 'MDL-72173-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-09-16 15:02:17 +02:00
Andrew Nicols eacfa23bcc MDL-72173 behat: Respect login page preference 2021-09-16 20:47:18 +08:00
Jun Pataleta 5f644ae3ad Merge branch 'MDL-72173-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-09-16 15:39:56 +08:00
Andrew Nicols 5e2b248b20 MDL-72173 behat: Fix typo Logout <> Log out 2021-09-16 15:03:07 +08:00
Jun Pataleta 52cfb19f05 Merge branch 'MDL-71602-310-2' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-09-16 12:57:41 +08:00
Jun Pataleta 4619f8c4d0 Merge branch 'MDL-72173-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-09-16 12:23:03 +08:00
Andrew Nicols a4e338dd60 MDL-72173 behat: Add tests for login/logout steps 2021-09-16 12:20:37 +08:00
Andrew Nicols fe0af7ad54 MDL-72173 behat: Automatically log user out on behat login 2021-09-16 12:13:26 +08:00
Andrew Nicols f9888aca4e MDL-72173 behat: Add and use behat logout URL 2021-09-16 12:13:26 +08:00
Jake Dallimore 877288e0c1 Merge branch 'MDL-71860-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-09-16 11:03:20 +08:00
Jun Pataleta b0835ce1d4 Merge branch 'MDL-72589_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-09-16 09:46:42 +08:00
AMOS bot 1acba692e3 Automatically generated installer lang files 2021-09-16 00:07:24 +00:00
Leon Stringer 2a785a209a 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:01:42 +08:00
Eloy Lafuente (stronk7) 5923a1baaa Merge branch 'MDL-72432-MOODLE_310_STABLE' of https://github.com/katerynadegtyariova/moodle into MOODLE_310_STABLE 2021-09-16 00:37:29 +02:00
Eloy Lafuente (stronk7) cfbefac189 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:28:31 +02:00
Eloy Lafuente (stronk7) 905741ee47 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:28:26 +02:00
Jake Dallimore 9fbff304da Merge branch 'MDL-71550-310' of git://github.com/bmbrands/moodle into MOODLE_310_STABLE 2021-09-15 10:50:01 +08:00
Jake Dallimore 548b2e7921 Merge branch 'MDL-71137-310' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-09-15 10:12:30 +08:00
Eloy Lafuente (stronk7) 8cadc4dcca Merge branch '71093-moodle310-backup-honor-formatstringstriptags' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_310_STABLE 2021-09-14 22:22:28 +02:00
Eloy Lafuente (stronk7) 248c791132 Merge branch 'MDL-72192-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-14 22:17:41 +02:00
Ilya Tregubov 7326bc1246 Merge branch 'MDL-71961-310' of git://github.com/nguyenphuctien/moodle into MOODLE_310_STABLE 2021-09-14 12:09:37 +02:00
Ilya Tregubov a81035a211 Merge branch 'MDL-71846-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-13 13:44:41 +02:00
Tien Nguyen da619ac46f MDL-71961 Quiz: Disable quiz navigation buttons when files are uploading 2021-09-13 17:42:33 +07:00
Odei Alba 4c1894aa97 MDL-68325 completion: Add validation to course completion form 2021-09-13 12:12:53 +02:00
Andrew Nicols 07e69d234e MDL-72173 behat: Switch to behat login URL 2021-09-13 11:20:35 +08:00
gthomas2 5fad08121e MDL-72173 behat: Add alternative login file for behat 2021-09-13 11:14:02 +08:00
Eloy Lafuente (stronk7) 5af6e79b38 Moodle release 3.10.7 2021-09-12 12:37:31 +02:00
Eloy Lafuente (stronk7) afa3c2a13f weekly release 3.10.6+ 2021-09-11 12:12:23 +02:00
Eloy Lafuente (stronk7) 10e6791ee0 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-09-11 12:12:21 +02:00
Shamim Rezaie 194b964dc5 MDL-71240 filter_tex: Add allowlist for filter_tex_sanitize_formula 2021-09-10 18:10:26 +02:00
Eloy Lafuente (stronk7) 3d94d6fb6a Merge branch 'MDL-71385-310-3' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-09-09 13:01:37 +02:00
Eloy Lafuente (stronk7) 83e94a25cf Merge branch 'MDL-63207-310' of git://github.com/cescobedo/moodle into MOODLE_310_STABLE 2021-09-09 13:01:37 +02:00
Eloy Lafuente (stronk7) 60a4c78f98 Merge branch 'MDL-69855-310' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-09-09 13:01:37 +02:00
Jun Pataleta 0095f26934 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:58 +08:00
AMOS bot 18678fc78e Automatically generated installer lang files 2021-09-09 00:07:22 +00:00
Eloy Lafuente (stronk7) b5366af358 Merge branch 'MDL-72216-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-09-08 11:29:16 +02:00
Eloy Lafuente (stronk7) 90e0a2c746 Merge branch 'MDL-72499-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-07 23:52:09 +02:00
Eloy Lafuente (stronk7) 45a7e77e6c Merge branch 'MDL-72071-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-07 23:30:04 +02:00
Eloy Lafuente (stronk7) 0110d5a4ad Merge branch 'MDL-72488-310-importdatastring' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-09-07 23:00:23 +02:00
cescobedo f01cff47d2 MDL-63207 auth_ldap: Update user profile if field is empty 2021-09-07 22:57:02 +02:00
Eloy Lafuente (stronk7) 83b771c9be Merge branch 'MDL-69504-310' of https://github.com/snake/moodle into MOODLE_310_STABLE 2021-09-07 20:04:22 +02:00
Eloy Lafuente (stronk7) a85148d645 Merge branch 'MDL-67610-310-2' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-09-07 19:25:35 +02:00
Jun Pataleta d65f46103a 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:33 +08:00
AMOS bot 98679b981c Automatically generated installer lang files 2021-09-07 00:07:23 +00:00
Paul Holden ec4c5a0e35 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:39 +02:00
Sujith Haridasan 4ffc17be15 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:39 +02:00
Paul Holden e2b3d5fec5 MDL-71976 auth_shibboleth: consistent session parsing during logout. 2021-09-07 00:14:39 +02:00
Shamim Rezaie 1b6f1756f6 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:39 +02:00
Shamim Rezaie cd7fa2e513 MDL-71240 filter_tex: Support paranoid mode for openin_any in latex 2021-09-07 00:14:39 +02:00
Huong Nguyen 0cd2cbccfb MDL-71797 quiz: Improve the checks when fetching user's attempts 2021-09-07 00:14:39 +02:00
Eloy Lafuente (stronk7) c05d2669bd Merge branch 'MDL-72286-310-test' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-09-06 23:58:25 +02:00
David Mudrák c755938aa3 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:50 +02:00
Paul Holden 55deada25a MDL-72499 event: add/correct event language strings as required. 2021-09-06 11:16:45 +01:00
Thong Bui 75eff1bf89 MDL-71137 File upload: progress bar issues display when D&D multi files 2021-09-06 14:12:51 +07:00
Eloy Lafuente (stronk7) 536876611d Merge branch 'MDL-72428-310-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-09-03 19:10:45 +02:00
Eloy Lafuente (stronk7) 7aded627d8 Merge branch 'MDL-72478-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-09-03 17:03:19 +02:00
Shamim Rezaie aa7bc64c05 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:49 +10:00
Sara Arjona 9fa81da1f2 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:00 +02:00
Simey Lameze 3ae9fb6a95 MDL-72426 theme: fix message and notification count colour contrast 2021-09-03 12:26:45 +08:00
Peter Burnett 96d14175e4 MDL-72452 resource: Filter resource media embed output 2021-09-03 09:30:13 +10:00
Luca Bösch 4a47a0a0d6 MDL-72216 questions: Don't stick buttons together in preview. 2021-09-02 13:35:45 +02:00
Sara Arjona 3e6900105a weekly release 3.10.6+ 2021-09-02 11:51:27 +02:00
Jun Pataleta cf687ae49f Merge branch 'MDL-72440_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-09-02 09:52:11 +08:00
David Mudrák 2cce6c76af MDL-72428 lang: Use the fixed strings in the tests 2021-09-01 22:04:58 +02:00
Helen Foster 32b25556e1 MDL-72428 lang: Import fixed English strings (en_fix) 2021-09-01 22:04:04 +02:00
Sara Arjona 8d0457447a Merge branch 'MDL-72169-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-01 17:46:52 +02:00
Sara Arjona cfb69b6578 Merge branch 'MDL-71375-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-09-01 17:09:39 +02:00
Sara Arjona 54d1702e97 Merge branch 'MDL-70376-310' of git://github.com/peterRd/moodle into MOODLE_310_STABLE 2021-09-01 16:52:14 +02:00
Sara Arjona 87cf2ed706 Merge branch 'MDL-71674-310' of https://github.com/dcai/moodle into MOODLE_310_STABLE 2021-09-01 11:36:47 +02:00
Dongsheng Cai 1da0e42f0f MDL-71674 editor_atto: more assessible errors 2021-09-01 18:35:59 +10:00
Eloy Lafuente (stronk7) a7733c35b4 Merge branch 'MDL-71999-310' of https://github.com/danielneis/moodle into MOODLE_310_STABLE 2021-08-31 23:16:24 +02:00
Eloy Lafuente (stronk7) adcfb52c1e Merge branch 'MDL-71121-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-31 23:13:15 +02:00
Jun Pataleta b7d4a858f4 Merge branch 'MDL-71778-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-08-31 22:58:29 +08:00
Paul Holden 4dc7f8e76e MDL-72296 admin: style form when prompting for upgrade key. 2021-08-31 13:53:03 +02:00
Paul Holden 24d4dacf1f MDL-72192 user: observe fullname capability in selector context. 2021-08-31 12:17:08 +01:00
Paul Holden a4d85aa8d7 MDL-71846 group: consistent escaping of user/group names. 2021-08-31 12:15:58 +01:00
Paul Holden c3be0cca40 MDL-72071 message: preserve window scroll opening processor modal. 2021-08-31 11:57:15 +01:00
Paul Holden 63fea60126 MDL-72169 privacy: format course name/summary during export. 2021-08-31 11:56:12 +01:00
Eloy Lafuente (stronk7) 12026abb03 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:21:16 +02:00
cperves e9e2d3188a MDL-71778 admin: patch for hard-set check filter 2021-08-31 12:34:42 +08:00
Peter Dias a290e721e3 MDL-70376 mod_assign: Reintroduce pdf orientation check
Reintroduce the orientation check and sizing when importing an image
2021-08-31 12:29:27 +08:00
Jake Dallimore 465120ed76 Merge branch 'MDL-70433-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-08-30 10:42:36 +08:00
Simeon Naydenov 40adf6defd MDL-71375 lib: Fix tooltip in show_hide_icon in flexible table 2021-08-30 09:42:39 +08:00
Luca Bösch dab7b02b86 MDL-70433 grades: prevent double escaping in titles 2021-08-27 10:55:53 +02:00
Andrew Nicols 6259988cb6 weekly release 3.10.6+ 2021-08-27 12:00:24 +08:00
Andrew Nicols 0c1e6cc4b3 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-08-27 12:00:23 +08:00
Sujith Haridasan 9f96657f4c MDL-72110 core_navigation: home page preference
Admin should respect the home page preference set
just like any other user.
2021-08-27 07:31:23 +05:30
Sara Arjona 14f831490a Merge branch 'MDL-71029-310' of https://github.com/dcai/moodle into MOODLE_310_STABLE 2021-08-26 07:12:35 +02:00
Andrew Nicols 38cf23f98f Merge branch 'MDL-72403-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-08-26 13:02:27 +08:00
Heena Agheda e8bdb79b95 MDL-72187 logstore: record log store's visibility change 2021-08-26 12:57:15 +08:00
Andrew Nicols 36ef1de379 Merge branch 'MDL-70176_310' of https://github.com/TomoTsuyuki/moodle into MOODLE_310_STABLE 2021-08-26 12:16:44 +08:00
Andrew Nicols c651c43de9 Merge branch 'MDL-72271_310' of https://github.com/larsbonczek/moodle into MOODLE_310_STABLE 2021-08-26 11:45:38 +08:00
Andrew Nicols 6c4be982c2 Merge branch 'MDL-72152-m310' of https://github.com/sammarshallou/moodle into MOODLE_310_STABLE 2021-08-26 11:36:25 +08:00
Andrew Nicols ea67397163 Merge branch 'MDL-72153-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-26 11:32:13 +08:00
Andrew Nicols 554958612b Merge branch 'MDL-72312_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-08-26 11:26:54 +08:00
AMOS bot 528df7870c Automatically generated installer lang files 2021-08-26 00:07:26 +00:00
Sara Arjona d56f16671d Merge branch 'MDL-72106-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-25 18:38:45 +02:00
Eloy Lafuente (stronk7) 3c5ce312d3 Merge branch 'MDL-72163-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-08-24 20:12:39 +02:00
Sara Arjona 5ee12998e4 Merge branch '310_MDL-70006' of git://github.com/danmarsden/moodle into MOODLE_310_STABLE 2021-08-24 13:13:21 +02:00
Shamim Rezaie 194379a0f8 MDL-72403 calendar: prereserve courseid after form submit 2021-08-24 18:05:12 +10:00
Jake Dallimore 3c64ea8d3c 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:35:16 +08:00
Andrew Nicols 5b3b01f1c4 Merge branch 'MDL-72014_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-08-24 09:17:05 +08:00
Andrew Nicols f5708eee2c Merge branch 'MDL-72207-310' of git://github.com/jleyva/moodle into MOODLE_310_STABLE 2021-08-24 09:10:07 +08:00
Kateryna Degtyariova 33abdf813b 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:45:51 +10:00
Eloy Lafuente (stronk7) 2e7f57f975 Merge branch 'MDL-71055-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-08-23 23:22:40 +02:00
Sara Arjona 5666d8e792 Merge branch 'MDL-72257-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-23 17:52:33 +02:00
Shamim Rezaie 6227246c3f MDL-71602 qtype_essay: label essay question's answer area 2021-08-24 01:06:34 +10:00
Eloy Lafuente (stronk7) 525b10b861 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:51:57 +02:00
Eloy Lafuente (stronk7) ced1550177 MDL-72312 GHA: Force use of igbinary working version
And also remove memcached and redis that have dependencies on it.

Versions 3.2.2 - 3.2.4 have a bug returning
arrays with index messed up. This affects
key() and next() operations when reading
information serialised with igbinary.

Notably Moodle's MUC uses igbinary when
available and was leading to some wrong
operations and test failures.

Once a fixed version is used by GHA this
can be reverted. See MDL-72399.

Note this only affects to php72, newer php
versions are not affected.
2021-08-23 15:51:22 +02:00
Andrew Nicols 30de8275c0 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) bfaeecb183 Merge branch 'MDL-71973-310' of https://github.com/mohalisad/moodle into MOODLE_310_STABLE 2021-08-20 19:06:47 +02:00
Eloy Lafuente (stronk7) c5be7c53c6 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:56 +02:00
Ilya Tregubov 65b6e86406 weekly release 3.10.6+ 2021-08-20 13:24:35 +02:00
Ilya Tregubov 029e68e619 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-08-20 13:24:35 +02:00
Tomo Tsuyuki add4186322 MDL-70176 mod_forum: Grading respects separate groups filter 2021-08-20 13:36:28 +10:00
Ilya Tregubov bf0795c567 MDL-49202 core: Comment broken test.
Should be fixed properly as part of MDL-72377.
2021-08-19 17:20:48 +02:00
Ilya Tregubov 7c749fba9c Merge branch 'MDL-49202_310' of git://github.com/mdjnelson/moodle into MOODLE_310_STABLE 2021-08-19 17:17:04 +02:00
Mark Nelson bbe8be25fc MDL-49202 core: fix failing unit tests
See MDL-72377.
2021-08-19 20:15:59 +08:00
Mark Nelson 4527f760ea MDL-49202 core_grades: add Behat tests 2021-08-19 20:15:59 +08:00
Juan Leyva bfc0fabe44 MDL-72207 assign: Support all participants in get_submission_status WS 2021-08-19 14:12:08 +02:00
Mark Nelson 10963bad39 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:11 +08:00
Mark Nelson 1ae7e18d55 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:11 +08:00
Julien Boulen 6c661edffb MDL-71093 backup: fix backup when activity names use HTML tags 2021-08-19 11:24:21 +02:00
Thong Bui 53446defe6 MDL-72064 Questions: response selection area enough 2021-08-19 14:52:17 +07:00
Bas Brands d7ebcac861 MDL-71550 theme_boost: improve dropdown hover styles 2021-08-19 09:17:27 +02:00
Andrew Nicols 67284dfc05 Merge branch 'MDL-72282-310' of https://github.com/dcai/moodle into MOODLE_310_STABLE 2021-08-19 11:15:28 +08:00
Andrew Nicols 28d9031e44 Merge branch 'MDL-68639-3.10' of https://github.com/xcaro/moodle into MOODLE_310_STABLE 2021-08-19 10:07:41 +08:00
Eloy Lafuente (stronk7) ddcd34612f Merge branch 'MDL-72206-310' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-08-18 19:32:47 +02:00
Andrew Nicols 43cc0d43f7 Merge branch 'MDL-69451-shared-temptables-3.10' of https://github.com/srdjan-catalyst/moodle into MOODLE_310_STABLE 2021-08-18 21:41:09 +08:00
Víctor Déniz cbe888148d Merge branch 'MOODLE_310_MDL-72239-v2' of https://github.com/golenkovm/moodle into MOODLE_310_STABLE 2021-08-18 13:57:54 +01:00
Mikhail Golenkov a4f657d846 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:35:38 +10:00
Víctor Déniz f6f0f5bb6a Merge branch 'MDL-71487-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-18 09:55:04 +01:00
AMOS bot aea79216ce Automatically generated installer lang files 2021-08-18 00:07:22 +00:00
Nhan Vo 26420f609a MDL-68639 HTML Editor (Atto): Invalid HTML for nested lists 2021-08-18 04:16:21 +07:00
Dongsheng Cai 1b35161c37 MDL-72282 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-08-17 16:28:00 +10:00
Dongsheng Cai 55eddd9989 MDL-72282 accessibility: update color to increase contrast 2021-08-17 16:27:06 +10:00
Frédéric Massart 78a5927d4d MDL-72286 editor_atto: Declare type on plugins button groups 2021-08-17 12:00:33 +10:00
Ilya Tregubov 350b022f8d Merge branch 'MDL-71814-310' of git://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-08-16 13:57:34 +02:00
Jun Pataleta 0548156a3f MDL-69855 mod_forum: Don't show reply link in email for private replies 2021-08-16 17:46:25 +08:00
Thach Le Huy 16d8b84472 MDL-71814 Atto: File picker – file info panel focus issue 2021-08-16 16:37:01 +07:00
AMOS bot 45429deb00 Automatically generated installer lang files 2021-08-14 00:07:22 +00:00
Paul Holden 1d3aa1b798 MDL-72153 privacy: correctly export user description/files. 2021-08-13 12:40:52 +01:00
Ilya Tregubov f88c85056c Merge branch 'MDL-72035-excel_csv_bom-310' of git://github.com/leonstr/moodle into MOODLE_310_STABLE 2021-08-13 11:25:58 +02:00
Jun Pataleta a393c543e1 Merge branch 'MDL-72330-310' of git://github.com/vmdef/moodle into MOODLE_310_STABLE 2021-08-13 11:00:55 +08:00
Andrew Nicols 90638ef08f Merge branch 'MDL-72325-310-tourspolicy' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-08-13 10:01:42 +08:00
Víctor Déniz a7dba247cf MDL-72330 behat: revert previous incorrect change 2021-08-13 00:02:50 +01:00
Ilya Tregubov fa2e1ed7ec weekly release 3.10.6+ 2021-08-12 16:50:19 +02:00
Ilya Tregubov f98d542d0d Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-08-12 16:50:19 +02:00
David Mudrák 41d2fb93c8 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:26:47 +02:00
Víctor Déniz cdcf1e7ee3 MDL-71500 calendar_threemonth: fix wrong behat step 2021-08-12 11:43:06 +01:00
Andrew Nicols d7da1d28a7 Merge branch 'MDL-72252-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-12 10:27:16 +08:00
Andrew Nicols 824cb06df8 Merge branch 'MDL-71844-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-12 10:25:47 +08:00
Eloy Lafuente (stronk7) e246c8b7da Merge branch 'MDL-72265_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-08-12 00:05:53 +02:00
Eloy Lafuente (stronk7) ede634df91 Merge branch 'MDL-71500-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-08-11 20:17:43 +02:00
Eloy Lafuente (stronk7) 4c690bb1cf Merge branch 'MDL-71945-M310S' of https://github.com/lucisgit/moodle into MOODLE_310_STABLE 2021-08-11 11:47:18 +02:00
Eloy Lafuente (stronk7) de211d92c7 Merge branch 'MDL-72242-310-svgforcedfilter' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-08-11 11:40:18 +02:00
Eloy Lafuente (stronk7) 8389fcb9fc Merge branch 'MDL-71656-310' of git://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2021-08-10 19:09:50 +02:00
Eloy Lafuente (stronk7) fb03c9640d Merge branch 'MDL-70165-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-10 18:53:24 +02:00
Ilya Tregubov 6ee1ffa200 Merge branch 'MDL-72033-310' of git://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-08-10 16:09:35 +02:00
Tony Butler 025e5e9970 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:08:38 +01:00
Lars Bonczek 1148377a5c MDL-72271 mod_quiz: fix secure_window close function 2021-08-10 11:54:11 +02:00
Paul Holden 5b30467894 MDL-72106 calendar: redirect to same page post-subscription process.
Avoid issues when reloading page/re-sending POST data.
2021-08-10 09:41:01 +01:00
Paul Holden 21df5bc50e MDL-71844 tool_task: preserve navigation when executing task. 2021-08-09 10:45:00 +01:00
Paul Holden a23c3e4507 MDL-71487 admin: ensure filesize settings don't overflow integer. 2021-08-09 10:35:57 +01:00
Paul Holden 2833bafefb 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:06 +01:00
AMOS bot 98c3a5912f Automatically generated installer lang files 2021-08-06 00:07:24 +00:00
Srdjan 93f70c9d9d 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:08 +10:00
Tim Hunt 94026281ed 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 17:01:02 +01:00
Víctor Déniz 3a3060a08e weekly release 3.10.6+ 2021-08-05 16:27:30 +01:00
Víctor Déniz 7ee56a2016 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-08-05 16:27:29 +01:00
Víctor Déniz e4640f986d Merge branch 'MDL-71835-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-04 23:32:25 +01:00
Víctor Déniz 27603ce747 Merge branch 'MDL-71152-310' of git://github.com/roland04/moodle into MOODLE_310_STABLE 2021-08-04 20:38:10 +01:00
Víctor Déniz 5443767af6 Merge branch 'MDL-72262-310' of git://github.com/ilyatregubov/moodle into MOODLE_310_STABLE 2021-08-04 12:44:35 +01:00
abgreeve b597ecfbcd Merge branch 'MDL-71050-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-04 15:51:28 +08:00
abgreeve 811e47e0b4 Merge branch 'MDL-67833-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-03 10:24:39 +08:00
Dan Marsden c231cb5e64 MDL-70006 analytics: Don't send notifications to suspended enrolments. 2021-08-03 10:55:48 +12:00
Paul Holden bfe5e85895 MDL-71121 backup: apply config defaults for async backups. 2021-08-02 23:35:10 +01:00
David Mudrák 7b81244786 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 15:19:35 +02:00
Paul Holden 6ab27a723f 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:12 +01:00
Ilya Tregubov c23589a218 MDL-72262 behat: Make alias shorter to fix Oracle failures. 2021-08-02 08:26:44 +02:00
AMOS bot d652bad225 Automatically generated installer lang files 2021-07-31 00:07:26 +00:00
Víctor Déniz a5285d5c88 Merge branch 'MDL-72085-MOODLE_310_STABLE' of https://github.com/dmitriim/moodle into MOODLE_310_STABLE 2021-07-30 08:56:22 +01:00
Dmitrii Metelkin 07e6488a88 MDL-72085 core_phpunit: reset session notifications 2021-07-30 10:03:57 +10:00
Paul Holden f076f88211 MDL-72252 core: remove TODO file from 82e63108. 2021-07-29 08:58:05 +01:00
Jun Pataleta a0942c97ea Moodle release 3.10.6 2021-07-29 10:01:58 +08:00
Ilya Tregubov e8b0373b93 weekly release 3.10.5+ 2021-07-28 16:48:24 +02:00
Ilya Tregubov d888097b07 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-07-28 16:48:23 +02:00
Ilya Tregubov cdc89ce2f9 Merge branch 'MDL-71672-310-2' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-07-28 11:17:30 +02:00
Jun Pataleta 785e26ff0d Merge branch 'MDL-72203-310' of git://github.com/mickhawkins/moodle into MOODLE_310_STABLE 2021-07-28 11:27:31 +08:00
AMOS bot b21898443a Automatically generated installer lang files 2021-07-28 00:07:25 +00:00
Michael Hawkins 4425f819ae 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:20:34 +08:00
David Mudrák 3c1788abc8 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 23:15:59 +08:00
David Mudrák 150c5eabe6 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 23:15:59 +08:00
David Mudrák 4598f2265c 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 23:15:59 +08:00
David Mudrák 775c03ad2e 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 23:15:59 +08:00
Ilya Tregubov 19c6d9a089 Merge branch 'MDL-72179-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-07-27 12:38:27 +02:00
Andrew Nicols 82e63108fa MDL-72179 behat: Make use of page resolvers 2021-07-24 18:56:38 +08:00
Andrew Nicols 9f99c226dd MDL-72179 behat: Add page resolvers for activity roles/perms 2021-07-23 20:44:26 +08:00
Andrew Nicols 6f6b16f5b2 MDL-72179 behat: Add page resolver for activity names 2021-07-23 20:32:44 +08:00
Andrew Nicols 15c819ad90 MDL-72179 behat: Add activity editing page resolution 2021-07-23 20:32:15 +08:00
Andrew Nicols bfdf25df86 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:31:45 +08:00
Andrew Nicols 18f9fd70a0 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:28:15 +08:00
Andrew Nicols 79b1f0e924 MDL-72179 behat: Lowercase all page instance resolvers 2021-07-23 20:28:14 +08:00
Andrew Nicols 6eac0da6ad 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 887bb33d11 weekly release 3.10.5+ 2021-07-23 11:31:03 +02:00
Ilya Tregubov 13173cc241 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-07-23 11:31:02 +02:00
Jun Pataleta 44d24acd6d 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:08:11 +08:00
Jun Pataleta 66b23fbbe5 Merge branch 'MDL-72125-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-07-23 09:50:23 +08:00
Andrew Nicols b8fd3da2a8 MDL-72125 mod_assign: Correct step usage of undef step
This was due to an incorrectly resolved conflict when backporting from
3.11.
2021-07-23 08:36:43 +08:00
Andrew Nicols 7e2b291e34 Merge branch 'MDL-70427-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-07-22 11:23:11 +08:00
AMOS bot 7fba84f746 Automatically generated installer lang files 2021-07-22 00:07:30 +00:00
Víctor Déniz f1b64fb742 Merge branch 'MDL-72108-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-07-21 19:29:59 +01:00
Ilya Tregubov 3440e4155d Merge branch 'MDL-72125-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-07-19 14:02:35 +02:00
Andrew Nicols 729ee696fc MDL-72125 mod_assign: Use assign submission data generators 2021-07-19 18:41:31 +08:00
Andrew Nicols 0397710c44 MDL-72125 mod_assign: Add data generator for assign submissions 2021-07-19 18:41:31 +08:00
Andrew Nicols fc457581a4 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 faa1b7e640 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:42:05 +10:00
Shamim Rezaie 987166f5e0 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:42:05 +10:00
Shamim Rezaie 0fdf326b17 MDL-71672 atto_managefiles: Focus the first file manager button 2021-07-19 16:42:05 +10:00
Shamim Rezaie c47395c1ea MDL-71672 atto_emojipicker: Focus the search bar initially 2021-07-19 16:42:05 +10:00
Shamim Rezaie 136312c3ce MDL-71672 atto_recordrtc: focus Atto button after hide 2021-07-19 16:42:04 +10:00
Shamim Rezaie d227e72aa4 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:42:04 +10:00
Mikel Martín b4c09b497c 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:17 +02:00
boygr49p ec8fa5fc20 MDL-71500 calendar_threemonth: add behat step and coverage 2021-07-16 15:08:42 +08:00
boygr49p f3600e52cf 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:41 +08:00
Andrew Nicols 6d0a3915c1 MDL-72163 admin: Plugins overview page should link to categories 2021-07-16 13:49:55 +08:00
Andrew Nicols 1858a98a22 MDL-72125 behat: Add get_activity_id() behat generators helper 2021-07-16 12:33:56 +08:00
Andrew Nicols be00aebefe 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 1ab6cd84c2 MDL-72125 testing: Add helper to run generators as a user 2021-07-16 12:33:56 +08:00
Thach Le Huy 5c8bd91162 MDL-72033 User tours: step placement issues if screen too narrow 2021-07-16 11:24:48 +07:00
abgreeve 2e1212eeae weekly release 3.10.5+ 2021-07-16 10:16:41 +08:00
abgreeve e660067a9f Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-07-16 10:16:40 +08:00
AMOS bot 32648ae6a5 Automatically generated installer lang files 2021-07-16 00:07:26 +00:00
sam marshall c5d0f7605a 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:48:49 +01:00
Jun Pataleta 4560e11858 Merge branch 'MDL-63770-310' of /home/jun/moodles/stable_310/moodle into MOODLE_310_STABLE 2021-07-15 16:16:38 +08:00
Matteo Scaramuccia abc35abf38 MDL-63770 core: 'port' should be an integer like in parse_url()
Plus trivial comment cleanup.
2021-07-15 11:39:38 +08:00
Dmitri Pisarev 19e7915818 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:38 +08:00
Eloy Lafuente (stronk7) 2ae51fd4de Merge branch 'MDL-67338-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-07-15 00:35:18 +02:00
Paul Holden ae097fe1f5 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:31:33 +01:00
Eloy Lafuente (stronk7) 99d77f27c5 Merge branch 'MDL-72139-310' of git://github.com/cescobedo/moodle into MOODLE_310_STABLE 2021-07-14 14:00:08 +02:00
cescobedo dc8a28e4f0 MDL-72139 core_message: Fix encoding UTF-8 in prevent unclosed tags 2021-07-14 07:41:28 +02:00
Sara Arjona 426dbce03c Merge branch 'MDL-71782_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-07-13 16:44:46 +02:00
Jun Pataleta b8592dc8ee Merge branch 'MDL-72036-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-07-13 16:05:27 +08:00
Sara Arjona 62bc9cda28 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:50 +02:00
Huong Nguyen 38ea26fe41 MDL-71656 atto: Add meaningful labels to colour items
Colour chooser supported:
 - atto_fontcolor
 - atto_backcolor
2021-07-13 13:07:17 +07:00
Paul Holden aa6e48c6be 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:46:56 +01:00
Paul Holden cc341d85fd MDL-70427 admin: remove plugin adhoc tasks during uninstall. 2021-07-12 20:46:47 +01:00
Paul Holden d93f29fa56 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:12 +01:00
AMOS bot c00e4a02e2 Automatically generated installer lang files 2021-07-11 00:07:21 +00:00
Eloy Lafuente (stronk7) 4f8f170f54 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:48 +02:00
Paul Holden e203e89891 MDL-71835 report_log: correct query returning user fullname from DB. 2021-07-09 13:54:27 +01:00
Paul Holden 74f366c50a MDL-67833 tool_customlang: break long text in component column. 2021-07-09 11:37:11 +01:00
Andrew Nicols 3359f00688 MDL-72108 js: Fix incorrect jsdoc examples for core/ajax 2021-07-08 10:39:53 +08:00
Leon Stringer 0eb14ac1d4 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 14:59:15 +01:00
Daniel Neis Araujo 3e62c6c272 MDL-71999 enrol: enrol_imsenterprise_allow_group_member_remove global 2021-06-23 13:19:46 -03:00
Dongsheng Cai baa2eb2619 MDL-71029 forum: fix post count for users have more than 1 enrolment 2021-06-23 09:43:56 +10:00
mohalisad fd7ce03fd2 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:51 +04:30
878 changed files with 15031 additions and 7680 deletions
+61 -3
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,7 +200,23 @@
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',
}
},
{
@@ -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,
+1 -1
View File
@@ -1 +1 @@
v14.15.0
v14.18.0
+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'));
}
+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);
}
+15
View File
@@ -3163,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">
@@ -3345,6 +3350,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.11" requires="3.6">
@@ -3714,6 +3724,11 @@
</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>
+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 -5
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.
+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);
@@ -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,20 +111,21 @@ 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 I set the field "one" to "1"
And the following "activity" exists:
| activity | choice |
| course | C1 |
| idnumber | choice1 |
| intro | Test choice description |
| name | Test choice name |
| option | Option 1, Option 2, Option 3 |
| section | 1 |
| allowupdate | 1 |
And I am on the "Test choice name" "choice activity" page
And I set the field "Option 1" to "1"
And I press "Save my choice"
And the field "one" matches value "1"
And the field "two" matches value ""
And the field "Option 1" matches value "1"
And the field "Option 2" matches value ""
# Check if field xpath set/match works.
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
@@ -174,31 +171,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 +196,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,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"
@@ -97,7 +97,7 @@
{{#modified}}list-group-item-info{{/modified}}"
>
<div class="row">
<div class="col-sm-4 col-md-2">
<div class="col-sm-4 col-md-2 text-break">
<div class="d-md-none">
<strong>{{#str}}headingcomponent, tool_customlang{{/str}}</strong>
</div>
@@ -9,10 +9,8 @@ Feature: Manage data requests
| username | firstname | lastname | email |
| student1 | John | Doe | s1@example.com |
| student2 | Jane | Doe | s2@example.com |
And I log in as "admin"
And I set the following administration settings values:
| contactdataprotectionofficer | 1 |
And I log out
And the following config values are set as admin:
| contactdataprotectionofficer | 1 | tool_dataprivacy |
@javascript
Scenario: Marking general enquiries as complete
+1 -1
View File
@@ -27,7 +27,7 @@ require_once($CFG->libdir . '/adminlib.php');
admin_externalpage_setup('tool_filetypes');
$extension = required_param('extension', PARAM_RAW);
$extension = required_param('extension', PARAM_ALPHANUMEXT);
$redirecturl = new \moodle_url('/admin/tool/filetypes/index.php');
if (optional_param('revert', 0, PARAM_INT)) {
@@ -100,10 +100,12 @@ class tool_generator_testplan_backend extends tool_generator_backend {
*
* @param int $courseid The target course id
* @param bool $updateuserspassword Updates the course users password to $CFG->tool_generator_users_password
* @param int|null $size of the test plan. Used to limit the number of users exported
* to match the threads in the plan. For BC, defaults to null that means all enrolled users.
* @return stored_file
*/
public static function create_users_file($courseid, $updateuserspassword) {
$csvcontents = self::generate_users_file($courseid, $updateuserspassword);
public static function create_users_file($courseid, $updateuserspassword, ?int $size = null) {
$csvcontents = self::generate_users_file($courseid, $updateuserspassword, $size);
$fs = get_file_storage();
$filerecord = self::get_file_record('users', 'csv');
@@ -171,14 +173,18 @@ class tool_generator_testplan_backend extends tool_generator_backend {
*
* @param int $targetcourseid
* @param bool $updateuserspassword Updates the course users password to $CFG->tool_generator_users_password
* @param int|null $size of the test plan. Used to limit the number of users exported
* to match the threads in the plan. For BC, defaults to null that means all enrolled users.
* @return string The users csv file contents.
*/
protected static function generate_users_file($targetcourseid, $updateuserspassword) {
protected static function generate_users_file($targetcourseid, $updateuserspassword, ?int $size = null) {
global $CFG;
$coursecontext = context_course::instance($targetcourseid);
$users = get_enrolled_users($coursecontext, '', 0, 'u.id, u.username, u.auth', 'u.username ASC');
// If requested, get the number of users (threads) to use in the plan. We only need those in the exported file.
$planusers = self::$users[$size] ?? 0;
$users = get_enrolled_users($coursecontext, '', 0, 'u.id, u.username, u.auth', 'u.username ASC', 0, $planusers);
if (!$users) {
print_error('coursewithoutusers', 'tool_generator');
}
+1 -1
View File
@@ -98,7 +98,7 @@ if (empty($CFG->tool_generator_users_password) || is_bool($CFG->tool_generator_u
// Create files.
$courseid = $DB->get_field('course', 'id', array('shortname' => $shortname));
$usersfile = tool_generator_testplan_backend::create_users_file($courseid, !empty($options['updateuserspassword']));
$usersfile = tool_generator_testplan_backend::create_users_file($courseid, !empty($options['updateuserspassword']), $size);
$testplanfile = tool_generator_testplan_backend::create_testplan_file($courseid, $size);
// One file path per line so other CLI scripts can easily parse the output.
+1 -1
View File
@@ -51,7 +51,7 @@ if ($data = $mform->get_data()) {
// Creating both test plan and users files.
$testplanfile = tool_generator_testplan_backend::create_testplan_file($data->courseid, $data->size);
$usersfile = tool_generator_testplan_backend::create_users_file($data->courseid, $data->updateuserspassword);
$usersfile = tool_generator_testplan_backend::create_users_file($data->courseid, $data->updateuserspassword, $data->size);
// Test plan link.
$testplanurl = moodle_url::make_pluginfile_url(
+7
View File
@@ -1,6 +1,13 @@
This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.
=== 3.10.8 ===
* Function tool_generator_testplan_backend::create_users_file() now supports to pass the size of the testing plan,
that needs to be equal or smaller than the size of the generated site. That's used to effectively restrict the
exported number of users to the number of threads the jmeter plan will have (previously all the enrolled users
were being exported, with that leading to "false" loops (users not really looping X times).
=== 3.7 ===
* Function tool_generator_testplan_backend::get_course_options() is removed, the 'course' form element is used instead.
+2
View File
@@ -50,6 +50,7 @@ switch ($action) {
case 'disable':
unset($enabled[$enrol]);
set_config('enabled_stores', implode(',', array_keys($enabled)), 'tool_log');
add_to_config_log('tool_logstore_visibility', '1', '0', $enrol);
break;
case 'enable':
@@ -59,6 +60,7 @@ switch ($action) {
$enabled = array_keys($enabled);
$enabled[] = $enrol;
set_config('enabled_stores', implode(',', $enabled), 'tool_log');
add_to_config_log('tool_logstore_visibility', '0', '1', $enrol);
break;
case 'up':
@@ -0,0 +1,19 @@
@tool_log @report @report_configlog
Feature: In a report, admin can see logstore visibility changes
# Change log stores visibility so the report contains known data.
Background:
Given I log in as "admin"
And the following config values are set as admin:
| enabled_stores | logstore_standard | tool_log |
@javascript
Scenario: Display configuration changes report
When I navigate to "Plugins > Logging > Manage log stores" in site administration
And I click on "Disable" "icon" in the "Standard log" "table_row"
And I click on "Enable" "icon" in the "External database log" "table_row"
And I navigate to "Reports > Config changes" in site administration
Then the following should exist in the "report-configlog-report-table" table:
| User | Plugin | Setting | New value | Original value |
| Admin User | logstore_standard | tool_logstore_visibility | 0 | 1 |
| Admin User | logstore_database | tool_logstore_visibility | 1 | 0 |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -2
View File
@@ -98,8 +98,7 @@ define(['jquery'], function($) {
/**
* Callback to inject the template.
*
* @param {Node} container Node to inject in.
* @return {Promise} Resolved when done.
* @returns {Promise} Resolved when done.
* @method injectTemplate
*/
Rule.prototype.injectTemplate = function() {
@@ -37,9 +37,6 @@ define(['jquery',
/**
* Constructor for CompetencyDialogue.
*
* @param {Object} options
*
*/
var Competencydialogue = function() {
// Intentionally left empty.
@@ -156,9 +156,8 @@ define(['jquery',
/**
* Opens the picker.
*
* @param {Number} competencyId The competency ID of the competency to work on.
* @method display
* @return {Promise}
* @returns {Promise}
*/
RuleConfig.prototype.display = function() {
var self = this;
@@ -137,7 +137,6 @@ define(['jquery',
/**
* Refresh the course competencies page.
*
* @param {Event} e
* @method saveSettings
*/
settingsMod.prototype.refreshCourseCompetenciesPage = function() {
+1 -1
View File
@@ -26,7 +26,7 @@ define(['core/str', 'core/yui'], function(str, Y) {
/**
* Store the current instance of the core drag drop.
*
* @property dragDropInstance M.tool_lp.dragdrop_reorder
* @property {object} dragDropInstance M.tool_lp.dragdrop_reorder
*/
var dragDropInstance = null;
-1
View File
@@ -99,7 +99,6 @@ define(['jquery',
/**
* Opens the picker.
*
* @param {Number} competencyId The competency ID of the competency to work on.
* @method display
* @return {Promise}
*/
+2 -2
View File
@@ -43,8 +43,8 @@ define(['jquery'], function($) {
/**
* Constructor
*
* @param {$} menuRoot Jquery collection matching the root of the menu.
* @param {Function[]} handlers, called when a menu item is chosen.
* @param {jQuery} menuRoot Jquery collection matching the root of the menu.
* @param {Function[]} handlers called when a menu item is chosen.
*/
var Menubar = function(menuRoot, handlers) {
// Setup private class variables.
-3
View File
@@ -574,8 +574,6 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
* Handle a blur event
*
* @method handleBlur
* @param {Object} item item is the jquery id of the parent item of the group
* @param {Event} e The event.
* @return {Boolean}
*/
Tree.prototype.handleBlur = function() {
@@ -587,7 +585,6 @@ define(['jquery', 'core/url', 'core/log'], function($, url, log) {
*
* @method handleFocus
* @param {Object} item item is the jquery id of the parent item of the group
* @param {Event} e The event.
* @return {Boolean}
*/
Tree.prototype.handleFocus = function(item) {
@@ -31,8 +31,6 @@ define(['jquery',
/**
* UserCompetencyWorkflow class.
*
* @param {String} selector The node containing the buttons to switch mode.
*/
var UserCompetencyWorkflow = function() {
EventBase.prototype.constructor.apply(this, []);
@@ -195,7 +195,6 @@ define(['jquery',
*
* @param {Object} evidenceData Evidence data from evidence node.
* @param {Number} competencyIds The competency IDs.
* @param {Boolean} requestReview Send competencies to review.
*/
UserEvidenceActions.prototype._doCreateUserEvidenceCompetency = function(evidenceData, competencyIds) {
var self = this,
@@ -24,9 +24,7 @@ Feature: See the competencies for an activity on the course competencies page.
| activity | name | intro | course | idnumber | completion | completionview |
| page | PageName1 | PageDesc1 | C1 | PAGE1 | 1 | 1 |
| page | PageName2 | PageDesc2 | C1 | PAGE2 | 1 | 1 |
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on the "Course 1" course page logged in as admin
And I follow "Competencies"
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
@@ -36,9 +34,7 @@ Feature: See the competencies for an activity on the course competencies page.
And "Competency picker" "dialogue" should be visible
And I select "Test-Comp2" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I follow "Expand all"
And I set the field "Course competencies" to "Test-Comp1"
And I press "Save and return to course"
@@ -46,10 +42,8 @@ Feature: See the competencies for an activity on the course competencies page.
@javascript
Scenario: Go to the competency course competencies page.
When I log in as "student1"
And I am on site homepage
And I follow "Course 1"
And I follow "Competencies"
Given I am on the "Course 1" course page logged in as student1
When I follow "Competencies"
Then I should see "Test-Comp1"
And I should see "Test-Comp2"
And I set the field "Filter competencies by resource or activity" to "PageName1"
@@ -64,12 +58,5 @@ Feature: See the competencies for an activity on the course competencies page.
@javascript
Scenario: None course competencies page.
When I log in as "student1"
And I am on site homepage
And I follow "Course 1"
And I follow "PageName1"
Then I should see "Test page content"
And I am on site homepage
And I follow "Course 1"
And I follow "PageName1"
When I am on the PageName1 "page activity" page logged in as student1
Then I should see "Test page content"
+5
View File
@@ -329,6 +329,11 @@ class api {
$settings->supportpage = $CFG->supportpage;
}
if (empty($section) || $section === 'graceperiodsettings') {
$settings->coursegraceperiodafter = $CFG->coursegraceperiodafter;
$settings->coursegraceperiodbefore = $CFG->coursegraceperiodbefore;
}
return $settings;
}
@@ -234,6 +234,9 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
$expected[] = ['name' => 'supportemail', 'value' => $CFG->supportemail];
$expected[] = ['name' => 'supportpage', 'value' => $CFG->supportpage];
$expected[] = ['name' => 'coursegraceperiodafter', 'value' => $CFG->coursegraceperiodafter];
$expected[] = ['name' => 'coursegraceperiodbefore', 'value' => $CFG->coursegraceperiodbefore];
$this->assertCount(0, $result['warnings']);
$this->assertEquals($expected, $result['settings']);
File diff suppressed because one or more lines are too long
@@ -30,6 +30,8 @@ function($, Ajax, Notification, ModalFactory, ModalEvents) {
/**
* PolicyActions class.
*
* @param {jQuery} root
*/
var PolicyActions = function(root) {
this.registerEvents(root);
@@ -37,6 +39,8 @@ function($, Ajax, Notification, ModalFactory, ModalEvents) {
/**
* Register event listeners.
*
* @param {jQuery} root
*/
PolicyActions.prototype.registerEvents = function(root) {
root.on("click", function(e) {
@@ -115,6 +119,7 @@ function($, Ajax, Notification, ModalFactory, ModalEvents) {
* Initialise the actions helper.
*
* @method init
* @param {object} root
* @return {PolicyActions}
*/
'init': function(root) {
@@ -42,9 +42,7 @@ Feature: Backup user data
| Feedback for the response 'True'. | So you think it is true |
| Feedback for the response 'False'. | So you think it is false |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Quiz 1"
When I am on the "Quiz 1" "quiz activity" page logged in as student1
And I press "Attempt quiz now"
And I click on "True" "radio" in the "First question" "question"
And I click on "False" "radio" in the "Second question" "question"
+6 -2
View File
@@ -59,10 +59,14 @@ if (!$task) {
}
// Start output.
$PAGE->set_url(new moodle_url('/admin/tool/task/schedule_task.php'));
$PAGE->set_url(new moodle_url('/admin/tool/task/schedule_task.php', ['task' => $taskname]));
$PAGE->set_context($context);
$PAGE->navbar->add(get_string('scheduledtasks', 'tool_task'), new moodle_url('/admin/tool/task/scheduledtasks.php'));
$PAGE->set_heading($SITE->fullname);
$PAGE->set_title($task->get_name());
navigation_node::override_active_url(new moodle_url('/admin/tool/task/scheduledtasks.php'));
$PAGE->navbar->add(s($task->get_name()));
echo $OUTPUT->header();
echo $OUTPUT->heading($task->get_name());
@@ -84,6 +84,7 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form {
$displaylist = core_course_category::make_categories_list('moodle/course:create');
$mform->addElement('autocomplete', 'defaults[category]', get_string('coursecategory'), $displaylist);
$mform->addRule('defaults[category]', null, 'required', null, 'client');
$mform->addHelpButton('defaults[category]', 'coursecategory');
$choices = array();
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+28
View File
@@ -1199,6 +1199,7 @@ export default class Tour {
return this;
}
stepConfig.placement = this.recalculatePlacement(stepConfig);
let flipBehavior;
switch (stepConfig.placement) {
case 'left':
@@ -1293,6 +1294,33 @@ export default class Tour {
return this;
}
/**
* For left/right placement, checks that there is room for the step at current window size.
*
* If there is not enough room, changes placement to 'top'.
*
* @method recalculatePlacement
* @param {Object} stepConfig The step configuration of the step
* @return {String} The placement after recalculate
*/
recalculatePlacement(stepConfig) {
const buffer = 10;
const arrowWidth = 16;
let target = this.getStepTarget(stepConfig);
let widthContent = this.currentStepNode.width() + arrowWidth;
let targetOffsetLeft = target.offset().left - buffer;
let targetOffsetRight = target.offset().left + target.width() + buffer;
let placement = stepConfig.placement;
if (['left', 'right'].indexOf(placement) !== -1) {
if ((targetOffsetLeft < (widthContent + buffer)) &&
((targetOffsetRight + widthContent + buffer) > document.documentElement.clientWidth)) {
placement = 'top';
}
}
return placement;
}
/**
* Add the backdrop.
*
+20 -1
View File
@@ -622,7 +622,26 @@ class manager {
* @return array
*/
public static function get_matching_tours(\moodle_url $pageurl): array {
global $PAGE;
global $PAGE, $USER;
// The following three checks make sure that the user is fully ready to use the site. If not, we do not show any tours.
// We need the user to get properly set up so that all require_login() and other bits work as expected.
if (user_not_fully_set_up($USER)) {
return [];
}
if (get_user_preferences('auth_forcepasswordchange', false)) {
return [];
}
if (empty($USER->policyagreed) && !is_siteadmin()) {
$manager = new \core_privacy\local\sitepolicy\manager();
if ($manager->is_defined(isguestuser())) {
return [];
}
}
$tours = cache::get_matching_tourdata($pageurl);
@@ -325,6 +325,8 @@ class tool_usertours_manager_testcase extends advanced_testcase {
public function test_get_matching_tours(array $alltours, string $url, array $expected) {
$this->resetAfterTest();
$this->setGuestUser();
foreach ($alltours as $tourconfig) {
$tour = $this->helper_create_tour((object) $tourconfig);
$this->helper_create_step((object) ['tourid' => $tour->get_id()]);
@@ -336,4 +338,34 @@ class tool_usertours_manager_testcase extends advanced_testcase {
$this->assertEquals($expected[$i], $matches[$i]->get_name());
}
}
/**
* Test that no matching tours are returned if there is pending site policy agreement.
*/
public function test_get_matching_tours_for_user_without_site_policy_agreed() {
global $CFG;
$this->resetAfterTest();
$this->setGuestUser();
$tour = $this->helper_create_tour((object) [
'pathmatch' => '/%',
'enabled' => true,
'name' => 'Test tour',
'description' => '',
'configdata' => '',
]);
$this->helper_create_step((object) [
'tourid' => $tour->get_id(),
]);
$matches = \tool_usertours\manager::get_matching_tours(new moodle_url('/'));
$this->assertEquals(1, count($matches));
$CFG->sitepolicyguest = 'https://example.com';
$matches = \tool_usertours\manager::get_matching_tours(new moodle_url('/'));
$this->assertEmpty($matches);
}
}
+1 -1
View File
@@ -279,7 +279,7 @@ abstract class base extends \core_analytics\calculable {
} else if ($context->contextlevel >= CONTEXT_COURSE) {
// At course level or below only enrolled users although this is not ideal for
// teachers assigned at category level.
$users = get_enrolled_users($context, 'moodle/analytics:listinsights');
$users = get_enrolled_users($context, 'moodle/analytics:listinsights', 0, 'u.*', null, 0, 0, true);
} else {
$users = get_users_by_capability($context, 'moodle/analytics:listinsights');
}
+3 -3
View File
@@ -131,11 +131,11 @@ class auth_plugin_db extends auth_plugin_base {
$authdb->Close();
if ($this->config->passtype === 'plaintext') {
return ($fromdb == $extpassword);
return ($fromdb === $extpassword);
} else if ($this->config->passtype === 'md5') {
return (strtolower($fromdb) == md5($extpassword));
return (strtolower($fromdb) === md5($extpassword));
} else if ($this->config->passtype === 'sha1') {
return (strtolower($fromdb) == sha1($extpassword));
return (strtolower($fromdb) === sha1($extpassword));
} else if ($this->config->passtype === 'saltedcrypt') {
return password_verify($extpassword, $fromdb);
} else {
+16
View File
@@ -335,12 +335,28 @@ class auth_db_testcase extends advanced_testcase {
$DB->update_record('auth_db_users', $user3);
$this->assertTrue($auth->user_login('u3', 'heslo'));
// Test user created to see if the checking happens strictly.
$usermd5 = (object)['name' => 'usermd5', 'pass' => '0e462097431906509019562988736854'];
$usermd5->id = $DB->insert_record('auth_db_users', $usermd5);
// md5('240610708') === '0e462097431906509019562988736854'.
$this->assertTrue($auth->user_login('usermd5', '240610708'));
$this->assertFalse($auth->user_login('usermd5', 'QNKCDZO'));
set_config('passtype', 'sh1', 'auth_db');
$auth->config->passtype = 'sha1';
$user3->pass = sha1('heslo');
$DB->update_record('auth_db_users', $user3);
$this->assertTrue($auth->user_login('u3', 'heslo'));
// Test user created to see if the checking happens strictly.
$usersha1 = (object)['name' => 'usersha1', 'pass' => '0e66507019969427134894567494305185566735'];
$usersha1->id = $DB->insert_record('auth_db_users', $usersha1);
// sha1('aaroZmOk') === '0e66507019969427134894567494305185566735'.
$this->assertTrue($auth->user_login('usersha1', 'aaroZmOk'));
$this->assertFalse($auth->user_login('usersha1', 'aaK1STfY'));
set_config('passtype', 'saltedcrypt', 'auth_db');
$auth->config->passtype = 'saltedcrypt';
$user3->pass = password_hash('heslo', PASSWORD_BCRYPT);
+10 -10
View File
@@ -1228,18 +1228,18 @@ class auth_plugin_ldap extends auth_plugin_base {
empty($nuvalue) ? $nuvalue = array() : $nuvalue;
$ouvalue = core_text::convert($oldvalue, 'utf-8', $this->config->ldapencoding);
foreach ($ldapkeys as $ldapkey) {
// Skip update if $ldapkey does not exist in LDAP.
if (!isset($user_entry[$ldapkey][0])) {
$success = false;
error_log($this->errorlogtag.get_string('updateremfailfield', 'auth_ldap',
array('ldapkey' => $ldapkey,
'key' => $key,
'ouvalue' => $ouvalue,
'nuvalue' => $nuvalue)));
continue;
// If the field is empty in LDAP there are two options:
// 1. We get the LDAP field using ldap_first_attribute.
// 2. LDAP don't send the field using ldap_first_attribute.
// So, for option 1 we check the if the field is retrieve it.
// And get the original value of field in LDAP if the field.
// Otherwise, let value in blank and delegate the check in ldap_modify.
if (isset($user_entry[$ldapkey][0])) {
$ldapvalue = $user_entry[$ldapkey][0];
} else {
$ldapvalue = '';
}
$ldapvalue = $user_entry[$ldapkey][0];
if (!$ambiguous) {
// Skip update if the values already match
if ($nuvalue !== $ldapvalue) {
+6 -7
View File
@@ -93,13 +93,12 @@ class helper {
foreach ($sessions as $session) {
// Get user session from DB.
if (session_decode(base64_decode($session->sessdata))) {
if (isset($_SESSION['SESSION']) && isset($_SESSION['SESSION']->shibboleth_session_id)) {
// If there is a match, kill the session.
if ($_SESSION['SESSION']->shibboleth_session_id == trim($spsessionid)) {
// Delete this user's sessions.
\core\session\manager::kill_user_sessions($session->userid);
}
$usersession = self::unserializesession(base64_decode($session->sessdata));
if (isset($usersession['SESSION']) && isset($usersession['SESSION']->shibboleth_session_id)) {
// If there is a match, kill the session.
if ($usersession['SESSION']->shibboleth_session_id == trim($spsessionid)) {
// Delete this user's sessions.
\core\session\manager::kill_user_sessions($session->userid);
}
}
}
+6 -14
View File
@@ -42,6 +42,7 @@ class behat_auth extends behat_base {
* Logs in the user. There should exist a user with the same value as username and password.
*
* @Given /^I log in as "(?P<username_string>(?:[^"]|\\")*)"$/
* @Given I am logged in as :username
* @param string $username the user to log in as.
* @param moodle_url|null $wantsurl optional, URL to go to after logging in.
*/
@@ -52,33 +53,24 @@ class behat_auth extends behat_base {
return;
}
$loginurl = new moodle_url('/login/index.php');
$loginurl = new moodle_url('/auth/tests/behat/login.php', [
'username' => $username,
]);
if ($wantsurl !== null) {
$loginurl->param('wantsurl', $wantsurl->out_as_local_url());
}
// Visit login page.
$this->execute('behat_general::i_visit', [$loginurl]);
// Enter username and password.
$this->execute('behat_forms::i_set_the_field_to', array('Username', $this->escape($username)));
$this->execute('behat_forms::i_set_the_field_to', array('Password', $this->escape($username)));
// Press log in button, no need to check for exceptions as it will checked after this step execution.
$this->execute('behat_forms::press_button', get_string('login'));
}
/**
* Logs out of the system.
*
* @Given /^I log out$/
* @Given I am not logged in
*/
public function i_log_out() {
// Wait for page to be loaded.
$this->wait_for_pending_js();
// Click on logout link in footer, as it's much faster.
$this->execute('behat_general::i_click_on_in_the', array(get_string('logout'), 'link', '#page-footer', "css_element"));
$this->execute('behat_general::i_visit', [new moodle_url('/auth/tests/behat/logout.php')]);
}
}
+3 -5
View File
@@ -35,16 +35,14 @@ Feature: Authentication
And I press "Log in"
Then I should see "Invalid login, please try again"
Scenario: Log out
Scenario: Log out using the Log out link
Given I log in as "admin"
When I log out
When I click on "Log out" "link" in the "#page-footer" "css_element"
Then I should see "You are not logged in" in the "page-footer" "region"
Scenario Outline: Checking the display of the Remember username checkbox
Given I log in as "admin"
And I set the following administration settings values:
Given the following config values are set as admin:
| rememberusername | <settingvalue> |
And I log out
And I am on homepage
When I click on "Log in" "link" in the ".logininfo" "css_element"
Then I should <expect> "Remember username"
+89
View File
@@ -0,0 +1,89 @@
<?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/>.
// phpcs:disable moodle.Files.RequireLogin.Missing
// phpcs:disable moodle.PHP.ForbiddenFunctions.Found
/**
* Login end point for Behat tests only.
*
* @package core_auth
* @category test
* @author Guy Thomas
* @copyright 2021 Class Technologies Inc. {@link https://www.class.com/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__.'/../../../config.php');
require_once("{$CFG->dirroot}/login/lib.php");
$behatrunning = defined('BEHAT_SITE_RUNNING') && BEHAT_SITE_RUNNING;
if (!$behatrunning) {
redirect(new moodle_url('/'));
}
$username = required_param('username', PARAM_ALPHANUMEXT);
$wantsurl = optional_param('wantsurl', null, PARAM_URL);
if (isloggedin()) {
// If the user is already logged in, log them out and redirect them back to login again.
require_logout();
redirect(new moodle_url('/auth/tests/behat/login.php', [
'username' => $username,
'wantsurl' => (new moodle_url($wantsurl))->out(false),
]));
}
// Note - with behat, the password is always the same as the username.
$password = $username;
$failurereason = null;
$user = authenticate_user_login($username, $password, true, $failurereason, false);
if ($failurereason) {
switch($failurereason) {
case AUTH_LOGIN_NOUSER:
$reason = get_string('invalidlogin');
break;
case AUTH_LOGIN_SUSPENDED:
$reason = 'User suspended';
break;
case AUTH_LOGIN_FAILED:
$reason = 'Login failed';
break;
case AUTH_LOGIN_LOCKOUT:
$reason = 'Account locked';
break;
case AUTH_LOGIN_UNAUTHORISED:
$reason = get_string('unauthorisedlogin', 'core', $username);
break;
default:
$reason = "Unknown login failure: '{$failurereason}'";
break;
}
// Note: Do not throw an exception here as we sometimes test that login does not work.
// Exceptions are automatic failures in Behat.
\core\notification::add($reason, \core\notification::ERROR);
redirect(new moodle_url('/'));
}
if (!complete_user_login($user)) {
throw new Exception("Failed to login as behat step for $username");
}
if (empty($wantsurl)) {
$wantsurl = core_login_get_return_url();
}
redirect(new moodle_url($wantsurl));
+41
View File
@@ -0,0 +1,41 @@
<?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/>.
// phpcs:disable moodle.Files.RequireLogin.Missing
// phpcs:disable moodle.PHP.ForbiddenFunctions.Found
/**
* Login end point for Behat tests only.
*
* @package core_auth
* @category test
* @copyright Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__.'/../../../config.php');
$behatrunning = defined('BEHAT_SITE_RUNNING') && BEHAT_SITE_RUNNING;
if (!$behatrunning) {
redirect(new moodle_url('/login/logout.php'));
}
require_logout();
$login = optional_param('loginpage', 0, PARAM_BOOL);
if ($login) {
redirect(get_login_url());
} else {
redirect(new moodle_url('/'));
}
+78 -8
View File
@@ -108,6 +108,64 @@ abstract class condition extends tree_node {
return preg_replace('~^availability_(.*?)\\\\condition$~', '$1', get_class($this));
}
/**
* Returns a marker indicating that an activity name should be placed in a description.
*
* Gets placeholder text which will be decoded by info::format_info later when we can safely
* display names.
*
* @param int $cmid Course-module id
* @return string Placeholder text
* @since Moodle 3.10.7
*/
public static function description_cm_name(int $cmid): string {
return '<AVAILABILITY_CMNAME_' . $cmid . '/>';
}
/**
* Returns a marker indicating that formatted text should be placed in a description.
*
* Gets placeholder text which will be decoded by info::format_info later when we can safely
* call format_string.
*
* @param string $str Text to be processed with format_string
* @return string Placeholder text
* @since Moodle 3.10.7
*/
public static function description_format_string(string $str): string {
return '<AVAILABILITY_FORMAT_STRING>' . htmlspecialchars($str, ENT_NOQUOTES) .
'</AVAILABILITY_FORMAT_STRING>';
}
/**
* Returns a marker indicating that some of the description text should be computed at display
* time.
*
* This will result in a call to the get_description_callback_value static function within
* the condition class.
*
* Gets placeholder text which will be decoded by info::format_info later when we can safely
* call most Moodle functions.
*
* @param string[] $params Array of arbitrary parameters
* @return string Placeholder text
* @since Moodle 3.10.7
*/
public function description_callback(array $params): string {
$out = '<AVAILABILITY_CALLBACK type="' . $this->get_type() . '">';
$first = true;
foreach ($params as $param) {
if ($first) {
$first = false;
} else {
$out .= '<P/>';
}
$out .= htmlspecialchars($param, ENT_NOQUOTES);
}
$out .= '</AVAILABILITY_CALLBACK>';
return $out;
}
/**
* Obtains a string describing this restriction (whether or not
* it actually applies). Used to obtain information that is displayed to
@@ -119,11 +177,17 @@ abstract class condition extends tree_node {
* (when displaying only conditions they don't meet).
*
* If implementations require a course or modinfo, they should use
* the get methods in $info.
* the get methods in $info. They should not use any other functions that
* might rely on modinfo, such as format_string.
*
* The special string <AVAILABILITY_CMNAME_123/> can be returned, where
* 123 is any number. It will be replaced with the correctly-formatted
* name for that activity.
* To work around this limitation, use the functions:
*
* description_cm_name()
* description_format_string()
* description_callback()
*
* These return special markers which will be added to the string and processed
* later after modinfo is complete.
*
* @param bool $full Set true if this is the 'full information' view
* @param bool $not Set true if we are inverting the condition
@@ -142,11 +206,17 @@ abstract class condition extends tree_node {
* the list, in front of the standard get_description call.
*
* If implementations require a course or modinfo, they should use
* the get methods in $info.
* the get methods in $info. They should not use any other functions that
* might rely on modinfo, such as format_string.
*
* The special string <AVAILABILITY_CMNAME_123/> can be returned, where
* 123 is any number. It will be replaced with the correctly-formatted
* name for that activity.
* To work around this limitation, use the functions:
*
* description_cm_name()
* description_format_string()
* description_callback()
*
* These return special markers which will be added to the string and processed
* later after modinfo is complete.
*
* @param bool $full Set true if this is the 'full information' view
* @param bool $not Set true if we are inverting the condition
+20
View File
@@ -746,6 +746,26 @@ abstract class info {
return format_string($cm->get_name(), true, ['context' => $context]);
}
}, $info);
$info = preg_replace_callback('~<AVAILABILITY_FORMAT_STRING>(.*?)</AVAILABILITY_FORMAT_STRING>~s',
function($matches) use ($context) {
$decoded = htmlspecialchars_decode($matches[1], ENT_NOQUOTES);
return format_string($decoded, true, ['context' => $context]);
}, $info);
$info = preg_replace_callback('~<AVAILABILITY_CALLBACK type="([a-z0-9_]+)">(.*?)</AVAILABILITY_CALLBACK>~s',
function($matches) use ($modinfo, $context) {
// Find the class, it must have already been loaded by now.
$fullclassname = 'availability_' . $matches[1] . '\condition';
if (!class_exists($fullclassname, false)) {
return '<!-- Error finding class ' . $fullclassname .' -->';
}
// Load the parameters.
$params = [];
$encodedparams = preg_split('~<P/>~', $matches[2], 0);
foreach ($encodedparams as $encodedparam) {
$params[] = htmlspecialchars_decode($encodedparam, ENT_NOQUOTES);
}
return $fullclassname::get_description_callback_value($modinfo, $context, $params);
}, $info);
return $info;
}
+1 -1
View File
@@ -51,7 +51,7 @@ class info_module extends info {
// We cannot access $cm->name as a property at this point, because this
// code may itself run in response to the $cm->name property access, and
// PHP magic function properties do not allow recursion (because PHP).
return '<AVAILABILITY_CMNAME_' . $this->cm->id . '/>';
return condition::description_cm_name($this->cm->id);
}
protected function set_in_database($availability) {
@@ -354,7 +354,7 @@ class condition extends \core_availability\condition {
if (!array_key_exists($cmid, $modinfo->cms) || $modinfo->cms[$cmid]->deletioninprogress) {
$modname = get_string('missing', 'availability_completion');
} else {
$modname = '<AVAILABILITY_CMNAME_' . $modinfo->cms[$cmid]->id . '/>';
$modname = self::description_cm_name($modinfo->cms[$cmid]->id);
}
}
@@ -48,10 +48,10 @@ Feature: Confirm that conditions on completion no longer cause a bug
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I set the field with xpath "//div[contains(concat(' ', normalize-space(@class), ' '), ' availability-item ')][preceding-sibling::div]//select[@name='cm']" to "Page2"
And I press "Save and return to course"
And I should see "Not available unless:" in the ".activity.glossary" "css_element"
Then I should see "Not available unless:" in the ".activity.glossary" "css_element"
And I should see "The activity Page1 is marked complete" in the ".activity.glossary" "css_element"
And I should see "The activity Page2 is marked complete" in the ".activity.glossary" "css_element"
And I follow "TestGlossary"
# Behat will automatically check there is no error on this page.
Then I should see "TestGlossary"
And I am on the TestGlossary "glossary activity" page
And I should see "TestGlossary"
@@ -142,10 +142,29 @@ class condition extends \core_availability\condition {
$string = 'notgeneral';
}
}
$name = self::get_cached_grade_name($course->id, $this->gradeitemid);
// We cannot get the name at this point because it requires format_string which is not
// allowed here. Instead, get it later with the callback function below.
$name = $this->description_callback([$this->gradeitemid]);
return get_string('requires_' . $string, 'availability_grade', $name);
}
/**
* Gets the grade name at display time.
*
* @param \course_modinfo $modinfo Modinfo
* @param \context $context Context
* @param string[] $params Parameters (just grade item id)
* @return string Text value
*/
public static function get_description_callback_value(
\course_modinfo $modinfo, \context $context, array $params): string {
if (count($params) !== 1 || !is_number($params[0])) {
return '<!-- Invalid grade description callback -->';
}
$gradeitemid = (int)$params[0];
return self::get_cached_grade_name($modinfo->get_course_id(), $gradeitemid);
}
protected function get_debug_string() {
$out = '#' . $this->gradeitemid;
if (!is_null($this->min)) {
@@ -86,13 +86,12 @@ Feature: availability_grade
And I set the field "Minimum grade percentage (inclusive)" to "10"
And I press "Save and return to course"
And I log out
# Log in as student without a grade yet.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "A1" "assign activity" page logged in as student1
# Do the assignment.
And I follow "A1"
And I click on "Add submission" "button"
And I set the field "Online text" to "Q"
And I click on "Save changes" "button"
@@ -103,27 +102,60 @@ Feature: availability_grade
And I should not see "P3" in the "region-main" "region"
And I should not see "P4" in the "region-main" "region"
And I should see "A1" in the "region-main" "region"
And I log out
# Log back in as teacher.
When I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "A1" "assign activity" page logged in as teacher1
# Give the assignment 40%.
And I follow "A1"
And I navigate to "View all submissions" in current page administration
# Pick the grade link in the row that has s@example.com in it.
And I click on "Grade" "link" in the "s@example.com" "table_row"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
And I click on "Edit settings" "link"
And I log out
# Log back in as student.
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
# Check pages are visible.
Then I should see "P2" in the "region-main" "region"
And I should see "P4" in the "region-main" "region"
And I should not see "P3" in the "region-main" "region"
@javascript
Scenario: Condition display with filters
# Teacher sets up a restriction on group G1, using multilang filter.
Given the following "activity" exists:
| activity | assign |
| name | <span lang="en" class="multilang">A-One</span><span lang="fr" class="multilang">A-Un</span> |
| intro | Test |
| course | C1 |
| idnumber | 0001 |
| section | 1 |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
# The activity names filter is enabled because it triggered a bug in older versions.
And the "activitynames" filter is "on"
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I add a "Page" to section "1"
And I expand all fieldsets
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
And I set the field "Grade" to "A-One"
And I click on "min" "checkbox" in the ".availability-item" "css_element"
And I set the field "Minimum grade percentage (inclusive)" to "10"
And I press "Save and return to course"
And I log out
# Student sees information about no access to group, with group name in correct language.
When I am on the "C1" "Course" page logged in as "student1"
Then I should see "Not available unless: You achieve a required score in A-One"
And I should not see "A-Un"
@@ -68,6 +68,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
// Check if available (not available).
$this->assertFalse($cond->is_available(false, $info, true, $user->id));
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~have a grade.*Test!~', $information);
$this->assertTrue($cond->is_available(true, $info, true, $user->id));
@@ -76,6 +77,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
$this->assertTrue($cond->is_available(false, $info, true, $user->id));
$this->assertFalse($cond->is_available(true, $info, true, $user->id));
$information = $cond->get_description(false, true, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~do not have a grade.*Test!~', $information);
// Construct directly and test remaining conditions; first, min grade (fail).
@@ -84,6 +86,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
$cond = new condition($structure);
$this->assertFalse($cond->is_available(false, $info, true, $user->id));
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~achieve a required score.*Test!~', $information);
$this->assertTrue($cond->is_available(true, $info, true, $user->id));
@@ -92,6 +95,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
$this->assertTrue($cond->is_available(false, $info, true, $user->id));
$this->assertFalse($cond->is_available(true, $info, true, $user->id));
$information = $cond->get_description(false, true, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~do not get certain scores.*Test!~', $information);
// Max grade (fail).
@@ -100,6 +104,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
$cond = new condition($structure);
$this->assertFalse($cond->is_available(false, $info, true, $user->id));
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~get an appropriate score.*Test!~', $information);
$this->assertTrue($cond->is_available(true, $info, true, $user->id));
@@ -108,6 +113,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
$this->assertTrue($cond->is_available(false, $info, true, $user->id));
$this->assertFalse($cond->is_available(true, $info, true, $user->id));
$information = $cond->get_description(false, true, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~do not get certain scores.*Test!~', $information);
// Max and min (fail).
@@ -116,6 +122,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
$cond = new condition($structure);
$this->assertFalse($cond->is_available(false, $info, true, $user->id));
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~get a particular score.*Test!~', $information);
$this->assertTrue($cond->is_available(true, $info, true, $user->id));
@@ -128,6 +135,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
$this->assertTrue($cond->is_available(false, $info, true, $user->id));
$this->assertFalse($cond->is_available(true, $info, true, $user->id));
$information = $cond->get_description(false, true, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~do not get certain scores.*Test!~', $information);
// Success (bottom end).
@@ -135,6 +143,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
$this->assertTrue($cond->is_available(false, $info, true, $user->id));
$this->assertFalse($cond->is_available(true, $info, true, $user->id));
$information = $cond->get_description(false, true, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~do not get certain scores.*Test!~', $information);
}
@@ -110,9 +110,8 @@ class condition extends \core_availability\condition {
if (!array_key_exists($this->groupid, self::$groupnames)) {
$name = get_string('missing', 'availability_group');
} else {
$context = \context_course::instance($course->id);
$name = format_string(self::$groupnames[$this->groupid], true,
array('context' => $context));
// Not safe to call format_string here; use the special function to call it later.
$name = self::description_format_string(self::$groupnames[$this->groupid]);
}
} else {
return get_string($not ? 'requires_notanygroup' : 'requires_anygroup',
@@ -6,8 +6,8 @@ Feature: availability_group
Background:
Given the following "courses" exist:
| fullname | shortname | format | enablecompletion |
| Course 1 | C1 | topics | 1 |
| fullname | shortname | format | enablecompletion | numsections |
| Course 1 | C1 | topics | 1 | 3 |
And the following "users" exist:
| username |
| teacher1 |
@@ -101,3 +101,33 @@ Feature: availability_group
Then I should see "P1" in the "region-main" "region"
And I should see "P2" in the "region-main" "region"
And I should not see "P3" in the "region-main" "region"
@javascript
Scenario: Condition display with filters
# Teacher sets up a restriction on group G1, using multilang filter.
Given the following "groups" exist:
| name | course | idnumber |
| <span lang="en" class="multilang">G-One</span><span lang="fr" class="multilang">G-Un</span> | C1 | GI1 |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
# The activity names filter is enabled because it triggered a bug in older versions.
And the "activitynames" filter is "on"
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I add a "Page" to section "1"
And I expand all fieldsets
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Add restriction..." "button"
And I click on "Group" "button" in the "Add restriction..." "dialogue"
And I set the field "Group" to "G-One"
And I click on "Save and return to course" "button"
And I log out
# Student sees information about no access to group, with group name in correct language.
When I am on the "C1" "Course" page logged in as "student1"
Then I should see "Not available unless: You belong to G-One"
And I should not see "G-Un"
@@ -73,6 +73,7 @@ class availability_group_condition_testcase extends advanced_testcase {
// Check if available (when not available).
$this->assertFalse($cond->is_available(false, $info, true, $user->id));
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~You belong to.*G1!~', $information);
$this->assertTrue($cond->is_available(true, $info, true, $user->id));
@@ -85,6 +86,7 @@ class availability_group_condition_testcase extends advanced_testcase {
$this->assertTrue($cond->is_available(false, $info, true, $user->id));
$this->assertFalse($cond->is_available(true, $info, true, $user->id));
$information = $cond->get_description(false, true, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~do not belong to.*G1!~', $information);
// Check group 2 works also.
@@ -96,6 +98,7 @@ class availability_group_condition_testcase extends advanced_testcase {
$this->assertTrue($cond->is_available(false, $info, true, $user->id));
$this->assertFalse($cond->is_available(true, $info, true, $user->id));
$information = $cond->get_description(false, true, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~do not belong to any~', $information);
// Admin user doesn't belong to a group, but they can access it
@@ -108,6 +111,7 @@ class availability_group_condition_testcase extends advanced_testcase {
$cond = new condition((object)array('id' => $group2->id + 1000));
$this->assertFalse($cond->is_available(false, $info, true, $user->id));
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertRegExp('~You belong to.*\(Missing group\)~', $information);
}
@@ -141,9 +141,8 @@ class condition extends \core_availability\condition {
if (!array_key_exists($groupingid, self::$groupingnames)) {
$name = get_string('missing', 'availability_grouping');
} else {
$context = \context_course::instance($course->id);
$name = format_string(self::$groupingnames[$groupingid], true,
array('context' => $context));
// Not safe to call format_string here; use the special function to call it later.
$name = self::description_format_string(self::$groupingnames[$groupingid]);
}
return get_string($not ? 'requires_notgrouping' : 'requires_grouping',
@@ -114,3 +114,31 @@ Feature: availability_grouping
And I press "Add group/grouping access restriction"
When I press "Save and return to course"
Then I should see "Not available unless: You belong to a group in Grouping A"
@javascript
Scenario: Condition display with filters
# Teacher sets up a restriction on group G1, using multilang filter.
Given the following "groupings" exist:
| name | course | idnumber |
| <span lang="en" class="multilang">Gr-One</span><span lang="fr" class="multilang">Gr-Un</span> | C1 | GA |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | grouping |
| assign | Test assign | Assign description | C1 | assign1 | 1 | GA |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
# The activity names filter is enabled because it triggered a bug in older versions.
And the "activitynames" filter is "on"
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I open "Test assign" actions menu
And I choose "Edit settings" in the open action menu
And I expand all fieldsets
And I press "Add group/grouping access restriction"
And I press "Save and return to course"
And I log out
# Student sees information about no access to group, with group name in correct language.
When I am on the "C1" "Course" page logged in as "student1"
Then I should see "Not available unless: You belong to a group in Gr-One"
And I should not see "Gr-Un"
@@ -199,9 +199,9 @@ class condition extends \core_availability\condition {
} else {
$translatedfieldname = get_user_field_name($this->standardfield);
}
$context = \context_course::instance($course->id);
$a = new \stdClass();
$a->field = format_string($translatedfieldname, true, array('context' => $context));
// Not safe to call format_string here; use the special function to call it later.
$a->field = self::description_format_string($translatedfieldname);
$a->value = s($this->value);
if ($not) {
// When doing NOT strings, we replace the operator with its inverse.
@@ -95,8 +95,7 @@ Feature: availability_profile
And I click on "Save and return to course" "button"
# Edit it again and check the setting still works.
When I follow "P1"
And I navigate to "Edit settings" in current page administration
When I am on the P1 "page activity editing" page
And I expand all fieldsets
Then the field "User profile field" matches value "Super field"
And the field "Value to compare against" matches value "Bananaman"
@@ -106,3 +105,35 @@ Feature: availability_profile
And I log in as "student1"
And I am on "Course 1" course homepage
Then I should see "P1" in the "region-main" "region"
@javascript
Scenario: Condition display with filters
# Teacher sets up a restriction on group G1, using multilang filter.
Given the following "custom profile fields" exist:
| datatype | shortname | name | param2 |
| text | frog | <span lang="en" class="multilang">F-One</span><span lang="fr" class="multilang">F-Un</span> | 100 |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
# The activity names filter is enabled because it triggered a bug in older versions.
And the "activitynames" filter is "on"
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I add a "Page" to section "1"
And I expand all fieldsets
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Add restriction..." "button"
And I click on "User profile" "button" in the "Add restriction..." "dialogue"
And I set the following fields to these values:
| User profile field | F-One |
| Value to compare against | 111 |
And I click on "Save and return to course" "button"
And I log out
# Student sees information about no access to group, with group name in correct language.
When I am on the "C1" "Course" page logged in as "student1"
Then I should see "Not available unless: Your F-One is 111"
And I should not see "F-Un"
@@ -313,6 +313,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
// Check the message (should be using lang string with capital, which
// is evidence that it called the right function to get the name).
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $info->get_course());
$this->assertRegExp('~Department~', $information);
// Set the field to true for both users and retry.
@@ -394,6 +395,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
'Failed checking normal (positive) result');
if (!$yes) {
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $info->get_course());
$this->assertRegExp($failpattern, $information);
}
@@ -402,6 +404,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
'Failed checking NOT (negative) result');
if ($yes) {
$information = $cond->get_description(false, true, $info);
$information = \core_availability\info::format_info($information, $info->get_course());
$this->assertRegExp($failpattern, $information);
}
}
+7
View File
@@ -2,6 +2,13 @@ This files describes API changes in /availability/*.
The information here is intended only for developers.
=== 3.10.8 ===
* There were existing restrictions on what condition plugins can do in the get_description
method (for example they mustn't call format_string), which were not well documented.
New functions description_cm_name(), description_format_string(), description_callback()
can be used so that condition plugins to behave correctly in all situations.
=== 3.2 ===
* Condition plugins must replace the CSS selector "#fitem_id_availabilityconditionsjson" with ".availability-field".
@@ -358,6 +358,15 @@ class backup_controller extends base_controller {
return $this->plan;
}
/**
* For debug only. Get a simple test display of all the settings.
*
* @return string
*/
public function debug_display_all_settings_values(): string {
return $this->get_plan()->debug_display_all_settings_values();
}
/**
* Sets the user roles that should be kept in the destination course
* for a course copy operation.
@@ -350,6 +350,15 @@ class restore_controller extends base_controller {
}
}
/**
* For debug only. Get a simple test display of all the settings.
*
* @return string
*/
public function debug_display_all_settings_values(): string {
return $this->get_plan()->debug_display_all_settings_values();
}
public function get_info() {
return $this->info;
}
@@ -162,6 +162,16 @@ abstract class restore_block_task extends restore_task {
*/
abstract public function get_configdata_encoded_attributes();
/**
* Helper method to safely unserialize block configuration during restore
*
* @param string $configdata The original base64 encoded block config, as retrieved from the block_instances table
* @return stdClass
*/
protected function decode_configdata(string $configdata): stdClass {
return unserialize_object(base64_decode($configdata));
}
/**
* Define the contents in the activity that must be
* processed by the link decoder
+3 -4
View File
@@ -2119,7 +2119,6 @@ class restore_ras_and_caps_structure_step extends restore_structure_step {
public function process_override($data) {
$data = (object)$data;
// Check roleid is one of the mapped ones
$newrole = $this->get_mapping('role', $data->roleid);
$newroleid = $newrole->newitemid ?? false;
@@ -2137,8 +2136,8 @@ class restore_ras_and_caps_structure_step extends restore_structure_step {
// Check if the new role is an overrideable role AND if the user performing the restore has the
// capability to assign the capability.
if (in_array($newrole->info['shortname'], $overrideableroles) &&
($safecapability && has_capability('moodle/role:safeoverride', $context, $userid) ||
!$safecapability && has_capability('moodle/role:override', $context, $userid))
(has_capability('moodle/role:override', $context, $userid) ||
($safecapability && has_capability('moodle/role:safeoverride', $context, $userid)))
) {
assign_capability($data->capability, $data->permission, $newroleid, $this->task->get_contextid());
} else {
@@ -4206,7 +4205,7 @@ class restore_block_instance_structure_step extends restore_structure_step {
// Let's look for anything within configdata neededing processing
// (nulls and uses of legacy file.php)
if ($attrstotransform = $this->task->get_configdata_encoded_attributes()) {
$configdata = (array)unserialize(base64_decode($data->configdata));
$configdata = (array) unserialize_object(base64_decode($data->configdata));
foreach ($configdata as $attribute => $value) {
if (in_array($attribute, $attrstotransform)) {
$configdata[$attribute] = $this->contentprocessor->process_cdata($value);
+179
View File
@@ -0,0 +1,179 @@
<?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/>.
defined('MOODLE_INTERNAL') || die();
// Include all the needed stuff.
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
/**
* Unit tests for how backup and restore handles role-related things.
*
* @package core_backup
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class roles_backup_restore_test extends advanced_testcase {
/**
* Create a course where the (non-editing) Teacher role is overridden
* to have 'moodle/user:loginas' and 'moodle/site:accessallgroups'.
*
* @return stdClass the new course.
*/
protected function create_course_with_role_overrides(): stdClass {
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$teacher = $generator->create_user();
$context = context_course::instance($course->id);
$generator->enrol_user($teacher->id, $course->id, 'teacher');
$editingteacherrole = $this->get_role('teacher');
role_change_permission($editingteacherrole->id, $context, 'moodle/user:loginas', CAP_ALLOW);
role_change_permission($editingteacherrole->id, $context, 'moodle/site:accessallgroups', CAP_ALLOW);
return $course;
}
/**
* Get the role id from a shortname.
*
* @param string $shortname the role shortname.
* @return stdClass the role from the DB.
*/
protected function get_role(string $shortname): stdClass {
global $DB;
return $DB->get_record('role', ['shortname' => $shortname]);
}
/**
* Get an array capability => CAP_... constant for all the orverrides set for a given role on a given context.
*
* @param string $shortname role shortname.
* @param context $context context.
* @return array the overrides set here.
*/
protected function get_overrides_for_role_on_context(string $shortname, context $context): array {
$overridedata = get_capabilities_from_role_on_context($this->get_role($shortname), $context);
$overrides = [];
foreach ($overridedata as $override) {
$overrides[$override->capability] = $override->permission;
}
return $overrides;
}
/**
* Makes a backup of the course.
*
* @param stdClass $course The course object.
* @return string Unique identifier for this backup.
*/
protected function backup_course(\stdClass $course): string {
global $CFG, $USER;
// Turn off file logging, otherwise it can't delete the file (Windows).
$CFG->backup_file_logger_level = backup::LOG_NONE;
// Do backup with default settings. MODE_IMPORT means it will just
// create the directory and not zip it.
$bc = new \backup_controller(backup::TYPE_1COURSE, $course->id,
backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_IMPORT,
$USER->id);
$backupid = $bc->get_backupid();
$bc->execute_plan();
$bc->destroy();
return $backupid;
}
/**
* Restores a backup that has been made earlier.
*
* @param string $backupid The unique identifier of the backup.
* @param string $asroleshortname Which role in the new cousre the restorer should have.
* @return int The new course id.
*/
protected function restore_adding_to_course(string $backupid, string $asroleshortname): int {
global $CFG, $USER;
// Create course to restore into, and a user to do the restore.
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$restorer = $generator->create_user();
$generator->enrol_user($restorer->id, $course->id, $asroleshortname);
$this->setUser($restorer);
// Turn off file logging, otherwise it can't delete the file (Windows).
$CFG->backup_file_logger_level = backup::LOG_NONE;
// Do restore to new course with default settings.
$rc = new \restore_controller($backupid, $course->id,
backup::INTERACTIVE_NO, backup::MODE_GENERAL, $USER->id,
backup::TARGET_CURRENT_ADDING);
$precheck = $rc->execute_precheck();
$this->assertTrue($precheck);
$rc->get_plan()->get_setting('role_assignments')->set_value(true);
$rc->execute_plan();
$rc->destroy();
return $course->id;
}
public function test_restore_role_overrides_as_manager(): void {
$this->resetAfterTest();
$this->setAdminUser();
// Create a course and back it up.
$course = $this->create_course_with_role_overrides();
$backupid = $this->backup_course($course);
// When manager restores, both role overrides should be restored.
$newcourseid = $this->restore_adding_to_course($backupid, 'manager');
// Verify.
$overrides = $this->get_overrides_for_role_on_context('teacher',
context_course::instance($newcourseid));
$this->assertArrayHasKey('moodle/user:loginas', $overrides);
$this->assertEquals(CAP_ALLOW, $overrides['moodle/user:loginas']);
$this->assertArrayHasKey('moodle/site:accessallgroups', $overrides);
$this->assertEquals(CAP_ALLOW, $overrides['moodle/site:accessallgroups']);
}
public function test_restore_role_overrides_as_teacher(): void {
$this->resetAfterTest();
$this->setAdminUser();
// Create a course and back it up.
$course = $this->create_course_with_role_overrides();
$backupid = $this->backup_course($course);
// When teacher restores, only the safe override should be restored.
$newcourseid = $this->restore_adding_to_course($backupid, 'editingteacher');
// Verify.
$overrides = $this->get_overrides_for_role_on_context('teacher',
context_course::instance($newcourseid));
$this->assertArrayNotHasKey('moodle/user:loginas', $overrides);
$this->assertArrayHasKey('moodle/site:accessallgroups', $overrides);
$this->assertEquals(CAP_ALLOW, $overrides['moodle/site:accessallgroups']);
}
}
@@ -548,6 +548,7 @@ abstract class backup_controller_dbops extends backup_dbops {
switch ($mode) {
case backup::MODE_GENERAL:
case backup::MODE_ASYNC:
// Load the general defaults
$settings = array(
'backup_general_users' => 'users',
+13
View File
@@ -126,6 +126,19 @@ abstract class base_plan implements checksumable, executable {
return $result;
}
/**
* For debug only. Get a simple test display of all the settings.
*
* @return string
*/
public function debug_display_all_settings_values(): string {
$result = '';
foreach ($this->settings as $name => $setting) {
$result .= $name . ': ' . $setting->get_value() . "\n";
}
return $result;
}
/**
* Wrapper over @get_setting() that returns if the requested setting exists or no
*/
+5 -3
View File
@@ -146,11 +146,13 @@ class base_setting_ui {
* @throws base_setting_ui_exception when the label is not valid.
* @param string $label
*/
public function set_label($label) {
$label = (string)$label;
if ($label === '' || $label !== clean_param($label, PARAM_TEXT)) {
public function set_label(string $label) :void {
$label = clean_param($label, PARAM_CLEANHTML);
if ($label === '') {
throw new base_setting_ui_exception('setting_invalid_ui_label');
}
$this->label = $label;
}
@@ -107,6 +107,7 @@ class copy_form extends \moodleform {
$displaylist[$course->category] = \core_course_category::get($course->category, MUST_EXIST, true)->get_formatted_name();
}
$mform->addElement('autocomplete', 'category', get_string('coursecategory'), $displaylist);
$mform->addRule('category', null, 'required', null, 'client');
$mform->addHelpButton('category', 'coursecategory');
// Course visibility.
@@ -0,0 +1,70 @@
<?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/>.
/**
* Tests for base_setting_ui class.
*
* @package core_backup
* @copyright 2021 Université Rennes 2 {@link https://www.univ-rennes2.fr}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot.'/backup/util/settings/tests/settings_test.php');
/**
* Tests for base_setting_ui class.
*
* @copyright 2021 Université Rennes 2 {@link https://www.univ-rennes2.fr}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class base_setting_ui_test extends advanced_testcase {
/**
* Tests set_label().
*
* @return void
*/
public function test_set_label() {
$this->resetAfterTest();
$bs = new mock_base_setting('test', base_setting::IS_BOOLEAN);
$bsui = new base_setting_ui($bs);
// Should keep original text string.
$bsui->set_label('Section name');
$this->assertEquals('Section name', $bsui->get_label());
// Should keep original HTML string.
$bsui->set_label('<b>Section name</b>');
$this->assertEquals('<b>Section name</b>', $bsui->get_label());
// Should be converted to text string.
$bsui->set_label(123);
$this->assertSame('123', $bsui->get_label());
// Should raise an exception when label is empty.
try {
$bsui->set_label('');
$this->assertTrue(false, 'base_setting_ui_exception');
} catch (Exception $exception) {
$this->assertTrue($exception instanceof base_setting_ui_exception);
$this->assertEquals($exception->errorcode, 'setting_invalid_ui_label');
}
}
}
@@ -14,10 +14,8 @@ Feature: Duplicate activities
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I set the following administration settings values:
| backup_import_activities | 0 |
And I log out
And the following config values are set as admin:
| backup_import_activities | 0 | backup |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Database" to section "1" and I fill the form with:
+1
View File
@@ -36,6 +36,7 @@ $context = $badge->get_context();
require_capability('moodle/badges:configuredetails', $context);
if ($action == 'remove') {
require_sesskey();
$badge->delete_related_badge($relatedid);
}
+13 -11
View File
@@ -59,7 +59,7 @@ class core_badges_renderer extends plugin_renderer_base {
$name = html_writer::tag('span', $bname, array('class' => 'badge-name'));
$image = html_writer::empty_tag('img', array('src' => $imageurl, 'class' => 'badge-image'));
$image = html_writer::empty_tag('img', ['src' => $imageurl, 'class' => 'badge-image', 'alt' => $badge->imagecaption]);
if (!empty($badge->dateexpire) && $badge->dateexpire < time()) {
$image .= $this->output->pix_icon('i/expired',
get_string('expireddate', 'badges', userdate($badge->dateexpire)),
@@ -337,7 +337,7 @@ class core_badges_renderer extends plugin_renderer_base {
$output = '';
$output .= html_writer::start_tag('div', array('id' => 'badge'));
$output .= html_writer::start_tag('div', array('id' => 'badge-image'));
$output .= html_writer::empty_tag('img', array('src' => $badgeimage, 'alt' => $badge->name, 'width' => '100'));
$output .= html_writer::empty_tag('img', array('src' => $badgeimage, 'alt' => $badge->imagecaption, 'width' => '100'));
if ($expiration < $now) {
$output .= $this->output->pix_icon('i/expired',
get_string('expireddate', 'badges', userdate($issued['expires'])),
@@ -395,7 +395,9 @@ class core_badges_renderer extends plugin_renderer_base {
$output .= $this->output->heading(get_string('issuerdetails', 'badges'), 3);
$dl = array();
$dl[get_string('issuername', 'badges')] = $badge->issuername;
$dl[get_string('issuername', 'badges')] = format_string($badge->issuername, true,
['context' => context_system::instance()]);
if (isset($badge->issuercontact) && !empty($badge->issuercontact)) {
$dl[get_string('contact', 'badges')] = obfuscate_mailto($badge->issuercontact);
}
@@ -428,7 +430,7 @@ class core_badges_renderer extends plugin_renderer_base {
if ($badge->type == BADGE_TYPE_COURSE && isset($badge->courseid)) {
$coursename = $DB->get_field('course', 'fullname', array('id' => $badge->courseid));
$dl[get_string('course')] = $coursename;
$dl[get_string('course')] = format_string($coursename, true, ['context' => context_course::instance($badge->courseid)]);
}
$dl[get_string('bcriteria', 'badges')] = self::print_badge_criteria($badge);
$output .= $this->definition_list($dl);
@@ -1291,13 +1293,13 @@ class core_badges_renderer extends plugin_renderer_base {
);
if (!$currentbadge->is_active() && !$currentbadge->is_locked()) {
$action = $this->output->action_icon(
new moodle_url('related_action.php',
array(
'badgeid' => $related->currentbadgeid,
'relatedid' => $badge->id,
'action' => 'remove'
)
), new pix_icon('t/delete', get_string('delete')));
new moodle_url('/badges/related_action.php', [
'badgeid' => $related->currentbadgeid,
'relatedid' => $badge->id,
'sesskey' => sesskey(),
'action' => 'remove'
]),
new pix_icon('t/delete', get_string('delete')));
$actions = html_writer::tag('div', $action, array('class' => 'badge-actions'));
array_push($row, $actions);
}
+7 -4
View File
@@ -163,16 +163,17 @@ Feature: Award badges
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
| <span class="multilang" lang="en">Course 1</span><span class="multilang" lang="de">Kurs 1</span> | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "C1" "Course" page logged in as "teacher1"
And I navigate to "Badges > Add a new badge" in current page administration
And I follow "Add a new badge"
And I set the following fields to these values:
@@ -197,7 +198,9 @@ Feature: Award badges
And I log in as "student1"
And I follow "Profile" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
And I should see "Course Badge"
And I click on "Course Badge" "link"
And "Course 1" "text" should appear after "Badge details" "text"
And "Kurs 1" "text" should not exist
@javascript
Scenario: Award badge on activity completion
+5 -5
View File
@@ -51,18 +51,18 @@ Feature: Award badges based on activity completion
And I log out
Scenario: Student earns a badge using activity completion, but does not get passing grade
When I log in as "student1"
Given I log in as "student1"
And I am on "Course 1" course homepage
And the "Test quiz name" "quiz" activity with "auto" completion should be marked as not complete
And I follow "Test quiz name"
When I am on the "Test quiz name" "quiz activity" page
And I press "Re-attempt quiz"
And I set the field "False" to "1"
And I press "Finish attempt ..."
And I press "Submit all and finish"
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
And I log out
Then I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Badges > Manage badges" in current page administration
And I follow "Course Badge"
And I should see "Recipients (1)"
Then I should see "Recipients (1)"
@@ -73,7 +73,7 @@ class restore_activity_results_block_task extends restore_block_task {
$blockid = $this->get_blockid();
if ($configdata = $DB->get_field('block_instances', 'configdata', array('id' => $blockid))) {
$config = unserialize(base64_decode($configdata));
$config = $this->decode_configdata($configdata);
if (!empty($config->activityparentid)) {
// Get the mapping and replace it in config.
if ($mapping = restore_dbops::get_backup_ids_record($this->get_restoreid(),
@@ -58,7 +58,7 @@ class restore_glossary_random_block_task extends restore_block_task {
// Extract block configdata and update it to point to the new glossary
if ($configdata = $DB->get_field('block_instances', 'configdata', array('id' => $blockid))) {
$config = unserialize(base64_decode($configdata));
$config = $this->decode_configdata($configdata);
if (!empty($config->glossary)) {
if ($glossarymap = restore_dbops::get_backup_ids_record($this->get_restoreid(), 'glossary', $config->glossary)) {
// Get glossary mapping and replace it in config
@@ -82,7 +82,7 @@ class restore_html_block_decode_content extends restore_decode_content {
}
protected function preprocess_field($field) {
$this->configdata = unserialize(base64_decode($field));
$this->configdata = unserialize_object(base64_decode($field));
return isset($this->configdata->text) ? $this->configdata->text : '';
}
+1 -1
View File
@@ -43,7 +43,7 @@ class content extends \core_search\base_block {
$this->componentname, $this->areaname);
// Get stdclass object with data from DB.
$data = unserialize(base64_decode($record->configdata));
$data = unserialize_object(base64_decode($record->configdata));
// Get content.
$content = content_to_text($data->text, $data->format);
+2 -2
View File
@@ -51,7 +51,7 @@ class block_html_edit_form extends block_edit_form {
}
function set_data($defaults) {
if (!empty($this->block->config) && is_object($this->block->config)) {
if (!empty($this->block->config) && !empty($this->block->config->text)) {
$text = $this->block->config->text;
$draftid_editor = file_get_submitted_draft_itemid('config_text');
if (empty($text)) {
@@ -61,7 +61,7 @@ class block_html_edit_form extends block_edit_form {
}
$defaults->config_text['text'] = file_prepare_draft_area($draftid_editor, $this->block->context->id, 'block_html', 'content', 0, array('subdirs'=>true), $currenttext);
$defaults->config_text['itemid'] = $draftid_editor;
$defaults->config_text['format'] = $this->block->config->format;
$defaults->config_text['format'] = $this->block->config->format ?? FORMAT_MOODLE;
} else {
$text = '';
}
+1 -1
View File
@@ -100,7 +100,7 @@ function block_html_global_db_replace($search, $replace) {
$instances = $DB->get_recordset('block_instances', array('blockname' => 'html'));
foreach ($instances as $instance) {
// TODO: intentionally hardcoded until MDL-26800 is fixed
$config = unserialize(base64_decode($instance->configdata));
$config = unserialize_object(base64_decode($instance->configdata));
if (isset($config->text) and is_string($config->text)) {
$config->text = str_replace($search, $replace, $config->text);
$DB->update_record('block_instances', ['id' => $instance->id,

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