Compare commits

..

175 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 49648fdf30 Moodle release 3.8.9 2021-05-08 16:40:36 +02:00
Eloy Lafuente (stronk7) 210635e015 weekly release 3.8.8+ 2021-05-07 16:54:43 +02:00
Eloy Lafuente (stronk7) c1c224d602 NOBUG: Fixed SVG browser compatibility 2021-05-07 16:54:43 +02:00
Eloy Lafuente (stronk7) 5d14a3a27b Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2021-05-07 16:54:42 +02:00
Mathew May 2f6ff54b11 MDL-70622 mod_lti: Tighten redirect param typing 2021-05-07 11:47:28 +08:00
Adam Olley 7ec37a051e MDL-70622 mod_lti: Prevent xss on lti 1.3 authentication script
Without this, people can craft URLs that other users might use not realising
what they do - and as a XSS vulnerability, it could do any number of things the
clicking-user has access to do on the site.

Change-Id: I82adc71e8706d8929011b4b24523d5b62b8ccea1
2021-05-07 11:47:20 +08:00
Sara Arjona 85778f5ee3 Merge branch 'MDL-71420_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2021-05-06 17:58:55 +02:00
Sara Arjona 03ef84c148 Merge branch 'MDL-71390-38' of git://github.com/marinaglancy/moodle into MOODLE_38_STABLE 2021-05-06 08:05:28 +02:00
AMOS bot 7fd07a352e Automatically generated installer lang files 2021-05-06 00:07:49 +00:00
Eloy Lafuente (stronk7) f3fa3d90c2 MDL-71420 environment: Lower sodium requirement to recommended 2021-05-05 23:06:26 +02:00
Víctor Déniz 42fa42b715 Merge branch 'MDL-71460-38' of git://github.com/peterRd/moodle into MOODLE_38_STABLE 2021-05-05 10:52:21 +01:00
Peter Dias d776693f92 MDL-71460 hub: Use checkboxes instead of dropdowns
Change the yes/no dropdowns to a checkbox. Defaults to unchecked.
2021-05-05 10:28:11 +08:00
AMOS bot b9cd521f6a Automatically generated installer lang files 2021-05-04 00:07:50 +00:00
Paul Holden 2a10e1c6b0 MDL-71359 mod_forum: empty forums shouldn't export anything. 2021-05-03 17:34:08 +02:00
Marina Glancy 2976ff42b9 MDL-71390 core: raise max_input_vars requirement for Moodle 3.11 2021-05-03 13:30:38 +02:00
Sara Arjona cd89f55a46 MDL-71408 lib: Add required changes after lib upgrade
- The pull-request for fixing some minor PHP7.4 problems has been
integrated so this patch is not required
2021-04-30 19:14:10 +01:00
Sara Arjona 45cd4e36fb MDL-71408 lib: Upgrade H5P core library to 1.24.02 2021-04-30 19:14:10 +01:00
Huong Nguyen f799c3042c MDL-70720 Quiz: Improve capability checks when fetching users' best grades 2021-04-30 14:18:24 +02:00
Shamim Rezaie be93a16c16 MDL-69028 repository: Put a rate limit on draft file uploads 2021-04-30 14:18:24 +02:00
Paul Holden c4106464c6 MDL-71130 quiz_grading: escape user idnumber on display. 2021-04-30 14:18:24 +02:00
David Mudrák 8f746357c0 MDL-70804 mnet: Use proper DML method to get records from the table
This improves the code and avoids the risk of SQL injection through the
malicious XML-RPC request from the MNet peer.
2021-04-30 14:18:24 +02:00
Víctor Déniz 57a347a748 weekly release 3.8.8+ 2021-04-30 12:54:22 +01:00
Paul Holden f49cb04ca5 MDL-70763 core: export preferences for correct user.
Ensure we are using the ID of the given user rather than falling
back to that of the current user during privacy export.
2021-04-28 12:31:01 +02:00
Paul Holden a305ee2485 MDL-70763 quiz_overview: export preferences for correct user. 2021-04-28 12:30:56 +02:00
Paul Holden e313b4b446 MDL-70763 gradereport_grader: export preferences for correct user. 2021-04-28 12:30:52 +02:00
Sara Arjona 8ed413eaf9 weekly release 3.8.8+ 2021-04-20 15:51:22 +02:00
Sara Arjona 5013939aa2 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2021-04-20 15:51:21 +02:00
AMOS bot acde050775 Automatically generated installer lang files 2021-04-20 00:07:44 +00:00
Eloy Lafuente (stronk7) 52aa1e4c99 Merge branch 'MDL-69256-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2021-04-20 00:06:04 +02:00
AMOS bot 0da32cf406 Automatically generated installer lang files 2021-04-18 00:07:41 +00:00
AMOS bot ba21297ca7 Automatically generated installer lang files 2021-04-15 00:07:55 +00:00
AMOS bot ea63088252 Automatically generated installer lang files 2021-04-14 00:07:49 +00:00
AMOS bot 7066bec864 Automatically generated installer lang files 2021-04-09 00:07:50 +00:00
AMOS bot 1fe517b522 Automatically generated installer lang files 2021-04-06 00:07:58 +00:00
AMOS bot fcd0785e3f Automatically generated installer lang files 2021-04-04 00:07:56 +00:00
AMOS bot d08501d58e Automatically generated installer lang files 2021-04-02 00:07:42 +00:00
AMOS bot 3a8088c2ad Automatically generated installer lang files 2021-04-01 00:07:45 +00:00
AMOS bot 3e6c1f2f97 Automatically generated installer lang files 2021-03-29 00:07:42 +00:00
AMOS bot e3055df4b8 Automatically generated installer lang files 2021-03-28 00:07:40 +00:00
AMOS bot 2dafc14703 Automatically generated installer lang files 2021-03-25 00:07:48 +00:00
Víctor Déniz f5afb04143 weekly release 3.8.8+ 2021-03-24 14:20:54 +00:00
Víctor Déniz 09756b8b41 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2021-03-24 14:20:52 +00:00
Andrew Nicols 39ad2de97e MDL-69256 tests: Fix random slow test failures in completion cron 2021-03-23 08:08:48 +08:00
Chris Brown 432e0ca9a6 MDL-71139 trademark: Improve the trademark messaging 2021-03-22 12:01:35 +08:00
AMOS bot 041aeab494 Automatically generated installer lang files 2021-03-18 00:07:42 +00:00
AMOS bot c51f4c9dd2 Automatically generated installer lang files 2021-03-13 00:07:43 +00:00
Sara Arjona acd8c191fe weekly release 3.8.8+ 2021-03-11 17:18:58 +01:00
Sara Arjona a0902ad740 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2021-03-11 17:18:57 +01:00
Eloy Lafuente (stronk7) a3ad581e52 Merge branch 'MDL-70726-3.8' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_38_STABLE 2021-03-11 00:12:31 +01:00
AMOS bot 83ce32a4be Automatically generated installer lang files 2021-03-10 00:07:36 +00:00
Amaia Anabitarte bdd8caa90e MDL-70726 behat: Fixing existing fail tests
Some of the current behat tests were wrong but not failing because of the bug in 'should not exist' step.
Once the bug is fixed, we must fix also wrong behats.
2021-03-08 18:57:54 +07:00
Thong Bui bfcae1607c MDL-70726 behat: should_not_exist function does not work correctly 2021-03-08 18:57:54 +07:00
AMOS bot b6f2f2bcef Automatically generated installer lang files 2021-03-07 00:07:38 +00:00
Eloy Lafuente (stronk7) 6f7e3ca2f7 Moodle release 3.8.8 2021-03-06 18:03:50 +01:00
AMOS bot b2c0deeae8 Automatically generated installer lang files 2021-03-06 00:07:41 +00:00
Sara Arjona 43222b3990 weekly release 3.8.7+ 2021-03-05 16:01:47 +01:00
Sara Arjona 552c8dfaee Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2021-03-05 16:01:46 +01:00
Ilya Tregubov 72ce91171d MDL-69680 lib: Fix behat test backup_and_restore.feature 2021-03-04 22:51:52 +01:00
Ilya Tregubov a5d39f81c8 MDL-69680 lib: Replace deprecated jQuery functions 2021-03-04 12:47:34 +08:00
Ilya Tregubov f020baba0d MDL-69680 lib: Update jQuery version in Moodle files 2021-03-04 12:47:34 +08:00
Ilya Tregubov 3044e7f136 MDL-69680 lib: Upgrade jQuery lib to 3.5.1 2021-03-04 12:47:34 +08:00
Ilya Tregubov a8bfd397d7 MDL-70767 feedback: Prevent xss in feedback answer text. 2021-03-03 23:09:42 +01:00
Paul Holden 02fecb2c1e 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:31 +08:00
Marina Glancy e99235d097 MDL-65552 user: escape idnumber and email in table_sql 2021-03-03 23:14:31 +08:00
Paul Holden 74706d5f30 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:31 +08:00
AMOS bot 050f6c9c08 Automatically generated installer lang files 2021-03-03 00:07:37 +00:00
Paul Holden 955f74c2e4 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 16:48:29 +01:00
Sander Wind 9cb1dd4e5d MDL-70668 auth: Fix secret validation during user confirmation
Co-authored-by: Michael Hawkins <michaelh@moodle.com>
2021-03-02 16:48:29 +01:00
Peter Dias d5eea29933 MDL-59293 block_onlineusers: Update behat tests 2021-03-02 16:37:37 +01:00
Peter Dias 671f2b2eab 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:37:37 +01:00
AMOS bot 4295aad82a Automatically generated installer lang files 2021-03-02 00:07:35 +00:00
Sara Arjona 363c471929 Merge branch 'MDL-68735_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2021-03-01 16:17:59 +01:00
AMOS bot 72e54c8125 Automatically generated installer lang files 2021-03-01 00:07:38 +00:00
AMOS bot 91c5e66892 Automatically generated installer lang files 2021-02-28 00:07:35 +00:00
AMOS bot 9feac7b454 Automatically generated installer lang files 2021-02-27 00:07:42 +00:00
AMOS bot 9f2d67adcf Automatically generated installer lang files 2021-02-25 00:07:39 +00:00
AMOS bot a0cfe03ab7 Automatically generated installer lang files 2021-02-22 00:07:38 +00:00
AMOS bot 410364509e Automatically generated installer lang files 2021-02-19 00:07:51 +00:00
AMOS bot 3958c324f7 Automatically generated installer lang files 2021-02-17 00:07:45 +00:00
AMOS bot 6f555e3dc5 Automatically generated installer lang files 2021-02-16 00:07:42 +00:00
Eloy Lafuente (stronk7) 8a3908b13e MDL-68735 env: Moodle 3.8.x, 3.9.x and 3.10.x do not support PHP 8.0 2021-02-13 12:57:56 +01:00
AMOS bot d1084fb368 Automatically generated installer lang files 2021-02-13 00:07:50 +00:00
AMOS bot ae201b9bb9 Automatically generated installer lang files 2021-02-11 00:07:42 +00:00
AMOS bot d2a181feb2 Automatically generated installer lang files 2021-02-06 00:07:43 +00:00
AMOS bot 8b1a5d6cfe Automatically generated installer lang files 2021-02-04 00:07:48 +00:00
AMOS bot b6288afc2f Automatically generated installer lang files 2021-02-01 00:07:46 +00:00
AMOS bot 0d53af4307 Automatically generated installer lang files 2021-01-31 00:07:42 +00:00
AMOS bot 855457ad33 Automatically generated installer lang files 2021-01-27 00:07:46 +00:00
AMOS bot c5d829351d Automatically generated installer lang files 2021-01-23 00:07:43 +00:00
AMOS bot 48410fa3b4 Automatically generated installer lang files 2021-01-17 00:07:45 +00:00
Eloy Lafuente (stronk7) 323c12674a Moodle release 3.8.7 2021-01-16 16:58:20 +01:00
Sara Arjona 37057940b0 weekly release 3.8.6+ 2021-01-15 08:25:58 +01:00
Sara Arjona b494696246 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2021-01-15 08:25:56 +01:00
Sara Arjona 1689e0d02d Merge branch 'MDL-69308_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2021-01-14 12:04:29 +01:00
AMOS bot a2ecb5fee0 Automatically generated installer lang files 2021-01-14 00:07:41 +00:00
Eloy Lafuente (stronk7) ce6c648a5c 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:30:50 +01:00
Eloy Lafuente (stronk7) 708708389a 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:30:46 +01:00
Mihail Geshoski 882240bea8 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:56 +08:00
Mihail Geshoski 586b1a6f42 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:56 +08:00
AMOS bot a1e9aac687 Automatically generated installer lang files 2021-01-13 00:07:42 +00:00
AMOS bot f043935fe9 Automatically generated installer lang files 2021-01-12 00:07:51 +00:00
AMOS bot 87ff32287f Automatically generated installer lang files 2021-01-11 00:08:56 +00:00
AMOS bot 614af534e9 Automatically generated installer lang files 2021-01-09 00:07:46 +00:00
Michael Hawkins f0bb4a442a MDL-69911 core: Clean content passed through TeX filter 2021-01-08 05:18:21 +01:00
Ferran Recio 680cb4c2bc MDL-67782 message: fix messages max length 2021-01-08 05:18:21 +01:00
Juan Segarra Montesinos bbf25a740b MDL-69797 core_grades: Implement authorization into fetch method 2021-01-08 05:18:21 +01:00
Juan Segarra Montesinos fdf9d2c0d7 MDL-69797 core_grades: Implement authorization into fetch method 2021-01-08 05:18:21 +01:00
Juan Segarra Montesinos 38a5690419 MDL-69797 gradingform_rubric: Implement authorization into fetch method 2021-01-08 05:18:21 +01:00
Juan Segarra Montesinos 38aec55521 MDL-69797 gradingform_guide: Implement authorization into fetch method 2021-01-08 05:18:21 +01:00
Jun Pataleta b820cbd7b2 weekly release 3.8.6+ 2021-01-08 12:15:08 +08:00
Jun Pataleta 7595f8d9f1 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2021-01-08 12:15:06 +08:00
AMOS bot 9134ec4414 Automatically generated installer lang files 2021-01-08 00:07:40 +00:00
Eloy Lafuente (stronk7) 4ca510ef8f Merge branch 'MDL-70584-38' of git://github.com/marinaglancy/moodle into MOODLE_38_STABLE 2021-01-07 23:31:33 +01:00
Marina Glancy 2eb25578d7 MDL-70584 core_iplookup: increase tolerance in test 2021-01-07 16:36:07 +01:00
AMOS bot 40b559b8a2 Automatically generated installer lang files 2020-12-27 00:07:43 +00:00
AMOS bot 9b7dec7967 Automatically generated installer lang files 2020-12-24 00:07:47 +00:00
Eloy Lafuente (stronk7) 540c5032ec weekly release 3.8.6+ 2020-12-23 20:24:44 +01:00
Eloy Lafuente (stronk7) 2f627b199a Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-12-23 20:24:41 +01:00
AMOS bot 9590644949 Automatically generated installer lang files 2020-12-22 00:07:41 +00:00
Sara Arjona b3eb0b4ed8 Merge branch 'MDL-69107-38-2' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-12-18 15:22:55 +01:00
Sara Arjona 9e09004bf9 weekly release 3.8.6+ 2020-12-17 15:53:02 +01:00
Sara Arjona ac62bf1f10 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-12-17 15:53:00 +01:00
Andrew Nicols da7a9d4a5b MDL-69107 behat: Update field normalisation 2020-12-17 07:50:21 +08:00
Andrew Nicols 15deb6037a MDL-69107 user: Fix autocomplete usages 2020-12-16 08:11:58 +08:00
Paul Holden 7ba62ce566 MDL-70422 restore: fix for undefined question answer ordering in test. 2020-12-15 16:43:37 +01:00
Andrew Nicols 6fb9ff4a8d 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 20:34:19 +08:00
AMOS bot c1b5bd5f2c Automatically generated installer lang files 2020-12-15 00:07:42 +00:00
Sara Arjona 90645731dd Merge branch 'MDL-70397-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-12-14 17:12:51 +01:00
AMOS bot 617a39a855 Automatically generated installer lang files 2020-12-13 00:07:42 +00:00
AMOS bot 733a066172 Automatically generated installer lang files 2020-12-12 00:07:51 +00:00
AMOS bot ef5abe6f1a Merge branch 'MOODLE_38_STABLE' into install_38_STABLE 2020-12-12 00:07:50 +00:00
AMOS bot 997a6d6aea Automatically generated installer lang files 2020-12-11 00:07:49 +00:00
Víctor Déniz 782d9e0a70 weekly release 3.8.6+ 2020-12-10 21:10:26 +00:00
Víctor Déniz 899ebabd4a Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-12-10 21:10:20 +00:00
Jake Dallimore 979acac249 Merge branch 'MDL-70151-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-12-09 14:46:57 +08:00
Jake Dallimore 68636f2c58 Merge branch 'MDL-70285_38' of https://github.com/timhunt/moodle into MOODLE_38_STABLE 2020-12-08 16:34:34 +08:00
AMOS bot 88642c8f8d Automatically generated installer lang files 2020-12-08 00:07:40 +00:00
AMOS bot fa5227be64 Automatically generated installer lang files 2020-12-06 00:07:46 +00:00
Andrew Nicols 5460610eab MDL-70397 behat: Prevent browser restarting after initial start 2020-12-04 12:07:51 +08:00
Jake Dallimore f00ea29c80 weekly release 3.8.6+ 2020-12-04 08:42:54 +08:00
Jake Dallimore 10bf4c6c69 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-12-04 08:42:51 +08:00
Adrian Greeve 4cd4d59006 Merge branch 'MDL-70167-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-12-03 09:55:33 +08:00
AMOS bot 461552b315 Automatically generated installer lang files 2020-12-03 00:07:45 +00:00
AMOS bot d2e4b192ec Automatically generated installer lang files 2020-12-02 00:07:41 +00:00
AMOS bot 8cfd3f2b72 Automatically generated installer lang files 2020-12-01 00:07:47 +00:00
Sara Arjona 885cb5e157 weekly release 3.8.6+ 2020-11-27 07:51:00 +01:00
Sara Arjona 4f6fe6ceb1 Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-11-27 07:50:56 +01:00
AMOS bot 8a3b7b90e8 Automatically generated installer lang files 2020-11-27 06:21:27 +00:00
Sara Arjona fd2c79545f Merge branch 'MDL-70276_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2020-11-26 15:05:03 +01:00
Eloy Lafuente (stronk7) e1bb0014c1 MDL-70276 github actions: First cut, phpunit and grunt checks
First working version, supports phpunit (using build matrix):

- php71 (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:20:22 +01:00
Sara Arjona bcfa789822 Merge branch 'MDL-70265_38' of https://github.com/stronk7/moodle into MOODLE_38_STABLE 2020-11-25 15:47:11 +01:00
Tim Hunt e9cb4f23a5 MDL-70285 completion upgrade: fix performance of the MDL-69687 code 2020-11-23 22:55:09 +00:00
Eloy Lafuente (stronk7) a476c8f0bd 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:23:31 +01:00
Adrian Greeve 50285a5011 Merge branch 'MDL-67668-38-2' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-11-23 15:35:43 +08:00
Andrew Nicols 069e41e2e0 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:28 +08:00
Andrew Nicols 2f842d0d45 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:07:11 +08:00
Andrew Nicols 6e7d2022d1 MDL-70167 behat: Boolean attributes should either exist or not 2020-11-23 11:07:09 +08:00
Andrew Nicols 161a902514 MDL-67668 behat: Update tests for inplace editable field type 2020-11-23 09:00:46 +08:00
Andrew Nicols 4c4c49036c 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 6aeca2cc3b 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 85ca7d98de 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 cc724b40f1 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) be139ca945 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:22 +01:00
Eloy Lafuente (stronk7) 3cb4a45cb4 weekly release 3.8.6+ 2020-11-20 23:16:58 +01:00
Eloy Lafuente (stronk7) dee26a0fbd Merge branch 'install_38_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_38_STABLE 2020-11-20 23:16:55 +01:00
Sara Arjona 6cacbf2d63 Merge branch 'MDL-70148_38' of git://github.com/stronk7/moodle into MOODLE_38_STABLE 2020-11-19 13:21:32 +01:00
Eloy Lafuente (stronk7) 56c8c6b292 MDL-70148 behat: Added missing step definition that was lost in backport 2020-11-19 12:54:09 +01:00
Sam Hemelryk 1db6212c68 MDL-68896 mod_scorm: improved sendBeacon use when unloading 2020-11-18 10:06:21 +08:00
Eloy Lafuente (stronk7) 29bf8d5176 Merge branch 'MDL-70148-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE 2020-11-17 23:13:36 +01:00
Andrew Nicols 581c909321 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 7cbdc8a996 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 fd62f6e03e MDL-70148 behat: Update steps for keyboard 2020-11-17 15:14:43 +08:00
Andrew Nicols 8ae2fb1773 MDL-70148 behat: Add steps to send keys without an element 2020-11-17 15:14:43 +08:00
AMOS bot f577d6f6c3 Automatically generated installer lang files 2020-11-11 00:07:49 +00:00
AMOS bot ae166e60bb Automatically generated installer lang files 2020-11-09 00:07:57 +00:00
761 changed files with 7006 additions and 4543 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.1
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
+30 -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.1.30 # Make this sticky because current default version (7.1.11) has a bug with redis-extension output (MDL-66062)
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,36 @@ 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.1.30)
# Make this sticky because current default version (7.1.11) has a bug with redis-extension output (MDL-66062)
- php: 7.1.30
env: DB=none TASK=CITEST
- php: 7.1.30
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.1.30
env: DB=pgsql TASK=PHPUNIT
- if: env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all"
php: 7.1.30
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 +115,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 +226,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 +251,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' ];
+1 -1
View File
@@ -2,7 +2,7 @@ MOODLE TRADEMARKS POLICY
========================
The word "Moodle" is trademarked in many countries around the world. The word
was originally an acronym: Modular Object-Oriented Dynamic Learning
was originally coined as an acronym: Modular Object-Oriented Dynamic Learning
Environment. The trademark is owned by Martin Dougiamas, Founder and Director
of Moodle.
+187
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,188 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.11" requires="3.6">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="9.6" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
@@ -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
@@ -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"
@@ -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,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);
}
}
@@ -132,12 +132,12 @@ Feature: Upload users
# Boost check.
And I log in as "jonest"
And I am on "Maths" course homepage
And "Turn editing on" "button" should not exist
And "Calendar" "link" should be visible
And I log out
# Classic check.
And I log in as "reznor"
And I am on "Maths" course homepage
And "Turn editing on" "button" should exist
And "Calendar" "link" should not be visible
@javascript
Scenario: Upload users setting their user theme when allowuserthemes is false
+1 -1
View File
@@ -293,7 +293,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"');
+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 -3
View File
@@ -716,9 +716,7 @@ class auth_plugin_mnet extends auth_plugin_base {
foreach($superArray as $subArray) {
$subArray = array_values($subArray);
$instring = "('".implode("', '",$subArray)."')";
$query = "select id, session_id, username from {mnet_session} where username in $instring";
$results = $DB->get_records_sql($query);
$results = $DB->get_records_list('mnet_session', 'username', $subArray, '', 'id, session_id, username');
if ($results == false) {
// We seem to have a username that breaks our query:
+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;
}
+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;
if ($oldversion < 2017020700) {
// Convert info in config plugins from auth/shibboleth to auth_shibboleth.
@@ -57,5 +57,27 @@ function xmldb_auth_shibboleth_upgrade($oldversion) {
// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2019111801) {
// 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, 2019111801, '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.8.7 ===
* 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 = 2019111800; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2019111801; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2019111200; // Requires this Moodle version
$plugin->component = 'auth_shibboleth'; // Full name of the plugin (used for diagnostics)
@@ -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]);
}
}
@@ -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 |
+19 -2
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 {
@@ -152,6 +161,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 = 2019111800; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2019111801; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2019111200; // Requires this Moodle version
$plugin->component = 'block_online_users'; // Full name of the plugin (used for diagnostics)
@@ -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%)]",
]),
];
}
}
@@ -24,9 +24,7 @@ Feature: Edit activities in social activities block
And I set the field "Add an activity to section 'section 0'" to "Forum"
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"
@@ -82,4 +80,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
+1 -3
View File
@@ -59,9 +59,7 @@ Feature: Add cohorts of users
@javascript
Scenario: Edit cohort name in-place
When I follow "Cohorts"
And I click on "Edit cohort name" "link" in the "Test cohort name" "table_row"
And I set the field "New name for cohort Test cohort name" to "Students cohort"
And I press key "13" in the field "New name for cohort Test cohort name"
And I set the field "Edit cohort name" to "Students cohort"
Then I should not see "Test cohort name"
And I should see "Students cohort"
And I follow "Cohorts"
@@ -53,9 +53,7 @@ Feature: Sections can be edited and deleted in topics format
@javascript
Scenario: Inline edit section name in topics format
When I click on "Edit topic name" "link" in the "li#section-1" "css_element"
And I set the field "New name for topic Topic 1" to "Midterm evaluation"
And I press key "13" in the field "New name for topic Topic 1"
When I set the field "Edit topic name" in the "li#section-1" "css_element" to "Midterm evaluation"
Then I should not see "Topic 1" in the "region-main" "region"
And "New name for topic" "field" should not exist
And I should see "Midterm evaluation" in the "li#section-1" "css_element"
@@ -54,9 +54,7 @@ Feature: Sections can be edited and deleted in weeks format
@javascript
Scenario: Inline edit section name in weeks format
When I click on "Edit week name" "link" in the "li#section-1" "css_element"
And I set the field "New name for week 1 May - 7 May" to "Midterm evaluation"
And I press key "13" in the field "New name for week 1 May - 7 May"
When I set the field "Edit week name" in the "li#section-1" "css_element" to "Midterm evaluation"
Then I should not see "1 May - 7 May" in the "region-main" "region"
And "New name for week" "field" should not exist
And I should see "Midterm evaluation" in the "li#section-1" "css_element"
@@ -15,15 +15,16 @@ Feature: Edit activity name in-place
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
| description | Test forum description |
| idnumber | forum1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
# Rename activity
And I click on "Edit title" "link" in the "//div[contains(@class,'activityinstance') and contains(.,'Test forum name')]" "xpath_element"
And I set the field "New name for activity Test forum name" to "Good news"
And I press key "13" in the field "New name for activity Test forum name"
And I set the field "Edit title" in the "Test forum name" "activity" to "Good news"
Then I should not see "Test forum name" in the ".course-content" "css_element"
And "New name for activity Test forum name" "field" should not exist
And I should see "Good news"
@@ -32,12 +33,11 @@ Feature: Edit activity name in-place
And I should not see "Test forum name"
# Cancel renaming
And I click on "Edit title" "link" in the "//div[contains(@class,'activityinstance') and contains(.,'Good news')]" "xpath_element"
And I set the field "New name for activity Good news" to "Terrible news"
And I press key "27" in the field "New name for activity Good news"
And I type "Terrible news"
And I press the escape key
And "New name for activity Good news" "field" should not exist
And I should see "Good news"
And I should not see "Terrible news"
And I am on "Course 1" course homepage
And I should see "Good news"
And I should not see "Terrible news"
And I log out
+6 -16
View File
@@ -811,22 +811,12 @@ class behat_course extends behat_base {
* @param string $newactivityname
*/
public function i_change_activity_name_to($activityname, $newactivityname) {
if (!$this->running_javascript()) {
throw new DriverException('Change activity name step is not available with Javascript disabled');
}
$activity = $this->escape($activityname);
$this->execute('behat_course::i_click_on_in_the_activity',
array(get_string('edittitle'), "link", $activity)
);
// Adding chr(10) to save changes.
$this->execute('behat_forms::i_set_the_field_to',
array('title', $this->escape($newactivityname) . chr(10))
);
$this->execute('behat_forms::i_set_the_field_in_container_to', [
get_string('edittitle'),
$activityname,
'activity',
$newactivityname
]);
}
/**
+2 -4
View File
@@ -38,7 +38,7 @@ Feature: Tagging courses
And I expand all fieldsets
Then I should see "Mathematics" in the ".form-autocomplete-selection" "css_element"
And I set the following fields to these values:
| Tags | Algebra |
| Tags | Mathematics, Algebra |
And I press "Save and display"
And I am on "Course 2" course homepage
And I navigate to "Edit settings" in current page administration
@@ -63,7 +63,6 @@ Feature: Tagging courses
And I follow "Geometry"
And I should not see "Course 1"
And I should see "Course 2"
And I log out
Scenario: User can set course tags using separate form
Given I log in as "admin"
@@ -75,7 +74,7 @@ Feature: Tagging courses
And I navigate to "Course tags" in current page administration
Then I should see "Mathematics" in the ".form-autocomplete-selection" "css_element"
And I set the following fields to these values:
| Tags | Algebra |
| Tags | Mathematics, Algebra |
And I press "Save changes"
And I am on "Course 2" course homepage
And I navigate to "Course tags" in current page administration
@@ -100,4 +99,3 @@ Feature: Tagging courses
And I follow "Geometry"
And I should not see "Course 1"
And I should see "Course 2"
And I log out
@@ -12,7 +12,6 @@ Feature: Managers can manage categories for course custom fields
Then I should see "Other fields" in the "#customfield_catlist" "css_element"
And I navigate to "Reports > Logs" in site administration
And I press "Get these logs"
And I log out
Scenario: Edit a category name for custom course fields
Given the following "custom field categories" exist:
@@ -20,15 +19,12 @@ Feature: Managers can manage categories for course custom fields
| Category for test | core_course | course | 0 |
And I log in as "admin"
And I navigate to "Courses > Course custom fields" in site administration
And I click on "Edit category name" "link" in the "//div[contains(@class,'categoryinstance') and contains(.,'Category for test')]" "xpath_element"
And I set the field "New value for Category for test" to "Good fields"
And I press key "13" in the field "New value for Category for test"
And I set the field "Edit category name" in the "//div[contains(@class,'categoryinstance') and contains(.,'Category for test')]" "xpath_element" to "Good fields"
Then I should not see "Category for test" in the "#customfield_catlist" "css_element"
And "New value for Category for test" "field" should not exist
And I should see "Good fields" in the "#customfield_catlist" "css_element"
And I navigate to "Reports > Logs" in site administration
And I press "Get these logs"
And I log out
Scenario: Delete a category for custom course fields
Given the following "custom field categories" exist:
@@ -46,7 +42,6 @@ Feature: Managers can manage categories for course custom fields
Then I should not see "Test category" in the "#customfield_catlist" "css_element"
And I navigate to "Reports > Logs" in site administration
And I press "Get these logs"
And I log out
Scenario: Move field in the course custom fields to another category
Given the following "custom field categories" exist:
@@ -78,7 +73,6 @@ Feature: Managers can manage categories for course custom fields
And I press "Move \"Field1\""
And I follow "After field Field2"
And "Field1" "text" should appear after "Field2" "text"
And I log out
Scenario: Reorder course custom field categories
Given the following "custom field categories" exist:
@@ -108,4 +102,3 @@ Feature: Managers can manage categories for course custom fields
And "Field1" "text" should appear after "Category1" "text"
And "Category2" "text" should appear after "Field1" "text"
And "Category3" "text" should appear after "Category2" "text"
And I log out
+3 -2
View File
@@ -307,6 +307,7 @@ class core_enrol_external extends external_api {
global $CFG, $USER, $DB;
require_once($CFG->dirroot . '/course/lib.php');
require_once($CFG->dirroot . '/user/lib.php');
require_once($CFG->libdir . '/completionlib.php');
// Do basic automatic PARAM checks on incoming data, using params description
@@ -346,8 +347,8 @@ class core_enrol_external extends external_api {
continue;
}
if (!$sameuser and !course_can_view_participants($context)) {
// we need capability to view participants
// If viewing details of another user, then we must be able to view participants as well as profile of that user.
if (!$sameuser && (!course_can_view_participants($context) || !user_can_view_profile($user, $course))) {
continue;
}
+15 -16
View File
@@ -130,18 +130,17 @@ Feature: Teacher can search and enrol users one by one into the course
Scenario: Searching for a non-existing user
Given I navigate to course participants
And I press "Enrol users"
And I set the field "Select users" to "qwertyuiop"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
And I click on "Select users" "field"
And I type "qwertyuiop"
Then I should see "No suggestions"
@javascript
Scenario: If there are less than 100 matching users, all are displayed for selection
Given I navigate to course participants
And I press "Enrol users"
When I set the field "Select users" to "example.com"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
And I click on "Student 099" item in the autocomplete list
Then I should see "Student 099"
When I click on "Select users" "field"
And I type "example.com"
Then "Student 099" "autocomplete_suggestions" should exist
@javascript
Scenario: If there are more than 100 matching users, inform there are too many.
@@ -151,8 +150,8 @@ Feature: Teacher can search and enrol users one by one into the course
| student101 | Student | 101 | student101@example.com |
And I navigate to course participants
And I press "Enrol users"
When I set the field "Select users" to "example.com"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
When I click on "Select users" "field"
And I type "example.com"
Then I should see "Too many users (>100) to show"
@javascript
@@ -161,8 +160,8 @@ Feature: Teacher can search and enrol users one by one into the course
| maxusersperpage | 5 |
And I navigate to course participants
And I press "Enrol users"
When I set the field "Select users" to "student00"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
When I click on "Select users" "field"
And I type "student00"
Then I should see "Too many users (>5) to show"
@javascript
@@ -177,18 +176,18 @@ Feature: Teacher can search and enrol users one by one into the course
When I am on "Course 001" course homepage
Then I navigate to course participants
And I press "Enrol users"
When I set the field "Select users" to "student100@example.com"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
When I click on "Select users" "field"
And I type "student100@example.com"
Then I should see "student100@example.com, CITY1, UK, 1234567892, 1234567893, ABC1, ABC2"
# Remove identity field in setting User policies
And the following config values are set as admin:
| showuseridentity | idnumber,email,phone1,phone2,department,institution |
When I am on "Course 001" course homepage
And I am on "Course 001" course homepage
And I navigate to course participants
And I press "Enrol users"
When I set the field "Select users" to "student100@example.com"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
Then I should see "student100@example.com, 1234567892, 1234567893, ABC1, ABC2"
And I click on "Select users" "field"
And I type "student100@example.com"
And I should see "student100@example.com, 1234567892, 1234567893, ABC1, ABC2"
# The following tests are commented out as a result of MDL-66339.
# @javascript
+1 -1
View File
@@ -32,6 +32,6 @@ Feature: Users can be added to multiple groups at once
And I click on "Group 1" item in the autocomplete list
And I click on ".form-autocomplete-downarrow" "css_element" in the "student1" "table_row"
And I click on "Group 2" item in the autocomplete list
And I press key "27" in the field "Edit groups for \"Student 1\""
And I press the escape key
And I click on "Save changes" "link" in the "student1" "table_row"
Then I should see "Group 1, Group 2"
+75
View File
@@ -521,6 +521,81 @@ class core_enrol_externallib_testcase extends externallib_advanced_testcase {
$this->assertEquals(0, $enrolledincourses[0]['lastaccess']); // I can't see this, hidden by global setting.
}
/**
* Test that get_users_courses respects the capability to view participants when viewing courses of other user
*/
public function test_get_users_courses_can_view_participants(): void {
global $DB;
$this->resetAfterTest();
$course = $this->getDataGenerator()->create_course();
$context = context_course::instance($course->id);
$user1 = $this->getDataGenerator()->create_and_enrol($course, 'student');
$user2 = $this->getDataGenerator()->create_and_enrol($course, 'student');
$this->setUser($user1);
$courses = core_enrol_external::clean_returnvalue(
core_enrol_external::get_users_courses_returns(),
core_enrol_external::get_users_courses($user2->id, false)
);
$this->assertCount(1, $courses);
$this->assertEquals($course->id, reset($courses)['id']);
// Prohibit the capability for viewing course participants.
$studentrole = $DB->get_field('role', 'id', ['shortname' => 'student']);
assign_capability('moodle/course:viewparticipants', CAP_PROHIBIT, $studentrole, $context->id);
$courses = core_enrol_external::clean_returnvalue(
core_enrol_external::get_users_courses_returns(),
core_enrol_external::get_users_courses($user2->id, false)
);
$this->assertEmpty($courses);
}
/*
* Test that get_users_courses respects the capability to view a users profile when viewing courses of other user
*/
public function test_get_users_courses_can_view_profile(): void {
$this->resetAfterTest();
$course = $this->getDataGenerator()->create_course([
'groupmode' => VISIBLEGROUPS,
]);
$user1 = $this->getDataGenerator()->create_and_enrol($course, 'student');
$user2 = $this->getDataGenerator()->create_and_enrol($course, 'student');
// Create separate groups for each of our students.
$group1 = $this->getDataGenerator()->create_group(['courseid' => $course->id]);
groups_add_member($group1, $user1);
$group2 = $this->getDataGenerator()->create_group(['courseid' => $course->id]);
groups_add_member($group2, $user2);
$this->setUser($user1);
$courses = core_enrol_external::clean_returnvalue(
core_enrol_external::get_users_courses_returns(),
core_enrol_external::get_users_courses($user2->id, false)
);
$this->assertCount(1, $courses);
$this->assertEquals($course->id, reset($courses)['id']);
// Change to separate groups mode, so students can't view information about each other in different groups.
$course->groupmode = SEPARATEGROUPS;
update_course($course);
$courses = core_enrol_external::clean_returnvalue(
core_enrol_external::get_users_courses_returns(),
core_enrol_external::get_users_courses($user2->id, false)
);
$this->assertEmpty($courses);
}
/**
* Test get_users_courses with mathjax in the name.
*/
+3
View File
@@ -189,6 +189,9 @@ class filter_tex extends moodle_text_filter {
continue;
}
// Sanitize the decoded string, because filter_text_image() injects the final string between script tags.
$texexp = clean_param($texexp, PARAM_TEXT);
$md5 = md5($texexp);
if (!$DB->record_exists("cache_filters", array("filter"=>"tex", "md5key"=>$md5))) {
$texcache = new stdClass();
@@ -128,7 +128,13 @@ class fetch extends external_api {
}
// Fetch the actual data.
$gradeduser = \core_user::get_user($gradeduserid);
$gradeduser = \core_user::get_user($gradeduserid, '*', MUST_EXIST);
// One can access its own grades. Others just if they're graders.
if ($gradeduserid != $USER->id) {
$gradeitem->require_user_can_grade($gradeduser, $USER);
}
$hasgrade = $gradeitem->user_has_grade($gradeduser);
$grade = $gradeitem->get_grade_for_user($gradeduser, $USER);
$maxgrade = (int) $gradeitem->get_grade_item()->grademax;
@@ -127,7 +127,12 @@ class fetch extends external_api {
throw new moodle_exception("The {$itemname} item in {$component}/{$contextid} is not configured for grading with scales");
}
$gradeduser = \core_user::get_user($gradeduserid);
$gradeduser = \core_user::get_user($gradeduserid, '*', MUST_EXIST);
// One can access its own grades. Others just if they're graders.
if ($gradeduserid != $USER->id) {
$gradeitem->require_user_can_grade($gradeduser, $USER);
}
$maxgrade = (int) $gradeitem->get_grade_item()->grademax;
+1 -1
View File
@@ -1,2 +1,2 @@
define ("gradingform_guide/comment_chooser",["jquery","core/templates","core/notification","core/yui"],function(a,b,c){return{initialise:function initialise(d,e,f,g){function h(b,c){var e="<label>"+M.util.get_string("insertcomment","gradingform_guide")+"</label>",g="comment-chooser-"+d+"-cancel",h="<button id=\""+g+"\">"+M.util.get_string("cancel","moodle")+"</button>",i=new M.core.dialogue({modal:!0,headerContent:e,bodyContent:b,footerContent:h,focusAfterHide:"#"+f,id:"comments-chooser-dialog-"+d});a("#"+g).click(function(){i.hide()});a.each(c,function(b,c){var e="#comment-option-"+d+"-"+c.id;a(e).click(function(){var b=a("#"+f),d=b.val();if(""!==a.trim(d)){d+="\n"}d+=c.description;b.val(d);i.hide()});a(document).off("keypress",e).on("keypress",e,function(){var b=event.which||event.keyCode;if(13==b||32==b){a(e).click()}})});i.after("visibleChange",function(a){if(a.prevVal&&!a.newVal){this.destroy()}},i);i.show()}function i(){b.render("gradingform_guide/comment_chooser",{criterionId:d,comments:g}).done(function(a){h(a,g)}).fail(c.exception)}a("#"+e).click(function(a){a.preventDefault();i()})}}});
define ("gradingform_guide/comment_chooser",["jquery","core/templates","core/notification","core/yui"],function(a,b,c){return{initialise:function initialise(d,e,f,g){function h(b,c){var e="<label>"+M.util.get_string("insertcomment","gradingform_guide")+"</label>",g="comment-chooser-"+d+"-cancel",h="<button id=\""+g+"\">"+M.util.get_string("cancel","moodle")+"</button>",i=new M.core.dialogue({modal:!0,headerContent:e,bodyContent:b,footerContent:h,focusAfterHide:"#"+f,id:"comments-chooser-dialog-"+d});a("#"+g).click(function(){i.hide()});a.each(c,function(b,c){var e="#comment-option-"+d+"-"+c.id;a(e).click(function(){var b=a("#"+f),d=b.val();if(""!==d.trim()){d+="\n"}d+=c.description;b.val(d);i.hide()});a(document).off("keypress",e).on("keypress",e,function(){var b=event.which||event.keyCode;if(13==b||32==b){a(e).click()}})});i.after("visibleChange",function(a){if(a.prevVal&&!a.newVal){this.destroy()}},i);i.show()}function i(){b.render("gradingform_guide/comment_chooser",{criterionId:d,comments:g}).done(function(a){h(a,g)}).fail(c.exception)}a("#"+e).click(function(a){a.preventDefault();i()})}}});
//# sourceMappingURL=comment_chooser.min.js.map
File diff suppressed because one or more lines are too long
@@ -77,7 +77,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/yui'], function($
var remarkText = remarkTextArea.val();
// Add line break if the current value of the remark text is not empty.
if ($.trim(remarkText) !== '') {
if (remarkText.trim() !== '') {
remarkText += '\n';
}
remarkText += comment.description;
@@ -133,7 +133,12 @@ class fetch extends external_api {
}
// Fetch the actual data.
$gradeduser = core_user::get_user($gradeduserid);
$gradeduser = core_user::get_user($gradeduserid, '*', MUST_EXIST);
// One can access its own grades. Others just if they're graders.
if ($gradeduserid != $USER->id) {
$gradeitem->require_user_can_grade($gradeduser, $USER);
}
return self::get_fetch_data($gradeitem, $gradeduser);
}
@@ -167,8 +167,6 @@ class fetch_test extends advanced_testcase {
*/
public function test_execute_fetch_graded(): void {
$this->resetAfterTest();
$generator = \testing_util::get_data_generator();
$guidegenerator = $generator->get_plugin_generator('gradingform_guide');
[
'forum' => $forum,
@@ -178,23 +176,74 @@ class fetch_test extends advanced_testcase {
'teacher' => $teacher,
] = $this->get_test_data();
$this->setUser($teacher);
$this->execute_and_assert_fetch($forum, $controller, $definition, $teacher, $teacher, $student);
}
/**
* Class mates should not get other's grades.
*/
public function test_execute_fetch_does_not_return_data_to_other_students(): void {
$this->resetAfterTest();
[
'forum' => $forum,
'controller' => $controller,
'definition' => $definition,
'student' => $student,
'teacher' => $teacher,
'course' => $course,
] = $this->get_test_data();
$evilstudent = $this->getDataGenerator()->create_and_enrol($course, 'student');
$this->expectException(\required_capability_exception::class);
$this->execute_and_assert_fetch($forum, $controller, $definition, $evilstudent, $teacher, $student);
}
/**
* Grades can be returned to graded user.
*/
public function test_execute_fetch_return_data_to_graded_user(): void {
$this->resetAfterTest();
[
'forum' => $forum,
'controller' => $controller,
'definition' => $definition,
'student' => $student,
'teacher' => $teacher,
] = $this->get_test_data();
$this->execute_and_assert_fetch($forum, $controller, $definition, $student, $teacher, $student);
}
/**
* Executes and performs all the assertions of the fetch method with the given parameters.
*/
private function execute_and_assert_fetch ($forum, $controller, $definition, $fetcheruser, $grader, $gradeduser) {
$generator = \testing_util::get_data_generator();
$guidegenerator = $generator->get_plugin_generator('gradingform_guide');
$this->setUser($grader);
$gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
$grade = $gradeitem->get_grade_for_user($student, $teacher);
$instance = $gradeitem->get_advanced_grading_instance($teacher, $grade);
$grade = $gradeitem->get_grade_for_user($gradeduser, $grader);
$instance = $gradeitem->get_advanced_grading_instance($grader, $grade);
$submissiondata = $guidegenerator->get_test_form_data($controller, (int) $student->id,
$submissiondata = $guidegenerator->get_test_form_data($controller, (int) $gradeduser->id,
10, 'Propper good speling',
0, 'ASCII art is not a picture'
);
$gradeitem->store_grade_from_formdata($student, $teacher, (object) [
$gradeitem->store_grade_from_formdata($gradeduser, $grader, (object) [
'instanceid' => $instance->get_id(),
'advancedgrading' => $submissiondata,
]);
$result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id);
$this->setUser($fetcheruser);
// Set up some items we need to return on other interfaces.
$result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $gradeduser->id);
$result = external_api::clean_returnvalue(fetch::execute_returns(), $result);
$this->assertIsArray($result);
@@ -291,6 +340,7 @@ class fetch_test extends advanced_testcase {
'definition' => $definition,
'student' => $student,
'teacher' => $teacher,
'course' => $course,
];
}
}
@@ -93,6 +93,8 @@ class fetch extends external_api {
* @since Moodle 3.8
*/
public static function execute(string $component, int $contextid, string $itemname, int $gradeduserid): array {
global $USER;
[
'component' => $component,
'contextid' => $contextid,
@@ -124,7 +126,12 @@ class fetch extends external_api {
}
// Fetch the actual data.
$gradeduser = \core_user::get_user($gradeduserid);
$gradeduser = \core_user::get_user($gradeduserid, '*', MUST_EXIST);
// One can access its own grades. Others just if they're graders.
if ($gradeduserid != $USER->id) {
$gradeitem->require_user_can_grade($gradeduser, $USER);
}
return self::get_fetch_data($gradeitem, $gradeduser);
}
@@ -174,8 +174,6 @@ class fetch_test extends advanced_testcase {
*/
public function test_execute_fetch_graded(): void {
$this->resetAfterTest();
$generator = \testing_util::get_data_generator();
$rubricgenerator = $generator->get_plugin_generator('gradingform_rubric');
[
'forum' => $forum,
@@ -185,23 +183,73 @@ class fetch_test extends advanced_testcase {
'teacher' => $teacher,
] = $this->get_test_data();
$this->setUser($teacher);
$this->execute_and_assert_fetch($forum, $controller, $definition, $teacher, $teacher, $student);
}
/**
* Class mates should not get other's grades.
*/
public function test_execute_fetch_does_not_return_data_to_other_students(): void {
$this->resetAfterTest();
[
'forum' => $forum,
'controller' => $controller,
'definition' => $definition,
'student' => $student,
'teacher' => $teacher,
'course' => $course,
] = $this->get_test_data();
$evilstudent = $this->getDataGenerator()->create_and_enrol($course, 'student');
$this->expectException(\required_capability_exception::class);
$this->execute_and_assert_fetch($forum, $controller, $definition, $evilstudent, $teacher, $student);
}
/**
* Grades can be returned to graded user.
*/
public function test_execute_fetch_return_data_to_graded_user(): void {
$this->resetAfterTest();
[
'forum' => $forum,
'controller' => $controller,
'definition' => $definition,
'student' => $student,
'teacher' => $teacher,
] = $this->get_test_data();
$this->execute_and_assert_fetch($forum, $controller, $definition, $student, $teacher, $student);
}
/**
* Executes and performs all the assertions of the fetch method with the given parameters.
*/
private function execute_and_assert_fetch ($forum, $controller, $definition, $fetcheruser, $grader, $gradeduser) {
$generator = \testing_util::get_data_generator();
$rubricgenerator = $generator->get_plugin_generator('gradingform_rubric');
$this->setUser($grader);
$gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
$grade = $gradeitem->get_grade_for_user($student, $teacher);
$instance = $gradeitem->get_advanced_grading_instance($teacher, $grade);
$grade = $gradeitem->get_grade_for_user($gradeduser, $grader);
$instance = $gradeitem->get_advanced_grading_instance($grader, $grade);
$submissiondata = $rubricgenerator->get_test_form_data($controller, (int) $student->id,
$submissiondata = $rubricgenerator->get_test_form_data($controller, (int) $gradeduser->id,
0, 'Too many mistakes. Please try again.',
2, 'Great number of pictures. Well done.'
);
$gradeitem->store_grade_from_formdata($student, $teacher, (object) [
$gradeitem->store_grade_from_formdata($gradeduser, $grader, (object) [
'instanceid' => $instance->get_id(),
'advancedgrading' => $submissiondata,
]);
$result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id);
$this->setUser($fetcheruser);
$result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $gradeduser->id);
$result = external_api::clean_returnvalue(fetch::execute_returns(), $result);
$this->assertIsArray($result);
@@ -311,6 +359,7 @@ class fetch_test extends advanced_testcase {
'definition' => $definition,
'student' => $student,
'teacher' => $teacher,
'course' => $course,
];
}
}
@@ -87,7 +87,7 @@ class provider implements
* @param int $userid The userid of the user whose data is to be exported.
*/
public static function export_user_preferences(int $userid) {
$preferences = get_user_preferences();
$preferences = get_user_preferences(null, null, $userid);
foreach ($preferences as $name => $value) {
$prefname = null;
$prefdescription = null;
@@ -59,18 +59,18 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
Then I should see a grade field for "Student 2" and grade item "Item VU"
And I should not see a feedback field for "Student 2" and grade item "Item VU"
And I set the field "ajaxgrade" to "33"
And I press key "13" in the field "ajaxgrade"
And I press the enter key
And I should not see a grade field for "Student 2" and grade item "Item VU"
And I should not see a feedback field for "Student 2" and grade item "Item VU"
And I click on student "Student 3" for grade item "Item VU"
And I set the field "ajaxgrade" to "50"
And I press key "13" in the field "ajaxgrade"
And I click on student "Student 3" for grade item "Item 1"
And I set the field "ajaxgrade" to "80"
And I press key "13" in the field "ajaxgrade"
And I click on student "Student 3" for grade item "Item SU"
And I set the field "ajaxgrade" to "Very good"
And I press key "13" in the field "ajaxgrade"
And I press the shift tab key
And I click on student "Student 3" for grade item "Item VU"
And I set the field "ajaxgrade" to "50"
And I press the enter key
And I click on student "Student 3" for grade item "Item 1"
And I set the field "ajaxgrade" to "80"
And I press the enter key
And the following should exist in the "user-grades" table:
| -1- | -6- | -7- | -13- | -16- |
| Student 2 | - | 33.00 | - | 33.00 |
@@ -88,7 +88,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
And I should see a grade field for "Student 1" and grade item "Course total"
And I should not see a feedback field for "Student 1" and grade item "Course total"
And I set the field "ajaxgrade" to "90"
And I press key "13" in the field "ajaxgrade"
And I press the enter key
And the following should exist in the "user-grades" table:
| -1- | -16- |
| Student 1 | 90.00 |
@@ -112,7 +112,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
And I should see a feedback field for "Student 2" and grade item "Item VU"
And I set the field "ajaxgrade" to "33"
And I set the field "ajaxfeedback" to "Student 2 VU feedback"
And I press key "13" in the field "ajaxfeedback"
And I press the enter key
And I click on student "Student 3" for grade item "Item VL"
And I should not see a grade field for "Student 3" and grade item "Item VL"
And I should not see a feedback field for "Student 3" and grade item "Item VL"
@@ -120,11 +120,11 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
And I should not see a grade field for "Student 3" and grade item "Item TU"
And I should see a feedback field for "Student 3" and grade item "Item TU"
And I set the field "ajaxfeedback" to "Student 3 TU feedback"
And I press key "13" in the field "ajaxfeedback"
And I press the enter key
And I click on student "Student 2" for grade item "Item SU"
And I set the field "ajaxgrade" to "Very good"
And I set the field "ajaxfeedback" to "Student 2 SU feedback"
And I press key "13" in the field "ajaxfeedback"
And I press the enter key
# Reload grader report:
And I navigate to "View > User report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
@@ -148,7 +148,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe
Then I should see a grade field for "Student 2" and grade item "Item VU"
And I should see a feedback field for "Student 2" and grade item "Item VU"
And I set the field "ajaxgrade" to "33"
And I press key "13" in the field "ajaxgrade"
And I press the enter key
And I click on student "Student 2" for grade item "Course total"
And I should not see a grade field for "Student 3" and grade item "Course total"
And I should not see a feedback field for "Student 3" and grade item "Course total"
+6 -2
View File
@@ -63,14 +63,18 @@ class gradereport_grader_privacy_testcase extends \core_privacy\tests\provider_t
* These preferences can be set on each course, but the value is shared in the whole site.
*/
public function test_export_user_preferences_single() {
// Add some user preferences.
// Create test user, add some preferences.
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
set_user_preference('grade_report_showcalculations', 1, $user);
set_user_preference('grade_report_meanselection', GRADE_REPORT_MEAN_GRADED, $user);
set_user_preference('grade_report_studentsperpage', 50, $user);
// Validate exported data.
// Switch to admin user (so we can validate preferences of our test user are still exported).
$this->setAdminUser();
// Validate exported data for our test user.
provider::export_user_preferences($user->id);
$context = context_user::instance($user->id);
$writer = writer::with_context($context);
@@ -149,14 +149,60 @@ class fetch_test extends advanced_testcase {
$course = $forum->get_course_record();
$teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
$student = $this->getDataGenerator()->create_and_enrol($course, 'student');
$this->setUser($teacher);
$this->execute_and_assert_fetch($forum, $teacher, $teacher, $student);
}
/**
* Class mates should not get other's grades.
*/
public function test_execute_fetch_does_not_return_data_to_other_students(): void {
$this->resetAfterTest();
$forum = $this->get_forum_instance([
// Negative numbers mean a scale.
'grade_forum' => 5,
]);
$course = $forum->get_course_record();
$teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
$student = $this->getDataGenerator()->create_and_enrol($course, 'student');
$evilstudent = $this->getDataGenerator()->create_and_enrol($course, 'student');
$this->expectException(\required_capability_exception::class);
$this->execute_and_assert_fetch($forum, $evilstudent, $teacher, $student);
}
/**
* Grades can be returned to graded user.
*/
public function test_execute_fetch_return_data_to_graded_user(): void {
$this->resetAfterTest();
$forum = $this->get_forum_instance([
// Negative numbers mean a scale.
'grade_forum' => 5,
]);
$course = $forum->get_course_record();
$teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
$student = $this->getDataGenerator()->create_and_enrol($course, 'student');
$this->execute_and_assert_fetch($forum, $student, $teacher, $student);
}
/**
* Executes the fetch method with the given users and returns the result.
*/
private function execute_and_assert_fetch ($forum, $fetcheruser, $grader, $gradeduser) {
$this->setUser($grader);
$gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
$gradeitem->store_grade_from_formdata($student, $teacher, (object) [
$gradeitem->store_grade_from_formdata($gradeduser, $grader, (object) [
'grade' => 4,
]);
$result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id);
$this->setUser($fetcheruser);
$result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $gradeduser->id);
$result = external_api::clean_returnvalue(fetch::execute_returns(), $result);
$this->assertIsArray($result);
@@ -178,14 +178,75 @@ class fetch_test extends advanced_testcase {
$course = $forum->get_course_record();
$teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
$student = $this->getDataGenerator()->create_and_enrol($course, 'student');
$this->setUser($teacher);
$this->execute_and_assert_fetch($forum, $options, $scale, $teacher, $teacher, $student);
}
/**
* Class mates should not get other's grades.
*/
public function test_execute_fetch_does_not_return_data_to_other_students(): void {
$this->resetAfterTest();
$options = [
'A',
'B',
'C'
];
$scale = $this->getDataGenerator()->create_scale(['scale' => implode(',', $options)]);
$forum = $this->get_forum_instance([
// Negative numbers mean a scale.
'grade_forum' => -1 * $scale->id
]);
$course = $forum->get_course_record();
$teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
$student = $this->getDataGenerator()->create_and_enrol($course, 'student');
$evilstudent = $this->getDataGenerator()->create_and_enrol($course, 'student');
$this->expectException(\required_capability_exception::class);
$this->execute_and_assert_fetch($forum, $options, $scale, $evilstudent, $teacher, $student);
}
/**
* Grades can be returned to graded user.
*/
public function test_execute_fetch_return_data_to_graded_user(): void {
$this->resetAfterTest();
$options = [
'A',
'B',
'C'
];
$scale = $this->getDataGenerator()->create_scale(['scale' => implode(',', $options)]);
$forum = $this->get_forum_instance([
// Negative numbers mean a scale.
'grade_forum' => -1 * $scale->id
]);
$course = $forum->get_course_record();
$teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher');
$student = $this->getDataGenerator()->create_and_enrol($course, 'student');
$this->execute_and_assert_fetch($forum, $options, $scale, $student, $teacher, $student);
}
/**
* Executes the fetch method with the given users and returns the result.
*/
private function execute_and_assert_fetch ($forum, $options, $scale, $fetcheruser, $grader, $gradeduser) {
$this->setUser($grader);
$gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum');
$gradeitem->store_grade_from_formdata($student, $teacher, (object) [
$gradeitem->store_grade_from_formdata($gradeduser, $grader, (object) [
'grade' => 2,
]);
$result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id);
$this->setUser($fetcheruser);
$result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $gradeduser->id);
$result = external_api::clean_returnvalue(fetch::execute_returns(), $result);
$this->assertIsArray($result);
@@ -193,7 +254,7 @@ class fetch_test extends advanced_testcase {
$this->assertEquals('core_grades/grades/grader/gradingpanel/scale', $result['templatename']);
$result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $student->id);
$result = fetch::execute('mod_forum', (int) $forum->get_context()->id, 'forum', (int) $gradeduser->id);
$result = external_api::clean_returnvalue(fetch::execute_returns(), $result);
$this->assertIsArray($result);
+1 -1
View File
@@ -124,4 +124,4 @@ Feature: Organize students into groups
And I set the following fields to these values:
| Group name | Group A |
| Enrolment key | Abcdef-1 |
And I should not see "This enrolment key is already used for another group."
And I should not see "This enrolment key is already used for another group."
+1 -1
View File
@@ -101,4 +101,4 @@ Feature: The description of a group can be viewed by students and teachers
And I log in as "student2"
And I am on "Course 1" course homepage
And I navigate to course participants
And ".groupinfobox" "css_element" should not exist
And ".groupinfobox" "css_element" should not exist
+32
View File
@@ -0,0 +1,32 @@
<?php
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['thislanguage'] = 'Аԥсуа бызшәа';
+10 -11
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
@@ -31,15 +30,15 @@
defined('MOODLE_INTERNAL') || die();
$string['clianswerno'] = 'n';
$string['cliansweryes'] = 'y';
$string['cliansweryes'] = 'j';
$string['cliincorrectvalueerror'] = 'Fout, verkeerde waarde "{$a->value}" vir "{$a->option}"';
$string['cliincorrectvalueretry'] = 'Verkeerde waarde, probeer weer';
$string['clitypevalue'] = 'tipe waarde';
$string['clitypevaluedefault'] = 'tipe waarde, druk Enter om die standaard waarde te gebruik ({$a})';
$string['cliunknowoption'] = 'Nie-erkende opsies:
$string['clitypevaluedefault'] = 'tipe waarde, druk Enter om die verstekwaarde te gebruik ({$a})';
$string['cliunknowoption'] = 'Onerkende opsies:
{$a}
Gebruik die --help opsie.';
$string['cliyesnoprompt'] = 'Tik y (beteken ja) of n (beteken nee)';
$string['environmentrequireinstall'] = 'moet geïnstalleer en geaktiveer wees';
$string['environmentrequireversion'] = 'weergawe {$a->needed} word benodig en jy het tans {$a->current}';
$string['upgradekeyset'] = 'Opgradering sleutel (los skoon om nie te stel nie)';
Gebruik asseblief die --help opsie.';
$string['cliyesnoprompt'] = 'Tik j (beteken ja) of n (beteken nee)';
$string['environmentrequireinstall'] = 'moet geïnstalleer en ontsper wees';
$string['environmentrequireversion'] = 'weergawe {$a->needed} word benodig en jy hardloop tans {$a->current}';
$string['upgradekeyset'] = 'Opgradering sleutel (los oop om nie in te stel nie)';
+52
View File
@@ -0,0 +1,52 @@
<?php
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['cannotcreatedboninstall'] = '<p>Kon nie die databasis skep nie.</p>
<p>Die gespesifiseerde databasis bestaan nie en die aangetoonde gebruiker het nie toestemming om die databasis te skep nie.</p>
<p>Die werf se administrateur moet die konfigurasie van databasisse verifieer.</p>';
$string['cannotcreatelangdir'] = 'Kan nie taalgids skep nie';
$string['cannotcreatetempdir'] = 'Kan nie tydelike gids skep nie';
$string['cannotdownloadcomponents'] = 'Kan nie komponente aflaai nie';
$string['cannotdownloadzipfile'] = 'Kan nie ZIP-lêer aflaai nie';
$string['cannotfindcomponent'] = 'Kan nie komponent vind nie';
$string['cannotsavemd5file'] = 'Kan nie md5-lêer stoor nie';
$string['cannotsavezipfile'] = 'Kan nie ZIP-lêer stoor nie';
$string['cannotunzipfile'] = 'Kan nie lêer uitpak nie';
$string['componentisuptodate'] = 'Komponent is bygewerk';
$string['dmlexceptiononinstall'] = '<p>\'n Databasisfout het opgeduik [{$a->errorcode}].<br />{$a->debuginfo}</p>';
$string['downloadedfilecheckfailed'] = 'Kontrolering van afgelaaide lêer het misluk';
$string['invalidmd5'] = 'Die kontroleveranderlike was verkeerd - probeer weer';
$string['missingrequiredfield'] = 'Een of ander verlangde veld ontbreek';
$string['remotedownloaderror'] = '<p>Die aflaai van die komponent na jou bediener het misluk. Verifieer asseblief instaanbediener se instellings; die uitbreiding PHP cURL word hoogs aanbeveel.</p>
<p>Jy moet die <a href="{$a->url}">{$a->url}</a>-lêer handmatig aflaai, dit na "{$a->dest}" in jou bediener kopieer en dit daar uitpak.</p>';
$string['wrongdestpath'] = 'Verkeerde bestemmingsroete';
$string['wrongsourcebase'] = 'Verkeerde bron vir URL-basis';
$string['wrongzipfilename'] = 'Verkeerde ZIP-lêernaam';
+66 -4
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
@@ -30,4 +29,67 @@
defined('MOODLE_INTERNAL') || die();
$string['availablelangs'] = 'Beskikbare taal pakkette';
$string['admindirname'] = 'Admingids';
$string['availablelangs'] = 'Beskikbare taalpakkette';
$string['chooselanguagehead'] = 'Kies \'n taal';
$string['chooselanguagesub'] = 'Kies asseblief \'n taal vir die installasie. Hierdie taal sal ook as die verstektaal vir die webwerf gebruik word, alhoewel dit later verander kan word.';
$string['clialreadyconfigured'] = 'Die konfigurasielêer config.php bestaan reeds. Gebruik admin/cli/install_database.php asseblief om Moodle vir hierdie webwerf te installeer.';
$string['clialreadyinstalled'] = 'Die konfigurasielêer config.php bestaan reeds. Gebruik admin/cli/install_database.php asseblief om Moodle vir hierdie webwerf by te werk.';
$string['cliinstallheader'] = 'Installasieprogram vir Moodle-{$a}-opdraglyn';
$string['databasehost'] = 'Databasisgasheer';
$string['databasename'] = 'Databasisnaam';
$string['databasetypehead'] = 'Kies databasisdrywer';
$string['dataroot'] = 'Datagids';
$string['datarootpermission'] = 'Datagidstoestemming';
$string['dbprefix'] = 'Tabelvoorvoegsel';
$string['dirroot'] = 'Moodle-gids';
$string['environmenthead'] = 'Gaan tans jou omgewing na ...';
$string['environmentsub2'] = 'Elke Moodle-vrystelling het \'n paar minimumvereistes vir PHP-weergawes en \'n aantal verpligte PHP-uitbreidings.
Volledige omgewingskontrole word vóór elke installasie en opgradering gedoen. Kontak bedieneradministrateur asseblief as jy nie weet hoe om nuwe weergawe te installeer of PHP-uitbreidings te ontsper nie.';
$string['errorsinenvironment'] = 'Omgewingskontrole het misluk!';
$string['installation'] = 'Installasie';
$string['langdownloaderror'] = 'Jammer, die taal "{$a}" kon nie afgelaai word nie. Die installasieproses sal in Engels voortgesit word.';
$string['memorylimithelp'] = '<p>Die PHP-geheueperk vir jou bediener is tans op {$a} gestel.</p>
<p>Dit kan veroorsaak dat Moodle mettertyd geheueprobleme ervaar, veral as baie modules aangeskakel en/of daar baie gebruikers is.</p>
<p>Ons beveel aan dat jy, indien moontlik, PHP herkonfigureer met \'n hoër perk, soos 40M.
Jy kan verskeie maniere probeer om dit te doen:</p>
<ol>
<li>As jy kan, herkompileer PHP met <i>--enable-memory-limit</i>.
Dit sal Moodle in staat stel om self die geheueperk te stel.</li>
<li>As jy toegang tot jou php.ini-lêer het, kan jy die <b>memory_limit</b>-instelling daarin verander tot iets soos 40M. As jy nie toegang het nie, kan jy dalk jou administrateur vra om dit vir jou te doen.</li>
<li>Op sommige PHP-bedieners kan jy \'n .htaccess-lêer in die Moodle-gids skep wat hierdie lyn bevat:
<blockquote><div>php_value memory_limit 40M</div></blockquote>
<p>Op sommige bedieners kan dit egter verhoed dat <b>alle</b> PHP-blaaie werk (jy sal foute sien wanneer jy na die blaaie kyk), en daarom sal jy die .htaccess-lêer moet verwyder.</p></li>
</ol>';
$string['paths'] = 'Roetes';
$string['pathserrcreatedataroot'] = 'Datagids ({$a->dataroot}) kan nie deur installeerder geskep word nie.';
$string['pathshead'] = 'Bevestig roetes';
$string['pathsrodataroot'] = 'Datastamgids is nie skryfbaar nie.';
$string['pathsroparentdataroot'] = 'Moedergids ({$a->parent}) is nie skryfbaar nie. Datagids ({$a->dataroot}) kan nie deur installeerder geskep word nie.';
$string['pathssubadmindir'] = 'Slegs \'n paar webgashere gebruik /admin \'n spesiale URL sodat jy toegang tot \'n kontrolepaneel of iets dergliks kan verkry. Ongelukkig bots dit met die standaardligging vir die Moodle-adminblaaie. Jy kan dit regstel deur die admingids in jou installasie te herbenaam, en daardie nuwe naam hier aan te bring. Byvoorbeeld: <em>moodleadmin</em>. Dit sal die adminskakels in Moodle regstel.';
$string['pathssubdataroot'] = '<p>\'n Gids waar Moodle alle lêerinhoud wat deur gebruikers opgelaai is, sal stoor.</p>
<p>Hierdie gids moet vir die gebruiker van die webbediener (gewoonlik \'www-data\', \'niemand\' of \'apache\') leesbaar en skryfbaar wees.</p>
</p>Dit moet nie regstreeks via die web toeganklik wees nie.</p>
<p>As die gids nie tans bestaan nie, sal die installasieproses probeer om dit te skep.</p>';
$string['pathssubdirroot'] = '<p>Die volledige roete na die gids wat die Moodle-kode bevat.</p>';
$string['pathssubwwwroot'] = '<p>Die volledige adres waar toegang tot Moodle verkry sal word, d.w.s. die adres wat gebruikers in die adresbalk van hul blaaier sal intik om toegang tot Moodle te verkry.</p>
<p>Dit is nie moontlik om toegang tot Moodle te verkry deur van veelvoudige adresse gebruik te maak nie. As jou webwerf via veelvoudige adresse toeganklik is, kies dan die maklikste een en stel \'n permanente heradressering vir elk van die ander adresse op.</p>
<p>As jou webwerf beide via die Internet en \'n interne netwerk (soms bekend as \'n Intranet) toeganklik is, gebruik dan die publieke adres hier.</p>
<p>As die huidige adres nie korrek is nie, verander asseblief die URL in jou blaaier se adresbalk en herbegin die installasie.</p>';
$string['pathsunsecuredataroot'] = 'Ligging van datastam is nie veilig nie';
$string['pathswrongadmindir'] = 'Admingids bestaan nie';
$string['phpextension'] = '{$a} PHP-uitbreiding';
$string['phpversion'] = 'PHP-weergawe';
$string['phpversionhelp'] = '<p>Moodle vereis \'n PHP-weergawe van ten minste 5.6.5 of 7.1 (7.0.x het \'n paar enjinbeperkings).</p>
<p>Jy gebruik tans weergawe {$a}.</p>
<p>Jy moet PHP opgradeer of na \'n gasheer met \'n nuwer weergawe van PHP verskuif.</p>';
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
$string['welcomep20'] = 'Jy sien hierdie blad omdat jy die <strong>{$a->packname} {$a->packversion}</strong>-pakket suksesvol geïnstalleer en op jou rekenaar laat loop het. Baie geluk!';
$string['welcomep30'] = 'Hierdie vrystelling van die <strong>{$a->installername}</strong> sluit die toepassings in om \'n omgewing te skep waarbinne <strong>Moodle</strong> gaan funksioneer, naamlik:';
$string['welcomep40'] = 'Die pakket sluit ook <strong>Moodle {$a->moodlerelease} ({$a->moodleversion})</strong> in.';
$string['welcomep50'] = 'Die gebruik van al die toepassings in hierdie pakket word beheer deur hul onderskeie lisensies. Die volledige <strong>{$a->installername}</strong>-pakket is <a href="https://www.opensource.org/docs/definition_plain.html">-oopbron</a> en word versprei onder die <a href="https://www.gnu.org/copyleft/gpl.html">GPL</a>-lisensie.';
$string['welcomep60'] = 'Die volgende blaaie gaan jou deur \'n paar maklik volgbare stappe lei om <strong>Moodle</strong> op jou rekenaar te konfigureer en op te stel. Jy kan die verstekinstellings aanvaar of, opsioneel, hulle wysig om by jou eie behoeftes te pas.';
$string['welcomep70'] = 'Klik die "Volgende"-knoppie hieronder om voort te gaan met die opstelling van <strong>Moodle</strong>.';
$string['wwwroot'] = 'Webadres';
+3 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
@@ -30,4 +29,5 @@
defined('MOODLE_INTERNAL') || die();
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'Afrikaans';
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
+7 -10
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
@@ -34,12 +33,10 @@ $string['clianswerno'] = 'لا';
$string['cliansweryes'] = 'نعم';
$string['cliincorrectvalueerror'] = 'خطأ، القيمة "{$a->value}" غير صحيحة من أجل "{$a->option}"';
$string['cliincorrectvalueretry'] = 'قيمة غير صحيحة، حاول مرة أخرى';
$string['clitypevalue'] = 'أدخل القيمة';
$string['clitypevaluedefault'] = 'أدخل القيمة أو إضغط مفتاح Enter لاستعمال القيمة الافتراضية ({$a})';
$string['cliunknowoption'] = 'خيارات غير معروفة
{$a}
الرجاء استخدام خيار المساعدة';
$string['cliyesnoprompt'] = 'أدخل y (وتعني نعم) أو n (وتعني لا)';
$string['environmentrequireinstall'] = 'يجب تنصيبه/تمكينه';
$string['clitypevalue'] = 'اكتب قيمة';
$string['clitypevaluedefault'] = 'اكتب قيمة أو اضغط زر الإدخال لاستخدام القيم الافتراضية ({$a})';
$string['cliunknowoption'] = 'خيارات غير معروفة: {$a} الرجاء استخدام -- خيار المساعدة.';
$string['cliyesnoprompt'] = 'أدخل (Y) و تعني نعم أو (N) و تعني لا';
$string['environmentrequireinstall'] = 'يجب تثبيته و تمكينه';
$string['environmentrequireversion'] = 'يتطلب الإصدار {$a->needed}، وأنت تستعمل الإصدار {$a->current}';
$string['upgradekeyset'] = 'مفتاح التحديث (اتركها فارغة إن لم ترغب بتحديده)';
+8 -9
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
@@ -30,17 +29,17 @@
defined('MOODLE_INTERNAL') || die();
$string['cannotcreatedboninstall'] = '<p>لا يمكن إنشاء قاعدة البيانات.</p>
<p>لا وجود لقاعدة البيانات المحددة والمستخدم المُعطى ليس لديه صلاحية إنشاء قاعدة البيانات.</p>
<p>مسؤول الموقع يجب أن يتحقق من إعدادات قاعدة البيانات.</p>';
$string['cannotcreatedboninstall'] = '<p> لا يمكن إنشاء قاعدة البيانات. </p>
<p> لا وجود لقاعدة البيانات المحددة والمستخدم المُعين ليس لديه إذن لإنشاء قاعدة البيانات. </ p>
<p> المسؤول عن الموقع يجب أن يتحقق من إعدادات قاعدة بيانات. </p>';
$string['cannotcreatelangdir'] = 'لا يمكن إنشاء مجلد اللغة';
$string['cannotcreatetempdir'] = 'لا يمكن إنشاء المجلد المؤقت';
$string['cannotdownloadcomponents'] = 'تعذر تنزيل المُكونات';
$string['cannotdownloadzipfile'] = 'لم يتم تحميل الملف المضغوط';
$string['cannotfindcomponent'] = 'لم يتم العثور على المكون';
$string['cannotsavemd5file'] = 'لم يتم حفظ ملف md5';
$string['cannotsavezipfile'] = 'لم يتم حفظ الملف المضغوط';
$string['cannotunzipfile'] = 'لم يتم فك الملف المضغوط';
$string['cannotsavemd5file'] = 'تعذر حفظ ملف md5';
$string['cannotsavezipfile'] = 'تعذر حفظ الملف المضغوط';
$string['cannotunzipfile'] = 'تعذر فك الملف المضغوط';
$string['componentisuptodate'] = 'العنصر محدث';
$string['dmlexceptiononinstall'] = '<p>حدث خطأ في قاعدة البيانات[{$a->errorcode}].<br />{$a->debuginfo}</p>';
$string['downloadedfilecheckfailed'] = 'فشل التحقق من الملف الذي تم تنزيله';
+5 -6
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
@@ -88,9 +87,9 @@ $string['pathsunsecuredataroot'] = 'موضع مجلد البيانات الرئ
$string['pathswrongadmindir'] = 'مجلد المشرف غير موجود';
$string['phpextension'] = 'إمتداد PHP {$a}';
$string['phpversion'] = 'إصدار PHP';
$string['phpversionhelp'] = '<p> يتطلب مودل على الاقل وجود PHP بالاصدار 5.6.5 أو 7.1 (الإصدار 7.0.x فيه بعض القيود عند التشغيل).</p>
<p> انت تستعمل حالياً الإصدار {$a}.</p>
<p> يجب عليك ترقية PHP أو الانتقال إلى مستضيف آخر لديه إصدار أحدث من PHP.</p>';
$string['phpversionhelp'] = '<p>يتطلب مودل على الأقل وجود PHP بالإصدار 5.6.5 أو 7.1 (الإصدار 7.0.x فيه بعض القيود عند التشغيل).</p>
<p>انت تستعمل حالياً الإصدار {$a}.</p>
<p>يجب عليك ترقية PHP أو الانتقال إلى مستضيف آخر لديه إصدار أحدث من PHP.</p>';
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
$string['welcomep20'] = 'أنت تشاهد هذه الصفحة لأنك تمكنت بنجاح من تنصيب وإطلاق
حزمة <strong>{$a->packname} {$a->packversion}</strong> في حاسبتك. تهانينا!';
+4 -4
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer
@@ -30,5 +29,6 @@
defined('MOODLE_INTERNAL') || die();
$string['parentlanguage'] = '';
$string['thisdirection'] = 'rtl';
$string['thislanguage'] = 'عربي';
$string['thislanguage'] = 'العربية';
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -13,7 +12,7 @@
// 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/>.
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Automatically generated strings for Moodle installer

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