Compare commits

...

496 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 15f3dddd04 Moodle release 3.10.2 2021-03-06 18:03:57 +01:00
AMOS bot b0aa3ba6af Automatically generated installer lang files 2021-03-06 00:07:19 +00:00
Sara Arjona c6f3ecb4f0 weekly release 3.10.1+ 2021-03-05 16:01:41 +01:00
Sara Arjona 573158a4f3 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-03-05 16:01:40 +01:00
Ilya Tregubov b33790d932 MDL-69680 lib: Fix behat test backup_and_restore.feature 2021-03-04 22:51:28 +01:00
Ilya Tregubov 0e0b494d4a MDL-69680 lib: Replace deprecated jQuery functions 2021-03-04 12:47:56 +08:00
Ilya Tregubov b61c7fe0f9 MDL-69680 lib: Update jQuery version in Moodle files 2021-03-04 12:47:56 +08:00
Ilya Tregubov 044754dddb MDL-69680 lib: Upgrade jQuery lib to 3.5.1 2021-03-04 12:47:56 +08:00
Eloy Lafuente (stronk7) c25ae6986c Merge branch 'MDL-70424-auth-avoid-changes-MOODLE_310_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_310_STABLE 2021-03-04 00:29:21 +01:00
Brendan Heywood f5e822222d MDL-70424 auth: Avoid random changes to $CFG->auth 2021-03-04 09:30:17 +11:00
Ilya Tregubov 67aa4abd73 MDL-70767 feedback: Prevent xss in feedback answer text. 2021-03-03 23:09:09 +01:00
Sara Arjona f3e6ed90d0 Merge branch 'MDL-68721-310' of git://github.com/ferranrecio/moodle into MOODLE_310_STABLE 2021-03-03 17:51:31 +01:00
Ferran Recio cfd58aae3e MDL-68721 mod_h5pactivity: report acceptance tests 2021-03-03 17:23:24 +01:00
Paul Holden 822eea5638 MDL-65552 block_activity_results: correct Behat tests for idnumbers.
Teachers can see user idnumber fields only when they are configured
identity fields. Students cannot.
2021-03-03 23:14:47 +08:00
Marina Glancy 9c29fcaae0 MDL-65552 user: escape idnumber and email in table_sql 2021-03-03 23:14:47 +08:00
Paul Holden bee5d9d27e MDL-65552 user: escape idnumber field on output.
This commit also corrects parameter definition of the field to
match core_user.
2021-03-03 23:14:47 +08:00
Sara Arjona 695e05f1e8 Merge branch 'MDL-70125_310-3' of git://github.com/mdjnelson/moodle into MOODLE_310_STABLE 2021-03-03 15:47:37 +01:00
Sara Arjona 5a407772c7 Merge branch 'MDL-67494-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-03-03 11:49:20 +01:00
Sara Arjona 82f2fe02e6 Merge branch 'MDL-67119-310' of git://github.com/aanabit/moodle into MOODLE_310_STABLE 2021-03-03 11:11:41 +01:00
Jun Pataleta b9a6effccb Merge branch 'MDL-70987-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-03-03 16:42:03 +08:00
Simey Lameze 7108bf827d MDL-67494 calendar: user_delete_user should delete all user events 2021-03-03 16:31:24 +08:00
Simey Lameze e5ce3297ba MDL-67494 calendar: privacy provider should not delete shared events 2021-03-03 16:31:24 +08:00
Simey Lameze 0f7ba5c1d2 MDL-67494 calendar: shared subscriptions should not set userid to 0 2021-03-03 16:31:24 +08:00
Simey Lameze 45266a3611 MDL-67494 calendar: only user overrides should retain userid 2021-03-03 16:31:24 +08:00
Simey Lameze bc6fa0ad98 MDL-67494 calendar: set userid to zero for shared events 2021-03-03 16:31:24 +08:00
Simey Lameze b528e38d53 MDL-67494 calendar: step to set userid 0 to all shared events 2021-03-03 16:31:22 +08:00
Simey Lameze d6d923a26a MDL-67494 calendar: add logic for category events in get_context 2021-03-03 16:27:05 +08:00
Jun Pataleta 970fc5dfd5 Merge branch 'MDL-71009_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-03-03 16:22:37 +08:00
Sara Arjona d7136fa135 Merge branch 'MDL-69097_310' of https://github.com/inigozendegi/moodle into MOODLE_310_STABLE 2021-03-03 09:06:58 +01:00
Jun Pataleta 14f98eefcf Merge branch 'MDL-70995-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-03-03 15:05:15 +08:00
Jun Pataleta 15f6a8977a Merge branch 'MDL-69883-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-03-03 14:34:44 +08:00
Andrew Nicols cd10e95fd9 Merge branch 'MDL-70268-310-2' of git://github.com/peterRd/moodle into MOODLE_310_STABLE 2021-03-03 12:22:34 +08:00
Peter Dias f50885a3a4 MDL-70268 core: Update the oauthlib to exclude scope if none provided 2021-03-03 12:06:24 +08:00
AMOS bot 17f6e10e4e Automatically generated installer lang files 2021-03-03 00:07:21 +00:00
Paul Holden 69dc0ef1cf MDL-70822 enrol: respect capability to view other users profile.
When retrieving courses of another user via web services, we should
respect the capability to view that users profile in a given course.
2021-03-02 23:44:24 +01:00
Sander Wind 3f9d4a08a5 MDL-70668 auth: Fix secret validation during user confirmation
Co-authored-by: Michael Hawkins <michaelh@moodle.com>
2021-03-02 23:44:24 +01:00
Eloy Lafuente (stronk7) 5d6e97dabb Merge branch 'MDL-70340-310' of git://github.com/jleyva/moodle into MOODLE_310_STABLE 2021-03-02 23:33:08 +01:00
Víctor Déniz 45a7f417ce Merge branch 'MDL-70676-310' of git://github.com/ilyatregubov/moodle into MOODLE_310_STABLE
Fixed mod/workshop/db/upgrade.php: \xmldb_field::getNotNull()
does not verify if the column is nullable in the database.
2021-03-02 22:10:14 +00:00
Peter Dias 62d098d787 MDL-59293 block_onlineusers: Update behat tests 2021-03-02 16:09:07 +00:00
Peter Dias 6cc044522a MDL-59293 block_onlineusers: Check whether current user can view online users
- Removed block from site admin.
- Blocked guest from viewuserlist cap
2021-03-02 16:09:07 +00:00
Ilya Tregubov ff09683e6c MDL-70676 workshop: Allow empty grades. 2021-03-02 13:44:54 +02:00
Sara Arjona d65a32ba29 Merge branch 'MDL-67515-310' of git://github.com/vmdef/moodle into MOODLE_310_STABLE 2021-03-02 11:21:33 +01:00
Jun Pataleta 4ddc2a627c Merge branch 'MDL-70457_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-03-02 17:39:20 +08:00
Víctor Déniz aa0d546355 Merge branch 'MDL-70172-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-03-02 09:17:10 +00:00
Víctor Déniz ae9785389a MDL-67515 tool_customlang: Ignore invalid component strings
After uninstalling a plugin, the translated strings remain in
tool_customlang table, throwing an exception when trying to localise
any strings. Currently there is no mechanism to
clean up customlang tables and files during the uninstall process,
so with this patch the invalid components will be ignored.
2021-03-02 09:09:16 +00:00
AMOS bot 5f4af646ee Automatically generated installer lang files 2021-03-02 00:07:19 +00:00
Eloy Lafuente (stronk7) c228509061 Merge branch 'MDL-67974-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-03-01 22:33:39 +01:00
Shamim Rezaie 8ec7ddb92b MDL-70172 output: pages with main logo should have a first-level header 2021-03-02 05:41:50 +11:00
Shamim Rezaie af390c4495 MDL-70172 output: Fix empty links
The approach taken is inline with font-awesome documentation:
https://fontawesome.com/how-to-use/on-the-web/other-topics/accessibility
2021-03-02 05:39:49 +11:00
Eloy Lafuente (stronk7) ded345c09a Merge branch 'MDL-70912-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-03-01 16:47:47 +01:00
Sara Arjona 5ecae0a17e Merge branch 'MDL-68735_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-03-01 16:17:40 +01:00
Eloy Lafuente (stronk7) 16deaaf095 Merge branch 'MDL-70913-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-03-01 14:22:23 +01:00
Sara Arjona 91d3150e6a MDL-70913 core_badges: Use and update properly sortorder
Sortorder field in badge_external_backpack was updated with a wrong
value. This patch fixes this behaviour and adds sortorder as
sorting criteria for displaying the list of site backpacks.

In the phpunit method reviewed for covering this, a couple of
assertEquals() calls have been changed too to put the expected value
first.
2021-03-01 13:10:37 +01:00
Eloy Lafuente (stronk7) 930c1a303f Merge branch 'MDL-70931-310-xmldbeol' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-03-01 10:01:14 +01:00
Eloy Lafuente (stronk7) aacb7a3cda Merge branch 'MDL-70941-310' of git://github.com/dravek/moodle into MOODLE_310_STABLE 2021-03-01 09:54:18 +01:00
Eloy Lafuente (stronk7) 6e43990254 Merge branch 'MDL-70910-310' of git://github.com/dravek/moodle into MOODLE_310_STABLE 2021-03-01 09:50:16 +01:00
Eloy Lafuente (stronk7) 7556d45c17 Merge branch 'MDL-70964-310-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-03-01 09:34:09 +01:00
AMOS bot d19433e901 Automatically generated installer lang files 2021-03-01 00:07:22 +00:00
AMOS bot 08dae87267 Automatically generated installer lang files 2021-02-28 00:07:20 +00:00
AMOS bot 565a9c2af5 Automatically generated installer lang files 2021-02-27 00:07:24 +00:00
David Matamoros fefdb9ad68 MDL-70941 contentbank: fix empty equality check when renaming content 2021-02-26 14:34:42 +01:00
Tim Hunt 5f0e09f367 MDL-71009 question bank: escape idnumbers when displayed 2021-02-26 12:48:11 +00:00
Eloy Lafuente (stronk7) 5bb3ac5c9a MDL-68735 env: Moodle 3.8.x, 3.9.x and 3.10.x do not support PHP 8.0 2021-02-26 13:08:07 +01:00
David Matamoros 384e6b03b1 MDL-70910 contentbank: fix for using contentid not validated 2021-02-26 12:02:25 +01:00
Eloy Lafuente (stronk7) d921a644ba MDL-70457 forms: php74 fix for the (not used in core) date element
Curly brackets to access by index to strings or arrays is
deprecated since php74.
2021-02-26 11:55:32 +01:00
Amaia Anabitarte 60fcd69368 MDL-67119 core_analytics: Analyse users once per course
User's activity in a course should be analysed only once
no matter the number of enrolments the user has in that course.
2021-02-26 11:48:09 +01:00
Jun Pataleta 3799c7f535 weekly release 3.10.1+ 2021-02-26 13:42:53 +08:00
Jun Pataleta e8425ed3af Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-02-26 13:42:52 +08:00
David Mudrák 4fc700ec96 MDL-70964 lang: Use the fixed strings in tests 2021-02-25 16:35:58 +01:00
Helen Foster c9ee7a2092 MDL-70964 lang: Import fixed English strings (en_fix) 2021-02-25 16:35:34 +01:00
Jun Pataleta 54a1d40758 Merge branch 'MDL-70169-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-02-25 12:29:30 +08:00
AMOS bot 92a8afc1e4 Automatically generated installer lang files 2021-02-25 00:07:24 +00:00
Paul Holden 46a52c6ad2 MDL-69883 message: fix lazy loading of conversations.
Set max-height on each container section rather than the container
itself, so that each can respond to the scrollBottom event within
the lazy loading module (which handles the overflow itself).
2021-02-24 22:01:37 +00:00
Paul Holden ab5e184301 MDL-70995 user: format group names in course participants filter. 2021-02-24 19:26:10 +00:00
Iñigo Zendegi 8b8c96ff3c MDL-69097 mod_forum: Apply filters to whole forum grading 2021-02-24 17:12:02 +01:00
Víctor Déniz ae9cf72fb6 Merge branch 'MDL-51111-muc-reset-MOODLE_310_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_310_STABLE 2021-02-24 14:08:25 +00:00
Brendan Heywood 42ddf9c0da MDL-51111 cache: Don't lock and write the config file if unchanged 2021-02-24 12:44:38 +11:00
Andrew Nicols 00f23b218a MDL-70987 core_form: Use correct id for elementid during validation
The id of the formid was being passed instead of the elementid.
2021-02-24 09:06:37 +08:00
Sara Arjona 07685e8116 MDL-67974 core_badges: Recovered expired stamp
Expired stamp icon displayed over the badge images has been added
again to CSS (it was lost at any point).
2021-02-23 15:32:57 +01:00
Sara Arjona 729b244321 MDL-67974 core_badges: Badge expiry date when hover
Text displayed for expired badges when the user hovers over the
warning (!) icon has been fixed in the "Issued badge information"
page.
2021-02-23 15:32:57 +01:00
Eloy Lafuente (stronk7) 147cd2557c Merge branch 'MDL-43697-310' of https://github.com/praxisdigital/moodle into MOODLE_310_STABLE 2021-02-22 23:10:12 +01:00
Mark Nelson fbef841ee3 MDL-70125 core_grade: do not change overridden status during regrading 2021-02-22 17:35:38 +08:00
AMOS bot 6a4f5a7d80 Automatically generated installer lang files 2021-02-22 00:07:22 +00:00
Andrew Nicols 4e25ca4aad Merge branch 'MDL-70879_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-02-22 07:51:00 +08:00
Daniel Kristian Steffensen 8fd59d9009 MDL-43697 backup: Archived badges are restored during course restore 2021-02-19 15:50:13 +01:00
Eloy Lafuente (stronk7) eda36d1eab MDL-70879 behat: Bump to Behat 3.8.x 2021-02-19 14:49:19 +01:00
Víctor Déniz 9b2400e94e weekly release 3.10.1+ 2021-02-19 12:39:15 +00:00
Víctor Déniz 051b9b8317 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-02-19 12:39:14 +00:00
AMOS bot 1f27baf216 Automatically generated installer lang files 2021-02-19 00:07:32 +00:00
Jun Pataleta 28d5ee7876 Merge branch 'MDL-47410-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-02-18 11:24:07 +08:00
Andrew Nicols 6aadb04fe1 MDL-47410 behat: Perform exact match for date_time selectors 2021-02-18 09:35:23 +08:00
David Mudrák fe6470b852 MDL-70931 xmldb: Generate install.xml files with EOL and EOF
As discussed in MDLSITE-6397, all Moodle code files should end with
single Unix-style end of line character. Files created and edited
through the XMLDB editor should follow this rule, too.
2021-02-17 21:06:00 +01:00
Víctor Déniz 858078a374 Merge branch 'MOODLE_310_MDL-70752' of https://github.com/golenkovm/moodle into MOODLE_310_STABLE 2021-02-17 16:57:36 +00:00
Eloy Lafuente (stronk7) 317af7632a Merge branch 'MDL-70552-310' of git://github.com/ilyatregubov/moodle into MOODLE_310_STABLE 2021-02-17 10:26:48 +01:00
Ilya Tregubov 53fcd633e5 MDL-70552 core_message: Show popup for teachers when anonymous
user completed feedback.
2021-02-17 08:43:28 +02:00
Andrew Nicols 40e11ee44a Merge branch 'MDL-47410-310' of git://github.com/mihailges/moodle into MOODLE_310_STABLE 2021-02-17 09:41:40 +08:00
AMOS bot 875ee2f1d2 Automatically generated installer lang files 2021-02-17 00:07:28 +00:00
Andrew Nicols 3b9d4c2cc8 Merge branch 'MDL-70264-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-02-17 07:26:56 +08:00
Eloy Lafuente (stronk7) 296e9ed320 Merge branch 'MDL-69562_310' of https://github.com/dvdcastro/moodle into MOODLE_310_STABLE 2021-02-16 22:39:36 +01:00
Eloy Lafuente (stronk7) be526048f6 Merge branch 'MDL-70525_310' of https://github.com/TomoTsuyuki/moodle into MOODLE_310_STABLE 2021-02-16 19:56:30 +01:00
Sara Arjona 9f2a875b0f MDL-70912 mod_data: Add filepicker to the H5P Atto button
The filepicker wasn't displayed fot the H5P Atto button when a text
area database field was created because some options were missing
in the textarea field class.
2021-02-16 18:17:26 +01:00
AMOS bot 8f86550c41 Automatically generated installer lang files 2021-02-16 00:07:25 +00:00
AMOS bot 579a25273d Automatically generated installer lang files 2021-02-13 00:07:29 +00:00
Simey Lameze 9ff0798864 MDL-70169 login: fix accessibility issues 2021-02-12 12:12:58 +08:00
Sara Arjona dcee7949db MDL-70264 badges: remove badges/oauth2callback.php
File badges/oauth2callback.php has been removed and now badges
API will use admin/oauth2callback.php because it makes no sense having
it twice.

Credits go to Andrew Nicols for raising it!
2021-02-11 16:58:48 +01:00
Sara Arjona 2e96a6508e weekly release 3.10.1+ 2021-02-11 14:54:47 +01:00
Sara Arjona 81e59a9ae7 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-02-11 14:54:45 +01:00
Mihail Geshoski 880224da1b MDL-47410 mod_assign: Update mod_assign behat tests
Updates the mod_assign behat tests to utilize the ability to
conviniently populate the datetime selector fields.
2021-02-11 12:13:04 +08:00
Mihail Geshoski 07d73cc416 MDL-47410 behat: Support selection from the datetime selector element
Adds behat support for selecting date and time from a datetime selector
element. The passed values should represent a textual date and time
description wrapped in '##' (e.g. '##first day of January 2020 08:00##',
'##1 Jan 2020 10:30##'). Also, the value 'disabled' is valid and can be
used to disable the datetime selector element.
2021-02-11 12:13:04 +08:00
Mihail Geshoski c68967af02 MDL-47410 tool_licensemanager: Update tool_licensemanager behat tests
Updates the tool_licensemanager behat tests to utilize the ability to
conviniently populate the date selector fields.
2021-02-11 12:13:04 +08:00
Mihail Geshoski 7a868e586f MDL-47410 behat: Support date selection from the date selector element
Adds behat support for selecting a date from the date selector element.
The passed values should represent a textual date description wrapped
in '##' (e.g. '##first day of January 2020##', '##1 Jan 2020##'). Also,
the value 'disabled' is valid and can be used to disable the date
selector element.
2021-02-11 12:13:02 +08:00
Mihail Geshoski c9ecca60c1 MDL-47410 behat: Create custom selector for the date and datetime fields
Creates a custom field selector to locate the requested date or datetime
form fields.
2021-02-11 12:11:15 +08:00
Mihail Geshoski 8031c68d12 MDL-47410 behat: Move logic from guess_type() to a separate method
Moves the logic from guess_type() to a separate protected method
get_field_instance_for_element(). This would be quite useful for
form field classes as they can now use this method when there is
a need to determine the type of a given node element.
2021-02-11 12:11:15 +08:00
Mihail Geshoski 41d8472136 MDL-47410 behat: Use data-fieldtype attribute to guess the field type
The data-fieldtype attribute (if present) should be also utilized in
guess_field_type() and match the behavior in get_field_node_type().
2021-02-11 12:11:15 +08:00
Mihail Geshoski d2304bfbe5 MDL-47410 form: Add data-fieldtype attribute to checkbox inline element
Includes the data-fieldtype attribute to the checkbox inline form
element. This element does not extend the parent inline element
template due to its specific nature and therefore this attribute was
missing.
2021-02-11 12:11:15 +08:00
Adrian Greeve 26ec6b3f69 Merge branch 'MDL-70513_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-02-11 10:05:51 +08:00
Adrian Greeve a057e10630 Merge branch 'MDL-69867-310_display_grade_with_scale' of git://github.com/moffe42/moodle into MOODLE_310_STABLE 2021-02-11 09:24:38 +08:00
AMOS bot 47373b3d37 Automatically generated installer lang files 2021-02-11 00:07:24 +00:00
Sara Arjona b21bbfbb53 Merge branch 'MDL-70732-310' of git://github.com/aanabit/moodle into MOODLE_310_STABLE 2021-02-10 17:20:36 +01:00
Sara Arjona 9dd33a7e4a Merge branch 'MDL-70796_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-02-10 16:50:15 +01:00
Sara Arjona 4205f0d819 Merge branch 'MDL-69101_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-02-10 15:12:05 +01:00
Sara Arjona eb7c0f7d12 Merge branch 'MDL-70631-310-unzip' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-02-10 12:38:18 +01:00
Sara Arjona 064c3f2b4b Merge branch 'MDL-70736_MOODLE_310_STABLE' of https://github.com/TomoTsuyuki/moodle into MOODLE_310_STABLE 2021-02-10 08:28:26 +01:00
Jacob Christiansen 17d2e4a79d MDL-69867 mod_assign: Display current grade with scale value
When using workflow we show the current grade with its scale value
instead of the internal index
2021-02-10 08:08:58 +01:00
John Yao c6df8dc20b MDL-65390 accessibility: correct focus after "Show more" clicked 2021-02-09 15:11:12 +01:00
Sara Arjona 8f66f8807d Merge branch 'MDL-70173-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-02-09 08:29:26 +01:00
Sara Arjona 94fa7da52a Merge branch 'MDL-70377_310' of https://github.com/mkassaei/moodle into MOODLE_310_STABLE 2021-02-09 08:23:36 +01:00
Shamim Rezaie c61b50e6a0 MDL-70173 core: Use a meaningful first level header 2021-02-09 16:32:45 +11:00
Shamim Rezaie 950e44c82f MDL-70173 theme_boost: Fix empty link issue on the "Go to top" button
On behat, we have to use a more specific test step if we are looking
for a "Go" button on a modal. The reason is that the html of the modal
content is put after the html of the "Go to top" button, so behat
may find the "Go to top" button if we just look for "Go".
2021-02-09 16:32:45 +11:00
Shamim Rezaie 71b49a5b87 MDL-70173 theme_boost: Increase the size of notification counter
WAVE considers any text with the size of 10px or below really small.
Increasing the font size of the navbar counter by 1px should not make a
big negative impact on the design, but improves accessibility.
2021-02-09 16:32:45 +11:00
Shamim Rezaie e7b0985d5e MDL-70173 output: All pages should have a heading
In MDL-63040, it was decided that the page header for the dashboad page
should be removed.
However, Based on Success Criteria 1.3.1 and 2.4.6 from the WebAIM's
WCAG 2 Checklist, all pages should have an <h1> element.
So I put an sr-only heading on the dashboard and all other pages, where
no page header is shown.
2021-02-09 16:32:45 +11:00
Shamim Rezaie ac4b7f1193 MDL-70173 dashboard: ARIA role presentation conflicted the empty alt
The markup <img role="presentation" alt="alt text"> is contradictory.

According to https://www.w3.org/TR/2017/WD-wai-aria-practices-1.1-20170628/examples/presentation/PresentationRoleExamples.html
 It is recommended that authors instead use empty alt text (alt="")
 where they use role="presentation".
2021-02-09 16:32:45 +11:00
Shamim Rezaie 30354e039a MDL-70173 message: Fix empty link 2021-02-09 16:32:40 +11:00
Shamim Rezaie a9c9d74fa0 MDL-70173 output: use an empty alt to hide user pic from screen readers
There is no need to use WAI-ARIA to hide images from screen readers.
See https://www.w3.org/WAI/tutorials/images/decorative/
2021-02-09 16:15:57 +11:00
Tomo Tsuyuki 0570323dab MDL-70525 tool_profiling: Cannot import profiling file
Change type from int to integer to be able to have big numbers
2021-02-09 10:15:48 +11:00
Mahmoud Kassaei fc538e946a MDL-70377 qtype_essay: When reviewing an attempt as a teacher
In the Response history table, Action Saved: does not display the value
of $a in the language string.
2021-02-08 16:52:48 +00:00
Andrew Nicols 17c85b704c Merge branch 'MDL-70614-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-02-08 10:36:15 +08:00
Andrew Nicols 340bd2726a Merge branch 'MDL-70725-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-02-08 10:30:28 +08:00
AMOS bot 0ad3e036d2 Automatically generated installer lang files 2021-02-06 00:07:24 +00:00
Tim Hunt cfcfaba862 MDL-70796 count_words: match the count from LibraOffice & MS Word 2021-02-05 15:28:34 +00:00
Amaia Anabitarte 582f636756 MDL-70732 behat: Adding second parameter to ExpectationException() 2021-02-05 11:01:38 +01:00
Sara Arjona 726d5dfc65 weekly release 3.10.1+ 2021-02-04 14:56:20 +01:00
Sara Arjona de8df592c9 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-02-04 14:56:18 +01:00
Mikhail Golenkov 30646de80a MDL-70752 restore: Fix remote file recovery 2021-02-04 19:21:45 +11:00
Tomo Tsuyuki bf7f52d775 MDL-70736 gradingform_guide: Fix loading marking guide template issue
Do not check grade item name if it is from shared template.
2021-02-04 16:15:44 +11:00
Andrew Nicols b1cf84453d Merge branch 'MDL-69748-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-02-04 11:52:21 +08:00
Shamim Rezaie e0f895ea8e MDL-69748 core: Fix hideif issue with array elements
Changed the element selector to get all array elements,
whether named or unnamed. The previus selector was only
working for elements that thir names were like name="something[]".
It was not working for name="something[a]" elements.
2021-02-04 14:38:53 +11:00
Andrew Nicols 975c9f7a82 Merge branch 'MDL-70579-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-02-04 09:30:20 +08:00
AMOS bot 32e56d6e65 Automatically generated installer lang files 2021-02-04 00:07:29 +00:00
Eloy Lafuente (stronk7) adc56c3df0 MDL-70741 capability overview: missing whitespace after placeholder 2021-02-04 00:01:12 +01:00
Tim Hunt 546ca90251 MDL-70513 quiz manual grading: use formchangechecker to avoid dataloss 2021-02-03 16:10:30 +00:00
David Mudrák 1d32d1d64f MDL-70631 files: Replace hard-coded value with FL_ENC_RAW constant
This is not related to the issue but I noticed it while trying to debug
it.

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

The patch changes the implementation to use ZipArchive::extractTo()
unless the extracted entry path contains a folder name ending with dot
(such as some/path./to/file.txt). There is a known upstream bug in the
PHP ZIP extension #77214 (also #74619 and #69477) so that we fall back
to keep using the stream in those cases.
2021-02-03 16:10:28 +01:00
Sara Arjona eb8938e15b Merge branch 'MDL-70705-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-02-03 15:33:19 +01:00
Luca Bösch d49c11e4ec MDL-70705 block_blog_recent: support multilang blog entry titles 2021-02-03 15:15:25 +01:00
Sara Arjona a0183a8251 Merge branch 'MDL-70741_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-02-03 14:49:51 +01:00
David Castro 6c4989dca7 MDL-69562 admin: Allow getting IP from all sources. 2021-02-03 07:22:48 -05:00
Eloy Lafuente (stronk7) 656fc5e11b Merge branch 'MDL-70711-M310' of git://github.com/kordan/moodle into MOODLE_310_STABLE 2021-02-03 13:04:11 +01:00
Sara Arjona fec01c3415 Merge branch 'MDL-70163-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-02-03 12:25:41 +01:00
Sara Arjona 27bdf9b710 Merge branch 'MDL-70535-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-02-03 11:19:35 +01:00
Sara Arjona e6803f9345 Merge branch 'MDL-67959-310-2' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-02-03 10:50:47 +01:00
Tim Hunt 7015334d6d MDL-69101 Essay/Moodle XML: recent new settings not imported/exported 2021-02-03 08:14:00 +00:00
Sara Arjona b6f7ebe5e6 Merge branch 'MDL-70621-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-02-03 09:02:59 +01:00
Sara Arjona 5f2879986a Merge branch 'MDL-68970_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-02-03 08:51:23 +01:00
Luca Bösch b53915eabb MDL-70621 mod_glossary: use glossary rsstype string. 2021-02-03 08:34:46 +01:00
Luca Bösch a4cc053dd1 MDL-70621 mod_forum: use forum rsstype string. 2021-02-03 08:34:46 +01:00
Andrew Nicols 101667dc59 Merge branch 'MDL-56772-310' of git://github.com/peterRd/moodle into MOODLE_310_STABLE 2021-02-03 10:57:51 +08:00
Andrew Nicols c25da3ed87 Merge branch 'MDL-66932_M310' of https://github.com/nadavkav/moodle into MOODLE_310_STABLE 2021-02-03 10:23:58 +08:00
Andrew Nicols 82e32d8012 Merge branch 'MDL-68893-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-02-03 09:41:09 +08:00
Andrew Nicols 73822e2790 Merge branch 'MDL-68958-310' of git://github.com/peterRd/moodle into MOODLE_310_STABLE 2021-02-03 09:37:49 +08:00
Andrew Nicols a6f3c28afd Merge branch 'MDL-70339-310' of git://github.com/peterRd/moodle into MOODLE_310_STABLE 2021-02-03 09:09:22 +08:00
Víctor Déniz ed48cfd287 Merge branch 'MDL-59782-310' of git://github.com/bmbrands/moodle into MOODLE_310_STABLE 2021-02-02 09:35:40 +00:00
Sara Arjona a9d19d3f20 Merge branch 'MDL-70574_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-02-02 08:20:34 +01:00
Sara Arjona 4a1748a0d8 Merge branch 'MDL-70288-310-2' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-02-02 07:59:42 +01:00
Jun Pataleta 399ed2ef31 MDL-70288 qtype: Remove unnecessary empty label string
* When a label is passed to an (advanced) checkbox and no text
  was provided, the label will be displayed on the right of the the
  checkbox element. So there's no point in passing an empty string for
  the label just to render the text to the right of the checkbox.
2021-02-02 14:21:57 +08:00
Jun Pataleta 14710e4652 MDL-70288 mod_lti: Remove unnecessary empty label string
* When a label is passed to an (advanced) checkbox and no text
  was provided, the label will be displayed on the right of the the
  checkbox element. So there's no point in passing an empty string for
  the label just to render the text to the right of the checkbox.
2021-02-02 14:21:57 +08:00
Jun Pataleta 72c7ab1fcd MDL-70288 core: Remove duplicate labels for checkbox elements
* If there's a label, the text will serve as the description of  the
element.
2021-02-02 14:21:57 +08:00
Jun Pataleta 1feb3e130d MDL-70288 theme_boost: Manage aria-describedby on form validation
* The aria-describedby attribute can be a list of element IDs that
describe the element. On form validation, the ID of the error message
container is added to this attribute which may already be containing
another ID. So we need to properly add/remove the error message ID
so that we don't delete any existing ID(s) in the aria-describedby
attribute during form validation.
2021-02-02 14:21:57 +08:00
Eloy Lafuente (stronk7) 120ab864a1 Merge branch 'MDL-46256_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-02-01 23:20:23 +01:00
Eloy Lafuente (stronk7) 4be8f22e59 Merge branch 'MDL-70648-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-02-01 19:19:46 +01:00
Sara Arjona 63c16676ff Merge branch 'MDL-70625-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-02-01 15:37:09 +01:00
Sara Arjona 66de72d17f Merge branch 'MDL-70734-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-02-01 12:30:21 +01:00
Sara Arjona fc6d356416 Merge branch 'MDL-70740-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-02-01 11:25:22 +01:00
Paul Holden e2d9c997d5 MDL-70614 user: consistent roles spacing in course profile. 2021-02-01 07:54:21 +00:00
Andrew Nicols a7d8af4a9e MDL-70734 behat: Increase the WebDriver Curl timeout 2021-02-01 09:50:08 +08:00
AMOS bot 901e09e890 Automatically generated installer lang files 2021-02-01 00:07:28 +00:00
Andrew Nicols 1cb8980be0 MDL-70740 behat: Composer bump for new version of Mink Driver 2021-01-31 20:26:35 +08:00
AMOS bot 57efb76aba Automatically generated installer lang files 2021-01-31 00:07:24 +00:00
Luca Bösch 3394914940 MDL-68893 mod_data: use own RSS feed string.
AMOS BEGIN
 CPY [rsstype,core],[rsstype,mod_data]
AMOS END
2021-01-29 23:19:57 +01:00
Tim Hunt 78bcf502a3 MDL-70741 capability overview: avoid errors from orphan contexts 2021-01-29 20:50:41 +00:00
Víctor Déniz cd2e91aa18 weekly release 3.10.1+ 2021-01-29 17:13:20 +00:00
Víctor Déniz f72bb528e8 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-01-29 17:13:14 +00:00
Jake Dallimore 629905943f Merge branch 'MDL-66979-310-7' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-01-29 15:44:01 +08:00
Andrew Nicols 1f4b80c9f1 MDL-66979 behat: Mark some tests as being slow
Uses of the httpsreplace and customlang tools are known to be extremely
slow.

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

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

get_real_timeout(30000)

to:

get_real_timeout(30) * 1000

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

get_real_timeout(30000)

to:

get_real_timeout(30) * 1000

because the original functions are defined to use seconds, and
having the 1000 around will help us detecting cases in the case
of a hypothetical review of uses.
2021-01-28 17:12:15 +01:00
Bas Brands b36bc055d4 MDL-59782 core_question: improve questionbank highlighting 2021-01-28 11:08:05 +01:00
Eloy Lafuente (stronk7) d2a001ed67 Merge branch 'MDL-66979-310-7' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-01-28 09:09:01 +01:00
Kordan 1f6f68ad16 MDL-70711 form: deleted useless if block
get_magic_quotes_gpc() always return false since PHP 5.3 so (1 == get_magic_quotes_gpc()) is never verified.
This allows me to safetly delete what I dropped out.
2021-01-28 08:45:36 +01:00
Andrew Nicols 3a0d042395 MDL-66979 behat: Set script timeout with timeout factor 2021-01-28 15:27:49 +08:00
Andrew Nicols 889c9ca8d6 MDL-66979 behat: Correct selenium2 reference in config-dist 2021-01-28 15:08:10 +08:00
Andrew Nicols ebd36d2ac2 MDL-66979 behat: Handle driver stop failure properly
An case was found where the webdriver stop() call could fail in an
AfterScenario hook, leading to a complete rerun if no other errors were
experienced.
2021-01-28 15:07:52 +08:00
Andrew Nicols 46e121473f Merge branch 'MDL-70048-310' of git://github.com/peterRd/moodle into MOODLE_310_STABLE 2021-01-28 08:04:51 +08:00
Peter Dias c1f73e72b4 MDL-70048 dropbox: Augmented unit tests to account for additional params 2021-01-28 07:32:35 +08:00
Peter Dias 276e963f29 MDL-70048 dropbox: Update the dropbox search URL.
- Update fetch_dropbox_data to allow different result nodes and version
- Update search to the new URL with new params
- Update the get entities function to account for the change in structure.
2021-01-28 07:32:35 +08:00
Sara Arjona c856a7f9bb MDL-70725 oauth2: move expectException to separate method 2021-01-27 17:54:17 +01:00
Víctor Déniz b6aed6feaa Merge branch 'MDL-70585-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-01-27 10:52:31 +00:00
AMOS bot 7a3233a7ca Automatically generated installer lang files 2021-01-27 00:07:27 +00:00
Eloy Lafuente (stronk7) cf7eab3db1 Merge branch 'MDL-66979-310-7' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-01-26 22:45:23 +01:00
Víctor Déniz 75b7539e32 Merge branch 'MDL-70528-310' of git://github.com/ilyatregubov/moodle into MOODLE_310_STABLE 2021-01-26 14:05:10 +00:00
Ilya Tregubov 90d42dfc84 MDL-70528 h5pactivity: Fix block can't be added to h5pactivity page. 2021-01-26 15:45:55 +02:00
Paul Holden 92d60b64a8 MDL-70163 core: fix attachment validation when localrequestdir absent.
Switch the order of operations performed when collating list of paths
from which a user can include attachments.

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

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

Thanks to Jake Dallimore and Russell Boyatt for suggestions
which lead to this fix.
2021-01-25 18:35:22 +00:00
Peter Dias 6c364c0011 MDL-70339 mod_lti: Use the convenience function to get the right img 2021-01-25 13:39:14 +08:00
Peter Dias b6c5df8181 MDL-68958 mod_imscp: Return manifestfilename as default response. 2021-01-25 13:23:26 +08:00
Peter Dias 120c2ee7a6 MDL-56772 core: Update the picker styles for rtl langs 2021-01-25 11:36:45 +08:00
Andrew Nicols 058394a412 MDL-66979 behat: Warn about old behat.yml file location 2021-01-23 20:44:53 +08:00
AMOS bot 2acb070a39 Automatically generated installer lang files 2021-01-23 00:07:23 +00:00
Paul Holden 52bc8499aa MDL-70585 course: deeper clean of path names in course export.
This fixes an issue on those systems that don't fully support unicode
characters within zip structures, which subsequently led to broken
links when browsing downloaded course content.
2021-01-22 08:15:32 +00:00
Andrew Nicols ef4a652abe MDL-66979 behat: Rename and warn on old config 2021-01-22 14:52:14 +08:00
Andrew Nicols 5282a67615 MDL-66979 behat: Uncomment step disabled for old firefox 2021-01-22 14:52:14 +08:00
Andrew Nicols d44fdcf54c MDL-66979 behat: Pad messaging drawer
This works around an issue highlighted by MDL-70411 whereby some of the
messaging links are covered by the scrollbar in Firefox on MacOS.
2021-01-22 14:52:14 +08:00
Andrew Nicols 30e2579222 MDL-66979 behat: Work around weird gradebook focus behaviour
I can't expand this one in a sane fashion but the older JS is doing some
weird and wonderful things with focus.

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

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

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

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

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

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

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

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

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

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

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

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

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

Most of these changes relate to use of features of WebDriver which we
are required to use directly rather than through the Mink Driver.
2021-01-22 14:52:13 +08:00
Andrew Nicols fc021f968a MDL-66979 behat: Switch to new W3C Behat driver
This commit updates the composer dependencies to make use of the updated
version of moodlehq/moodle-behat-extension which depends upon the
php-webdriver/webdriver and relevant Mink WebDriver.
2021-01-22 14:52:13 +08:00
Jake Dallimore 2477b04d12 weekly release 3.10.1+ 2021-01-22 11:30:57 +08:00
Jake Dallimore a6af5fd054 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-01-22 11:30:54 +08:00
Tim Hunt 8321e49c8a MDL-46256 count_words: fix handling of paragraphs 2021-01-21 09:54:36 +00:00
Tim Hunt 509eef8fcf MDL-46256 count_letters: an unit tests and fix HTML editity handling 2021-01-21 09:54:36 +00:00
Tim Hunt cb9c2320b6 MDL-46256 word count: Convert existing tests to a data provider 2021-01-21 09:54:36 +00:00
Adrian Greeve b11792ac11 Merge branch 'MDL-57020-310-allow_delete_unused_scale' of https://github.com/sharidas/moodle into MOODLE_310_STABLE 2021-01-21 12:02:49 +08:00
Nadav Kavalerchik dc8a751815 MDL-66932 theme/boost: Use LTR directionality to display user % grades 2021-01-20 09:31:12 +02:00
Simey Lameze 8e6cbc6e18 MDL-70648 calendar: upgrade step to delete wrong cat events 2021-01-20 09:28:54 +08:00
Simey Lameze 33a8c2d06a MDL-70648 calendar: add form validation for category events 2021-01-20 09:26:48 +08:00
AMOS bot 9c4379153f Automatically generated installer lang files 2021-01-17 00:07:26 +00:00
Eloy Lafuente (stronk7) 00821c744c Moodle release 3.10.1 2021-01-16 16:58:29 +01:00
Paul Holden 390326fd17 MDL-70535 media_videojs: fallback to English language video player.
When current language doesn't have accompanying videojs language file
we should fallback to displaying the player in English, otherwise the
web service returns empty and a Javascript exception is triggered.
2021-01-15 13:50:47 +00:00
Sujith Haridasan cbc2b593e7 MDL-57020 scales: Allow deletion of unused scales in forum
Allow deletion of unused scales used in a
forum for the course.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-01-15 15:06:19 +05:30
Sara Arjona f420af1016 weekly release 3.10+ 2021-01-15 08:25:49 +01:00
Sara Arjona 67150560b2 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-01-15 08:25:47 +01:00
Sara Arjona 9fac7a8d59 Merge branch 'MDL-69308_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-01-14 12:03:52 +01:00
Jake Dallimore e1ca7e93d9 Merge branch 'MDL-69877-310' of git://github.com/mickhawkins/moodle into MOODLE_310_STABLE 2021-01-14 14:52:18 +08:00
Michael Hawkins 8bd6cfb4c4 MDL-69877 core: Added security.txt 2021-01-14 14:30:50 +08:00
AMOS bot a3afe546fd Automatically generated installer lang files 2021-01-14 00:07:23 +00:00
Eloy Lafuente (stronk7) db30a623bf MDL-69308 environment: Apply agreed changes
- PHP 7.3 required.
- Moodle 3.6 required.
- SQL*Server 2017 (aka, 14.0) required.
- Sodium PHP extension required.
2021-01-13 19:29:44 +01:00
Eloy Lafuente (stronk7) 3afcb70b3d MDL-69308 environment: 3.11 base information
This is a direct copy of the 3.10 branch to have
the changes under control in next commits.
2021-01-13 19:29:39 +01:00
Shamim Rezaie f9b58dd719 MDL-70625 core_calendar: Fix whitespace appearance in the id attribute 2021-01-14 01:59:08 +11:00
Sara Arjona 9ca6f8199e Merge branch 'MDL-70394-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-01-13 15:31:26 +01:00
Mihail Geshoski 4fec7a276d MDL-68486 auth_shibboleth: Reset convert_data if it uses dataroot file
Upgrade step that resets the 'Data modification API' (convert_data)
setting to its default value if this setting is currently configured
to use a file located within the $CFG->dataroot directory.
2021-01-13 12:35:00 +08:00
Mihail Geshoski b70a1c71e1 MDL-68486 auth_shibboleth: Prevent using dataroot files in convert_data
Prevents configuring the 'Data modification API' (convert_data) setting
to use files located within the $CFG->dataroot directory as it exposes
the site to security risks.
2021-01-13 12:35:00 +08:00
Jun Pataleta 90c450839d Merge branch 'MDL-70580-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-01-13 10:19:51 +08:00
AMOS bot b7a62b4286 Automatically generated installer lang files 2021-01-13 00:07:25 +00:00
Paul Holden 33427c7c5d MDL-70580 core: retrieve closest tree node in click handler. 2021-01-12 20:17:32 +00:00
Michael Hawkins 8fa9d159bc MDL-69911 core: Clean content passed through TeX filter 2021-01-12 10:24:26 +01:00
Ferran Recio f8f154236d MDL-67782 message: fix messages max length 2021-01-12 10:24:26 +01:00
Juan Segarra Montesinos d54cc8fbd7 MDL-69797 core_grades: Implement authorization into fetch method 2021-01-12 10:24:26 +01:00
Juan Segarra Montesinos 7e6fc779c7 MDL-69797 core_grades: Implement authorization into fetch method 2021-01-12 10:24:26 +01:00
Juan Segarra Montesinos 3467d87c80 MDL-69797 gradingform_rubric: Implement authorization into fetch method 2021-01-12 10:24:26 +01:00
Juan Segarra Montesinos 855957180a MDL-69797 gradingform_guide: Implement authorization into fetch method 2021-01-12 10:24:26 +01:00
Sara Arjona 8862b80c56 Merge branch 'MDL-70009-310' of git://github.com/ilyatregubov/moodle into MOODLE_310_STABLE 2021-01-12 10:21:09 +01:00
Jake Dallimore 8b8142d8d9 Merge branch 'MDL-69431_Moodle_310_Validate_section_arg_modedit' of git://github.com/watson8/moodle into MOODLE_310_STABLE 2021-01-12 17:09:01 +08:00
Ilya Tregubov f0260219fa MDL-70009 h5pactivity: Split get_pluginfile_hash in two methods. 2021-01-12 09:10:57 +02:00
Jun Pataleta be36ead8b0 Merge branch 'MDL-70580-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-01-12 13:15:43 +08:00
AMOS bot f270bd8c8e Automatically generated installer lang files 2021-01-12 00:07:34 +00:00
Andrew Nicols 357909b23b MDL-70580 core: Tree nodes should check if they were clicked directly 2021-01-11 23:43:28 +00:00
Tim Hunt 84302e4a76 MDL-70574 qtype_multianswer: fractional scores should be possible 2021-01-11 17:37:25 +00:00
Michael Hawkins 2c45443ad7 MDL-70571 lib: Added additional escaping to search_input template 2021-01-11 16:20:32 +01:00
Sara Arjona 77d7480096 Merge branch 'MDL-70034_310' of git://github.com/mdjnelson/moodle into MOODLE_310_STABLE 2021-01-11 15:19:32 +01:00
Sara Arjona b57b9b41cd Merge branch 'MDL-70567-MOODLE_310_STABLE' of https://github.com/dmitriim/moodle into MOODLE_310_STABLE 2021-01-11 13:09:49 +01:00
Sara Arjona cfa2b28de6 Merge branch 'MDL-70578-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-01-11 12:58:20 +01:00
Sara Arjona e22723680d Merge branch 'MDL-70352-MOODLE_310_STABLE' of https://github.com/dmitriim/moodle into MOODLE_310_STABLE 2021-01-11 12:24:05 +01:00
AMOS bot db2a9784ef Automatically generated installer lang files 2021-01-11 00:08:40 +00:00
David Watson 06d7da192b MDL-69431 course: validate section url param against maxsections 2021-01-10 17:14:58 +00:00
Eloy Lafuente (stronk7) 586a6da356 Merge branch 'MDL-70550-310-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-01-09 13:17:50 +01:00
Mark Nelson 2ab950039c MDL-70034 gradingform_guide: use new API to retrieve grade item name 2021-01-09 14:31:09 +08:00
AMOS bot 3b3c246aaa Automatically generated installer lang files 2021-01-09 00:07:26 +00:00
Sara Arjona b3b476ce3c Merge branch 'MDL-70558-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-01-08 17:07:23 +01:00
Sara Arjona 682ee99293 Merge branch 'MDL-70102-m310' of https://github.com/sammarshallou/moodle into MOODLE_310_STABLE 2021-01-08 15:51:05 +01:00
David Mudrák b8069c3372 MDL-70550 lang: Use the fixed strings in Behat tests, too 2021-01-08 09:11:38 +01:00
Helen Foster 992d1b29b4 MDL-70550 lang: Import fixed English strings (en_fix) 2021-01-08 09:11:38 +01:00
Jun Pataleta ceab4136aa Merge branch 'MDL-70310-310' of git://github.com/ilyatregubov/moodle into MOODLE_310_STABLE 2021-01-08 14:47:14 +08:00
Luca Bösch 8241aa75d5 MDL-70578 cohorts: Add bootstrap classes to buttons 2021-01-08 07:28:15 +01:00
Jun Pataleta f186074a54 weekly release 3.10+ 2021-01-08 12:14:56 +08:00
Jun Pataleta 8585fe1404 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-01-08 12:14:55 +08:00
AMOS bot d4dff59b82 Automatically generated installer lang files 2021-01-08 00:07:23 +00:00
Eloy Lafuente (stronk7) af4b97f57a Merge branch 'MDL-70245-MOODLE_310_STABLE' of https://github.com/TomoTsuyuki/moodle into MOODLE_310_STABLE 2021-01-07 23:49:47 +01:00
Eloy Lafuente (stronk7) c3341dea30 Merge branch 'MDL-70584-310' of git://github.com/marinaglancy/moodle into MOODLE_310_STABLE 2021-01-07 23:31:24 +01:00
sam marshall 2b0b250162 MDL-70102 PHPunit: Core test fails with weird added modules
Specifically it fails if the modules have unusual default capabilities
so that editingteacher doesn't have addinstance.
2021-01-07 16:11:55 +00:00
Marina Glancy dd17f6b1bf MDL-70584 core_iplookup: increase tolerance in test 2021-01-07 14:17:19 +01:00
Ilya Tregubov 4e1786f27f MDL-70310 user: Remove yahoo icon since domain no longer exists. 2021-01-07 09:15:28 +02:00
Jun Pataleta 247437ce25 Merge branch 'MDL-70374_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-01-07 12:24:18 +08:00
Eloy Lafuente (stronk7) 8d306e640f Merge branch 'MDL-70476_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-01-07 00:28:08 +01:00
Eloy Lafuente (stronk7) 17d296f1ea Merge branch 'MOODLE_310_MDL-70520' of https://github.com/golenkovm/moodle into MOODLE_310_STABLE 2021-01-07 00:19:12 +01:00
Paul Holden b8948751f9 MDL-70579 course: filter site fullname when exporting course content. 2021-01-06 21:30:33 +00:00
Dmitrii Metelkin c9dfaec749 MDL-70567 task: fix broken result filter on logs page 2021-01-06 14:29:17 +11:00
Adrian Greeve 304aaf2b7b Merge branch 'MDL-70482_310_STABLE' of https://github.com/sebmehr/moodle into MOODLE_310_STABLE 2021-01-06 11:23:47 +08:00
Dmitrii Metelkin 34153bcc77 MDL-70352 core: attach modal to a specific element 2021-01-06 11:19:57 +11:00
Paul Holden 65ef2f90bf MDL-70558 tool_langimport: sort available language packs. 2021-01-04 23:56:03 +00:00
AMOS bot b12ab80cf5 Automatically generated installer lang files 2020-12-27 00:07:25 +00:00
Sébastien Mehr 9ee975f3a9 MDL-70482 template: add missing closing bracket 2020-12-24 14:04:54 +01:00
AMOS bot fb02551622 Automatically generated installer lang files 2020-12-24 00:07:25 +00:00
Eloy Lafuente (stronk7) 64db9dc75a weekly release 3.10+ 2020-12-23 20:24:53 +01:00
Eloy Lafuente (stronk7) 9d5931b6e2 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2020-12-23 20:24:51 +01:00
Eloy Lafuente (stronk7) 0369198637 Merge branch 'MDL-56119-310' of https://github.com/inigozendegi/moodle into MOODLE_310_STABLE 2020-12-23 01:27:07 +01:00
Eloy Lafuente (stronk7) 62b9a44045 Merge branch 'MDL-70279-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2020-12-23 00:47:00 +01:00
Eloy Lafuente (stronk7) 1251f26d67 Merge branch 'MDL-70436-310' of git://github.com/bmbrands/moodle into MOODLE_310_STABLE 2020-12-22 18:29:55 +01:00
Eloy Lafuente (stronk7) 77a6c383bf Merge branch 'MDL-70386-310' of git://github.com/bmbrands/moodle into MOODLE_310_STABLE 2020-12-22 18:22:00 +01:00
Jake Dallimore 53e81c00fa Merge branch 'MDL-70459-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2020-12-22 16:51:36 +08:00
Jake Dallimore 9480706466 Merge branch 'MDL-69422-310-2' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2020-12-22 16:03:17 +08:00
Jake Dallimore bb48ca47ef Merge branch 'MDL-70426-310' of https://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2020-12-22 15:16:41 +08:00
Mikhail Golenkov 93b2fe7d38 MDL-70520 mod_assign: Use task API to get scheduled task lastruntime 2020-12-22 15:30:50 +11:00
Mikhail Golenkov 6ba4712549 MDL-70520 tasks: Keep lastruntime when a scheduled task is reset 2020-12-22 15:30:45 +11:00
AMOS bot b192dc7c64 Automatically generated installer lang files 2020-12-22 00:07:24 +00:00
Víctor Déniz 2d9922f388 Merge branch 'MDL-70355-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2020-12-21 23:19:20 +00:00
Eloy Lafuente (stronk7) 639f6143e7 Merge branch 'MDL-70430-310-oauth2refreshtoken' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2020-12-22 00:07:00 +01:00
Víctor Déniz 0a27966b67 Merge branch 'MDL-70284-dynreg-bug-310' of https://github.com/cengage/moodle into MOODLE_310_STABLE 2020-12-21 16:33:17 +00:00
Sara Arjona 79b89c2d42 Merge branch 'MDL-69107-310-2' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2020-12-18 15:22:24 +01:00
Tim Hunt 591107c208 MDL-70374 qtype_multichoice: improve alignment of choices 2020-12-18 13:10:13 +00:00
Tim Hunt ccfc9f7bc9 MDL-70476 permission overrides: role names double-escaped in tool tip 2020-12-18 13:04:16 +00:00
Luca Bösch 06bf0c89d6 MDL-70355 calendar: Filter popuptext for calendar entries. 2020-12-17 17:44:04 +01:00
Sara Arjona c25f0087f7 weekly release 3.10+ 2020-12-17 15:52:52 +01:00
Sara Arjona 12830e4214 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2020-12-17 15:52:50 +01:00
Shamim Rezaie 2e1b2cf30e MDL-70394 paygw_paypal: Fix the incorrect foreign key 2020-12-17 00:26:48 +11:00
Víctor Déniz 0bfb0a58a0 Merge branch 'MDL-70261-310' of git://github.com/ilya-catalyst/moodle into MOODLE_310_STABLE 2020-12-16 12:34:29 +00:00
Sara Arjona 50ba1375e8 Merge branch 'MDL-70373_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2020-12-16 12:40:52 +01:00
Shamim Rezaie 5f57b10712 MDL-70459 enrol_fee: Sort the list of currencies when displaying 2020-12-16 22:30:52 +11:00
Shamim Rezaie ec6720a836 MDL-70459 core_payment: use array_merge to merge currencies 2020-12-16 22:30:52 +11:00
Sara Arjona e00b006d51 Merge branch 'MDL-70322-310' of git://github.com/roland04/moodle into MOODLE_310_STABLE 2020-12-16 12:04:22 +01:00
Jun Pataleta 7ce3918e83 Merge branch 'MDL-54907_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2020-12-16 10:26:58 +08:00
Andrew Nicols aa1c7e0a64 MDL-69107 user: Fix autocomplete usages 2020-12-16 07:50:56 +08:00
Sara Arjona cc87756c10 Merge branch 'MDL-70422-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2020-12-15 16:43:02 +01:00
Sara Arjona e7a53e9410 Merge branch 'MDL-70409-310' of git://github.com/merrill-oakland/moodle into MOODLE_310_STABLE 2020-12-15 16:15:50 +01:00
Sara Arjona a050d3f41b Merge branch 'MDL-70342-310' of git://github.com/abias/moodle into MOODLE_310_STABLE 2020-12-15 15:29:18 +01:00
Sara Arjona bc103afb53 Merge branch 'MDL-70357-310-cronlibthrowables' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2020-12-15 14:56:04 +01:00
Ilya Tregubov 50d1003bb7 MDL-70261 course: Allow update locked course custom fields
on course upload.
2020-12-15 14:43:11 +02:00
Jake Dallimore 5c899c722c Merge branch 'MDL-67623-310_blocks_myoverview_pagination_regression' of https://github.com/tomdickman/moodle into MOODLE_310_STABLE 2020-12-15 18:22:11 +08:00
Jun Pataleta 73ad678e73 Merge branch 'MDL-70361-dlrlid-310' of https://github.com/cengage/moodle into MOODLE_310_STABLE 2020-12-15 11:17:25 +08:00
Andrew Nicols 22a5445346 MDL-69107 form_autocomplete: Rewrite item selection
The form_autocomplete is essentially a custom element. Unfortunately the
`setValue()` function in Mink has undesired actions so it is necessary
to write our own handling for it.

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

Course overview block should now do the following:
- Display no pagination controls when user has no courses
- Display no pagination controls when less than 12 courses to display
- Only display pagination controls up to the number of courses user is
enrolled in
- Work correctly when on a page greater than the second page.
2020-12-14 13:28:11 +11:00
AMOS bot 773db77081 Automatically generated installer lang files 2020-12-13 00:07:25 +00:00
AMOS bot a07acd9464 Automatically generated installer lang files 2020-12-12 00:07:28 +00:00
AMOS bot 12b20cbf3b Merge branch 'MOODLE_310_STABLE' into install_310_STABLE 2020-12-12 00:07:27 +00:00
Mikel Martín fa31950c6a MDL-70322 core_search: consistent search icon 2020-12-11 15:40:45 +01:00
AMOS bot 6ef5f4ced0 Automatically generated installer lang files 2020-12-11 00:07:31 +00:00
Víctor Déniz c537ed7fed weekly release 3.10+ 2020-12-10 21:10:47 +00:00
Víctor Déniz f3b2f604e2 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2020-12-10 21:10:40 +00:00
Huong Nguyen f987001a61 MDL-70426 qtype_ddmarker: infinite markers keep duplicating 2020-12-10 15:52:46 +07:00
Shamim Rezaie f1ec340cca MDL-69301 theme_boost: Remove the special handling of Escape key 2020-12-10 14:59:55 +08:00
Tomo Tsuyuki 6998cbfad4 MDL-70245 core_grade: Fix grade_get_setting unit test failures
To fix the phpunit issue, change from static variable to use cache
2020-12-10 16:47:51 +11:00
Jake Dallimore 655f4d4f3f Merge branch 'MDL-70320-310' of https://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2020-12-10 12:01:48 +08:00
Andrew Nicols d9e22f40b4 MDL-70320 behat: User full path to page admin node 2020-12-10 07:55:50 +08:00
Bas Brands df8a5aeab5 MDL-70386 theme_boost: quizes correctness badges 2020-12-09 18:07:29 +01:00
Bas Brands 17cc12c381 MDL-70436 theme_boost: closebutton styles in moodle-dialog-fullscreen 2020-12-09 14:59:44 +01:00
Víctor Déniz e76c5c764b Merge branch 'MDL-63683-310' of https://github.com/dravek/moodle into MOODLE_310_STABLE 2020-12-09 12:47:52 +00:00
Jake Dallimore be45f4c47f Merge branch 'MDL-70151-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2020-12-09 14:46:14 +08:00
Shamim Rezaie fa7e218546 MDL-69301 behat: comment a test out
The e.key is not filled correctly by Geckodriver on the verssion of
Firefox that we use.
2020-12-09 13:40:04 +08:00
Andrew Nicols 5c0a5a531d Merge branch 'MDL-70320_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2020-12-09 12:06:22 +08:00
Andrew Nicols 200ec6b6ac Merge branch 'MDL-62707-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2020-12-09 08:53:27 +08:00
David Mudrák 0e7dc879de MDL-70430 oauth2: Fix storing of the new refresh token
There was a typo - missing underscore. As a result, the new refresh
token was never updated in the database. Depending on the issuer and
whether or when theyu invalidate issued refresh tokens, this might or
might not make the token refresh stop working.
2020-12-08 11:24:27 +01:00
Jake Dallimore 70fe644191 Merge branch 'MDL-70285_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2020-12-08 16:33:43 +08:00
AMOS bot 5178b349e8 Automatically generated installer lang files 2020-12-08 00:07:22 +00:00
Paul Holden c8e335fbe3 MDL-70422 restore: fix for undefined question answer ordering in test. 2020-12-07 10:15:53 +00:00
Adrian Greeve 567e587dbb Merge branch 'MDL-69301-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2020-12-07 09:29:24 +08:00
AMOS bot 37348f1c2e Automatically generated installer lang files 2020-12-06 00:07:27 +00:00
Eric Merrill e2feddadd9 MDL-70409 chat: Use require_once to import lib.php 2020-12-04 10:45:59 -05:00
Paul Holden 0a62138795 MDL-70279 tool_templatelibrary: preserve component search field value. 2020-12-04 14:55:32 +00:00
Paul Holden c24a16a819 MDL-62707 search: account for no matching courses when listing areas.
When limiting the list of courses during retrieval of the search areas
the user can access, make sure we have some contexts before looking
for blocks.
2020-12-04 09:43:17 +00:00
inigozendegi 8091ab8078 MDL-56119 gradingform_rubric: Rubric display layout issue 2020-12-04 09:41:42 +01:00
David Matamoros 12b9c6051e MDL-63683 enrol: Fix plugin settings when no role has student archetype 2020-12-04 09:25:54 +01:00
Andrew Nicols 92e6eb437c MDL-70397 behat: Prevent browser restarting after initial start 2020-12-04 12:07:20 +08:00
Jake Dallimore 32866a1758 weekly release 3.10+ 2020-12-04 08:42:48 +08:00
Jake Dallimore 9ce415b207 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2020-12-04 08:42:45 +08:00
Jake Dallimore ec69ae5929 Merge branch 'MDL-70326-MOODLE_310_STABLE' of https://github.com/durzo/moodle into MOODLE_310_STABLE 2020-12-03 11:54:18 +08:00
Andrew Nicols f5545b5c0e Merge branch 'MDL-70327-310' of git://github.com/cescobedo/moodle into MOODLE_310_STABLE 2020-12-03 11:51:59 +08:00
Andrew Nicols 7c22b71916 Merge branch 'MDL-70321_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2020-12-03 11:39:54 +08:00
Jake Dallimore b5414af214 Merge branch 'MDL-69411-310' of git://github.com/dravek/moodle into MOODLE_310_STABLE 2020-12-03 11:37:00 +08:00
Jake Dallimore 686b5beb23 Merge branch 'MDL-67460-310_profile_secure' of https://github.com/beenet-dev/moodle into MOODLE_310_STABLE 2020-12-03 11:16:31 +08:00
Adrian Greeve af87a57052 Merge branch 'wip_MDL-70267_m310' of git://github.com/gjb2048/moodle into MOODLE_310_STABLE 2020-12-03 10:56:37 +08:00
Adrian Greeve dec6e261e2 Merge branch 'MDL-70167-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2020-12-03 09:57:42 +08:00
AMOS bot 24058ace40 Automatically generated installer lang files 2020-12-03 00:07:26 +00:00
Andrew Nicols d552427f61 Merge branch 'MDL-69868-310' of git://github.com/ilya-catalyst/moodle into MOODLE_310_STABLE 2020-12-03 07:47:48 +08:00
Tim Hunt 0eeb391472 MDL-70373 qtype_essay: missing border on atto input 2020-12-02 20:09:57 +00:00
Shamim Rezaie 433556de1f MDL-69301 theme_boost: Use event.key in aria.js
Both event.which and event.keyCode are deprecated. So
We switched to using event.key. We can only do so now
because IE is no longer supported.
2020-12-03 04:22:09 +11:00
Shamim Rezaie b24f13eca2 MDL-69301 course: Remove custom keyboard navigation code 2020-12-03 04:22:09 +11:00
Shamim Rezaie 65a9b26791 MDL-69301 core: Enhanced WAI-ARIA support for tab elements 2020-12-03 04:22:09 +11:00
Shamim Rezaie 2cc04e2b29 MDL-69301 theme_boost: convert aria.js to es6 module 2020-12-03 04:22:09 +11:00
Jake Dallimore 6be44e7d06 Merge branch 'MDL-67514-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2020-12-02 16:23:54 +08:00
AMOS bot 93b3efa5a7 Automatically generated installer lang files 2020-12-02 00:07:23 +00:00
Thong Bui 2908ed5405 MDL-70324 Question: get_all_response_file_areas() not work correctly 2020-12-01 16:11:21 +07:00
AMOS bot 966c8a37cb Automatically generated installer lang files 2020-12-01 00:07:30 +00:00
Claude Vervoort c8637d645e MDL-70361 mod_lti: deeplinking multiple preserve resourceid and tag 2020-11-30 14:59:54 -05:00
David Mudrák b427f21cca MDL-70357 cron: Catch Throwables not just Exceptions when running tasks
Starting from PHP 7, most language errors throw Error exceptions. We
want to deal with those equally as with any other exception so we need
to catch all Throwables here.
2020-11-30 17:37:25 +01:00
Alexander Bias 25a0001b9f MDL-70342 block_timeline: Get rid of double quotes
This commit gets rid of double quotes around the activity name and course name
which have sneaked into block_timeline's view in MDL-65183.
2020-11-30 13:20:05 +01:00
Gareth Barnard 843cc0ee8d MDL-70267 ux, theme: Course user profile inconsistent page layout. 2020-11-29 23:51:01 +00:00
AMOS bot 0172d13163 Automatically generated installer lang files 2020-11-29 00:07:31 +00:00
Tim Hunt 78bddace2c MDL-54907 quiz unit tests: clean up code style in attempts_test.php 2020-11-27 18:30:43 +00:00
Tim Hunt 779c1687a4 MDL-54907 quiz: better timefinish for attempts finished asynchronously
There are serveral ways a quiz attempt can be submitted:

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

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

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

   Now, in this situation, the finsh time for the quiz attempt is
   recorded as the time when the time limit ran out. This is not
   just less confusing for teachers looking at the quiz report,
   it is also more accurate. That is the latest time at which
   students could have made any changes to their responses.
2020-11-27 18:30:43 +00:00
Tim Hunt c99a83bc5c MDL-54907 quiz generator: defaults should match a new Moodle install 2020-11-27 18:30:43 +00:00
Tim Hunt 0b523e6031 MDL-54907 dml: Correct incorrect PHPdoc 2020-11-27 18:30:42 +00:00
Juan Leyva 4e5dee71b4 MDL-70340 mod_workshop: Do not apply format to peer comments
This text is not directly output to final users, it is used just in the textarea in both the site and the app.
Applying format, case issues like adding glossary links etc...
2020-11-27 18:16:39 +01:00
Jun Pataleta 8cd8daa285 MDL-69422 mod_data: Export form accessibility fixes
* Set appropriate heading element IDs
* Replace usages of deprecated HTML tag acronym with abbr instead.
* Add a label for the export fields fieldset.
* Move the CSV delimiter list outside the radio group.
* Fix div under a label element and duplicate labels
for the checkboxes of the fields to be exported by showing the field
name and type together.
* Group the fields to be exported as a fieldset.
* Move unsupported fields into a separate list.
* Move export options into its own section and group the options as a
fieldset.
2020-11-27 23:24:13 +08:00
Jun Pataleta 1bd007e815 MDL-69422 core: Convert required and help button container to div
* A span element cannot have a div as a child.
2020-11-27 23:24:13 +08:00
Sara Arjona 9c35064345 weekly release 3.10+ 2020-11-27 07:50:48 +01:00
Sara Arjona 5945a1a926 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2020-11-27 07:50:45 +01:00
AMOS bot fac91d11d8 Automatically generated installer lang files 2020-11-27 06:21:03 +00:00
Sara Arjona 9fcd6522ce Merge branch 'MDL-70276_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2020-11-26 15:04:30 +01:00
Andrew Nicols 85673c859e MDL-70153 qtype_essay: Whitespace/behat fixes 2020-11-26 12:54:26 +01:00
Andrew Nicols 4dba8e8359 Merge branch 'MDL-70153-310' of git://github.com/dpalou/moodle into MOODLE_310_STABLE 2020-11-26 12:54:26 +01:00
Andrew Nicols f03c875cf3 Merge branch 'MDL-70237-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2020-11-26 12:54:26 +01:00
Andrew Nicols 9fcb5ece12 Merge branch 'MDL-70242-310' of git://github.com/marinaglancy/moodle into MOODLE_310_STABLE 2020-11-26 12:54:26 +01:00
Andrew Nicols b07833ddf4 Merge branch 'MDL-65852-310' of git://github.com/ilya-catalyst/moodle into MOODLE_310_STABLE 2020-11-26 12:54:26 +01:00
Sara Arjona 333f6cb753 Merge branch 'MDL-70248-310' of https://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2020-11-26 12:54:25 +01:00
Sara Arjona 1c594e729b Merge branch 'MDL-70265_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2020-11-26 12:54:25 +01:00
Ilya Tregubov d8c8f544b3 MDL-69868 h5pactivity: Prevent breaking $USER when seeing
attempt report.
2020-11-26 12:40:28 +02:00
Eloy Lafuente (stronk7) a284ced9a1 MDL-70276 github actions: First cut, phpunit and grunt checks
First working version, supports phpunit (using build matrix):

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

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

TODO: Verify the remaining checks currently in .travis.yml, namely:
 - CITEST
 - Add caching
 - Better health-check for DB images.
 - Support from the tracker (satus badges and enable check).
 - Support from CiBoT (status and enable check).
 - Consider moving both the common setup (git, composer...)
   and the database (mysql, postgres) to own actions for
   easier tweaking.
2020-11-26 00:23:22 +01:00
Tim Hunt cb82824f6a MDL-70320 permission overrides: role names were double-escaped 2020-11-25 21:21:28 +00:00
Claude Vervoort 613c37d54b MDL-70284 mod_lti: dynreg fix response claims 2020-11-25 10:51:08 -05:00
cescobedo 53f9417795 MDL-70327 core_h5p: Add preventredirect to the player 2020-11-25 16:30:46 +01:00
Jordan Tomkinson 407807df6b MDL-70326 antivirus: fixing regression in MDL-66222 2020-11-25 11:28:56 +01:00
Ilya Tregubov 7c80e15392 MDL-65852 user: Fix permission check to download course participants. 2020-11-25 11:27:36 +02:00
Tim Hunt e95c0a90ac MDL-70321 question backup: fix MDL-47178 unit tests
They were failing if you had CodeRunner installed
2020-11-24 15:29:41 +00:00
Simon Mok 48905f6b75 MDL-67460 profile: User profile link to use HTTPS 2020-11-24 20:48:52 +08:00
Tim Hunt b5b562b7ee MDL-70285 completion upgrade: fix performance of the MDL-69687 code 2020-11-23 20:59:08 +00:00
David Matamoros 4a82e72b00 MDL-69411 core_message: Fix return structure for empty result set
Passing a timefrom higher than last message timecreated needs to
return a formatted response so it does not break ws.
2020-11-23 19:25:43 +01:00
Eloy Lafuente (stronk7) ef95f5262f MDL-70265 travis: Completely remove the UPGRADE check
It was broken since ages ago, see MDL-64874, so no sense
to keep it eating minutes for nothing.
2020-11-23 14:28:33 +01:00
Adrian Greeve e2d911c07b Merge branch 'MDL-67668-310-2' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2020-11-23 15:37:44 +08:00
Jake Dallimore 71bae0da0f Merge branch 'MDL-70160-function-cache-310' of https://github.com/Peterburnett/moodle into MOODLE_310_STABLE 2020-11-23 15:22:49 +08:00
Andrew Nicols e7bfbaf7b2 MDL-70151 assign: Fix bulk change for behat
Behat does not play well with confirmation dialogues and in some
situations it does not wait for the page to reload before starting the
next step.

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

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

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

This default behavior can be changed with a new variable:

MOODLE_PHP = [all]
MOODLE_DATABASE = [pgsql | mysqli | all]
2020-11-21 11:28:31 +01:00
Eloy Lafuente (stronk7) 03e3219884 weekly release 3.10+ 2020-11-20 23:17:06 +01:00
Huong Nguyen 681b7f4e78 MDL-70248 qtype_ddimageortext: Drop zones have UI issue in Editing form 2020-11-19 17:03:49 +07:00
Adrian Greeve f098f28d01 Merge branch 'MOODLE_310_STABLE-MDL-67636' of https://github.com/yao9394/moodle into MOODLE_310_STABLE 2020-11-19 11:57:33 +08:00
John Yao bf17d50cf6 MDL-67636 gradebook: Prevent exposing hidden grade in locked category 2020-11-19 14:33:26 +11:00
Adrian Greeve 8e0f036b29 Merge branch 'MDL-56653-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2020-11-19 11:10:48 +08:00
Andrew Nicols 51c6924206 Merge branch 'MDL-69809-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2020-11-19 10:47:46 +08:00
Jun Pataleta f589a25459 Merge branch 'MDL-70094-310' of https://github.com/SangNguyen2601/moodle into MOODLE_310_STABLE 2020-11-19 09:36:53 +08:00
Eloy Lafuente (stronk7) dee389dff6 Merge branch 'MDL-69201-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2020-11-18 23:00:18 +01:00
Shamim Rezaie a9b83b3c01 MDL-70237 payment: Allow html tags in gateway description 2020-11-18 23:25:06 +11:00
sangnguyen2601 0ab0a293a8 MDL-70094 Question: Technical info section expands if click help icon 2020-11-18 17:32:40 +07:00
Dani Palou b76093e90c MDL-70153 qtype_essay: Add behat test for attachments max size 2020-11-18 10:48:17 +01:00
Dani Palou 8f0d40a39c MDL-70153 qtype_essay: Fix max size displayed for attachments 2020-11-18 10:48:17 +01:00
Vitaly 3a2d8a175e MDL-56653 enrol_meta: a single DB query in edit_instance_validation
The 'edit_instance_validation()' method checks for existing meta enrolment instances.
The fix replaces DB queries in a loop for each course with a single query for all courses.
Also, a new testing method 'test_edit_instance_validation_with_existing_courses()'
was added to /enrol/meta/tests/plugin_test.php to test if the new implementation
returns an error in case of trying to save the already linked courses in the 'customint1' field.
2020-11-18 15:05:42 +08:00
Andrew Nicols ff72ca7340 Merge branch '310_MDL-68896' of git://github.com/danmarsden/moodle into MOODLE_310_STABLE 2020-11-18 09:33:06 +08:00
Eloy Lafuente (stronk7) 4e346470a5 Merge branch 'MDL-70148-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2020-11-17 23:13:17 +01:00
Paul Holden 13c76cc295 MDL-67514 customfield: correct external usescategories return type. 2020-11-17 22:13:16 +00:00
Marina Glancy 2c4426bb10 MDL-70242 auth_oauth2: set page context and url 2020-11-17 16:47:59 +01:00
Andrew Nicols d3a9e2935d MDL-70148 gradereport_grader: Improve reliability of keyboard usage
In some browsers the ajax grade select does not properly update the
grade after setting values. The previous solution was to press the
[enter] key, but doing this with the new key type step opens the select
box again. This is what happens when a real user presses enter on the
select.

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

The solution uses a shift-tab to move the focus away to the previous
gradale element. In this case it must also be moved to an earlier step
because the previously selected value must be checked in the Then
section of the test and if it is selected then its value cannot be
checked.
2020-11-17 15:14:43 +08:00
Andrew Nicols 2adc010b85 MDL-70148 qtype: Update qtype steps to new key interaction
Note: The ddmarker question type was previously getting the number of
keypresses wrong. This was because it was using both keyDown/keyUp, and
also keyPress. As a result each keypress was essentially happening two
times.
2020-11-17 15:14:43 +08:00
Andrew Nicols c330c9276c MDL-70148 behat: Update steps for keyboard 2020-11-17 15:14:43 +08:00
Andrew Nicols e9b443b3a1 MDL-70148 behat: Add steps to send keys without an element 2020-11-17 15:14:43 +08:00
Andrew Nicols 7bb692666b Merge branch 'MDL-69526-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2020-11-17 14:55:10 +08:00
Adrian Greeve 5e924f295a Merge branch 'MDL-50955-310' of git://github.com/peterRd/moodle into MOODLE_310_STABLE 2020-11-17 13:08:48 +08:00
Andrew Nicols 739cbcf7e9 Merge branch 'MDL-69964-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2020-11-17 10:22:38 +08:00
Paul Holden 22df02089a MDL-69964 course: toggle participant checkboxes in root element.
For a given toggleGroup, the relevant action elements are not
necessarily descendants of the same tableRoot element, on the
course participants page.
2020-11-16 17:44:23 +00:00
Andrew Nicols be2afb52c1 MDL-67513 core: Only move modal to body if currently attached
A previous change as part of this commitset was intended to move the
modal to the document.body, but where the modal had been destroyed it
was instead added back to the body.
2020-11-16 09:37:48 +01:00
Peter Dias 09520f8e0d MDL-50955 core: Reset lessons completion criteria if grade type is none 2020-11-16 16:35:33 +08:00
Andrew Nicols d661fbfbc1 Merge branch 'MDL-67513-m310' of https://github.com/NeillM/moodle into MOODLE_310_STABLE 2020-11-16 08:27:35 +08:00
Luca Bösch e29069d45b MDL-69526 block_myoverview: custom course fields natural sorting 2020-11-13 00:57:42 +01:00
Neill Magill a2dcfd5bf6 MDL-67513 forum: View conversations while fullscreen grading
Before this change when a modal was shown and an element on the page
was fullscreen the modal would be created behind it.

This change ensures that the modal will be inside an element that is
fullscreen so that it will be correctly displayed.
2020-11-12 08:30:54 +00:00
Peter Burnett ebe19aa434 MDL-70160 cache: plugin_functions checks for function_exists() 2020-11-10 16:03:53 +10:00
Paul Holden 898dd7bf5b MDL-69201 core: consistent table primary sort column/order. 2020-11-09 19:45:41 +00:00
Neill Magill 4423581f8d MDL-67513 forum: Test that discussions can be viewed while grading 2020-11-09 14:24:56 +00:00
Paul Holden 9597baa6e8 MDL-69809 mod_folder: include forcedownload setting in WS responses. 2020-10-12 12:28:26 +01:00
Sam Hemelryk 04073c7e31 MDL-68896 mod_scorm: improved sendBeacon use when unloading 2020-08-19 20:30:17 +12:00
1095 changed files with 13684 additions and 7823 deletions
+71
View File
@@ -0,0 +1,71 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Template configuraton file for github actions CI/CD.
*
* @package core
* @copyright 2020 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// This cannot be used out from a github actions workflow, so just exit.
getenv('GITHUB_WORKFLOW') || die; // phpcs:ignore moodle.Files.MoodleInternal.MoodleInternalGlobalState
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = getenv('dbtype');
$CFG->dblibrary = 'native';
$CFG->dbhost = '127.0.0.1';
$CFG->dbname = 'test';
$CFG->dbuser = 'test';
$CFG->dbpass = 'test';
$CFG->prefix = 'm_';
$CFG->dboptions = ['dbcollation' => 'utf8mb4_bin'];
$host = 'localhost';
$CFG->wwwroot = "http://{$host}";
$CFG->dataroot = realpath(dirname(__DIR__)) . '/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
// Debug options - possible to be controlled by flag in future.
$CFG->debug = (E_ALL | E_STRICT); // DEBUG_DEVELOPER.
$CFG->debugdisplay = 1;
$CFG->debugstringids = 1; // Add strings=1 to url to get string ids.
$CFG->perfdebug = 15;
$CFG->debugpageinfo = 1;
$CFG->allowthemechangeonurl = 1;
$CFG->passwordpolicy = 0;
$CFG->cronclionly = 0;
$CFG->pathtophp = getenv('pathtophp');
$CFG->phpunit_dataroot = realpath(dirname(__DIR__)) . '/phpunitdata';
$CFG->phpunit_prefix = 't_';
define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost:8080');
define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://localhost:8080');
define('TEST_SESSION_REDIS_HOST', 'localhost');
define('TEST_CACHESTORE_REDIS_TESTSERVERS', 'localhost');
// TODO: add others (solr, mongodb, memcached, ldap...).
// Too much for now: define('PHPUNIT_LONGTEST', true); // Only leaves a few tests out and they are run later by CI.
require_once(__DIR__ . '/lib/setup.php');
+103
View File
@@ -0,0 +1,103 @@
name: Core
on: [push]
env:
php: 7.4
jobs:
Grunt:
runs-on: ubuntu-18.04
steps:
- name: Checking out code
uses: actions/checkout@v2
- name: Configuring node & npm
shell: bash -l {0}
run: nvm install
- name: Installing node stuff
run: npm install
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
php: 7.2
db: mysqli
- os: ubuntu-18.04
php: 7.4
db: pgsql
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: johanmeiring/mysql-action@tmpfs-patch
with:
collation server: utf8mb4_bin
mysql version: 5.7
mysql database: test
mysql user: test
mysql password: test
use tmpfs: true
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
uses: m4nu56/postgresql-action@v1
with:
postgresql version: 9.6
postgresql db: test
postgresql user: test
postgresql password: test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v3.x
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v2
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
sudo locale-gen en_AU.UTF-8
php admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
run: vendor/bin/phpunit -v
+29 -71
View File
@@ -16,31 +16,9 @@ services:
- mysql
- docker
php:
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
- 7.4
- 7.2
addons:
postgresql: "9.6"
env:
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
# start first so that the total run time is not too high.
#
# We only run MySQL on PHP 7.2, so run that first.
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
# Postgres is significantly is pretty reasonable in its run-time.
# Run CI Tests without running PHPUnit.
- DB=none TASK=CITEST
# Run unit tests on Postgres
- DB=pgsql TASK=PHPUNIT
# Perform an upgrade test too.
- DB=pgsql TASK=UPGRADE
jobs:
# Enable fast finish.
# This will fail the build if a single job fails (except those in allow_failures).
@@ -48,12 +26,35 @@ jobs:
fast_finish: true
include:
# Run mysql only on highest - it's just too slow
- php: 7.4
# First all the lowest php ones (7.2)
- php: 7.2
env: DB=none TASK=CITEST
- php: 7.2
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
- if: env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present
php: 7.2
env: DB=pgsql TASK=PHPUNIT
- if: env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all"
php: 7.2
env: DB=mysqli TASK=PHPUNIT
# Then, conditionally, all the highest php ones (7.4)
- if: env(MOODLE_PHP) = "all"
php: 7.4
env: DB=none TASK=CITEST
- if: env(MOODLE_PHP) = "all"
php: 7.4
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present)
php: 7.4
env: DB=pgsql TASK=PHPUNIT
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all")
php: 7.4
env: DB=mysqli TASK=PHPUNIT
# Run grunt/npm install on highest version too ('node' is an alias for the latest node.js version.)
- php: 7.4
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
cache:
directories:
@@ -113,7 +114,7 @@ install:
before_script:
- phpenv config-rm xdebug.ini
- >
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
if [ "$TASK" = 'PHPUNIT' ];
then
# Copy generic configuration in place.
cp config-dist.php config.php ;
@@ -224,32 +225,6 @@ before_script:
export phpcmd=`which php`;
fi
########################################################################
# Upgrade test
########################################################################
- >
if [ "$TASK" = 'UPGRADE' ];
then
# We need the official upstream.
git remote add upstream https://github.com/moodle/moodle.git;
# Checkout 30 STABLE branch (the first version compatible with PHP 7.x)
git fetch upstream MOODLE_30_STABLE;
git checkout MOODLE_30_STABLE;
# Perform the upgrade
php admin/cli/install_database.php --agree-license --adminpass=Password --adminemail=admin@example.com --fullname="Upgrade test" --shortname=Upgrade;
# Return to the previous commit
git checkout -;
# Perform the upgrade
php admin/cli/upgrade.php --non-interactive --allow-unstable ;
# The local_ci repository can be used to check upgrade savepoints.
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci ;
fi
script:
- >
if [ "$TASK" = 'PHPUNIT' ];
@@ -275,23 +250,6 @@ script:
git diff --cached --exit-code ;
fi
########################################################################
# Upgrade test
########################################################################
- >
if [ "$TASK" = 'UPGRADE' ];
then
cp local/ci/check_upgrade_savepoints/check_upgrade_savepoints.php ./check_upgrade_savepoints.php
result=`php check_upgrade_savepoints.php`;
# Check if there are problems
count=`echo "$result" | grep -P "ERROR|WARN" | wc -l` ;
if (($count > 0));
then
echo "$result"
exit 1 ;
fi
fi
after_script:
- >
if [ "$TASK" = 'PHPUNIT' ];
+185
View File
@@ -2815,6 +2815,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.1.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2996,6 +2997,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.2.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -3177,6 +3179,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.2.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -3344,4 +3347,186 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.11" requires="3.6">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="9.6" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+1
View File
@@ -32,6 +32,7 @@ $result = optional_param('result', null, PARAM_INT);
$pageurl = new \moodle_url('/admin/tasklogs.php');
$pageurl->param('filter', $filter);
$pageurl->param('result', $result);
$PAGE->set_url($pageurl);
$PAGE->set_context(context_system::instance());
+1
View File
@@ -46,6 +46,7 @@ $string['stepsdefinitionstype'] = 'Type';
$string['theninfo'] = 'Then. Checkings to ensure the outcomes are the expected ones';
$string['unknownexceptioninfo'] = 'There was a problem with Selenium or your browser. Please ensure you are using the latest version of Selenium. Error:';
$string['viewsteps'] = 'Filter';
$string['warndirrootconfigfound'] = 'A configuration file was found at {$a}. This file is not automatically updated and may become stale. We recommend removing this file.';
$string['wheninfo'] = 'When. Action that provokes an event';
$string['wrongbehatsetup'] = 'Something is wrong with the behat setup and so step definitions cannot be listed: <b>{$a->errormsg}</b><br/><br/>Please check:<ul>
<li>$CFG->behat_dataroot, $CFG->behat_prefix and $CFG->behat_wwwroot are set in config.php with different values from $CFG->dataroot, $CFG->prefix and $CFG->wwwroot.</li>
@@ -156,7 +156,7 @@ Feature: Set up contextual data for tests
And I log in as "user5"
And I should see "You are logged in as"
And I am on "Course 1" course homepage
And I should see "You can not enrol yourself in this course."
And I should see "You cannot enrol yourself in this course."
Scenario: Add modules
Given the following "courses" exist:
@@ -6,14 +6,18 @@ Feature: Edit capabilities
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| username | firstname | lastname |
| teacher1 | Teacher | 1 |
| tutor | Teaching | Assistant |
| student | Student | One |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| user | course | role |
| teacher1 | C1 | editingteacher |
| tutor | C1 | teacher |
| student | C1 | student |
Scenario: Default system capabilities modification
Given I log in as "admin"
@@ -60,3 +64,25 @@ Feature: Edit capabilities
Then "mod/forum:deleteanypost" capability has "Prohibit" permission
And "mod/forum:editanypost" capability has "Prevent" permission
And "mod/forum:addquestion" capability has "Allow" permission
@javascript
Scenario: Edit permissions escapes role names correctly
When I am on the "C1" "Course" page logged in as "admin"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Your word for 'Teacher' | Teacher >= editing |
| Your word for 'Non-editing teacher' | Teacher < "editing" |
| Your word for 'Student' | Studier & 'learner' |
And I press "Save and display"
And I navigate to course participants
Then I should see "Teacher >= editing (Teacher)" in the "Teacher 1" "table_row"
And I should see "Teacher < \"editing\" (Non-editing teacher)" in the "Teaching Assistant" "table_row"
And I should see "Studier & 'learner' (Student)" in the "Student One" "table_row"
And I navigate to "Users > Permissions" in current page administration
And I should see "Teacher >= editing" in the "mod/forum:replypost" "table_row"
And I should see "Teacher < \"editing\"" in the "mod/forum:replypost" "table_row"
And I should see "Studier & 'learner'" in the "mod/forum:replypost" "table_row"
And I follow "Prohibit"
And "Teacher >= editing" "button" in the "Prohibit role" "dialogue" should be visible
And "Teacher < \"editing\"" "button" in the "Prohibit role" "dialogue" should be visible
And "Studier & 'learner'" "button" in the "Prohibit role" "dialogue" should be visible
@@ -0,0 +1,30 @@
@tool_behat
Feature: Verify that the inplace editable field works as expected
In order to use behat step definitions
As a test write
I need to ensure that the inplace editable works in forms
Background:
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
And the following "activities" exist:
| activity | course | name | idnumber |
| forum | C1 | My first forum | forum1 |
| assign | C1 | My first assignment | assign1 |
| quiz | C1 | My first quiz | quiz1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Using an inplace editable updates the name of an activity
When I set the field "Edit title" in the "My first assignment" "activity" to "Coursework submission"
Then I should see "Coursework submission"
And I should not see "My first assignment"
But I should see "My first forum"
And I should see "My first quiz"
And I set the field "Edit title" in the "Coursework submission" "activity" to "My first assignment"
And I should not see "Coursework submission"
But I should see "My first assignment"
And I should see "My first forum"
And I should see "My first quiz"
@@ -0,0 +1,52 @@
@tool_behat
Feature: Verify that keyboard steps work as expected
In order to use behat step definitions
As a test writer
I need to verify that the keyboard steps work as expected
@javascript
Scenario: Typing keys into a field causes them to be input
Given the following "users" exist:
| username | email | firstname | lastname | password |
| saffronr | saffron.rutledge@example.com | Saffron | Rutledge | flowerpower |
Given I click on "Log in" "link"
And I click on "Username" "field"
When I type "saffronr"
And I press the tab key
And I type "flowerpower"
And I press enter
Then I should see "You are logged in as Saffron Rutledge"
@javascript
Scenario: Using tab changes focus to the next or previous field
Given I click on "Log in" "link"
And I click on "Username" "field"
And the focused element is "Username" "field"
When I press the tab key
Then the focused element is "Password" "field"
And I press the shift tab key
And the focused element is "Username" "field"
@javascript
Scenario: Using the arrow keys allows me to navigate through menus
Given the following "users" exist:
| username | email | firstname | lastname |
| saffronr | saffron.rutledge@example.com | Saffron | Rutledge |
And I log in as "saffronr"
And I click on "Saffron Rutledge" "link" in the ".usermenu" "css_element"
When I press the up key
Then the focused element is "Log out" "link"
@javascript
Scenario: The escape key can be used to close a dialogue
Given the following "course" exists:
| fullname | C1|
| shortname | C1 |
And I log in as "admin"
And I am on "C1" course homepage
And I navigate to course participants
And I press "Enrol users"
And "Enrol users" "dialogue" should be visible
When I press the escape key
Then "Enrol users" "dialogue" should not be visible
@@ -14,8 +14,6 @@ Feature: Forms manipulation
Then the field "First name" matches value "Field value"
And the "Select a country" select box should contain "Japan"
And the field "New password" matches value "TestPass"
And I take focus off "Update profile" "button"
And I press "Update profile"
@javascript
Scenario: Expand all fieldsets and advanced elements
@@ -60,12 +60,12 @@ class tool_capability_settings_form extends moodleform {
$form->addElement('select', 'roles', get_string('roleslabel', 'tool_capability'), $roles, $attributes);
$form->setType('roles', PARAM_TEXT);
$form->addElement('checkbox', 'onlydiff',
get_string('filters', 'tool_capability'),
get_string('onlydiff', 'tool_capability'));
$filters = [];
$filters[] = $form->createElement('checkbox', 'onlydiff', get_string('onlydiff', 'tool_capability'));
$form->setType('onlydiff', PARAM_BOOL);
$form->addGroup($filters, 'filters', get_string('filters', 'tool_capability'), array('<br>'), false);
$form->addElement('submit', 'submitbutton', get_string('getreport', 'tool_capability'));
}
}
}
+11 -2
View File
@@ -53,7 +53,12 @@ function tool_capability_calculate_role_data($capability, array $roles) {
$sql = 'SELECT DISTINCT con.path, 1
FROM {context} con
JOIN {role_capabilities} rc ON rc.contextid = con.id
WHERE capability = ? '.$sqlroletest;
WHERE capability = ? ' .
$sqlroletest .
// Context path should never be null, but can happen in old database with
// bad data (e.g. a course_module where the corresponding course no longer exists).
// We need to leave these out of the report to prevent errors.
' AND con.path IS NOT NULL';
$relevantpaths = $DB->get_records_sql_menu($sql, $params);
$requiredcontexts = array($systemcontext->id);
foreach ($relevantpaths as $path => $notused) {
@@ -88,6 +93,10 @@ function tool_capability_calculate_role_data($capability, array $roles) {
// Put the role capabilities into the context tree.
foreach ($rolecaps as $rolecap) {
if (!isset($contexts[$rolecap->contextid])) {
// Skip capabilities in orphaned contexts that are not in the tree.
continue;
}
$contexts[$rolecap->contextid]->rolecapabilities[$rolecap->roleid] = $rolecap->permission;
}
@@ -99,4 +108,4 @@ function tool_capability_calculate_role_data($capability, array $roles) {
}
return $contexts;
}
}
@@ -0,0 +1,88 @@
<?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 the capability overview helper functions.
*
* @package tool_capability
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/' . $CFG->admin . '/tool/capability/locallib.php');
/**
* Tests for the capability overview helper functions.
*/
class tool_capability_locallib_testcase extends advanced_testcase {
/**
* Test the function that gets the data - simple case.
*/
public function test_tool_capability_calculate_role_data() {
global $DB;
$data = tool_capability_calculate_role_data('mod/quiz:attempt', get_all_roles());
$systcontext = context_system::instance();
$studentroleid = $DB->get_field('role', 'id', ['shortname' => 'student']);
$this->assertArrayHasKey($systcontext->id, $data);
$this->assertCount(1, $data);
foreach ($data[$systcontext->id]->rolecapabilities as $roleid => $permission) {
if ($roleid == $studentroleid) {
$this->assertEquals(CAP_ALLOW, $permission);
} else {
$this->assertEquals(CAP_INHERIT, $permission);
}
}
}
/**
* Test the function that gets the data - simple case.
*/
public function test_tool_capability_calculate_role_data_orphan_contexts() {
global $DB;
$this->resetAfterTest();
// This simulates a situation that seems to happen sometimes, where
// we end up with contexts with path = NULL in the database.
$systcontext = context_system::instance();
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$coursecontext = context_course::instance($course->id);
$studentroleid = $DB->get_field('role', 'id', ['shortname' => 'student']);
role_change_permission($studentroleid, $coursecontext, 'mod/quiz:attempt', CAP_PREVENT);
// This is where we simulate the breakage.
$DB->set_field('context', 'path', null, ['id' => $coursecontext->id]);
// Now call the function. We mainly just want to know there is no exception.
$data = tool_capability_calculate_role_data('mod/quiz:attempt', get_all_roles());
$this->assertArrayHasKey($systcontext->id, $data);
$this->assertCount(1, $data);
foreach ($data[$systcontext->id]->rolecapabilities as $roleid => $permission) {
if ($roleid == $studentroleid) {
$this->assertEquals(CAP_ALLOW, $permission);
} else {
$this->assertEquals(CAP_INHERIT, $permission);
}
}
}
}
+28 -24
View File
@@ -39,7 +39,7 @@ class tool_customlang_utils {
const ROUGH_NUMBER_OF_STRINGS = 16500;
/** @var array cache of {@link self::list_components()} results */
protected static $components = null;
private static $components = null;
/**
* This class can not be instantiated
@@ -54,28 +54,30 @@ class tool_customlang_utils {
*/
public static function list_components() {
$list['moodle'] = 'core';
if (self::$components === null) {
$list['moodle'] = 'core';
$coresubsystems = core_component::get_core_subsystems();
ksort($coresubsystems); // should be but just in case
foreach ($coresubsystems as $name => $location) {
$list[$name] = 'core_'.$name;
}
$coresubsystems = core_component::get_core_subsystems();
ksort($coresubsystems); // Should be but just in case.
foreach ($coresubsystems as $name => $location) {
$list[$name] = 'core_' . $name;
}
$plugintypes = core_component::get_plugin_types();
foreach ($plugintypes as $type => $location) {
$pluginlist = core_component::get_plugin_list($type);
foreach ($pluginlist as $name => $ununsed) {
if ($type == 'mod') {
// Plugin names are now automatically validated.
$list[$name] = $type.'_'.$name;
} else {
$list[$type.'_'.$name] = $type.'_'.$name;
$plugintypes = core_component::get_plugin_types();
foreach ($plugintypes as $type => $location) {
$pluginlist = core_component::get_plugin_list($type);
foreach ($pluginlist as $name => $ununsed) {
if ($type == 'mod') {
// Plugin names are now automatically validated.
$list[$name] = $type . '_' . $name;
} else {
$list[$type . '_' . $name] = $type . '_' . $name;
}
}
}
self::$components = $list;
}
return $list;
return self::$components;
}
/**
@@ -211,14 +213,18 @@ class tool_customlang_utils {
return false;
}
// get all customized strings from updated components
list($insql, $inparams) = $DB->get_in_or_equal(self::list_components());
// Get all customized strings from updated valid components.
$sql = "SELECT s.*, c.name AS component
FROM {tool_customlang} s
JOIN {tool_customlang_components} c ON s.componentid = c.id
WHERE s.lang = ?
AND (s.local IS NOT NULL OR s.modified = 1)
AND c.name $insql
ORDER BY componentid, stringid";
$strings = $DB->get_records_sql($sql, array($lang));
array_unshift($inparams, $lang);
$strings = $DB->get_records_sql($sql, $inparams);
$files = array();
foreach ($strings as $string) {
@@ -336,11 +342,9 @@ EOF
* @return string|boolean filename eg 'moodle.php' or 'workshop.php', false if not found
*/
protected static function get_component_filename($component) {
if (is_null(self::$components)) {
self::$components = self::list_components();
}
$return = false;
foreach (self::$components as $legacy => $normalized) {
foreach (self::list_components() as $legacy => $normalized) {
if ($component === $normalized) {
$return = $legacy.'.php';
break;
@@ -5,7 +5,10 @@ Feature: Within a moodle instance, an administrator should be able to modify lan
I need to be able to access and change values in the the language customisation of the language pack.
Background:
Given I log in as "admin"
# This is a very slow running test and on slow databases can take minutes to complete.
Given I mark this test as slow setting a timeout factor of 4
And I log in as "admin"
And I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
And I press "Open language pack for editing"
@@ -4,6 +4,10 @@ Feature: Within a moodle instance, an administrator should be able to export mod
As an admin
I need to be able to export the php-files of the language customisation of a language.
Background:
# This is a very slow running feature and on slow databases can take minutes to complete.
Given I mark this test as slow setting a timeout factor of 4
@javascript
Scenario: Export button should not appear if no customization is made
Given I log in as "admin"
@@ -5,7 +5,10 @@ Feature: Within a moodle instance, an administrator should be able to import mod
I need to be able to import the zips and php files of the language customisation of a language.
Background:
Given I log in as "admin"
# This is a very slow running test and on slow databases can take minutes to complete.
Given I mark this test as slow setting a timeout factor of 4
And I log in as "admin"
And I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
And I click on "Import custom strings" "button"
@@ -5,8 +5,11 @@ Feature: Within a moodle instance, an administrator should be able to import lan
I need to be able to import only some language customisation strings depending on some conditions.
Background:
# This is a very slow running feature and on slow databases can take minutes to complete.
Given I mark this test as slow setting a timeout factor of 4
# Add one customization.
Given I log in as "admin"
And I log in as "admin"
And I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
And I press "Open language pack for editing"
@@ -46,7 +46,7 @@ Feature: Manage data requests
And I open the action menu in "John Doe" "table_row"
And I should see "View the request"
But I should not see "Mark as complete"
And I press key "27" in ".moodle-actionmenu" "css_element"
And I press the escape key
And I open the action menu in "Jane Doe" "table_row"
And I choose "Mark as complete" in the open action menu
And I should see "Do you really want to mark this user enquiry as complete?"
@@ -10,16 +10,12 @@ Feature: Manage data storage purposes
And I open the action menu in "region-main" "region"
And I choose "Purposes" in the open action menu
And I press "Add purpose"
And I set the field "Name" to "Purpose 1"
And I set the field "Description" to "Purpose 1 description"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Lawful bases" "form_row"
And I click on "Contract (GDPR Art. 6.1(b))" "list_item"
And I click on "Legal obligation (GDPR Art 6.1(c))" "list_item"
And I press key "27" in the field "Lawful bases"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Sensitive personal data processing reasons" "form_row"
And I click on "Explicit consent (GDPR Art. 9.2(a))" "list_item"
And I press key "27" in the field "Sensitive personal data processing reasons"
And I set the field "retentionperiodnumber" to "2"
And I set the following fields to these values:
| Name | Purpose 1 |
| Description | Purpose 1 description |
| Lawful bases | Contract (GDPR Art. 6.1(b)),Legal obligation (GDPR Art 6.1(c)) |
| Sensitive personal data processing reasons | Explicit consent (GDPR Art. 9.2(a)) |
| retentionperiodnumber | 2 |
When I press "Save"
Then I should see "Purpose 1" in the "List of data purposes" "table"
And I should see "Contract (GDPR Art. 6.1(b))" in the "Purpose 1" "table_row"
@@ -31,14 +27,13 @@ Feature: Manage data storage purposes
Scenario: Update a data storage purpose
Given I open the action menu in "Purpose 1" "table_row"
And I choose "Edit" in the open action menu
And I set the field "Name" to "Purpose 1 edited"
And I set the field "Description" to "Purpose 1 description edited"
And I click on "Legal obligation (GDPR Art 6.1(c))" "text" in the ".form-autocomplete-selection" "css_element"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Lawful bases" "form_row"
And I click on "Vital interests (GDPR Art. 6.1(d))" "list_item"
And I press key "27" in the field "Lawful bases"
And I set the field "retentionperiodnumber" to "3"
And I click on "protected" "checkbox"
And I set the following fields to these values:
| Name | Purpose 1 edited |
| Description | Purpose 1 description edited |
| Lawful bases | Contract (GDPR Art. 6.1(b)), Vital interests (GDPR Art. 6.1(d)) |
| Sensitive personal data processing reasons | Explicit consent (GDPR Art. 9.2(a)) |
| retentionperiodnumber | 3 |
| protected | 1 |
When I press "Save changes"
Then I should see "Purpose 1 edited" in the "List of data purposes" "table"
And I should see "Purpose 1 description edited" in the "Purpose 1 edited" "table_row"
@@ -5,7 +5,10 @@ Feature: View the httpsreplace report
I need to be able to automatically replace http links
Background: Create some http links
Given I am on site homepage
# This is a slow running feature and on slow databases can take over 30 seconds to complete.
Given I mark this test as slow setting a timeout factor of 2
And I am on site homepage
And the following "courses" exist:
| fullname | shortname | category | summary |
| Course 1 | C1 | 0 | <img src="http://intentionally.unavailable/test.png"> <img src="http://download.moodle.org/unittest/test.jpg"> |
@@ -22,8 +22,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_langimport\output;
defined('MOODLE_INTERNAL') || die();
use core_collator;
use moodle_url;
use renderable;
use renderer_base;
@@ -95,6 +95,8 @@ class langimport_page implements renderable, templatable {
if (!empty($this->availablelanguages)) {
$data->toinstalloptions = [];
core_collator::asort($this->availablelanguages);
foreach ($this->availablelanguages as $code => $language) {
$option = new stdClass();
$option->value = $code;
@@ -10,12 +10,10 @@ Feature: Delete custom licenses
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | March |
| version[year] | 2019 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##1 March 2019## |
And I press "Save changes"
And I click on "Delete" "icon" in the "MIT" "table_row"
When I click on "Save changes" "button" in the "Delete licence" "dialogue"
@@ -9,12 +9,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | January |
| version[year] | 2020 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##first day of January 2020## |
When I press "Save changes"
Then I should see "Licence manager"
And I should see "MIT Licence" in the "MIT" "table_row"
@@ -25,12 +23,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | January |
| version[year] | 2020 |
| shortname | MIT |
| fullname | MIT Licence |
| source | opensource.org/licenses/MIT |
| Licence version | ##2020-01-01## |
When I press "Save changes"
Then I should see "Invalid source URL"
And I set the following fields to these values:
@@ -49,12 +45,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | March |
| version[year] | 2019 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##1 March 2019## |
When I press "Save changes"
Then I should see "Licence manager"
And I should see "2019030100" in the "MIT" "table_row"
@@ -65,12 +59,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | March |
| version[year] | 2019 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##1 Mar 2019## |
And I press "Save changes"
And I should see "Licence manager"
And I should see "MIT Licence" in the "MIT" "table_row"
@@ -53,11 +53,11 @@ Feature: See the competencies for an activity on the course competencies page.
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"
And I press key "13" in the field "Filter competencies by resource or activity"
And I press the enter key
And I should see "Test-Comp1"
And I should not see "Test-Comp2"
And I set the field "Filter competencies by resource or activity" to "PageName2"
And I press key "13" in the field "Filter competencies by resource or activity"
And I press the enter key
And I should not see "Test-Comp1"
And I should not see "Test-Comp2"
And I should see "No competencies have been linked to this activity or resource."
+2 -4
View File
@@ -30,7 +30,7 @@ Feature: Manage plearning plan
And I click on ".template-userplans" "css_element" in the "Science template" "table_row"
And I open the autocomplete suggestions list
And I click on "Admin User" item in the autocomplete list
And I press key "27" in the field "Select users to create learning plans for"
And I press the escape key
When I click on "Create learning plans" "button"
Then I should see "A learning plan was created"
And I should see "Admin User" in the "Science template" "table_row"
@@ -53,9 +53,7 @@ Feature: Manage plearning plan
And I follow "Home"
And I navigate to "Competencies > Learning plan templates" in site administration
And I click on ".template-cohorts" "css_element" in the "Science template cohort" "table_row"
And I click on ".form-autocomplete-downarrow" "css_element"
And I click on "cohort plan" item in the autocomplete list
And I press key "27" in the field "Select cohorts to sync"
And I set the field "Select cohorts to sync" to "cohort plan"
When I click on "Add cohorts" "button"
Then I should see "2 learning plans were created."
And I follow "Learning plan templates"
+1 -1
View File
@@ -221,7 +221,7 @@ class api {
}
// Identity providers.
$authsequence = get_enabled_auth_plugins(true);
$authsequence = get_enabled_auth_plugins();
$identityproviders = \auth_plugin_base::get_identity_providers($authsequence);
$identityprovidersdata = \auth_plugin_base::prepare_identity_providers_for_output($identityproviders, $OUTPUT);
if (!empty($identityprovidersdata)) {
@@ -1,2 +1,2 @@
define ("tool_policy/acceptances_filter_datasource",["jquery","core/ajax","core/notification"],function(a,b,c){return{list:function list(b,c){var d=[],e=a(b),f=a(b).data("originaloptionsjson"),g=e.val();a.each(f,function(b,e){if(""!==a.trim(c)&&-1===e.label.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())){return!0}if(-1<a.inArray(e.value,g)){return!0}d.push(e);return!0});var h=new a.Deferred;h.resolve(d);return h.promise()},processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.value,label:b.label})});return d},transport:function transport(a,b,d){this.list(a,b).then(d).catch(c.exception)}}});
define ("tool_policy/acceptances_filter_datasource",["jquery","core/ajax","core/notification"],function(a,b,c){return{list:function list(b,c){var d=[],e=a(b),f=a(b).data("originaloptionsjson"),g=e.val();a.each(f,function(b,e){if(""!==c.trim()&&-1===e.label.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())){return!0}if(-1<a.inArray(e.value,g)){return!0}d.push(e);return!0});var h=new a.Deferred;h.resolve(d);return h.promise()},processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.value,label:b.label})});return d},transport:function transport(a,b,d){this.list(a,b).then(d).catch(c.exception)}}});
//# sourceMappingURL=acceptances_filter_datasource.min.js.map
File diff suppressed because one or more lines are too long
@@ -41,7 +41,7 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat
var selectedFilters = el.val();
$.each(originalOptions, function(index, option) {
// Skip option if it does not contain the query string.
if ($.trim(query) !== '' && option.label.toLocaleLowerCase().indexOf(query.toLocaleLowerCase()) === -1) {
if (query.trim() !== '' && option.label.toLocaleLowerCase().indexOf(query.toLocaleLowerCase()) === -1) {
return true;
}
// Skip filters that have already been selected.
@@ -641,6 +641,6 @@ class acceptances_table extends \table_sql {
}
return ''; // User agreed by themselves.
}
return null;
return parent::other_cols($column, $row);
}
}
+1 -1
View File
@@ -1,2 +1,2 @@
define ("tool_templatelibrary/search",["jquery","core/ajax","core/log","core/notification","core/templates","core/config"],function(a,b,c,d,e,f){var g=function(b){e.render("tool_templatelibrary/search_results",{templates:b}).done(function(b,c){e.replaceNode(a("[data-region=\"searchresults\"]"),b,c)}).fail(d.exception)},h=function(c){var e=a("[data-field=\"component\"]").val(),f=a("[data-region=\"list-templates\"] [data-region=\"input\"]").val();if(""!==f){a("[data-region=\"list-templates\"] [data-action=\"clearsearch\"]").removeClass("d-none")}else{a("[data-region=\"list-templates\"] [data-action=\"clearsearch\"]").addClass("d-none")}document.location.hash=f;b.call([{methodname:"tool_templatelibrary_list_templates",args:{component:e,search:f,themename:c},done:g,fail:d.exception}],!0,!1)},i=null,j=function(a,b){if(null!==i){window.clearTimeout(i)}i=window.setTimeout(function(){a();i=null},b)},k=function(){j(h.bind(this,f.theme),400)};a("[data-region=\"list-templates\"]").on("change","[data-field=\"component\"]",k);a("[data-region=\"list-templates\"]").on("input","[data-region=\"input\"]",k);a("[data-action=\"clearsearch\"]").on("click",function(){a("[data-region=\"input\"]").val("");h(f.theme);a(this).addClass("d-none")});a("[data-region=\"input\"]").val(document.location.hash.replace("#",""));h(f.theme);return{}});
define ("tool_templatelibrary/search",["jquery","core/ajax","core/log","core/notification","core/templates","core/config"],function(a,b,c,d,e,f){var g=function(b){e.render("tool_templatelibrary/search_results",{templates:b}).done(function(b,c){e.replaceNode(a("[data-region=\"searchresults\"]"),b,c)}).fail(d.exception)},h=function(c){var e=a("[data-field=\"component\"]").val(),f=a("[data-region=\"list-templates\"] [data-region=\"input\"]").val();if(""!==f){a("[data-region=\"list-templates\"] [data-action=\"clearsearch\"]").removeClass("d-none")}else{a("[data-region=\"list-templates\"] [data-action=\"clearsearch\"]").addClass("d-none")}b.call([{methodname:"tool_templatelibrary_list_templates",args:{component:e,search:f,themename:c},done:g,fail:d.exception}],!0,!1)},i=null,j=function(a,b){if(null!==i){window.clearTimeout(i)}i=window.setTimeout(function(){a();i=null},b)},k=function(){j(h.bind(this,f.theme),400)};a("[data-region=\"list-templates\"]").on("change","[data-field=\"component\"]",k);a("[data-region=\"list-templates\"]").on("input","[data-region=\"input\"]",k);a("[data-action=\"clearsearch\"]").on("click",function(){a("[data-region=\"input\"]").val("");h(f.theme);a(this).addClass("d-none")});h(f.theme);return{}});
//# sourceMappingURL=search.min.js.map
File diff suppressed because one or more lines are too long
+1 -3
View File
@@ -52,9 +52,8 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
} else {
$('[data-region="list-templates"] [data-action="clearsearch"]').addClass('d-none');
}
// Trigger the search.
document.location.hash = searchStr;
// Trigger the search.
ajax.call([
{methodname: 'tool_templatelibrary_list_templates',
args: {component: componentStr, search: searchStr, themename: themename},
@@ -96,7 +95,6 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
$(this).addClass('d-none');
});
$('[data-region="input"]').val(document.location.hash.replace('#', ''));
refreshSearch(config.theme);
return {};
});
@@ -38,6 +38,22 @@ use tool_templatelibrary\api;
*/
class list_templates_page implements renderable, templatable {
/** @var string $component The currently selected component */
protected $component;
/** @var string $search The current search */
protected $search;
/**
* Template page constructor
*
* @param string $component
* @param string $search
*/
public function __construct(string $component = '', string $search = '') {
$this->component = $component;
$this->search = $search;
}
/**
* Export this data so it can be used as the context for a mustache template.
*
@@ -46,6 +62,7 @@ class list_templates_page implements renderable, templatable {
public function export_for_template(renderer_base $output) {
$data = new stdClass();
$data->allcomponents = array();
$data->search = $this->search;
$fulltemplatenames = api::list_templates();
$pluginmanager = core_plugin_manager::instance();
$components = array();
@@ -59,6 +76,7 @@ class list_templates_page implements renderable, templatable {
foreach ($components as $component) {
$info = new stdClass();
$info->component = $component;
$info->selected = ($component === $this->component);
if (strpos($component, 'core') === 0) {
$info->name = get_string('coresubsystem', 'tool_templatelibrary', $component);
} else {
@@ -72,10 +72,10 @@
{{/label}}
{{$element}}
<select id="selectcomponent" class="form-control" data-field="component">
<select id="selectcomponent" name="component" class="form-control" data-field="component">
<option value="">{{#str}}all, tool_templatelibrary{{/str}}</option>
{{#allcomponents}}
<option value="{{component}}">{{name}}</option>
<option value="{{component}}" {{#selected}}selected{{/selected}}>{{name}}</option>
{{/allcomponents}}
</select>
{{/element}}
@@ -84,10 +84,10 @@
{{< core_form/element-template }}
{{$element}}
{{< core/search_input_auto }}
{{$label}}{{{ searchstring }}}{{/label}}
{{$placeholder}}{{#str}}
search, core
{{/str}}{{/placeholder}}
{{$label}}
{{#str}} search, tool_templatelibrary {{/str}}
{{/label}}
{{$value}}{{ search }}{{/value}}
{{/ core/search_input_auto }}
{{/element}}
{{/ core_form/element-template }}
+1 -1
View File
@@ -305,7 +305,7 @@ class admin_uploaduser_form2 extends moodleform {
$mform->setAdvanced('url');
$mform->addElement('text', 'idnumber', get_string('idnumber'), 'maxlength="255" size="25"');
$mform->setType('idnumber', PARAM_NOTAGS);
$mform->setType('idnumber', core_user::get_property_type('idnumber'));
$mform->setForceLtr('idnumber');
$mform->addElement('text', 'institution', get_string('institution'), 'maxlength="255" size="25"');
@@ -93,7 +93,7 @@ class create_xml_file extends XMLDBAction {
$c.= ' </KEYS>' . "\n";
$c.= ' </TABLE>' . "\n";
$c.= ' </TABLES>' . "\n";
$c.= ' </XMLDB>';
$c.= ' </XMLDB>' . "\n";
if (!file_put_contents($file, $c)) {
$errormsg = 'Error creando fichero ' . $file;
+1 -4
View File
@@ -55,10 +55,7 @@ Feature: Manage analytics models
And I choose "Create model" in the open action menu
And I set the field "Enabled" to "Enable"
And I select "__core_course__analytics__target__course_completion" from the "target" singleselect
And I open the autocomplete suggestions list
And I click on "Read actions amount" item in the autocomplete list
And I open the autocomplete suggestions list
And I click on "Any write action in the course" item in the autocomplete list
And I set the field "Indicators" to "Read actions amount, Any write action in the course"
And I select "__core__analytics__time_splitting__single_range" from the "timesplitting" singleselect
And I press "Save changes"
Then I should see "No predictions available yet" in the "Students at risk of not meeting the course completion conditions" "table_row"
+2 -4
View File
@@ -178,10 +178,10 @@ class auth_plugin_email extends auth_plugin_base {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
} else if ($user->secret === $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
} else if ($user->secret === $confirmsecret) { // They have provided the secret key to get in
$DB->set_field("user", "confirmed", 1, array("id"=>$user->id));
if ($wantsurl = get_user_preferences('auth_email_wantsurl', false, $user)) {
@@ -257,5 +257,3 @@ class auth_plugin_email extends auth_plugin_base {
}
}
+2 -2
View File
@@ -598,10 +598,10 @@ class auth_plugin_ldap extends auth_plugin_base {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
} else if ($user->secret === $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
} else if ($user->secret === $confirmsecret) { // They have provided the secret key to get in
if (!$this->user_activate($username)) {
return AUTH_CONFIRM_FAIL;
}
+1 -1
View File
@@ -8,7 +8,7 @@ $PAGE->set_context(context_system::instance());
// Define variables used in page
$site = get_site();
$authsequence = get_enabled_auth_plugins(true); // auths, in sequence
$authsequence = get_enabled_auth_plugins(); // Auths, in sequence.
if (!in_array('ldap', $authsequence, true)) {
print_error('ldap_isdisabled', 'auth');
}
+1 -1
View File
@@ -8,7 +8,7 @@ $PAGE->set_context(context_system::instance());
// Define variables used in page
$site = get_site();
$authsequence = get_enabled_auth_plugins(true); // auths, in sequence
$authsequence = get_enabled_auth_plugins(); // Auths, in sequence.
if (!in_array('ldap', $authsequence, true)) {
print_error('ldap_isdisabled', 'auth');
}
+1 -1
View File
@@ -10,7 +10,7 @@ require(__DIR__.'/../../config.php');
$PAGE->set_context(context_system::instance());
$authsequence = get_enabled_auth_plugins(true); // auths, in sequence
$authsequence = get_enabled_auth_plugins(); // Auths, in sequence.
if (!in_array('ldap', $authsequence, true)) {
print_error('ldap_isdisabled', 'auth');
}
+1 -1
View File
@@ -543,7 +543,7 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
}
protected function enable_plugin() {
$auths = get_enabled_auth_plugins(true);
$auths = get_enabled_auth_plugins();
if (!in_array('ldap', $auths)) {
$auths[] = 'ldap';
+2 -2
View File
@@ -372,10 +372,10 @@ class auth extends \auth_plugin_base {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
} else if ($user->secret === $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in.
} else if ($user->secret === $confirmsecret) { // They have provided the secret key to get in.
$DB->set_field("user", "confirmed", 1, array("id" => $user->id));
return AUTH_CONFIRM_OK;
}
+3
View File
@@ -27,6 +27,9 @@ require_once('../../config.php');
$issuerid = required_param('id', PARAM_INT);
$wantsurl = new moodle_url(optional_param('wantsurl', '', PARAM_URL));
$PAGE->set_context(context_system::instance());
$PAGE->set_url(new moodle_url('/auth/oauth2/login.php', ['id' => $issuerid]));
require_sesskey();
if (!\auth_oauth2\api::is_enabled()) {
+2 -1
View File
@@ -182,7 +182,8 @@ How to customize the way the Shibboleth user data is used in Moodle
Among the Shibboleth settings in Moodle there is a field that should contain a
path to a php file that can be used as data manipulation hook.
You can use this if you want to further process the way your Shibboleth
attributes are used in Moodle.
attributes are used in Moodle. Due to security reasons this file cannot be
located within the current site data directory ($CFG->dataroot).
Example 1: Your Shibboleth federation uses an attribute that specifies the
user's preferred language, but the content of this attribute is not
@@ -0,0 +1,75 @@
<?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/>.
/**
* Special setting for auth_shibboleth convert_data.
*
* @package auth_shibboleth
* @copyright 2020 Mihail Geshoski
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Admin settings class for the convert_data option.
*
* @package auth_shibboleth
* @copyright 2020 Mihail Geshoski
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class auth_shibboleth_admin_setting_convert_data extends admin_setting_configfile {
/**
* Constructor.
*
* @param string $name
* @param string $visiblename
* @param string $description
* @param mixed $defaultdirectory
*/
public function __construct($name, $visiblename, $description, $defaultdirectory) {
parent::__construct($name, $visiblename, $description, $defaultdirectory);
}
/**
* Validate the file path (location).
*
* This method ensures that the file defined as a data modification API exists and is not located in the site
* data directory ($CFG->dataroot). We should prohibit using files from the site data directory as this introduces
* security vulnerabilities.
*
* @param string $filepath The path to the file.
* @return mixed bool true for success or string:error on failure.
*/
public function validate($filepath) {
global $CFG;
if (empty($filepath)) {
return true;
}
// Fail if the file does not exist or it is not readable by the webserver process.
if (!is_readable($filepath)) {
return get_string('auth_shib_convert_data_warning', 'auth_shibboleth');
}
// Fail if the absolute file path matches the currently defined dataroot path.
if (preg_match('/' . preg_quote($CFG->dataroot, '/') . '/', realpath($filepath))) {
return get_string('auth_shib_convert_data_filepath_warning', 'auth_shibboleth');
}
return true;
}
}
+23 -1
View File
@@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die();
* @return bool result
*/
function xmldb_auth_shibboleth_upgrade($oldversion) {
global $CFG, $DB;
global $CFG, $DB, $OUTPUT;
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
@@ -50,5 +50,27 @@ function xmldb_auth_shibboleth_upgrade($oldversion) {
// Automatically generated Moodle v3.10.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2020110901) {
// The 'Data modification API' setting in the Shibboleth authentication plugin can no longer be configured
// to use files located within the site data directory, as it exposes the site to security risks. Therefore,
// we need to find every existing case and reset the 'Data modification API' setting to its default value.
$convertdataconfig = get_config('auth_shibboleth', 'convert_data');
if (preg_match('/' . preg_quote($CFG->dataroot, '/') . '/', realpath($convertdataconfig))) {
set_config('convert_data', '', 'auth_shibboleth');
$warn = 'Your \'Data modification API\' setting in the Shibboleth authentication plugin is currently
configured to use a file located within the current site data directory ($CFG->dataroot). You are no
longer able to use files from within this directory for this purpose as it exposes your site to security
risks. This setting has been reset to its default value. Please reconfigure it by providing a path
to a file which is not located within the site data directory.';
echo $OUTPUT->notification($warn, 'notifyproblem');
}
upgrade_plugin_savepoint(true, 2020110901, 'auth', 'shibboleth');
}
return true;
}
@@ -38,6 +38,7 @@ $string['auth_shibboleth_select_organization'] = 'For authentication via Shibbol
$string['auth_shib_convert_data'] = 'Data modification API';
$string['auth_shib_convert_data_description'] = 'You can use this API to further modify the data provided by Shibboleth. Read the <a href="{$a}">README</a> for further instructions.';
$string['auth_shib_convert_data_warning'] = 'The file does not exist or is not readable by the webserver process!';
$string['auth_shib_convert_data_filepath_warning'] = 'You cannot use a file that is located within the current site data directory ($CFG->dataroot) as the data modification API.';
$string['auth_shib_changepasswordurl'] = 'Password-change URL';
$string['auth_shib_idp_list'] = 'Identity providers';
$string['auth_shib_idp_list_description'] = 'Provide a list of Identity Provider entityIDs to let the user choose from on the login page.<br />On each line there must be a comma-separated tuple for entityID of the IdP (see the Shibboleth metadata file) and Name of IdP as it shall be displayed in the drop-down list.<br />As an optional third parameter you can add the location of a Shibboleth session initiator that shall be used in case your Moodle installation is part of a multi federation setup.';
+3 -2
View File
@@ -28,6 +28,7 @@ if ($ADMIN->fulltree) {
// We use a couple of custom admin settings since we need to massage the data before it is inserted into the DB.
require_once($CFG->dirroot.'/auth/shibboleth/classes/admin_setting_special_wayf_select.php');
require_once($CFG->dirroot.'/auth/shibboleth/classes/admin_setting_special_idp_configtextarea.php');
require_once($CFG->dirroot.'/auth/shibboleth/classes/admin_setting_special_convert_data_configfile.php');
// Introductory explanation.
$readmeurl = (new moodle_url('/auth/shibboleth/README.txt'))->out();
@@ -38,8 +39,8 @@ if ($ADMIN->fulltree) {
$settings->add(new admin_setting_configtext('auth_shibboleth/user_attribute', get_string('username'),
get_string('auth_shib_username_description', 'auth_shibboleth'), '', PARAM_RAW));
// COnvert Data configuration file.
$settings->add(new admin_setting_configfile('auth_shibboleth/convert_data',
// Convert Data configuration file.
$settings->add(new auth_shibboleth_admin_setting_convert_data('auth_shibboleth/convert_data',
get_string('auth_shib_convert_data', 'auth_shibboleth'),
get_string('auth_shib_convert_data_description', 'auth_shibboleth', $readmeurl), ''));
+5
View File
@@ -1,6 +1,11 @@
This files describes API changes in /auth/shibboleth/*,
information provided here is intended especially for developers.
=== 3.10.1 ===
* The 'Data modification API' (convert_data) setting can no longer be configured to use files located within the
current site data directory ($CFG->dataroot), as it exposes the site to security risks.
=== 3.5.2 ===
* Moved the public function unserializesession in auth/shibboleth/logout.php to auth/shibboleth/classes/helper.php and
+1 -1
View File
@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2020110901; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2020110300; // Requires this Moodle version
$plugin->component = 'auth_shibboleth'; // Full name of the plugin (used for diagnostics)
+12 -1
View File
@@ -835,6 +835,9 @@ class backup_badges_structure_step extends backup_structure_step {
}
protected function define_structure() {
global $CFG;
require_once($CFG->libdir . '/badgeslib.php');
// Define each element separated.
@@ -886,7 +889,15 @@ class backup_badges_structure_step extends backup_structure_step {
// Define sources.
$badge->set_source_table('badge', array('courseid' => backup::VAR_COURSEID));
$parametersql = '
SELECT *
FROM {badge}
WHERE courseid = :courseid
AND status != ' . BADGE_STATUS_ARCHIVED;
$parameterparams = [
'courseid' => backup::VAR_COURSEID
];
$badge->set_source_sql($parametersql, $parameterparams);
$criterion->set_source_table('badge_criteria', array('badgeid' => backup::VAR_PARENTID));
$endorsement->set_source_table('badge_endorsement', array('badgeid' => backup::VAR_PARENTID));
@@ -82,16 +82,17 @@ class restore_quiz_decode_testcase extends \core_privacy\tests\provider_testcase
$newcm = duplicate_module($course, get_fast_modinfo($course)->get_cm($quiz->cmid));
$sql = "SELECT qa.answer
$sql = "SELECT qa.id, qa.answer
FROM {quiz} q
LEFT JOIN {quiz_slots} qs ON qs.quizid = q.id
LEFT JOIN {question_answers} qa ON qa.question = qs.questionid
WHERE q.id = :quizid";
$params = array('quizid' => $newcm->instance);
$answers = $DB->get_fieldset_sql($sql, $params);
$this->assertEquals($CFG->wwwroot . '/course/view.php?id=' . $course->id, $answers[0]);
$this->assertEquals($CFG->wwwroot . '/mod/quiz/view.php?id=' . $quiz->cmid, $answers[1]);
$this->assertEquals($CFG->wwwroot . '/grade/report/index.php?id=' . $quiz->cmid, $answers[2]);
$this->assertEquals($CFG->wwwroot . '/mod/quiz/index.php?id=' . $quiz->cmid, $answers[3]);
$answers = $DB->get_records_sql_menu($sql, $params);
$this->assertEquals($CFG->wwwroot . '/course/view.php?id=' . $course->id, $answers[$firstanswer->id]);
$this->assertEquals($CFG->wwwroot . '/mod/quiz/view.php?id=' . $quiz->cmid, $answers[$secondanswer->id]);
$this->assertEquals($CFG->wwwroot . '/grade/report/index.php?id=' . $quiz->cmid, $answers[$thirdanswer->id]);
$this->assertEquals($CFG->wwwroot . '/mod/quiz/index.php?id=' . $quiz->cmid, $answers[$fourthanswer->id]);
}
}
+2 -2
View File
@@ -1078,8 +1078,8 @@ abstract class restore_dbops {
$localpath = $filesystem->get_local_path_from_storedfile($storedfile);
$fs->create_file_from_pathname($file, $localpath);
} else if ($filesystem->is_file_readable_remotely_by_storedfile($storedfile)) {
$url = $filesystem->get_remote_path_from_storedfile($storedfile);
$fs->create_file_from_url($file, $url);
$remotepath = $filesystem->get_remote_path_from_storedfile($storedfile);
$fs->create_file_from_pathname($file, $remotepath);
} else if ($filesystem->is_file_readable_locally_by_storedfile($storedfile, true)) {
$localpath = $filesystem->get_local_path_from_storedfile($storedfile, true);
$fs->create_file_from_pathname($file, $localpath);
+1 -1
View File
@@ -173,7 +173,7 @@ class client extends \core\oauth2\client {
* @return moodle_url url of callback
*/
public static function callback_url() {
return new moodle_url('/badges/oauth2callback.php');
return new moodle_url('/admin/oauth2callback.php');
}
/**
-57
View File
@@ -1,57 +0,0 @@
<?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/>.
/**
* Verify authorization callback.
*
* @package core_badges
* @copyright 2020 Tung Thai
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @author Tung Thai <Tung.ThaiDuc@nashtechglobal.com>
*/
require_once(__DIR__ . '/../config.php');
$error = optional_param('error', '', PARAM_RAW);
if ($error) {
$message = optional_param('error_description', '', PARAM_RAW);
if ($message) {
print_error($message);
} else {
print_error($error);
}
die();
}
require_login();
// The authorization code generated by the authorization server.
$code = required_param('code', PARAM_RAW);
$scope = required_param('scope', PARAM_RAW);
// The state parameter we've given (used in moodle as a redirect url).
$state = required_param('state', PARAM_LOCALURL);
$redirecturl = new moodle_url($state);
$params = $redirecturl->params();
if (isset($params['sesskey']) and confirm_sesskey($params['sesskey'])) {
$redirecturl->param('oauth2code', $code);
$redirecturl->param('scope', $scope);
redirect($redirecturl);
} else {
print_error('invalidsesskey');
}
+9 -4
View File
@@ -322,7 +322,15 @@ class core_badges_renderer extends plugin_renderer_base {
$badgeclass = $ibadge->badgeclass;
$badge = new badge($ibadge->badgeid);
$now = time();
$expiration = isset($issued['expires']) ? $issued['expires'] : $now + 86400;
if (isset($issued['expires'])) {
if (!is_numeric($issued['expires'])) {
$issued['expires'] = strtotime($issued['expires']);
}
$expiration = $issued['expires'];
} else {
$expiration = $now + 86400;
}
$badgeimage = is_array($badgeclass['image']) ? $badgeclass['image']['id'] : $badgeclass['image'];
$languages = get_string_manager()->get_list_of_languages();
@@ -432,9 +440,6 @@ class core_badges_renderer extends plugin_renderer_base {
}
$dl[get_string('dateawarded', 'badges')] = userdate($issued['issuedOn']);
if (isset($issued['expires'])) {
if (!is_numeric($issued['expires'])) {
$issued['expires'] = strtotime($issued['expires']);
}
if ($issued['expires'] < $now) {
$dl[get_string('expirydate', 'badges')] = userdate($issued['expires']) . get_string('warnexpired', 'badges');
+4 -2
View File
@@ -1145,6 +1145,7 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
$data['password'] = 'test';
if ($isadmin || $updatetest) {
$this->setAdminUser();
$lastmax = $DB->get_field_sql('SELECT MAX(sortorder) FROM {badge_external_backpack}');
$backpack = badges_create_site_backpack((object) $data);
}
@@ -1156,8 +1157,9 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
badges_update_site_backpack($backpack, (object)$data);
}
$record = $DB->get_record('badge_external_backpack', ['id' => $backpack]);
$this->assertEquals($record->backpackweburl, $data['backpackweburl']);
$this->assertEquals($record->backpackapiurl, $data['backpackapiurl']);
$this->assertEquals($data['backpackweburl'], $record->backpackweburl);
$this->assertEquals($data['backpackapiurl'], $record->backpackapiurl);
$this->assertEquals($lastmax + 1, $record->sortorder);
$record = $DB->get_record('badge_backpack', ['userid' => 0]);
$this->assertNotEmpty($record);
} else {
+1 -1
View File
@@ -7,7 +7,7 @@ default:
Behat\MinkExtension:
base_url: 'http://localhost:8000'
goutte: null
selenium2: null
webdriver: null
Moodle\BehatExtension:
moodledirroot: /Should/Change/To/Moodle/www/dir
steps_definitions: { }
@@ -512,6 +512,10 @@ class block_activity_results extends block_base {
$fields = implode(',', $fields);
$users = $DB->get_records_list('user', 'id', $userids, '', $fields);
// If configured to view user idnumber, ensure current user can see it.
$extrafields = get_extra_user_fields($this->context);
$canviewidnumber = (array_search('idnumber', $extrafields) !== false);
// Ready for output!
if ($activity->gradetype == GRADE_TYPE_SCALE) {
// We must display the results using scales.
@@ -537,10 +541,14 @@ class block_activity_results extends block_base {
}
$this->content->text .= '</h6></caption><colgroup class="number" />';
$this->content->text .= '<colgroup class="name" /><colgroup class="grade" /><tbody>';
foreach ($best as $userid => $gradeid) {
switch ($nameformat) {
case B_ACTIVITYRESULTS_NAME_FORMAT_ID:
$thisname = get_string('user').' '.$users[$userid]->idnumber;
$thisname = get_string('user');
if ($canviewidnumber) {
$thisname .= ' ' . s($users[$userid]->idnumber);
}
break;
case B_ACTIVITYRESULTS_NAME_FORMAT_ANON:
$thisname = get_string('user');
@@ -603,7 +611,10 @@ class block_activity_results extends block_base {
foreach ($worst as $userid => $gradeid) {
switch ($nameformat) {
case B_ACTIVITYRESULTS_NAME_FORMAT_ID:
$thisname = get_string('user').' '.$users[$userid]->idnumber;
$thisname = get_string('user');
if ($canviewidnumber) {
$thisname .= ' ' . s($users[$userid]->idnumber);
};
break;
case B_ACTIVITYRESULTS_NAME_FORMAT_ANON:
$thisname = get_string('user');
@@ -139,7 +139,9 @@ Feature: The activity results block displays student high scores
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -78,7 +78,9 @@ Feature: The activity results block displays students high scores in group as sc
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -110,7 +110,9 @@ Feature: The activity results block displays student in group high scores as sca
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -123,11 +125,13 @@ Feature: The activity results block displays student in group high scores as sca
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "User S1" in the "Activity results" "block"
And I should see "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should not see "User S2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
@@ -184,7 +184,9 @@ Feature: The activity results block displays student in separate groups scores
And I should see "90.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -198,11 +200,13 @@ Feature: The activity results block displays student in separate groups scores
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "User S1" in the "Activity results" "block"
And I should see "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should not see "User S2" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
@@ -168,7 +168,9 @@ Feature: The activity results block displays student in visible groups scores
And I should see "75.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -128,7 +128,9 @@ Feature: The activity results block displays student low scores
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -79,7 +79,9 @@ Feature: The activity results block displays student low scores as scales
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -108,7 +108,9 @@ Feature: The activity results block displays students in groups low scores as sc
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -120,11 +122,13 @@ Feature: The activity results block displays students in groups low scores as sc
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
And I log in as "student5"
And I am on "Course 1" course homepage
And I should see "User S5" in the "Activity results" "block"
And I should see "User" in the "Activity results" "block"
And I should not see "User S5" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I should see "User S6" in the "Activity results" "block"
And I should not see "User S6" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
@@ -178,7 +178,9 @@ Feature: The activity results block displays students in separate groups scores
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -191,11 +193,13 @@ Feature: The activity results block displays students in separate groups scores
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "User S1" in the "Activity results" "block"
And I should see "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should not see "User S2" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
@@ -166,7 +166,9 @@ Feature: The activity results block displays student in visible groups low score
And I should see "75.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
+2 -1
View File
@@ -114,7 +114,8 @@ class block_blog_recent extends block_base {
foreach ($entries as $entryid => $entry) {
$viewblogurl->param('entryid', $entryid);
$entrylink = html_writer::link($viewblogurl, shorten_text($entry->subject));
$entrylink = html_writer::link($viewblogurl, shorten_text(format_string($entry->subject, true,
['context' => $context])));
$entrieslist[] = $entrylink;
}
@@ -16,6 +16,8 @@ Feature: Students can use the recent blog entries block to view recent entries o
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Blog menu" block
@@ -27,13 +29,13 @@ Feature: Students can use the recent blog entries block to view recent entries o
And I am on "Course 1" course homepage
And I follow "Add an entry about this course"
When I set the following fields to these values:
| Entry title | S1 First Blog |
| Entry title | S1 First Blog <span lang="RU" class="multilang">RUSSIAN</span><span lang="EN" class="multilang">ENGLISH</span> |
| Blog entry body | This is my awesome blog! |
And I press "Save changes"
Then I should see "S1 First Blog"
Then I should see "S1 First Blog ENGLISH"
And I should see "This is my awesome blog!"
And I am on "Course 1" course homepage
And I should see "S1 First Blog"
And I should see "S1 First Blog ENGLISH"
And I follow "S1 First Blog"
And I should see "This is my awesome blog!"
+1 -1
View File
@@ -101,7 +101,7 @@ class block_login extends block_base {
$this->content->text .= '<div><a href="'.$forgot.'">'.get_string('forgotaccount').'</a></div>';
}
$authsequence = get_enabled_auth_plugins(true); // Get all auths, in sequence.
$authsequence = get_enabled_auth_plugins(); // Get all auths, in sequence.
$potentialidps = array();
foreach ($authsequence as $authname) {
$authplugin = get_auth_plugin($authname);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+7 -8
View File
@@ -543,11 +543,9 @@ function(
// Filter out all pagination options which are too large for the amount of courses user is enrolled in.
var totalCourseCount = parseInt(root.find(Selectors.courseView.region).attr('data-totalcoursecount'), 10);
if (totalCourseCount) {
itemsPerPage = itemsPerPage.filter(function(pagingOption) {
return pagingOption.value < totalCourseCount;
});
}
itemsPerPage = itemsPerPage.filter(function(pagingOption) {
return pagingOption.value < totalCourseCount || pagingOption.value === 0;
});
var filters = getFilterValues(root);
var config = $.extend({}, DEFAULT_PAGED_CONTENT_CONFIG);
@@ -602,7 +600,8 @@ function(
pageCourses = $.merge(loadedPages[currentPage].courses, courses.slice(0, nextPageStart));
}
} else {
nextPageStart = pageData.limit;
// When the page limit is zero, there is only one page of courses, no start for next page.
nextPageStart = pageData.limit || false;
pageCourses = (pageData.limit > 0) ? courses.slice(0, pageData.limit) : courses;
}
@@ -611,8 +610,8 @@ function(
courses: pageCourses
};
// Set up the next page
var remainingCourses = nextPageStart ? courses.slice(nextPageStart, courses.length) : [];
// Set up the next page (if there is more than one page).
var remainingCourses = nextPageStart !== false ? courses.slice(nextPageStart, courses.length) : [];
if (remainingCourses.length) {
loadedPages[currentPage + 1] = {
courses: remainingCourses
+5 -3
View File
@@ -202,8 +202,9 @@ class main implements renderable, templatable {
// Check and remember the given view.
$this->view = $view ? $view : BLOCK_MYOVERVIEW_VIEW_CARD;
// Check and remember the given page size.
if ($paging == BLOCK_MYOVERVIEW_PAGING_ALL) {
// Check and remember the given page size, `null` indicates no page size set
// while a `0` indicates a paging size of `All`.
if (!is_null($paging) && $paging == BLOCK_MYOVERVIEW_PAGING_ALL) {
$this->paging = BLOCK_MYOVERVIEW_PAGING_ALL;
} else {
$this->paging = $paging ? $paging : BLOCK_MYOVERVIEW_PAGING_12;
@@ -370,8 +371,9 @@ class main implements renderable, templatable {
$select = "instanceid $csql AND fieldid = :fieldid";
$params['fieldid'] = $fieldid;
$distinctablevalue = $DB->sql_compare_text('value');
$values = $DB->get_records_select_menu('customfield_data', $select, $params, $DB->sql_order_by_text('value'),
$values = $DB->get_records_select_menu('customfield_data', $select, $params, '',
"DISTINCT $distinctablevalue, $distinctablevalue AS value2");
\core_collator::asort($values, \core_collator::SORT_NATURAL);
$values = array_filter($values);
if (!$values) {
return [];
@@ -7,30 +7,30 @@ Feature: The my overview block allows users to persistence of their page limits
| student1 | Student | X | student1@example.com | S1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
| Course 3 | C3 | 0 |
| Course 4 | C4 | 0 |
| Course 5 | C5 | 0 |
| Course 6 | C6 | 0 |
| Course 7 | C7 | 0 |
| Course 8 | C8 | 0 |
| Course 9 | C9 | 0 |
| Course 1 | C01 | 0 |
| Course 2 | C02 | 0 |
| Course 3 | C03 | 0 |
| Course 4 | C04 | 0 |
| Course 5 | C05 | 0 |
| Course 6 | C06 | 0 |
| Course 7 | C07 | 0 |
| Course 8 | C08 | 0 |
| Course 9 | C09 | 0 |
| Course 10 | C10 | 0 |
| Course 11 | C11 | 0 |
| Course 12 | C12 | 0 |
| Course 13 | C13 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C01 | student |
| student1 | C02 | student |
| student1 | C03 | student |
| student1 | C04 | student |
| student1 | C05 | student |
| student1 | C06 | student |
| student1 | C07 | student |
| student1 | C08 | student |
| student1 | C09 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
@@ -38,8 +38,8 @@ Feature: The my overview block allows users to persistence of their page limits
Scenario: Toggle the page limit between page reloads
Given I log in as "student1"
When I click on "[data-toggle='dropdown']" "css_element" in the "Course overview" "block"
And I click on "All" "link"
When I click on "[data-action='limit-toggle']" "css_element" in the "Course overview" "block"
And I click on "All" "link" in the ".dropdown-menu.show" "css_element"
Then I should see "Course 13"
And I reload the page
Then I should see "Course 13"
@@ -47,8 +47,8 @@ Feature: The my overview block allows users to persistence of their page limits
Scenario: Toggle the page limit between grouping changes
Given I log in as "student1"
When I click on "[data-toggle='dropdown']" "css_element" in the "Course overview" "block"
And I click on "All" "link"
When I click on "[data-action='limit-toggle']" "css_element" in the "Course overview" "block"
And I click on "All" "link" in the ".dropdown-menu.show" "css_element"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I click on "In progress" "link" in the "Course overview" "block"
Then I should see "Course 13"
@@ -0,0 +1,191 @@
@block @block_myoverview @javascript
Feature: My overview block pagination
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | X | student1@example.com | S1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 01 | C1 | 0 |
| Course 02 | C2 | 0 |
| Course 03 | C3 | 0 |
| Course 04 | C4 | 0 |
| Course 05 | C5 | 0 |
| Course 06 | C6 | 0 |
| Course 07 | C7 | 0 |
| Course 08 | C8 | 0 |
| Course 09 | C9 | 0 |
| Course 10 | C10 | 0 |
| Course 11 | C11 | 0 |
| Course 12 | C12 | 0 |
| Course 13 | C13 | 0 |
| Course 14 | C14 | 0 |
| Course 15 | C15 | 0 |
| Course 16 | C16 | 0 |
| Course 17 | C17 | 0 |
| Course 18 | C18 | 0 |
| Course 19 | C19 | 0 |
| Course 20 | C20 | 0 |
| Course 21 | C21 | 0 |
| Course 22 | C22 | 0 |
| Course 23 | C23 | 0 |
| Course 24 | C24 | 0 |
| Course 25 | C25 | 0 |
Scenario: The pagination controls should be hidden if I am not enrolled in any courses
When I log in as "student1"
Then I should see "No courses" in the "Course overview" "block"
And I should not see "Show" in the "Course overview" "block"
And ".block_myoverview .dropdown-menu.show" "css_element" should not be visible
And ".block_myoverview [data-control='next']" "css_element" should not be visible
And ".block_myoverview [data-control='previous']" "css_element" should not be visible
And I log out
Scenario: The pagination controls should be hidden if I am enrolled in 12 courses or less
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
When I log in as "student1"
Then I should not see "Show" in the "Course overview" "block"
And ".block_myoverview .dropdown-menu.show" "css_element" should not be visible
And ".block_myoverview [data-control='next']" "css_element" should not be visible
And ".block_myoverview [data-control='previous']" "css_element" should not be visible
And I log out
Scenario: The default pagination should be 12 courses
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
When I log in as "student1"
Then I should see "12" in the "[data-action='limit-toggle']" "css_element"
And I log out
Scenario: I should only see pagination limit options less than total number of enrolled courses
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
And I log in as "student1"
When I click on "[data-action='limit-toggle']" "css_element" in the "Course overview" "block"
Then I should see "All" in the ".dropdown-menu.show" "css_element"
And I should see "12" in the ".dropdown-menu.show" "css_element"
And ".block_myoverview [data-control='next']" "css_element" should be visible
And ".block_myoverview [data-control='previous']" "css_element" should be visible
But I should not see "24" in the ".block_myoverview .dropdown-menu.show" "css_element"
And I log out
Scenario: Previous page button should be disabled when on the first page of courses
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
When I log in as "student1"
Then the "class" attribute of ".block_myoverview [data-control='previous']" "css_element" should contain "disabled"
And I log out
Scenario: Next page button should be disabled when on the last page of courses
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
When I log in as "student1"
And I click on "[data-control='next']" "css_element" in the "Course overview" "block"
And I wait until ".block_myoverview [data-control='next']" "css_element" exists
Then the "class" attribute of ".block_myoverview [data-control='next']" "css_element" should contain "disabled"
And I log out
Scenario: Next and previous page buttons should both be enabled when not on last or first page of courses
Given the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
| student1 | C5 | student |
| student1 | C6 | student |
| student1 | C7 | student |
| student1 | C8 | student |
| student1 | C9 | student |
| student1 | C10 | student |
| student1 | C11 | student |
| student1 | C12 | student |
| student1 | C13 | student |
| student1 | C14 | student |
| student1 | C15 | student |
| student1 | C16 | student |
| student1 | C17 | student |
| student1 | C18 | student |
| student1 | C19 | student |
| student1 | C20 | student |
| student1 | C21 | student |
| student1 | C22 | student |
| student1 | C23 | student |
| student1 | C24 | student |
| student1 | C25 | student |
When I log in as "student1"
And I click on "[data-control='next']" "css_element" in the "Course overview" "block"
And I wait until ".block_myoverview [data-control='next']" "css_element" exists
Then the "class" attribute of ".block_myoverview [data-control='next']" "css_element" should not contain "disabled"
And the "class" attribute of ".block_myoverview [data-control='previous']" "css_element" should not contain "disabled"
And I should see "Course 13" in the "Course overview" "block"
And I should see "Course 24" in the "Course overview" "block"
But I should not see "Course 12" in the "Course overview" "block"
And I should not see "Course 25" in the "Course overview" "block"
And I log out
+21 -3
View File
@@ -88,14 +88,23 @@ class block_online_users extends block_base {
$this->content->text = '<div class="info">'.$usercount.' ('.$periodminutes.')</div>';
// Verify if we can see the list of users, if not just print number of users
if (!has_capability('block/online_users:viewlist', $this->page->context)) {
// Verify if we can see the list of users, if not just print number of users.
// If the current user is not logged in OR it's a guest then don't show any users.
if (!has_capability('block/online_users:viewlist', $this->page->context)
|| isguestuser() || !isloggedin()) {
return $this->content;
}
$userlimit = 50; // We'll just take the most recent 50 maximum.
$initialcount = 0;
if ($users = $onlineusers->get_users($userlimit)) {
require_once($CFG->dirroot . '/user/lib.php');
$initialcount = count($users);
foreach ($users as $user) {
if (!user_can_view_profile($user)) {
unset($users[$user->id]);
continue;
}
$users[$user->id]->fullname = fullname($user);
}
} else {
@@ -126,7 +135,8 @@ class block_online_users extends block_base {
} else { // Not a guest user.
$this->content->text .= '<div class="user">';
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->page->course->id.'" title="'.$timeago.'">';
$this->content->text .= $OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false, 'link'=>false)) .$user->fullname.'</a></div>';
$avataroptions = ['size' => 16, 'visibletoscreenreaders' => false, 'link' => false];
$this->content->text .= $OUTPUT->user_picture($user, $avataroptions) . $user->fullname . '</a></div>';
if ($USER->id == $user->id) {
if ($CFG->block_online_users_onlinestatushiding) {
@@ -152,6 +162,14 @@ class block_online_users extends block_base {
}
$this->content->text .= "</li>\n";
}
if ($initialcount - count($users) > 0) {
$this->content->text .= '<li class="listentry"><div class="otherusers">';
$this->content->text .= html_writer::span(
get_string('otherusers', 'block_online_users', $initialcount - count($users))
);
$this->content->text .= "</div>";
$this->content->text .= "</li>\n";
}
$this->content->text .= '</ul><div class="clearer"><!-- --></div>';
}
+1 -1
View File
@@ -86,7 +86,7 @@ class fetcher {
}
$params = array();
$userfields = \user_picture::fields('u', array('username'));
$userfields = \user_picture::fields('u', array('username', 'deleted'));
// Add this to the SQL to show only group users.
if ($currentgroup !== null) {
+1 -1
View File
@@ -55,7 +55,7 @@ $capabilities = array(
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'user' => CAP_ALLOW,
'guest' => CAP_ALLOW,
'guest' => CAP_PREVENT,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
@@ -23,6 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['otherusers'] = 'Other Users ({$a})';
$string['onlinestatushiding_desc'] = 'If enabled, users have the option to hide their online status from other users.';
$string['configtimetosee'] = 'Number of minutes determining the period of inactivity after which a user is no longer considered to be online.';
$string['onlinestatushiding'] = 'Online status hiding';
+4
View File
@@ -7,6 +7,10 @@
position: relative;
}
.block_online_users .content .list li.listentry .otherusers {
margin-left: 1.5rem;
}
.block_online_users .content .list li.listentry .user .userpicture {
vertical-align: text-bottom;
}
@@ -1,5 +1,6 @@
@block @block_online_users
Feature: The online users block allow you to see who is currently online on dashboard
There should be some commonality for the users to show up
In order to use the online users block on the dashboard
As a user
I can view the online users block on my dashboard
@@ -10,6 +11,14 @@ Feature: The online users block allow you to see who is currently online on dash
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
Scenario: View the online users block on the dashboard and see myself
Given I log in as "teacher1"
@@ -1,14 +1,22 @@
@block @block_online_users
Feature: The online users block allow you to see who is currently online on frontpage
In order to enable the online users block on the front page page
There should be some commonality for the users to show up
In order to enable the online users block on the frontpage
As an admin
I can add the online users block to the front page page
I can add the online users block to the frontpage
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
Scenario: View the online users block on the front page and see myself
Given I log in as "admin"
@@ -28,7 +36,8 @@ Feature: The online users block allow you to see who is currently online on fron
And I log out
When I log in as "student1"
And I am on site homepage
Then I should see "Admin User" in the "Online users" "block"
Then I should not see "Admin User" in the "Online users" "block"
And I should see "Other Users (1)" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should see "3 online users" in the "Online users" "block"
@@ -45,9 +54,9 @@ Feature: The online users block allow you to see who is currently online on fron
And I log out
When I log in as "guest"
And I am on site homepage
Then I should see "Admin User" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
Then I should not see "Admin User" in the "Online users" "block"
And I should not see "Student 1" in the "Online users" "block"
And I should not see "Student 2" in the "Online users" "block"
And I should see "3 online users" in the "Online users" "block"
@javascript
@@ -69,7 +78,8 @@ Feature: The online users block allow you to see who is currently online on fron
When I log in as "student2"
And I am on site homepage
Then I should see "2 online user" in the "Online users" "block"
And I should see "Admin" in the "Online users" "block"
And I should not see "Admin" in the "Online users" "block"
And I should see "Other Users (1)" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should not see "Student 1" in the "Online users" "block"
And I log out
@@ -83,7 +93,8 @@ Feature: The online users block allow you to see who is currently online on fron
When I log in as "student2"
And I am on site homepage
Then I should see "3 online users" in the "Online users" "block"
And I should see "Admin" in the "Online users" "block"
And I should not see "Admin" in the "Online users" "block"
And I should see "Other Users (1)" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
@@ -126,7 +137,8 @@ Feature: The online users block allow you to see who is currently online on fron
And I log in as "student2"
And I am on site homepage
And I should see "2 online user" in the "Online users" "block"
And I should see "Admin" in the "Online users" "block"
And I should not see "Admin" in the "Online users" "block"
And I should see "Other Users (1)" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should not see "Student 1" in the "Online users" "block"
And I log out
@@ -135,6 +147,7 @@ Feature: The online users block allow you to see who is currently online on fron
And I log in as "student2"
When I am on site homepage
Then I should see "3 online users" in the "Online users" "block"
And I should see "Admin" in the "Online users" "block"
And I should not see "Admin" in the "Online users" "block"
And I should see "Other Users (1)" in the "Online users" "block"
And I should see "Student 2" in the "Online users" "block"
And I should see "Student 1" in the "Online users" "block"
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2020110900; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2020110901; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2020110300; // Requires this Moodle version
$plugin->component = 'block_online_users'; // Full name of the plugin (used for diagnostics)
@@ -46,49 +46,46 @@ Feature: View structural changes in recent activity block
| GG3 | G2 |
Scenario: Check that Added module information is displayed respecting view capability
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
When I add a "Forum" to section "1" and I fill the form with:
| name | ForumVisibleGroups |
| Description | No description |
| groupmode | Visible groups |
And I add a "Forum" to section "1" and I fill the form with:
| name | ForumSeparateGroups |
| Description | No description |
| groupmode | Separate groups |
And I add a "Forum" to section "1" and I fill the form with:
| name | ForumHidden |
| Description | No description |
| Availability | 0 |
And I add a "Forum" to section "1" and I fill the form with:
| name | ForumNoGroups |
| Description | No description |
| groupmode | No groups |
And I add a "Forum" to section "2" and I fill the form with:
| name | ForumVisibleGroupsG1 |
| Description | No description |
| groupmode | Visible groups |
| Grouping | Grouping 1 |
Given the following "activities" exist:
| activity | course | section | name | idnumber | description | groupmode | grouping | visible |
| forum | C1 | 1 | ForumVisibleGroups | forum1 | No description | 2 | | 1 |
| forum | C1 | 1 | ForumSeparateGroups | forum2 | No description | 1 | | 1 |
| forum | C1 | 1 | ForumHidden | forum3 | No description | 1 | | 0 |
| forum | C1 | 1 | ForumNoGroups | forum4 | No description | 0 | | 1 |
| forum | C1 | 2 | ForumVisibleGroupsG1 | forum5 | No description | 2 | GG1 | 1 |
| forum | C1 | 2 | ForumSeparateGroupsG1 | forum6 | No description | 1 | GG1 | 1 |
| forum | C1 | 3 | ForumVisibleGroupsG2 | forum7 | No description | 2 | GG2 | 1 |
| forum | C1 | 3 | ForumSeparateGroupsG2 | forum8 | No description | 1 | GG2 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I click on "ForumVisibleGroupsG1" "link"
And I click on "Edit settings" "link"
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 1 |
And I add a "Forum" to section "2" and I fill the form with:
| name | ForumSeparateGroupsG1 |
| Description | No description |
| groupmode | Separate groups |
| Grouping | Grouping 1 |
| Access restrictions | Grouping: Grouping 1 |
And I add a "Forum" to section "3" and I fill the form with:
| name | ForumVisibleGroupsG2 |
| Description | No description |
| groupmode | Visible groups |
| Grouping | Grouping 2 |
And I press "Save and return to course"
And I click on "ForumSeparateGroupsG1" "link"
And I click on "Edit settings" "link"
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 1 |
And I press "Save and return to course"
And I click on "ForumVisibleGroupsG2" "link"
And I click on "Edit settings" "link"
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 2 |
And I add a "Forum" to section "3" and I fill the form with:
| name | ForumSeparateGroupsG2 |
| Description | No description |
| groupmode | Separate groups |
| Grouping | Grouping 2 |
| Access restrictions | Grouping: Grouping 2 |
And I press "Save and return to course"
And I click on "ForumSeparateGroupsG2" "link"
And I click on "Edit settings" "link"
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 2 |
And I press "Save and return to course"
And I am on "Course 1" course homepage with editing mode on
When I add the "Recent activity" block
Then I should see "ForumVisibleGroups" in the "Recent activity" "block"
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
And I should see "ForumNoGroups" in the "Recent activity" "block"
@@ -98,6 +95,7 @@ Feature: View structural changes in recent activity block
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
@@ -109,6 +107,7 @@ Feature: View structural changes in recent activity block
And I should not see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should not see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
@@ -120,6 +119,7 @@ Feature: View structural changes in recent activity block
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I log out
And I log in as "student3"
And I am on "Course 1" course homepage
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
@@ -131,6 +131,7 @@ Feature: View structural changes in recent activity block
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I log out
# Teachers have capability to see all groups and hidden activities
And I log in as "assistant1"
And I am on "Course 1" course homepage
@@ -142,15 +143,20 @@ Feature: View structural changes in recent activity block
And I log out
Scenario: Updates and deletes in recent activity block
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | forum1 |
| name | ForumNew |
| description | No description |
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I add a "Forum" to section "1" and I fill the form with:
| name | ForumNew |
| Description | No description |
Then I should see "Added Forum" in the "Recent activity" "block"
And I should see "ForumNew" in the "Recent activity" "block"
And I log out
# Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.
And I wait "1" seconds
And I log in as "student1"
And I am on "Course 1" course homepage
@@ -159,6 +165,7 @@ Feature: View structural changes in recent activity block
And I log out
# Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.
And I wait "1" seconds
# Update forum as a teacher
And I log in as "teacher1"
And I am on "Course 1" course homepage
@@ -170,6 +177,7 @@ Feature: View structural changes in recent activity block
And I log out
And I wait "1" seconds
# Student 1 already saw that forum was created, now he can see that forum was updated
And I log in as "student1"
And I am on "Course 1" course homepage
And I should not see "Added Forum" in the "Recent activity" "block"
@@ -179,6 +187,7 @@ Feature: View structural changes in recent activity block
And I log out
And I wait "1" seconds
# Student 2 has bigger interval and he can see one entry that forum was created but with the new name
And I log in as "student2"
And I am on "Course 1" course homepage
And I should see "Added Forum" in the "Recent activity" "block"
@@ -188,6 +197,7 @@ Feature: View structural changes in recent activity block
And I log out
And I wait "1" seconds
# Delete forum as a teacher
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I delete "ForumUpdated" activity
@@ -195,6 +205,7 @@ Feature: View structural changes in recent activity block
And I log out
And I wait "1" seconds
# Students 1 and 2 see that forum was deleted
And I log in as "student1"
And I am on "Course 1" course homepage
And I should not see "Added Forum" in the "Recent activity" "block"
@@ -205,6 +216,7 @@ Feature: View structural changes in recent activity block
And I log out
And I wait "1" seconds
# Student 3 never knew that forum was created, so he does not see anything
And I log in as "student3"
And I am on "Course 1" course homepage
And I should not see "Added Forum" in the "Recent activity" "block"
@@ -212,4 +224,3 @@ Feature: View structural changes in recent activity block
And I should not see "Updated Forum" in the "Recent activity" "block"
And I should not see "ForumUpdated" in the "Recent activity" "block"
And I should not see "Deleted Forum" in the "Recent activity" "block"
And I log out
@@ -45,8 +45,7 @@
<div class="hidden text-xs-center text-center mt-3" data-region="empty-message">
<img class="empty-placeholder-image-lg mt-1"
src="{{nocoursesimgurl}}"
alt="{{#str}} nocourses, block_recentlyaccessedcourses {{/str}}"
role="presentation">
alt="">
<p class="text-muted mt-3">{{#str}} nocourses, block_recentlyaccessedcourses {{/str}}</p>
</div>
</div>
@@ -150,4 +150,17 @@ class behat_block_site_main_menu extends behat_base {
$xpath = "//*[contains(concat(' ',normalize-space(@class),' '),' block_site_main_menu ')]//li[contains(., $activityname)]";
$this->execute('behat_action_menu::i_open_the_action_menu_in', [$xpath, 'xpath_element']);
}
/**
* Return the list of partial named selectors.
*
* @return array
*/
public static function get_partial_named_selectors(): array {
return [
new behat_component_named_selector('Activity', [
"//*[contains(concat(' ',normalize-space(@class),' '),' block_site_main_menu ')]//li[contains(., %locator%)]"
]),
];
}
}
@@ -6,15 +6,16 @@ Feature: Edit activities in main menu block
@javascript
Scenario: Edit name of acitivity in-place in site main menu block
Given I log in as "admin"
Given the following "activity" exists:
| activity | forum |
| course | Acceptance test site |
| name | My forum name |
| idnumber | forum |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Main menu" block
When I add a "Forum" to section "0" and I fill the form with:
| Forum name | My forum name |
And I click on "Edit title" "link" in the "My forum name" activity in site main menu block
And I set the field "New name for activity My forum name" to "New forum name"
And I press key "13" in the field "New name for activity My forum name"
When I set the field "Edit title" in the "My forum name" "block_site_main_menu > Activity" to "New forum name"
Then I should not see "My forum name"
And I should see "New forum name"
And I follow "New forum name"
@@ -158,4 +158,17 @@ class behat_block_social_activities extends behat_base {
$xpath = "//*[contains(concat(' ',normalize-space(@class),' '),' block_social_activities ')]//li[contains(., $activityname)]";
$this->execute('behat_action_menu::i_open_the_action_menu_in', [$xpath, 'xpath_element']);
}
/**
* Return the list of partial named selectors.
*
* @return array
*/
public static function get_partial_named_selectors(): array {
return [
new behat_component_named_selector('Activity', [
"//*[contains(concat(' ',normalize-space(@class),' '),' block_social_activities ')]//li[contains(., %locator%)]",
]),
];
}
}
@@ -25,9 +25,7 @@ Feature: Edit activities in social activities block
And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
And I set the field "Forum name" to "My forum name"
And I press "Save and return to course"
And I click on "Edit title" "link" in the "My forum name" activity in social activities block
And I set the field "New name for activity My forum name" to "New forum name"
And I press key "13" in the field "New name for activity My forum name"
When I set the field "Edit title" in the "My forum name" "block_social_activities > Activity" to "New forum name"
Then I should not see "My forum name" in the "Social activities" "block"
And I should see "New forum name"
And I follow "New forum name"
@@ -84,4 +82,3 @@ Feature: Edit activities in social activities block
And I should not see "My forum name" in the "Social activities" "block"
And I click on "My forum name" "link" in the "Recent activity" "block"
And I should see "My forum name" in the ".breadcrumb" "css_element"
And I log out
@@ -52,9 +52,9 @@
<a href="{{url}}"
title={{#quote}}{{{name}}}{{/quote}}
aria-label='{{#str}} ariaeventlistitem, block_timeline, { "name": {{#quote}}{{{name}}}{{/quote}}, "course": {{#quote}}{{{course.fullnamedisplay}}}{{/quote}}, "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/str}}'
><h6 class="event-name text-truncate mb-0">{{#quote}}{{{name}}}{{/quote}}</h6></a>
><h6 class="event-name text-truncate mb-0">{{{name}}}</h6></a>
{{#course.fullnamedisplay}}
<small class="text-muted text-truncate mb-0">{{#quote}}{{{course.fullnamedisplay}}}{{/quote}}</small>
<small class="text-muted text-truncate mb-0">{{{course.fullnamedisplay}}}</small>
{{/course.fullnamedisplay}}
{{#action.actionable}}
<h6 class="mb-0 pt-2">
@@ -46,8 +46,7 @@
<div class="hidden text-xs-center text-center mt-3" data-region="empty-message">
<img
src="{{urls.noevents}}"
alt="{{#str}} noevents, block_timeline {{/str}}"
role="presentation"
alt=""
style="height: 70px; width: 70px"
>
<p class="text-muted mt-1">{{#str}} noevents, block_timeline {{/str}}</p>
@@ -41,8 +41,7 @@
<div class="hidden text-xs-center text-center mt-3" data-region="no-courses-empty-message">
<img
src="{{urls.noevents}}"
alt="{{#str}} nocoursesinprogress, block_timeline {{/str}}"
role="presentation"
alt=""
style="height: 70px; width: 70px"
>
<p class="text-muted mt-1">{{#str}} nocoursesinprogress, block_timeline {{/str}}</p>

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