Compare commits

...

634 Commits

Author SHA1 Message Date
Jun Pataleta 3c33177dd2 Moodle release 3.10.11 2022-05-07 19:34:45 +08:00
Eloy Lafuente (stronk7) 4120b71be6 weekly release 3.10.10+ 2022-05-06 15:58:40 +02:00
Eloy Lafuente (stronk7) 519e708127 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-05-06 15:58:38 +02:00
Víctor Déniz d91780c1b6 Merge branch 'MDL-74612-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2022-05-05 13:26:26 +01:00
Jake Dallimore eabd853d0f MDL-73736 core_auth: Fix concurrency issue in login_attempt_failed()
This patch wraps the login_failed_count logic in a resource lock and
forces a user preferences cache reload. Each thread must wait for the
lock and must fetch the current count before incrementing it. This
ensures that login_failed_count is correct across threads and that the
lockout threshold is correctly honoured.

Co-Authored-By: Sujith Haridasan <sujith@moodle.com>
2022-05-04 16:28:04 +06:00
Michael Hawkins e294189099 MDL-74333 badges: Check profile criteria valid when reviewing 2022-05-04 12:58:29 +08:00
Ferran Recio 977f196c11 MDL-71623 core_search: fix user document visibility 2022-05-02 16:41:41 +06:00
Paul Holden c6e412ab60 MDL-74612 cohort: use data generator for populating cohort members. 2022-04-29 16:23:41 +01:00
AMOS bot 2eecdbaab6 Automatically generated installer lang files 2022-04-23 00:07:30 +00:00
AMOS bot 2647dabbab Automatically generated installer lang files 2022-04-12 00:07:31 +00:00
Amaia Anabitarte 27723d2ec9 MDL-74318 core_user: Description field as hidden on profile 2022-04-08 12:44:17 +02:00
Paul Holden 7e24859635 MDL-74204 mod_assign: escape identity fields in allocate marker form. 2022-04-08 12:44:16 +02:00
Ilya Tregubov 51206b0790 weekly release 3.10.10+ 2022-04-08 16:39:55 +06:00
Ilya Tregubov 0759e2fc12 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-04-08 16:39:55 +06:00
AMOS bot 8c1efcbcbf Automatically generated installer lang files 2022-04-07 00:07:28 +00:00
Víctor Déniz ab2231f94d Merge branch 'MDL-74189-310' of https://github.com/mihailges/moodle into MOODLE_310_STABLE 2022-04-06 22:56:50 +01:00
Mihail Geshoski d47c96ed35 MDL-74189 tool_moodlenet: Add upgrade step to remove irrelevant data
Upgrade step to identify all existing cases where users have linked
their MoodleNet profile on the site and remove the related data from
the database. Due to some recent changes on the MoodleNet platform,
this data is now irrelevant and can no longer be used to authenticate
on the MoodleNet platform.
2022-04-06 23:41:19 +08:00
Mihail Geshoski 66fc5bbf77 MDL-74189 tool_moodlenet: Update language strings
Updates the existing language strings in order to provide more accurate
instructions on how users can link existing their MoodleNet profile on
the site.
2022-04-06 23:41:19 +08:00
AMOS bot ca097ab63e Automatically generated installer lang files 2022-04-06 00:07:26 +00:00
Sara Arjona c56a642260 weekly release 3.10.10+ 2022-04-05 13:24:51 +02:00
Sara Arjona ec8a7f4b9c Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-04-05 13:24:51 +02:00
Jun Pataleta d0e8babdca Merge branch 'MDL-70014_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2022-04-04 13:56:14 +08:00
Jun Pataleta e4457963f0 Merge branch 'MDL-74096-310' of https://github.com/ilyatregubov/moodle into MOODLE_310_STABLE 2022-04-04 13:05:36 +08:00
Ilya Tregubov db50738df0 MDL-74096 mlbackend_python: Update mlbackend version. 2022-04-04 09:17:49 +06:00
AMOS bot 732383048f Automatically generated installer lang files 2022-04-04 00:07:25 +00:00
Eloy Lafuente (stronk7) 8b372e611e MDL-70014 tool_customlang: Workaround to make behat happier
This is a BEHAT_RUNNING only hack, so it doesn't affect normal
operations at all. What it achieves is to reduce the number of
strings loaded when customising a lang pack from current 31K ones
to the just needed ones for Behat testing purposes.

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

Also, unrelated, a couple of tiny changes:
- Modified constant (that was really outdated) to current number
  of lang strings (so the progress bar behaves better).
- Remove an elseif occurrence because it was hurting my eyes.
2022-04-01 23:57:17 +02:00
Sara Arjona bb1b6fd5e8 weekly release 3.10.10+ 2022-04-01 16:40:50 +02:00
Sara Arjona 6966a51f15 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-04-01 16:40:49 +02:00
Andrew Nicols 7ef52704de Merge branch 'MDL-72446_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2022-03-31 22:34:05 +08:00
Eloy Lafuente (stronk7) cb050b49f8 MDL-72446 behat: Ensure that the day reset happens on enabled element
Before this change we were setting the month day to 1 unconditionally
and that was working ok for enabled by default elements.

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

Backed with tests using disabled form elements, so we have now
both enabled and disabled fields covered.
2022-03-31 12:23:46 +02:00
AMOS bot 56a1925885 Automatically generated installer lang files 2022-03-31 00:07:28 +00:00
AMOS bot 16186b6e5d Automatically generated installer lang files 2022-03-26 00:07:24 +00:00
Víctor Déniz 9a5aedeb3c weekly release 3.10.10+ 2022-03-25 15:00:31 +00:00
Víctor Déniz 60f6a0b35b Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-03-25 15:00:30 +00:00
AMOS bot 5303132a08 Automatically generated installer lang files 2022-03-23 00:07:22 +00:00
Sara Arjona ff695e069e MDL-74184 behat: Unrelated, remove the @skip_interim tag
This commit is UNRELATED to the MDL-74184, but we need the
@skip_interim tag removed to a couple of scenarios that were
causing lots of noise and failures @ci infrastructure.
MDL-74265 was created to deal with this issue but these jobs
are now passing, and nothing has been changed...

So we are using MDL-74184 (this extra commit) to remove that
tag (sorry for the noise).
2022-03-22 17:24:34 +01:00
AMOS bot d3017ef9b3 Automatically generated installer lang files 2022-03-22 00:07:25 +00:00
Sara Arjona 1d9394a73c weekly release 3.10.10+ 2022-03-18 16:28:20 +01:00
Sara Arjona ac166e5e0f MDL-74116 behat: Unrelated, add the @skip_interim tag
This commit is UNRELATED to the MDL-74116, but we need the
@skip_interim tag added to a couple of scenarios that are
causing lots of noise and failures  @CI infrastructure.
MDL-74265 has been created to deal with this issue.

So we are using MDL-74116 (this extra commit) to add that tag
(sorry for the noise).
2022-03-18 13:46:32 +01:00
Eloy Lafuente (stronk7) e050328677 Merge branch 'MDL-74116-310' of https://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2022-03-16 22:19:36 +01:00
Andrew Nicols 5f4c92404c MDL-74116 behat: Fix browser instantiation for Selenium 4 2022-03-16 22:29:00 +08:00
Sara Arjona 7f273e3905 Merge branch 'MDL-74130_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2022-03-15 12:19:26 +01:00
Jun Pataleta 4495c3351c Moodle release 3.10.10 2022-03-12 12:39:19 +08:00
Jun Pataleta f72fea5dcf Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-03-12 12:39:18 +08:00
AMOS bot 8b90c334d5 Automatically generated installer lang files 2022-03-12 00:07:25 +00:00
Ilya Tregubov 3a515cc067 weekly release 3.10.9+ 2022-03-11 16:19:52 +06:00
Tim Hunt 2b13b00703 MDL-74130 question behat: Update tests to use the new navigation steps 2022-03-10 12:09:13 +00:00
Tim Hunt 49f8c0213f MDL-74130 question behat: support I am on ... page or key qbank pages 2022-03-10 09:31:13 +00:00
Jake Dallimore ef376a6793 Merge branch 'MDL-73899-310' of https://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2022-03-10 15:35:04 +08:00
Amaia Anabitarte 3b47042a4a MDL-74075 core_badges: Check accepted criterias 2022-03-09 12:31:47 +01:00
Michael Hawkins 6b670477f7 MDL-74074 badges: Ensure profile criteria exists before completion check 2022-03-08 12:07:58 +00:00
Paul Holden 4a625b5b78 MDL-72972 tool_uploaduser: observe capability to delete users. 2022-03-08 10:04:28 +01:00
cescobedo 2d5f48e2dd MDL-71722 h5plib_v124: Add required changes after lib upgrade 2022-03-08 10:04:28 +01:00
cescobedo c92c3c3f61 MDL-71722 h5plib_v124: Upgrade ckeditor to 4.17.1 2022-03-08 10:04:28 +01:00
Ilya Tregubov 7b2d71da98 MDL-71703 lib: update phpmailer to 6.5.3 2022-03-08 10:04:28 +01:00
Eloy Lafuente (stronk7) 87776ba114 weekly release 3.10.9+ 2022-03-08 10:02:01 +01:00
Eloy Lafuente (stronk7) 629922ff59 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-03-08 10:02:00 +01:00
Eloy Lafuente (stronk7) 82b8735c48 Merge branch 'MDL-74042-310' of https://github.com/jleyva/moodle into MOODLE_310_STABLE 2022-03-04 12:20:28 +01:00
Juan Leyva bd8c5d8afd MDL-74042 vimeo: Support security hash for restricted videos 2022-03-01 13:33:00 +01:00
AMOS bot f25e9da915 Automatically generated installer lang files 2022-03-01 00:07:31 +00:00
AMOS bot 695b7f4c07 Automatically generated installer lang files 2022-02-26 00:07:31 +00:00
Ilya Tregubov 78c9316c3c weekly release 3.10.9+ 2022-02-25 19:23:43 +02:00
Ilya Tregubov 035dfeecdd Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-02-25 19:23:43 +02:00
Jun Pataleta f74b3efbe0 Merge branch 'MDL-73915-310-terser' of https://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2022-02-24 16:56:13 +08:00
AMOS bot 4a4084f432 Automatically generated installer lang files 2022-02-24 00:07:31 +00:00
Andrew Nicols eaf5ab0793 MDL-73899 behat: Fix coding style issues to change third-party status
This commit removes the moodle-behat-extension from the list of
third-party libraries.

In order to do this properly, all pending coding-style issues are fixed.
In addition the following niceties have also been included:
* convert long form array() syntax to short form
* alphabetically sort class imports (use)
* remove unused class imports
* correct documentation
* Normalise whitespace in concat operators
* Remove unnecessary file docblocks
2022-02-23 08:19:30 +08:00
Sara Arjona e0e8802023 weekly release 3.10.9+ 2022-02-22 11:12:54 +01:00
Sara Arjona 7291454129 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-02-22 11:12:53 +01:00
Andrew Nicols 2528569425 MDL-73915 js: Switch amd minification to terser
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.

Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.

Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.

The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.

Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
2022-02-22 14:16:08 +08:00
Andrew Nicols 26a5300b6b MDL-73915 js: Upgrade babel and eslint 2022-02-22 14:16:04 +08:00
Sara Arjona 787687a19c Merge branch 'MDL-73883-310' of https://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2022-02-21 15:35:27 +01:00
AMOS bot af54ee60be Automatically generated installer lang files 2022-02-21 00:07:31 +00:00
Sara Arjona 7517c55f1d weekly release 3.10.9+ 2022-02-18 15:03:43 +01:00
Sara Arjona cd1d6c2aa0 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-02-18 15:03:42 +01:00
Andrew Nicols cbc811f039 MDL-73915 js: Upgrade packages 2022-02-18 08:41:02 +08:00
Andrew Nicols b74c2d4890 MDL-73915 js: Switch to nodejs lts/gallium 2022-02-18 08:26:17 +08:00
Andrew Nicols b62f0258b3 MDL-73915 js: Upgrade node-sass 2022-02-18 08:21:01 +08:00
AMOS bot 17979c5200 Automatically generated installer lang files 2022-02-17 00:07:28 +00:00
Sara Arjona bac7569b82 Merge branch 'MDL-72762_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2022-02-16 11:50:24 +01:00
Andrew Nicols f4955d77fc MDL-73883 behat: Display actual step during testing
Because of the way in which we check for exceptions, we always show the
following string during behat pretty output:

    behat_hooks::i_look_for_exceptions()

We can easily modify this to only show this value when the
i_look_for_exceptions() test itself fails, but otherwise to show the
actual step that is run.
2022-02-15 15:01:28 +08:00
AMOS bot b7d7a055ee Automatically generated installer lang files 2022-02-10 00:07:46 +00:00
AMOS bot 173a8f68eb Automatically generated installer lang files 2022-02-09 00:07:31 +00:00
Eloy Lafuente (stronk7) 9b085ae35e MDL-72762 backup: Accept empty and whitespace-only UI labels.
This was causing problems when sections or activity names where
set to be empty or whitespace-only, with the PARAM_CLEANHTML
leading to exception.

Now they are supported and handled like &nbsp; (0xc2a0) to
allow the process to continue.

Added a few extra tests to confirm the behaviour.
2022-02-07 15:59:13 +01:00
Sara Arjona 2c45077ae5 weekly release 3.10.9+ 2022-02-04 18:18:32 +01:00
Sara Arjona cad93ab90e Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-02-04 18:18:31 +01:00
Jun Pataleta d520264814 Merge branch 'MDL-73711_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2022-02-03 11:14:44 +08:00
Eloy Lafuente (stronk7) 95a3759f18 MDL-73711 behat: Bump to Behat 3.10.x
Generated with php72, following the instructions at:

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

Note this also comes with a minor PHPUnit bump to 8.5.23.
2022-01-29 16:21:44 +01:00
AMOS bot 361ba37179 Automatically generated installer lang files 2022-01-29 00:07:26 +00:00
Ilya Tregubov 85045cc9d4 weekly release 3.10.9+ 2022-01-28 20:17:01 +02:00
Ilya Tregubov 9243089573 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-01-28 20:17:01 +02:00
Sara Arjona f63a38260b Merge branch 'MDL-73588_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2022-01-27 17:06:13 +01:00
Eloy Lafuente (stronk7) 6bfb557169 MDL-73588 phpunit: Fix assertion to PHPUnit 8.5 one
This issue was backported from 311_STABLE that uses
PHPUnit 9.5, were the regexp assertion was renamed.

This just moves it back to the 8.5 one for 39 and 310 stables.
2022-01-27 16:12:53 +01:00
Frode Petterson 1a03e46f96 MDL-73588 curl: Fix expected CURLOPT_FILE behavior
After cbf9dfb the CURLOPT_FILE no longer behaves as expected. All
redirect responses are appended to the same stream resource.  This fix
reverts back to the old behavior by setting the stream pointer back to
the beginning for each subsequent redirect.
2022-01-27 12:18:26 +01:00
AMOS bot 9e5569b89d Automatically generated installer lang files 2022-01-26 00:07:33 +00:00
Sara Arjona 996bea908e weekly release 3.10.9+ 2022-01-21 15:00:52 +01:00
Sara Arjona f0713bab89 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-01-21 15:00:51 +01:00
Jun Pataleta f13a8dcef7 Merge branch 'MDL-73021-310' of git://github.com/andelacruz/moodle into MOODLE_310_STABLE 2022-01-21 11:18:28 +08:00
AMOS bot 6aff2b7c8d Automatically generated installer lang files 2022-01-21 00:07:36 +00:00
AMOS bot 322c3d3bae Automatically generated installer lang files 2022-01-19 00:07:32 +00:00
Eloy Lafuente (stronk7) bdb0364a3d Moodle release 3.10.9 2022-01-15 12:14:14 +01:00
Sara Arjona 52ddc92739 weekly release 3.10.8+ 2022-01-14 11:14:06 +01:00
Sara Arjona a2eb0d703b Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-01-14 11:14:06 +01:00
Paul Holden 261bcced5b MDL-72772 gradereport_overview: account for users with parent roles. 2022-01-12 14:19:45 +01:00
Eloy Lafuente (stronk7) eb4b0ac719 Merge branch 'MDL-70348-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2022-01-12 10:18:05 +01:00
Paul Holden b76e653518 MDL-72772 gradereport_overview: access checks for viewing grades. 2022-01-12 13:44:09 +08:00
AMOS bot 715fbb88c5 Automatically generated installer lang files 2022-01-12 00:07:34 +00:00
Paul Holden 46e45e7a64 MDL-72367 badges: require sesskey to remove badge alignment. 2022-01-11 14:34:16 +01:00
Dongsheng Cai 1b2ec27efc MDL-71239 calendar: disallow manager role users edit user events 2022-01-11 14:34:16 +01:00
Jun Pataleta bd7f72c777 weekly release 3.10.8+ 2022-01-11 21:29:59 +08:00
Jun Pataleta 70b9287643 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2022-01-11 21:29:58 +08:00
Jun Pataleta bd2a63dc74 Merge branch 'MDL-69061-310' of https://github.com/junpataleta/moodle into MOODLE_310_STABLE 2022-01-11 11:56:38 +08:00
Adam Pawełczak de33b20c79 MDL-69061 core: Fix admin path replacement with path to $CFG->admin 2022-01-11 11:33:54 +08:00
AMOS bot 14fc6d807f Automatically generated installer lang files 2022-01-11 00:07:28 +00:00
AMOS bot d41932a504 Automatically generated installer lang files 2022-01-08 00:07:25 +00:00
Shamim Rezaie 622ea0d721 Merge branch 'MDL-73272/3.10' of https://github.com/skodak/moodle into MOODLE_310_STABLE 2022-01-07 17:46:12 +11:00
AMOS bot 01bd38278b Automatically generated installer lang files 2022-01-07 00:07:33 +00:00
Ilya Tregubov a9e8056784 weekly release 3.10.8+ 2022-01-06 20:50:52 +02:00
Jun Pataleta e484778b3e Merge branch 'MDL-69700-310' of https://github.com/junpataleta/moodle into MOODLE_310_STABLE 2022-01-06 12:01:13 +08:00
Paul Holden 46b42dd297 MDL-69700 tests: clarify expected exceptions in unit tests.
Resolves some leftovers from MDL-67673, see d95c3787.
2022-01-06 11:43:03 +08:00
Petr Skoda 3f62bef6a6 MDL-73272 behat: move behat extension to core 2021-12-31 09:50:42 +13:00
Sara Arjona 4e79bd7530 weekly release 3.10.8+ 2021-12-30 11:24:14 +01:00
Sara Arjona fa3d437a07 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-12-30 11:24:13 +01:00
AMOS bot cb5c97043b Automatically generated installer lang files 2021-12-30 00:07:22 +00:00
AMOS bot afe05bf9f6 Automatically generated installer lang files 2021-12-28 00:07:21 +00:00
Víctor Déniz 434955ccf1 Merge branch 'MDL-73269/3.10' of https://github.com/skodak/moodle into MOODLE_310_STABLE 2021-12-27 15:26:14 +00:00
AMOS bot 121d43c8e3 Automatically generated installer lang files 2021-12-27 00:07:24 +00:00
AMOS bot ad884ebc90 Automatically generated installer lang files 2021-12-26 00:07:21 +00:00
Sara Arjona 5a042a256b weekly release 3.10.8+ 2021-12-23 16:29:44 +01:00
Sara Arjona 1dc92804be Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-12-23 16:29:43 +01:00
Jun Pataleta 23bb57ec47 Merge branch 'MDL-72701-310' of https://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-12-23 12:10:59 +08:00
AMOS bot f91a523dcc Automatically generated installer lang files 2021-12-23 00:07:23 +00:00
Petr Skoda fc764a1b23 MDL-73269 dev: add requirements to composer.json 2021-12-23 07:24:33 +13:00
Sara Arjona 3fbee249bf Merge branch 'MDL-73405_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-12-22 17:20:58 +01:00
Angelia Dela Cruz 078a510ed2 MDL-73021 behat: Use assign generators
Replace steps that manually add assignment instances via the UI
and use Behat generators. This improves the speed of Behat test
runs.
2021-12-22 15:07:32 +08:00
AMOS bot 856e46c884 Automatically generated installer lang files 2021-12-22 00:07:26 +00:00
Andrew Nicols 3235ad2a37 MDL-72701 unit tests: Fix broken @covers annotations 2021-12-21 09:24:06 +08:00
AMOS bot af2e3bc4df Automatically generated installer lang files 2021-12-21 00:07:23 +00:00
Shamim Rezaie 94a17a6b82 Merge branch 'MDL-73175-310' of https://github.com/NoelDeMartin/moodle into MOODLE_310_STABLE 2021-12-20 11:00:40 +11:00
Eloy Lafuente (stronk7) 464f2ea460 MDL-73405 phpunit: dataset fixes
This was detected when working in the renaming of test names:
- Fix file name, it was incorrectly named .test.php, now _test.php.
- Add namespace and rename testcase name to match file name.
- Fix php80 deprecation message about optional and required params
  order.
2021-12-19 12:52:49 +01:00
AMOS bot 1b47cc00bb Automatically generated installer lang files 2021-12-19 00:07:22 +00:00
Noel De Martin 2e88f5385e MDL-73175 mod_glossary: Add behat generators 2021-12-17 07:52:27 +01:00
Paul Holden 2932170119 MDL-70348 core: fix upgrade note referring to $CFG->localrequestdir.
The change in 9fabe1dd referred to incorrect config property.
2021-12-15 08:56:35 +00:00
AMOS bot 5be8691162 Automatically generated installer lang files 2021-12-15 00:07:23 +00:00
Ilya Tregubov 6d35e4a7c2 weekly release 3.10.8+ 2021-12-14 17:42:59 +02:00
Ilya Tregubov 1a684e2af2 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-12-14 17:42:59 +02:00
AMOS bot 5160019c8c Automatically generated installer lang files 2021-12-13 00:07:22 +00:00
AMOS bot 142e789a1d Automatically generated installer lang files 2021-12-12 00:07:20 +00:00
AMOS bot 220f5ab3a0 Automatically generated installer lang files 2021-12-11 00:07:23 +00:00
Ilya Tregubov 489b23ffa1 Merge branch 'MDL-73278_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-12-10 18:52:20 +02:00
AMOS bot 855f45838d Automatically generated installer lang files 2021-12-10 00:07:21 +00:00
Eloy Lafuente (stronk7) 035f282739 MDL-73278 phpunit: Add missing payment subsystem and fix dataprovider
While testing the changed unit tests one by one, the
payment/tests/helper_test.php was failing because of a mismatch
between the dataProvider data and the param type.

That made me think why that error was not popping in complete runs
and the answer is that the new (3.10) subsystem is not in the
phpunit.xml.dist file.

Hence, adding it and fixing the dataProvider mismatch.

Finally, it has been detected that some old ICU versions (< 62)
have an incorrect behaviour, not adding the required non-breaking
white-space between the currency abbreviation and the value. So
we are skipping some payment tests if that's found.
2021-12-09 10:39:37 +01:00
AMOS bot e074f62ca3 Automatically generated installer lang files 2021-12-09 00:07:18 +00:00
Ilya Tregubov 2e98ffb59d weekly release 3.10.8+ 2021-12-07 14:59:44 +02:00
Ilya Tregubov 20e865ad07 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-12-07 14:59:43 +02:00
Jun Pataleta a501c7520a Merge branch 'MDL-73202-310' of https://github.com/NoelDeMartin/moodle into MOODLE_310_STABLE 2021-12-07 10:38:41 +08:00
AMOS bot 560afbe855 Automatically generated installer lang files 2021-12-07 00:07:24 +00:00
Eloy Lafuente (stronk7) d9d5d01201 Merge branch 'MDL-73253-310' of https://github.com/vmdef/moodle into MOODLE_310_STABLE 2021-12-03 18:52:43 +01:00
Víctor Déniz 62dd86c8a8 MDL-73253 ci: use setup-node action in GHA 2021-12-03 16:07:07 +00:00
Sara Arjona c86c9797b3 weekly release 3.10.8+ 2021-12-03 10:26:34 +01:00
Andrew Nicols 4be6379b25 Merge branch 'MDL-73195-310' of https://github.com/lameze/moodle into MOODLE_310_STABLE 2021-12-03 14:19:22 +08:00
Andrew Nicols eaf44f06d6 Merge branch 'MDL-72846-310' of https://github.com/NoelDeMartin/moodle into MOODLE_310_STABLE 2021-12-03 08:30:23 +08:00
Eloy Lafuente (stronk7) 57c7cd7c22 Merge branch 'MDL-72728-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-12-02 18:57:24 +01:00
Noel De Martin 3dcae6c702 MDL-72846 testing: Add default block generators 2021-12-02 14:57:05 +01:00
Jun Pataleta 708a613e94 Merge branch 'MDL-72785-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-12-02 17:06:23 +08:00
Simey Lameze c82692e7a8 MDL-73195 mod_url: prevent invalid urls from breaking the course 2021-12-02 16:58:27 +08:00
Andrew Nicols e8d99e4b76 Merge branch 'MDL-73070_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-12-02 11:24:47 +08:00
Eloy Lafuente (stronk7) ceae073d1d weekly release 3.10.8+ 2021-11-30 19:01:17 +01:00
Eloy Lafuente (stronk7) bd20aea403 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-11-30 19:01:16 +01:00
Noel De Martin 83954781a9 MDL-73202 mod_forum: Add behat generators 2021-11-30 10:08:13 +01:00
Jun Pataleta 1b8a325038 Merge branch 'MDL-70274-310-2' of https://github.com/lameze/moodle into MOODLE_310_STABLE 2021-11-29 12:25:32 +08:00
Simey Lameze ada5c7e6af MDL-70274 core: fix Validate HTML and WCAG Check links 2021-11-29 12:24:09 +08:00
AMOS bot df2a779dba Automatically generated installer lang files 2021-11-27 00:07:32 +00:00
Paul Holden 3e965458f0 MDL-72728 behat: switch import course steps to native execute method.
The previous iteration using the behat_form_field class directly
didn't explicitly require the file that defines this class, and in
Goutte runs this led to fatal errors (class not found).
2021-11-26 19:07:53 +00:00
Paul Holden 85a741a6f6 MDL-72785 course: remove double validation during category deletion.
Fixes issue from 0645319e that meant the category "Move into" field
was required even when user selected to "Delete all content".
2021-11-26 11:14:57 +00:00
AMOS bot a5e4d03df8 Automatically generated installer lang files 2021-11-25 00:07:21 +00:00
Tim Hunt 8a762403bd MDL-73070 Behat: stop using no-longer-existant classes in behat_hooks 2021-11-23 10:59:48 +00:00
Eloy Lafuente (stronk7) c942855732 weekly release 3.10.8+ 2021-11-19 19:15:30 +01:00
Eloy Lafuente (stronk7) 035de9a5f4 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-11-19 19:15:29 +01:00
AMOS bot 2dcea341d7 Automatically generated installer lang files 2021-11-19 00:07:22 +00:00
Eloy Lafuente (stronk7) 7f20a0b509 Merge branch 'MDL-71882-310' of https://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-11-18 23:48:32 +01:00
AMOS bot bc1dbf8323 Automatically generated installer lang files 2021-11-18 00:07:20 +00:00
Andrew Nicols e4cc11f11a MDL-71882 grunt: Replace module names
When a third-party AMD module is provided with an included name we must
replace it with a name that we are able to use.

The structure of an AMD module define function is:

    [name], [dependencies], [callback]
    String, Array,          Function

Each of these is (strangely) optional.

We know that the name is the only String and will always be the first,
and we can use AST to remove a provided name before adding the
Moodle-specific name.

This should be a safe change and not lead to any changes in built code,
but will make it easier to include third-party code.

An additional logging line is also included to inform developers that a
change was made.
2021-11-17 09:20:54 +08:00
AMOS bot 5de0c8c99d Automatically generated installer lang files 2021-11-17 00:07:24 +00:00
Eloy Lafuente (stronk7) bcb3b58f22 weekly release 3.10.8+ 2021-11-16 14:00:01 +01:00
Eloy Lafuente (stronk7) 76e6c563f4 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-11-16 13:59:59 +01:00
AMOS bot 9602d39728 Automatically generated installer lang files 2021-11-16 00:07:21 +00:00
Eloy Lafuente (stronk7) 872ab24bc3 Merge branch 'MDL-72096-310' of https://github.com/mickhawkins/moodle into MOODLE_310_STABLE 2021-11-15 19:13:54 +01:00
Michael Hawkins 281f826009 MDL-72096 core: Add safe ORDER BY helpers for db sorting from user input
The new get_safe_orderby() and get_safe_orderby_multiple() methods
provide a centralised safe way for user submitted sorting values to be
incorporated into SQL ORDER BY. They do this by removing the need for
user submitted data to pass in any SQL and not allowing arbitrary
column values, instead using string keys which map to a predefined
list of allowed sortable columns.
2021-11-15 19:50:42 +08:00
Eloy Lafuente (stronk7) 61209fdec1 weekly release 3.10.8+ 2021-11-12 13:40:37 +01:00
Eloy Lafuente (stronk7) ee9e1b9b64 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-11-12 13:40:35 +01:00
Eloy Lafuente (stronk7) b33da0a812 Merge branch 'MDL-72696-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-11-10 19:21:20 +01:00
AMOS bot acc141535c Automatically generated installer lang files 2021-11-09 00:07:24 +00:00
Paul Holden 9bd876e243 MDL-72696 behat: support inplace editable fields of type select.
If an inplace editable field is using the "select" type, we should
treat it as a select field when setting it's value during scenarios.
2021-11-08 13:12:33 +00:00
Eloy Lafuente (stronk7) 08534dff50 Moodle release 3.10.8 2021-11-06 10:34:22 +01:00
Ilya Tregubov b6936f521b weekly release 3.10.7+ 2021-11-05 19:18:36 +02:00
Ilya Tregubov bf29fabccd Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-11-05 19:18:35 +02:00
Huong Nguyen 05ffb4680d MDL-71918 Calendar: Improve capability checks when fetching events 2021-11-05 13:16:04 +08:00
Jun Pataleta 47a3349629 Merge branch 'MDL-72667-310-fix' of https://github.com/lameze/moodle into MOODLE_310_STABLE 2021-11-05 12:45:04 +08:00
Simey Lameze 2cc0e5e744 MDL-72667 assign: change overdue message to darker red 2021-11-05 12:42:23 +08:00
Jun Pataleta 064306fd31 Merge branch 'MDL-72679-310' of git://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2021-11-05 12:41:01 +08:00
Andrew Nicols 03430b4e2f Merge branch 'MDL-72990-310' of https://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-11-05 11:58:52 +08:00
Andrew Nicols 415de33156 MDL-71439 core_grade: Coding style tidyup 2021-11-05 11:33:34 +08:00
Andrew Nicols 41a4a08a07 Merge branch 'MDL-71439_310' of https://github.com/mdjnelson/moodle into MOODLE_310_STABLE 2021-11-05 11:33:27 +08:00
Jun Pataleta 33e0235236 Merge branch 'MDL-72688-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-11-05 11:23:50 +08:00
Víctor Déniz 10477794b9 Merge branch 'MDL-72945-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-11-05 01:48:04 +00:00
Shamim Rezaie c562f8bb87 MDL-72688 contentbank: Some accessibility improvements described below
- Label the table/list with aria-label
- Hide sort buttons from screen-readers and use aria-sort instead
- Remove the redundant title from decorative thumbnails
2021-11-05 12:43:52 +11:00
Shamim Rezaie f9053d932e MDL-72688 contentbank: Add and maintain appropriate aria roles
Also moved header text into the sorting button as per the example at
https://dequeuniversity.com/library/aria/table-sortable
2021-11-05 12:38:32 +11:00
Víctor Déniz 47e5bf72af Merge branch 'MDL-72969-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-11-05 01:20:10 +00:00
AMOS bot ba40dbce29 Automatically generated installer lang files 2021-11-05 00:07:22 +00:00
Jun Pataleta 55f08b61ca Merge branch 'MDL-72667-310' of https://github.com/lameze/moodle into MOODLE_310_STABLE 2021-11-04 22:06:10 +08:00
Simey Lameze 17f1558a63 MDL-72667 message: fix contrast issue in the drawer 2021-11-04 21:21:12 +08:00
Simey Lameze 623b759934 MDL-72667 notifications: improve colour contrast 2021-11-04 21:21:11 +08:00
Simey Lameze 2afc498820 MDL-72667 lesson: improve colour contrast of correct text 2021-11-04 21:20:33 +08:00
Simey Lameze bee3b5656a MDL-72667 assign: improve contrast of not graded text 2021-11-04 21:20:33 +08:00
Jun Pataleta 6e8eb03e59 Merge branch 'MDL-72672-310' of https://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-11-04 18:23:10 +08:00
Simey Lameze cb57a6569a MDL-72672 lesson: make edit collapsed table responsive 2021-11-04 18:20:54 +08:00
Simey Lameze 898dbbb0ed MDL-72672 lesson: make detailed stats table responsive 2021-11-04 18:20:53 +08:00
Simey Lameze 9d83452a4c MDL-72672 lesson: make attempts table responsive 2021-11-04 18:20:52 +08:00
Simey Lameze fa90465f37 MDL-72672 lesson: add label for true/false checkboxes 2021-11-04 18:20:50 +08:00
Simey Lameze 4546974e30 MDL-72672 lesson: add label for multichoice checkboxes 2021-11-04 18:20:49 +08:00
Simey Lameze 516ca4373d MDL-72672 lesson: remove unnecessary nowrap
This commit also remove some deprecated table properties as well.
2021-11-04 18:20:48 +08:00
Simey Lameze baa337515e MDL-72672 mod_lesson: add aria-label to actions select element 2021-11-04 18:20:47 +08:00
Sara Arjona 1e9568597f Merge branch 'MDL-72949-310' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-11-04 10:33:41 +01:00
Nathan Nguyen e10cbb53f6 MDL-72679 qtype_ddmarker: Fix incorrect positions in multiple viewportss
Co-authored-by: Huong Nguyen <huongnv13@gmail.com>
2021-11-04 14:44:48 +07:00
Jun Pataleta c5cd2bbb13 Merge branch 'MDL-72668-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-11-04 12:04:27 +08:00
Shamim Rezaie 0843836725 MDL-72990 badges: Use imagecaption as alternative text for badge image 2021-11-04 15:04:14 +11:00
Shamim Rezaie b9a9967996 MDL-72668 block_badges: Add alt attribute to badge images 2021-11-04 14:20:10 +11:00
Shamim Rezaie 105cd1d7a0 MDL-72668 core: Highlight the focused tree item in a tree. 2021-11-04 14:20:10 +11:00
Shamim Rezaie 2d3e43ec62 MDL-72668 block_private_files: Switched from YUI to core/tree AMD 2021-11-04 14:20:07 +11:00
Víctor Déniz df9d3c744f Merge branch 'MDL-72895-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-11-04 01:50:56 +00:00
Paul Holden e36157f765 MDL-70823 qtype_ddwtos: new method for safer feedback unserializing. 2021-11-03 16:57:24 +01:00
Paul Holden f43285a28d MDL-70823 mod: safely parse module display options array. 2021-11-03 16:57:24 +01:00
Paul Holden f18f500a11 MDL-70823 blocks: safer unserializing during block restore. 2021-11-03 16:57:24 +01:00
Paul Holden dd66a550cb MDL-70823 core: safer alternative for unserializing objects. 2021-11-03 16:57:24 +01:00
sangnguyena 802f1a7a87 MDL-72949 WS: Return coursegraceperiod setting in tool_mobile_get_config 2021-11-03 16:09:53 +07:00
Ilya Tregubov 90a83f1ef3 Merge branch 'MOODLE_310_MDL-72953' of https://github.com/golenkovm/moodle into MOODLE_310_STABLE 2021-11-03 10:35:50 +02:00
Andrew Nicols 209f4292fc MDL-72894 courseexport: Whitespace fix 2021-11-03 16:12:01 +08:00
Andrew Nicols 34696d4a36 Merge branch 'MDL-72894-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-11-03 16:11:55 +08:00
Sara Arjona 46f2c2471f Merge branch 'MDL-72977-310' of https://github.com/juancs/moodle into MOODLE_310_STABLE 2021-11-03 09:04:07 +01:00
Ilya Tregubov 662639ba34 Merge branch 'MDL-71872-310' of https://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2021-11-03 09:27:39 +02:00
Jun Pataleta 106ac6b81e Merge branch 'MDL-72687-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-11-03 11:57:22 +08:00
Mikhail Golenkov 1b158e1e45 MDL-72953 core_lang: Add string for new timezone Pacific/Kanton 2021-11-03 11:40:10 +11:00
AMOS bot 4251c2a010 Automatically generated installer lang files 2021-11-03 00:07:22 +00:00
Paul Holden fc42ef155a MDL-72370 badges: require sesskey to remove related badge. 2021-11-02 18:04:16 +01:00
Ilya Tregubov faabe30597 MDL-70887 mlbackend_python: Update to latest version. 2021-11-02 18:04:16 +01:00
Simey Lameze 1dcb4f9aa3 MDL-72571 tool_filetypes: change extension param to PARAM_ALPHANUMEXT 2021-11-02 18:04:16 +01:00
Sara Arjona 4d084e8a11 Merge branch 'MDL-72857-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-11-02 18:01:41 +01:00
Eloy Lafuente (stronk7) 58f859fda6 weekly release 3.10.7+ 2021-11-02 14:07:57 +01:00
Eloy Lafuente (stronk7) ebfa38561a Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-11-02 14:07:56 +01:00
Juan Segarra Montesinos 297edf518d MDL-72977 qtype_essay: Honor Information for graders text format. 2021-11-02 12:22:22 +01:00
Simey Lameze f6eddf3ef8 MDL-72687 assign: move labels for toggle zoom icons to the <a> 2021-11-02 13:56:57 +08:00
Simey Lameze 4b2d40ec24 MDL-72687 assign: move labels for collapse buttons to the button 2021-11-02 13:56:57 +08:00
Simey Lameze 6fc89d13f2 MDL-72687 assign: remove title attr from view all submissions link 2021-11-02 13:56:56 +08:00
Simey Lameze 6b5eb6c2f4 MDL-72687 assign: move label from the edit settings icon to <a> 2021-11-02 13:56:56 +08:00
Simey Lameze 5ab92e459c MDL-72687 assign: remove presentation role from profile image 2021-11-02 13:56:56 +08:00
Simey Lameze aaea00fac4 MDL-72687 assign: fix email and due date cut off whem zooming 2021-11-02 13:56:56 +08:00
Simey Lameze 8af2a0d1e5 MDL-72687 assign: fix colour picker broken aria menu 2021-11-02 13:56:56 +08:00
Simey Lameze d823a6a109 MDL-72687 assign: fix stamp picker broken aria menu 2021-11-02 13:56:56 +08:00
Simey Lameze 9bde57d68b MDL-72687 assign: fix change filter element tab navigation 2021-11-02 13:56:56 +08:00
Simey Lameze 6d46bde5df MDL-72687 assign: use correct aria role for toolbar 2021-11-02 13:56:56 +08:00
Simey Lameze af6ac19818 MDL-72687 assign: add missing label to change user element 2021-11-02 13:56:55 +08:00
Simey Lameze 8e9a244acb MDL-72687 assign: display a more friendly link when not graded 2021-11-02 13:56:55 +08:00
Simey Lameze bff8d68915 MDL-72687 assign: add missing aria-label to prev/next arrows 2021-11-02 13:56:55 +08:00
Simey Lameze a852f9c33c MDL-72687 form: only add legend tag if a label is set 2021-11-02 13:56:55 +08:00
Andrew Nicols 6046c252e6 Merge branch 'MDL-72884-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-11-02 11:34:11 +08:00
Andrew Nicols 0af5f15eb7 Merge branch 'MDL-72767-m310' of https://github.com/NeillM/moodle into MOODLE_310_STABLE 2021-11-02 11:29:04 +08:00
AMOS bot f890546135 Automatically generated installer lang files 2021-11-02 00:07:23 +00:00
Paul Holden 6ad94202c3 MDL-72969 output: correct ansi colour format codes for check results. 2021-11-01 17:12:21 +00:00
Huong Nguyen 7ffc6c9e09 MDL-71872 Questions: The placeholder disappears when double-clicking 2021-11-01 17:30:24 +07:00
Paul Holden 13f3015dd6 MDL-72857 badges: filter site/course name when showing issued badge. 2021-11-01 10:20:45 +00:00
Neill Magill a83bc1c40c MDL-72767 forum: Stop duplicate digests being created
This change is to stop there being a possibility of 2 digests tasks
being created for a user on the day that MDL-72767 is applied.
2021-11-01 08:51:26 +00:00
Neill Magill cda586322e MDL-72767 forum: Ensure digests are sent
Before this change if a new post was made after the digest time but
before todays daily digest had been sent the run time on the digest
would be set to the next day resulting in no digest being sent to
the user.

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

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

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

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

And that's what this issue exactly does, restrict the export to the
number of threads that the plan will have. So every user always runs
the very same number of loops.
2021-10-29 18:03:50 +02:00
Eloy Lafuente (stronk7) 96911f0c1a weekly release 3.10.7+ 2021-10-29 17:10:15 +02:00
Eloy Lafuente (stronk7) b45b272a45 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-29 17:10:14 +02:00
Eloy Lafuente (stronk7) 06eb5a762f MDL-72743 phpunit: Skip test until MDL-72950 is fixed
It's good to keep the test because it's not easy to
reproduce the issue to be fixed. Part of the fix will
be to remove this skip.
2021-10-29 14:00:41 +02:00
Huong Nguyen 6742fa55be MDL-72895 Assignment: Fix colour contrast for grading navigation 2021-10-29 18:53:22 +08:00
Shamim Rezaie c0d9cbcced Merge branch 'MDL-72874-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-10-29 03:35:33 +11:00
Shamim Rezaie c72f637d37 Merge branch 'MDL-72924-fix-component-initialisation-for-performance-checks-MOODLE_310_STABLE' of https://github.com/keevan/moodle into MOODLE_310_STABLE 2021-10-29 02:57:23 +11:00
Sara Arjona 054d49fe3d MDL-72945 badges: use default issuer contact
The defaultissuercontact was ignored if the sitebackpack email was set
to empty string..
2021-10-28 17:45:10 +02:00
Víctor Déniz dab1898dd1 Merge branch 'MDL-72912_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-10-28 15:45:40 +01:00
Víctor Déniz dfe37f0c6b Merge branch 'MDL-72901_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-10-28 13:49:25 +01:00
Eloy Lafuente (stronk7) d16a375088 MDL-72743 tests: tidy up the new test with NS/name/covers
Ideally any new test should be using a class name matching
the file name, and to use namespace when clearly belonging to
a component (sub-namespace also allowed for better accuracy).

And, also, adding a @covers label to indicate which class
(preferred, method is also possible) is being covered with the test.
2021-10-28 13:11:51 +02:00
Eloy Lafuente (stronk7) 2572fdc856 Merge branch 'MDL-72743-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-28 13:11:47 +02:00
Andrew Nicols c5e217856a Merge branch 'MDL-72871_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-10-28 14:16:32 +08:00
Jun Pataleta dda001d3d3 Merge branch 'MDL-72316-310-2' of git://github.com/mickhawkins/moodle into MOODLE_310_STABLE 2021-10-28 13:50:35 +08:00
Michael Hawkins 29cfeda7b5 MDL-72316 filelib: Add ability for modules to directly load SVG images
This also implements the functionality for SCORM packages, which may
have SVG images embedded within their content which require loading
directly (and are only created by users with appropriate risk flag).
2021-10-28 13:06:07 +08:00
Kevin Pham 48f390046d MDL-72924 check: Fix component initialisation for performance checks 2021-10-28 14:22:41 +11:00
Eloy Lafuente (stronk7) 6a6e407f70 Merge branch 'MDL-72879-310-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-10-27 22:12:41 +02:00
Jun Pataleta 955800114b Merge branch 'MDL-72669-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-10-27 15:07:52 +08:00
Mark Nelson e89ba50b71 MDL-71439 core_grades: return a blank mustache template for letters 2021-10-27 12:20:34 +08:00
Mark Nelson 569024b0d9 MDL-71439 mod_forum: display user grade from web service 2021-10-27 12:20:34 +08:00
Mark Nelson ef9594be52 MDL-71439 core_grades: return result of new method in web services 2021-10-27 12:20:34 +08:00
Mark Nelson a93e25a05f MDL-71439 core_grades: add new method 'get_formatted_grade_for_user' 2021-10-27 12:20:34 +08:00
Mark Nelson d46acf02fa MDL-71439 core_grades: fixed undefined class issues 2021-10-27 12:20:33 +08:00
Mark Nelson dd7d81b872 MDL-71439 core_grades: remove returning null when not possible
The method explicitly declares 'stdClass' as the return type.
2021-10-27 12:20:33 +08:00
AMOS bot fb4878f231 Automatically generated installer lang files 2021-10-27 00:07:22 +00:00
Eloy Lafuente (stronk7) 612f688949 Merge branch 'MDL-72913-310' of git://github.com/NoelDeMartin/moodle into MOODLE_310_STABLE 2021-10-26 17:22:17 +02:00
Eloy Lafuente (stronk7) 9424c7464e MDL-72871 cleanup: Remove incorrect whitespace from codebase
Differences can be checked with git diff --ignore-all-space and
that will show that the only non-whitespace change is in a test
in the git lib/tests/html2text_test.php file. In that case the
whitespace has been replaced by a quoted string (of whitespaces)
keeping the test 100% equivalent and workarrounding the whitespace.
2021-10-26 17:19:22 +02:00
Víctor Déniz 9fd7f2c0be weekly release 3.10.7+ 2021-10-26 13:44:11 +01:00
Víctor Déniz c4372bb149 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-26 13:44:09 +01:00
Tim Hunt 466b94469e MDL-72912 questions: fix type of question_display_options::$context 2021-10-26 08:06:37 +01:00
Noel De Martin ee3caf8593 MDL-72913 course: Fix require statement 2021-10-26 08:53:22 +02:00
Helen Foster a7b0d7cb7b MDL-72879 lang: Import fixed English strings (en_fix) 2021-10-25 21:01:52 +02:00
Paul Holden 8f592b3e3b MDL-72894 course: format name and summary data for download.
The names and summaries of course elements (i.e. the course
itself, plus sections and modules) included when downloading
it's content are now passed through appropriate methods to
format their values.
2021-10-25 08:07:58 +01:00
Andrew Nicols 35bbdfbef5 Merge branch 'MDL-71750-310' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-10-25 13:58:46 +08:00
AMOS bot 3287734e73 Automatically generated installer lang files 2021-10-24 00:07:24 +00:00
Tim Hunt 0260a426c8 MDL-72901 question: add missing {$a} in string attemptfinishedsubmitting 2021-10-22 23:16:44 +01:00
Ilya Tregubov 01bdec3021 weekly release 3.10.7+ 2021-10-22 12:49:06 +02:00
Shamim Rezaie 6bf3f5f911 MDL-72669 qtype_multianswer: Replace empty option with NBSP 2021-10-22 16:02:32 +11:00
Víctor Déniz 884bf887b2 Merge branch 'MDL-72607-fix_media_vimeo_url_parser' of https://github.com/praxisdigital/moodle into MOODLE_310_STABLE 2021-10-22 00:03:34 +01:00
Paul Holden d42c4f2fff MDL-72884 atto_image: improve svg support in editor dialogue.
Where the dimensions of an image are not present, we should use
sensible defaults so that the dialogue is still usable.
2021-10-21 23:58:37 +01:00
Paul Holden 08076fbff0 MDL-72743 mod_quiz: verify user mapping prior to restoring attempts. 2021-10-21 08:26:33 +01:00
Eloy Lafuente (stronk7) d277a76ec0 Merge branch 'MDL-72013-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-10-21 09:17:17 +02:00
Andrew Nicols aac3479ad8 Merge branch 'MDL-72507-310' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-10-21 13:00:32 +08:00
Andrew Nicols 04ce020099 MDL-72874 behat: Allow behat window sizes to be modified during run
In some situations it is useful to modify the requested screensize by a
modifier. This allows for failing tests to be rerun at a different
screensize, where the original screensize triggered a failure for some
size-related reason.
2021-10-21 10:26:16 +08:00
Andrew Nicols e7c219aa59 MDL-72013 js: Configure eslint-jsdoc plugin
This change adds configuration for the eslint-jsdoc plugin in order to
detect the following errors with jsdoc blocks:
* missing params
* params in incorrect order
* params with no type defined
* properties incorrectly defined
* incorrect use of @package
* incorrect values for @access

In addition, warnings will be thrown where indentation is incorrect.
2021-10-21 08:52:57 +08:00
Andrew Nicols bc301d0b55 MDL-72013 js: Add eslint-jsdoc plugin 2021-10-21 08:52:57 +08:00
Andrew Nicols e7f1069aa3 MDL-72013 js: Fix jsdocs to meet stricter eslint 2021-10-21 08:52:57 +08:00
Ilya Tregubov 8dbfccfaf4 Merge branch 'MDL-72639-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-20 13:01:36 +02:00
Eloy Lafuente (stronk7) 551584fdb5 Merge branch 'MDL-72849-m310' of https://github.com/sammarshallou/moodle into MOODLE_310_STABLE 2021-10-19 22:17:23 +02:00
sam marshall 908175aa5a MDL-72849 tool_behat: Use of xpath name() not compatible with Firefox
The xpath name() function returns upper-case e.g. 'IMG' in Firefox and
lower-case e.g. 'img' in Chrome.
2021-10-19 13:50:49 +01:00
Ilya Tregubov 81c2310aec Merge branch 'MDL-71270-310' of git://github.com/mickhawkins/moodle into MOODLE_310_STABLE 2021-10-19 14:46:56 +02:00
Eloy Lafuente (stronk7) cce486dfc5 weekly release 3.10.7+ 2021-10-19 12:51:53 +02:00
Eloy Lafuente (stronk7) 84aa260b18 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-19 12:51:51 +02:00
Andrew Nicols e909b6ac53 MDL-71785 mod_quiz: Correct string as per reviewer feedback 2021-10-19 11:20:57 +08:00
Andrew Nicols d98071bad5 Merge branch 'MDL-71785_310' of https://github.com/StudiUM/moodle into MOODLE_310_STABLE 2021-10-19 11:20:55 +08:00
Sara Arjona d0e4af123c Merge branch 'MDL-72590-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-10-18 17:38:45 +02:00
Luca Bösch 1d5a547027 MDL-72590 enrol: Course in success message after unenroll passes filter 2021-10-18 16:38:19 +02:00
Sara Arjona 281b23d7d2 Merge branch 'MDL-72064-310' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-10-18 12:59:51 +02:00
Michael Hawkins 33a68275a3 MDL-71270 core: Updated security.txt expiry 2021-10-18 17:14:17 +08:00
Sam Møller 6b93cb6a3a MDL-72607 media_vimeo: Fix vimeo URL parser
Fix vimeo URL parser to support the new vimeo URL format with privacy
settings (the video with password or domain restricted setting).
For example "https://vimeo.com/123456789/2bffff0000" the plugin must
parse the URL "https://player.vimeo.com/video/123456789?h=2bffff0000"
to the iframe source to make it compatible with the new vimeo URL
format.
See more about vimeo video privacy settings at
https://vimeo.com/blog/post/video-privacy-explained/
2021-10-18 08:43:08 +02:00
Andrew Nicols 61e3074574 Merge branch 'MDL-65943-310' of git://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2021-10-18 14:05:29 +08:00
Huong Nguyen 0df31d4324 MDL-65943 media_videojs: add videojs-ogvjs plugin
VideoJS now support to play Ogg Vorbis/Opus/Theora and WebM VP8/VP9/AV1 video on:
 - Safari on Mac OS
 - Safari on iPhone OS
 - Safari on iPad OS
2021-10-18 12:00:37 +07:00
AMOS bot 14b8cba9f3 Automatically generated installer lang files 2021-10-16 00:07:29 +00:00
Shamim Rezaie cede428cc4 weekly release 3.10.7+ 2021-10-16 00:29:25 +11:00
Shamim Rezaie 30837de74c Merge branch 'MDL-71344-310' of git://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2021-10-15 14:27:42 +11:00
Jun Pataleta b26ee161cb Merge branch 'MDL-72623_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-10-15 09:47:03 +08:00
Jun Pataleta cc259e05d1 Merge branch 'MDL-72807_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-10-15 09:08:15 +08:00
Eloy Lafuente (stronk7) 3d207d282c Merge branch 'MDL-26633-310-workshopnumofreviews' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-10-14 22:41:02 +02:00
Eloy Lafuente (stronk7) d3b0abf253 Merge branch 'MDL-68325-310' of git://github.com/odeialba/moodle into MOODLE_310_STABLE 2021-10-14 22:19:40 +02:00
Eloy Lafuente (stronk7) 56297afaf4 Merge branch 'MDL-72464-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-14 22:02:36 +02:00
Eloy Lafuente (stronk7) 344ff84559 MDL-72807 behat: Add a few more @skip_chrome_zerosize tags
This is the 3rd round adding the tags to some scenarios
detected to be failing with zerosize problems lately.

Note that @ MDL-71108, the final solution will happen, say
switching to own webdriver till the upstream one is fixed
or whatever. Our @skip_chrome_zerosize solution is just a
workaround to have all those scenarios detected and ignored
by normal runs.
2021-10-14 16:17:20 +02:00
Eloy Lafuente (stronk7) ea0adf9302 MDL-72623 nodejs: Bump from v14.15.0 to v14.18.0
Without modifying any installed package or dependency
because, after trying to do so, the updated stuff is huge
and leads to some JS validation / minimisation problems.
2021-10-13 09:49:58 +02:00
Andrew Nicols 2805514fb4 weekly release 3.10.7+ 2021-10-13 09:40:53 +08:00
Andrew Nicols 1699daee3b Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-13 09:40:52 +08:00
AMOS bot 037c988ffa Automatically generated installer lang files 2021-10-13 00:07:21 +00:00
Víctor Déniz fc5b9dcd66 Merge branch 'MDL-72498-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-12 15:34:49 +08:00
Huong Nguyen b7adb5da3f MDL-71344 questions: Improve event handler for Drag n Drop family 2021-10-11 11:05:23 +07:00
Andrew Nicols c8530a1956 Merge branch 'MDL-66203-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-10-11 08:37:37 +08:00
Paul Holden fac4ab52e0 MDL-72639 admin: consistent primary buttons during site upgrade. 2021-10-10 20:43:26 +01:00
Paul Holden 9e1cc7c039 MDL-72498 report_eventlist: use core component API for event list.
The previous method of hardcoded filepaths, specifically for events
belonging to core, meant that any events belongs to core subsystems
were omitted (core_customfield, core_h5p, core_payment, etc).
2021-10-10 20:41:49 +01:00
Paul Holden 2163c70d1c MDL-72464 webservice: fix detection of non-expiring external tokens. 2021-10-10 20:40:47 +01:00
David Mudrák f5bb18e153 MDL-26633 workshop: Allow to randomly allocate more than 30 reviews
For classes with many students, there may be valid cases for having more
than 30 reviews per submission / reviewer.

The patch changes the type of the input field so that it can freely
editable to any integer value.
2021-10-08 17:35:43 +02:00
Sara Arjona 7cef80d284 weekly release 3.10.7+ 2021-10-08 12:43:24 +02:00
Sara Arjona 63f8c08bb6 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-08 12:43:23 +02:00
AMOS bot 571e9516b4 Automatically generated installer lang files 2021-10-08 00:07:23 +00:00
Víctor Déniz 815c4943fa Merge branch 'MOODLE_310_MDL-64576' of https://github.com/golenkovm/moodle into MOODLE_310_STABLE 2021-10-07 22:28:24 +01:00
Eloy Lafuente (stronk7) 37cbcfabc3 Merge branch 'MDL-71306-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-07 23:10:17 +02:00
Eloy Lafuente (stronk7) 36f64e7023 Merge branch 'MDL-72674-310' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-10-07 22:54:14 +02:00
Eloy Lafuente (stronk7) 49e05ee653 Merge branch 'MDL-72309-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-07 22:43:05 +02:00
Eloy Lafuente (stronk7) dba8c123ad Merge branch 'MDL-72635-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-10-07 22:39:12 +02:00
Eloy Lafuente (stronk7) a2a370818d Merge branch 'MDL-72621-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-10-07 21:10:45 +02:00
AMOS bot be04192910 Automatically generated installer lang files 2021-10-07 00:07:21 +00:00
Jun Pataleta be71182f32 Merge branch 'MDL-72339-m310' of https://github.com/sammarshallou/moodle into MOODLE_310_STABLE 2021-10-06 22:44:26 +08:00
sam marshall ca7b088d44 MDL-72339 core_availability: Unsafe to use format_string in description
The availability condition get_description method is called while
gathering data for the modinfo object. As such it is not safe to
call other functions which might rely on modinfo, such as format_string
(if using filters which access modinfo).

This change provides a mechanism to call format_string later, and also
a general callback to do other stuff later as well if needed. It uses
the same approach already taken to make activity names work correctly
in the availability_condition class.
2021-10-06 11:27:42 +01:00
Andrew Nicols ad360f54fd Merge branch 'MDL-72515-310' of git://github.com/marinaglancy/moodle into MOODLE_310_STABLE 2021-10-06 13:17:37 +08:00
Ilya Tregubov c1e2d9c2ff Merge branch 'MDL-72452-resource-filter-310' of https://github.com/Peterburnett/moodle into MOODLE_310_STABLE 2021-10-06 10:56:21 +07:00
Andrew Nicols fc79234d6d Merge branch 'MDL-72599-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-06 09:13:27 +08:00
Eloy Lafuente (stronk7) 278c3dfb4d weekly release 3.10.7+ 2021-10-06 00:24:55 +02:00
Ilya Tregubov 586d84ad0b Merge branch 'MDL-56773-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-10-05 23:32:54 +02:00
Jun Pataleta d92ed8b795 Merge branch 'MDL-39324-moodle310' of https://github.com/kiratskitizing/moodle into MOODLE_310_STABLE 2021-10-05 23:32:54 +02:00
Simey Lameze b7c34fb5e3 MDL-72635 calendar: fix typo in data attribute 2021-10-05 06:30:57 +08:00
Paul Holden a9046afce1 MDL-71306 cohort: ignore empty values in form autocomplete element. 2021-10-04 21:14:53 +01:00
Joshua Ebarvia 51e35ec47d MDL-39324 mod_url: Fix icon when URL has params 2021-10-04 20:02:02 +10:30
Marina Glancy 374717d6ec MDL-72515 admin: do not call curl unnecessary on plugins page 2021-10-04 10:01:18 +02:00
Paul Holden 56f275036b MDL-72309 course: make category a required field in forms.
Course category fields were changed en masse from simple select
elements to autocompletes in 93d72205, but weren't defined as
required fields. This could lead to exceptions and/or unexpected
behaviour if their values were cleared prior to form submission.
2021-10-04 08:11:47 +01:00
Mikhail Golenkov 3f128992d2 MDL-64576 completion: Fix criteria and course completion dates 2021-10-04 10:53:34 +11:00
Shamim Rezaie 85f18da71d MDL-66203 mod_assign: Reset submission status when removing a submission 2021-10-04 02:13:54 +11:00
Eloy Lafuente (stronk7) e57b280e00 weekly release 3.10.7+ 2021-10-02 22:05:17 +02:00
Eloy Lafuente (stronk7) 1c38736a13 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-10-02 22:05:16 +02:00
Eloy Lafuente (stronk7) 0009f62945 Merge branch 'MDL-72714_310' of git://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-10-02 15:29:53 +02:00
Eloy Lafuente (stronk7) e29998cf8e MDL-72714 behat: Add new @skip_chrome_zerosize labels
With the move from Chrome 93 to 94 a few new "zerosize" cases
have appeared, this just protect us from them, so they
are run apart.
2021-10-02 12:17:25 +02:00
Eloy Lafuente (stronk7) e2d9c69819 MDL-72714 behat: fix problem with button on the edge and failing
Surprise came with Chrome 94, so applying the usual trick by
changing window size. Hopefully some day we'll be able to
revert all them (Chrome 123).
2021-10-02 12:17:25 +02:00
abgreeve 3b8c9e1a99 Merge branch 'MDL-69682-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-10-01 11:27:09 +08:00
Jun Pataleta 2e9e4ca1df MDL-72674 core: Add indicator that feedback link opens in new window
* New pix icon i/externallink
* New lang string opensinnewwindow
* Use the external link pix icon with "Opens in new window" lang string
 as its alt text and add it to the "Give feedback about this software"
 link.
* Update cta template to indicate whether the link opens in new window.
2021-10-01 10:40:18 +08:00
Andrew Nicols b21aa1e011 Merge branch 'MDL-72673-310' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-10-01 10:24:09 +08:00
Eloy Lafuente (stronk7) a5a7b1d2c5 Merge branch 'MDL-72484-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-30 23:19:24 +02:00
Víctor Déniz 8645227c34 Merge branch 'MDL-72399_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-09-30 16:10:18 +01:00
Víctor Déniz d62f2e79b7 Merge branch 'MDL-72496-310_assert_tag' of https://github.com/call-learning/moodle into MOODLE_310_STABLE 2021-09-30 15:40:49 +01:00
Laurent David 5d5cd02239 MDL-72496 question tests: fix assertTag if tag not found
* The basic_test::assertTag method will issue a warning as $tag is not
found, failing the PHP Unit test that uses this method.
* Add tests to check that assertTag is working
2021-09-30 13:14:51 +02:00
Thong Bui f28abb53e0 MDL-72507 Quiz: Quiz auto-save does not detect uploaded files 2021-09-30 12:18:44 +07:00
abgreeve edafd88b34 Merge branch 'MDL-72275-310-2' of git://github.com/mickhawkins/moodle into MOODLE_310_STABLE 2021-09-30 10:08:26 +08:00
AMOS bot d126cf25ae Automatically generated installer lang files 2021-09-30 00:07:22 +00:00
Eloy Lafuente (stronk7) 0eeec9ead8 Merge branch 'MDL-71970-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-09-29 23:27:34 +02:00
Andrew Nicols 82d04b0144 MDL-72621 admin: Add environment check for admin deprecation 2021-09-29 22:39:32 +08:00
Shamim Rezaie 89e834ef1e Merge branch 'MDL-72060-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-09-28 20:13:41 +10:00
Adrian Perez 3399c49298 MDL-72060 mod_lti: fix comparison if user is gradable 2021-09-28 17:26:25 +08:00
AMOS bot 708943ec2e Automatically generated installer lang files 2021-09-28 00:07:29 +00:00
Paul Holden 88c1da303c MDL-72484 report_eventlist: looser check for event 'other' docs. 2021-09-27 18:21:27 +01:00
Sara Arjona 23fb47e2cf MDL-71970 h5plib_v124: Replace references to new Moodle\H5Pxxx namespace
The joubel/core and joubel/editor libraries have been moved to Moodle
namespace.
This commit adds the new namespace to the places where these classes
are used.
Besides, a couple of minor changes have been done to replace the _test.php
classname and remove some unnecessary defined('MOODLE_INTERNAL').
2021-09-27 11:43:37 +02:00
Sara Arjona f8cffbbf7e MDL-71970 h5plib_v124: Add namespace to H5P editor library
The joubel/editor is a third-party library. A namespace has been added to
avoid collision with other plugins using it (such as mod_hvp).
That way, they will be able to have a different version without
side effects.
2021-09-27 11:43:37 +02:00
Sara Arjona ae3066690c MDL-71970 h5plib_v124: Add namespace to H5P core library
The joubel/core is a third-party library. A namespace has been added to
avoid collision with other plugins using it (such as mod_hvp).
That way, they will be able to have a different version without
side effects.
2021-09-27 11:43:37 +02:00
Jun Pataleta d09bbc9f14 MDL-72673 mod_glossary: Generate unique ID for Keywords select element 2021-09-24 18:31:34 +08:00
Paul Holden 9a0e343654 MDL-69682 theme_boost: remove minimum height of tables.
The change that introduced this property (a3124b15) is no longer
required, and it caused visual glitches on tables containing a
single row.
2021-09-24 08:22:52 +01:00
Michael Hawkins 0f65d529fd MDL-72275 timeline: Add default offset to template
This value was being passed in the template, but the template
had 0 hardcoded instead of injecting the context value. With the other
bug fixes in this issue correctly loading the "All" view properly on
page load, this uncovered that at load time, the course view would not
load overdue items, which also meant a behat test was failing.
2021-09-24 11:24:49 +08:00
Michael Hawkins e65db9fe04 MDL-72275 timeline: Make time dropdown options display consistently
The 6 month option was highlighted on load if previously selected,
which was not the case for any other options. This has been removed
so it behaves consistently.
2021-09-24 11:24:49 +08:00
Michael Hawkins 1b29aea633 MDL-72275 timeline: Fixed non-loading issue in dates sort
Incorrect setting/getting of the "seen" data attribute resulted in no
information being fetched when switching from course view back to dates
view.
2021-09-24 11:24:49 +08:00
Michael Hawkins dcf2239198 MDL-72275 timeline: Display "all" time on page load fix
When the timeframe filter was set to "all" when the timeline
block was initially loaded, an incorrect value rendered into
the template meant the timeframe limit was set to 0 (which will
return no results) instead of setting no limit (which would fetch all
 action events, as intended).
2021-09-24 11:24:49 +08:00
AMOS bot 83b6ed8fd1 Automatically generated installer lang files 2021-09-24 00:07:28 +00:00
Eloy Lafuente (stronk7) 9675c9e914 MDL-72399 GHA: Go back to use upstream igbinary extension
With igbinary >=3.2.6 already built, see

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

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

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

This reverts commit ced1550177.
2021-09-23 19:37:55 +02:00
Ilya Tregubov 0360329c46 weekly release 3.10.7+ 2021-09-23 18:21:54 +02:00
Ilya Tregubov d9dfcb86a3 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-09-23 18:21:54 +02:00
Jun Pataleta 3ee6448d1d Merge branch 'MDL-72426-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-09-23 12:24:00 +08:00
Thong Bui 5e8baa62f3 MDL-71750 File upload: Disable submittion when uploading multiple files 2021-09-23 09:13:02 +07:00
AMOS bot 9a2ab7641a Automatically generated installer lang files 2021-09-23 00:07:24 +00:00
Eloy Lafuente (stronk7) f0b48631c1 Merge branch 'MDL-72110-310' of https://github.com/sharidas/moodle into MOODLE_310_STABLE 2021-09-22 20:12:27 +02:00
Eloy Lafuente (stronk7) 7268b98f0d Merge branch 'MDL-72593-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-09-22 10:48:28 +02:00
Jun Pataleta 63706d6044 Merge branch 'MDL-51165-moodle310' of https://github.com/kiratskitizing/moodle into MOODLE_310_STABLE 2021-09-22 10:51:52 +08:00
AMOS bot 0ca10e3942 Automatically generated installer lang files 2021-09-22 00:07:25 +00:00
Eloy Lafuente (stronk7) fdfbf416b3 Merge branch 'MDL-71352-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-09-21 23:19:47 +02:00
Eloy Lafuente (stronk7) 70d5ba992d Merge branch 'MDL-69364-310-alt' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-09-21 18:19:43 +02:00
Andrew Nicols 24d9c5e6ce MDL-72593 behat: Improve behat handling of file manager buttons
When using a try/catch for a find if the first match is not met then we
have an implicit 6 second delay waiting for the search to time out.

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

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

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

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

I believe that this should be a safe change as the document fetched from
the browser is normalised to match the doctype specified.
2021-09-21 16:00:49 +08:00
Andrew Nicols 4d5b16b22b MDL-69364 enrol: Improve setting of save button 2021-09-20 12:07:58 +08:00
Andrew Nicols 871ee28e3b MDL-69364 enrol: Improve cohort test 2021-09-20 12:07:58 +08:00
Joshua Ebarvia 843988882f MDL-51165 mod_url: allow directory index url direct access 2021-09-19 12:07:28 +09:30
Marie-Eve Lévesque f2c42a1fe3 MDL-71785 core_quiz: Empty quiz section name behaves like new page 2021-09-17 11:32:52 -04:00
Paul Holden 8825279be6 MDL-72599 blocks: handle editing/deletion on admin notification page.
This was broken by changes in fdd5aef0, as the sesskey URL parameter
was required on admin/index.php in order for block related actions
to be performed uninterrupted by any redirections.
2021-09-17 12:21:54 +01:00
Luca Bösch e3958e5a8c MDL-71352 gradereport_grader: Add icons for pass/fail. 2021-09-17 12:12:29 +02:00
Ilya Tregubov 41cfb8996a weekly release 3.10.7+ 2021-09-17 08:58:36 +02:00
Ilya Tregubov 0ccf676b79 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-09-17 08:58:35 +02:00
Ilya Tregubov 5ee956d6c9 Merge branch 'MDL-72173-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-09-16 15:02:17 +02:00
Andrew Nicols eacfa23bcc MDL-72173 behat: Respect login page preference 2021-09-16 20:47:18 +08:00
Jun Pataleta 5f644ae3ad Merge branch 'MDL-72173-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-09-16 15:39:56 +08:00
Andrew Nicols 5e2b248b20 MDL-72173 behat: Fix typo Logout <> Log out 2021-09-16 15:03:07 +08:00
Jun Pataleta 52cfb19f05 Merge branch 'MDL-71602-310-2' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-09-16 12:57:41 +08:00
Jun Pataleta 4619f8c4d0 Merge branch 'MDL-72173-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-09-16 12:23:03 +08:00
Andrew Nicols a4e338dd60 MDL-72173 behat: Add tests for login/logout steps 2021-09-16 12:20:37 +08:00
Andrew Nicols fe0af7ad54 MDL-72173 behat: Automatically log user out on behat login 2021-09-16 12:13:26 +08:00
Andrew Nicols f9888aca4e MDL-72173 behat: Add and use behat logout URL 2021-09-16 12:13:26 +08:00
Jake Dallimore 877288e0c1 Merge branch 'MDL-71860-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-09-16 11:03:20 +08:00
Jun Pataleta b0835ce1d4 Merge branch 'MDL-72589_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-09-16 09:46:42 +08:00
AMOS bot 1acba692e3 Automatically generated installer lang files 2021-09-16 00:07:24 +00:00
Leon Stringer 2a785a209a MDL-71860 core: Migrate lang string
Corresponding move of language string invalidpersistenterror following
move of class invalid_persistent_exception in MDL-57273.

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

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

They will be run by another job, specifically using that tag to
keep them failing and under control.
2021-09-15 20:28:26 +02:00
Jake Dallimore 9fbff304da Merge branch 'MDL-71550-310' of git://github.com/bmbrands/moodle into MOODLE_310_STABLE 2021-09-15 10:50:01 +08:00
Jake Dallimore 548b2e7921 Merge branch 'MDL-71137-310' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-09-15 10:12:30 +08:00
Eloy Lafuente (stronk7) 8cadc4dcca Merge branch '71093-moodle310-backup-honor-formatstringstriptags' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_310_STABLE 2021-09-14 22:22:28 +02:00
Eloy Lafuente (stronk7) 248c791132 Merge branch 'MDL-72192-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-14 22:17:41 +02:00
Ilya Tregubov 7326bc1246 Merge branch 'MDL-71961-310' of git://github.com/nguyenphuctien/moodle into MOODLE_310_STABLE 2021-09-14 12:09:37 +02:00
Ilya Tregubov a81035a211 Merge branch 'MDL-71846-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-13 13:44:41 +02:00
Tien Nguyen da619ac46f MDL-71961 Quiz: Disable quiz navigation buttons when files are uploading 2021-09-13 17:42:33 +07:00
Odei Alba 4c1894aa97 MDL-68325 completion: Add validation to course completion form 2021-09-13 12:12:53 +02:00
Andrew Nicols 07e69d234e MDL-72173 behat: Switch to behat login URL 2021-09-13 11:20:35 +08:00
gthomas2 5fad08121e MDL-72173 behat: Add alternative login file for behat 2021-09-13 11:14:02 +08:00
Eloy Lafuente (stronk7) 5af6e79b38 Moodle release 3.10.7 2021-09-12 12:37:31 +02:00
Eloy Lafuente (stronk7) afa3c2a13f weekly release 3.10.6+ 2021-09-11 12:12:23 +02:00
Eloy Lafuente (stronk7) 10e6791ee0 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-09-11 12:12:21 +02:00
Shamim Rezaie 194b964dc5 MDL-71240 filter_tex: Add allowlist for filter_tex_sanitize_formula 2021-09-10 18:10:26 +02:00
Eloy Lafuente (stronk7) 3d94d6fb6a Merge branch 'MDL-71385-310-3' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-09-09 13:01:37 +02:00
Eloy Lafuente (stronk7) 83e94a25cf Merge branch 'MDL-63207-310' of git://github.com/cescobedo/moodle into MOODLE_310_STABLE 2021-09-09 13:01:37 +02:00
Eloy Lafuente (stronk7) 60a4c78f98 Merge branch 'MDL-69855-310' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-09-09 13:01:37 +02:00
Jun Pataleta 0095f26934 MDL-71385 theme: Fix contrast for dimmed text against striped table rows
In order to achieve good colour contrast between dimmed text and striped
table rows, the background colour of the striped rows are being
lightened to 0.03 alpha. While $gray-600 is being adjusted to a bit
darker shade of #6a737b. This gives a colour contrast ratio of 4.5:1
between the dimmed text colour and the striped table row background
which meets WCAG 2.1 Level AA requirements.

Comparing the normal font colour (#212529) with the adjusted dimmed text
colour gives a contrast ratio of 3.20:1 which meets WCAG 2.1 Level AA
requirements and still makes them distinguishable from one another.
2021-09-09 16:02:58 +08:00
AMOS bot 18678fc78e Automatically generated installer lang files 2021-09-09 00:07:22 +00:00
Eloy Lafuente (stronk7) b5366af358 Merge branch 'MDL-72216-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-09-08 11:29:16 +02:00
Eloy Lafuente (stronk7) 90e0a2c746 Merge branch 'MDL-72499-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-07 23:52:09 +02:00
Eloy Lafuente (stronk7) 45a7e77e6c Merge branch 'MDL-72071-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-07 23:30:04 +02:00
Eloy Lafuente (stronk7) 0110d5a4ad Merge branch 'MDL-72488-310-importdatastring' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-09-07 23:00:23 +02:00
cescobedo f01cff47d2 MDL-63207 auth_ldap: Update user profile if field is empty 2021-09-07 22:57:02 +02:00
Eloy Lafuente (stronk7) 83b771c9be Merge branch 'MDL-69504-310' of https://github.com/snake/moodle into MOODLE_310_STABLE 2021-09-07 20:04:22 +02:00
Eloy Lafuente (stronk7) a85148d645 Merge branch 'MDL-67610-310-2' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-09-07 19:25:35 +02:00
Jun Pataleta d65f46103a MDL-67610 mod_forum: Do not include private replies in unread count
Fetching the counts of unread posts should only include unread regular
posts or unread private reply posts directed to the user unless the user
has the capability to read private replies.
In order to retrieve the correct counts, we also need to loop through
each forum instance in the course to check the capability of the user to
read private replies in each forum.
2021-09-07 23:20:33 +08:00
AMOS bot 98679b981c Automatically generated installer lang files 2021-09-07 00:07:23 +00:00
Paul Holden ec4c5a0e35 MDL-71726 course: respect user access when exporting participants.
We should ensure that users being exported are enrolled on the
course being exported from. In courses where the current user can't
access all groups we should ensure that users being exported belong
to the same groups as them.
2021-09-07 00:14:39 +02:00
Sujith Haridasan 4ffc17be15 MDL-71160 auth_db: Use strict comaprison
Use strict comparison to avoid type juggling.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-09-07 00:14:39 +02:00
Paul Holden e2b3d5fec5 MDL-71976 auth_shibboleth: consistent session parsing during logout. 2021-09-07 00:14:39 +02:00
Shamim Rezaie 1b6f1756f6 MDL-71240 filter_tex: Sanitize the whole latex document
LaTeX documents have a preamble section and admins can use a \newcommand
statement to define new commands there (or to give an alias to another
command). This commit makes sure no blocked command can escape
sanitization by being used in a new seemingly harmless command that is
defined in the LaTeX preamble.
2021-09-07 00:14:39 +02:00
Shamim Rezaie cd7fa2e513 MDL-71240 filter_tex: Support paranoid mode for openin_any in latex 2021-09-07 00:14:39 +02:00
Huong Nguyen 0cd2cbccfb MDL-71797 quiz: Improve the checks when fetching user's attempts 2021-09-07 00:14:39 +02:00
Eloy Lafuente (stronk7) c05d2669bd Merge branch 'MDL-72286-310-test' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-09-06 23:58:25 +02:00
David Mudrák c755938aa3 MDL-72488 lang: Fix hard-coded English string at grades import form
Also adding a help tooltip as this seems to be the most important field
in the form and yet it was the only one without a help.
2021-09-06 17:41:50 +02:00
Paul Holden 55deada25a MDL-72499 event: add/correct event language strings as required. 2021-09-06 11:16:45 +01:00
Thong Bui 75eff1bf89 MDL-71137 File upload: progress bar issues display when D&D multi files 2021-09-06 14:12:51 +07:00
Eloy Lafuente (stronk7) 536876611d Merge branch 'MDL-72428-310-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-09-03 19:10:45 +02:00
Eloy Lafuente (stronk7) 7aded627d8 Merge branch 'MDL-72478-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2021-09-03 17:03:19 +02:00
Shamim Rezaie aa7bc64c05 MDL-56773 atto_equation: The equation editor should always be rtl
Also re-applied the border that was added to the preview area as part of
MDL-44778. The class name that's used no longer exists.
2021-09-03 17:58:49 +10:00
Sara Arjona 9fa81da1f2 MDL-72478 calendar: Fix PHPUnit failure with offset
Before PHP 8.0.10, the time is lost when datetime->modify() is used
with weekdays. However, with PHP 8.0.10, the time is kept.
In consequence, the test_yearly_every_20th_monday_forever method
started failing.
For fixing it, the offset has been removed and the time has been set
to 00:00, so the behaviour will be the same regardless the PHP
version.
2021-09-03 09:35:00 +02:00
Simey Lameze 3ae9fb6a95 MDL-72426 theme: fix message and notification count colour contrast 2021-09-03 12:26:45 +08:00
Peter Burnett 96d14175e4 MDL-72452 resource: Filter resource media embed output 2021-09-03 09:30:13 +10:00
Luca Bösch 4a47a0a0d6 MDL-72216 questions: Don't stick buttons together in preview. 2021-09-02 13:35:45 +02:00
Sara Arjona 3e6900105a weekly release 3.10.6+ 2021-09-02 11:51:27 +02:00
Jun Pataleta cf687ae49f Merge branch 'MDL-72440_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-09-02 09:52:11 +08:00
David Mudrák 2cce6c76af MDL-72428 lang: Use the fixed strings in the tests 2021-09-01 22:04:58 +02:00
Helen Foster 32b25556e1 MDL-72428 lang: Import fixed English strings (en_fix) 2021-09-01 22:04:04 +02:00
Sara Arjona 8d0457447a Merge branch 'MDL-72169-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-09-01 17:46:52 +02:00
Sara Arjona cfb69b6578 Merge branch 'MDL-71375-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-09-01 17:09:39 +02:00
Sara Arjona 54d1702e97 Merge branch 'MDL-70376-310' of git://github.com/peterRd/moodle into MOODLE_310_STABLE 2021-09-01 16:52:14 +02:00
Sara Arjona 87cf2ed706 Merge branch 'MDL-71674-310' of https://github.com/dcai/moodle into MOODLE_310_STABLE 2021-09-01 11:36:47 +02:00
Dongsheng Cai 1da0e42f0f MDL-71674 editor_atto: more assessible errors 2021-09-01 18:35:59 +10:00
Eloy Lafuente (stronk7) a7733c35b4 Merge branch 'MDL-71999-310' of https://github.com/danielneis/moodle into MOODLE_310_STABLE 2021-08-31 23:16:24 +02:00
Eloy Lafuente (stronk7) adcfb52c1e Merge branch 'MDL-71121-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-31 23:13:15 +02:00
Jun Pataleta b7d4a858f4 Merge branch 'MDL-71778-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-08-31 22:58:29 +08:00
Paul Holden 4dc7f8e76e MDL-72296 admin: style form when prompting for upgrade key. 2021-08-31 13:53:03 +02:00
Paul Holden 24d4dacf1f MDL-72192 user: observe fullname capability in selector context. 2021-08-31 12:17:08 +01:00
Paul Holden a4d85aa8d7 MDL-71846 group: consistent escaping of user/group names. 2021-08-31 12:15:58 +01:00
Paul Holden c3be0cca40 MDL-72071 message: preserve window scroll opening processor modal. 2021-08-31 11:57:15 +01:00
Paul Holden 63fea60126 MDL-72169 privacy: format course name/summary during export. 2021-08-31 11:56:12 +01:00
Eloy Lafuente (stronk7) 12026abb03 MDL-72440 js: reconcile npm installed stuff
When npm-shrinkwrap.json was regenerated few days ago by MDL-72014
running audit-fix on it, it seems that some checksums in the "lodash"
package were missing.

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

So, just reconcile the file to include the new checksums.
2021-08-31 11:21:16 +02:00
cperves e9e2d3188a MDL-71778 admin: patch for hard-set check filter 2021-08-31 12:34:42 +08:00
Peter Dias a290e721e3 MDL-70376 mod_assign: Reintroduce pdf orientation check
Reintroduce the orientation check and sizing when importing an image
2021-08-31 12:29:27 +08:00
Jake Dallimore 465120ed76 Merge branch 'MDL-70433-310' of git://github.com/lucaboesch/moodle into MOODLE_310_STABLE 2021-08-30 10:42:36 +08:00
Simeon Naydenov 40adf6defd MDL-71375 lib: Fix tooltip in show_hide_icon in flexible table 2021-08-30 09:42:39 +08:00
Luca Bösch dab7b02b86 MDL-70433 grades: prevent double escaping in titles 2021-08-27 10:55:53 +02:00
Andrew Nicols 6259988cb6 weekly release 3.10.6+ 2021-08-27 12:00:24 +08:00
Andrew Nicols 0c1e6cc4b3 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-08-27 12:00:23 +08:00
Sujith Haridasan 9f96657f4c MDL-72110 core_navigation: home page preference
Admin should respect the home page preference set
just like any other user.
2021-08-27 07:31:23 +05:30
Sara Arjona 14f831490a Merge branch 'MDL-71029-310' of https://github.com/dcai/moodle into MOODLE_310_STABLE 2021-08-26 07:12:35 +02:00
Andrew Nicols 38cf23f98f Merge branch 'MDL-72403-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE 2021-08-26 13:02:27 +08:00
Heena Agheda e8bdb79b95 MDL-72187 logstore: record log store's visibility change 2021-08-26 12:57:15 +08:00
Andrew Nicols 36ef1de379 Merge branch 'MDL-70176_310' of https://github.com/TomoTsuyuki/moodle into MOODLE_310_STABLE 2021-08-26 12:16:44 +08:00
Andrew Nicols c651c43de9 Merge branch 'MDL-72271_310' of https://github.com/larsbonczek/moodle into MOODLE_310_STABLE 2021-08-26 11:45:38 +08:00
Andrew Nicols 6c4be982c2 Merge branch 'MDL-72152-m310' of https://github.com/sammarshallou/moodle into MOODLE_310_STABLE 2021-08-26 11:36:25 +08:00
Andrew Nicols ea67397163 Merge branch 'MDL-72153-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-26 11:32:13 +08:00
Andrew Nicols 554958612b Merge branch 'MDL-72312_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-08-26 11:26:54 +08:00
AMOS bot 528df7870c Automatically generated installer lang files 2021-08-26 00:07:26 +00:00
Sara Arjona d56f16671d Merge branch 'MDL-72106-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-25 18:38:45 +02:00
Eloy Lafuente (stronk7) 3c5ce312d3 Merge branch 'MDL-72163-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-08-24 20:12:39 +02:00
Sara Arjona 5ee12998e4 Merge branch '310_MDL-70006' of git://github.com/danmarsden/moodle into MOODLE_310_STABLE 2021-08-24 13:13:21 +02:00
Shamim Rezaie 194379a0f8 MDL-72403 calendar: prereserve courseid after form submit 2021-08-24 18:05:12 +10:00
Jake Dallimore 3c64ea8d3c MDL-69504 mod_lti: check role switches when setting lti roles on launch
is_siteadmin isn't aware of role switches, so make sure we're not in a
switched role before calling that method.
2021-08-24 14:35:16 +08:00
Andrew Nicols 5b3b01f1c4 Merge branch 'MDL-72014_310' of https://github.com/stronk7/moodle into MOODLE_310_STABLE 2021-08-24 09:17:05 +08:00
Andrew Nicols f5708eee2c Merge branch 'MDL-72207-310' of git://github.com/jleyva/moodle into MOODLE_310_STABLE 2021-08-24 09:10:07 +08:00
Kateryna Degtyariova 33abdf813b MDL-72342 groups: Use get_columns() to handle BOM in CSV
Ensuring that BOM was properly removed from input CSV file by using get_columns() instead of parsing the raw data.
2021-08-24 10:45:51 +10:00
Eloy Lafuente (stronk7) 2e7f57f975 Merge branch 'MDL-71055-310' of git://github.com/andrewnicols/moodle into MOODLE_310_STABLE 2021-08-23 23:22:40 +02:00
Sara Arjona 5666d8e792 Merge branch 'MDL-72257-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-23 17:52:33 +02:00
Shamim Rezaie 6227246c3f MDL-71602 qtype_essay: label essay question's answer area 2021-08-24 01:06:34 +10:00
Eloy Lafuente (stronk7) 525b10b861 MDL-72312 environment: Add new optional custom check for igbinary
This optional environmental check will look if:

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

And will warn if all the conditions are met.
2021-08-23 15:51:57 +02:00
Eloy Lafuente (stronk7) ced1550177 MDL-72312 GHA: Force use of igbinary working version
And also remove memcached and redis that have dependencies on it.

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

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

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

Note this only affects to php72, newer php
versions are not affected.
2021-08-23 15:51:22 +02:00
Andrew Nicols 30de8275c0 MDL-71055 behat: Update core settings to use generator
These changes have only been applied to settings which were already
using settings names and values, but which were still using the UI.
2021-08-23 12:23:03 +08:00
Eloy Lafuente (stronk7) bfaeecb183 Merge branch 'MDL-71973-310' of https://github.com/mohalisad/moodle into MOODLE_310_STABLE 2021-08-20 19:06:47 +02:00
Eloy Lafuente (stronk7) c5be7c53c6 MDL-72014 nodejs: audit fix to solve some security reports
Simply run npm audit fix that updates these main packages:

- xmldom 0.6.0
- grunt 1.4.1
- gherkin-lint 4.2.2

(and also a bunch of dependencies)
2021-08-20 13:49:56 +02:00
Ilya Tregubov 65b6e86406 weekly release 3.10.6+ 2021-08-20 13:24:35 +02:00
Ilya Tregubov 029e68e619 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-08-20 13:24:35 +02:00
Tomo Tsuyuki add4186322 MDL-70176 mod_forum: Grading respects separate groups filter 2021-08-20 13:36:28 +10:00
Ilya Tregubov bf0795c567 MDL-49202 core: Comment broken test.
Should be fixed properly as part of MDL-72377.
2021-08-19 17:20:48 +02:00
Ilya Tregubov 7c749fba9c Merge branch 'MDL-49202_310' of git://github.com/mdjnelson/moodle into MOODLE_310_STABLE 2021-08-19 17:17:04 +02:00
Mark Nelson bbe8be25fc MDL-49202 core: fix failing unit tests
See MDL-72377.
2021-08-19 20:15:59 +08:00
Mark Nelson 4527f760ea MDL-49202 core_grades: add Behat tests 2021-08-19 20:15:59 +08:00
Juan Leyva bfc0fabe44 MDL-72207 assign: Support all participants in get_submission_status WS 2021-08-19 14:12:08 +02:00
Mark Nelson 10963bad39 MDL-49202 core_grades: perform same action on categories in form
When you click on 'Edit' then 'Hide' on a grade item like a course category
that contains many grade items, the course and the grade items are set to
hidden. However, if you use the 'hidden' option on the 'Edit settings'
page it only hides that item and none of the items (assignment etc)
under that course category. We want them to be consistent.
2021-08-19 17:44:11 +08:00
Mark Nelson 1ae7e18d55 MDL-49202 core_grades: perform same action on items in form
When you click on 'Edit' then 'Hide' on a grade item like an
assignment it also hides the grades. However, If you use the
'hidden' option on the 'Edit settings' page it just hides that
item and doesn't hide grades as well. We want them to be
consistent.
2021-08-19 17:44:11 +08:00
Julien Boulen 6c661edffb MDL-71093 backup: fix backup when activity names use HTML tags 2021-08-19 11:24:21 +02:00
Thong Bui 53446defe6 MDL-72064 Questions: response selection area enough 2021-08-19 14:52:17 +07:00
Bas Brands d7ebcac861 MDL-71550 theme_boost: improve dropdown hover styles 2021-08-19 09:17:27 +02:00
Andrew Nicols 67284dfc05 Merge branch 'MDL-72282-310' of https://github.com/dcai/moodle into MOODLE_310_STABLE 2021-08-19 11:15:28 +08:00
Andrew Nicols 28d9031e44 Merge branch 'MDL-68639-3.10' of https://github.com/xcaro/moodle into MOODLE_310_STABLE 2021-08-19 10:07:41 +08:00
Eloy Lafuente (stronk7) ddcd34612f Merge branch 'MDL-72206-310' of git://github.com/junpataleta/moodle into MOODLE_310_STABLE 2021-08-18 19:32:47 +02:00
Andrew Nicols 43cc0d43f7 Merge branch 'MDL-69451-shared-temptables-3.10' of https://github.com/srdjan-catalyst/moodle into MOODLE_310_STABLE 2021-08-18 21:41:09 +08:00
Víctor Déniz cbe888148d Merge branch 'MOODLE_310_MDL-72239-v2' of https://github.com/golenkovm/moodle into MOODLE_310_STABLE 2021-08-18 13:57:54 +01:00
Mikhail Golenkov a4f657d846 MDL-72239 phpunit: Assert the number of db queries to be less or equal
The course unit test assumes the number of db call. This assumption
is correct in vanilla moodle only. Once some plugins installed their
observers may do extra db calls. Due to caching the number of actual
db calls in the unit test may be fewer.
2021-08-18 21:35:38 +10:00
Víctor Déniz f6f0f5bb6a Merge branch 'MDL-71487-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-18 09:55:04 +01:00
AMOS bot aea79216ce Automatically generated installer lang files 2021-08-18 00:07:22 +00:00
Nhan Vo 26420f609a MDL-68639 HTML Editor (Atto): Invalid HTML for nested lists 2021-08-18 04:16:21 +07:00
Dongsheng Cai 1b35161c37 MDL-72282 accessibility: update tree attributes to pass a11y check
- Move aria-* atrributes from <p> to <li>
- Move "role" attribute from <p> to <li>
- Update behat tests

Based on reference implementation from:
- https://www.w3.org/TR/wai-aria-practices-1.1/examples/treeview/treeview-2/treeview-2a.html
- https://www.w3.org/WAI/GL/wiki/Using_ARIA_trees
2021-08-17 16:28:00 +10:00
Dongsheng Cai 55eddd9989 MDL-72282 accessibility: update color to increase contrast 2021-08-17 16:27:06 +10:00
Frédéric Massart 78a5927d4d MDL-72286 editor_atto: Declare type on plugins button groups 2021-08-17 12:00:33 +10:00
Ilya Tregubov 350b022f8d Merge branch 'MDL-71814-310' of git://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-08-16 13:57:34 +02:00
Jun Pataleta 0548156a3f MDL-69855 mod_forum: Don't show reply link in email for private replies 2021-08-16 17:46:25 +08:00
Thach Le Huy 16d8b84472 MDL-71814 Atto: File picker – file info panel focus issue 2021-08-16 16:37:01 +07:00
AMOS bot 45429deb00 Automatically generated installer lang files 2021-08-14 00:07:22 +00:00
Paul Holden 1d3aa1b798 MDL-72153 privacy: correctly export user description/files. 2021-08-13 12:40:52 +01:00
Ilya Tregubov f88c85056c Merge branch 'MDL-72035-excel_csv_bom-310' of git://github.com/leonstr/moodle into MOODLE_310_STABLE 2021-08-13 11:25:58 +02:00
Jun Pataleta a393c543e1 Merge branch 'MDL-72330-310' of git://github.com/vmdef/moodle into MOODLE_310_STABLE 2021-08-13 11:00:55 +08:00
Andrew Nicols 90638ef08f Merge branch 'MDL-72325-310-tourspolicy' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-08-13 10:01:42 +08:00
Víctor Déniz a7dba247cf MDL-72330 behat: revert previous incorrect change 2021-08-13 00:02:50 +01:00
Ilya Tregubov fa2e1ed7ec weekly release 3.10.6+ 2021-08-12 16:50:19 +02:00
Ilya Tregubov f98d542d0d Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-08-12 16:50:19 +02:00
David Mudrák 41d2fb93c8 MDL-72325 user: Do not show user tours without site policy agreed
Fetching user tours used to fail on external_api::validate_context() and
require_login() calls if the user did not have the site policy agreed.

The patch introduces a check to see if the user is fully set up and
ready to use the site before attempting to load the tours.
2021-08-12 13:26:47 +02:00
Víctor Déniz cdcf1e7ee3 MDL-71500 calendar_threemonth: fix wrong behat step 2021-08-12 11:43:06 +01:00
Andrew Nicols d7da1d28a7 Merge branch 'MDL-72252-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-12 10:27:16 +08:00
Andrew Nicols 824cb06df8 Merge branch 'MDL-71844-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-12 10:25:47 +08:00
Eloy Lafuente (stronk7) e246c8b7da Merge branch 'MDL-72265_310' of https://github.com/timhunt/moodle into MOODLE_310_STABLE 2021-08-12 00:05:53 +02:00
Eloy Lafuente (stronk7) ede634df91 Merge branch 'MDL-71500-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2021-08-11 20:17:43 +02:00
Eloy Lafuente (stronk7) 4c690bb1cf Merge branch 'MDL-71945-M310S' of https://github.com/lucisgit/moodle into MOODLE_310_STABLE 2021-08-11 11:47:18 +02:00
Eloy Lafuente (stronk7) de211d92c7 Merge branch 'MDL-72242-310-svgforcedfilter' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE 2021-08-11 11:40:18 +02:00
Eloy Lafuente (stronk7) 8389fcb9fc Merge branch 'MDL-71656-310' of git://github.com/HuongNV13/moodle into MOODLE_310_STABLE 2021-08-10 19:09:50 +02:00
Eloy Lafuente (stronk7) fb03c9640d Merge branch 'MDL-70165-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-10 18:53:24 +02:00
Ilya Tregubov 6ee1ffa200 Merge branch 'MDL-72033-310' of git://github.com/NashTechOpenUniversity/moodle into MOODLE_310_STABLE 2021-08-10 16:09:35 +02:00
Tony Butler 025e5e9970 MDL-71945 mod_assign: Remove unneccesary call to assign_update_grades()
The update_grade() call achieves the same thing with additional checks.
2021-08-10 11:08:38 +01:00
Lars Bonczek 1148377a5c MDL-72271 mod_quiz: fix secure_window close function 2021-08-10 11:54:11 +02:00
Paul Holden 5b30467894 MDL-72106 calendar: redirect to same page post-subscription process.
Avoid issues when reloading page/re-sending POST data.
2021-08-10 09:41:01 +01:00
Paul Holden 21df5bc50e MDL-71844 tool_task: preserve navigation when executing task. 2021-08-09 10:45:00 +01:00
Paul Holden a23c3e4507 MDL-71487 admin: ensure filesize settings don't overflow integer. 2021-08-09 10:35:57 +01:00
Paul Holden 2833bafefb MDL-70165 course: always import inplace editable module.
It's required on the course participants table for the roles/groups
columns, but isn't always loaded after adding the first participant.
2021-08-09 10:30:06 +01:00
AMOS bot 98c3a5912f Automatically generated installer lang files 2021-08-06 00:07:24 +00:00
Srdjan 93f70c9d9d MDL-69451 dml: use same temptables for both rw and ro database handle
moodle_read_slave_trait: when creating another handle, restore temptables
property that is clobbered by raw_connect().

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

dml_pgsql_read_slave_test::test_temp_table(): use real db connection
if possible, otherwise skip the test.
2021-08-06 10:02:08 +10:00
Tim Hunt 94026281ed MDL-72265 backup: fix checking of override capabilites on restore
Thanks to Peter Dias <peter@moodle.com> for his help with the unit test.
2021-08-05 17:01:02 +01:00
Víctor Déniz 3a3060a08e weekly release 3.10.6+ 2021-08-05 16:27:30 +01:00
Víctor Déniz 7ee56a2016 Merge branch 'install_310_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_310_STABLE 2021-08-05 16:27:29 +01:00
Víctor Déniz e4640f986d Merge branch 'MDL-71835-310' of git://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-04 23:32:25 +01:00
Víctor Déniz 27603ce747 Merge branch 'MDL-71152-310' of git://github.com/roland04/moodle into MOODLE_310_STABLE 2021-08-04 20:38:10 +01:00
Víctor Déniz 5443767af6 Merge branch 'MDL-72262-310' of git://github.com/ilyatregubov/moodle into MOODLE_310_STABLE 2021-08-04 12:44:35 +01:00
abgreeve b597ecfbcd Merge branch 'MDL-71050-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-04 15:51:28 +08:00
abgreeve 811e47e0b4 Merge branch 'MDL-67833-310' of https://github.com/paulholden/moodle into MOODLE_310_STABLE 2021-08-03 10:24:39 +08:00
Dan Marsden c231cb5e64 MDL-70006 analytics: Don't send notifications to suspended enrolments. 2021-08-03 10:55:48 +12:00
Paul Holden bfe5e85895 MDL-71121 backup: apply config defaults for async backups. 2021-08-02 23:35:10 +01:00
David Mudrák 7b81244786 MDL-72242 files: Do not force text filtering of SVG files
It was a mistake to force filtering of SVG files in MDL-55243. It can
easily lead to corrupted SVG files.

The patch removes that forced filtering and clarifies the inline comment
of what and why we need to do.
2021-08-02 15:19:35 +02:00
Paul Holden 6ab27a723f MDL-72257 gradeexport_xml: detect absense of grade items to export.
Where there are no grade items with idnumbers for selection, then
nothing should be exported. Currently, this is being interpreted as
the user exporting all grade items.
2021-08-02 10:24:12 +01:00
Ilya Tregubov c23589a218 MDL-72262 behat: Make alias shorter to fix Oracle failures. 2021-08-02 08:26:44 +02:00
AMOS bot d652bad225 Automatically generated installer lang files 2021-07-31 00:07:26 +00:00
Víctor Déniz a5285d5c88 Merge branch 'MDL-72085-MOODLE_310_STABLE' of https://github.com/dmitriim/moodle into MOODLE_310_STABLE 2021-07-30 08:56:22 +01:00
Dmitrii Metelkin 07e6488a88 MDL-72085 core_phpunit: reset session notifications 2021-07-30 10:03:57 +10:00
Paul Holden f076f88211 MDL-72252 core: remove TODO file from 82e63108. 2021-07-29 08:58:05 +01:00
Jun Pataleta 44d24acd6d MDL-72206 theme_boost: Have env check classes extend alert classes
To achieve good colour contrast and consistency with other parts of
Moodle, the environment check classes need to extend the alert-*
classes.
2021-07-23 15:08:11 +08:00
Mikel Martín b4c09b497c MDL-71152 theme_boost: Use 'scroll-margin-top' for anchor links
Current anchor link offset fix is not working with 'display:flex' elements
2021-07-16 11:56:17 +02:00
boygr49p ec8fa5fc20 MDL-71500 calendar_threemonth: add behat step and coverage 2021-07-16 15:08:42 +08:00
boygr49p f3600e52cf MDL-71500 calendar_threemonth: clicking in a diff day should refresh day view
Clicking in a day in the three month block replaces the div with id starting
with calendar- so we can do so repeatedly and successfully and test that it does (with behat).
2021-07-16 15:08:41 +08:00
Andrew Nicols 6d0a3915c1 MDL-72163 admin: Plugins overview page should link to categories 2021-07-16 13:49:55 +08:00
Thach Le Huy 5c8bd91162 MDL-72033 User tours: step placement issues if screen too narrow 2021-07-16 11:24:48 +07:00
sam marshall c5d0f7605a MDL-72152 Behat: No way to test key shortcuts with letter keys
Extends the existing step 'And I press the Shift Left key' so that
it supports letter/other keys: 'And I press the Ctrl C key'.
2021-07-15 10:48:49 +01:00
Huong Nguyen 38ea26fe41 MDL-71656 atto: Add meaningful labels to colour items
Colour chooser supported:
 - atto_fontcolor
 - atto_backcolor
2021-07-13 13:07:17 +07:00
Paul Holden d93f29fa56 MDL-71050 h5p: account for parent languages retrieving translations.
Take account of parent languages when requesting given library
translation. For example if we are currently using "de_kids" as the
current language, we need to recurse each language pack looking for
a matching H5P translation ("de_kids" -> "de_du" -> "de").
2021-07-12 13:17:12 +01:00
Paul Holden e203e89891 MDL-71835 report_log: correct query returning user fullname from DB. 2021-07-09 13:54:27 +01:00
Paul Holden 74f366c50a MDL-67833 tool_customlang: break long text in component column. 2021-07-09 11:37:11 +01:00
Leon Stringer 0eb14ac1d4 MDL-72035 csvlib: Write BOM for Excel
Add option to class csv_export_writer to prefix CSV file with UTF-8 byte
order mark (BOM).  This helps Microsoft Excel detect the file's character
encoding.
2021-06-30 14:59:15 +01:00
Daniel Neis Araujo 3e62c6c272 MDL-71999 enrol: enrol_imsenterprise_allow_group_member_remove global 2021-06-23 13:19:46 -03:00
Dongsheng Cai baa2eb2619 MDL-71029 forum: fix post count for users have more than 1 enrolment 2021-06-23 09:43:56 +10:00
mohalisad fd7ce03fd2 MDL-71973 analytics cli: fix enabling model bug
Fix the exception at line 143 caused by wrong argument for constructor in line 140
2021-06-21 18:51:51 +04:30
2016 changed files with 39979 additions and 20515 deletions
+64 -5
View File
@@ -2,6 +2,7 @@
'plugins': [
'babel',
'promise',
'jsdoc',
],
'env': {
'browser': true,
@@ -191,7 +192,6 @@
'property': 'str',
'message': 'Use AMD module "core/str" or M.util.get_string()'
}],
},
overrides: [
{
@@ -200,7 +200,23 @@
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off'
'no-unused-expressions': 'off',
// === JSDocs ===
"jsdoc/check-access": 'off',
"jsdoc/check-alignment": 'off',
"jsdoc/check-param-names": 'off',
"jsdoc/check-property-names": 'off',
"jsdoc/empty-tags": 'off',
"jsdoc/implements-on-classes": 'off',
"jsdoc/multiline-blocks": 'off',
"jsdoc/require-jsdoc": 'off',
"jsdoc/require-param": 'off',
"jsdoc/require-param-name": 'off',
"jsdoc/require-param-type": 'off',
"jsdoc/require-property": 'off',
"jsdoc/require-property-name": 'off',
"jsdoc/require-property-type": 'off',
}
},
{
@@ -211,7 +227,7 @@
},
// We're using babel transpiling so use their parser
// for linting.
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
// Check AMD with some slightly stricter rules.
rules: {
'no-unused-vars': 'error',
@@ -238,11 +254,54 @@
// === Promises ===
// We have Promise now that we're using ES6.
'promise/no-native': 'off',
'promise/avoid-new': 'off'
'promise/avoid-new': 'off',
// === JSDocs ===
"jsdoc/check-access": [
'error',
],
"jsdoc/check-alignment": 1, // Recommended.
"jsdoc/check-param-names": [
'error',
],
"jsdoc/check-property-names": [
'error',
],
"jsdoc/empty-tags": [
'error',
],
"jsdoc/implements-on-classes": [
'error',
],
"jsdoc/multiline-blocks": [
'error',
],
"jsdoc/require-jsdoc": [
'error',
],
"jsdoc/require-param": [
'error',
],
"jsdoc/require-param-name": [
'error',
],
"jsdoc/require-param-type": [
'error',
],
"jsdoc/require-property": [
'error',
],
"jsdoc/require-property-name": [
'error',
],
"jsdoc/require-property-type": [
'error',
],
},
parserOptions: {
'ecmaVersion': 9,
'sourceType': 'module'
'sourceType': 'module',
'requireConfigFile': false,
}
}
]
+3 -2
View File
@@ -20,8 +20,9 @@ jobs:
uses: actions/checkout@v2
- name: Configuring node & npm
shell: bash -l {0}
run: nvm install
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
- name: Installing node stuff
run: npm install
+1 -1
View File
@@ -1 +1 @@
v14.15.0
lts/gallium
+123 -46
View File
@@ -286,6 +286,71 @@ module.exports = function(grunt) {
return ['**/tests/behat/*.feature'];
};
const babelTransform = require('@babel/core').transform;
const babel = (options = {}) => {
return {
name: 'babel',
transform: (code, id) => {
grunt.log.debug(`Transforming ${id}`);
options.filename = id;
const transformed = babelTransform(code, options);
return {
code: transformed.code,
map: transformed.map
};
}
};
};
// Note: We have to use a rate limit plugin here because rollup runs all tasks asynchronously and in parallel.
// When we kick off a full run, if we kick off a rollup of every file this will fork-bomb the machine.
// To work around this we use a concurrent Promise queue based on the number of available processors.
const rateLimit = () => {
const queue = [];
let queueRunner;
const startQueue = () => {
if (queueRunner) {
return;
}
queueRunner = setTimeout(() => {
const limit = Math.max(1, require('os').cpus().length / 2);
grunt.log.debug(`Starting rollup with queue size of ${limit}`);
runQueue(limit);
}, 100);
};
// The queue runner will run the next `size` items in the queue.
const runQueue = (size = 1) => {
queue.splice(0, size).forEach(resolve => {
resolve();
});
};
return {
name: 'ratelimit',
// The options hook is run in parallel.
// We can return an unresolved Promise which is queued for later resolution.
options: async() => {
return new Promise(resolve => {
queue.push(resolve);
startQueue();
});
},
// When an item in the queue completes, start the next item in the queue.
buildEnd: () => {
runQueue();
},
};
};
const terser = require('rollup-plugin-terser').terser;
// Project configuration.
grunt.initConfig({
eslint: {
@@ -302,55 +367,66 @@ module.exports = function(grunt) {
// Check YUI module source files.
yui: {src: files ? files : yuiSrc},
},
babel: {
options: {
sourceMaps: true,
comments: false,
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('babel-plugin-add-module-to-define.js'),
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', {'loose': false}],
'@babel/plugin-proposal-json-strings'
],
presets: [
['minify', {
// This minification plugin needs to be disabled because it breaks the
// source map generation and causes invalid source maps to be output.
simplify: false,
builtIns: false
}],
['@babel/preset-env', {
targets: {
browsers: [
">0.25%",
"last 2 versions",
"not ie <= 10",
"not op_mini all",
"not Opera > 0",
"not dead"
]
},
modules: false,
useBuiltIns: false
}]
]
},
rollup: {
dist: {
options: {
format: 'esm',
dir: 'output',
sourcemap: true,
treeshake: false,
context: 'window',
plugins: [
rateLimit({initialDelay: 0}),
babel({
sourceMaps: true,
comments: false,
compact: false,
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('babel-plugin-add-module-to-define.js'),
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', {'loose': false}],
'@babel/plugin-proposal-json-strings'
],
presets: [
['@babel/preset-env', {
targets: {
browsers: [
">0.25%",
"last 2 versions",
"not ie <= 10",
"not op_mini all",
"not Opera > 0",
"not dead"
]
},
modules: false,
useBuiltIns: false
}]
]
}),
terser({
// Do not mangle variables.
// Makes debugging easier.
mangle: false,
}),
],
},
files: [{
expand: true,
src: files ? files : amdSrc,
rename: babelRename
}]
}
}],
},
},
jsdoc: {
dist: {
@@ -842,7 +918,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-stylelint');
grunt.loadNpmTasks('grunt-babel');
grunt.loadNpmTasks('grunt-rollup');
grunt.loadNpmTasks('grunt-jsdoc');
// Rename the grunt-contrib-watch "watch" task because we're going to wrap it.
@@ -854,7 +931,7 @@ module.exports = function(grunt) {
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', tasks.ignorefiles);
grunt.registerTask('watch', 'Run tasks on file changes', tasks.watch);
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
grunt.registerTask('amd', ['ignorefiles', 'eslint:amd', 'babel']);
grunt.registerTask('amd', ['ignorefiles', 'eslint:amd', 'rollup']);
grunt.registerTask('js', ['amd', 'yui']);
// Register CSS tasks.
-1
View File
@@ -1 +0,0 @@
mod/forum/tests/behat/forum_subscriptions_default.feature
+3 -1
View File
@@ -126,6 +126,7 @@ class filesize extends \admin_setting {
if (is_null($bytes)) {
return null;
}
$bytes = intval($bytes);
return self::parse_bytes($bytes);
}
@@ -145,9 +146,10 @@ class filesize extends \admin_setting {
return get_string('errorsetting', 'admin');
}
// Calculate size in bytes, ensuring we don't overflow PHP_INT_MAX.
$bytes = $data['v'] * $data['u'];
$result = (is_int($bytes) && $this->config_write($this->name, $bytes));
$result = $this->config_write($this->name, $bytes);
return ($result ? '' : get_string('errorsetting', 'admin'));
}
+8 -1
View File
@@ -120,7 +120,14 @@ if ($options['unset'] || $options['set'] !== null) {
}
// Check that the variable is not hard-set in the main config.php already.
if (array_key_exists($options['name'], $CFG->config_php_settings)) {
$component = $options['component'];
if (!empty($component)) {
$componentsettings = $CFG->forced_plugin_settings[$component] ?? [];
$settinginconfig = array_key_exists($options['name'], $componentsettings);
} else {
$settinginconfig = array_key_exists($options['name'], $CFG->config_php_settings);
}
if ($settinginconfig) {
cli_error('The configuration variable is hard-set in the config.php, unable to change.', 4);
}
+15
View File
@@ -3163,6 +3163,11 @@
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_igbinary322_version" level="optional">
<FEEDBACK>
<ON_CHECK message="igbinary322buggyversion" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.10" requires="3.5">
@@ -3345,6 +3350,11 @@
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_igbinary322_version" level="optional">
<FEEDBACK>
<ON_CHECK message="igbinary322buggyversion" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.11" requires="3.6">
@@ -3714,6 +3724,11 @@
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
<FEEDBACK>
<ON_CHECK message="iscustomadminwarnings" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+27 -16
View File
@@ -220,7 +220,7 @@ class core_admin_renderer extends plugin_renderer_base {
$output .= $this->container_end();
}
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get', true);
$button->class = 'continuebutton';
$output .= $this->render($button);
$output .= $this->footer();
@@ -1616,12 +1616,18 @@ class core_admin_renderer extends plugin_renderer_base {
$plugininfo = $pluginman->get_plugins();
$numtotal = $numextension = $numupdatable = 0;
$numtotal = $numextension = $numupdatable = $numinstallable = 0;
foreach ($plugininfo as $type => $plugins) {
foreach ($plugins as $name => $plugin) {
if ($plugin->available_updates()) {
if ($res = $plugin->available_updates()) {
$numupdatable++;
foreach ($res as $updateinfo) {
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason, false)) {
$numinstallable++;
break;
}
}
}
if ($plugin->get_status() === core_plugin_manager::PLUGIN_STATUS_MISSING) {
continue;
@@ -1664,16 +1670,13 @@ class core_admin_renderer extends plugin_renderer_base {
$out .= $this->output->heading(get_string('overviewext', 'core_plugin'), 3);
}
if ($numupdatable) {
$installableupdates = $pluginman->filter_installable($pluginman->available_updates());
if ($installableupdates) {
$out .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', count($installableupdates)),
'post',
array('class' => 'singlebutton updateavailableinstallall')
);
}
if ($numinstallable) {
$out .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', $numinstallable),
'post',
array('class' => 'singlebutton updateavailableinstallall')
);
}
$out .= html_writer::div($infoall, 'info info-all').
@@ -1907,7 +1910,7 @@ class core_admin_renderer extends plugin_renderer_base {
'infos'
);
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason)) {
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason, false)) {
$box .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdate' => $updateinfo->component,
'installupdateversion' => $updateinfo->version)),
@@ -2127,8 +2130,16 @@ class core_admin_renderer extends plugin_renderer_base {
$output .= $this->container_start('upgradekeyreq');
$output .= $this->heading(get_string('upgradekeyreq', 'core_admin'));
$output .= html_writer::start_tag('form', array('method' => 'POST', 'action' => $url));
$output .= html_writer::empty_tag('input', array('name' => 'upgradekey', 'type' => 'password'));
$output .= html_writer::empty_tag('input', array('value' => get_string('submit'), 'type' => 'submit'));
$output .= html_writer::empty_tag('input', [
'name' => 'upgradekey',
'type' => 'password',
'class' => 'form-control w-auto',
]);
$output .= html_writer::empty_tag('input', [
'type' => 'submit',
'value' => get_string('submit'),
'class' => 'btn btn-primary mt-3',
]);
$output .= html_writer::end_tag('form');
$output .= $this->container_end();
$output .= $this->footer();
+2 -5
View File
@@ -53,11 +53,8 @@ class behat_admin extends behat_base {
}
foreach ($data as $label => $value) {
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', [get_string('administrationsite')]);
// Search by label.
$this->execute('behat_forms::i_set_the_field_to', [get_string('search'), $label]);
$this->execute("behat_forms::press_button", get_string('search', 'admin'));
// Navigate straight to the search results fo rthis label.
$this->execute('behat_general::i_visit', ["/admin/search.php?query=" . urlencode($label)]);
// Admin settings does not use the same DOM structure than other moodle forms
// but we also need to use lib/behat/form_field/* to deal with the different moodle form elements.
+4 -2
View File
@@ -14,6 +14,10 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
And the following "cohorts" exist:
| name | idnumber |
| Cohort 1 | CH1 |
And the following "cohort members" exist:
| user | cohort |
| user2 | CH1 |
| user3 | CH1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
@@ -23,8 +27,6 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
| user2 | C1 | student |
| user3 | C1 | student |
And I log in as "admin"
And I add "User Two (two@example.com)" user to "CH1" cohort members
And I add "User Three (three@example.com)" user to "CH1" cohort members
And I navigate to "Users > Accounts > Browse list of users" in site administration
Scenario: Filter user accounts by role and cohort
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_analytics/log_info",["jquery","core/str","core/modal_factory","core/notification"],function(a,b,c,d){return{loadInfo:function loadInfo(e,f){var g=a("[data-model-log-id=\""+e+"\"]");b.get_string("loginfo","tool_analytics").then(function(b){var d=a("<ul>");f.forEach(function(a){d.append("<li>"+a+"</li>")});d.append("</ul>");return c.create({title:b,body:d.html(),large:!0},g)}).catch(d.exception)}}});
//# sourceMappingURL=log_info.min.js.map
/**
* Shows a dialogue with info about this logs.
*
* @module tool_analytics/log_info
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_analytics/log_info",["jquery","core/str","core/modal_factory","core/notification"],(function($,str,ModalFactory,Notification){return{loadInfo:function(id,info){var link=$('[data-model-log-id="'+id+'"]');str.get_string("loginfo","tool_analytics").then((function(langString){var bodyInfo=$("<ul>");return info.forEach((function(item){bodyInfo.append("<li>"+item+"</li>")})),bodyInfo.append("</ul>"),ModalFactory.create({title:langString,body:bodyInfo.html(),large:!0},link)})).catch(Notification.exception)}}}));
//# sourceMappingURL=log_info.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/log_info.js"],"names":["define","$","str","ModalFactory","Notification","loadInfo","id","info","link","get_string","then","langString","bodyInfo","forEach","item","append","create","title","body","html","large","catch","exception"],"mappings":"AAsBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,oBAAvB,CAA6C,mBAA7C,CAAD,CAAoE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+BC,CAA/B,CAA6C,CAEnH,MAAoD,CAShDC,QAAQ,CAAE,kBAASC,CAAT,CAAaC,CAAb,CAAmB,CAEzB,GAAIC,CAAAA,CAAI,CAAGP,CAAC,CAAC,wBAAyBK,CAAzB,CAA8B,KAA/B,CAAZ,CACAJ,CAAG,CAACO,UAAJ,CAAe,SAAf,CAA0B,gBAA1B,EAA4CC,IAA5C,CAAiD,SAASC,CAAT,CAAqB,CAElE,GAAIC,CAAAA,CAAQ,CAAGX,CAAC,CAAC,MAAD,CAAhB,CACAM,CAAI,CAACM,OAAL,CAAa,SAASC,CAAT,CAAe,CACxBF,CAAQ,CAACG,MAAT,CAAgB,OAASD,CAAT,CAAgB,OAAhC,CACH,CAFD,EAGAF,CAAQ,CAACG,MAAT,CAAgB,OAAhB,EAEA,MAAOZ,CAAAA,CAAY,CAACa,MAAb,CAAoB,CACvBC,KAAK,CAAEN,CADgB,CAEvBO,IAAI,CAAEN,CAAQ,CAACO,IAAT,EAFiB,CAGvBC,KAAK,GAHkB,CAApB,CAIJZ,CAJI,CAMV,CAdD,EAcGa,KAdH,CAcSjB,CAAY,CAACkB,SAdtB,CAeH,CA3B+C,CA6BvD,CA/BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Shows a dialogue with info about this logs.\n *\n * @module tool_analytics/log_info\n * @copyright 2017 David Monllao {@link http://www.davidmonllao.com}\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], function($, str, ModalFactory, Notification) {\n\n return /** @alias module:tool_analytics/log_info */ {\n\n /**\n * Prepares a modal info for a log's results.\n *\n * @method loadInfo\n * @param {int} id\n * @param {string[]} info\n */\n loadInfo: function(id, info) {\n\n var link = $('[data-model-log-id=\"' + id + '\"]');\n str.get_string('loginfo', 'tool_analytics').then(function(langString) {\n\n var bodyInfo = $(\"<ul>\");\n info.forEach(function(item) {\n bodyInfo.append('<li>' + item + '</li>');\n });\n bodyInfo.append(\"</ul>\");\n\n return ModalFactory.create({\n title: langString,\n body: bodyInfo.html(),\n large: true,\n }, link);\n\n }).catch(Notification.exception);\n }\n };\n});\n"],"file":"log_info.min.js"}
{"version":3,"file":"log_info.min.js","sources":["../src/log_info.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Shows a dialogue with info about this logs.\n *\n * @module tool_analytics/log_info\n * @copyright 2017 David Monllao {@link http://www.davidmonllao.com}\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], function($, str, ModalFactory, Notification) {\n\n return /** @alias module:tool_analytics/log_info */ {\n\n /**\n * Prepares a modal info for a log's results.\n *\n * @method loadInfo\n * @param {int} id\n * @param {string[]} info\n */\n loadInfo: function(id, info) {\n\n var link = $('[data-model-log-id=\"' + id + '\"]');\n str.get_string('loginfo', 'tool_analytics').then(function(langString) {\n\n var bodyInfo = $(\"<ul>\");\n info.forEach(function(item) {\n bodyInfo.append('<li>' + item + '</li>');\n });\n bodyInfo.append(\"</ul>\");\n\n return ModalFactory.create({\n title: langString,\n body: bodyInfo.html(),\n large: true,\n }, link);\n\n }).catch(Notification.exception);\n }\n };\n});\n"],"names":["define","$","str","ModalFactory","Notification","loadInfo","id","info","link","get_string","then","langString","bodyInfo","forEach","item","append","create","title","body","html","large","catch","exception"],"mappings":";;;;;;;AAsBAA,iCAAO,CAAC,SAAU,WAAY,qBAAsB,sBAAsB,SAASC,EAAGC,IAAKC,aAAcC,oBAEjD,CAShDC,SAAU,SAASC,GAAIC,UAEfC,KAAOP,EAAE,uBAAyBK,GAAK,MAC3CJ,IAAIO,WAAW,UAAW,kBAAkBC,MAAK,SAASC,gBAElDC,SAAWX,EAAE,eACjBM,KAAKM,SAAQ,SAASC,MAClBF,SAASG,OAAO,OAASD,KAAO,YAEpCF,SAASG,OAAO,SAETZ,aAAaa,OAAO,CACvBC,MAAON,WACPO,KAAMN,SAASO,OACfC,OAAO,GACRZ,SAEJa,MAAMjB,aAAakB"}
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_analytics/model",["jquery","core/str","core/log","core/notification","core/modal_factory","core/modal_events","core/templates"],function(b,c,d,e,f,g,h){var i={clear:{title:{key:"clearpredictions",component:"tool_analytics"},body:{key:"clearmodelpredictions",component:"tool_analytics"}},delete:{title:{key:"delete",component:"tool_analytics"},body:{key:"deletemodelconfirmation",component:"tool_analytics"}}},j=function(a){var c=b(a).closest("[data-model-name]");if(c.length){return c.attr("data-model-name")}else{d.error("Unexpected DOM error - unable to obtain the model name");return""}};return{confirmAction:function confirmAction(a,h){b("[data-action-id=\""+a+"\"]").on("click",function(k){k.preventDefault();var l=b(k.currentTarget);if("undefined"==typeof i[h]){d.error("Action \""+h+"\" is not allowed.");return}var a=[i[h].title,i[h].body];a[1].param=j(l);var m=c.get_strings(a),n=f.create({type:f.types.SAVE_CANCEL});b.when(m,n).then(function(a,b){b.setTitle(a[0]);b.setBody(a[1]);b.setSaveButtonText(a[0]);b.getRoot().on(g.save,function(){window.location.href=l.attr("href")});b.show();return b}).fail(e.exception)})},selectEvaluationOptions:function selectEvaluationOptions(a,d){b("[data-action-id=\""+a+"\"]").on("click",function(i){i.preventDefault();var j=b(i.currentTarget),a=b(this).attr("data-timesplitting-methods"),k=c.get_strings([{key:"evaluatemodel",component:"tool_analytics"},{key:"evaluate",component:"tool_analytics"}]),l=f.create({type:f.types.SAVE_CANCEL}),m=h.render("tool_analytics/evaluation_options",{trainedexternally:d,timesplittingmethods:JSON.parse(a)});b.when(k,l).then(function(a,c){c.getRoot().on(g.hidden,c.destroy.bind(c));c.setTitle(a[0]);c.setSaveButtonText(a[1]);c.setBody(m);c.getRoot().on(g.save,function(){var a=b("input[name='evaluationmode']:checked").val();if("trainedmodel"==a){j.attr("href",j.attr("href")+"&mode=trainedmodel")}var c=b("#id-evaluation-timesplitting").val();j.attr("href",j.attr("href")+"&timesplitting="+c);window.location.href=j.attr("href")});c.show();return c}).fail(e.exception)})},selectExportOptions:function selectExportOptions(a,d){b("[data-action-id=\""+a+"\"]").on("click",function(i){i.preventDefault();var j=b(i.currentTarget);if(!d){j.attr("href",j.attr("href")+"&action=exportmodel&includeweights=0");window.location.href=j.attr("href");return}var a=c.get_strings([{key:"export",component:"tool_analytics"}]),k=f.create({type:f.types.SAVE_CANCEL}),l=h.render("tool_analytics/export_options",{});b.when(a,k).then(function(a,c){c.getRoot().on(g.hidden,c.destroy.bind(c));c.setTitle(a[0]);c.setSaveButtonText(a[0]);c.setBody(l);c.getRoot().on(g.save,function(){var a=b("input[name='exportoption']:checked").val();if("exportdata"==a){j.attr("href",j.attr("href")+"&action=exportdata")}else{j.attr("href",j.attr("href")+"&action=exportmodel");if(b("#id-includeweights").is(":checked")){j.attr("href",j.attr("href")+"&includeweights=1")}else{j.attr("href",j.attr("href")+"&includeweights=0")}}window.location.href=j.attr("href")});c.show();return c}).fail(e.exception)})}}});
//# sourceMappingURL=model.min.js.map
/**
* AMD module for model actions confirmation.
*
* @module tool_analytics/model
* @copyright 2017 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_analytics/model",["jquery","core/str","core/log","core/notification","core/modal_factory","core/modal_events","core/templates"],(function($,Str,log,Notification,ModalFactory,ModalEvents,Templates){var actionsList={clear:{title:{key:"clearpredictions",component:"tool_analytics"},body:{key:"clearmodelpredictions",component:"tool_analytics"}},delete:{title:{key:"delete",component:"tool_analytics"},body:{key:"deletemodelconfirmation",component:"tool_analytics"}}};return{confirmAction:function(actionId,actionType){$('[data-action-id="'+actionId+'"]').on("click",(function(ev){ev.preventDefault();var a=$(ev.currentTarget);if(void 0!==actionsList[actionType]){var wrap,reqStrings=[actionsList[actionType].title,actionsList[actionType].body];reqStrings[1].param=(wrap=$(a).closest("[data-model-name]")).length?wrap.attr("data-model-name"):(log.error("Unexpected DOM error - unable to obtain the model name"),"");var stringsPromise=Str.get_strings(reqStrings),modalPromise=ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL});$.when(stringsPromise,modalPromise).then((function(strings,modal){return modal.setTitle(strings[0]),modal.setBody(strings[1]),modal.setSaveButtonText(strings[0]),modal.getRoot().on(ModalEvents.save,(function(){window.location.href=a.attr("href")})),modal.show(),modal})).fail(Notification.exception)}else log.error('Action "'+actionType+'" is not allowed.')}))},selectEvaluationOptions:function(actionId,trainedOnlyExternally){$('[data-action-id="'+actionId+'"]').on("click",(function(ev){ev.preventDefault();var a=$(ev.currentTarget),timeSplittingMethods=$(this).attr("data-timesplitting-methods"),stringsPromise=Str.get_strings([{key:"evaluatemodel",component:"tool_analytics"},{key:"evaluate",component:"tool_analytics"}]),modalPromise=ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL}),bodyPromise=Templates.render("tool_analytics/evaluation_options",{trainedexternally:trainedOnlyExternally,timesplittingmethods:JSON.parse(timeSplittingMethods)});$.when(stringsPromise,modalPromise).then((function(strings,modal){return modal.getRoot().on(ModalEvents.hidden,modal.destroy.bind(modal)),modal.setTitle(strings[0]),modal.setSaveButtonText(strings[1]),modal.setBody(bodyPromise),modal.getRoot().on(ModalEvents.save,(function(){"trainedmodel"==$("input[name='evaluationmode']:checked").val()&&a.attr("href",a.attr("href")+"&mode=trainedmodel");var timeSplittingMethod=$("#id-evaluation-timesplitting").val();a.attr("href",a.attr("href")+"&timesplitting="+timeSplittingMethod),window.location.href=a.attr("href")})),modal.show(),modal})).fail(Notification.exception)}))},selectExportOptions:function(actionId,isTrained){$('[data-action-id="'+actionId+'"]').on("click",(function(ev){ev.preventDefault();var a=$(ev.currentTarget);if(!isTrained)return a.attr("href",a.attr("href")+"&action=exportmodel&includeweights=0"),void(window.location.href=a.attr("href"));var stringsPromise=Str.get_strings([{key:"export",component:"tool_analytics"}]),modalPromise=ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL}),bodyPromise=Templates.render("tool_analytics/export_options",{});$.when(stringsPromise,modalPromise).then((function(strings,modal){return modal.getRoot().on(ModalEvents.hidden,modal.destroy.bind(modal)),modal.setTitle(strings[0]),modal.setSaveButtonText(strings[0]),modal.setBody(bodyPromise),modal.getRoot().on(ModalEvents.save,(function(){"exportdata"==$("input[name='exportoption']:checked").val()?a.attr("href",a.attr("href")+"&action=exportdata"):(a.attr("href",a.attr("href")+"&action=exportmodel"),$("#id-includeweights").is(":checked")?a.attr("href",a.attr("href")+"&includeweights=1"):a.attr("href",a.attr("href")+"&includeweights=0")),window.location.href=a.attr("href")})),modal.show(),modal})).fail(Notification.exception)}))}}}));
//# sourceMappingURL=model.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_analytics/potential-contexts",["jquery","core/ajax"],function(a,b){return{processResults:function processResults(b,c){var d=[];if(a.isArray(c)){a.each(c,function(a,b){d.push({value:b.id,label:b.name})});return d}else{return c}},transport:function transport(c,d,e,f){var g,h=a(c).attr("modelid")||null;g=b.call([{methodname:"tool_analytics_potential_contexts",args:{query:d,modelid:h}}]);g[0].then(e).fail(f)}}});
//# sourceMappingURL=potential-contexts.min.js.map
/**
* Potential contexts selector module.
*
* @module tool_analytics/potential-contexts
* @copyright 2019 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_analytics/potential-contexts",["jquery","core/ajax"],(function($,Ajax){return{processResults:function(selector,results){var contexts=[];return $.isArray(results)?($.each(results,(function(index,context){contexts.push({value:context.id,label:context.name})})),contexts):results},transport:function(selector,query,success,failure){var modelid=$(selector).attr("modelid")||null;Ajax.call([{methodname:"tool_analytics_potential_contexts",args:{query:query,modelid:modelid}}])[0].then(success).fail(failure)}}}));
//# sourceMappingURL=potential-contexts.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/potential-contexts.js"],"names":["define","$","Ajax","processResults","selector","results","contexts","isArray","each","index","context","push","value","id","label","name","transport","query","success","failure","promise","modelid","attr","call","methodname","args","then","fail"],"mappings":"AAuBAA,OAAM,qCAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAE9C,MAA8D,CAE1DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAQ,CAAG,EAAf,CACA,GAAIL,CAAC,CAACM,OAAF,CAAUF,CAAV,CAAJ,CAAwB,CACpBJ,CAAC,CAACO,IAAF,CAAOH,CAAP,CAAgB,SAASI,CAAT,CAAgBC,CAAhB,CAAyB,CACrCJ,CAAQ,CAACK,IAAT,CAAc,CACVC,KAAK,CAAEF,CAAO,CAACG,EADL,CAEVC,KAAK,CAAEJ,CAAO,CAACK,IAFL,CAAd,CAIH,CALD,EAMA,MAAOT,CAAAA,CAEV,CATD,IASO,CACH,MAAOD,CAAAA,CACV,CACJ,CAhByD,CAkB1DW,SAAS,CAAE,mBAASZ,CAAT,CAAmBa,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAG/CC,CAAO,CAAGpB,CAAC,CAACG,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,SAAjB,GAA+B,IAHM,CAInDF,CAAO,CAAGlB,CAAI,CAACqB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,mCADK,CAEjBC,IAAI,CAAE,CACFR,KAAK,CAAEA,CADL,CAEFI,OAAO,CAAEA,CAFP,CAFW,CAAD,CAAV,CAAV,CAQAD,CAAO,CAAC,CAAD,CAAP,CAAWM,IAAX,CAAgBR,CAAhB,EAAyBS,IAAzB,CAA8BR,CAA9B,CACH,CA/ByD,CAmCjE,CArCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Potential contexts selector module.\n *\n * @module tool_analytics/potential-contexts\n * @copyright 2019 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n return /** @alias module:tool_analytics/potential-contexts */ {\n\n processResults: function(selector, results) {\n var contexts = [];\n if ($.isArray(results)) {\n $.each(results, function(index, context) {\n contexts.push({\n value: context.id,\n label: context.name\n });\n });\n return contexts;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n let modelid = $(selector).attr('modelid') || null;\n promise = Ajax.call([{\n methodname: 'tool_analytics_potential_contexts',\n args: {\n query: query,\n modelid: modelid\n }\n }]);\n\n promise[0].then(success).fail(failure);\n }\n\n };\n\n});\n"],"file":"potential-contexts.min.js"}
{"version":3,"file":"potential-contexts.min.js","sources":["../src/potential-contexts.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Potential contexts selector module.\n *\n * @module tool_analytics/potential-contexts\n * @copyright 2019 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n return /** @alias module:tool_analytics/potential-contexts */ {\n\n processResults: function(selector, results) {\n var contexts = [];\n if ($.isArray(results)) {\n $.each(results, function(index, context) {\n contexts.push({\n value: context.id,\n label: context.name\n });\n });\n return contexts;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n let modelid = $(selector).attr('modelid') || null;\n promise = Ajax.call([{\n methodname: 'tool_analytics_potential_contexts',\n args: {\n query: query,\n modelid: modelid\n }\n }]);\n\n promise[0].then(success).fail(failure);\n }\n\n };\n\n});\n"],"names":["define","$","Ajax","processResults","selector","results","contexts","isArray","each","index","context","push","value","id","label","name","transport","query","success","failure","modelid","attr","call","methodname","args","then","fail"],"mappings":";;;;;;;AAuBAA,2CAAO,CAAC,SAAU,cAAc,SAASC,EAAGC,YAEsB,CAE1DC,eAAgB,SAASC,SAAUC,aAC3BC,SAAW,UACXL,EAAEM,QAAQF,UACVJ,EAAEO,KAAKH,SAAS,SAASI,MAAOC,SAC5BJ,SAASK,KAAK,CACVC,MAAOF,QAAQG,GACfC,MAAOJ,QAAQK,UAGhBT,UAGAD,SAIfW,UAAW,SAASZ,SAAUa,MAAOC,QAASC,aAGtCC,QAAUnB,EAAEG,UAAUiB,KAAK,YAAc,KACnCnB,KAAKoB,KAAK,CAAC,CACjBC,WAAY,oCACZC,KAAM,CACFP,MAAOA,MACPG,QAASA,YAIT,GAAGK,KAAKP,SAASQ,KAAKP"}
+1 -1
View File
@@ -137,7 +137,7 @@ if (!empty($validdatasets) && !$model->is_enabled() && $options['non-interactive
}
// Refresh the instance to prevent unexpected issues.
$model = new \core_analytics\model($modelobj);
$model = new \core_analytics\model($options['modelid']);
// Set the time splitting method file and enable it.
$model->enable($input);
@@ -0,0 +1,110 @@
@tool_behat
Feature: Verify that the behat login and logout steps work as expected
In order to use behat login and log out steps
As a test writer
I need to verify that login and logout happen when the steps are used
Scenario: Log in as a user using the step
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
When I log in as "traverst1"
Then I should see "Thomas Travers"
@javascript
Scenario: Log in as a user using the step (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
When I log in as "traverst1"
Then I should see "Thomas Travers"
Scenario: Log out using the log out step
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And I am logged in as traverst1
When I log out
Then I should not see "Thomas Travers"
And I should see "You are not logged in"
@javascript
Scenario: Log out using the log out step (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And I am logged in as traverst1
When I log out
Then I should not see "Thomas Travers"
And I should see "You are not logged in"
Scenario: Log in step should automatically log user out if already logged in
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And I am logged in as traverst1
When I log in as "emeryj"
Then I should not see "Thomas Travers"
And I should see "Jane Emery"
@javascript
Scenario: Log in step should automatically log user out if already logged in (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And I am logged in as traverst1
When I log in as "emeryj"
Then I should not see "Thomas Travers"
And I should see "Jane Emery"
Scenario: I am on page logged in as should redirect to correct page
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
@javascript
Scenario: I am on page logged in as should redirect to correct page (javascript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
Scenario: I am on page logged in as should redirect to correct page when automatically logging a user out
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
And I am logged in as emeryj
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
@javascript
Scenario: I am on page logged in as should redirect to correct page when automatically logging a user out (javacript)
Given the following "users" exist:
| username | firstname | lastname |
| traverst1 | Thomas | Travers |
| emeryj | Jane | Emery |
And the following "course" exists:
| fullname | Life, the Universe, and Everything |
| shortname | hhgttg |
And I am logged in as emeryj
When I am on the hhgttg Course page logged in as traverst1
Then I should see "Thomas Travers"
And I should see "Life, the Universe, and Everything"
@@ -1 +1 @@
YUI.add("moodle-tool_capability-search",function(s,t){var e=function(){e.superclass.constructor.apply(this,arguments)};e.prototype={form:null,select:null,selectoptions:{},input:null,button:null,cancel:null,lastsearch:null,initializer:function(){this.form=s.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(t){var e=t.get("value");this.selectoptions[e]=t},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=s.Node.create('<div id="capabilitysearchui" class="input-group simplesearchform mb-2"data-fieldtype="text"></div>'),e=s.Node.create('<label for="capabilitysearch"><span class="sr-only"'+this.get("strsearch")+"</span></label>");this.cancel=s.Node.create('<a class="btn btn-clear d-none icon-no-margin"><i class="icon fa fa-times fa-fw " aria-hidden="true"></i></a>'),this.input=s.Node.create('<input type="text" class="form-control withclear" placeholder="'+this.get("strsearch")+'"id="capabilitysearch" />'),t.append(e).append(this.input).append(this.cancel),this.select.insert(t,"before"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.cancel.on("click",function(){this.input.set("value",""),this.typed()},this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",""===this.select.get("value"))},typed:function(){var t,e=this.input.get("value"),s=0,i=null;for(t in this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove(),this.selectoptions)0<=t.indexOf(e)&&(s++,i=this.selectoptions[t],this.select.append(this.selectoptions[t]));0===s?this.input.addClass("error"):(this.input.removeClass("error"),1===s&&i.set("selected",!0)),""!==e?this.cancel.removeClass("d-none"):this.cancel.addClass("d-none"),this.validate()}},s.extend(e,s.Base,e.prototype,{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(t){new e(t)}},"@VERSION@",{requires:["base","node"]});
YUI.add("moodle-tool_capability-search",function(s,t){var e=function(){e.superclass.constructor.apply(this,arguments)};s.extend(e,s.Base,e.prototype={form:null,select:null,selectoptions:{},input:null,button:null,cancel:null,lastsearch:null,initializer:function(){this.form=s.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(t){var e=t.get("value");this.selectoptions[e]=t},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=s.Node.create('<div id="capabilitysearchui" class="input-group simplesearchform mb-2"data-fieldtype="text"></div>'),e=s.Node.create('<label for="capabilitysearch"><span class="sr-only"'+this.get("strsearch")+"</span></label>");this.cancel=s.Node.create('<a class="btn btn-clear d-none icon-no-margin"><i class="icon fa fa-times fa-fw " aria-hidden="true"></i></a>'),this.input=s.Node.create('<input type="text" class="form-control withclear" placeholder="'+this.get("strsearch")+'"id="capabilitysearch" />'),t.append(e).append(this.input).append(this.cancel),this.select.insert(t,"before"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.cancel.on("click",function(){this.input.set("value",""),this.typed()},this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",""===this.select.get("value"))},typed:function(){var t,e=this.input.get("value"),s=0,i=null;for(t in this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove(),this.selectoptions)0<=t.indexOf(e)&&(s++,i=this.selectoptions[t],this.select.append(this.selectoptions[t]));0===s?this.input.addClass("error"):(this.input.removeClass("error"),1===s&&i.set("selected",!0)),""!==e?this.cancel.removeClass("d-none"):this.cancel.addClass("d-none"),this.validate()}},{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(t){new e(t)}},"@VERSION@",{requires:["base","node"]});
+15 -2
View File
@@ -36,7 +36,7 @@ class tool_customlang_utils {
* Rough number of strings that are being processed during a full checkout.
* This is used to estimate the progress of the checkout.
*/
const ROUGH_NUMBER_OF_STRINGS = 16500;
const ROUGH_NUMBER_OF_STRINGS = 30000;
/** @var array cache of {@link self::list_components()} results */
private static $components = null;
@@ -91,9 +91,22 @@ class tool_customlang_utils {
public static function checkout($lang, progress_bar $progressbar = null) {
global $DB;
// For behat executions we are going to load only a few components in the
// language customisation structures. Using the whole "en" langpack is
// too much slow (leads to Selenium 30s timeouts, especially on slow
// environments) and we don't really need the whole thing for tests. So,
// apart from escaping from the timeouts, we are also saving some good minutes
// in tests. See MDL-70014 and linked issues for more info.
$behatneeded = ['core', 'core_langconfig', 'tool_customlang'];
// make sure that all components are registered
$current = $DB->get_records('tool_customlang_components', null, 'name', 'name,version,id');
foreach (self::list_components() as $component) {
// Filter out unwanted components when running behat.
if (defined('BEHAT_SITE_RUNNING') && !in_array($component, $behatneeded)) {
continue;
}
if (empty($current[$component])) {
$record = new stdclass();
$record->name = $component;
@@ -103,7 +116,7 @@ class tool_customlang_utils {
$record->version = $version;
}
$DB->insert_record('tool_customlang_components', $record);
} elseif ($version = get_component_version($component)) {
} else if ($version = get_component_version($component)) {
if (is_null($current[$component]->version) or ($version > $current[$component]->version)) {
$DB->set_field('tool_customlang_components', 'version', $version, array('id' => $current[$component]->id));
}
@@ -97,7 +97,7 @@
{{#modified}}list-group-item-info{{/modified}}"
>
<div class="row">
<div class="col-sm-4 col-md-2">
<div class="col-sm-4 col-md-2 text-break">
<div class="d-md-none">
<strong>{{#str}}headingcomponent, tool_customlang{{/str}}</strong>
</div>
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/add_category",["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],function(a,b,c,d,e,f,g){var h={CATEGORY_LINK:"[data-add-element=\"category\"]"},i=function(a){this.contextId=a;this.strings=b.get_strings([{key:"addcategory",component:"tool_dataprivacy"},{key:"save",component:"admin"}]);this.registerEventListeners()};i.prototype.contextId=0;i.prototype.strings=0;i.prototype.registerEventListeners=function(){var b=a(h.CATEGORY_LINK);b.on("click",function(){return this.strings.then(function(a){e.create({type:e.types.SAVE_CANCEL,title:a[0],body:""},b).done(function(b){this.setupFormModal(b,a[1])}.bind(this))}.bind(this)).fail(d.exception)}.bind(this))};i.prototype.getBody=function(a){var b=null;if("undefined"!=typeof a){b={jsonformdata:JSON.stringify(a)}}return g.loadFragment("tool_dataprivacy","addcategory_form",this.contextId,b)};i.prototype.setupFormModal=function(a,b){a.setLarge();a.setSaveButtonText(b);a.getRoot().on(f.hidden,this.destroy.bind(this));a.setBody(this.getBody());a.getRoot().on(f.save,this.submitForm.bind(this));a.getRoot().on("submit","form",this.submitFormAjax.bind(this));this.modal=a;a.show()};i.prototype.submitForm=function(a){a.preventDefault();this.modal.getRoot().find("form").submit()};i.prototype.submitFormAjax=function(a){a.preventDefault();var b=this.modal.getRoot().find("form").serialize();c.call([{methodname:"tool_dataprivacy_create_category_form",args:{jsonformdata:JSON.stringify(b)},done:function(a){if(a.validationerrors){this.modal.setBody(this.getBody(b))}else{this.close()}}.bind(this),fail:d.exception}])};i.prototype.close=function(){this.destroy();document.location.reload()};i.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()});this.modal.destroy()};i.prototype.removeListeners=function(){a(h.CATEGORY_LINK).off("click")};return{getInstance:function getInstance(a){return new i(a)}}});
//# sourceMappingURL=add_category.min.js.map
/**
* Module to add categories.
*
* @module tool_dataprivacy/add_category
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/add_category",["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],(function($,Str,Ajax,Notification,ModalFactory,ModalEvents,Fragment){var SELECTORS_CATEGORY_LINK='[data-add-element="category"]',AddCategory=function(contextId){this.contextId=contextId;this.strings=Str.get_strings([{key:"addcategory",component:"tool_dataprivacy"},{key:"save",component:"admin"}]),this.registerEventListeners()};return AddCategory.prototype.contextId=0,AddCategory.prototype.strings=0,AddCategory.prototype.registerEventListeners=function(){var trigger=$(SELECTORS_CATEGORY_LINK);trigger.on("click",function(){return this.strings.then(function(strings){ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL,title:strings[0],body:""},trigger).done(function(modal){this.setupFormModal(modal,strings[1])}.bind(this))}.bind(this)).fail(Notification.exception)}.bind(this))},AddCategory.prototype.getBody=function(formdata){var params=null;return void 0!==formdata&&(params={jsonformdata:JSON.stringify(formdata)}),Fragment.loadFragment("tool_dataprivacy","addcategory_form",this.contextId,params)},AddCategory.prototype.setupFormModal=function(modal,saveText){modal.setLarge(),modal.setSaveButtonText(saveText),modal.getRoot().on(ModalEvents.hidden,this.destroy.bind(this)),modal.setBody(this.getBody()),modal.getRoot().on(ModalEvents.save,this.submitForm.bind(this)),modal.getRoot().on("submit","form",this.submitFormAjax.bind(this)),this.modal=modal,modal.show()},AddCategory.prototype.submitForm=function(e){e.preventDefault(),this.modal.getRoot().find("form").submit()},AddCategory.prototype.submitFormAjax=function(e){e.preventDefault();var formData=this.modal.getRoot().find("form").serialize();Ajax.call([{methodname:"tool_dataprivacy_create_category_form",args:{jsonformdata:JSON.stringify(formData)},done:function(data){data.validationerrors?this.modal.setBody(this.getBody(formData)):this.close()}.bind(this),fail:Notification.exception}])},AddCategory.prototype.close=function(){this.destroy(),document.location.reload()},AddCategory.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",(function(){M.core_formchangechecker.reset_form_dirty_state()})),this.modal.destroy()},AddCategory.prototype.removeListeners=function(){$(SELECTORS_CATEGORY_LINK).off("click")},{getInstance:function(contextId){return new AddCategory(contextId)}}}));
//# sourceMappingURL=add_category.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/add_purpose",["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],function(a,b,c,d,e,f,g){var h={PURPOSE_LINK:"[data-add-element=\"purpose\"]"},i=function(a){this.contextId=a;this.strings=b.get_strings([{key:"addpurpose",component:"tool_dataprivacy"},{key:"save",component:"admin"}]);this.registerEventListeners()};i.prototype.contextId=0;i.prototype.strings=0;i.prototype.registerEventListeners=function(){var b=a(h.PURPOSE_LINK);b.on("click",function(){return this.strings.then(function(a){e.create({type:e.types.SAVE_CANCEL,title:a[0],body:""},b).done(function(b){this.setupFormModal(b,a[1])}.bind(this))}.bind(this)).fail(d.exception)}.bind(this))};i.prototype.getBody=function(a){var b=null;if("undefined"!=typeof a){b={jsonformdata:JSON.stringify(a)}}return g.loadFragment("tool_dataprivacy","addpurpose_form",this.contextId,b)};i.prototype.setupFormModal=function(a,b){a.setLarge();a.setSaveButtonText(b);a.getRoot().on(f.hidden,this.destroy.bind(this));a.setBody(this.getBody());a.getRoot().on(f.save,this.submitForm.bind(this));a.getRoot().on("submit","form",this.submitFormAjax.bind(this));this.modal=a;a.show()};i.prototype.submitForm=function(a){a.preventDefault();this.modal.getRoot().find("form").submit()};i.prototype.submitFormAjax=function(a){a.preventDefault();var b=this.modal.getRoot().find("form").serialize();c.call([{methodname:"tool_dataprivacy_create_purpose_form",args:{jsonformdata:JSON.stringify(b)},done:function(a){if(a.validationerrors){this.modal.setBody(this.getBody(b))}else{this.close()}}.bind(this),fail:d.exception}])};i.prototype.close=function(){this.destroy();document.location.reload()};i.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()});this.modal.destroy()};i.prototype.removeListeners=function(){a(h.PURPOSE_LINK).off("click")};return{getInstance:function getInstance(a){return new i(a)}}});
//# sourceMappingURL=add_purpose.min.js.map
/**
* Module to add purposes.
*
* @module tool_dataprivacy/add_purpose
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/add_purpose",["jquery","core/str","core/ajax","core/notification","core/modal_factory","core/modal_events","core/fragment"],(function($,Str,Ajax,Notification,ModalFactory,ModalEvents,Fragment){var SELECTORS_PURPOSE_LINK='[data-add-element="purpose"]',AddPurpose=function(contextId){this.contextId=contextId;this.strings=Str.get_strings([{key:"addpurpose",component:"tool_dataprivacy"},{key:"save",component:"admin"}]),this.registerEventListeners()};return AddPurpose.prototype.contextId=0,AddPurpose.prototype.strings=0,AddPurpose.prototype.registerEventListeners=function(){var trigger=$(SELECTORS_PURPOSE_LINK);trigger.on("click",function(){return this.strings.then(function(strings){ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL,title:strings[0],body:""},trigger).done(function(modal){this.setupFormModal(modal,strings[1])}.bind(this))}.bind(this)).fail(Notification.exception)}.bind(this))},AddPurpose.prototype.getBody=function(formdata){var params=null;return void 0!==formdata&&(params={jsonformdata:JSON.stringify(formdata)}),Fragment.loadFragment("tool_dataprivacy","addpurpose_form",this.contextId,params)},AddPurpose.prototype.setupFormModal=function(modal,saveText){modal.setLarge(),modal.setSaveButtonText(saveText),modal.getRoot().on(ModalEvents.hidden,this.destroy.bind(this)),modal.setBody(this.getBody()),modal.getRoot().on(ModalEvents.save,this.submitForm.bind(this)),modal.getRoot().on("submit","form",this.submitFormAjax.bind(this)),this.modal=modal,modal.show()},AddPurpose.prototype.submitForm=function(e){e.preventDefault(),this.modal.getRoot().find("form").submit()},AddPurpose.prototype.submitFormAjax=function(e){e.preventDefault();var formData=this.modal.getRoot().find("form").serialize();Ajax.call([{methodname:"tool_dataprivacy_create_purpose_form",args:{jsonformdata:JSON.stringify(formData)},done:function(data){data.validationerrors?this.modal.setBody(this.getBody(formData)):this.close()}.bind(this),fail:Notification.exception}])},AddPurpose.prototype.close=function(){this.destroy(),document.location.reload()},AddPurpose.prototype.destroy=function(){Y.use("moodle-core-formchangechecker",(function(){M.core_formchangechecker.reset_form_dirty_state()})),this.modal.destroy()},AddPurpose.prototype.removeListeners=function(){$(SELECTORS_PURPOSE_LINK).off("click")},{getInstance:function(contextId){return new AddPurpose(contextId)}}}));
//# sourceMappingURL=add_purpose.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/categoriesactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:"[data-action=\"deletecategory\"]"},h=function(){this.registerEvents()};h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name");d.get_strings([{key:"deletecategory",component:"tool_dataprivacy"},{key:"deletecategorytext",component:"tool_dataprivacy",param:i},{key:"delete"}]).then(function(d){var g=d[0],i=d[1],j=d[2];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){d.setSaveButtonText(j);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_delete_category",args:{id:h}}])[0].done(function(b){if(b.result){a("tr[data-categoryid=\""+h+"\"]").remove()}else{c.addNotification({message:b.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d})}).done(function(a){a.show()}).fail(c.exception)})};return{init:function init(){return new h}}});
//# sourceMappingURL=categoriesactions.min.js.map
/**
* AMD module for categories actions.
*
* @module tool_dataprivacy/categoriesactions
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/categoriesactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],(function($,Ajax,Notification,Str,ModalFactory,ModalEvents){var ACTIONS_DELETE='[data-action="deletecategory"]',CategoriesActions=function(){this.registerEvents()};return CategoriesActions.prototype.registerEvents=function(){$(ACTIONS_DELETE).click((function(e){e.preventDefault();var id=$(this).data("id"),stringkeys=[{key:"deletecategory",component:"tool_dataprivacy"},{key:"deletecategorytext",component:"tool_dataprivacy",param:$(this).data("name")},{key:"delete"}];Str.get_strings(stringkeys).then((function(langStrings){var title=langStrings[0],confirmMessage=langStrings[1],buttonText=langStrings[2];return ModalFactory.create({title:title,body:confirmMessage,type:ModalFactory.types.SAVE_CANCEL}).then((function(modal){return modal.setSaveButtonText(buttonText),modal.getRoot().on(ModalEvents.save,(function(){var request={methodname:"tool_dataprivacy_delete_category",args:{id:id}};Ajax.call([request])[0].done((function(data){data.result?$('tr[data-categoryid="'+id+'"]').remove():Notification.addNotification({message:data.warnings[0].message,type:"error"})})).fail(Notification.exception)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()})),modal}))})).done((function(modal){modal.show()})).fail(Notification.exception)}))},{init:function(){return new CategoriesActions}}}));
//# sourceMappingURL=categoriesactions.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/data_deletion",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var h={MARK_FOR_DELETION:"[data-action=\"markfordeletion\"]",SELECT_ALL:"[data-action=\"selectall\"]"},i={SELECTCONTEXT:".selectcontext"},j=function(){this.registerEvents()};j.prototype.registerEvents=function(){a(h.MARK_FOR_DELETION).click(function(b){b.preventDefault();var c=[];a(i.SELECTCONTEXT).each(function(){var b=a(this);if(b.is(":checked")){c.push(b.val())}});g(c)});a(h.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this);if(c.is(":checked")){a(i.SELECTCONTEXT).attr("checked","checked")}else{a(i.SELECTCONTEXT).removeAttr("checked")}})};function g(a){var g="";d.get_strings([{key:"confirm",component:"moodle"},{key:"confirmcontextdeletion",component:"tool_dataprivacy"}]).then(function(a){g=a[0];var b=a[1];return e.create({title:g,body:b,type:e.types.SAVE_CANCEL})}).then(function(d){d.setSaveButtonText(g);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_confirm_contexts_for_deletion",args:{ids:a}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d}).done(function(a){a.show()}).fail(c.exception)}return j});
//# sourceMappingURL=data_deletion.min.js.map
/**
* Request actions.
*
* @module tool_dataprivacy/data_deletion
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/data_deletion",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],(function($,Ajax,Notification,Str,ModalFactory,ModalEvents){var ACTIONS_MARK_FOR_DELETION='[data-action="markfordeletion"]',ACTIONS_SELECT_ALL='[data-action="selectall"]',SELECTORS_SELECTCONTEXT=".selectcontext",DataDeletionActions=function(){this.registerEvents()};return DataDeletionActions.prototype.registerEvents=function(){$(ACTIONS_MARK_FOR_DELETION).click((function(e){e.preventDefault();var ids,keys,wsfunction,modalTitle,selectedIds=[];$(SELECTORS_SELECTCONTEXT).each((function(){var checkbox=$(this);checkbox.is(":checked")&&selectedIds.push(checkbox.val())})),ids=selectedIds,keys=[{key:"confirm",component:"moodle"},{key:"confirmcontextdeletion",component:"tool_dataprivacy"}],wsfunction="tool_dataprivacy_confirm_contexts_for_deletion",modalTitle="",Str.get_strings(keys).then((function(langStrings){modalTitle=langStrings[0];var confirmMessage=langStrings[1];return ModalFactory.create({title:modalTitle,body:confirmMessage,type:ModalFactory.types.SAVE_CANCEL})})).then((function(modal){return modal.setSaveButtonText(modalTitle),modal.getRoot().on(ModalEvents.save,(function(){var request={methodname:wsfunction,args:{ids:ids}};Ajax.call([request])[0].done((function(data){data.result?window.location.reload():Notification.addNotification({message:data.warnings[0].message,type:"error"})})).fail(Notification.exception)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()})),modal})).done((function(modal){modal.show()})).fail(Notification.exception)})),$(ACTIONS_SELECT_ALL).change((function(e){e.preventDefault(),$(this).is(":checked")?$(SELECTORS_SELECTCONTEXT).attr("checked","checked"):$(SELECTORS_SELECTCONTEXT).removeAttr("checked")}))},DataDeletionActions}));
//# sourceMappingURL=data_deletion.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/data_request_modal",["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","tool_dataprivacy/events"],function(a,b,c,d,e,f){var g=!1,h={APPROVE_BUTTON:"[data-action=\"approve\"]",DENY_BUTTON:"[data-action=\"deny\"]",COMPLETE_BUTTON:"[data-action=\"complete\"]"},i=function(a){d.call(this,a)};i.TYPE="tool_dataprivacy-data_request";i.prototype=Object.create(d.prototype);i.prototype.constructor=i;i.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this);this.getModal().on(c.events.activate,h.APPROVE_BUTTON,function(b,c){var d=a.Event(f.approve);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this));this.getModal().on(c.events.activate,h.DENY_BUTTON,function(b,c){var d=a.Event(f.deny);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this));this.getModal().on(c.events.activate,h.COMPLETE_BUTTON,function(b,c){var d=a.Event(f.complete);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){this.hide();c.originalEvent.preventDefault()}}.bind(this))};if(!g){e.register(i.TYPE,i,"tool_dataprivacy/data_request_modal");g=!0}return i});
//# sourceMappingURL=data_request_modal.min.js.map
/**
* Request actions.
*
* @module tool_dataprivacy/data_request_modal
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/data_request_modal",["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_registry","tool_dataprivacy/events"],(function($,Notification,CustomEvents,Modal,ModalRegistry,DataPrivacyEvents){var registered=!1,SELECTORS_APPROVE_BUTTON='[data-action="approve"]',SELECTORS_DENY_BUTTON='[data-action="deny"]',SELECTORS_COMPLETE_BUTTON='[data-action="complete"]',ModalDataRequest=function(root){Modal.call(this,root)};return ModalDataRequest.TYPE="tool_dataprivacy-data_request",(ModalDataRequest.prototype=Object.create(Modal.prototype)).constructor=ModalDataRequest,ModalDataRequest.prototype.registerEventListeners=function(){Modal.prototype.registerEventListeners.call(this),this.getModal().on(CustomEvents.events.activate,SELECTORS_APPROVE_BUTTON,function(e,data){var approveEvent=$.Event(DataPrivacyEvents.approve);this.getRoot().trigger(approveEvent,this),approveEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this)),this.getModal().on(CustomEvents.events.activate,SELECTORS_DENY_BUTTON,function(e,data){var denyEvent=$.Event(DataPrivacyEvents.deny);this.getRoot().trigger(denyEvent,this),denyEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this)),this.getModal().on(CustomEvents.events.activate,SELECTORS_COMPLETE_BUTTON,function(e,data){var completeEvent=$.Event(DataPrivacyEvents.complete);this.getRoot().trigger(completeEvent,this),completeEvent.isDefaultPrevented()||(this.hide(),data.originalEvent.preventDefault())}.bind(this))},registered||(ModalRegistry.register(ModalDataRequest.TYPE,ModalDataRequest,"tool_dataprivacy/data_request_modal"),registered=!0),ModalDataRequest}));
//# sourceMappingURL=data_request_modal.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/effective_retention_period",["jquery"],function(a){var b={PURPOSE_SELECT:"#id_purposeid",RETENTION_FIELD:"#fitem_id_retention_current [data-fieldtype=static]"},c=function(a){this.purposeRetentionPeriods=a;this.registerEventListeners()},d=function(){a(b.PURPOSE_SELECT).off("change")};c.prototype.purposeRetentionPeriods=[];c.prototype.registerEventListeners=function(){a(b.PURPOSE_SELECT).on("change",function(c){var d=a(c.currentTarget).val(),e=this.purposeRetentionPeriods[d];a(b.RETENTION_FIELD).text(e)}.bind(this))};return{init:function init(a){d();return new c(a)}}});
//# sourceMappingURL=effective_retention_period.min.js.map
/**
* Module to update the displayed retention period.
*
* @module tool_dataprivacy/effective_retention_period
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/effective_retention_period",["jquery"],(function($){var SELECTORS_PURPOSE_SELECT="#id_purposeid",SELECTORS_RETENTION_FIELD="#fitem_id_retention_current [data-fieldtype=static]",EffectiveRetentionPeriod=function(purposeRetentionPeriods){this.purposeRetentionPeriods=purposeRetentionPeriods,this.registerEventListeners()};return EffectiveRetentionPeriod.prototype.purposeRetentionPeriods=[],EffectiveRetentionPeriod.prototype.registerEventListeners=function(){$(SELECTORS_PURPOSE_SELECT).on("change",function(ev){var selected=$(ev.currentTarget).val(),selectedPurpose=this.purposeRetentionPeriods[selected];$(SELECTORS_RETENTION_FIELD).text(selectedPurpose)}.bind(this))},{init:function(purposeRetentionPeriods){return $(SELECTORS_PURPOSE_SELECT).off("change"),new EffectiveRetentionPeriod(purposeRetentionPeriods)}}}));
//# sourceMappingURL=effective_retention_period.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/effective_retention_period.js"],"names":["define","$","SELECTORS","PURPOSE_SELECT","RETENTION_FIELD","EffectiveRetentionPeriod","purposeRetentionPeriods","registerEventListeners","removeListeners","off","prototype","on","ev","selected","currentTarget","val","selectedPurpose","text","bind","init"],"mappings":"AAsBAA,OAAM,+CAAC,CAAC,QAAD,CAAD,CACF,SAASC,CAAT,CAAY,IAEJC,CAAAA,CAAS,CAAG,CACZC,cAAc,CAAE,eADJ,CAEZC,eAAe,CAAE,qDAFL,CAFR,CAYJC,CAAwB,CAAG,SAASC,CAAT,CAAkC,CAC7D,KAAKA,uBAAL,CAA+BA,CAA/B,CACA,KAAKC,sBAAL,EACH,CAfO,CAsBJC,CAAe,CAAG,UAAW,CAC7BP,CAAC,CAACC,CAAS,CAACC,cAAX,CAAD,CAA4BM,GAA5B,CAAgC,QAAhC,CACH,CAxBO,CA8BRJ,CAAwB,CAACK,SAAzB,CAAmCJ,uBAAnC,CAA6D,EAA7D,CAOAD,CAAwB,CAACK,SAAzB,CAAmCH,sBAAnC,CAA4D,UAAW,CAEnEN,CAAC,CAACC,CAAS,CAACC,cAAX,CAAD,CAA4BQ,EAA5B,CAA+B,QAA/B,CAAyC,SAASC,CAAT,CAAa,IAC9CC,CAAAA,CAAQ,CAAGZ,CAAC,CAACW,CAAE,CAACE,aAAJ,CAAD,CAAoBC,GAApB,EADmC,CAE9CC,CAAe,CAAG,KAAKV,uBAAL,CAA6BO,CAA7B,CAF4B,CAGlDZ,CAAC,CAACC,CAAS,CAACE,eAAX,CAAD,CAA6Ba,IAA7B,CAAkCD,CAAlC,CACH,CAJwC,CAIvCE,IAJuC,CAIlC,IAJkC,CAAzC,CAKH,CAPD,CASA,MAAwE,CACpEC,IAAI,CAAE,cAASb,CAAT,CAAkC,CAEpCE,CAAe,GACf,MAAO,IAAIH,CAAAA,CAAJ,CAA6BC,CAA7B,CACV,CALmE,CAO3E,CAtDC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Module to update the displayed retention period.\n *\n * @module tool_dataprivacy/effective_retention_period\n * @copyright 2018 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'],\n function($) {\n\n var SELECTORS = {\n PURPOSE_SELECT: '#id_purposeid',\n RETENTION_FIELD: '#fitem_id_retention_current [data-fieldtype=static]',\n };\n\n /**\n * Constructor for the retention period display.\n *\n * @param {Array} purposeRetentionPeriods Associative array of purposeids with effective retention period at this context\n */\n var EffectiveRetentionPeriod = function(purposeRetentionPeriods) {\n this.purposeRetentionPeriods = purposeRetentionPeriods;\n this.registerEventListeners();\n };\n\n /**\n * Removes the current 'change' listeners.\n *\n * Useful when a new form is loaded.\n */\n var removeListeners = function() {\n $(SELECTORS.PURPOSE_SELECT).off('change');\n };\n\n /**\n * @var {Array} purposeRetentionPeriods\n * @private\n */\n EffectiveRetentionPeriod.prototype.purposeRetentionPeriods = [];\n\n /**\n * Add purpose change listeners.\n *\n * @method registerEventListeners\n */\n EffectiveRetentionPeriod.prototype.registerEventListeners = function() {\n\n $(SELECTORS.PURPOSE_SELECT).on('change', function(ev) {\n var selected = $(ev.currentTarget).val();\n var selectedPurpose = this.purposeRetentionPeriods[selected];\n $(SELECTORS.RETENTION_FIELD).text(selectedPurpose);\n }.bind(this));\n };\n\n return /** @alias module:tool_dataprivacy/effective_retention_period */ {\n init: function(purposeRetentionPeriods) {\n // Remove previously attached listeners.\n removeListeners();\n return new EffectiveRetentionPeriod(purposeRetentionPeriods);\n }\n };\n }\n);\n\n"],"file":"effective_retention_period.min.js"}
{"version":3,"file":"effective_retention_period.min.js","sources":["../src/effective_retention_period.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Module to update the displayed retention period.\n *\n * @module tool_dataprivacy/effective_retention_period\n * @copyright 2018 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'],\n function($) {\n\n var SELECTORS = {\n PURPOSE_SELECT: '#id_purposeid',\n RETENTION_FIELD: '#fitem_id_retention_current [data-fieldtype=static]',\n };\n\n /**\n * Constructor for the retention period display.\n *\n * @param {Array} purposeRetentionPeriods Associative array of purposeids with effective retention period at this context\n */\n var EffectiveRetentionPeriod = function(purposeRetentionPeriods) {\n this.purposeRetentionPeriods = purposeRetentionPeriods;\n this.registerEventListeners();\n };\n\n /**\n * Removes the current 'change' listeners.\n *\n * Useful when a new form is loaded.\n */\n var removeListeners = function() {\n $(SELECTORS.PURPOSE_SELECT).off('change');\n };\n\n /**\n * @var {Array} purposeRetentionPeriods\n * @private\n */\n EffectiveRetentionPeriod.prototype.purposeRetentionPeriods = [];\n\n /**\n * Add purpose change listeners.\n *\n * @method registerEventListeners\n */\n EffectiveRetentionPeriod.prototype.registerEventListeners = function() {\n\n $(SELECTORS.PURPOSE_SELECT).on('change', function(ev) {\n var selected = $(ev.currentTarget).val();\n var selectedPurpose = this.purposeRetentionPeriods[selected];\n $(SELECTORS.RETENTION_FIELD).text(selectedPurpose);\n }.bind(this));\n };\n\n return /** @alias module:tool_dataprivacy/effective_retention_period */ {\n init: function(purposeRetentionPeriods) {\n // Remove previously attached listeners.\n removeListeners();\n return new EffectiveRetentionPeriod(purposeRetentionPeriods);\n }\n };\n }\n);\n\n"],"names":["define","$","SELECTORS","EffectiveRetentionPeriod","purposeRetentionPeriods","registerEventListeners","prototype","on","ev","selected","currentTarget","val","selectedPurpose","this","text","bind","init","off"],"mappings":";;;;;;;AAsBAA,qDAAO,CAAC,WACJ,SAASC,OAEDC,yBACgB,gBADhBA,0BAEiB,sDAQjBC,yBAA2B,SAASC,8BAC/BA,wBAA0BA,6BAC1BC,iCAgBTF,yBAAyBG,UAAUF,wBAA0B,GAO7DD,yBAAyBG,UAAUD,uBAAyB,WAExDJ,EAAEC,0BAA0BK,GAAG,SAAU,SAASC,QAC1CC,SAAWR,EAAEO,GAAGE,eAAeC,MAC/BC,gBAAkBC,KAAKT,wBAAwBK,UACnDR,EAAEC,2BAA2BY,KAAKF,kBACpCG,KAAKF,QAG6D,CACpEG,KAAM,SAASZ,gCAxBfH,EAAEC,0BAA0Be,IAAI,UA2BrB,IAAId,yBAAyBC"}
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/events",[],function(){return{approve:"tool_dataprivacy-data_request:approve",bulkApprove:"tool_dataprivacy-data_request:bulk_approve",deny:"tool_dataprivacy-data_request:deny",bulkDeny:"tool_dataprivacy-data_request:bulk_deny",complete:"tool_dataprivacy-data_request:complete"}});
//# sourceMappingURL=events.min.js.map
/**
* Contain the events the data privacy tool can fire.
*
* @module tool_dataprivacy/events
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/events",[],(function(){return{approve:"tool_dataprivacy-data_request:approve",bulkApprove:"tool_dataprivacy-data_request:bulk_approve",deny:"tool_dataprivacy-data_request:deny",bulkDeny:"tool_dataprivacy-data_request:bulk_deny",complete:"tool_dataprivacy-data_request:complete"}}));
//# sourceMappingURL=events.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/events.js"],"names":["define","approve","bulkApprove","deny","bulkDeny","complete"],"mappings":"AAsBAA,OAAM,2BAAC,EAAD,CAAK,UAAW,CAClB,MAAO,CACHC,OAAO,CAAE,uCADN,CAEHC,WAAW,CAAE,4CAFV,CAGHC,IAAI,CAAE,oCAHH,CAIHC,QAAQ,CAAE,yCAJP,CAKHC,QAAQ,CAAE,wCALP,CAOV,CARK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Contain the events the data privacy tool can fire.\n *\n * @module tool_dataprivacy/events\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n return {\n approve: 'tool_dataprivacy-data_request:approve',\n bulkApprove: 'tool_dataprivacy-data_request:bulk_approve',\n deny: 'tool_dataprivacy-data_request:deny',\n bulkDeny: 'tool_dataprivacy-data_request:bulk_deny',\n complete: 'tool_dataprivacy-data_request:complete'\n };\n});\n"],"file":"events.min.js"}
{"version":3,"file":"events.min.js","sources":["../src/events.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Contain the events the data privacy tool can fire.\n *\n * @module tool_dataprivacy/events\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n return {\n approve: 'tool_dataprivacy-data_request:approve',\n bulkApprove: 'tool_dataprivacy-data_request:bulk_approve',\n deny: 'tool_dataprivacy-data_request:deny',\n bulkDeny: 'tool_dataprivacy-data_request:bulk_deny',\n complete: 'tool_dataprivacy-data_request:complete'\n };\n});\n"],"names":["define","approve","bulkApprove","deny","bulkDeny","complete"],"mappings":";;;;;;;AAsBAA,iCAAO,IAAI,iBACA,CACHC,QAAS,wCACTC,YAAa,6CACbC,KAAM,qCACNC,SAAU,0CACVC,SAAU"}
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/expand_contract",["jquery","core/url","core/str"],function(a,b,c){var d=a("<img alt=\"\" src=\""+b.imageUrl("t/expanded")+"\"/>"),e=a("<img alt=\"\" src=\""+b.imageUrl("t/collapsed")+"\"/>"),f={EXPAND:"fa-caret-right",COLLAPSE:"fa-caret-down"};return{expandCollapse:function expandCollapse(a,b){if(a.hasClass("hide")){a.removeClass("hide");a.addClass("visible");a.attr("aria-expanded",!0);b.find(":header i.fa").removeClass(f.EXPAND);b.find(":header i.fa").addClass(f.COLLAPSE);b.find(":header img.icon").attr("src",d.attr("src"))}else{a.removeClass("visible");a.addClass("hide");a.attr("aria-expanded",!1);b.find(":header i.fa").removeClass(f.COLLAPSE);b.find(":header i.fa").addClass(f.EXPAND);b.find(":header img.icon").attr("src",e.attr("src"))}},expandCollapseAll:function expandCollapseAll(b){var g="visible"==b?"hide":"visible",h="visible"==b?!0:!1,i="visible"==b?f.EXPAND:f.COLLAPSE,j="visible"==b?f.COLLAPSE:f.EXPAND,k="visible"==b?d.attr("src"):e.attr("src");a("."+g).each(function(){a(this).removeClass(g);a(this).addClass(b);a(this).attr("aria-expanded",h)});a(".tool_dataprivacy-expand-all").data("visibilityState",g);c.get_string(g,"tool_dataprivacy").then(function(b){a(".tool_dataprivacy-expand-all").html(b)}).catch(Notification.exception);a(":header i.fa").each(function(){a(this).removeClass(i);a(this).addClass(j)});a(":header img.icon").each(function(){a(this).attr("src",k)})}}});
//# sourceMappingURL=expand_contract.min.js.map
/**
* Potential user selector module.
*
* @module tool_dataprivacy/expand_contract
* @copyright 2018 Adrian Greeve
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/expand_contract",["jquery","core/url","core/str"],(function($,url,str){var expandedImage=$('<img alt="" src="'+url.imageUrl("t/expanded")+'"/>'),collapsedImage=$('<img alt="" src="'+url.imageUrl("t/collapsed")+'"/>'),CLASSES_EXPAND="fa-caret-right",CLASSES_COLLAPSE="fa-caret-down";return{expandCollapse:function(targetnode,thisnode){targetnode.hasClass("hide")?(targetnode.removeClass("hide"),targetnode.addClass("visible"),targetnode.attr("aria-expanded",!0),thisnode.find(":header i.fa").removeClass(CLASSES_EXPAND),thisnode.find(":header i.fa").addClass(CLASSES_COLLAPSE),thisnode.find(":header img.icon").attr("src",expandedImage.attr("src"))):(targetnode.removeClass("visible"),targetnode.addClass("hide"),targetnode.attr("aria-expanded",!1),thisnode.find(":header i.fa").removeClass(CLASSES_COLLAPSE),thisnode.find(":header i.fa").addClass(CLASSES_EXPAND),thisnode.find(":header img.icon").attr("src",collapsedImage.attr("src")))},expandCollapseAll:function(nextstate){var currentstate="visible"==nextstate?"hide":"visible",ariaexpandedstate="visible"==nextstate,iconclassnow="visible"==nextstate?CLASSES_EXPAND:CLASSES_COLLAPSE,iconclassnext="visible"==nextstate?CLASSES_COLLAPSE:CLASSES_EXPAND,imagenow="visible"==nextstate?expandedImage.attr("src"):collapsedImage.attr("src");$("."+currentstate).each((function(){$(this).removeClass(currentstate),$(this).addClass(nextstate),$(this).attr("aria-expanded",ariaexpandedstate)})),$(".tool_dataprivacy-expand-all").data("visibilityState",currentstate),str.get_string(currentstate,"tool_dataprivacy").then((function(langString){$(".tool_dataprivacy-expand-all").html(langString)})).catch(Notification.exception),$(":header i.fa").each((function(){$(this).removeClass(iconclassnow),$(this).addClass(iconclassnext)})),$(":header img.icon").each((function(){$(this).attr("src",imagenow)}))}}}));
//# sourceMappingURL=expand_contract.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/form-user-selector",["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d},transport:function transport(d,e,f,g){var h=b.call([{methodname:"tool_dataprivacy_get_users",args:{query:e}}]);h[0].then(function(b){var d=[],e=0;a.each(b,function(a,b){d.push(c.render("tool_dataprivacy/form-user-selector-suggestion",b))});return a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b,function(a,b){b._label=c[e];e++});f(b)})}).fail(g)}}});
//# sourceMappingURL=form-user-selector.min.js.map
/**
* Potential user selector module.
*
* @module tool_dataprivacy/form-user-selector
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/form-user-selector",["jquery","core/ajax","core/templates"],(function($,Ajax,Templates){return{processResults:function(selector,results){var users=[];return $.each(results,(function(index,user){users.push({value:user.id,label:user._label})})),users},transport:function(selector,query,success,failure){Ajax.call([{methodname:"tool_dataprivacy_get_users",args:{query:query}}])[0].then((function(results){var promises=[],i=0;return $.each(results,(function(index,user){promises.push(Templates.render("tool_dataprivacy/form-user-selector-suggestion",user))})),$.when.apply($.when,promises).then((function(){var args=arguments;$.each(results,(function(index,user){user._label=args[i],i++})),success(results)}))})).fail(failure)}}}));
//# sourceMappingURL=form-user-selector.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/form-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","call","methodname","args","then","promises","i","render","when","apply","arguments","fail"],"mappings":"AAuBAA,OAAM,uCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAgE,CAE5DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAX2D,CAa5DS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,CACnD,GAAIC,CAAAA,CAAO,CAEDlB,CAAI,CAACmB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,4BADK,CAEjBC,IAAI,CAAE,CACFN,KAAK,CAAEA,CADL,CAFW,CAAD,CAAV,CAFV,CASAG,CAAO,CAAC,CAAD,CAAP,CAAWI,IAAX,CAAgB,SAASlB,CAAT,CAAkB,CAC9B,GAAImB,CAAAA,CAAQ,CAAG,EAAf,CACIC,CAAC,CAAG,CADR,CAIAzB,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCe,CAAQ,CAACd,IAAT,CAAcR,CAAS,CAACwB,MAAV,CAAiB,gDAAjB,CAAmEjB,CAAnE,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAAC2B,IAAF,CAAOC,KAAP,CAAa5B,CAAC,CAAC2B,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAID,CAAAA,CAAI,CAAGO,SAAX,CACA7B,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCA,CAAI,CAACK,MAAL,CAAcQ,CAAI,CAACG,CAAD,CAAlB,CACAA,CAAC,EACJ,CAHD,EAIAR,CAAO,CAACZ,CAAD,CAEV,CARM,CAUV,CApBD,EAoBGyB,IApBH,CAoBQZ,CApBR,CAqBH,CA5C2D,CAgDnE,CAlDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Potential user selector module.\n *\n * @module tool_dataprivacy/form-user-selector\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_dataprivacy/form-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n promise = Ajax.call([{\n methodname: 'tool_dataprivacy_get_users',\n args: {\n query: query\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results, function(index, user) {\n promises.push(Templates.render('tool_dataprivacy/form-user-selector-suggestion', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"file":"form-user-selector.min.js"}
{"version":3,"file":"form-user-selector.min.js","sources":["../src/form-user-selector.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Potential user selector module.\n *\n * @module tool_dataprivacy/form-user-selector\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_dataprivacy/form-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n promise = Ajax.call([{\n methodname: 'tool_dataprivacy_get_users',\n args: {\n query: query\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results, function(index, user) {\n promises.push(Templates.render('tool_dataprivacy/form-user-selector-suggestion', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","call","methodname","args","then","promises","i","render","when","apply","arguments","fail"],"mappings":";;;;;;;AAuBAA,6CAAO,CAAC,SAAU,YAAa,mBAAmB,SAASC,EAAGC,KAAMC,iBAEA,CAE5DC,eAAgB,SAASC,SAAUC,aAC3BC,MAAQ,UACZN,EAAEO,KAAKF,SAAS,SAASG,MAAOC,MAC5BH,MAAMI,KAAK,CACPC,MAAOF,KAAKG,GACZC,MAAOJ,KAAKK,YAGbR,OAGXS,UAAW,SAASX,SAAUY,MAAOC,QAASC,SAGhCjB,KAAKkB,KAAK,CAAC,CACjBC,WAAY,6BACZC,KAAM,CACFL,MAAOA,UAIP,GAAGM,MAAK,SAASjB,aACjBkB,SAAW,GACXC,EAAI,SAGRxB,EAAEO,KAAKF,SAAS,SAASG,MAAOC,MAC5Bc,SAASb,KAAKR,UAAUuB,OAAO,iDAAkDhB,UAI9ET,EAAE0B,KAAKC,MAAM3B,EAAE0B,KAAMH,UAAUD,MAAK,eACnCD,KAAOO,UACX5B,EAAEO,KAAKF,SAAS,SAASG,MAAOC,MAC5BA,KAAKK,OAASO,KAAKG,GACnBA,OAEJP,QAAQZ,eAIbwB,KAAKX"}
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/myrequestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","core/pending"],function(a,b,c,d,e,f,g,h){var j={CANCEL_REQUEST:"[data-action=\"cancel\"]",CONTACT_DPO:"[data-action=\"contactdpo\"]"},k=function(){this.registerEvents()};k.prototype.registerEvents=function(){a(j.CANCEL_REQUEST).click(function(g){g.preventDefault();var h=a(this).data("requestid");d.get_strings([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then(function(a){var d=a[0],g=a[1];return e.create({title:d,body:g,type:e.types.SAVE_CANCEL}).then(function(a){a.setSaveButtonText(d);a.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:h}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});a.getRoot().on(f.hidden,function(){a.destroy()});return a})}).done(function(a){a.show()}).fail(c.exception)});a(j.CONTACT_DPO).click(function(b){var j=new h("dataprivacy/crud:initModal:contactdpo");b.preventDefault();var k=a(this).data("replytoemail"),l="";d.get_strings([{key:"contactdataprotectionofficer",component:"tool_dataprivacy"},{key:"send",component:"tool_dataprivacy"}]).then(function(a){var b=a[0];l=a[1];return e.create({title:b,body:g.render("tool_dataprivacy/contact_dpo",{replytoemail:k}),type:e.types.SAVE_CANCEL,large:!0})}).then(function(b){b.setSaveButtonText(l);b.show();b.getRoot().on(f.save,function(b){var c=a("#message").val().trim();if(0===c.length){b.preventDefault();a("[data-region=\"messageinput\"]").addClass("has-danger notifyproblem");a("#id_error_message").removeAttr("hidden")}else{i(c)}});b.getRoot().on(f.hidden,function(){b.destroy()})}).then(j.resolve).catch(c.exception)})};function i(a){var e="success";b.call([{methodname:"tool_dataprivacy_contact_dpo",args:{message:a}}])[0].then(function(a){if(a.result){return d.get_string("requestsubmitted","tool_dataprivacy")}e="error";return a.warnings.join("<br>")}).done(function(a){c.addNotification({message:a,type:e})}).fail(c.exception)}return{init:function init(){return new k}}});
//# sourceMappingURL=myrequestactions.min.js.map
/**
* AMD module to enable users to manage their own data requests.
*
* @module tool_dataprivacy/myrequestactions
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/myrequestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","core/pending"],(function($,Ajax,Notification,Str,ModalFactory,ModalEvents,Templates,Pending){var ACTIONS_CANCEL_REQUEST='[data-action="cancel"]',ACTIONS_CONTACT_DPO='[data-action="contactdpo"]',MyRequestActions=function(){this.registerEvents()};return MyRequestActions.prototype.registerEvents=function(){$(ACTIONS_CANCEL_REQUEST).click((function(e){e.preventDefault();var requestId=$(this).data("requestid");Str.get_strings([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then((function(langStrings){var title=langStrings[0],confirmMessage=langStrings[1];return ModalFactory.create({title:title,body:confirmMessage,type:ModalFactory.types.SAVE_CANCEL}).then((function(modal){return modal.setSaveButtonText(title),modal.getRoot().on(ModalEvents.save,(function(){var request={methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:requestId}};Ajax.call([request])[0].done((function(data){data.result?window.location.reload():Notification.addNotification({message:data.warnings[0].message,type:"error"})})).fail(Notification.exception)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()})),modal}))})).done((function(modal){modal.show()})).fail(Notification.exception)})),$(ACTIONS_CONTACT_DPO).click((function(e){var pendingPromise=new Pending("dataprivacy/crud:initModal:contactdpo");e.preventDefault();var replyToEmail=$(this).data("replytoemail"),sendButtonText="";Str.get_strings([{key:"contactdataprotectionofficer",component:"tool_dataprivacy"},{key:"send",component:"tool_dataprivacy"}]).then((function(langStrings){var modalTitle=langStrings[0];sendButtonText=langStrings[1];var context={replytoemail:replyToEmail};return ModalFactory.create({title:modalTitle,body:Templates.render("tool_dataprivacy/contact_dpo",context),type:ModalFactory.types.SAVE_CANCEL,large:!0})})).then((function(modal){modal.setSaveButtonText(sendButtonText),modal.show(),modal.getRoot().on(ModalEvents.save,(function(e){var message=$("#message").val().trim();0===message.length?(e.preventDefault(),$('[data-region="messageinput"]').addClass("has-danger notifyproblem"),$("#id_error_message").removeAttr("hidden")):function(message){var request={methodname:"tool_dataprivacy_contact_dpo",args:{message:message}},requestType="success";Ajax.call([request])[0].then((function(data){return data.result?Str.get_string("requestsubmitted","tool_dataprivacy"):(requestType="error",data.warnings.join("<br>"))})).done((function(message){Notification.addNotification({message:message,type:requestType})})).fail(Notification.exception)}(message)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()}))})).then(pendingPromise.resolve).catch(Notification.exception)}))},{init:function(){return new MyRequestActions}}}));
//# sourceMappingURL=myrequestactions.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/purposesactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:"[data-action=\"deletepurpose\"]"},h=function(){this.registerEvents()};h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name");d.get_strings([{key:"deletepurpose",component:"tool_dataprivacy"},{key:"deletepurposetext",component:"tool_dataprivacy",param:i},{key:"delete"}]).then(function(d){var g=d[0],i=d[1],j=d[2];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){d.setSaveButtonText(j);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_delete_purpose",args:{id:h}}])[0].done(function(b){if(b.result){a("tr[data-purposeid=\""+h+"\"]").remove()}else{c.addNotification({message:b.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d})}).done(function(a){a.show()}).fail(c.exception)})};return{init:function init(){return new h}}});
//# sourceMappingURL=purposesactions.min.js.map
/**
* AMD module for purposes actions.
*
* @module tool_dataprivacy/purposesactions
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/purposesactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],(function($,Ajax,Notification,Str,ModalFactory,ModalEvents){var ACTIONS_DELETE='[data-action="deletepurpose"]',PurposesActions=function(){this.registerEvents()};return PurposesActions.prototype.registerEvents=function(){$(ACTIONS_DELETE).click((function(e){e.preventDefault();var id=$(this).data("id"),stringkeys=[{key:"deletepurpose",component:"tool_dataprivacy"},{key:"deletepurposetext",component:"tool_dataprivacy",param:$(this).data("name")},{key:"delete"}];Str.get_strings(stringkeys).then((function(langStrings){var title=langStrings[0],confirmMessage=langStrings[1],buttonText=langStrings[2];return ModalFactory.create({title:title,body:confirmMessage,type:ModalFactory.types.SAVE_CANCEL}).then((function(modal){return modal.setSaveButtonText(buttonText),modal.getRoot().on(ModalEvents.save,(function(){var request={methodname:"tool_dataprivacy_delete_purpose",args:{id:id}};Ajax.call([request])[0].done((function(data){data.result?$('tr[data-purposeid="'+id+'"]').remove():Notification.addNotification({message:data.warnings[0].message,type:"error"})})).fail(Notification.exception)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()})),modal}))})).done((function(modal){modal.show()})).fail(Notification.exception)}))},{init:function(){return new PurposesActions}}}));
//# sourceMappingURL=purposesactions.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_dataprivacy/request_filter",["jquery","core/form-autocomplete","core/str","core/notification"],function(a,b,c,d){var e={REQUEST_FILTERS:"#request-filters"},f=function init(){c.get_strings([{key:"filter",component:"moodle"},{key:"nofiltersapplied",component:"moodle"}]).then(function(a){var c=a[0],d=a[1];return b.enhance(e.REQUEST_FILTERS,!1,"",c,!1,!0,d,!0)}).fail(d.exception);var f=a(e.REQUEST_FILTERS).val();a(e.REQUEST_FILTERS).on("change",function(){var b=a(this).val();if(f.join(",")!==b.join(",")){if(0===b.length){a("#filters-cleared").val(1)}a(this.form).submit()}})};return{init:function init(){f()}}});
//# sourceMappingURL=request_filter.min.js.map
/**
* JS module for the data requests filter.
*
* @module tool_dataprivacy/request_filter
* @copyright 2018 Jun Pataleta
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_dataprivacy/request_filter",["jquery","core/form-autocomplete","core/str","core/notification"],(function($,Autocomplete,Str,Notification){var SELECTORS_REQUEST_FILTERS="#request-filters";return{init:function(){!function(){Str.get_strings([{key:"filter",component:"moodle"},{key:"nofiltersapplied",component:"moodle"}]).then((function(langstrings){var placeholder=langstrings[0],noSelectionString=langstrings[1];return Autocomplete.enhance(SELECTORS_REQUEST_FILTERS,!1,"",placeholder,!1,!0,noSelectionString,!0)})).fail(Notification.exception);var last=$(SELECTORS_REQUEST_FILTERS).val();$(SELECTORS_REQUEST_FILTERS).on("change",(function(){var current=$(this).val();last.join(",")!==current.join(",")&&(0===current.length&&$("#filters-cleared").val(1),$(this.form).submit())}))}()}}}));
//# sourceMappingURL=request_filter.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/request_filter.js"],"names":["define","$","Autocomplete","Str","Notification","SELECTORS","REQUEST_FILTERS","init","get_strings","key","component","then","langstrings","placeholder","noSelectionString","enhance","fail","exception","last","val","on","current","join","length","form","submit"],"mappings":"AAsBAA,OAAM,mCAAC,CAAC,QAAD,CAAW,wBAAX,CAAqC,UAArC,CAAiD,mBAAjD,CAAD,CAAwE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAA6C,IAQnHC,CAAAA,CAAS,CAAG,CACZC,eAAe,CAAE,kBADL,CARuG,CAkBnHC,CAAI,CAAG,QAAPA,CAAAA,IAAO,EAAW,CAYlBJ,CAAG,CAACK,WAAJ,CAXiB,CACb,CACIC,GAAG,CAAE,QADT,CAEIC,SAAS,CAAE,QAFf,CADa,CAKb,CACID,GAAG,CAAE,kBADT,CAEIC,SAAS,CAAE,QAFf,CALa,CAWjB,EAA4BC,IAA5B,CAAiC,SAASC,CAAT,CAAsB,IAC/CC,CAAAA,CAAW,CAAGD,CAAW,CAAC,CAAD,CADsB,CAE/CE,CAAiB,CAAGF,CAAW,CAAC,CAAD,CAFgB,CAGnD,MAAOV,CAAAA,CAAY,CAACa,OAAb,CAAqBV,CAAS,CAACC,eAA/B,IAAuD,EAAvD,CAA2DO,CAA3D,OAAqFC,CAArF,IACV,CAJD,EAIGE,IAJH,CAIQZ,CAAY,CAACa,SAJrB,EAMA,GAAIC,CAAAA,CAAI,CAAGjB,CAAC,CAACI,CAAS,CAACC,eAAX,CAAD,CAA6Ba,GAA7B,EAAX,CACAlB,CAAC,CAACI,CAAS,CAACC,eAAX,CAAD,CAA6Bc,EAA7B,CAAgC,QAAhC,CAA0C,UAAW,CACjD,GAAIC,CAAAA,CAAO,CAAGpB,CAAC,CAAC,IAAD,CAAD,CAAQkB,GAAR,EAAd,CAEA,GAAID,CAAI,CAACI,IAAL,CAAU,GAAV,IAAmBD,CAAO,CAACC,IAAR,CAAa,GAAb,CAAvB,CAA0C,CAEtC,GAAuB,CAAnB,GAAAD,CAAO,CAACE,MAAZ,CAA0B,CACtBtB,CAAC,CAAC,kBAAD,CAAD,CAAsBkB,GAAtB,CAA0B,CAA1B,CACH,CACDlB,CAAC,CAAC,KAAKuB,IAAN,CAAD,CAAaC,MAAb,EACH,CACJ,CAVD,CAWH,CAhDsH,CAkDvH,MAAmD,CAM/ClB,IAAI,CAAE,eAAW,CACbA,CAAI,EACP,CAR8C,CAUtD,CA5DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * JS module for the data requests filter.\n *\n * @module tool_dataprivacy/request_filter\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/form-autocomplete', 'core/str', 'core/notification'], function($, Autocomplete, Str, Notification) {\n\n /**\n * Selectors.\n *\n * @access private\n * @type {{REQUEST_FILTERS: string}}\n */\n var SELECTORS = {\n REQUEST_FILTERS: '#request-filters'\n };\n\n /**\n * Init function.\n *\n * @method init\n * @private\n */\n var init = function() {\n var stringkeys = [\n {\n key: 'filter',\n component: 'moodle'\n },\n {\n key: 'nofiltersapplied',\n component: 'moodle'\n }\n ];\n\n Str.get_strings(stringkeys).then(function(langstrings) {\n var placeholder = langstrings[0];\n var noSelectionString = langstrings[1];\n return Autocomplete.enhance(SELECTORS.REQUEST_FILTERS, false, '', placeholder, false, true, noSelectionString, true);\n }).fail(Notification.exception);\n\n var last = $(SELECTORS.REQUEST_FILTERS).val();\n $(SELECTORS.REQUEST_FILTERS).on('change', function() {\n var current = $(this).val();\n // Prevent form from submitting unnecessarily, eg. on blur when no filter is selected.\n if (last.join(',') !== current.join(',')) {\n // If we're submitting without filters, set the hidden input 'filters-cleared' to 1.\n if (current.length === 0) {\n $('#filters-cleared').val(1);\n }\n $(this.form).submit();\n }\n });\n };\n\n return /** @alias module:core/form-autocomplete */ {\n /**\n * Initialise the unified user filter.\n *\n * @method init\n */\n init: function() {\n init();\n }\n };\n});\n"],"file":"request_filter.min.js"}
{"version":3,"file":"request_filter.min.js","sources":["../src/request_filter.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * JS module for the data requests filter.\n *\n * @module tool_dataprivacy/request_filter\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/form-autocomplete', 'core/str', 'core/notification'], function($, Autocomplete, Str, Notification) {\n\n /**\n * Selectors.\n *\n * @access private\n * @type {{REQUEST_FILTERS: string}}\n */\n var SELECTORS = {\n REQUEST_FILTERS: '#request-filters'\n };\n\n /**\n * Init function.\n *\n * @method init\n * @private\n */\n var init = function() {\n var stringkeys = [\n {\n key: 'filter',\n component: 'moodle'\n },\n {\n key: 'nofiltersapplied',\n component: 'moodle'\n }\n ];\n\n Str.get_strings(stringkeys).then(function(langstrings) {\n var placeholder = langstrings[0];\n var noSelectionString = langstrings[1];\n return Autocomplete.enhance(SELECTORS.REQUEST_FILTERS, false, '', placeholder, false, true, noSelectionString, true);\n }).fail(Notification.exception);\n\n var last = $(SELECTORS.REQUEST_FILTERS).val();\n $(SELECTORS.REQUEST_FILTERS).on('change', function() {\n var current = $(this).val();\n // Prevent form from submitting unnecessarily, eg. on blur when no filter is selected.\n if (last.join(',') !== current.join(',')) {\n // If we're submitting without filters, set the hidden input 'filters-cleared' to 1.\n if (current.length === 0) {\n $('#filters-cleared').val(1);\n }\n $(this.form).submit();\n }\n });\n };\n\n return /** @alias module:core/form-autocomplete */ {\n /**\n * Initialise the unified user filter.\n *\n * @method init\n */\n init: function() {\n init();\n }\n };\n});\n"],"names":["define","$","Autocomplete","Str","Notification","SELECTORS","init","get_strings","key","component","then","langstrings","placeholder","noSelectionString","enhance","fail","exception","last","val","on","current","this","join","length","form","submit"],"mappings":";;;;;;;AAsBAA,yCAAO,CAAC,SAAU,yBAA0B,WAAY,sBAAsB,SAASC,EAAGC,aAAcC,IAAKC,kBAQrGC,0BACiB,yBAyC8B,CAM/CC,KAAM,YAtCC,WAYPH,IAAII,YAXa,CACb,CACIC,IAAK,SACLC,UAAW,UAEf,CACID,IAAK,mBACLC,UAAW,YAISC,MAAK,SAASC,iBAClCC,YAAcD,YAAY,GAC1BE,kBAAoBF,YAAY,UAC7BT,aAAaY,QAAQT,2BAA2B,EAAO,GAAIO,aAAa,GAAO,EAAMC,mBAAmB,MAChHE,KAAKX,aAAaY,eAEjBC,KAAOhB,EAAEI,2BAA2Ba,MACxCjB,EAAEI,2BAA2Bc,GAAG,UAAU,eAClCC,QAAUnB,EAAEoB,MAAMH,MAElBD,KAAKK,KAAK,OAASF,QAAQE,KAAK,OAET,IAAnBF,QAAQG,QACRtB,EAAE,oBAAoBiB,IAAI,GAE9BjB,EAAEoB,KAAKG,MAAMC,aAYjBnB"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -9,10 +9,8 @@ Feature: Manage data requests
| username | firstname | lastname | email |
| student1 | John | Doe | s1@example.com |
| student2 | Jane | Doe | s2@example.com |
And I log in as "admin"
And I set the following administration settings values:
| contactdataprotectionofficer | 1 |
And I log out
And the following config values are set as admin:
| contactdataprotectionofficer | 1 | tool_dataprivacy |
@javascript
Scenario: Marking general enquiries as complete
+1 -1
View File
@@ -27,7 +27,7 @@ require_once($CFG->libdir . '/adminlib.php');
admin_externalpage_setup('tool_filetypes');
$extension = required_param('extension', PARAM_RAW);
$extension = required_param('extension', PARAM_ALPHANUMEXT);
$redirecturl = new \moodle_url('/admin/tool/filetypes/index.php');
if (optional_param('revert', 0, PARAM_INT)) {
@@ -100,10 +100,12 @@ class tool_generator_testplan_backend extends tool_generator_backend {
*
* @param int $courseid The target course id
* @param bool $updateuserspassword Updates the course users password to $CFG->tool_generator_users_password
* @param int|null $size of the test plan. Used to limit the number of users exported
* to match the threads in the plan. For BC, defaults to null that means all enrolled users.
* @return stored_file
*/
public static function create_users_file($courseid, $updateuserspassword) {
$csvcontents = self::generate_users_file($courseid, $updateuserspassword);
public static function create_users_file($courseid, $updateuserspassword, ?int $size = null) {
$csvcontents = self::generate_users_file($courseid, $updateuserspassword, $size);
$fs = get_file_storage();
$filerecord = self::get_file_record('users', 'csv');
@@ -171,14 +173,18 @@ class tool_generator_testplan_backend extends tool_generator_backend {
*
* @param int $targetcourseid
* @param bool $updateuserspassword Updates the course users password to $CFG->tool_generator_users_password
* @param int|null $size of the test plan. Used to limit the number of users exported
* to match the threads in the plan. For BC, defaults to null that means all enrolled users.
* @return string The users csv file contents.
*/
protected static function generate_users_file($targetcourseid, $updateuserspassword) {
protected static function generate_users_file($targetcourseid, $updateuserspassword, ?int $size = null) {
global $CFG;
$coursecontext = context_course::instance($targetcourseid);
$users = get_enrolled_users($coursecontext, '', 0, 'u.id, u.username, u.auth', 'u.username ASC');
// If requested, get the number of users (threads) to use in the plan. We only need those in the exported file.
$planusers = self::$users[$size] ?? 0;
$users = get_enrolled_users($coursecontext, '', 0, 'u.id, u.username, u.auth', 'u.username ASC', 0, $planusers);
if (!$users) {
print_error('coursewithoutusers', 'tool_generator');
}
+1 -1
View File
@@ -98,7 +98,7 @@ if (empty($CFG->tool_generator_users_password) || is_bool($CFG->tool_generator_u
// Create files.
$courseid = $DB->get_field('course', 'id', array('shortname' => $shortname));
$usersfile = tool_generator_testplan_backend::create_users_file($courseid, !empty($options['updateuserspassword']));
$usersfile = tool_generator_testplan_backend::create_users_file($courseid, !empty($options['updateuserspassword']), $size);
$testplanfile = tool_generator_testplan_backend::create_testplan_file($courseid, $size);
// One file path per line so other CLI scripts can easily parse the output.
+1 -1
View File
@@ -51,7 +51,7 @@ if ($data = $mform->get_data()) {
// Creating both test plan and users files.
$testplanfile = tool_generator_testplan_backend::create_testplan_file($data->courseid, $data->size);
$usersfile = tool_generator_testplan_backend::create_users_file($data->courseid, $data->updateuserspassword);
$usersfile = tool_generator_testplan_backend::create_users_file($data->courseid, $data->updateuserspassword, $data->size);
// Test plan link.
$testplanurl = moodle_url::make_pluginfile_url(
+7
View File
@@ -1,6 +1,13 @@
This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.
=== 3.10.8 ===
* Function tool_generator_testplan_backend::create_users_file() now supports to pass the size of the testing plan,
that needs to be equal or smaller than the size of the generated site. That's used to effectively restrict the
exported number of users to the number of threads the jmeter plan will have (previously all the enrolled users
were being exported, with that leading to "false" loops (users not really looping X times).
=== 3.7 ===
* Function tool_generator_testplan_backend::get_course_options() is removed, the 'course' form element is used instead.
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_licensemanager/delete_license",["jquery","core/modal_factory","core/modal_events","core/url","core/str"],function(a,b,c,d,e){var f=a(".delete-license");b.create({type:b.types.SAVE_CANCEL,title:e.get_string("deletelicense","tool_licensemanager"),body:e.get_string("deletelicenseconfirmmessage","tool_licensemanager"),preShowCallback:function preShowCallback(b,c){b=a(b);var e={action:"delete",license:b.data("license")};c.deleteURL=d.relativeUrl("/admin/tool/licensemanager/index.php",e,!0)},large:!0},f).done(function(a){a.getRoot().on(c.save,function(b){b.preventDefault();window.location.href=a.deleteURL})})});
//# sourceMappingURL=delete_license.min.js.map
/**
* Modal for confirming deletion of a custom license.
*
* @module tool_licensemanager/delete_license
* @copyright 2019 Tom Dickman <tomdickman@catalyst-au.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_licensemanager/delete_license",["jquery","core/modal_factory","core/modal_events","core/url","core/str"],(function($,ModalFactory,ModalEvents,Url,String){var trigger=$(".delete-license");ModalFactory.create({type:ModalFactory.types.SAVE_CANCEL,title:String.get_string("deletelicense","tool_licensemanager"),body:String.get_string("deletelicenseconfirmmessage","tool_licensemanager"),preShowCallback:function(triggerElement,modal){var params={action:"delete",license:(triggerElement=$(triggerElement)).data("license")};modal.deleteURL=Url.relativeUrl("/admin/tool/licensemanager/index.php",params,!0)},large:!0},trigger).done((function(modal){modal.getRoot().on(ModalEvents.save,(function(e){e.preventDefault(),window.location.href=modal.deleteURL}))}))}));
//# sourceMappingURL=delete_license.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/delete_license.js"],"names":["define","$","ModalFactory","ModalEvents","Url","String","trigger","create","type","types","SAVE_CANCEL","title","get_string","body","preShowCallback","triggerElement","modal","params","data","deleteURL","relativeUrl","large","done","getRoot","on","save","e","preventDefault","window","location","href"],"mappings":"AAsBAA,OAAM,sCAAC,CAAC,QAAD,CAAW,oBAAX,CAAiC,mBAAjC,CAAsD,UAAtD,CAAkE,UAAlE,CAAD,CACF,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAuCC,CAAvC,CAA4CC,CAA5C,CAAoD,CAEhD,GAAIC,CAAAA,CAAO,CAAGL,CAAC,CAAC,iBAAD,CAAf,CACAC,CAAY,CAACK,MAAb,CAAoB,CAChBC,IAAI,CAAEN,CAAY,CAACO,KAAb,CAAmBC,WADT,CAEhBC,KAAK,CAAEN,CAAM,CAACO,UAAP,CAAkB,eAAlB,CAAmC,qBAAnC,CAFS,CAGhBC,IAAI,CAAER,CAAM,CAACO,UAAP,CAAkB,6BAAlB,CAAiD,qBAAjD,CAHU,CAIhBE,eAAe,CAAE,yBAASC,CAAT,CAAyBC,CAAzB,CAAgC,CAC7CD,CAAc,CAAGd,CAAC,CAACc,CAAD,CAAlB,CACA,GAAIE,CAAAA,CAAM,CAAG,CACT,OAAU,QADD,CAET,QAAWF,CAAc,CAACG,IAAf,CAAoB,SAApB,CAFF,CAAb,CAIAF,CAAK,CAACG,SAAN,CAAkBf,CAAG,CAACgB,WAAJ,CAAgB,sCAAhB,CAAwDH,CAAxD,IACrB,CAXe,CAYhBI,KAAK,GAZW,CAApB,CAaGf,CAbH,EAcKgB,IAdL,CAcU,SAASN,CAAT,CAAgB,CAClBA,CAAK,CAACO,OAAN,GAAgBC,EAAhB,CAAmBrB,CAAW,CAACsB,IAA/B,CAAqC,SAASC,CAAT,CAAY,CAE7CA,CAAC,CAACC,cAAF,GAEAC,MAAM,CAACC,QAAP,CAAgBC,IAAhB,CAAuBd,CAAK,CAACG,SAChC,CALD,CAMH,CArBL,CAsBH,CA1BC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Modal for confirming deletion of a custom license.\n *\n * @module tool_licensemanager/delete_license\n * @copyright 2019 Tom Dickman <tomdickman@catalyst-au.net>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/modal_factory', 'core/modal_events', 'core/url', 'core/str'],\n function($, ModalFactory, ModalEvents, Url, String) {\n\n var trigger = $('.delete-license');\n ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: String.get_string('deletelicense', 'tool_licensemanager'),\n body: String.get_string('deletelicenseconfirmmessage', 'tool_licensemanager'),\n preShowCallback: function(triggerElement, modal) {\n triggerElement = $(triggerElement);\n let params = {\n 'action': 'delete',\n 'license': triggerElement.data('license')\n };\n modal.deleteURL = Url.relativeUrl('/admin/tool/licensemanager/index.php', params, true);\n },\n large: true,\n }, trigger)\n .done(function(modal) {\n modal.getRoot().on(ModalEvents.save, function(e) {\n // Stop the default save button behaviour which is to close the modal.\n e.preventDefault();\n // Redirect to delete url.\n window.location.href = modal.deleteURL;\n });\n });\n });\n"],"file":"delete_license.min.js"}
{"version":3,"file":"delete_license.min.js","sources":["../src/delete_license.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Modal for confirming deletion of a custom license.\n *\n * @module tool_licensemanager/delete_license\n * @copyright 2019 Tom Dickman <tomdickman@catalyst-au.net>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/modal_factory', 'core/modal_events', 'core/url', 'core/str'],\n function($, ModalFactory, ModalEvents, Url, String) {\n\n var trigger = $('.delete-license');\n ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: String.get_string('deletelicense', 'tool_licensemanager'),\n body: String.get_string('deletelicenseconfirmmessage', 'tool_licensemanager'),\n preShowCallback: function(triggerElement, modal) {\n triggerElement = $(triggerElement);\n let params = {\n 'action': 'delete',\n 'license': triggerElement.data('license')\n };\n modal.deleteURL = Url.relativeUrl('/admin/tool/licensemanager/index.php', params, true);\n },\n large: true,\n }, trigger)\n .done(function(modal) {\n modal.getRoot().on(ModalEvents.save, function(e) {\n // Stop the default save button behaviour which is to close the modal.\n e.preventDefault();\n // Redirect to delete url.\n window.location.href = modal.deleteURL;\n });\n });\n });\n"],"names":["define","$","ModalFactory","ModalEvents","Url","String","trigger","create","type","types","SAVE_CANCEL","title","get_string","body","preShowCallback","triggerElement","modal","params","data","deleteURL","relativeUrl","large","done","getRoot","on","save","e","preventDefault","window","location","href"],"mappings":";;;;;;;AAsBAA,4CAAO,CAAC,SAAU,qBAAsB,oBAAqB,WAAY,aACrE,SAASC,EAAGC,aAAcC,YAAaC,IAAKC,YAEpCC,QAAUL,EAAE,mBAChBC,aAAaK,OAAO,CAChBC,KAAMN,aAAaO,MAAMC,YACzBC,MAAON,OAAOO,WAAW,gBAAiB,uBAC1CC,KAAMR,OAAOO,WAAW,8BAA+B,uBACvDE,gBAAiB,SAASC,eAAgBC,WAElCC,OAAS,QACC,kBAFdF,eAAiBd,EAAEc,iBAGWG,KAAK,YAEnCF,MAAMG,UAAYf,IAAIgB,YAAY,uCAAwCH,QAAQ,IAEtFI,OAAO,GACRf,SACEgB,MAAK,SAASN,OACXA,MAAMO,UAAUC,GAAGrB,YAAYsB,MAAM,SAASC,GAE1CA,EAAEC,iBAEFC,OAAOC,SAASC,KAAOd,MAAMG"}
+2
View File
@@ -50,6 +50,7 @@ switch ($action) {
case 'disable':
unset($enabled[$enrol]);
set_config('enabled_stores', implode(',', array_keys($enabled)), 'tool_log');
add_to_config_log('tool_logstore_visibility', '1', '0', $enrol);
break;
case 'enable':
@@ -59,6 +60,7 @@ switch ($action) {
$enabled = array_keys($enabled);
$enabled[] = $enrol;
set_config('enabled_stores', implode(',', $enabled), 'tool_log');
add_to_config_log('tool_logstore_visibility', '0', '1', $enrol);
break;
case 'up':
@@ -0,0 +1,19 @@
@tool_log @report @report_configlog
Feature: In a report, admin can see logstore visibility changes
# Change log stores visibility so the report contains known data.
Background:
Given I log in as "admin"
And the following config values are set as admin:
| enabled_stores | logstore_standard | tool_log |
@javascript
Scenario: Display configuration changes report
When I navigate to "Plugins > Logging > Manage log stores" in site administration
And I click on "Disable" "icon" in the "Standard log" "table_row"
And I click on "Enable" "icon" in the "External database log" "table_row"
And I navigate to "Reports > Config changes" in site administration
Then the following should exist in the "report-configlog-report-table" table:
| User | Plugin | Setting | New value | Original value |
| Admin User | logstore_standard | tool_logstore_visibility | 0 | 1 |
| Admin User | logstore_database | tool_logstore_visibility | 1 | 0 |
+14 -2
View File
@@ -1,2 +1,14 @@
define ("tool_lp/actionselector",["jquery","core/notification","core/ajax","core/templates","tool_lp/dialogue","tool_lp/event_base"],function(a,b,c,d,e,f){var g=function(a,b,c,d,e){var g=this;f.prototype.constructor.apply(this,[]);g._title=a;g._message=b;g._actions=c;g._confirm=d;g._cancel=e;g._selectedValue=null;g._reset()};g.prototype=Object.create(f.prototype);g.prototype._selectedValue=null;g.prototype._popup=null;g.prototype._title=null;g.prototype._message=null;g.prototype._actions=null;g.prototype._confirm=null;g.prototype._cancel=null;g.prototype._afterRender=function(){var b=this;b._find("[data-action=\"action-selector-confirm\"]").attr("disabled","disabled");b._find("[data-region=\"action-selector-radio-buttons\"]").change(function(){b._selectedValue=a("input[type='radio']:checked").val();b._find("[data-action=\"action-selector-confirm\"]").removeAttr("disabled");b._refresh.bind(b)});b._find("[data-action=\"action-selector-cancel\"]").click(function(a){a.preventDefault();b.close()});b._find("[data-action=\"action-selector-confirm\"]").click(function(a){a.preventDefault();if(!b._selectedValue.length){return}b._trigger("save",{action:b._selectedValue});b.close()})};g.prototype.close=function(){var a=this;a._popup.close();a._reset()};g.prototype.display=function(){var a=this;return a._render().then(function(b){a._popup=new e(a._title,b,a._afterRender.bind(a))}).fail(b.exception)};g.prototype._find=function(b){return a(this._popup.getContent()).find(b)};g.prototype._refresh=function(){var a=this;return a._render().then(function(b){a._find("[data-region=\"action-selector\"]").replaceWith(b);a._afterRender()})};g.prototype._render=function(){var a=this,b=[];for(var c in a._actions){b.push(a._actions[c])}var e={message:a._message,choices:b,confirm:a._confirm,cancel:a._cancel};return d.render("tool_lp/action_selector",e)};g.prototype._reset=function(){this._popup=null;this._selectedValue=""};return g});
//# sourceMappingURL=actionselector.min.js.map
/**
* Action selector.
*
* To handle 'save' events use: actionselector.on('save')
* This will receive the information to display in popup.
* The actions have the format [{'text': sometext, 'value' : somevalue}].
*
* @module tool_lp/actionselector
* @copyright 2016 Serge Gauthier - <serge.gauthier.2@umontreal.ca>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/actionselector",["jquery","core/notification","core/ajax","core/templates","tool_lp/dialogue","tool_lp/event_base"],(function($,Notification,Ajax,Templates,Dialogue,EventBase){var ActionSelector=function(title,message,actions,confirm,cancel){EventBase.prototype.constructor.apply(this,[]),this._title=title,this._message=message,this._actions=actions,this._confirm=confirm,this._cancel=cancel,this._selectedValue=null,this._reset()};return(ActionSelector.prototype=Object.create(EventBase.prototype))._selectedValue=null,ActionSelector.prototype._popup=null,ActionSelector.prototype._title=null,ActionSelector.prototype._message=null,ActionSelector.prototype._actions=null,ActionSelector.prototype._confirm=null,ActionSelector.prototype._cancel=null,ActionSelector.prototype._afterRender=function(){var self=this;self._find('[data-action="action-selector-confirm"]').attr("disabled","disabled"),self._find('[data-region="action-selector-radio-buttons"]').change((function(){self._selectedValue=$("input[type='radio']:checked").val(),self._find('[data-action="action-selector-confirm"]').removeAttr("disabled"),self._refresh.bind(self)})),self._find('[data-action="action-selector-cancel"]').click((function(e){e.preventDefault(),self.close()})),self._find('[data-action="action-selector-confirm"]').click((function(e){e.preventDefault(),self._selectedValue.length&&(self._trigger("save",{action:self._selectedValue}),self.close())}))},ActionSelector.prototype.close=function(){this._popup.close(),this._reset()},ActionSelector.prototype.display=function(){var self=this;return self._render().then((function(html){self._popup=new Dialogue(self._title,html,self._afterRender.bind(self))})).fail(Notification.exception)},ActionSelector.prototype._find=function(selector){return $(this._popup.getContent()).find(selector)},ActionSelector.prototype._refresh=function(){var self=this;return self._render().then((function(html){self._find('[data-region="action-selector"]').replaceWith(html),self._afterRender()}))},ActionSelector.prototype._render=function(){var choices=[];for(var i in this._actions)choices.push(this._actions[i]);var content={message:this._message,choices:choices,confirm:this._confirm,cancel:this._cancel};return Templates.render("tool_lp/action_selector",content)},ActionSelector.prototype._reset=function(){this._popup=null,this._selectedValue=""},ActionSelector}));
//# sourceMappingURL=actionselector.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/competency_outcomes",["jquery","core/str"],function(a,b){return{NONE:0,EVIDENCE:1,COMPLETE:2,RECOMMEND:3,getAll:function getAll(){var a=this;return b.get_strings([{key:"competencyoutcome_none",component:"tool_lp"},{key:"competencyoutcome_evidence",component:"tool_lp"},{key:"competencyoutcome_recommend",component:"tool_lp"},{key:"competencyoutcome_complete",component:"tool_lp"}]).then(function(b){var c={};c[a.NONE]={code:a.NONE,name:b[0]};c[a.EVIDENCE]={code:a.EVIDENCE,name:b[1]};c[a.RECOMMEND]={code:a.RECOMMEND,name:b[2]};c[a.COMPLETE]={code:a.COMPLETE,name:b[3]};return c})},getString:function getString(b){var c=this,d=c.getAll();return d.then(function(c){if("undefined"==typeof c[b]){return a.Deferred().reject().promise()}return c[b].name})}}});
//# sourceMappingURL=competency_outcomes.min.js.map
/**
* Competency rule config.
*
* @module tool_lp/competency_outcomes
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/competency_outcomes",["jquery","core/str"],(function($,Str){return{NONE:0,EVIDENCE:1,COMPLETE:2,RECOMMEND:3,getAll:function(){var self=this;return Str.get_strings([{key:"competencyoutcome_none",component:"tool_lp"},{key:"competencyoutcome_evidence",component:"tool_lp"},{key:"competencyoutcome_recommend",component:"tool_lp"},{key:"competencyoutcome_complete",component:"tool_lp"}]).then((function(strings){var outcomes={};return outcomes[self.NONE]={code:self.NONE,name:strings[0]},outcomes[self.EVIDENCE]={code:self.EVIDENCE,name:strings[1]},outcomes[self.RECOMMEND]={code:self.RECOMMEND,name:strings[2]},outcomes[self.COMPLETE]={code:self.COMPLETE,name:strings[3]},outcomes}))},getString:function(id){return this.getAll().then((function(outcomes){return void 0===outcomes[id]?$.Deferred().reject().promise():outcomes[id].name}))}}}));
//# sourceMappingURL=competency_outcomes.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/competency_outcomes.js"],"names":["define","$","Str","NONE","EVIDENCE","COMPLETE","RECOMMEND","getAll","self","get_strings","key","component","then","strings","outcomes","code","name","getString","id","all","Deferred","reject","promise"],"mappings":"AAuBAA,OAAM,+BAAC,CAAC,QAAD,CACC,UADD,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAiB,CAOrB,MAAO,CAEHC,IAAI,EAFD,CAGHC,QAAQ,EAHL,CAIHC,QAAQ,EAJL,CAKHC,SAAS,EALN,CAaHC,MAAM,CAAE,iBAAW,CACf,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACA,MAAON,CAAAA,CAAG,CAACO,WAAJ,CAAgB,CACnB,CAACC,GAAG,CAAE,wBAAN,CAAgCC,SAAS,CAAE,SAA3C,CADmB,CAEnB,CAACD,GAAG,CAAE,4BAAN,CAAoCC,SAAS,CAAE,SAA/C,CAFmB,CAGnB,CAACD,GAAG,CAAE,6BAAN,CAAqCC,SAAS,CAAE,SAAhD,CAHmB,CAInB,CAACD,GAAG,CAAE,4BAAN,CAAoCC,SAAS,CAAE,SAA/C,CAJmB,CAAhB,EAKJC,IALI,CAKC,SAASC,CAAT,CAAkB,CACtB,GAAIC,CAAAA,CAAQ,CAAG,EAAf,CACAA,CAAQ,CAACN,CAAI,CAACL,IAAN,CAAR,CAAsB,CAACY,IAAI,CAAEP,CAAI,CAACL,IAAZ,CAAkBa,IAAI,CAAEH,CAAO,CAAC,CAAD,CAA/B,CAAtB,CACAC,CAAQ,CAACN,CAAI,CAACJ,QAAN,CAAR,CAA0B,CAACW,IAAI,CAAEP,CAAI,CAACJ,QAAZ,CAAsBY,IAAI,CAAEH,CAAO,CAAC,CAAD,CAAnC,CAA1B,CACAC,CAAQ,CAACN,CAAI,CAACF,SAAN,CAAR,CAA2B,CAACS,IAAI,CAAEP,CAAI,CAACF,SAAZ,CAAuBU,IAAI,CAAEH,CAAO,CAAC,CAAD,CAApC,CAA3B,CACAC,CAAQ,CAACN,CAAI,CAACH,QAAN,CAAR,CAA0B,CAACU,IAAI,CAAEP,CAAI,CAACH,QAAZ,CAAsBW,IAAI,CAAEH,CAAO,CAAC,CAAD,CAAnC,CAA1B,CACA,MAAOC,CAAAA,CACV,CAZM,CAaV,CA5BE,CAqCHG,SAAS,CAAE,mBAASC,CAAT,CAAa,CACpB,GAAIV,CAAAA,CAAI,CAAG,IAAX,CACIW,CAAG,CAAGX,CAAI,CAACD,MAAL,EADV,CAGA,MAAOY,CAAAA,CAAG,CAACP,IAAJ,CAAS,SAASE,CAAT,CAAmB,CAC/B,GAA4B,WAAxB,QAAOA,CAAAA,CAAQ,CAACI,CAAD,CAAnB,CAAyC,CACrC,MAAOjB,CAAAA,CAAC,CAACmB,QAAF,GAAaC,MAAb,GAAsBC,OAAtB,EACV,CACD,MAAOR,CAAAA,CAAQ,CAACI,CAAD,CAAR,CAAaF,IACvB,CALM,CAMV,CA/CE,CAiDV,CA1DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Competency rule config.\n *\n * @module tool_lp/competency_outcomes\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str'],\n function($, Str) {\n\n var OUTCOME_NONE = 0,\n OUTCOME_EVIDENCE = 1,\n OUTCOME_COMPLETE = 2,\n OUTCOME_RECOMMEND = 3;\n\n return {\n\n NONE: OUTCOME_NONE,\n EVIDENCE: OUTCOME_EVIDENCE,\n COMPLETE: OUTCOME_COMPLETE,\n RECOMMEND: OUTCOME_RECOMMEND,\n\n /**\n * Get all the outcomes.\n *\n * @return {Object} Indexed by outcome code, contains code and name.\n * @method getAll\n */\n getAll: function() {\n var self = this;\n return Str.get_strings([\n {key: 'competencyoutcome_none', component: 'tool_lp'},\n {key: 'competencyoutcome_evidence', component: 'tool_lp'},\n {key: 'competencyoutcome_recommend', component: 'tool_lp'},\n {key: 'competencyoutcome_complete', component: 'tool_lp'},\n ]).then(function(strings) {\n var outcomes = {};\n outcomes[self.NONE] = {code: self.NONE, name: strings[0]};\n outcomes[self.EVIDENCE] = {code: self.EVIDENCE, name: strings[1]};\n outcomes[self.RECOMMEND] = {code: self.RECOMMEND, name: strings[2]};\n outcomes[self.COMPLETE] = {code: self.COMPLETE, name: strings[3]};\n return outcomes;\n });\n },\n\n /**\n * Get the string for an outcome.\n *\n * @param {Number} id The outcome code.\n * @return {Promise} Resolved with the string.\n * @method getString\n */\n getString: function(id) {\n var self = this,\n all = self.getAll();\n\n return all.then(function(outcomes) {\n if (typeof outcomes[id] === 'undefined') {\n return $.Deferred().reject().promise();\n }\n return outcomes[id].name;\n });\n }\n };\n});\n"],"file":"competency_outcomes.min.js"}
{"version":3,"file":"competency_outcomes.min.js","sources":["../src/competency_outcomes.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Competency rule config.\n *\n * @module tool_lp/competency_outcomes\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str'],\n function($, Str) {\n\n var OUTCOME_NONE = 0,\n OUTCOME_EVIDENCE = 1,\n OUTCOME_COMPLETE = 2,\n OUTCOME_RECOMMEND = 3;\n\n return {\n\n NONE: OUTCOME_NONE,\n EVIDENCE: OUTCOME_EVIDENCE,\n COMPLETE: OUTCOME_COMPLETE,\n RECOMMEND: OUTCOME_RECOMMEND,\n\n /**\n * Get all the outcomes.\n *\n * @return {Object} Indexed by outcome code, contains code and name.\n * @method getAll\n */\n getAll: function() {\n var self = this;\n return Str.get_strings([\n {key: 'competencyoutcome_none', component: 'tool_lp'},\n {key: 'competencyoutcome_evidence', component: 'tool_lp'},\n {key: 'competencyoutcome_recommend', component: 'tool_lp'},\n {key: 'competencyoutcome_complete', component: 'tool_lp'},\n ]).then(function(strings) {\n var outcomes = {};\n outcomes[self.NONE] = {code: self.NONE, name: strings[0]};\n outcomes[self.EVIDENCE] = {code: self.EVIDENCE, name: strings[1]};\n outcomes[self.RECOMMEND] = {code: self.RECOMMEND, name: strings[2]};\n outcomes[self.COMPLETE] = {code: self.COMPLETE, name: strings[3]};\n return outcomes;\n });\n },\n\n /**\n * Get the string for an outcome.\n *\n * @param {Number} id The outcome code.\n * @return {Promise} Resolved with the string.\n * @method getString\n */\n getString: function(id) {\n var self = this,\n all = self.getAll();\n\n return all.then(function(outcomes) {\n if (typeof outcomes[id] === 'undefined') {\n return $.Deferred().reject().promise();\n }\n return outcomes[id].name;\n });\n }\n };\n});\n"],"names":["define","$","Str","NONE","EVIDENCE","COMPLETE","RECOMMEND","getAll","self","this","get_strings","key","component","then","strings","outcomes","code","name","getString","id","Deferred","reject","promise"],"mappings":";;;;;;;AAuBAA,qCAAO,CAAC,SACA,aACA,SAASC,EAAGC,WAOT,CAEHC,KAPe,EAQfC,SAPmB,EAQnBC,SAPmB,EAQnBC,UAPoB,EAepBC,OAAQ,eACAC,KAAOC,YACJP,IAAIQ,YAAY,CACnB,CAACC,IAAK,yBAA0BC,UAAW,WAC3C,CAACD,IAAK,6BAA8BC,UAAW,WAC/C,CAACD,IAAK,8BAA+BC,UAAW,WAChD,CAACD,IAAK,6BAA8BC,UAAW,aAChDC,MAAK,SAASC,aACTC,SAAW,UACfA,SAASP,KAAKL,MAAQ,CAACa,KAAMR,KAAKL,KAAMc,KAAMH,QAAQ,IACtDC,SAASP,KAAKJ,UAAY,CAACY,KAAMR,KAAKJ,SAAUa,KAAMH,QAAQ,IAC9DC,SAASP,KAAKF,WAAa,CAACU,KAAMR,KAAKF,UAAWW,KAAMH,QAAQ,IAChEC,SAASP,KAAKH,UAAY,CAACW,KAAMR,KAAKH,SAAUY,KAAMH,QAAQ,IACvDC,aAWfG,UAAW,SAASC,WACLV,KACIF,SAEJM,MAAK,SAASE,sBACO,IAAjBA,SAASI,IACTlB,EAAEmB,WAAWC,SAASC,UAE1BP,SAASI,IAAIF"}
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/competency_plan_navigation",["jquery"],function(a){var b=function(b,c,d,e,f){this._baseUrl=c;this._userId=d+"";this._competencyId=e+"";this._planId=f;this._ignoreFirstCompetency=!0;a(b).on("change",this._competencyChanged.bind(this))};b.prototype._competencyChanged=function(b){if(this._ignoreFirstCompetency){this._ignoreFirstCompetency=!1;return}var c=a(b.target).val(),d="?userid="+this._userId+"&planid="+this._planId+"&competencyid="+c;document.location=this._baseUrl+d};b.prototype._competencyId=null;b.prototype._userId=null;b.prototype._planId=null;b.prototype._baseUrl=null;b.prototype._ignoreFirstCompetency=null;return b});
//# sourceMappingURL=competency_plan_navigation.min.js.map
/**
* Event click on selecting competency in the competency autocomplete.
*
* @module tool_lp/competency_plan_navigation
* @copyright 2016 Issam Taboubi <issam.taboubi@umontreal.ca>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/competency_plan_navigation",["jquery"],(function($){var CompetencyPlanNavigation=function(competencySelector,baseUrl,userId,competencyId,planId){this._baseUrl=baseUrl,this._userId=userId+"",this._competencyId=competencyId+"",this._planId=planId,this._ignoreFirstCompetency=!0,$(competencySelector).on("change",this._competencyChanged.bind(this))};return CompetencyPlanNavigation.prototype._competencyChanged=function(e){if(this._ignoreFirstCompetency)this._ignoreFirstCompetency=!1;else{var newCompetencyId=$(e.target).val(),queryStr="?userid="+this._userId+"&planid="+this._planId+"&competencyid="+newCompetencyId;document.location=this._baseUrl+queryStr}},CompetencyPlanNavigation.prototype._competencyId=null,CompetencyPlanNavigation.prototype._userId=null,CompetencyPlanNavigation.prototype._planId=null,CompetencyPlanNavigation.prototype._baseUrl=null,CompetencyPlanNavigation.prototype._ignoreFirstCompetency=null,CompetencyPlanNavigation}));
//# sourceMappingURL=competency_plan_navigation.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/competency_plan_navigation.js"],"names":["define","$","CompetencyPlanNavigation","competencySelector","baseUrl","userId","competencyId","planId","_baseUrl","_userId","_competencyId","_planId","_ignoreFirstCompetency","on","_competencyChanged","bind","prototype","e","newCompetencyId","target","val","queryStr","document","location"],"mappings":"AAuBAA,OAAM,sCAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAY3B,GAAIC,CAAAA,CAAwB,CAAG,SAASC,CAAT,CAA6BC,CAA7B,CAAsCC,CAAtC,CAA8CC,CAA9C,CAA4DC,CAA5D,CAAoE,CAC/F,KAAKC,QAAL,CAAgBJ,CAAhB,CACA,KAAKK,OAAL,CAAeJ,CAAM,CAAG,EAAxB,CACA,KAAKK,aAAL,CAAqBJ,CAAY,CAAG,EAApC,CACA,KAAKK,OAAL,CAAeJ,CAAf,CACA,KAAKK,sBAAL,IAEAX,CAAC,CAACE,CAAD,CAAD,CAAsBU,EAAtB,CAAyB,QAAzB,CAAmC,KAAKC,kBAAL,CAAwBC,IAAxB,CAA6B,IAA7B,CAAnC,CACH,CARD,CAgBAb,CAAwB,CAACc,SAAzB,CAAmCF,kBAAnC,CAAwD,SAASG,CAAT,CAAY,CAChE,GAAI,KAAKL,sBAAT,CAAiC,CAC7B,KAAKA,sBAAL,IACA,MACH,CAJ+D,GAK5DM,CAAAA,CAAe,CAAGjB,CAAC,CAACgB,CAAC,CAACE,MAAH,CAAD,CAAYC,GAAZ,EAL0C,CAM5DC,CAAQ,CAAG,WAAa,KAAKZ,OAAlB,CAA4B,UAA5B,CAAyC,KAAKE,OAA9C,CAAwD,gBAAxD,CAA2EO,CAN1B,CAOhEI,QAAQ,CAACC,QAAT,CAAoB,KAAKf,QAAL,CAAgBa,CACvC,CARD,CAWAnB,CAAwB,CAACc,SAAzB,CAAmCN,aAAnC,CAAmD,IAAnD,CAEAR,CAAwB,CAACc,SAAzB,CAAmCP,OAAnC,CAA6C,IAA7C,CAEAP,CAAwB,CAACc,SAAzB,CAAmCL,OAAnC,CAA6C,IAA7C,CAEAT,CAAwB,CAACc,SAAzB,CAAmCR,QAAnC,CAA8C,IAA9C,CAEAN,CAAwB,CAACc,SAAzB,CAAmCJ,sBAAnC,CAA4D,IAA5D,CAEA,MAAOV,CAAAA,CACV,CAlDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Event click on selecting competency in the competency autocomplete.\n *\n * @module tool_lp/competency_plan_navigation\n * @copyright 2016 Issam Taboubi <issam.taboubi@umontreal.ca>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * CompetencyPlanNavigation\n *\n * @class\n * @param {String} competencySelector The selector of the competency element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} userId The user id\n * @param {Number} competencyId The competency id\n * @param {Number} planId The plan id\n */\n var CompetencyPlanNavigation = function(competencySelector, baseUrl, userId, competencyId, planId) {\n this._baseUrl = baseUrl;\n this._userId = userId + '';\n this._competencyId = competencyId + '';\n this._planId = planId;\n this._ignoreFirstCompetency = true;\n\n $(competencySelector).on('change', this._competencyChanged.bind(this));\n };\n\n /**\n * The competency was changed in the select list.\n *\n * @method _competencyChanged\n * @param {Event} e\n */\n CompetencyPlanNavigation.prototype._competencyChanged = function(e) {\n if (this._ignoreFirstCompetency) {\n this._ignoreFirstCompetency = false;\n return;\n }\n var newCompetencyId = $(e.target).val();\n var queryStr = '?userid=' + this._userId + '&planid=' + this._planId + '&competencyid=' + newCompetencyId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the competency. */\n CompetencyPlanNavigation.prototype._competencyId = null;\n /** @property {Number} The id of the user. */\n CompetencyPlanNavigation.prototype._userId = null;\n /** @property {Number} The id of the plan. */\n CompetencyPlanNavigation.prototype._planId = null;\n /** @property {String} Plugin base url. */\n CompetencyPlanNavigation.prototype._baseUrl = null;\n /** @property {Boolean} Ignore the first change event for competencies. */\n CompetencyPlanNavigation.prototype._ignoreFirstCompetency = null;\n\n return CompetencyPlanNavigation;\n});\n"],"file":"competency_plan_navigation.min.js"}
{"version":3,"file":"competency_plan_navigation.min.js","sources":["../src/competency_plan_navigation.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Event click on selecting competency in the competency autocomplete.\n *\n * @module tool_lp/competency_plan_navigation\n * @copyright 2016 Issam Taboubi <issam.taboubi@umontreal.ca>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * CompetencyPlanNavigation\n *\n * @class\n * @param {String} competencySelector The selector of the competency element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} userId The user id\n * @param {Number} competencyId The competency id\n * @param {Number} planId The plan id\n */\n var CompetencyPlanNavigation = function(competencySelector, baseUrl, userId, competencyId, planId) {\n this._baseUrl = baseUrl;\n this._userId = userId + '';\n this._competencyId = competencyId + '';\n this._planId = planId;\n this._ignoreFirstCompetency = true;\n\n $(competencySelector).on('change', this._competencyChanged.bind(this));\n };\n\n /**\n * The competency was changed in the select list.\n *\n * @method _competencyChanged\n * @param {Event} e\n */\n CompetencyPlanNavigation.prototype._competencyChanged = function(e) {\n if (this._ignoreFirstCompetency) {\n this._ignoreFirstCompetency = false;\n return;\n }\n var newCompetencyId = $(e.target).val();\n var queryStr = '?userid=' + this._userId + '&planid=' + this._planId + '&competencyid=' + newCompetencyId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the competency. */\n CompetencyPlanNavigation.prototype._competencyId = null;\n /** @property {Number} The id of the user. */\n CompetencyPlanNavigation.prototype._userId = null;\n /** @property {Number} The id of the plan. */\n CompetencyPlanNavigation.prototype._planId = null;\n /** @property {String} Plugin base url. */\n CompetencyPlanNavigation.prototype._baseUrl = null;\n /** @property {Boolean} Ignore the first change event for competencies. */\n CompetencyPlanNavigation.prototype._ignoreFirstCompetency = null;\n\n return CompetencyPlanNavigation;\n});\n"],"names":["define","$","CompetencyPlanNavigation","competencySelector","baseUrl","userId","competencyId","planId","_baseUrl","_userId","_competencyId","_planId","_ignoreFirstCompetency","on","this","_competencyChanged","bind","prototype","e","newCompetencyId","target","val","queryStr","document","location"],"mappings":";;;;;;;AAuBAA,4CAAO,CAAC,WAAW,SAASC,OAYpBC,yBAA2B,SAASC,mBAAoBC,QAASC,OAAQC,aAAcC,aAClFC,SAAWJ,aACXK,QAAUJ,OAAS,QACnBK,cAAgBJ,aAAe,QAC/BK,QAAUJ,YACVK,wBAAyB,EAE9BX,EAAEE,oBAAoBU,GAAG,SAAUC,KAAKC,mBAAmBC,KAAKF,eASpEZ,yBAAyBe,UAAUF,mBAAqB,SAASG,MACzDJ,KAAKF,4BACAA,wBAAyB,WAG9BO,gBAAkBlB,EAAEiB,EAAEE,QAAQC,MAC9BC,SAAW,WAAaR,KAAKL,QAAU,WAAaK,KAAKH,QAAU,iBAAmBQ,gBAC1FI,SAASC,SAAWV,KAAKN,SAAWc,WAIxCpB,yBAAyBe,UAAUP,cAAgB,KAEnDR,yBAAyBe,UAAUR,QAAU,KAE7CP,yBAAyBe,UAAUN,QAAU,KAE7CT,yBAAyBe,UAAUT,SAAW,KAE9CN,yBAAyBe,UAAUL,uBAAyB,KAErDV"}
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/competency_rule",["jquery"],function(a){var b=function(b){this._eventNode=a("<div>");this._ready=a.Deferred();this._tree=b};b.prototype._competency=null;b.prototype._eventNode=null;b.prototype._ready=null;b.prototype._tree=null;b.prototype.canConfig=function(){return this._tree.hasChildren(this._competency.id)};b.prototype.getConfig=function(){return null};b.prototype.getType=function(){throw new Error("Not implemented")};b.prototype.init=function(){return this._load()};b.prototype.injectTemplate=function(){return a.Deferred().reject().promise()};b.prototype.isValid=function(){return!1};b.prototype._load=function(){return a.when()};b.prototype.on=function(a,b){this._eventNode.on(a,b)};b.prototype.setTargetCompetency=function(a){this._competency=a};b.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])};b.prototype._triggerChange=function(){this._trigger("change",this)};return b});
//# sourceMappingURL=competency_rule.min.js.map
/**
* Competency rule base module.
*
* @module tool_lp/competencyrule
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/competency_rule",["jquery"],(function($){var Rule=function(tree){this._eventNode=$("<div>"),this._ready=$.Deferred(),this._tree=tree};return Rule.prototype._competency=null,Rule.prototype._eventNode=null,Rule.prototype._ready=null,Rule.prototype._tree=null,Rule.prototype.canConfig=function(){return this._tree.hasChildren(this._competency.id)},Rule.prototype.getConfig=function(){return null},Rule.prototype.getType=function(){throw new Error("Not implemented")},Rule.prototype.init=function(){return this._load()},Rule.prototype.injectTemplate=function(){return $.Deferred().reject().promise()},Rule.prototype.isValid=function(){return!1},Rule.prototype._load=function(){return $.when()},Rule.prototype.on=function(type,handler){this._eventNode.on(type,handler)},Rule.prototype.setTargetCompetency=function(competency){this._competency=competency},Rule.prototype._trigger=function(type,data){this._eventNode.trigger(type,[data])},Rule.prototype._triggerChange=function(){this._trigger("change",this)},Rule}));
//# sourceMappingURL=competency_rule.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/competency_rule_all",["jquery","core/str","tool_lp/competency_rule"],function(a,b,c){var d=function(){c.apply(this,arguments)};d.prototype=Object.create(c.prototype);d.prototype.getType=function(){return"core_competency\\competency_rule_all"};d.prototype.isValid=function(){return!0};return d});
//# sourceMappingURL=competency_rule_all.min.js.map
/**
* Competency rule all module.
*
* @module tool_lp/competency_rule_all
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/competency_rule_all",["jquery","core/str","tool_lp/competency_rule"],(function($,Str,RuleBase){var Rule=function(){RuleBase.apply(this,arguments)};return(Rule.prototype=Object.create(RuleBase.prototype)).getType=function(){return"core_competency\\competency_rule_all"},Rule.prototype.isValid=function(){return!0},Rule}));
//# sourceMappingURL=competency_rule_all.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/competency_rule_all.js"],"names":["define","$","Str","RuleBase","Rule","apply","arguments","prototype","Object","create","getType","isValid"],"mappings":"AAuBAA,OAAM,+BAAC,CAAC,QAAD,CACC,UADD,CAEC,yBAFD,CAAD,CAIE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA2B,CAO/B,GAAIC,CAAAA,CAAI,CAAG,UAAW,CAClBD,CAAQ,CAACE,KAAT,CAAe,IAAf,CAAqBC,SAArB,CACH,CAFD,CAGAF,CAAI,CAACG,SAAL,CAAiBC,MAAM,CAACC,MAAP,CAAcN,CAAQ,CAACI,SAAvB,CAAjB,CAQAH,CAAI,CAACG,SAAL,CAAeG,OAAf,CAAyB,UAAW,CAChC,MAAO,sCACV,CAFD,CAUAN,CAAI,CAACG,SAAL,CAAeI,OAAf,CAAyB,UAAW,CAChC,QACH,CAFD,CAIA,MAAOP,CAAAA,CACV,CArCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Competency rule all module.\n *\n * @module tool_lp/competency_rule_all\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str',\n 'tool_lp/competency_rule',\n ],\n function($, Str, RuleBase) {\n\n /**\n * Competency rule all class.\n *\n * @class tool_lp/competency_rule_all\n */\n var Rule = function() {\n RuleBase.apply(this, arguments);\n };\n Rule.prototype = Object.create(RuleBase.prototype);\n\n /**\n * Return the type of the module.\n *\n * @return {String}\n * @method getType\n */\n Rule.prototype.getType = function() {\n return 'core_competency\\\\competency_rule_all';\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * @return {Boolean}\n * @method isValid\n */\n Rule.prototype.isValid = function() {\n return true;\n };\n\n return Rule;\n});\n"],"file":"competency_rule_all.min.js"}
{"version":3,"file":"competency_rule_all.min.js","sources":["../src/competency_rule_all.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Competency rule all module.\n *\n * @module tool_lp/competency_rule_all\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str',\n 'tool_lp/competency_rule',\n ],\n function($, Str, RuleBase) {\n\n /**\n * Competency rule all class.\n *\n * @class tool_lp/competency_rule_all\n */\n var Rule = function() {\n RuleBase.apply(this, arguments);\n };\n Rule.prototype = Object.create(RuleBase.prototype);\n\n /**\n * Return the type of the module.\n *\n * @return {String}\n * @method getType\n */\n Rule.prototype.getType = function() {\n return 'core_competency\\\\competency_rule_all';\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * @return {Boolean}\n * @method isValid\n */\n Rule.prototype.isValid = function() {\n return true;\n };\n\n return Rule;\n});\n"],"names":["define","$","Str","RuleBase","Rule","apply","this","arguments","prototype","Object","create","getType","isValid"],"mappings":";;;;;;;AAuBAA,qCAAO,CAAC,SACA,WACA,4BAEA,SAASC,EAAGC,IAAKC,cAOjBC,KAAO,WACPD,SAASE,MAAMC,KAAMC,mBAEzBH,KAAKI,UAAYC,OAAOC,OAAOP,SAASK,YAQzBG,QAAU,iBACd,wCASXP,KAAKI,UAAUI,QAAU,kBACd,GAGJR"}
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/competency_rule_points",["jquery","core/str","core/templates","tool_lp/competency_rule"],function(a,b,c,d){var e=function(){d.apply(this,arguments)};e.prototype=Object.create(d.prototype);e.prototype._container=null;e.prototype._templateLoaded=!1;e.prototype.getConfig=function(){return JSON.stringify({base:{points:this._getRequiredPoints()},competencies:this._getCompetenciesConfig()})};e.prototype._getCompetenciesConfig=function(){var b=[];this._container.find("[data-competency]").each(function(){var c=a(this),d=c.data("competency"),e=parseInt(c.find("[name=\"points\"]").val(),10),f=c.find("[name=\"required\"]").prop("checked");b.push({id:d,points:e,required:f?1:0})});return b};e.prototype._getRequiredPoints=function(){return parseInt(this._container.find("[name=\"requiredpoints\"]").val()||1,10)};e.prototype.getType=function(){return"core_competency\\competency_rule_points"};e.prototype.injectTemplate=function(b){var d=this,e=this._tree.getChildren(this._competency.id),f,g={base:{points:2},competencies:[]};this._templateLoaded=!1;if(d._competency.ruletype==d.getType()){try{g=JSON.parse(d._competency.ruleconfig)}catch(a){}}f={requiredpoints:g&&g.base?g.base.points:2,competency:d._competency,children:[]};a.each(e,function(b,c){var d={id:c.id,shortname:c.shortname,required:!1,points:0};if(g){a.each(g.competencies,function(a,b){if(b.id==d.id){d.required=b.required?!0:!1;d.points=b.points}})}f.children.push(d)});return c.render("tool_lp/competency_rule_points",f).then(function(a){d._container=b;b.html(a);b.find("input").change(function(){d._triggerChange()});d._templateLoaded=!0;d._triggerChange()})};e.prototype.isValid=function(){if(!this._templateLoaded){return!1}var b=this._getRequiredPoints(),c=0,d=!0;a.each(this._getCompetenciesConfig(),function(a,b){if(0>b.points){d=!1}c+=b.points});d=d&&c>=b;return d};return e});
//# sourceMappingURL=competency_rule_points.min.js.map
/**
* Competency rule points module.
*
* @module tool_lp/competency_rule_all
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/competency_rule_points",["jquery","core/str","core/templates","tool_lp/competency_rule"],(function($,Str,Templates,RuleBase){var Rule=function(){RuleBase.apply(this,arguments)};return(Rule.prototype=Object.create(RuleBase.prototype))._container=null,Rule.prototype._templateLoaded=!1,Rule.prototype.getConfig=function(){return JSON.stringify({base:{points:this._getRequiredPoints()},competencies:this._getCompetenciesConfig()})},Rule.prototype._getCompetenciesConfig=function(){var competencies=[];return this._container.find("[data-competency]").each((function(){var node=$(this),id=node.data("competency"),points=parseInt(node.find('[name="points"]').val(),10),required=node.find('[name="required"]').prop("checked");competencies.push({id:id,points:points,required:required?1:0})})),competencies},Rule.prototype._getRequiredPoints=function(){return parseInt(this._container.find('[name="requiredpoints"]').val()||1,10)},Rule.prototype.getType=function(){return"core_competency\\competency_rule_points"},Rule.prototype.injectTemplate=function(container){var context,self=this,children=this._tree.getChildren(this._competency.id),config={base:{points:2},competencies:[]};if(this._templateLoaded=!1,self._competency.ruletype==self.getType())try{config=JSON.parse(self._competency.ruleconfig)}catch(e){}return context={requiredpoints:config&&config.base?config.base.points:2,competency:self._competency,children:[]},$.each(children,(function(index,child){var competency={id:child.id,shortname:child.shortname,required:!1,points:0};config&&$.each(config.competencies,(function(index,comp){comp.id==competency.id&&(competency.required=!!comp.required,competency.points=comp.points)})),context.children.push(competency)})),Templates.render("tool_lp/competency_rule_points",context).then((function(html){self._container=container,container.html(html),container.find("input").change((function(){self._triggerChange()})),self._templateLoaded=!0,self._triggerChange()}))},Rule.prototype.isValid=function(){if(!this._templateLoaded)return!1;var required=this._getRequiredPoints(),max=0,valid=!0;return $.each(this._getCompetenciesConfig(),(function(index,competency){competency.points<0&&(valid=!1),max+=competency.points})),valid=valid&&max>=required},Rule}));
//# sourceMappingURL=competency_rule_points.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/competencydialogue",["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/dialogue"],function(a,b,c,d,e,f){var g,h=function(){};h.prototype.triggerCompetencyViewedEvent=function(a){c.call([{methodname:"core_competency_competency_viewed",args:{id:a}}])};h.prototype.showDialogue=function(a,c){var e=this.getCompetencyDataPromise(a,c),g=this;e.done(function(c){d.render("tool_lp/competency_summary",c).done(function(b){g.triggerCompetencyViewedEvent(a);new f(c.competency.shortname,b)}).fail(b.exception)}).fail(b.exception)};h.prototype.showDialogueFromData=function(a){var c=this;d.render("tool_lp/competency_summary",a).done(function(b){c.triggerCompetencyViewedEvent(a.id);new f(a.shortname,b,c.enhanceDialogue)}).fail(b.exception)};h.prototype.clickEventHandler=function(b){var c=b.data.compdialogue,d=a(b.currentTarget),e=d.data("id"),f=!d.data("excluderelated"),g=d.data("includecourses");c.showDialogue(e,{includerelated:f,includecourses:g});b.preventDefault()};h.prototype.getCompetencyDataPromise=function(a,d){var e=c.call([{methodname:"tool_lp_data_for_competency_summary",args:{competencyid:a,includerelated:d.includerelated||!1,includecourses:d.includecourses||!1}}]);return e[0].then(function(a){return a}).fail(b.exception)};return{init:function init(){if("undefined"!=typeof g){return}g=new h;a("body").delegate("[data-action=\"competency-dialogue\"]","click",{compdialogue:g},g.clickEventHandler.bind(g))}}});
//# sourceMappingURL=competencydialogue.min.js.map
/**
* Display Competency in dialogue box.
*
* @module tool_lp/Competencydialogue
* @copyright 2015 Issam Taboubi <issam.taboubi@umontreal.ca>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/competencydialogue",["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/dialogue"],(function($,notification,ajax,templates,str,Dialogue){var instance,Competencydialogue=function(){};return Competencydialogue.prototype.triggerCompetencyViewedEvent=function(competencyId){ajax.call([{methodname:"core_competency_competency_viewed",args:{id:competencyId}}])},Competencydialogue.prototype.showDialogue=function(competencyid,options){var datapromise=this.getCompetencyDataPromise(competencyid,options),localthis=this;datapromise.done((function(data){templates.render("tool_lp/competency_summary",data).done((function(html){localthis.triggerCompetencyViewedEvent(competencyid),new Dialogue(data.competency.shortname,html)})).fail(notification.exception)})).fail(notification.exception)},Competencydialogue.prototype.showDialogueFromData=function(dataSource){var localthis=this;templates.render("tool_lp/competency_summary",dataSource).done((function(html){localthis.triggerCompetencyViewedEvent(dataSource.id),new Dialogue(dataSource.shortname,html,localthis.enhanceDialogue)})).fail(notification.exception)},Competencydialogue.prototype.clickEventHandler=function(e){var compdialogue=e.data.compdialogue,currentTarget=$(e.currentTarget),competencyid=currentTarget.data("id"),includerelated=!currentTarget.data("excluderelated"),includecourses=currentTarget.data("includecourses");compdialogue.showDialogue(competencyid,{includerelated:includerelated,includecourses:includecourses}),e.preventDefault()},Competencydialogue.prototype.getCompetencyDataPromise=function(competencyid,options){return ajax.call([{methodname:"tool_lp_data_for_competency_summary",args:{competencyid:competencyid,includerelated:options.includerelated||!1,includecourses:options.includecourses||!1}}])[0].then((function(context){return context})).fail(notification.exception)},{init:function(){void 0===instance&&(instance=new Competencydialogue,$("body").delegate('[data-action="competency-dialogue"]',"click",{compdialogue:instance},instance.clickEventHandler.bind(instance)))}}}));
//# sourceMappingURL=competencydialogue.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+15 -2
View File
@@ -1,2 +1,15 @@
define ("tool_lp/competencypicker_user_plans",["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/tree","tool_lp/competencypicker"],function(a,b,c,d,e,f,g){var h=function(a,b,c){g.prototype.constructor.apply(this,[1,!1,"self",c]);this._userId=a;this._plans=[];if(b){this._planId=b;this._singlePlan=!0}};h.prototype=Object.create(g.prototype);h.prototype._plans=null;h.prototype._planId=null;h.prototype._singlePlan=!1;h.prototype._userId=null;h.prototype._afterRender=function(){var c=this;g.prototype._afterRender.apply(c,arguments);if(!c._singlePlan){c._find("[data-action=\"chooseplan\"]").change(function(d){c._planId=a(d.target).val();c._loadCompetencies().then(c._refresh.bind(c)).catch(b.exception)})}};h.prototype._fetchCompetencies=function(a,d){var e=this;return c.call([{methodname:"core_competency_list_plan_competencies",args:{id:a}}])[0].done(function(a){var b,c,f=[];for(b=0;b<a.length;b++){c=a[b].competency;if(0>c.shortname.toLowerCase().indexOf(d.toLowerCase())){continue}c.children=[];c.haschildren=0;f.push(c)}e._competencies=f}).fail(b.exception)};h.prototype._getPlan=function(b){var c;a.each(this._plans,function(a,d){if(d.id==b){c=d}});return c};h.prototype._loadCompetencies=function(){return this._fetchCompetencies(this._planId,this._searchText)};h.prototype._loadPlans=function(){var d,e=this;if(0<e._plans.length){return a.when()}if(e._singlePlan){d=c.call([{methodname:"core_competency_read_plan",args:{id:this._planId}}])[0].then(function(a){return[a]})}else{d=c.call([{methodname:"core_competency_list_user_plans",args:{userid:e._userId}}])[0]}return d.done(function(a){e._plans=a}).fail(b.exception)};h.prototype._preRender=function(){var b=this;return b._loadPlans().then(function(){if(!b._planId&&0<b._plans.length){b._planId=b._plans[0].id}if(!b._planId){b._plans=[];return a.when()}return b._loadCompetencies()})};h.prototype._render=function(){var b=this;return b._preRender().then(function(){if(!b._singlePlan){a.each(b._plans,function(a,c){if(c.id==b._planId){c.selected=!0}else{c.selected=!1}})}var c={competencies:b._competencies,plan:b._getPlan(b._planId),plans:b._plans,search:b._searchText,singlePlan:b._singlePlan};return d.render("tool_lp/competency_picker_user_plans",c)})};return h});
//# sourceMappingURL=competencypicker_user_plans.min.js.map
/**
* Competency picker from user plans.
*
* To handle 'save' events use: picker.on('save').
*
* This will receive a object with either a single 'competencyId', or an array in 'competencyIds'
* depending on the value of multiSelect.
*
* @module tool_lp/competencypicker_user_plans
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/competencypicker_user_plans",["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/tree","tool_lp/competencypicker"],(function($,Notification,Ajax,Templates,Str,Tree,PickerBase){var Picker=function(userId,singlePlan,multiSelect){PickerBase.prototype.constructor.apply(this,[1,!1,"self",multiSelect]),this._userId=userId,this._plans=[],singlePlan&&(this._planId=singlePlan,this._singlePlan=!0)};return(Picker.prototype=Object.create(PickerBase.prototype))._plans=null,Picker.prototype._planId=null,Picker.prototype._singlePlan=!1,Picker.prototype._userId=null,Picker.prototype._afterRender=function(){var self=this;PickerBase.prototype._afterRender.apply(self,arguments),self._singlePlan||self._find('[data-action="chooseplan"]').change((function(e){self._planId=$(e.target).val(),self._loadCompetencies().then(self._refresh.bind(self)).catch(Notification.exception)}))},Picker.prototype._fetchCompetencies=function(planId,searchText){var self=this;return Ajax.call([{methodname:"core_competency_list_plan_competencies",args:{id:planId}}])[0].done((function(competencies){var i,comp,tree=[];for(i=0;i<competencies.length;i++)(comp=competencies[i].competency).shortname.toLowerCase().indexOf(searchText.toLowerCase())<0||(comp.children=[],comp.haschildren=0,tree.push(comp));self._competencies=tree})).fail(Notification.exception)},Picker.prototype._getPlan=function(id){var plan;return $.each(this._plans,(function(i,f){f.id!=id||(plan=f)})),plan},Picker.prototype._loadCompetencies=function(){return this._fetchCompetencies(this._planId,this._searchText)},Picker.prototype._loadPlans=function(){var self=this;return self._plans.length>0?$.when():(self._singlePlan?Ajax.call([{methodname:"core_competency_read_plan",args:{id:this._planId}}])[0].then((function(plan){return[plan]})):Ajax.call([{methodname:"core_competency_list_user_plans",args:{userid:self._userId}}])[0]).done((function(plans){self._plans=plans})).fail(Notification.exception)},Picker.prototype._preRender=function(){var self=this;return self._loadPlans().then((function(){return!self._planId&&self._plans.length>0&&(self._planId=self._plans[0].id),self._planId?self._loadCompetencies():(self._plans=[],$.when())}))},Picker.prototype._render=function(){var self=this;return self._preRender().then((function(){self._singlePlan||$.each(self._plans,(function(i,plan){plan.id==self._planId?plan.selected=!0:plan.selected=!1}));var context={competencies:self._competencies,plan:self._getPlan(self._planId),plans:self._plans,search:self._searchText,singlePlan:self._singlePlan};return Templates.render("tool_lp/competency_picker_user_plans",context)}))},Picker}));
//# sourceMappingURL=competencypicker_user_plans.min.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/competencytree",["core/ajax","core/notification","core/templates","tool_lp/tree","tool_lp/competency_outcomes","jquery"],function(a,b,c,d,e,f){var g={},h=0,j="",k="",l="",m=!1,n=function(a,b){var c=0,d=!1;a.haschildren=!1;a.children=[];for(c=0;c<b.length;c++){d=b[c];if(d.parentid==a.id){a.haschildren=!0;a.children.push(d);n(d,b)}}},o=function(b){var e=f.Deferred();c.render("tool_lp/loading",{}).done(function(i,o){c.replaceNodeContents(f(k),i,o);var p=a.call([{methodname:"core_competency_search_competencies",args:{searchtext:b,competencyframeworkid:h}}]);p[0].done(function(a){g={};var b=0;for(b=0;b<a.length;b++){g[a[b].id]=a[b]}var h=[],o=!1;for(b=0;b<a.length;b++){o=a[b];if(0===parseInt(o.parentid,10)){h.push(o);n(o,a)}}var p={shortname:j,canmanage:m,competencies:h};c.render("tool_lp/competencies_tree_root",p).done(function(a,b){c.replaceNodeContents(f(k),f(a).html(),b);var h=new d(k,!1);if(l){var i=f(k).find("[data-id="+l+"]");if(i.length){h.selectItem(i);h.updateFocus(i)}}e.resolve(g)}).fail(e.reject)}).fail(e.reject)});return e.promise()},p=function(a,b){var c=b.selected;l=c.attr("data-id")};return{init:function init(a,c,d,e,f,g){h=a;j=c;m=f;k=e;o(d).fail(b.exception);if(0<g){l=g}this.on("selectionchanged",p)},on:function on(a,b){f(k).on(a,b)},getChildren:function getChildren(a){var b=[];f.each(g,function(c,d){if(d.parentid==a){b.push(d)}});return b},getCompetencyFrameworkId:function getCompetencyFrameworkId(){return h},getCompetency:function getCompetency(a){return g[a]},getCompetencyLevel:function getCompetencyLevel(a){var b=this.getCompetency(a),c=b.path.replace(/^\/|\/$/g,"").split("/").length;return c},hasChildren:function hasChildren(a){return 0<this.getChildren(a).length},hasRule:function hasRule(a){var b=this.getCompetency(a);if(b){return b.ruleoutcome!=e.OUTCOME_NONE&&b.ruletype}return!1},reloadCompetencies:function reloadCompetencies(){return o("").fail(b.exception)},listCompetencies:function listCompetencies(){return g}}});
//# sourceMappingURL=competencytree.min.js.map
/**
* Handle selection changes on the competency tree.
*
* @module tool_lp/competencyselect
* @copyright 2015 Damyon Wiese <damyon@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/competencytree",["core/ajax","core/notification","core/templates","tool_lp/tree","tool_lp/competency_outcomes","jquery"],(function(ajax,notification,templates,Ariatree,CompOutcomes,$){var competencies={},competencyFrameworkId=0,competencyFrameworkShortName="",treeSelector="",currentNodeId="",competencyFramworkCanManage=!1,addChildren=function addChildren(parent,all){var i=0,current=!1;for(parent.haschildren=!1,parent.children=[],i=0;i<all.length;i++)(current=all[i]).parentid==parent.id&&(parent.haschildren=!0,parent.children.push(current),addChildren(current,all))},loadCompetencies=function(searchtext){var deferred=$.Deferred();return templates.render("tool_lp/loading",{}).done((function(loadinghtml,loadingjs){templates.replaceNodeContents($(treeSelector),loadinghtml,loadingjs),ajax.call([{methodname:"core_competency_search_competencies",args:{searchtext:searchtext,competencyframeworkid:competencyFrameworkId}}])[0].done((function(result){competencies={};var i=0;for(i=0;i<result.length;i++)competencies[result[i].id]=result[i];var children=[],competency=!1;for(i=0;i<result.length;i++)competency=result[i],0===parseInt(competency.parentid,10)&&(children.push(competency),addChildren(competency,result));var context={shortname:competencyFrameworkShortName,canmanage:competencyFramworkCanManage,competencies:children};templates.render("tool_lp/competencies_tree_root",context).done((function(html,js){templates.replaceNodeContents($(treeSelector),$(html).html(),js);var tree=new Ariatree(treeSelector,!1);if(currentNodeId){var node=$(treeSelector).find("[data-id="+currentNodeId+"]");node.length&&(tree.selectItem(node),tree.updateFocus(node))}deferred.resolve(competencies)})).fail(deferred.reject)})).fail(deferred.reject)})),deferred.promise()},rememberCurrent=function(evt,params){var node=params.selected;currentNodeId=node.attr("data-id")};return{init:function(id,shortname,search,selector,canmanage,competencyid){competencyFrameworkId=id,competencyFrameworkShortName=shortname,competencyFramworkCanManage=canmanage,treeSelector=selector,loadCompetencies(search).fail(notification.exception),competencyid>0&&(currentNodeId=competencyid),this.on("selectionchanged",rememberCurrent)},on:function(eventname,handler){$(treeSelector).on(eventname,handler)},getChildren:function(id){var children=[];return $.each(competencies,(function(index,competency){competency.parentid==id&&children.push(competency)})),children},getCompetencyFrameworkId:function(){return competencyFrameworkId},getCompetency:function(id){return competencies[id]},getCompetencyLevel:function(id){return this.getCompetency(id).path.replace(/^\/|\/$/g,"").split("/").length},hasChildren:function(id){return this.getChildren(id).length>0},hasRule:function(id){var comp=this.getCompetency(id);return!!comp&&(comp.ruleoutcome!=CompOutcomes.OUTCOME_NONE&&comp.ruletype)},reloadCompetencies:function(){return loadCompetencies("").fail(notification.exception)},listCompetencies:function(){return competencies}}}));
//# sourceMappingURL=competencytree.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/course_competency_settings",["jquery","core/notification","tool_lp/dialogue","core/str","core/ajax","core/templates","core/pending"],function(a,b,c,d,f,g,h){var i=function(b){a(b).on("click",this.configureSettings.bind(this))};i.prototype._dialogue=null;i.prototype.configureSettings=function(f){var e=new h,i=a(f.target).closest("a").data("courseid"),j=a(f.target).closest("a").data("pushratingstouserplans");f.preventDefault();a.when(d.get_string("configurecoursecompetencysettings","tool_lp"),g.render("tool_lp/course_competency_settings",{courseid:i,settings:{pushratingstouserplans:j}})).then(function(a,b){this._dialogue=new c(a,b[0],this.addListeners.bind(this));return this._dialogue}.bind(this)).then(e.resolve).catch(b.exception)};i.prototype.addListeners=function(){var a=this._find("[data-action=\"save\"]");a.on("click",this.saveSettings.bind(this));var b=this._find("[data-action=\"cancel\"]");b.on("click",this.cancelChanges.bind(this))};i.prototype.cancelChanges=function(a){a.preventDefault();this._dialogue.close()};i.prototype._find=function(b){return a("[data-region=\"coursecompetencysettings\"]").find(b)};i.prototype.saveSettings=function(a){var c=new h;a.preventDefault();var d=this._find("input[name=\"pushratingstouserplans\"]:checked").val(),e=this._find("input[name=\"courseid\"]").val();f.call([{methodname:"core_competency_update_course_competency_settings",args:{courseid:e,settings:{pushratingstouserplans:d}}}])[0].then(function(){return this.refreshCourseCompetenciesPage()}.bind(this)).then(c.resolve).catch(b.exception)};i.prototype.refreshCourseCompetenciesPage=function(){var c=this._find("input[name=\"courseid\"]").val(),d=new h;f.call([{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:c,moduleid:0}}])[0].then(function(a){return g.render("tool_lp/course_competencies_page",a)}).then(function(b,c){g.replaceNode(a("[data-region=\"coursecompetenciespage\"]"),b,c);this._dialogue.close()}.bind(this)).then(d.resolve).catch(b.exception)};return i});
//# sourceMappingURL=course_competency_settings.min.js.map
/**
* Change the course competency settings in a popup.
*
* @module tool_lp/configurecoursecompetencysettings
* @copyright 2015 Damyon Wiese <damyon@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/course_competency_settings",["jquery","core/notification","tool_lp/dialogue","core/str","core/ajax","core/templates","core/pending"],(function($,notification,Dialogue,str,ajax,templates,Pending){var settingsMod=function(selector){$(selector).on("click",this.configureSettings.bind(this))};return settingsMod.prototype._dialogue=null,settingsMod.prototype.configureSettings=function(e){var pendingPromise=new Pending,context={courseid:$(e.target).closest("a").data("courseid"),settings:{pushratingstouserplans:$(e.target).closest("a").data("pushratingstouserplans")}};e.preventDefault(),$.when(str.get_string("configurecoursecompetencysettings","tool_lp"),templates.render("tool_lp/course_competency_settings",context)).then(function(title,templateResult){return this._dialogue=new Dialogue(title,templateResult[0],this.addListeners.bind(this)),this._dialogue}.bind(this)).then(pendingPromise.resolve).catch(notification.exception)},settingsMod.prototype.addListeners=function(){this._find('[data-action="save"]').on("click",this.saveSettings.bind(this)),this._find('[data-action="cancel"]').on("click",this.cancelChanges.bind(this))},settingsMod.prototype.cancelChanges=function(e){e.preventDefault(),this._dialogue.close()},settingsMod.prototype._find=function(selector){return $('[data-region="coursecompetencysettings"]').find(selector)},settingsMod.prototype.saveSettings=function(e){var pendingPromise=new Pending;e.preventDefault();var newValue=this._find('input[name="pushratingstouserplans"]:checked').val(),courseId=this._find('input[name="courseid"]').val(),settings={pushratingstouserplans:newValue};ajax.call([{methodname:"core_competency_update_course_competency_settings",args:{courseid:courseId,settings:settings}}])[0].then(function(){return this.refreshCourseCompetenciesPage()}.bind(this)).then(pendingPromise.resolve).catch(notification.exception)},settingsMod.prototype.refreshCourseCompetenciesPage=function(){var courseId=this._find('input[name="courseid"]').val(),pendingPromise=new Pending;ajax.call([{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:courseId,moduleid:0}}])[0].then((function(context){return templates.render("tool_lp/course_competencies_page",context)})).then(function(html,js){templates.replaceNode($('[data-region="coursecompetenciespage"]'),html,js),this._dialogue.close()}.bind(this)).then(pendingPromise.resolve).catch(notification.exception)},settingsMod}));
//# sourceMappingURL=course_competency_settings.min.js.map
File diff suppressed because one or more lines are too long
+11 -2
View File
@@ -1,2 +1,11 @@
define ("tool_lp/dialogue",["core/yui"],function(a){var b=function(b,c,d,e,f){M.util.js_pending("tool_lp/dialogue:dialogue");this.yuiDialogue=null;var g=this;if("undefined"==typeof f){f=!1}a.use("moodle-core-notification","timers",function(){var h="480px";if(f){h="800px"}g.yuiDialogue=new M.core.dialogue({headerContent:b,bodyContent:c,draggable:!0,visible:!1,center:!0,modal:!0,width:h});g.yuiDialogue.before("visibleChange",function(){M.util.js_pending("tool_lp/dialogue:before:visibleChange")});g.yuiDialogue.after("visibleChange",function(b){if(b.newVal){if("undefined"!=typeof d){a.soon(function(){d(g);g.yuiDialogue.centerDialogue();M.util.js_complete("tool_lp/dialogue:before:visibleChange")})}else{M.util.js_complete("tool_lp/dialogue:before:visibleChange")}}else{if("undefined"!=typeof e){a.soon(function(){e(g);M.util.js_complete("tool_lp/dialogue:before:visibleChange")})}else{M.util.js_complete("tool_lp/dialogue:before:visibleChange")}}});g.yuiDialogue.show();M.util.js_complete("tool_lp/dialogue:dialogue")})};b.prototype.close=function(){this.yuiDialogue.hide();this.yuiDialogue.destroy()};b.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()};return b});
//# sourceMappingURL=dialogue.min.js.map
/**
* Wrapper for the YUI M.core.notification class. Allows us to
* use the YUI version in AMD code until it is replaced.
*
* @module tool_lp/dialogue
* @copyright 2015 Damyon Wiese <damyon@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/dialogue",["core/yui"],(function(Y){var dialogue=function(title,content,afterShow,afterHide,wide){M.util.js_pending("tool_lp/dialogue:dialogue"),this.yuiDialogue=null;var parent=this;void 0===wide&&(wide=!1),Y.use("moodle-core-notification","timers",(function(){var width="480px";wide&&(width="800px"),parent.yuiDialogue=new M.core.dialogue({headerContent:title,bodyContent:content,draggable:!0,visible:!1,center:!0,modal:!0,width:width}),parent.yuiDialogue.before("visibleChange",(function(){M.util.js_pending("tool_lp/dialogue:before:visibleChange")})),parent.yuiDialogue.after("visibleChange",(function(e){e.newVal?void 0!==afterShow?Y.soon((function(){afterShow(parent),parent.yuiDialogue.centerDialogue(),M.util.js_complete("tool_lp/dialogue:before:visibleChange")})):M.util.js_complete("tool_lp/dialogue:before:visibleChange"):void 0!==afterHide?Y.soon((function(){afterHide(parent),M.util.js_complete("tool_lp/dialogue:before:visibleChange")})):M.util.js_complete("tool_lp/dialogue:before:visibleChange")})),parent.yuiDialogue.show(),M.util.js_complete("tool_lp/dialogue:dialogue")}))};return dialogue.prototype.close=function(){this.yuiDialogue.hide(),this.yuiDialogue.destroy()},dialogue.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()},dialogue}));
//# sourceMappingURL=dialogue.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/dragdrop-reorder",["core/str","core/yui"],function(a,b){var c=null,d=function(a){var b=a.drag.get("node"),c=a.drop.get("node");this.callback(b.getDOMNode(),c.getDOMNode())};return{dragdrop:function dragdrop(e,f,g,h,i,j,k,l){a.get_strings([{key:"emptydragdropregion",component:"moodle"},{key:"movecontent",component:"moodle"},{key:"tocontent",component:"moodle"}]).done(function(){b.use("moodle-tool_lp-dragdrop-reorder",function(){if(c){c.destroy()}c=M.tool_lp.dragdrop_reorder({group:e,dragHandleText:f,sameNodeText:g,parentNodeText:h,sameNodeClass:i,parentNodeClass:j,dragHandleInsertClass:k,callback:b.bind(d,{callback:l})})})})}}});
//# sourceMappingURL=dragdrop-reorder.min.js.map
/**
* Drag and drop reorder via HTML5.
*
* @module tool_lp/dragdrop-reorder
* @copyright 2015 Damyon Wiese <damyon@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/dragdrop-reorder",["core/str","core/yui"],(function(str,Y){var dragDropInstance=null,proxyCallback=function(e){var dragNode=e.drag.get("node"),dropNode=e.drop.get("node");this.callback(dragNode.getDOMNode(),dropNode.getDOMNode())};return{dragdrop:function(group,dragHandleText,sameNodeText,parentNodeText,sameNodeClass,parentNodeClass,dragHandleInsertClass,callback){str.get_strings([{key:"emptydragdropregion",component:"moodle"},{key:"movecontent",component:"moodle"},{key:"tocontent",component:"moodle"}]).done((function(){Y.use("moodle-tool_lp-dragdrop-reorder",(function(){var context={callback:callback};dragDropInstance&&dragDropInstance.destroy(),dragDropInstance=M.tool_lp.dragdrop_reorder({group:group,dragHandleText:dragHandleText,sameNodeText:sameNodeText,parentNodeText:parentNodeText,sameNodeClass:sameNodeClass,parentNodeClass:parentNodeClass,dragHandleInsertClass:dragHandleInsertClass,callback:Y.bind(proxyCallback,context)})}))}))}}}));
//# sourceMappingURL=dragdrop-reorder.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/event_base",["jquery"],function(a){var b=function(){this._eventNode=a("<div></div>")};b.prototype._eventNode=null;b.prototype.on=function(a,b){this._eventNode.on(a,b)};b.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])};return b});
//# sourceMappingURL=event_base.min.js.map
/**
* Event base javascript module.
*
* @module tool_lp/event_base
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/event_base",["jquery"],(function($){var Base=function(){this._eventNode=$("<div></div>")};return Base.prototype._eventNode=null,Base.prototype.on=function(type,handler){this._eventNode.on(type,handler)},Base.prototype._trigger=function(type,data){this._eventNode.trigger(type,[data])},Base}));
//# sourceMappingURL=event_base.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/event_base.js"],"names":["define","$","Base","_eventNode","prototype","on","type","handler","_trigger","data","trigger"],"mappings":"AAsBAA,OAAM,sBAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAK3B,GAAIC,CAAAA,CAAI,CAAG,UAAW,CAClB,KAAKC,UAAL,CAAkBF,CAAC,CAAC,aAAD,CACtB,CAFD,CAKAC,CAAI,CAACE,SAAL,CAAeD,UAAf,CAA4B,IAA5B,CASAD,CAAI,CAACE,SAAL,CAAeC,EAAf,CAAoB,SAASC,CAAT,CAAeC,CAAf,CAAwB,CACxC,KAAKJ,UAAL,CAAgBE,EAAhB,CAAmBC,CAAnB,CAAyBC,CAAzB,CACH,CAFD,CAWAL,CAAI,CAACE,SAAL,CAAeI,QAAf,CAA0B,SAASF,CAAT,CAAeG,CAAf,CAAqB,CAC3C,KAAKN,UAAL,CAAgBO,OAAhB,CAAwBJ,CAAxB,CAA8B,CAACG,CAAD,CAA9B,CACH,CAFD,CAIA,MAA+CP,CAAAA,CAClD,CAnCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Event base javascript module.\n *\n * @module tool_lp/event_base\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'], function($) {\n\n /**\n * Base class.\n */\n var Base = function() {\n this._eventNode = $('<div></div>');\n };\n\n /** @property {Node} The node we attach the events to. */\n Base.prototype._eventNode = null;\n\n /**\n * Register an event listener.\n *\n * @param {String} type The event type.\n * @param {Function} handler The event listener.\n * @method on\n */\n Base.prototype.on = function(type, handler) {\n this._eventNode.on(type, handler);\n };\n\n /**\n * Trigger an event.\n *\n * @param {String} type The type of event.\n * @param {Object} data The data to pass to the listeners.\n * @method _trigger\n */\n Base.prototype._trigger = function(type, data) {\n this._eventNode.trigger(type, [data]);\n };\n\n return /** @alias module:tool_lp/event_base */ Base;\n});\n"],"file":"event_base.min.js"}
{"version":3,"file":"event_base.min.js","sources":["../src/event_base.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Event base javascript module.\n *\n * @module tool_lp/event_base\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'], function($) {\n\n /**\n * Base class.\n */\n var Base = function() {\n this._eventNode = $('<div></div>');\n };\n\n /** @property {Node} The node we attach the events to. */\n Base.prototype._eventNode = null;\n\n /**\n * Register an event listener.\n *\n * @param {String} type The event type.\n * @param {Function} handler The event listener.\n * @method on\n */\n Base.prototype.on = function(type, handler) {\n this._eventNode.on(type, handler);\n };\n\n /**\n * Trigger an event.\n *\n * @param {String} type The type of event.\n * @param {Object} data The data to pass to the listeners.\n * @method _trigger\n */\n Base.prototype._trigger = function(type, data) {\n this._eventNode.trigger(type, [data]);\n };\n\n return /** @alias module:tool_lp/event_base */ Base;\n});\n"],"names":["define","$","Base","_eventNode","prototype","on","type","handler","_trigger","data","trigger"],"mappings":";;;;;;;AAsBAA,4BAAO,CAAC,WAAW,SAASC,OAKpBC,KAAO,gBACFC,WAAaF,EAAE,uBAIxBC,KAAKE,UAAUD,WAAa,KAS5BD,KAAKE,UAAUC,GAAK,SAASC,KAAMC,cAC1BJ,WAAWE,GAAGC,KAAMC,UAU7BL,KAAKE,UAAUI,SAAW,SAASF,KAAMG,WAChCN,WAAWO,QAAQJ,KAAM,CAACG,QAGYP"}
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/evidence_delete",["jquery","core/notification","core/ajax","core/str","core/log"],function(a,b,c,d,e){var f={};return{register:function register(g,h){if("undefined"!=typeof f[g]){return}f[g]=a("body").delegate(g,"click",function(f){var g=a(f.currentTarget).parents(h);if(!g.length||1<g.length){e.error("None or too many evidence container were found.");return}var i=g.data("id");if(!i){e.error("Evidence ID was not found.");return}f.preventDefault();f.stopPropagation();d.get_strings([{key:"confirm",component:"moodle"},{key:"areyousure",component:"moodle"},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){b.confirm(a[0],a[1],a[2],a[3],function(){var a=c.call([{methodname:"core_competency_delete_evidence",args:{id:i}}]);a[0].then(function(){g.remove()}).fail(b.exception)})}).fail(b.exception)})}}});
//# sourceMappingURL=evidence_delete.min.js.map
/**
* Evidence delete.
*
* @module tool_lp/evidence_delete
* @copyright 2016 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/evidence_delete",["jquery","core/notification","core/ajax","core/str","core/log"],(function($,Notification,Ajax,Str,Log){var selectors={};return{register:function(triggerSelector,containerSelector){void 0===selectors[triggerSelector]&&(selectors[triggerSelector]=$("body").delegate(triggerSelector,"click",(function(e){var parent=$(e.currentTarget).parents(containerSelector);if(!parent.length||parent.length>1)Log.error("None or too many evidence container were found.");else{var evidenceId=parent.data("id");evidenceId?(e.preventDefault(),e.stopPropagation(),Str.get_strings([{key:"confirm",component:"moodle"},{key:"areyousure",component:"moodle"},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done((function(strings){Notification.confirm(strings[0],strings[1],strings[2],strings[3],(function(){Ajax.call([{methodname:"core_competency_delete_evidence",args:{id:evidenceId}}])[0].then((function(){parent.remove()})).fail(Notification.exception)}))})).fail(Notification.exception)):Log.error("Evidence ID was not found.")}})))}}}));
//# sourceMappingURL=evidence_delete.min.js.map
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -1,2 +1,10 @@
define ("tool_lp/form-cohort-selector",["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.id,label:b._label})});return d},transport:function transport(d,e,f,g){var h,i=parseInt(a(d).data("contextid"),10),j=a(d).data("includes");h=b.call([{methodname:"tool_lp_search_cohorts",args:{query:e,context:{contextid:i},includes:j}}]);h[0].then(function(b){var d=[],e=0;a.each(b.cohorts,function(a,b){d.push(c.render("tool_lp/form-cohort-selector-suggestion",b))});return a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b.cohorts,function(a,b){b._label=c[e];e++});f(b.cohorts)})}).catch(g)}}});
//# sourceMappingURL=form-cohort-selector.min.js.map
/**
* Cohort selector module.
*
* @module tool_lp/form-cohort-selector
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("tool_lp/form-cohort-selector",["jquery","core/ajax","core/templates"],(function($,Ajax,Templates){return{processResults:function(selector,results){var cohorts=[];return $.each(results,(function(index,cohort){cohorts.push({value:cohort.id,label:cohort._label})})),cohorts},transport:function(selector,query,success,failure){var contextid=parseInt($(selector).data("contextid"),10),includes=$(selector).data("includes");Ajax.call([{methodname:"tool_lp_search_cohorts",args:{query:query,context:{contextid:contextid},includes:includes}}])[0].then((function(results){var promises=[],i=0;return $.each(results.cohorts,(function(index,cohort){promises.push(Templates.render("tool_lp/form-cohort-selector-suggestion",cohort))})),$.when.apply($.when,promises).then((function(){var args=arguments;$.each(results.cohorts,(function(index,cohort){cohort._label=args[i],i++})),success(results.cohorts)}))})).catch(failure)}}}));
//# sourceMappingURL=form-cohort-selector.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/form-cohort-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","cohorts","each","index","cohort","push","value","id","label","_label","transport","query","success","failure","promise","contextid","parseInt","data","includes","call","methodname","args","context","then","promises","i","render","when","apply","arguments","catch"],"mappings":"AAuBAA,OAAM,gCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAyD,CAErDC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAO,CAAG,EAAd,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAwB,CACpCH,CAAO,CAACI,IAAR,CAAa,CACTC,KAAK,CAAEF,CAAM,CAACG,EADL,CAETC,KAAK,CAAEJ,CAAM,CAACK,MAFL,CAAb,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAXoD,CAarDS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,CACnD,GAAIC,CAAAA,CAAJ,CACIC,CAAS,CAAGC,QAAQ,CAACrB,CAAC,CAACI,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,WAAjB,CAAD,CAAgC,EAAhC,CADxB,CAEIC,CAAQ,CAAGvB,CAAC,CAACI,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,UAAjB,CAFf,CAIAH,CAAO,CAAGlB,CAAI,CAACuB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,wBADK,CAEjBC,IAAI,CAAE,CACFV,KAAK,CAAEA,CADL,CAEFW,OAAO,CAAE,CAACP,SAAS,CAAEA,CAAZ,CAFP,CAGFG,QAAQ,CAAEA,CAHR,CAFW,CAAD,CAAV,CAAV,CAQAJ,CAAO,CAAC,CAAD,CAAP,CAAWS,IAAX,CAAgB,SAASvB,CAAT,CAAkB,CAC9B,GAAIwB,CAAAA,CAAQ,CAAG,EAAf,CACIC,CAAC,CAAG,CADR,CAIA9B,CAAC,CAACO,IAAF,CAAOF,CAAO,CAACC,OAAf,CAAwB,SAASE,CAAT,CAAgBC,CAAhB,CAAwB,CAC5CoB,CAAQ,CAACnB,IAAT,CAAcR,CAAS,CAAC6B,MAAV,CAAiB,yCAAjB,CAA4DtB,CAA5D,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAACgC,IAAF,CAAOC,KAAP,CAAajC,CAAC,CAACgC,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAIF,CAAAA,CAAI,CAAGQ,SAAX,CACAlC,CAAC,CAACO,IAAF,CAAOF,CAAO,CAACC,OAAf,CAAwB,SAASE,CAAT,CAAgBC,CAAhB,CAAwB,CAC5CA,CAAM,CAACK,MAAP,CAAgBY,CAAI,CAACI,CAAD,CAApB,CACAA,CAAC,EACJ,CAHD,EAIAb,CAAO,CAACZ,CAAO,CAACC,OAAT,CAEV,CARM,CAUV,CApBD,EAoBG6B,KApBH,CAoBSjB,CApBT,CAqBH,CA/CoD,CAmD5D,CArDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Cohort selector module.\n *\n * @module tool_lp/form-cohort-selector\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_lp/form-cohort-selector */ {\n\n processResults: function(selector, results) {\n var cohorts = [];\n $.each(results, function(index, cohort) {\n cohorts.push({\n value: cohort.id,\n label: cohort._label\n });\n });\n return cohorts;\n },\n\n transport: function(selector, query, success, failure) {\n var promise,\n contextid = parseInt($(selector).data('contextid'), 10),\n includes = $(selector).data('includes');\n\n promise = Ajax.call([{\n methodname: 'tool_lp_search_cohorts',\n args: {\n query: query,\n context: {contextid: contextid},\n includes: includes\n }\n }]);\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results.cohorts, function(index, cohort) {\n promises.push(Templates.render('tool_lp/form-cohort-selector-suggestion', cohort));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results.cohorts, function(index, cohort) {\n cohort._label = args[i];\n i++;\n });\n success(results.cohorts);\n return;\n });\n\n }).catch(failure);\n }\n\n };\n\n});\n"],"file":"form-cohort-selector.min.js"}
{"version":3,"file":"form-cohort-selector.min.js","sources":["../src/form-cohort-selector.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Cohort selector module.\n *\n * @module tool_lp/form-cohort-selector\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_lp/form-cohort-selector */ {\n\n processResults: function(selector, results) {\n var cohorts = [];\n $.each(results, function(index, cohort) {\n cohorts.push({\n value: cohort.id,\n label: cohort._label\n });\n });\n return cohorts;\n },\n\n transport: function(selector, query, success, failure) {\n var promise,\n contextid = parseInt($(selector).data('contextid'), 10),\n includes = $(selector).data('includes');\n\n promise = Ajax.call([{\n methodname: 'tool_lp_search_cohorts',\n args: {\n query: query,\n context: {contextid: contextid},\n includes: includes\n }\n }]);\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results.cohorts, function(index, cohort) {\n promises.push(Templates.render('tool_lp/form-cohort-selector-suggestion', cohort));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results.cohorts, function(index, cohort) {\n cohort._label = args[i];\n i++;\n });\n success(results.cohorts);\n return;\n });\n\n }).catch(failure);\n }\n\n };\n\n});\n"],"names":["define","$","Ajax","Templates","processResults","selector","results","cohorts","each","index","cohort","push","value","id","label","_label","transport","query","success","failure","contextid","parseInt","data","includes","call","methodname","args","context","then","promises","i","render","when","apply","arguments","catch"],"mappings":";;;;;;;AAuBAA,sCAAO,CAAC,SAAU,YAAa,mBAAmB,SAASC,EAAGC,KAAMC,iBAEP,CAErDC,eAAgB,SAASC,SAAUC,aAC3BC,QAAU,UACdN,EAAEO,KAAKF,SAAS,SAASG,MAAOC,QAC5BH,QAAQI,KAAK,CACTC,MAAOF,OAAOG,GACdC,MAAOJ,OAAOK,YAGfR,SAGXS,UAAW,SAASX,SAAUY,MAAOC,QAASC,aAEtCC,UAAYC,SAASpB,EAAEI,UAAUiB,KAAK,aAAc,IACpDC,SAAWtB,EAAEI,UAAUiB,KAAK,YAEtBpB,KAAKsB,KAAK,CAAC,CACjBC,WAAY,yBACZC,KAAM,CACFT,MAAOA,MACPU,QAAS,CAACP,UAAWA,WACrBG,SAAUA,aAGV,GAAGK,MAAK,SAAStB,aACjBuB,SAAW,GACXC,EAAI,SAGR7B,EAAEO,KAAKF,QAAQC,SAAS,SAASE,MAAOC,QACpCmB,SAASlB,KAAKR,UAAU4B,OAAO,0CAA2CrB,YAIvET,EAAE+B,KAAKC,MAAMhC,EAAE+B,KAAMH,UAAUD,MAAK,eACnCF,KAAOQ,UACXjC,EAAEO,KAAKF,QAAQC,SAAS,SAASE,MAAOC,QACpCA,OAAOK,OAASW,KAAKI,GACrBA,OAEJZ,QAAQZ,QAAQC,eAIrB4B,MAAMhB"}

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