Compare commits

...

1196 Commits

Author SHA1 Message Date
Jun Pataleta 6d7dbaa685 Moodle release 3.11.6 2022-03-12 12:39:27 +08:00
Jun Pataleta 05d7ba80e0 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-03-12 12:39:25 +08:00
AMOS bot cdd969bc64 Automatically generated installer lang files 2022-03-12 00:07:30 +00:00
Ilya Tregubov 4f5ad93e83 weekly release 3.11.5+ 2022-03-11 16:19:50 +06:00
Jun Pataleta c8f275ceb0 Merge branch 'MDL-71305-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2022-03-11 11:50:53 +08:00
Jun Pataleta 87bb565607 Merge branch 'MDL-73895-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-11 11:17:18 +08:00
Víctor Déniz 333811ca7b MDL-54724 qtype_multianswer: fix version.php 2022-03-10 23:54:07 +00:00
Víctor Déniz b052925815 Merge branch 'MDL-54724-311' of https://github.com/cameron1729/moodle into MOODLE_311_STABLE 2022-03-10 23:28:57 +00:00
Paul Holden f29ee3a772 MDL-67802 core: load only those properties defined within persistent.
This is a backport of the patch from MDL-71086.
2022-03-10 21:40:42 +01:00
Sara Arjona a059ee52a4 Merge branch 'MDL-73760_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2022-03-10 13:17:31 +01:00
Sara Arjona 1e8a05b13a Merge branch 'MDL-74123_h5p_duplicate_file_311' of https://github.com/davosmith/moodle into MOODLE_311_STABLE 2022-03-10 08:41:01 +01:00
Jake Dallimore 263e28634f Merge branch 'MDL-73899-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-03-10 15:34:45 +08:00
Jun Pataleta e40b7928c9 Merge branch 'MDL-73520-M311_replace-deprecated-php_errormsg-with-error_get_last' of https://github.com/ziegenberg/moodle into MOODLE_311_STABLE 2022-03-10 12:28:20 +08:00
Ilya Tregubov f783ae12d9 Merge branch 'MDL-67428-filter-context-311' of https://github.com/Peterburnett/moodle into MOODLE_311_STABLE 2022-03-10 09:14:18 +06:00
Shamim Rezaie 730e131ad5 Merge branch 'MOODLE_311_STABLE_MDL-67802_2' of https://github.com/mattporritt/moodle into MOODLE_311_STABLE 2022-03-10 08:57:34 +11:00
Sara Arjona 951465e810 Merge branch 'MDL-74104-311' of https://github.com/ferranrecio/moodle into MOODLE_311_STABLE 2022-03-09 18:23:19 +01:00
Eloy Lafuente (stronk7) fd9fbe61da Merge branch 'MDL-73737-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-09 16:54:22 +01:00
Sara Arjona ed07b798e9 Merge branch 'MDL-73586_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-09 16:26:20 +01:00
Sara Arjona d4308f1113 Merge branch 'MDL-71807_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-09 16:22:10 +01:00
Davo Smith a1fa5e7178 MDL-74123 h5p: delete any existing files when downloading new files 2022-03-09 13:36:07 +00:00
Ferran Recio a484fcb09d MDL-74104 mod_folder: fix recent activity with forcedownload links
The folder module has a setting to force the download links. However,
the recent activity block ignored this setting until now.
2022-03-09 14:06:35 +01:00
Sara Arjona a17a59c8fe Merge branch 'MDL-73923-M311_tool_task_cronrunning-has-very-tight-limits-on-checking-cron-interval-and-expected-frequency' of https://github.com/ziegenberg/moodle into MOODLE_311_STABLE 2022-03-09 13:52:58 +01:00
Sara Arjona cf7429e55e Merge branch 'MDL-73993-MOODLE_311' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2022-03-09 13:24:37 +01:00
Sara Arjona 38a6eb9739 Merge branch 'MDL-73779_dynreg_sup_msgs_311' of https://github.com/cengage/moodle into MOODLE_311_STABLE 2022-03-09 13:11:17 +01:00
Amaia Anabitarte cdc78a16a5 MDL-74075 core_badges: Check accepted criterias 2022-03-09 12:31:33 +01:00
Matt Porritt 6a4801b152 MDL-67802 Authentication: Allow disabling email verification for OAuth
Allow email account verification to be disabled for any Oauth2 provider.
Also add clear indications to administrators of the danger of doing do,
this is done by an additional form checkbox.
This patch also reverts MDL-66598
2022-03-09 01:16:16 +00:00
Sara Arjona 4c00836de9 Merge branch 'MDL-73846-MOODLE_311' of https://github.com/golenkovm/moodle into MOODLE_311_STABLE 2022-03-08 16:34:46 +01:00
Eloy Lafuente (stronk7) e66a822d8a MDL-73586 phpunit: Simply, remove the setting
It's not available since PHP 7.0, so no use at all.
2022-03-08 14:56:05 +01:00
Eloy Lafuente (stronk7) 9f905c73fd MDL-73586 mod_wiki: Removed php init param for php80 and up
For PHP 8 and up, the 'mbstring.func_overload' doesn't exist
anymore, so skip any check/condition based on it.

The patch has been done that way, so it's easier to remove
the whole block of code once PHP 8.0 becomes our min supported
PHP version.

The change is self-coveres (changes the external and its own tests).
2022-03-08 14:55:58 +01:00
Eloy Lafuente (stronk7) 8a6a7d7e36 MDL-73586 mustache.php: Removed php init param for php80 and up
The 'mbstring.func_overload' php init setting was removed for
php80 (it was deprecated since php72). So it won't evaluate to
true ever, so the whole block can be put under php version condition.

Note that this is already fixed upsteam, for commit:
https://github.com/bobthecow/mustache.php/commit/e7165a33b282ab4d20b3863825caadb46313d62b

And it has been released with version 2.14.1 of the library, so, once
we upgrade to it, the fix will be incorporated.
2022-03-08 14:13:37 +01:00
Michael Hawkins a2d230777f MDL-74074 badges: Ensure profile criteria exists before completion check 2022-03-08 12:04:53 +00:00
Daniel Ziegenberg 3fe211d602 MDL-73520 adodb: Remove usage of $php_errormsg from DB2 driver
This applies #791 from upstream libraries: https://github.com/ADOdb/ADOdb/issues/791

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-08 11:21:25 +01:00
Daniel Ziegenberg 865cd7235e MDL-73520 general: replace deprecated php_errormsg with error_get_last()
For a better PHP8 compatibility this commit replaces the deprecated $php_errormsg
with error_get_last().

The PHP 8.0 migration guide (https://www.php.net/manual/de/migration80.incompatible.php) says:
    The track_errors ini directive has been removed.
    This means that php_errormsg is no longer available.
    The error_get_last() function may be used instead.
Also the documentation on $php_errormsg (https://www.php.net/manual/en/reserved.variables.phperrormsg.php) says:
    This feature has been DEPRECATED as of PHP 7.2.0.
    Relying on this feature is highly discouraged.
    Use error_get_last() instead.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-08 11:18:21 +01:00
Eloy Lafuente (stronk7) 2b61c1b77c MDL-71807 cleanup: Replace deprecated codingStandardsIgnore annotations
The PHP_CodeSniffer @codingStandardsIgnore annotations are deprecated
and, since version 3.x, the new // phpcs:ignore comments should be used
instead.

This commits just reviews all the uses in core, replacing them for
the better new candidate, or removing when no longer needed.
2022-03-08 10:49:01 +01:00
Paul Holden c653a49fe3 MDL-72972 tool_uploaduser: observe capability to delete users. 2022-03-08 10:04:21 +01:00
cescobedo 15c282d1e5 MDL-71722 h5plib_v124: Add required changes after lib upgrade 2022-03-08 10:04:21 +01:00
cescobedo d8ce474882 MDL-71722 h5plib_v124: Upgrade ckeditor to 4.17.1 2022-03-08 10:04:21 +01:00
Ilya Tregubov 9fc9168f1c MDL-71703 lib: update phpmailer to 6.5.3 2022-03-08 10:04:21 +01:00
Eloy Lafuente (stronk7) bb864ee2e1 weekly release 3.11.5+ 2022-03-08 10:01:56 +01:00
Jun Pataleta d96a108ea0 Merge branch 'MDL-72646-font-mimetype-311' of https://github.com/doctorlard/moodle into MOODLE_311_STABLE 2022-03-08 12:18:00 +08:00
Ilya Tregubov 9c6d7dbf7b Merge branch 'MDL-66940-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-03-08 05:01:56 +02:00
Shamim Rezaie 8c1587e612 MDL-71305 core_question: Use toggle button for flag question element 2022-03-08 13:44:01 +11:00
Mikhail Golenkov 3679e8d579 MDL-73846 assignfeedback_editpdf: Add limit for convert_submissions task 2022-03-08 12:38:35 +11:00
Shamim Rezaie e0dcb76a41 MDL-71305 core_question: Remove duplicate strings 2022-03-07 11:38:17 +11:00
Sara Arjona 90290e5957 MDL-66940 badges: Create page to display badges info
The OBv2.0 specification includes a field "Criteria" for
BadgeClass. Until now, this field was filled using the
URL of the badge assertion, but that is causing some issues
in Badgr because it linked to the badge assertion of the
first user sending this badge to the Badgr backpack (so then,
the following users linked to the first user assertion page
too).

This patch adds a new page, badgeclass.php which will be
used from now to display any badge information which is
not related to any assertion (like happens with the criteria
in BadgeClass).
2022-03-04 17:16:21 +01:00
Sara Arjona 64b9992366 MDL-66940 badges: simplify external badges page
This is a backport from MDL-72141.

Apart from reorganising the information displayed in the external badges
page, this information has been moved to reuse the template created in
MDL-71937, to make it easier to modify and maintain.
2022-03-04 17:16:21 +01:00
Sara Arjona 3c18fd4e3d MDL-66940 badges: simplify badges page
This is a backport of MDL-71937.

Apart from reorganising the information displayed in the badges page,
this information has been moved to a template in order to make it
easier to modify and maintain.
2022-03-04 17:16:21 +01:00
Shamim Rezaie 523ee08608 Merge branch 'MDL-73824_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-05 00:40:40 +11:00
Eloy Lafuente (stronk7) e650d04b34 Merge branch 'MDL-73954_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2022-03-04 14:20:52 +01:00
Tim Hunt bb228c82c1 MDL-73954 quiz: fix decimal places for the percentage on review page 2022-03-04 11:54:42 +00:00
Eloy Lafuente (stronk7) cdfae47f94 Merge branch 'MDL-74042-311' of https://github.com/jleyva/moodle into MOODLE_311_STABLE 2022-03-04 12:20:08 +01:00
Mahmoud Kassaei 93052dde8d MDL-73760 Quiz: Manual grading report does not handle separate groups
when the user is not in any group
2022-03-04 11:05:55 +00:00
Eloy Lafuente (stronk7) c2e5f45769 MDL-73824 test: Cover all the changed code with special decsep tests
Various tests have been added to cover the points fixed in the previous
commit, using a localised decimal separator (#). Using the same
numbering, here there are the details:

A. grade/report/singleview/tests/behat/singleview.feature
   grade/tests/behat/grade_category_validation.feature

B. grade/tests/behat/grade_override_letter.feature

C. (done within various scenarios)

D. grade/report/singleview/tests/behat/singleview.feature

E. admin/tool/behat/tests/behat_form_text_test.php

F. grade/tests/behat/grade_to_pass.feature
   mod/lesson/tests/behat/lesson_informations_at_end.feature

G. quiz/tests/behat/preview.feature

H. mod/quiz/tests/behat/info_page.feature

I. question/type/ddimageortext/tests/behat/edit.feature
2022-03-04 10:23:35 +01:00
Eloy Lafuente (stronk7) c6691f7ef7 MDL-73824 gradebook: Add support for localised floats where missing
It has been detected, thanks to php80 specially, that there are
various places in core where support for localised floats is
missing. Before php80, some locale-dependent conversions were
performed by PHP, allowing things to work. But with php80 all
those comparisons are now locale-independent. See:

https://wiki.php.net/rfc/locale_independent_float_to_string

That implies that we now need to, always, unformat floats to
be internally the correct (decimal point as separator) in
order to compare it.

While this was visited in the php80 epic (MDL-70745), nothing
was found, all automated tests were passing ok. Problem is that
we run behat tests with en-AU laguage that has the decimal point
separator.

So, in this issue we are fixing all the problems detected by
running those Behat tests using localised (comma) decimal
separator.

Note that there may be other places still causing problems, but
it's really hard to find them programmatically, so we'll have to
wait for real use reports / issues and go fixing them while they
happen.

Back to this commit, this is the list of changes performed (note that
in the next commit, we'll be adding scenarios explicitly using
a localised decimal separator to ensure that they work ok).

A. Changes to various grade forms to ensure that, on their validation
  floats are unformatted properly. Also, changed the corresponding
  form element from current text/PARAM_RAW to proper float ones that
  take care of the conversion in a number of places (but when disabled,
  that's the reason we still have to unformat in validation.
  This includes the following forms:
    - edit_category_form
    - edit_item_form
  (this is the original problem reported that cause all the research
  to be performed against full behat runs)

B. Changes to edit_letter_form, so it uses a proper PARAM_LOCALISEDFLOAT
  (note this is the type of change that surely should be used for all
  the rest of /grade/edit/tree form, including those in the previous
  point).

C. Changes to the grade_item behat generator, so it's able to work with
  localised floats, un-formatting them when needed.
  At lib/behat/classes/behat_core_generator.php

D. Fix problem passing localised floats to scales, not displaying
  properly. At grade/report/singleview/classes/local/ui/finalgrade.php

E. Change the behat text matcher in order to allow comparison of
  localised floats when they are the current ones. Before this change
  the matches was using soft/lazy comparison, so '50' and '50.0000'
  match. Now, when the comma (for example) is used (and only then),
  '50' and '50,000' will also match. This comparison is in use in a
  bunch of tests and makes sense to make it localisation-aware.
  At grade/report/singleview/classes/local/ui/finalgrade.php

F. Fix a couple of number_format() uses in lesson, because they are
  not localised-aware. Switched to format_float(). At mod/lesson/locallib.php

G. Change the quiz_contains_the_following_questions() step to accept
  localised maxmark expectations. At mod/quiz/tests/behat/behat_mod_quiz.php

H. Change the quiz generator so it accepts localised gradepass.
  At mod/quiz/tests/generator/lib.php

I. Change the edit question form to show proper localised penalties,
  previously it was always showing point-decimal ones. Of course,
  leaving the values of the select element unmodified (internal floats).
  Related, also change a couple of tests to, instead of try to match the
  value (always internal floats), match the description (now localised),
  so we can test them with different separators. At:
    - question/type/ddimageortext/tests/behat/backup_and_restore.feature
    - question/type/ddmarker/tests/behat/backup_and_restore.feature
    - question/type/edit_question_form.php
2022-03-04 10:23:35 +01:00
Jun Pataleta 7139d3404f Merge branch 'MDL-73799_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-04 14:47:33 +08:00
Jun Pataleta 0cdd0b34f6 Merge branch 'MDL-73785_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-03-04 14:36:41 +08:00
Peter Spicer 1c3084df01 MDL-67428 navigation: Apply navigation text filters at system context
On some larger sites, processing the navigation with format_string will
habitually load all the contexts for navigation which can take 400+ DB
queries. Explicitly tying all those format_string calls to the system
context reduces this overhead to a single DB query that probably has
already been run on the page previously.

Co-authored-by: Peter Burnett <peterburnett@catalyst-au.net>
2022-03-04 14:38:39 +10:00
Eloy Lafuente (stronk7) 95430c15f9 Merge branch 'MDL-64770-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-03-03 23:20:45 +01:00
Sara Arjona 5d9b0a171b Merge branch 'MDL-72915-311' of https://github.com/HuongNV13/moodle into MOODLE_311_STABLE 2022-03-03 17:31:17 +01:00
Paul Holden 14403a8cb8 MDL-73737 report_loglive: ensure action link popups work post-AJAX. 2022-03-03 14:02:35 +00:00
Daniel Ziegenberg 5971de4590 MDL-73923 tool_task: make a more relaxed check on cron run interval
Prior to this change, the tool_task_cronrunning check had very tight
limits for checking the last cron interval and comparing it to the
expected frequency. When a cron job should take 1:00 min and the last
run was 1:02 min it complained that there was 1:02 between the last two
runs of the cron maintenance script and it should run every 1:00.

This change makes the check a bit more relaxed and adds an additional
minute on top of the expectedfrequency to give the cron job some time.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-03 14:28:03 +01:00
Eloy Lafuente (stronk7) 950c3a59cc MDL-73799 phpunit: Move some test names, as agreed in the issue
- behaviourtype_test => behaviour_type_test (10)
- questiontype_test => question_type_test (16)
- upgradelibnewqe_test => upgrade_old_attempt_data_test (13)
2022-03-03 12:22:42 +01:00
Eloy Lafuente (stronk7) 960cfda886 MDL-73799 phpunit: various question & quiz testcase names
To all the walkthrough, questiontype, question, upgradelibnewqe,
behaviourtype_test and edit_form testcase classes::

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:
- When belonging to other component and being valid api:
  - form related tests have been moved to tests/form subdir.
2022-03-03 12:22:42 +01:00
Eloy Lafuente (stronk7) eb0c520ad6 MDL-73785 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- When belonging to other components and being valid api:
  - analytics related tests have been moved to tests/analytics subdir.
  - backup & restore related tests have been moved to tests/backup subdir.
  - events related tests have been moved to tests/event subdir.
  - privacy related tests have been moved to tests/privacy.
  - task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
  needed now that they are namespaced):
  - some xxxlib_test.php have been renamed lib_test.php
    (when they where testing the corresponding lib.php).
  - cache stores tests have been all renamed store_test, originally
    each one had its own name (file_test, apcu_test, redis_test...)
  - assign feedback tests have been all renamed feedback_test, originally
    each one had its own name (file_test, editpdf_test...)
2022-03-03 12:19:38 +01:00
Jun Pataleta 646c691107 weekly release 3.11.5+ 2022-03-03 17:51:32 +08:00
Jun Pataleta 23fb69bbe3 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-03-03 17:51:28 +08:00
Mikhail Golenkov 498c78e23a MDL-73993 phpdoc: get_module_types_names returns lang_string objects 2022-03-03 10:43:41 +11:00
Cameron Ball 83b7836068 MDL-54724 qtype_multianswer: Better handle corrupted questions
When questions are deleted, we now check if the parent is in use before deletion.

Prior to this, it would be possible for multianswer questions to reference
questions that have been deleted. This results in fatal errors when the quiz
is viewed.

This patch uses a dummy 'subquestion_replacement' to handle this case and
display some information to the end user about what has happened so that
they may take action to repair the corrupted question.

As a result of the bug described above, the sequence column of
mdl_question_multianswer can contiain references to questions that no
longer exist, and these IDs can make their way in to backups.

When this happens, the backups cannot be restored. To avoid this,
this patch skips trying to restore those questions that reference
question IDs that no longer exist (as there is no way to recover them).
2022-03-02 18:46:21 +08:00
Juan Leyva 2cae00d9d3 MDL-74042 vimeo: Support security hash for restricted videos 2022-03-01 13:33:09 +01:00
AMOS bot d7de09d272 Automatically generated installer lang files 2022-03-01 00:07:35 +00:00
Paul Holden 28761c2eba MDL-64770 tool_uploaduser: validate unique field values in upload.
If a custom user profile field is set to be unique, then we should
ensure that is respected in the entirety of the uploaded data.
2022-02-28 14:53:13 +00:00
Andrew Nicols 48a9189c12 Merge branch 'MDL-73582-311-nocache' of https://github.com/vmdef/moodle into MOODLE_311_STABLE 2022-02-28 13:03:38 +08:00
AMOS bot 5b5c4361ee Automatically generated installer lang files 2022-02-26 00:07:38 +00:00
Ilya Tregubov 33b053ede8 weekly release 3.11.5+ 2022-02-25 19:23:40 +02:00
Ilya Tregubov 5c762b40bf Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-02-25 19:23:36 +02:00
Andrew Nicols ca0bf01e23 Merge branch 'MDL-70792-311-2' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-02-25 11:52:32 +08:00
Jun Pataleta 1bd98e1641 MDL-70792 theme_boost: Remove default outline on focused menu items
* Remove default browser outline in :focus-visible pseudo-class for
  links within .dropdown-item elements.
2022-02-24 18:26:14 +08:00
Jun Pataleta ef132f0ab4 MDL-70792 output: Menu items should have -1 tab index
* As per WAI ARIA Authoring Practices 1.1 guidelines for menus,
menu items should have a tab index of -1. Navigation between menu items
is done via arrow keys.

See https://www.w3.org/TR/wai-aria-practices-1.1/#menu
2022-02-24 18:26:14 +08:00
Jun Pataleta 62a90218e1 MDL-70792 aria: Dropdown menu keyboard interaction fixes
* Move the focus to the last menu item when the menu is displayed by
pressing the Up arrow key.
* When the menu is open and Tab/Shift-Tab is pressed, focus on the
next/previous focusable element on the DOM instead of focusing back on
the menu trigger.
* Combine event handling for the dropdown menu trigger.
2022-02-24 18:26:14 +08:00
Jun Pataleta 360b0271a5 Merge branch 'MDL-73915-311-terser' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-02-24 17:02:19 +08:00
AMOS bot fe8d169b36 Automatically generated installer lang files 2022-02-24 00:07:35 +00:00
Mathew May b3c3f4e0ba MDL-70792 aria: Only set focus on items when triggered by keypress 2022-02-23 22:42:37 +08:00
Andrew Nicols 6fc3618bd5 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-23 08:51:44 +08:00
Andrew Nicols 034ffb924b MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:51:44 +08:00
Andrew Nicols 3ee0da8f17 MDL-73915 js: Upgrade packages 2022-02-23 08:51:44 +08:00
Andrew Nicols a6f5c43c9f MDL-73915 js: Switch to nodejs lts/gallium 2022-02-23 08:51:43 +08:00
Andrew Nicols c2f8050802 MDL-73915 js: Upgrade node-sass 2022-02-23 08:51:43 +08:00
Andrew Nicols e3c9bab5e5 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
Eloy Lafuente (stronk7) 383a8f5fc7 Merge branch 'MDL-73450-311_auroramysql_fix' of https://github.com/Limekiller/moodle into MOODLE_311_STABLE 2022-02-22 19:40:38 +01:00
Sara Arjona c1441da84a weekly release 3.11.5+ 2022-02-22 11:12:51 +01:00
Sara Arjona 18eee87ae9 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-02-22 11:12:48 +01:00
Sara Arjona cbd3fd7d9c Merge branch 'MDL-73905_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-02-21 16:40:39 +01:00
Sara Arjona 729ca7f2f8 Merge branch 'MDL-73872-311' of https://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2022-02-21 16:32:09 +01:00
Sara Arjona 7a87dac5cd Merge branch 'MDL-73883-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-02-21 15:35:19 +01:00
Eloy Lafuente (stronk7) 0196f5326f Merge branch 'MDL-73812-311-enfix' of https://github.com/vmdef/moodle into MOODLE_311_STABLE 2022-02-21 09:15:04 +01:00
AMOS bot 2b0be5b36c Automatically generated installer lang files 2022-02-21 00:07:36 +00:00
Luca Bösch 6513f39863 MDL-73872 admin: align 'Save changes' and 'Cancel' 2022-02-18 18:36:07 +01:00
Víctor Déniz 2407b79b8b MDL-73812 lang: Replace modified strings in tests 2022-02-18 16:22:41 +00:00
Helen Foster a77a75fe72 MDL-73812 lang: Import fixed English strings (en_fix) 2022-02-18 16:22:41 +00:00
Eloy Lafuente (stronk7) ea801b6374 MDL-73905 core: fix coding_exception missing namespace
This was leading to exception:

Class 'core\message\coding_exception' not found

Surely we weren't facing this before MDL-67853, but it seems that
now we are hitting it sometimes (being investigated @ MDL-73747).

So, just ensure the proper \coding_exception is used.
2022-02-18 15:45:18 +01:00
Sara Arjona 554911ee4e weekly release 3.11.5+ 2022-02-18 15:03:40 +01:00
Sara Arjona 7052e98f2c Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-02-18 15:03:37 +01:00
Ilya Tregubov 6701dbec13 Merge branch 'MDL-72734-311-fix' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-02-18 13:53:19 +02:00
Paul Holden bd56366374 MDL-72734 tool_task: replace usage of non-existing method.
The method `$task->can_run()` exists only in the master branch,
replace usage with implementation appropriate for 311.
2022-02-18 11:35:18 +00:00
Andrew Nicols 3310bf9924 Merge branch 'MDL-72734-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-02-18 10:56:05 +02:00
Andrew Nicols 21e61a347e Merge branch 'MDL-73748-311-check_for_updates' of https://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2022-02-18 10:56:05 +02:00
Andrew Nicols 134a7ca404 Merge branch 'MDL-73636-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-02-18 10:56:04 +02:00
AMOS bot 7b519f1c20 Automatically generated installer lang files 2022-02-17 00:07:31 +00:00
Víctor Déniz 65b49f5be6 MDL-73582 registration: Add endpoint to provide version to linkchecker 2022-02-16 20:42:04 +00:00
Ilya Tregubov 171c9cc802 Merge branch 'MDL-73868-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-02-16 13:06:45 +02:00
Sara Arjona 4e4f395994 Merge branch 'MDL-72762_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-02-16 11:50:16 +01:00
Paul Holden 1755da1e81 MDL-73895 message: hide empty component notification categories.
If a component has no available notification types (because they're
disabled), then it (the component) should be hidden entirely from
the user notification preferences page.
2022-02-16 10:31:00 +00:00
Jun Pataleta c3facdf7dc Merge branch 'MDL-73827-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-02-16 16:52:16 +08:00
Jonathan Harker 0b79f9fdf1 MDL-72646 theme: update font download MIME types, RFC-8081 2022-02-16 19:12:44 +13:00
Sara Arjona 3b2234ee76 Merge branch 'MDL-73834_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-02-15 17:18:46 +01:00
Eloy Lafuente (stronk7) b57b50cc0c MDL-73834 mod_lti: Don't load external artifacts, original behaviour
Summary:

- With PHP7, libxml_disable_entity_loader() was making those
  flags futile, and the DTDs were not being requested ever.
- With PHP8, the flags get precedence and requests for the
  DTD have started to happen.
- Those requests are not served by W3C (1 minute time-out).
- Those DTDs aren't used by anything in code (no entity
  replacement, no validation...)

Hence:
- Remove the flags so it will work the same in PHP7 and PHP8.
- Just to double ensure we don't want any remote loading
  to happen ever, add explicitly the LIBXML_NONET flag.
2022-02-15 09:41:47 +01:00
Andrew Nicols 781c3438c2 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:20 +08:00
Jun Pataleta e8721581cd Merge branch 'MDL-73805-311' of https://github.com/bmbrands/moodle into MOODLE_311_STABLE 2022-02-15 12:18:24 +08:00
Jun Pataleta ef6a2e594f Merge branch 'MDL-73826_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-02-15 11:52:01 +08:00
Sara Arjona 3b32118506 MDL-73868 oauth2: Remove multiple slashes in image URL
There is an issue with the current Badgr manifest because the image
URL contains double slash which is causing an error when storing it
in the database (https://api.test.badgr.com/static//images/logo.png).
This issue parses image URL and removes multiple slashes in URL.
2022-02-14 11:43:23 +01:00
Paul Holden 77857ced5a MDL-72734 tool_task: consistent checks for running tasks from web. 2022-02-14 09:21:50 +00:00
Paul Holden 48a0d87f2f MDL-73636 course: use formatted name in exported activity data. 2022-02-14 09:19:09 +00:00
Eloy Lafuente (stronk7) d6984b7616 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-11 23:50:41 +01:00
Eloy Lafuente (stronk7) ad1c072d04 MDL-73826 phpunit: Allow curl mock responses to handle empty strings
Before this commit, is_empty() was being applied before returning
the mock response. But we want to be able to mock the empty response
for some tests, hence moving the condition to null/isset, that is
the value that array_pop() returns where there aren't more elements
in the array.

With that change performed, we can test lti_load_cartridge() with
empty responses, hence adding a new test for that.
2022-02-11 23:50:12 +01:00
Eloy Lafuente (stronk7) e6aeab1fc0 MDL-73826 mod_lti: Fix for Windows/PHP8 with empty curl responses
Sometimes (detected with Windows, when running @ GHA), both the
response and the error of a curl request to non-existing URL
returns the empty string.

In that case, we cannot call to DOMDocument::loadXML() because the
1st param cannot be empty. So here, whenever that happens, we are
throwing the moodle_exception earlier, instead of waiting for the
XML errors to be processed later.
2022-02-11 23:50:12 +01:00
Sara Arjona 6994e82281 weekly release 3.11.5+ 2022-02-11 15:55:21 +01:00
Sara Arjona eb5efbd0ca Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-02-11 15:55:17 +01:00
Limekiller d130a9d0b7 MDL-73450 installation: Support Aurora MySQL >= 8.0.0 2022-02-10 15:13:54 -05:00
Ilya Tregubov b9e8a9af10 Merge branch 'MDL-73764_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-02-10 14:19:21 +02:00
Sara Arjona 3bb11e2ab4 MDL-73827 lib: Fix URL blocked error for userinfo endpoint
When the oAuth2 issuer hasn't any userinfo endpoint, a call to
$this->get(false) was done, which was returning "The URL is
blocked".
This is a regression from MDL-70649, which added some cURL security
checks.
2022-02-10 10:44:08 +01:00
AMOS bot 9ce0d04ceb Automatically generated installer lang files 2022-02-10 00:07:49 +00:00
Shamim Rezaie 75968fb87e Merge branch 'MDL-73772-311' of https://github.com/aanabit/moodle into MOODLE_311_STABLE 2022-02-10 09:42:46 +11:00
Amaia Anabitarte a268911ffe MDL-73772 reports: Fix Activity completion report with no group select 2022-02-09 13:19:57 +01:00
Huong Nguyen 5707de083a MDL-72915 qtype_ddimageortext: Fix eventHandler for Unlimited items
Sometimes, for the question that has a lot of input groups and unlimited draggable items,
the 'clone' process takes longer than usual, so the questionManager.init() method
will not add the eventHandler for the cloned drag.
We should make sure to bind the eventHandler for the cloned too
2022-02-09 16:26:39 +07:00
AMOS bot 8d97af30c0 Automatically generated installer lang files 2022-02-09 00:07:34 +00:00
Eloy Lafuente (stronk7) bcb55ea61a MDL-73764 behat: Verify the report works and all files in core are ok 2022-02-08 19:25:09 +01:00
Eloy Lafuente (stronk7) 6af84076b0 MDL-73764 tool_xmldb: Regenerate all the files detected by the report
Note that, instead of going one by one to them from the XMLDB Editor
(load, makes some tiny change, save, revert the change, save), the
report includes a commented line that, once uncommented, does regenerate
the file while reporting.

I've left it there as a commodity for the developer.
2022-02-08 19:25:09 +01:00
Eloy Lafuente (stronk7) efd150059b MDL-73764 tool_xmldb: New report to show all xml files needing reconcile
People uses to edit the install.xml files manually, here and there. That
uses to come with small mistakes, like wrong white-space indentation,
some attributes out of order...

While none of them are critical, they add a lot of noise when somebody
is correctly editing a file with the XMLDB Editor because it, correctly,
overwrites the whole file and then diffs show a lot of unrelated changes.

So, this report will inform us about any file needing to be regenerated
because it has been manually edited (in a different way than the way
the editor has).

Note that the report is very basic, with minimal ouput, manually
generating the HTML, like the rest of the XMLDB Editor actions do. We
are not using renderers neither templates here.

Also note that it includes a commented line of code that, once
uncommented, enables the report to, also, fix the wrong files. Useful
for developers.
2022-02-08 19:25:09 +01:00
Ilya Tregubov e91a1432d1 weekly release 3.11.5+ 2022-02-08 14:54:07 +02:00
Bas Brands 7c9b0751f8 MDL-73805 theme_boost: remove left icon margin
The icon margin added in MDL-73543 is causing multiple alignment issues. The alignment issue it needed to fix is done for the recently accessed course block
only.
2022-02-08 13:07:16 +01:00
Jun Pataleta 66396cf4a5 Merge branch 'MDL-72246-311-2' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-02-08 11:37:08 +08:00
Andrew Nicols 0f0b8bbf68 MDL-72246 core_completion: Only fetch other completion data on requested
Prior to this patch, the code was fetching all completion data for all
activities in a course, even when the activity was not requested. This
leads to recursion issues as the data has not been added to the cache
before this operation occurs.

To handle this situation, only the requested CM is fetched in full, and
a boolean flag is used to store whether the full data has been fetched.

When returning a partially fetched value from the cache, the flag is
used to determine whether more data must be fetched, and the cache
updated.

The flag is filtered out before the value is returned.

Note: Many of the tests were updated as these were inspecting private
features of the API which should not really be tested.
2022-02-08 11:35:23 +08:00
Andrew Nicols 1142892aca MDL-72246 core_completion: Test coverage improvements for completion 2022-02-08 11:22:25 +08:00
Andrew Nicols 1330fadb00 MDL-72246 core_completion: Stop testing the inner workings of get_data() 2022-02-08 11:22:24 +08:00
Andrew Nicols 3d7e4f8900 Merge branch 'MDL-73716_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-02-08 11:00:22 +08:00
Eloy Lafuente (stronk7) 27ec971d45 MDL-73716 phpunit: remove old simpletest static members
And replace them by phpunit @covers annotations including
all the classes declared or extended in the removed members.

It's not awesome coverage, but better than nothing.
2022-02-07 10:44:49 +01:00
Andrew Nicols 261f79884f Merge branch 'MDL-73659_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-02-07 13:34:39 +08:00
David Mudrák 20797726bb MDL-73748 admin: Check for available updates daily on random time
It's been a mistake to make every Moodle site out there to check for
available update every two hours, on the hour. We are experiencing
server load peaks that are harder and harder to deal with.

The patch addresses this by (1) checking for available updates just once
a day and (2) distributing the checking times randomly around the clock.
2022-02-06 21:54:17 +01:00
Eloy Lafuente (stronk7) f92877a5a3 MDL-73659 phpunit: restore_date, api, rule, plugin, manager & helper
All restore_date_test, api_test, rule_test, plugin_test,
manager_test, helper_test testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- All restore_date_test cases have been put under xxx\backup
  level 2 (valid API) namespace.
2022-02-05 00:03:40 +01:00
Claude Vervoort 8b5e15ef5b MDL-73779 mod_lti: dynreg fix messages supported 2022-02-04 15:43:42 -05:00
Sara Arjona 62fe7519b8 weekly release 3.11.5+ 2022-02-04 18:18:30 +01:00
Víctor Déniz 579498f9fa Merge branch 'MDL-73514_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-02-03 22:20:07 +00:00
Víctor Déniz b447e683f7 Merge branch 'MDL-73517_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-02-03 22:03:51 +00:00
Eloy Lafuente (stronk7) 4b9d3d514d Merge branch 'MDL-73765-311-twenty-three-minutes' of https://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2022-02-03 22:27:32 +01:00
David Mudrák 30aa6960fc MDL-73765 task: Fix calculation of random minute in the task schedule
The random minute was incorrectly set to a random value from the range
0 - 23 instead of 0 - 59 due to this copy & paste mistake.
2022-02-03 19:17:42 +01:00
Ilya Tregubov 072f686193 Merge branch 'MDL-73543-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2022-02-03 10:53:21 +02:00
Jun Pataleta 3e4dd17c54 Merge branch 'MDL-73711_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-02-03 11:14:39 +08:00
Simey Lameze a1059b10c1 MDL-73543 theme: add left margin to move block icon 2022-02-02 19:12:45 +08:00
Eloy Lafuente (stronk7) 19c1c5fea6 Merge branch 'MDL-73075-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-02-02 11:12:55 +01:00
Paul Holden 29936a7238 MDL-73075 lang: move deprecated strings to correct component.
Fix deprecated version. See original change from f9e1c258 for context.
2022-02-02 10:02:40 +00:00
Eloy Lafuente (stronk7) 8f46c10cb8 weekly release 3.11.5+ 2022-02-01 19:51:04 +01:00
Eloy Lafuente (stronk7) b9348695f6 MDL-73711 behat: Bump to Behat 3.10.x
Generated with php73, following the instructions at:

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

Note this also comes with a minor PHPUnit bump to 9.5.13.
2022-01-29 16:11:37 +01:00
AMOS bot b2c031f401 Automatically generated installer lang files 2022-01-29 00:07:30 +00:00
Eloy Lafuente (stronk7) 071ea825b7 MDL-73517 mnet: add some openssl missing parameters
Since php80 the 5th parameter (cypher) in the following functions:
  - openssl_seal
  - openssl_open
is mandatory, hence:
  - adding it.
  - with value 'RC4' to keep BC.
2022-01-28 20:10:58 +01:00
Eloy Lafuente (stronk7) 5e8812bfc5 MDL-73514 mnet: fix promiscuous mode and php80 support 2022-01-28 20:10:45 +01:00
Ilya Tregubov 0b00e04cf3 weekly release 3.11.5+ 2022-01-28 20:16:59 +02:00
Ilya Tregubov a0386b12ad Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-01-28 20:16:58 +02:00
Shamim Rezaie 75df86e057 Merge branch 'MDL-72852-311-fix' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-01-28 14:59:06 +11:00
Eloy Lafuente (stronk7) 3fc51cf8b4 Merge branch 'MDL-72937-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-28 00:26:17 +01:00
Eloy Lafuente (stronk7) 42bcaa8aa7 Merge branch 'MDL-73588-311-curlfile' of https://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2022-01-27 12:17:49 +01:00
Shamim Rezaie 46cbfbfb21 Merge branch 'MDL-73500_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-01-27 11:38:13 +11:00
Sara Arjona 26ac673e3e MDL-72852 badges: Improve performance to display Badges nav
The course_get_user_navigation_options() is called on each request
from the add_course_essentials() method, to initialise the basic
navigation options that are available or not for the current user.
This information is not always displayed in boost (for
instance, in a module page), but it might be required by some blocks,
like Navigation.
However, this block is hidden by default in boost since MDL-73347,
so at any point we should check if it's possible to change the way
this navigations options is loaded, to only get this information
when it's strictly required.
2022-01-26 10:36:19 +01:00
Eloy Lafuente (stronk7) fc2020f573 Merge branch 'MDL-72626-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-01-26 10:16:36 +01:00
AMOS bot 957ac32358 Automatically generated installer lang files 2022-01-26 00:07:36 +00:00
Sara Arjona 838b33b9ab MDL-72626 lib: Set Moodle files after RTLCSS upgrade 2022-01-25 09:22:00 +01:00
Sara Arjona 36b4656906 MDL-72626 lib: Upgrade RTLCSS to 1.0.1 2022-01-25 09:22:00 +01:00
Shamim Rezaie e44f94b493 Merge branch 'MDL-72852-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-01-25 13:34:30 +11:00
Frode Petterson acbfa890f6 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-24 16:55:37 +01:00
Sara Arjona d9bde2ab22 MDL-72852 navigation: Do not display badges when empty
If there are no course badges, students shouldn't have a link to a
page saying there are no badges available.

This patch is for displaying the Badges in the secondary navigation
only if the user can manage badges or there is, at least, one
badge available to the current user.
2022-01-24 15:32:08 +01:00
Andrew Nicols 1dd52d7b47 Merge branch 'MDL-73625-311' of https://github.com/jleyva/moodle into MOODLE_311_STABLE 2022-01-24 11:09:26 +08:00
Jake Dallimore 4eda8d0571 Merge branch 'MDL-73485_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-01-24 10:46:40 +08:00
Paul Holden 4b919b20bc MDL-72937 user: restrict Moodlenet profile field length. 2022-01-23 23:00:53 +00:00
Eloy Lafuente (stronk7) 9835d6920f MDL-73485 phpunit: externallib, generator and filter tescase names
All externallib_test, generator_test and filter_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to tests under testing/tests:

1) The core_testing component doesn't exist.
2) But testing/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have testing_xxxx as prefix.

Finally, also modified calendar/tests/event/events_test.php because it uses
some renamed (core_calendar_externallib_testcase => \core_calendar\externallib_test)
classes.
2022-01-21 19:48:30 +01:00
Eloy Lafuente (stronk7) 517e301d5a MDL-73500 general: Remove php < 73 conditional code
This commit removes code that only was being executed by php < 73
and it's 100% safe to do so because Moodle 3.11 and up require
php 73, hence it was not executed ever.

Removed code includes:
- ldap_control_paged_result and ldap_control_paged_result_response
  (that were deprecated in php 73 and have been removed in php 80).
- conditional code in the session manager, where some hacks were
  needed for php < 73. Note that this removes the private function
  append_samesite_cookie_attribute() completely because it was
  doinf nothing (first line was returning for php < 73).
- Also removed the old session.hash_function ini setting because
  it was removed in php 71.

Kept code includes:
- The environmental check_igbinary322_version test has not been
  removed because it doesn't hurt (always returns "ok" for php 73
  sites) and doing it would involve to backport the environment.xml
  file to 39 and 310. Instead, a note has been added to MDL-71747
  in order to get rid of that check for 4.1 and up.
2022-01-21 19:48:01 +01:00
Sara Arjona 1bd5d40c8f weekly release 3.11.5+ 2022-01-21 15:00:49 +01:00
Sara Arjona 00ebf601ff Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-01-21 15:00:45 +01:00
Jun Pataleta 8d8b24a320 Merge branch 'MDL-73021-311' of git://github.com/andelacruz/moodle into MOODLE_311_STABLE 2022-01-21 11:21:59 +08:00
AMOS bot 04c907d433 Automatically generated installer lang files 2022-01-21 00:07:39 +00:00
Sara Arjona 573de6d923 Merge branch 'MDL-73603-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-20 17:23:50 +01:00
Juan Leyva 158518c79e MDL-73625 tool_mobile: Adapt mobile settings for 4.0 2022-01-20 16:30:00 +01:00
Sara Arjona 42e9f29f8a Merge branch 'MDL-73600-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-20 15:22:16 +01:00
Jun Pataleta 4eebc40ec3 Merge branch 'MDL-73523_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-01-20 21:52:57 +08:00
Eloy Lafuente (stronk7) 32d68836a4 MDL-73523 libraries: openssl_free_xxx() methods are deprecated in php80
So we are putting them under a standard PHP_MAJOR_VERSION < 8 condition.

Also, added TODO comments to remember to delete that block of code when
php80 becomes the minimum required versions in the future (Moodle 4.3?).

When possible, an issue has been created upstream, else a comment in
readme_moodle files has been added.

Finally, when the keys being freed were class or object attributes, also
nullify them (but when the calls were part of destructor methods).
2022-01-20 14:48:50 +01:00
AMOS bot ae8b4733fd Automatically generated installer lang files 2022-01-19 00:07:36 +00:00
Daniel Neis Araujo 21865b22e7 MDL-69965 moodlenet: show moodlenet in profile only if it is enabled
Amended to use plain get_config() condition.
2022-01-18 23:28:40 +01:00
Eloy Lafuente (stronk7) 1fcccd8722 Merge branch 'MDL-73561-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-01-18 23:09:36 +01:00
Sara Arjona 0f6643a972 weekly release 3.11.5+ 2022-01-18 12:27:03 +01:00
Jun Pataleta 6c8fd471b4 Merge branch 'MDL-69966-311' of https://github.com/danielneis/moodle into MOODLE_311_STABLE 2022-01-18 10:53:58 +08:00
Jun Pataleta b5dd9b2e8a Merge branch 'MDL-73563-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-18 10:43:54 +08:00
Andrew Nicols c95fad5c21 Merge branch 'MDL-73476_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-01-18 09:31:08 +08:00
Paul Holden 0b73fde437 MDL-73603 webservice: fix user retrieval in token form callback. 2022-01-17 21:52:40 +00:00
Víctor Déniz 36100ed441 Merge branch 'MDL-73584-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2022-01-17 18:54:38 +00:00
Daniel Neis Araujo 48fac357b6 MDL-69966 quiz: start attempt button should be a primary button 2022-01-17 13:54:01 -03:00
Paul Holden 76756f1e10 MDL-73600 user: remove references to deleted user fields/strings.
Since f9e1c258 they are no longer valid.
2022-01-17 16:03:46 +00:00
Bas Brands f2b9070a2c MDL-73486 block_privatefiles: prevent stylelint warnings 2022-01-17 16:32:29 +01:00
Sara Arjona edfcc33471 MDL-73584 lib: Remove role menubar from Actions menu
The menubar role defined in the "menubar d-flex" element is not
required and it's causing the following error "Required ARIA children
role not present: group, menuitemradio, menuitem, menuitemcheckbox".
2022-01-17 12:51:20 +01:00
Sara Arjona 9d49d402eb Merge branch 'MDL-72412-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-01-17 08:28:55 +01:00
Eloy Lafuente (stronk7) a59bec2a6f Moodle release 3.11.5 2022-01-15 12:14:25 +01:00
Eloy Lafuente (stronk7) f773514761 MDL-73476 phpunit: events, external and search tescase names
All events_test, external_test and search_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to lib/external/tests/external_test.php:
- external is not a valid component
- hence, its only valid namespace is "core"
- also, it's testing lib/external/externallib.php
- hence, the file (and class) have been renamed to external_externallib_test.php
  (to avoid conflicts with other external_test that may exist in core)
2022-01-14 16:19:51 +01:00
Sara Arjona 62f859ed24 weekly release 3.11.4+ 2022-01-14 11:14:04 +01:00
Sara Arjona 4b4508fd8b Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-01-14 11:14:01 +01:00
Jun Pataleta c31822a6b4 MDL-72412 core: Add the image role to informative icon fonts 2022-01-14 10:33:30 +08:00
Andrew Nicols 8c2057e569 Merge branch 'MDL-73575-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-14 09:36:47 +08:00
Paul Holden f84ab6c2e4 MDL-73563 course: add vertical space above category action buttons. 2022-01-13 23:14:20 +00:00
Eloy Lafuente (stronk7) 5c42461b50 Merge branch 'MDL-69624-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-13 23:25:00 +01:00
Eloy Lafuente (stronk7) cc4940d794 Merge branch 'MDL-73004-311_access_unit_tests' of https://github.com/brickfield/moodle into MOODLE_311_STABLE 2022-01-13 19:23:29 +01:00
Mike Churchward 29bfe17f2c MDL-73004 tool_brickfield: Fix unit tests for question areas.
Search array of areas for expected question components, rather than assume an array position.
2022-01-13 11:58:28 -05:00
Paul Holden 06abb64d09 MDL-69624 question: add missing test required library. 2022-01-13 15:10:17 +00:00
Paul Holden df608012a7 MDL-73575 webservice: ensure configured protocols are non-empty. 2022-01-13 12:32:48 +00:00
Sara Arjona 817212be50 MDL-73561 grade: Use proper alert for success message 2022-01-13 09:22:33 +01:00
Víctor Déniz 04be2d16f7 Merge branch 'MDL-73418_311' of https://github.com/ja9837/moodle into MOODLE_311_STABLE 2022-01-12 22:25:16 +00:00
Eloy Lafuente (stronk7) 50c8887deb Merge branch 'MDL-73564-311' of https://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2022-01-12 18:31:20 +01:00
Paul Holden beb47bcab8 MDL-72772 gradereport_overview: account for users with parent roles. 2022-01-12 14:19:27 +01:00
Marina Glancy d240de81d1 MDL-73564 webservice: make sure to require webservice lib once 2022-01-12 13:20:18 +01:00
Ilya Tregubov ff840af0b7 Merge branch 'MDL-71949-fix-backup-log-311' of https://github.com/matthewhilton/moodle into MOODLE_311_STABLE 2022-01-12 11:52:06 +02:00
Eloy Lafuente (stronk7) d721f94f2b Merge branch 'MDL-70348-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-12 10:17:41 +01:00
Sara Arjona cb13d527cd Merge branch 'MDL-71461-311' of https://github.com/dravek/moodle into MOODLE_311_STABLE 2022-01-12 09:58:29 +01:00
Sara Arjona d661ace551 Merge branch 'MDL-72771_311' of https://github.com/reskit/moodle into MOODLE_311_STABLE 2022-01-12 09:41:10 +01:00
Shamim Rezaie 6ff9b28f66 Merge branch 'MDL-72880-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-12 19:21:45 +11:00
Paul Holden e414f5b771 MDL-72772 gradereport_overview: access checks for viewing grades. 2022-01-12 13:43:58 +08:00
Andrew Nicols 7ecb4daee6 Merge branch 'MDL-73526_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-01-12 10:21:34 +08:00
AMOS bot b3f1550b40 Automatically generated installer lang files 2022-01-12 00:07:39 +00:00
Eloy Lafuente (stronk7) 17c70ff8a6 MDL-73526 mod_wiki: Remove unused nwiki diff processor
It never has been used in core since it was introduced in 2011
by MDL-22112, because the ouwiki_diff_html() is used unconditionally
for all wiki formats (html, creole or nwiki).

So, removing it to avoid any current (php80) or future incidence
with it.
2022-01-11 17:27:51 +01:00
Paul Holden eda7d884ba MDL-72367 badges: require sesskey to remove badge alignment. 2022-01-11 14:34:17 +01:00
Paul Holden b09d50dd4a MDL-72573 mod_h5pactivity: tighter validation of external sort param.
Restrict external method $sortorder parameter to limited subset of
values.
2022-01-11 14:34:17 +01:00
Dongsheng Cai a0b04d09a7 MDL-71239 calendar: disallow manager role users edit user events 2022-01-11 14:34:17 +01:00
Jun Pataleta bb9cd179ed weekly release 3.11.4+ 2022-01-11 21:30:11 +08:00
Jun Pataleta 4cc87b1326 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2022-01-11 21:30:05 +08:00
David Matamoros f682557e5f MDL-71461 core_customfield: Add missing library in textarea export value 2022-01-11 11:19:57 +01:00
Jun Pataleta 1303c0fb82 Merge branch 'MDL-69061-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2022-01-11 11:56:47 +08:00
Adam Pawełczak c343287349 MDL-69061 core: Fix admin path replacement with path to $CFG->admin 2022-01-11 11:34:09 +08:00
AMOS bot 7d872ea52a Automatically generated installer lang files 2022-01-11 00:07:31 +00:00
Víctor Déniz 62bb90821e Merge branch 'MDL-73414-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-10 23:21:22 +00:00
Jun Pataleta 62dc08644a Merge branch 'MDL-73502_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-01-10 15:10:41 +08:00
AMOS bot 68639cb426 Automatically generated installer lang files 2022-01-08 00:07:28 +00:00
Marc Català d98bf4c5ff MDL-72771 core_course: Set module visibility after moving it
Move a module to another section needs to update its visibility after
placing it into the new section. Otherwise an invalid database state
prevents the system to move any module with a completion rule
involving grades.
2022-01-07 14:27:24 +01:00
Paul Holden a35f4515bd MDL-72880 badges: change badge exporter issuername field to text.
This matches it's type in the settings pages, and also the type
of the site name used as the default for the setting. It's content
will now be automatically filtered by the external exporter class.
2022-01-07 09:12:02 +00:00
Ilya Tregubov c261edf5c7 Merge branch 'MDL-73427-311' of https://github.com/cameron1729/moodle into MOODLE_311_STABLE 2022-01-07 09:45:08 +02:00
Shamim Rezaie 4ce7448979 Merge branch 'MDL-73272/3.11' of https://github.com/skodak/moodle into MOODLE_311_STABLE 2022-01-07 17:45:48 +11:00
AMOS bot 2e814c9d0a Automatically generated installer lang files 2022-01-07 00:07:37 +00:00
Eloy Lafuente (stronk7) 5ef22c2458 MDL-73502 libraries: Avoid uses of get_magic_quotes_xxx() functions
They were deprecated in PHP 7.4 (warning) and have been removed in
PHP 8.0 (error). Plus they were returning false since ages ago (PHP
5.x).

Hence, adding conditional check to see if they are available (h5p
editor) or removing the unreachable code-block when they evaluated
to true.

Also, modified the corresponding moodle_readme files to document
the change.
2022-01-07 00:40:53 +01:00
Ilya Tregubov d6688ad206 weekly release 3.11.4+ 2022-01-06 20:50:51 +02:00
Jun Pataleta a569efe93d Merge branch 'MDL-69700-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-06 12:00:40 +08:00
Cameron Ball 9393fe3643 MDL-73427 core: Remove $SESSION->fromurl 2022-01-06 10:43:12 +08:00
Jun Pataleta ca560fd8b5 Merge branch 'MDL-73497_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-01-06 10:25:12 +08:00
Paul Holden 678c8d5c84 MDL-73497 libraries: upgrade to version 3.3.0 of Spout. 2022-01-05 13:11:45 +01:00
Jun Pataleta 96f7dba2c0 Merge branch 'MDL-68773-clear-adhoc-tasks-311' of https://github.com/Peterburnett/moodle into MOODLE_311_STABLE 2022-01-05 18:46:47 +08:00
Paul Holden c96d32990d MDL-69700 tests: clarify expected exceptions in unit tests.
Resolves some leftovers from MDL-67673, see d95c3787.
2022-01-05 08:45:31 +00:00
Jun Pataleta 9e7a680127 Merge branch 'MDL-73425-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2022-01-05 12:53:39 +08:00
Ilya Tregubov 79957c645f Merge branch 'MDL-73255-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2022-01-04 16:19:03 +02:00
Jun Pataleta 42361660e3 Merge branch 'MDL-73352_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2022-01-04 21:26:03 +08:00
Peter Burnett 54c42455ad MDL-68773 backup: Allow completed async backup + restore tasks to clear 2022-01-04 10:58:30 +10:00
Petr Skoda b5d9af91dc MDL-73272 behat: move behat extension to core 2021-12-31 09:55:07 +13:00
Eloy Lafuente (stronk7) 6dd561a11c MDL-73352 phpunit: lib_test and locallib_test testcase names
All lib_test and locallib_test classes:

- Namespaced with component (and API whenever makes sense).
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed or add new uses.
- All them passing individually.
- Complete runs passing too.

Special mention to tests under login/tests:

1) The core_login component doesn't exist.
2) But login/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have login_xxxx as prefix.
2021-12-30 16:21:48 +01:00
Sara Arjona 3105d5bc9f weekly release 3.11.4+ 2021-12-30 11:24:10 +01:00
Sara Arjona e08e3de631 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-12-30 11:24:06 +01:00
AMOS bot 700562d609 Automatically generated installer lang files 2021-12-30 00:07:25 +00:00
Sara Arjona f97dd08bbc Merge branch 'MDL-73086-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-29 16:18:14 +01:00
Sara Arjona 4599bb5251 Merge branch 'MDL-73295-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-29 15:36:14 +01:00
Sara Arjona 6f35469598 Merge branch 'MDL-72716-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-29 15:01:46 +01:00
Paul Holden 180389d33f MDL-72716 blocks: fix external fetching of available blocks.
Pass `$PAGE->subpage` value in AJAX request, which is required on
some pages (e.g. user dashboard) for loading existing blocks.
2021-12-29 10:46:59 +00:00
Paul Holden 00b78393b3 MDL-73414 webservice: don't disable all WS when disabling mobile. 2021-12-29 10:36:57 +00:00
Paul Holden 7cf0235ef7 MDL-73086 user: account for mixed casing of profile field shortname.
Custom profile fields allow for shortnames containing mixed character
casing, which should also be supported within the user fields API
when retrieving said custom fields.

Given that the DML libs convert all selected columns to lowercased
equivalent, we need to do the same when requesting custom fields to
ensure calling code doesn't try to access `->profile_field_Foo`
property when the DB returns `->profile_field_foo` instead.
2021-12-29 10:21:37 +00:00
Paul Holden af9f840e8d MDL-73295 webservice: only pass around sesskey for tokens as needed. 2021-12-29 09:59:49 +00:00
Sara Arjona 4e2cfa0fe0 Merge branch 'MDL-73402-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-29 10:08:04 +01:00
Sara Arjona 2d05bbbf4c Merge branch 'MDL-72375-completion-id-311' of https://github.com/Peterburnett/moodle into MOODLE_311_STABLE 2021-12-29 09:48:29 +01:00
Eloy Lafuente (stronk7) 43066fb582 Merge branch 'MDL-73420-311' of https://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-12-29 09:05:36 +01:00
Sara Arjona 97e28f897e Merge branch 'MDL-73237-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-28 15:58:35 +01:00
Sara Arjona 84ea58618b Merge branch 'MDL-73207-cronspec-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-12-28 15:43:20 +01:00
Sara Arjona 79c65ea145 Merge branch 'MDL-73189-311' of https://github.com/nguyenphuctien/moodle into MOODLE_311_STABLE 2021-12-28 11:42:03 +01:00
AMOS bot 9697eb3054 Automatically generated installer lang files 2021-12-28 00:07:24 +00:00
Víctor Déniz 5488ffe860 Merge branch 'MDL-73269/3.11' of https://github.com/skodak/moodle into MOODLE_311_STABLE 2021-12-27 15:25:56 +00:00
AMOS bot 9c501dc357 Automatically generated installer lang files 2021-12-27 00:07:27 +00:00
AMOS bot 3e2c0af7ad Automatically generated installer lang files 2021-12-26 00:07:24 +00:00
Josh.Aston 0020e31d55 MDL-73418 Quiz: Continue the last attempt > Continue your attempt 2021-12-23 16:04:48 +00:00
Sara Arjona f04d0ddc8f weekly release 3.11.4+ 2021-12-23 16:29:41 +01:00
Sara Arjona ca8f1866fb Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-12-23 16:29:38 +01:00
Jun Pataleta 4b39124bf8 Merge branch 'MDL-72701-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-12-23 12:10:53 +08:00
Andrew Nicols f6f9359c13 MDL-73255 user: Ensure that invalid filters are not left
When there is no group but a default groupmode is set, the group
configuration is provided but the group data is not present. This
resulted in a JS error and an invalid filter line was left in place.

This change conditionally checks the data-filter-type-class value of the
filterDataNode so that no JS error is produced if the filterDataNode
does not exist and therefore removes the empty filter row.
2021-12-23 11:02:10 +08:00
AMOS bot 529150a7d8 Automatically generated installer lang files 2021-12-23 00:07:26 +00:00
Petr Skoda 56f79b2da5 MDL-73269 dev: add requirements to composer.json 2021-12-23 07:21:47 +13:00
Sara Arjona 9394ec0f27 Merge branch 'MDL-73405_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-12-22 17:20:49 +01:00
Sara Arjona c6f4cac946 Merge branch 'MDL-73380-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-22 16:59:13 +01:00
Sara Arjona 21a59229a9 Merge branch 'MDL-73256-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-22 16:39:49 +01:00
Sara Arjona 36765f08a9 Merge branch 'MDL-69023-M311_mod-lti-conflicts-with-text-alignment-in-chat-messages' of https://github.com/ziegenberg/moodle into MOODLE_311_STABLE 2021-12-22 16:28:05 +01:00
Jun Pataleta acb63ae043 Merge branch 'MDL-73046-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-12-22 18:50:54 +08:00
Frederik Milling Pytlick 343d3f42d4 MDL-73046 media_html5video: Fixed .mov files
.mov files will now have the mimetype 'video/mp4' instead of 'video/quicktime'. (Only if the user's browser is chromium-based)
2021-12-22 18:45:48 +08:00
Shamim Rezaie 51ebf938b7 Merge branch 'MDL-73348_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-12-22 21:20:15 +11:00
Angelia Dela Cruz cf7238ac5e 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:12:52 +08:00
AMOS bot 7295679d8f Automatically generated installer lang files 2021-12-22 00:07:29 +00:00
Andrew Nicols f58768ee9e MDL-72701 unit tests: Fix broken @covers annotations 2021-12-21 09:24:06 +08:00
Matthew Hilton 90d21c6351 MDL-71949 backup: Fix userid and add backup ID to logging 2021-12-21 11:18:31 +10:00
AMOS bot c8da07ae5f Automatically generated installer lang files 2021-12-21 00:07:26 +00:00
Paul Holden b8d2dfc18d MDL-73425 phpunit: document expected class and filename layout. 2021-12-20 18:55:32 +00:00
Marina Glancy 363cf89cee MDL-73420 core: make static cache compatible with PHP8.1 2021-12-20 17:07:23 +01:00
Shamim Rezaie fe8e792113 Merge branch 'MDL-73175-311' of https://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2021-12-20 11:00:21 +11:00
Eloy Lafuente (stronk7) e14c046a17 MDL-73405 libraries: php80 compatibility fix to Horde Imap Client
The fix is already available upstream for versions 2.30.4 and up
See https://github.com/horde/Imap_Client/pull/13
2021-12-19 12:26:53 +01:00
Eloy Lafuente (stronk7) d02364e83b 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:26:53 +01:00
AMOS bot ebc715ceb2 Automatically generated installer lang files 2021-12-19 00:07:25 +00:00
Eloy Lafuente (stronk7) eac985d755 MDL-73348 phpunit: normalize all privacy provider tests
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
  privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)

Also, change some relative paths and comments to point to new
locations.
2021-12-17 14:21:09 +01:00
Eloy Lafuente (stronk7) d6e00bc466 MDL-73348 phpunit: privacy and privacy_provider testcase names
All privacy_test and privacy_provider_test classes:

- Namespaced with component\privacy.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Renamed a few files to make all be privacy_test or privacy_provider_test.php
- All them passing individually.
- Complete runs passing too.
2021-12-17 14:21:09 +01:00
Paul Holden a8a8555b4f MDL-73402 block_admin_bookmarks: slightly relax section cleaning.
Allow '/' character in external page names.
2021-12-17 11:59:21 +00:00
Eloy Lafuente (stronk7) fd3e2cd428 weekly release 3.11.4+ 2021-12-17 11:47:55 +01:00
Noel De Martin d71c1a0776 MDL-73175 mod_glossary: Add behat generators 2021-12-17 07:51:37 +01:00
Paul Holden 25210e010a MDL-70348 core: fix upgrade note referring to $CFG->localrequestdir.
The change in 9fabe1dd referred to incorrect config property.
2021-12-15 08:56:46 +00:00
AMOS bot d332c8e507 Automatically generated installer lang files 2021-12-15 00:07:27 +00:00
Paul Holden 4a3290f39d MDL-73380 mod_workshop: add lang string for phase auto switch event. 2021-12-14 21:53:41 +00:00
Ilya Tregubov 696857a008 weekly release 3.11.4+ 2021-12-14 17:42:58 +02:00
Ilya Tregubov f6f44d8360 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-12-14 17:42:56 +02:00
Tien Nguyen cff5ca7c2d MDL-73189 File upload: Fix bug can upload more than maximum no. of files 2021-12-14 15:08:16 +07:00
Víctor Déniz d494218b19 Merge branch 'MDL-73039-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-13 19:31:05 +00:00
Sara Arjona 06eb4fd769 Merge branch 'MDL-69467-311' of https://github.com/sebastianberm/moodle into MOODLE_311_STABLE 2021-12-13 17:34:45 +01:00
Paul Holden 900d4a8039 MDL-73039 course: remove double encoding of course/site for download. 2021-12-13 10:09:10 +00:00
Peter Burnett 0773b6d88a MDL-72375 completion: Remove id from custom rules
The id stored in the default custom rules was the courseid, and would
incorrectly be applied to new activities as the activity id.
2021-12-13 11:52:32 +10:00
AMOS bot 94c4ff2443 Automatically generated installer lang files 2021-12-13 00:07:26 +00:00
AMOS bot 6a959efde8 Automatically generated installer lang files 2021-12-12 00:07:23 +00:00
AMOS bot eee9636851 Automatically generated installer lang files 2021-12-11 00:07:27 +00:00
Ilya Tregubov 0ae57526db Merge branch 'MDL-73278_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-12-10 18:51:59 +02:00
Sebastian Berm b8335d5474 MDL-69467 core_h5p: User uniqueness by id instead of email 2021-12-10 14:37:54 +01:00
Ilya Tregubov b47dec983c weekly release 3.11.4+ 2021-12-10 15:14:37 +02:00
Ilya Tregubov e032566df0 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-12-10 15:14:34 +02:00
AMOS bot c9e2652fa7 Automatically generated installer lang files 2021-12-10 00:07:24 +00:00
Eloy Lafuente (stronk7) cdf933d5c2 Merge branch 'MDL-73201-311-enfix' of https://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-12-09 23:18:16 +01:00
David Mudrák f52d41eeef MDL-73201 lang: Use changed strings in tests, too 2021-12-09 19:58:35 +01:00
Helen Foster a63c76ec70 MDL-73201 lang: Import fixed English strings (en_fix) 2021-12-09 19:58:34 +01:00
Sara Arjona 27f6b7542e Merge branch 'MDL-61554-311' of https://github.com/nwp90/moodle into MOODLE_311_STABLE 2021-12-09 17:51:06 +01:00
Eloy Lafuente (stronk7) 935742572d 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:36:51 +01:00
AMOS bot 513534f7af Automatically generated installer lang files 2021-12-09 00:07:21 +00:00
Daniel Ziegenberg dba6833aa2 MDL-69023 mod_lti: remove superfluous css rule
The mod_lti css rule .path-mod-lti .message conflicts with text
alignment in chats in message an can be removed. The last occurrence
of the css class "message" was deleted from the mod_lti code in 2011
with 036e84c389 (see MDL-30354).

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2021-12-08 19:38:26 +01:00
Eloy Lafuente (stronk7) 3a08925b79 MDL-73278 phpunit: Fix namespaces for the renamed classes
Within the renamed classes in the previous commit, there were a
few incorrect namespace, this commit fixes all them to be
correct component[\api] ones.

Also fix a few incorrect leading backslashes in namespace/use
statements. And tests extending renamed tests.
2021-12-07 23:54:34 +01:00
Eloy Lafuente (stronk7) 2c30590d5d MDL-73278 phpunit: Rename already namespaced classes to match file name
These are the only cases 100% safe to apply the renaming of the
testcase class names to match the file names.

All other cases are not safe, because they are missing namespace
and may enter into name conflicts. Adding namespaces is not as
simple as imagined because it implies to, also, add a good number
of modifications to core. See the issue for more details.
2021-12-07 23:54:34 +01:00
Ilya Tregubov 059e523871 weekly release 3.11.4+ 2021-12-07 14:59:41 +02:00
Ilya Tregubov 9da96dbd6a Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-12-07 14:59:39 +02:00
Andrew Nicols 5dc1b69ef7 Merge branch 'MDL-72796_M311_fix-retry-delay-for-redis-session-cache' of https://github.com/ziegenberg/moodle into MOODLE_311_STABLE 2021-12-07 10:52:06 +08:00
Jun Pataleta 1d16b4b752 Merge branch 'MDL-73202-311' of https://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2021-12-07 10:38:33 +08:00
AMOS bot 8dd9f8482a Automatically generated installer lang files 2021-12-07 00:07:27 +00:00
Nick Phillips c27559d6b2 MDL-61554 calendar: Set $PAGE context in calendar export. 2021-12-07 12:23:32 +13:00
Paul Holden ecde575d00 MDL-73237 check: detect same role overrides in different contexts.
Prevents DML debugging from duplicate values in first field, also
fixes `context` class namespace and removes undefined `localrole`
property of $role object.
2021-12-06 16:23:22 +00:00
Paul Holden edd6f7f401 MDL-73256 tool_oauth2: save requireconfirmation property on create. 2021-12-06 14:28:30 +00:00
Jun Pataleta 092cc5ec3f Merge branch 'MDL-72870-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-06 18:43:14 +08:00
Jun Pataleta 2027f4011a Merge branch 'MDL-73153-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-12-06 17:43:22 +08:00
Brendan Heywood 8bd98c3bd8 MDL-73207 cron: Fixed cronspec field order bug 2021-12-06 17:54:26 +11:00
Shamim Rezaie 6cd7435119 Merge branch 'MDL-73245-311' of https://github.com/cameron1729/moodle into MOODLE_311_STABLE 2021-12-06 17:08:29 +11:00
Cameron Ball 98775c265b MDL-73245 cache: Fix bug with session lock debugging
When session lock debugging and read only sessions deubgging are both
enabled, session lock debugging becomes moot. This patch causes
the session lock deubgging code to exit early if read only sessions
debugging is enabled.
2021-12-06 12:16:19 +08:00
Daniel Ziegenberg 0ad2a91cdd MDL-72796 caching: fix retry delay for redis session cache
The random retry delay for redis session cache was calculated as
rand(100000, 500000) giving an effective retry delay of 100 seconds
to 500 seconds. That's off by a factor of a thousand! Using Redis as a
session cache and when the connection hangs, you can get random
"cannot obtain session lock" errors because it's waiting up to
500 seconds (or about 8.33 minutes) for a Redis connection.
This sets the delay to the originally intended 100ms to 500ms.
(see MDL-59866).

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2021-12-05 17:09:32 +01:00
Eloy Lafuente (stronk7) 09b004629f Merge branch 'MDL-73253-311' of https://github.com/vmdef/moodle into MOODLE_311_STABLE 2021-12-03 18:52:29 +01:00
Víctor Déniz 29994e98de MDL-73253 ci: use setup-node action in GHA 2021-12-03 15:44:58 +00:00
Sara Arjona 0b626ac5e0 weekly release 3.11.4+ 2021-12-03 10:26:32 +01:00
Jun Pataleta 5f28929d64 Merge branch 'MDL-72789-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-03 12:16:48 +08:00
Shamim Rezaie a96887e70a Merge branch 'MDL-68944-311' of https://github.com/juancs/moodle into MOODLE_311_STABLE 2021-12-03 14:54:27 +11:00
Andrew Nicols 24ffb2cf6f Merge branch 'MDL-73195-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2021-12-03 10:14:35 +08:00
Andrew Nicols df0d1ea93a Merge branch 'MDL-72846-311' of https://github.com/NoelDeMartin/moodle into MOODLE_311_STABLE 2021-12-03 08:29:49 +08:00
Eloy Lafuente (stronk7) 3982b8da9d Merge branch 'MDL-72728-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-02 18:57:10 +01:00
Noel De Martin 312c646c48 MDL-72846 testing: Add default block generators 2021-12-02 14:57:51 +01:00
Jun Pataleta 9097a7f414 Merge branch 'MDL-72785-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-02 17:06:15 +08:00
Simey Lameze fda79a220b MDL-73195 mod_url: prevent invalid urls from breaking the course 2021-12-02 16:58:15 +08:00
Andrew Nicols ff396418f7 MDL-73155 qtype_essay: Coding style fix 2021-12-02 14:43:25 +08:00
Andrew Nicols a6e991c75a Merge branch 'MDL-73155_311' of https://github.com/mkassaei/moodle into MOODLE_311_STABLE 2021-12-02 14:43:01 +08:00
Jun Pataleta 8c4cf07c54 Merge branch 'MDL-73142-311' of https://github.com/susyzan/moodle into MOODLE_311_STABLE 2021-12-02 14:30:25 +08:00
Andrew Nicols 3e141207a0 Merge branch 'MDL-73176-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-02 12:09:44 +08:00
Andrew Nicols 28150789b8 Merge branch 'mdl-68199-fix-311' of https://github.com/jaypha/moodle into MOODLE_311_STABLE 2021-12-02 11:55:32 +08:00
Andrew Nicols a71a1a67be Merge branch 'MDL-73205-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-02 11:45:49 +08:00
Andrew Nicols 0c0feb164f Merge branch 'MDL-73070_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-12-02 11:24:29 +08:00
Jason den Dulk bbee1d9e21 MDL-68199 setup: Fix invalid parameters to make_request_directory()
Removed invalid parameters from calls to make_request_directory()

Removing these parameters should have no effect on behaviour.
2021-12-02 07:44:46 +11:00
Eloy Lafuente (stronk7) 248edcf1b0 Merge branch 'MDL-70894-MOODLE_311_STABLE' of https://github.com/yankudriavtsev/moodle into MOODLE_311_STABLE 2021-12-01 19:10:53 +01:00
Eloy Lafuente (stronk7) eff3041098 Merge branch 'MDL-72791-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-12-01 17:13:38 +01:00
Sara Arjona ff285b448f Merge branch 'MDL-73140_311' of https://github.com/timhunt/moodle into MOODLE_311_STABLE 2021-12-01 12:29:53 +01:00
Shamim Rezaie 4307c81b65 Merge branch 'MOODLE_311_STABLE_MDL-59115' of https://github.com/mattporritt/moodle into MOODLE_311_STABLE 2021-12-01 14:53:57 +11:00
Matt Porritt 05127e02e7 MDL-59115 auth_oauth2: Set all mapped field of user
On account creation by Oauth2 all configured mapped user
fields are now saved in the user profile on user creation.

Co-Authored-By: SKOLL Learning Technologies
2021-12-01 03:14:48 +00:00
Paul Holden c092ab42af MDL-72870 mod_quiz: fix attempt navigation button alignment. 2021-11-30 23:21:50 +00:00
Paul Holden 0d99e663aa MDL-73176 forms: escape selector for active autocomplete element. 2021-11-30 20:08:45 +00:00
Eloy Lafuente (stronk7) 4f270213e7 weekly release 3.11.4+ 2021-11-30 19:01:13 +01:00
Eloy Lafuente (stronk7) f1f026cacf Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-11-30 19:01:09 +01:00
Noel De Martin 2d5cdf107c MDL-73202 mod_forum: Add behat generators 2021-11-30 10:07:44 +01:00
Eloy Lafuente (stronk7) fa8cf48660 Merge branch 'MDL-73074-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-11-29 23:15:03 +01:00
Paul Holden b005d5d510 MDL-73205 forms: handle AJAX error in dynamic/modal form submission. 2021-11-29 18:36:38 +00:00
Paul Holden 4d08b631f7 MDL-72789 report_eventlist: improve filtering of report by component.
Instead of performing partial matching on the event component, which
could return false positives, do an exact match.
2021-11-29 09:20:18 +00:00
Jun Pataleta 66c48b3358 Merge branch 'MDL-70274-311-2' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2021-11-29 12:17:18 +08:00
Simey Lameze 228232965b MDL-70274 core: fix Validate HTML and WCAG Check links 2021-11-29 12:11:33 +08:00
AMOS bot 8ed983a254 Automatically generated installer lang files 2021-11-27 00:07:35 +00:00
Paul Holden e61a1e9ec3 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:46 +00:00
Sara Arjona 2fd9b4b822 weekly release 3.11.4+ 2021-11-26 15:25:53 +01:00
Sara Arjona 340196b809 NOBUG: Fixed SVG browser compatibility 2021-11-26 15:25:51 +01:00
Sara Arjona 480b9726f6 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-11-26 15:25:50 +01:00
Mahmoud Kassaei 1ed929a22b MDL-73155 qtype_essay: Errors when Allow attachments is reset to 'No' 2021-11-26 13:55:46 +00:00
Jun Pataleta b1b607f273 Merge branch 'MDL-72443-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-11-25 17:32:01 +08:00
Juan Segarra Montesinos a00045a050 MDL-68944 mod_workshop: Workshop skips scheduled allocation 2021-11-25 09:48:10 +01:00
AMOS bot f4985556b3 Automatically generated installer lang files 2021-11-25 00:07:24 +00:00
Eloy Lafuente (stronk7) c29478fdc6 Merge branch 'MDL-73054-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-11-24 23:57:08 +01:00
Eloy Lafuente (stronk7) 250f6a1b0f Merge branch 'MDL-72988-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-11-24 23:49:52 +01:00
Susanna Zanatta 10eac8c81e MDL-73142 filepicker: improved contrast in allowed file types list
Changed bootstrap class from text-muted to text-dark to bring the
contrast of listed file extensions above the Level AA pass mark.
2021-11-24 16:31:04 +00:00
Sara Arjona 9a21803f8f MDL-73153 badges: get image when it has more data
In some cases, image might have more fields rather than the URL.
This patch is for taking them into account and displaying the image
and also these information properly.
2021-11-24 10:28:07 +01:00
Yan Kudriavtsev 7b3767ec20 MDL-70894 enrol: Fixed return type for count_enrolled_users 2021-11-24 00:04:09 +02:00
Paul Holden 258208056c 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-23 12:29:42 +00:00
Tim Hunt d40a865a2b MDL-73070 Behat: stop using no-longer-existant classes in behat_hooks 2021-11-23 10:59:26 +00:00
Ilya Tregubov 318dbbcb88 weekly release 3.11.4+ 2021-11-23 11:18:57 +02:00
Eloy Lafuente (stronk7) f94adf67d5 Merge branch 'MDL-73128-311' of https://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-11-23 11:37:29 +08:00
Ilya Tregubov 6be3a43c3c Merge branch 'MDL-72967-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2021-11-23 11:37:28 +08:00
Eloy Lafuente (stronk7) d31534bb87 Merge branch 'MDL-73095_311_v3' of https://github.com/TomoTsuyuki/moodle into MOODLE_311_STABLE
Added one extra TEXT column so we have it covered too.
2021-11-23 11:37:28 +08:00
Tim Hunt 42055d95cd MDL-73140 grade history: fix badly formatted lists 2021-11-22 23:51:05 +00:00
Paul Holden b6d4db166b MDL-73054 repository_googledocs: avoid $OUTPUT use in data provider. 2021-11-22 22:32:59 +00:00
Paul Holden 6eb8fe2896 MDL-73054 filter_emoticon: re-factor test data providers.
PHPUnit test dataProvider methods should not modify global state,
such as initializing $OUTPUT, as they can cause failures in
unrelated tests at a distance.
2021-11-22 22:32:48 +00:00
Sara Arjona 7ea7a17fb4 MDL-73128 badges: Fix warning with external badges 2021-11-22 16:32:03 +01:00
Paul Holden 3de2b5527f MDL-73074 forms: ensure autocomplete element is enhanced only once. 2021-11-22 10:25:25 +00:00
Eloy Lafuente (stronk7) bd9c2a4bc2 weekly release 3.11.4+ 2021-11-19 19:15:26 +01:00
Eloy Lafuente (stronk7) 8cb8e0d232 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-11-19 19:15:21 +01:00
Paul Holden ed5f906fbb MDL-72988 mod_lti: improved handling of missing tool endpoint. 2021-11-19 08:28:55 +00:00
Tomo Tsuyuki bbbfa6457f MDL-73095 core_ddl: Fix binary type field check 2021-11-19 12:48:34 +11:00
AMOS bot d0aa76458d Automatically generated installer lang files 2021-11-19 00:07:25 +00:00
Eloy Lafuente (stronk7) 2f7e8aee5a Merge branch 'MDL-71882-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-11-18 23:34:16 +01:00
Sara Arjona 8770bc0898 Merge branch 'MDL-70721-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-11-18 15:22:35 +01:00
Shamim Rezaie a4e8329337 Merge branch 'MDL-72887-M311' of https://github.com/michael-milette/moodle into MOODLE_311_STABLE 2021-11-18 22:37:36 +11:00
Michael Milette 0d0833980a MDL-72887 search: Tooltip added to navbar search icon. 2021-11-18 00:57:37 -05:00
AMOS bot c3db183b64 Automatically generated installer lang files 2021-11-18 00:07:23 +00:00
Jun Pataleta cc049c74c3 Merge branch 'MDL-72925_311_v2' of https://github.com/TomoTsuyuki/moodle into MOODLE_311_STABLE 2021-11-17 16:05:56 +08:00
Ilya Tregubov 7664fd2dc6 Merge branch 'MDL-69496_311' of https://github.com/1JackBlack1/moodle into MOODLE_311_STABLE 2021-11-17 09:02:23 +02:00
Andrew Nicols 5aedafd786 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:41 +08:00
AMOS bot 317c441994 Automatically generated installer lang files 2021-11-17 00:07:28 +00:00
PraiseSatan 4124e8b4bb MDL-69496 quiz: Only validate completion if unlocked
Quiz completion settings are only validated if they are unlocked.
Undefined behaviour in the forms API results in the completion
settings 'require passing grade' and 'completion attempts exhausted'
not being sent to the process options function if completion
settings are locked. This resulted in the completion attempts
exhausted setting being disabled whenever the quiz was saved
as it did not detect the require passing grade setting.
This changes the behaviour so that validation is only performed
if the completion settings are unlocked.
A behat test is included to ensure the setting does not change.
2021-11-17 09:02:51 +11:00
Eloy Lafuente (stronk7) ba28c8f782 weekly release 3.11.4+ 2021-11-16 13:59:57 +01:00
Eloy Lafuente (stronk7) dd78b8f983 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-11-16 13:59:52 +01:00
Tomo Tsuyuki ff274fa59d MDL-72925 mod_forum: Filter discussion when grading 2021-11-16 15:24:50 +11:00
Jun Pataleta 4203758fa8 Merge branch 'MDL-72966-311' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-11-16 11:38:55 +08:00
Faisal Kaleem d0c0a787dd MDL-72967 lib: fix typo in excellib insert_bitmap() method 2021-11-16 10:33:31 +08:00
AMOS bot b884ed5941 Automatically generated installer lang files 2021-11-16 00:07:24 +00:00
Shamim Rezaie bb1be809d1 MDL-70721 output: Remove redundant title
The format_string() function does half html escaping. It escapes < and >
characters, but does not escape ". Therefore, it put us in a situation
where neither {{}}, nor {{{}}} are suitable in templates. If we use {{}}
for an attribute (like title or aria-label), then < and > characters
will be double escaped. On the other hand, if we use {{{}}} there, a
double quote character will break HTML when it is used in an attribute.
Therefore, neither {{}}, nore {{{}}} are usable in html attributes.

Moreover, The title attribute here was redundant because it had the same
value as the link's text.
2021-11-16 10:09:11 +11:00
Shamim Rezaie c587c353c5 MDL-70721 output: remove {{#quote}} wherever it was misused
Also use the new {{#cleanstr}} helper where it was more appropriate
than the {{#str} helper.
2021-11-16 10:09:10 +11:00
Eloy Lafuente (stronk7) 4e66f86add Merge branch 'MDL-72096-311' of https://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2021-11-15 19:13:09 +01:00
Eloy Lafuente (stronk7) c107be7b61 Merge branch 'MDL-72908-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-11-15 18:58:59 +01:00
Paul Holden 23b87ccdd7 MDL-72908 admin: correctly distinguish purging all/selected caches. 2021-11-15 12:20:03 +00:00
Michael Hawkins d5038f41fe 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:47:49 +08:00
Shamim Rezaie 3c9e9efc97 MDL-70721 core: a new mustache helper to clean string after get_string 2021-11-15 22:16:05 +11:00
Thong Bui 6eb4b2d437 MDL-72966 File upload: Uncaught Error from JS when uploading the file 2021-11-15 07:33:28 +07:00
PraiseSatan 8bfe7b0759 MDL-69496 form: Check if element has attributes
Checks if a form element has attributes before
trying to get the default value. This fixes
an error when trying to get the default value
for a frozen group which does not have the
attributes array.
2021-11-15 09:41:54 +11:00
Paul Holden ec0558f5ba MDL-72791 customfield: correct access checks for course search data. 2021-11-12 15:08:49 +00:00
Paul Holden 0efdee5e6e MDL-72443 files: support svg preview as with other image types. 2021-11-12 15:07:09 +00:00
Eloy Lafuente (stronk7) 5d7fa92613 weekly release 3.11.4+ 2021-11-12 13:40:33 +01:00
Eloy Lafuente (stronk7) fc47a37c54 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-11-12 13:40:29 +01:00
Jun Pataleta 4d15d33bee Merge branch 'MDL-61671-311' of git://github.com/jleyva/moodle into MOODLE_311_STABLE 2021-11-12 10:49:08 +08:00
Shamim Rezaie 8f22de6a46 Merge branch 'MDL-60850-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-11-12 13:00:27 +11:00
Jun Pataleta a33234adf2 MDL-60850 mod_lti: Centre-align tool configure form elements 2021-11-12 09:41:49 +08:00
Jun Pataleta 5186a0bef8 Merge branch 'MDL-72982-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-11-11 23:01:23 +08:00
Luuk Verhoeven c8a93bcabe MDL-72982 tool_dataprivacy: add class name to email table 2021-11-11 22:59:05 +08:00
Sara Arjona 2a31eb2aba Merge branch 'MDL-71751-311' of https://github.com/nguyenphuctien/moodle into MOODLE_311_STABLE 2021-11-11 12:44:33 +01:00
Andrew Nicols 0b18f96813 MDL-71751 js: Do not stop propagation on drop, and handle it properly 2021-11-11 15:57:26 +07:00
Jun Pataleta 41624e65d6 Merge branch 'MDL-72552-311' of https://github.com/spvickers/moodle into MOODLE_311_STABLE 2021-11-11 11:42:21 +08:00
Andrew Nicols 34e1739a71 Merge branch 'MDL-73026-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-11-11 11:01:51 +08:00
Eloy Lafuente (stronk7) 8aab9fc84e Merge branch 'MDL-72696-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-11-10 19:21:06 +01:00
Jun Pataleta b68667b9c2 Merge branch 'MDL-72992-311' of git://github.com/cameron1729/moodle into MOODLE_311_STABLE 2021-11-10 18:38:11 +08:00
Juan Leyva b8c4c7694b MDL-61671 tool_mobile: Improve certificate checks
Support different curl implementations and skip last certificate checks in some cases.
2021-11-09 17:06:20 +01:00
AMOS bot 793359862b Automatically generated installer lang files 2021-11-09 00:07:27 +00:00
Sara Arjona 55aa143507 Merge branch 'MDL-72994-311' of https://github.com/lucaboesch/moodle into MOODLE_311_STABLE 2021-11-08 16:38:06 +01:00
Sara Arjona 5cb47da3f1 Merge branch 'MDL-72950_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-11-08 15:33:53 +01:00
Jun Pataleta 528f17d06e MDL-73026 theme: Override Bootstrap modal styles for close button
* Adjust the margins to accommodate the button outline so that it
doesn't look clipped.
* Inherit the opacity when the button receives focus to improve the
focus outline's contrast.
2021-11-08 21:44:35 +08:00
Paul Holden 7b22dff89a 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:25 +00:00
Eloy Lafuente (stronk7) da0f55caa1 MDL-72950 phpunit: Remove skipped tests now that the issue is fixed.
The problem (coincidence of contexts) was detected when running
oracle phpunit tests, so we skipped the tests as part of MDL-72743.

Now, with the problem fixed (previous commit), we can bring back
that test.
2021-11-06 11:06:36 +01:00
Eloy Lafuente (stronk7) 0de172734c MDL-72950 restore: Avoid qcat conflicts with matching contexts
Though it's really rare for this to happen (it only was discovered
when running unit tests with Oracle), it's possible to get
problems restoring courses when context ids in the backup file
do match existing contexts in the restore target site in certain
ways (see the issue for more information).

This change just ensures that every call to the method (that
happens 4 times, for sys, coursecat, course and module levels):

prechek_precheck_qbanks_by_level()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

- xmldom 0.6.0
- grunt 1.4.1
- gherkin-lint 4.2.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

So we are temporarily changing to one fork:

https://github.com/moodlehq/MinkExtension

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

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

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

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

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

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

A new unit test is added to cover this specific scenario. The existing
unit test is modified and it does not expect the exception any more.
There does not seem to be any good reason why this situation should be
exceptional.
2021-05-18 20:56:31 +02:00
Dongsheng Cai 5464f37017 MDL-65203 template: tab should be quoted to produce valid json 2021-05-18 20:42:17 +10:00
AMOS bot 857626bbe1 Automatically generated installer lang files 2021-05-18 00:07:36 +00:00
Paul Holden 113bef8365 MDL-71647 user: allow searching user selector by identity fields.
Fixes regression from d916cd77, which passed empty extra fields when
not including custom fields.
2021-05-17 16:07:39 +01:00
Sara Arjona 536a5a4ac5 Merge branch 'MDL-71638_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2021-05-17 12:44:50 +02:00
Nhan Vo 7981b16046 MDL-71047 HTML Editor (Atto): Cursor position is not correct when paste 2021-05-17 14:22:53 +07:00
Eloy Lafuente (stronk7) b23a50a063 MDL-71638 upgrade: add 3.10.0 separation line to all upgrade scripts 2021-05-16 00:00:43 +02:00
Luca Bösch 0c3a643182 MDL-71373 core_enrol: localize "close" in role manager. 2021-05-14 14:17:47 +02:00
Luca Bösch c9be7c7c5b MDL-71373 tool_usertours: localize "previous"/"next" in user tours. 2021-05-14 14:17:47 +02:00
Luca Bösch 280ec710c7 MDL-71373 core_table: localize "previous"/"next" in pagination. 2021-05-14 14:17:47 +02:00
Huong Nguyen c08dab048b MDL-71126 Quiz: Manual grading page size preference can get stuck at 0
Including in this change:
 - New positiveint regex rule to check if the value is a positive integer
2021-05-14 17:02:28 +07:00
Sara Arjona 2864b51c7b MDL-67935 tool_lp: fix random errors with login/logout 2021-05-14 10:53:13 +02:00
Paul Holden e16b41d630 MDL-71626 admin: filter site fullname in CLI maintenance script. 2021-05-13 20:27:58 +01:00
Paul Holden 9d5b74865f MDL-71619 privacy: extend correct class in provider testcases.
Extending the privacy provider testcase means that it's tearDown
method will reset the request writer.
2021-05-13 20:25:03 +01:00
Peter Burnett 49e201b592 MDL-70233 cache: Disabled factory now gets writer from parent 2021-04-07 15:33:07 +10:00
Andrew Nicols eee0b6865c MDL-71159 output: Do not run content prefetch during install 2021-03-22 13:15:26 +08:00
3748 changed files with 64497 additions and 40264 deletions
-96
View File
@@ -1,96 +0,0 @@
# Generated by "grunt ignorefiles"
!/.grunt
*/**/yui/src/*/meta/
*/**/build/
node_modules/
vendor/
admin/tool/policy/amd/src/jquery-eu-cookie-law-popup.js
auth/cas/CAS/
cache/stores/mongodb/MongoDB/
enrol/lti/ims-blti/
filter/algebra/AlgParser.pm
filter/tex/mimetex.*
h5p/h5plib/v124/joubel/core/
h5p/h5plib/v124/joubel/editor/
lib/editor/atto/plugins/html/yui/src/codemirror/
lib/editor/atto/plugins/html/yui/src/beautify/
lib/editor/atto/yui/src/rangy/js/*.*
lib/editor/tinymce/plugins/pdw/tinymce/
lib/editor/tinymce/plugins/spellchecker/rpc.php
lib/editor/tinymce/tiny_mce/
lib/mlbackend/php/phpml/
lib/adodb/
lib/behat/axe/
lib/bennu/
lib/evalmath/
lib/phpspreadsheet/
lib/google/
lib/htmlpurifier/
lib/jabber/
lib/minify/matthiasmullie-minify/
lib/minify/matthiasmullie-pathconverter/
lib/pear/HTML/Common.php
lib/pear/HTML/QuickForm.php
lib/pear/HTML/QuickForm/
lib/pear/PEAR.php
lib/phpmailer/
lib/simplepie/
lib/tcpdf/
lib/typo3/
lib/yuilib/
lib/yuilib/gallery/
lib/jquery/
lib/html2text/
lib/markdown/
lib/xhprof/
lib/horde/
lib/requirejs/
lib/amd/src/loglevel.js
lib/mustache/
lib/amd/src/mustache.js
lib/graphlib.php
lib/php-css-parser/
lib/rtlcss/
lib/scssphp/
lib/spout/
lib/amd/src/chartjs-lazy.js
lib/maxmind/GeoIp2/
lib/maxmind/MaxMind/
lib/ltiprovider/
lib/amd/src/truncate.js
lib/fonts/
lib/amd/src/adapter.js
lib/validateurlsyntax.php
lib/amd/src/popper.js
lib/geopattern-php/
lib/php-jwt/
lib/babel-polyfill/
lib/polyfills/
lib/emoji-data/
lib/plist/
lib/zipstream/
lib/php-enum/
lib/http-message/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js
media/player/videojs/videojs/
media/player/videojs/amd/src/videojs-flash-lazy.js
media/player/videojs/videojs/video-js.swf
mod/assign/feedback/editpdf/fpdi/
repository/s3/S3.php
theme/boost/scss/bootstrap/
theme/boost/amd/src/bootstrap/alert.js
theme/boost/amd/src/bootstrap/button.js
theme/boost/amd/src/bootstrap/carousel.js
theme/boost/amd/src/bootstrap/collapse.js
theme/boost/amd/src/bootstrap/dropdown.js
theme/boost/amd/src/bootstrap/modal.js
theme/boost/amd/src/bootstrap/popover.js
theme/boost/amd/src/bootstrap/tools/sanitizer.js
theme/boost/amd/src/bootstrap/scrollspy.js
theme/boost/amd/src/bootstrap/tab.js
theme/boost/amd/src/bootstrap/toast.js
theme/boost/amd/src/bootstrap/tooltip.js
theme/boost/amd/src/bootstrap/util.js
theme/boost/amd/src/index.js
theme/boost/scss/fontawesome/
+65 -6
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,18 +200,34 @@
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off'
'no-unused-expressions': 'off',
// === JSDocs ===
"jsdoc/check-access": 'off',
"jsdoc/check-alignment": 'off',
"jsdoc/check-param-names": 'off',
"jsdoc/check-property-names": 'off',
"jsdoc/empty-tags": 'off',
"jsdoc/implements-on-classes": 'off',
"jsdoc/multiline-blocks": 'off',
"jsdoc/require-jsdoc": 'off',
"jsdoc/require-param": 'off',
"jsdoc/require-param-name": 'off',
"jsdoc/require-param-type": 'off',
"jsdoc/require-property": 'off',
"jsdoc/require-property-name": 'off',
"jsdoc/require-property-type": 'off',
}
},
{
files: ["**/amd/src/*.js", "**/amd/src/**/*.js", "Gruntfile.js", ".grunt/*.js", ".grunt/tasks/*.js"],
files: ["**/amd/src/*.js", "**/amd/src/**/*.js", "Gruntfile.js", ".grunt/*.js", ".grunt/tasks/*.js", "jsdoc.conf.js"],
// We support es6 now. Woot!
env: {
es6: true
},
// 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
+4
View File
@@ -26,6 +26,7 @@
/cscope.*
/.patches/
/.idea/
.phpstorm.*
/nbproject/
CVS
.DS_Store
@@ -47,3 +48,6 @@ atlassian-ide-plugin.xml
/node_modules/
/.vscode/
moodle-plugin-ci.phar
.eslintignore
.stylelintignore
/jsdoc
@@ -111,8 +111,22 @@ module.exports = ({template, types}) => {
if (!this.seenDefine && path.get('callee').isIdentifier({name: 'define'})) {
// We only want to modify the first instance of define that we find.
this.seenDefine = true;
// Get the Moodle component for the file being processed.
var moduleName = getModuleNameFromFileName(this.file.opts.filename);
// The function signature of `define()` is:
// define = function (name, deps, callback) {...}
// Ensure that if the moduel supplied its own name that it is replaced.
if (path.node.arguments.length > 0) {
// Ensure that there is only one name.
if (path.node.arguments[0].type === 'StringLiteral') {
// eslint-disable-next-line
console.log(`Replacing module name '${path.node.arguments[0].extra.rawValue}' with ${moduleName}`);
path.node.arguments.shift();
}
}
// Add the module name as the first argument to the define function.
path.node.arguments.unshift(types.stringLiteral(moduleName));
// Add a space after the define function in the built file so that previous versions
+19
View File
@@ -0,0 +1,19 @@
# Moodle JavaScript Documentation
```
.-..-.
_____ | || |
/____/-.---_ .---. .---. .-.| || | .---.
| | _ _ |/ _ \/ _ \/ _ || |/ __ \
* | | | | | || |_| || |_| || |_| || || |___/
|_| |_| |_|\_____/\_____/\_____||_|\_____)
Moodle - the world's open source learning platform
```
## About
This generated documentation includes API documentation for JavaScript written in the AMD and ES2015 module formats within Moodle.
## Related information
See [https://docs.moodle.org/dev](https://docs.moodle.org/dev) for other related Developer Documentation.
+131
View File
@@ -0,0 +1,131 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Helper functions for working with Moodle component names, directories, and sources.
*
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
// Do not include any plugins as stanard.
const plugins = [];
plugins.push('plugins/markdown');
/**
* Get the source configuration.
*
* @return {Object}
*/
const getSource = () => {
const glob = require('glob');
const path = require('path');
const ComponentList = require(path.resolve('.grunt/components.js'));
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
const source = {
include: [],
includePattern: ".+\\.js$",
};
let includeList = [];
ComponentList.getAmdSrcGlobList().forEach(async pattern => {
includeList.push(...glob.sync(pattern));
});
const cwdLength = process.cwd().length + 1;
includeList.forEach(path => {
if (source.include.indexOf(path) !== -1) {
// Ensure no duplicates.
return;
}
const relPath = path.substring(cwdLength);
if (thirdPartyPaths.indexOf(relPath) !== -1) {
return;
}
source.include.push(path);
});
source.include.push('.grunt/jsdoc/README.md');
return source;
};
const tags = {
// Allow the use of unknown tags.
// We have a lot of legacy uses of these.
allowUnknownTags: true,
// We make use of jsdoc and closure dictionaries as standard.
dictionaries: [
'jsdoc',
'closure',
],
};
// Template configuraiton.
const templates = {
cleverLinks: false,
monospaceLinks: false,
};
module.exports = {
opts: {
destination: "./jsdoc/",
template: "node_modules/docdash",
},
plugins,
recurseDepth: 10,
source: getSource(),
sourceType: 'module',
tags,
templates,
docdash: {
collapse: true,
search: true,
sort: true,
sectionOrder: [
"Namespaces",
"Modules",
"Events",
"Classes",
"Externals",
"Mixins",
"Tutorials",
"Interfaces"
],
"menu": {
"Developer Docs": {
href: "https://docs.moodle.org/dev",
target: "_blank",
"class": "menu-item",
id: "devdocs"
},
"MDN Docs": {
href: "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
target: "_blank",
"class": "menu-item",
id: "mdndocs",
},
},
typedefs: true,
},
};
+1
View File
@@ -49,6 +49,7 @@ module.exports = grunt => {
'**/yui/build/*',
'theme/boost/style/moodle.css',
'theme/classic/style/moodle.css',
'jsdoc/styles/*.css',
].concat(thirdPartyPaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n') + '\n');
};
+125 -44
View File
@@ -30,6 +30,7 @@
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
*/
const babelRename = function(destPath, srcPath) {
destPath = srcPath.replace('src', 'build');
destPath = destPath.replace('.js', '.min.js');
@@ -37,75 +38,155 @@ const babelRename = function(destPath, srcPath) {
};
module.exports = grunt => {
// Load the Ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Shifter tasks.
require('./shifter')(grunt);
// Load ESLint.
require('./eslint')(grunt);
// Load JSDoc.
require('./jsdoc')(grunt);
const path = require('path');
// Register JS tasks.
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
grunt.registerTask('amd', ['eslint:amd', 'babel']);
grunt.registerTask('amd', ['ignorefiles', 'eslint:amd', 'rollup']);
grunt.registerTask('js', ['amd', 'yui']);
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-rollup');
// Load the Babel tasks and config.
grunt.loadNpmTasks('grunt-babel');
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;
grunt.config.merge({
babel: {
rollup: {
options: {
sourceMaps: true,
comments: false,
format: 'esm',
dir: 'output',
sourcemap: true,
treeshake: false,
context: 'window',
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('.grunt/babel-plugin-add-module-to-define.js'),
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', {'loose': false}],
'@babel/plugin-proposal-json-strings'
rateLimit(),
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('.grunt/babel-plugin-add-module-to-define.js'),
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', {'loose': false}],
'@babel/plugin-proposal-json-strings'
],
presets: [
['@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,
}),
],
presets: [
['minify', {
// This minification plugin needs to be disabled because it breaks the
// source map generation and causes invalid source maps to be output.
simplify: false,
builtIns: false
}],
['@babel/preset-env', {
targets: {
browsers: [
">0.25%",
"last 2 versions",
"not ie <= 10",
"not op_mini all",
"not Opera > 0",
"not dead"
]
},
modules: false,
useBuiltIns: false
}]
]
},
dist: {
files: [{
expand: true,
src: grunt.moodleEnv.files ? grunt.moodleEnv.files : grunt.moodleEnv.amdSrc,
rename: babelRename
}]
}
}],
},
},
});
@@ -126,7 +207,7 @@ module.exports = grunt => {
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('babel.dist.files', [{expand: true, src: files, rename: babelRename}]);
grunt.config('rollup.dist.files', [{expand: true, src: files, rename: babelRename}]);
changedFiles = Object.create(null);
}, 200);
+36
View File
@@ -0,0 +1,36 @@
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
// Project configuration.
grunt.config.merge({
jsdoc: {
dist: {
options: {
configure: ".grunt/jsdoc/jsdoc.conf.js",
},
},
},
});
grunt.loadNpmTasks('grunt-jsdoc');
};
+3
View File
@@ -21,6 +21,9 @@
*/
module.exports = grunt => {
// Load the ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Style Lint tasks.
require('./stylelint')(grunt);
+3 -1
View File
@@ -125,8 +125,9 @@ module.exports = grunt => {
grunt.config.merge(getScssConfigForFiles(scssFiles));
scssTasks.unshift('stylelint:scss');
}
scssTasks.unshift('ignorefiles');
const cssTasks = [];
const cssTasks = ['ignorefiles'];
if (hasCss) {
grunt.config.merge(getCssConfigForFiles(cssFiles));
cssTasks.push('stylelint:css');
@@ -169,6 +170,7 @@ module.exports = grunt => {
excludes: [
'**/moodle.css',
'**/editor.css',
'jsdoc/styles/*.css',
],
tasks: ['rawcss']
},
+1 -1
View File
@@ -1 +1 @@
v14.15.0
lts/gallium
-96
View File
@@ -1,96 +0,0 @@
# Generated by "grunt ignorefiles"
**/yui/build/*
theme/boost/style/moodle.css
theme/classic/style/moodle.css
node_modules/
vendor/
admin/tool/policy/amd/src/jquery-eu-cookie-law-popup.js
auth/cas/CAS/
cache/stores/mongodb/MongoDB/
enrol/lti/ims-blti/
filter/algebra/AlgParser.pm
filter/tex/mimetex.*
h5p/h5plib/v124/joubel/core/
h5p/h5plib/v124/joubel/editor/
lib/editor/atto/plugins/html/yui/src/codemirror/
lib/editor/atto/plugins/html/yui/src/beautify/
lib/editor/atto/yui/src/rangy/js/*.*
lib/editor/tinymce/plugins/pdw/tinymce/
lib/editor/tinymce/plugins/spellchecker/rpc.php
lib/editor/tinymce/tiny_mce/
lib/mlbackend/php/phpml/
lib/adodb/
lib/behat/axe/
lib/bennu/
lib/evalmath/
lib/phpspreadsheet/
lib/google/
lib/htmlpurifier/
lib/jabber/
lib/minify/matthiasmullie-minify/
lib/minify/matthiasmullie-pathconverter/
lib/pear/HTML/Common.php
lib/pear/HTML/QuickForm.php
lib/pear/HTML/QuickForm/
lib/pear/PEAR.php
lib/phpmailer/
lib/simplepie/
lib/tcpdf/
lib/typo3/
lib/yuilib/
lib/yuilib/gallery/
lib/jquery/
lib/html2text/
lib/markdown/
lib/xhprof/
lib/horde/
lib/requirejs/
lib/amd/src/loglevel.js
lib/mustache/
lib/amd/src/mustache.js
lib/graphlib.php
lib/php-css-parser/
lib/rtlcss/
lib/scssphp/
lib/spout/
lib/amd/src/chartjs-lazy.js
lib/maxmind/GeoIp2/
lib/maxmind/MaxMind/
lib/ltiprovider/
lib/amd/src/truncate.js
lib/fonts/
lib/amd/src/adapter.js
lib/validateurlsyntax.php
lib/amd/src/popper.js
lib/geopattern-php/
lib/php-jwt/
lib/babel-polyfill/
lib/polyfills/
lib/emoji-data/
lib/plist/
lib/zipstream/
lib/php-enum/
lib/http-message/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js
media/player/videojs/videojs/
media/player/videojs/amd/src/videojs-flash-lazy.js
media/player/videojs/videojs/video-js.swf
mod/assign/feedback/editpdf/fpdi/
repository/s3/S3.php
theme/boost/scss/bootstrap/
theme/boost/amd/src/bootstrap/alert.js
theme/boost/amd/src/bootstrap/button.js
theme/boost/amd/src/bootstrap/carousel.js
theme/boost/amd/src/bootstrap/collapse.js
theme/boost/amd/src/bootstrap/dropdown.js
theme/boost/amd/src/bootstrap/modal.js
theme/boost/amd/src/bootstrap/popover.js
theme/boost/amd/src/bootstrap/tools/sanitizer.js
theme/boost/amd/src/bootstrap/scrollspy.js
theme/boost/amd/src/bootstrap/tab.js
theme/boost/amd/src/bootstrap/toast.js
theme/boost/amd/src/bootstrap/tooltip.js
theme/boost/amd/src/bootstrap/util.js
theme/boost/amd/src/index.js
theme/boost/scss/fontawesome/
+1 -1
View File
@@ -10,7 +10,7 @@ language: php
os: linux
dist: xenial
dist: bionic
services:
- mysql
+5
View File
@@ -158,4 +158,9 @@ echo $outputhtml;
echo html_writer::end_tag('fieldset');
echo html_writer::end_tag('form');
$PAGE->requires->yui_module('moodle-core-formchangechecker', 'M.core_formchangechecker.init', [[
'formid' => 'adminsettings'
]]);
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
echo $OUTPUT->footer();
+3 -1
View File
@@ -126,6 +126,7 @@ class filesize extends \admin_setting {
if (is_null($bytes)) {
return null;
}
$bytes = intval($bytes);
return self::parse_bytes($bytes);
}
@@ -145,9 +146,10 @@ class filesize extends \admin_setting {
return get_string('errorsetting', 'admin');
}
// Calculate size in bytes, ensuring we don't overflow PHP_INT_MAX.
$bytes = $data['v'] * $data['u'];
$result = (is_int($bytes) && $this->config_write($this->name, $bytes));
$result = $this->config_write($this->name, $bytes);
return ($result ? '' : get_string('errorsetting', 'admin'));
}
+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);
}
+200
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">
@@ -3531,4 +3541,194 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.0" requires="3.6">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="10" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="optional"/>
<PHP_EXTENSION name="exif" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
<FEEDBACK>
<ON_CHECK message="iscustomadminwarnings" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+2 -3
View File
@@ -38,12 +38,11 @@ $form = new core_admin\form\purge_caches(null, ['returnurl' => $returnurl]);
if ($data = $form->get_data()) {
// Valid request. Purge, and redirect the user back to where they came from.
$selected = $data->purgeselectedoptions;
purge_caches($selected);
if (isset($data->all)) {
purge_caches();
$message = get_string('purgecachesfinished', 'admin');
} else {
purge_caches($data->purgeselectedoptions);
$message = get_string('purgeselectedcachesfinished', 'admin');
}
+48
View File
@@ -0,0 +1,48 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Endpoint to get the Moodle version
*
* Moodle linkchecker will check this endpoint when it cannot get the Moodle version otherwise.
*
* @package core
* @copyright 2022 Victor Deniz <victor@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir . '/filelib.php');
// Get public key.
$key = download_file_content(HUB_STATSPUBLICKEY);
// Check $key is a valid public key.
$publickey = openssl_pkey_get_public($key);
if ($publickey !== false) {
$publickeystr = openssl_pkey_get_details($publickey)['key'];
} else {
die('Error getting a valid public key');
}
// Encrypt data.
$message = $CFG->release;
$success = openssl_public_encrypt(utf8_encode($message), $encrypteddata, $publickeystr);
if ($success) {
echo base64_encode($encrypteddata);
} else {
die ('Error encrypting the data');
}
+27 -16
View File
@@ -220,7 +220,7 @@ class core_admin_renderer extends plugin_renderer_base {
$output .= $this->container_end();
}
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
$button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get', true);
$button->class = 'continuebutton';
$output .= $this->render($button);
$output .= $this->footer();
@@ -1616,12 +1616,18 @@ class core_admin_renderer extends plugin_renderer_base {
$plugininfo = $pluginman->get_plugins();
$numtotal = $numextension = $numupdatable = 0;
$numtotal = $numextension = $numupdatable = $numinstallable = 0;
foreach ($plugininfo as $type => $plugins) {
foreach ($plugins as $name => $plugin) {
if ($plugin->available_updates()) {
if ($res = $plugin->available_updates()) {
$numupdatable++;
foreach ($res as $updateinfo) {
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason, false)) {
$numinstallable++;
break;
}
}
}
if ($plugin->get_status() === core_plugin_manager::PLUGIN_STATUS_MISSING) {
continue;
@@ -1664,16 +1670,13 @@ class core_admin_renderer extends plugin_renderer_base {
$out .= $this->output->heading(get_string('overviewext', 'core_plugin'), 3);
}
if ($numupdatable) {
$installableupdates = $pluginman->filter_installable($pluginman->available_updates());
if ($installableupdates) {
$out .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', count($installableupdates)),
'post',
array('class' => 'singlebutton updateavailableinstallall')
);
}
if ($numinstallable) {
$out .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdatex' => 1)),
get_string('updateavailableinstallall', 'core_admin', $numinstallable),
'post',
array('class' => 'singlebutton updateavailableinstallall')
);
}
$out .= html_writer::div($infoall, 'info info-all').
@@ -1907,7 +1910,7 @@ class core_admin_renderer extends plugin_renderer_base {
'infos'
);
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason)) {
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason, false)) {
$box .= $this->output->single_button(
new moodle_url($this->page->url, array('installupdate' => $updateinfo->component,
'installupdateversion' => $updateinfo->version)),
@@ -2127,8 +2130,16 @@ class core_admin_renderer extends plugin_renderer_base {
$output .= $this->container_start('upgradekeyreq');
$output .= $this->heading(get_string('upgradekeyreq', 'core_admin'));
$output .= html_writer::start_tag('form', array('method' => 'POST', 'action' => $url));
$output .= html_writer::empty_tag('input', array('name' => 'upgradekey', 'type' => 'password'));
$output .= html_writer::empty_tag('input', array('value' => get_string('submit'), 'type' => 'submit'));
$output .= html_writer::empty_tag('input', [
'name' => 'upgradekey',
'type' => 'password',
'class' => 'form-control w-auto',
]);
$output .= html_writer::empty_tag('input', [
'type' => 'submit',
'value' => get_string('submit'),
'class' => 'btn btn-primary mt-3',
]);
$output .= html_writer::end_tag('form');
$output .= $this->container_end();
$output .= $this->footer();
+2 -1
View File
@@ -163,7 +163,8 @@ if (!empty($capabilities)) {
echo html_writer::start_tag('div', array('class'=>'submit_buttons'));
$attrs = array('type'=>'submit', 'name'=>'savechanges', 'value'=>get_string('savechanges'), 'class'=>'btn btn-primary');
echo html_writer::empty_tag('input', $attrs);
$attrs = array('type'=>'submit', 'name'=>'cancel', 'value'=>get_string('cancel'), 'class' => 'btn btn-secondary');
$attrs = array('type' => 'submit', 'name' => 'cancel', 'value' => get_string('cancel'),
'class' => 'btn btn-secondary ml-1');
echo html_writer::empty_tag('input', $attrs);
echo html_writer::end_tag('div');
echo html_writer::end_tag('div');
@@ -22,16 +22,17 @@
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_role\privacy;
defined('MOODLE_INTERNAL') || die();
use \core_role\privacy\provider;
use \core_privacy\local\request\approved_contextlist;
use \core_privacy\local\request\writer;
use \core_privacy\tests\provider_testcase;
use \core_privacy\local\request\transform;
use \tool_cohortroles\api;
use \core_privacy\local\request\approved_userlist;
use core_role\privacy\provider;
use core_privacy\local\request\approved_contextlist;
use core_privacy\local\request\writer;
use core_privacy\tests\provider_testcase;
use core_privacy\local\request\transform;
use tool_cohortroles\api;
use core_privacy\local\request\approved_userlist;
/**
* Privacy test for core_role
@@ -39,7 +40,7 @@ use \core_privacy\local\request\approved_userlist;
* @copyright 2018 Carlos Escobedo <carlos@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_role_privacy_testcase extends provider_testcase {
class provider_test extends provider_testcase {
/**
* Test to check export_user_preferences.
* returns user preferences data.
+2 -1
View File
@@ -38,7 +38,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
// "debugging" settingpage
$temp = new admin_settingpage('debugging', new lang_string('debugging', 'admin'));
$temp->add(new admin_setting_special_debug());
$temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'), new lang_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
$temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'),
new lang_string('configdebugdisplay', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('perfdebug', new lang_string('perfdebug', 'admin'), new lang_string('configperfdebug', 'admin'), '7', '15', '7'));
$temp->add(new admin_setting_configcheckbox('debugstringids', new lang_string('debugstringids', 'admin'), new lang_string('debugstringids_desc', 'admin'), 0));
$temp->add(new admin_setting_configselect('debugsqltrace',
+3
View File
@@ -231,6 +231,9 @@ if ($hassiteconfig) {
array('0' => new lang_string('none'), '1' => new lang_string('allfiles'), '2' => new lang_string('htmlfilesonly')));
$items[] = new admin_setting_configcheckbox('filtermatchoneperpage', new lang_string('filtermatchoneperpage', 'admin'), new lang_string('configfiltermatchoneperpage', 'admin'), 0);
$items[] = new admin_setting_configcheckbox('filtermatchonepertext', new lang_string('filtermatchonepertext', 'admin'), new lang_string('configfiltermatchonepertext', 'admin'), 0);
$items[] = new admin_setting_configcheckbox('filternavigationwithsystemcontext',
new lang_string('filternavigationwithsystemcontext', 'admin'),
new lang_string('configfilternavigationwithsystemcontext', 'admin'), 0);
foreach ($items as $item) {
$item->set_updatedcallback('reset_text_filters_cache');
$temp->add($item);
@@ -48,6 +48,6 @@
</div>
<input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="form-control text-ltr" {{#readonly}}disabled{{/readonly}}>
{{#haspreviewconfig}}
<input type="button" id="{{id}}_preview" value={{#quote}}{{#str}}preview{{/str}}{{/quote}} class="admin_colourpicker_preview">
<input type="button" id="{{id}}_preview" value="{{#cleanstr}}preview{{/cleanstr}}" class="admin_colourpicker_preview">
{{/haspreviewconfig}}
</div>
+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.
+9
View File
@@ -48,3 +48,12 @@ Feature: An administrator can browse user accounts
| User Two | Tree | Defence |
And I should not see "Email address" in the "table" "css_element"
And I should not see "one@example.com"
Scenario: Sort user accounts by custom profile field
Given the following config values are set as admin:
| showuseridentity | profile_field_frog |
When I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "Favourite frog"
Then "Kermit" "text" should appear before "Tree" "text"
And I follow "Favourite frog"
Then "Tree" "text" should appear before "Kermi" "text"
+1 -1
View File
@@ -30,7 +30,7 @@ Feature: Manage external services tokens
And I press "Delete"
And "Firstname1 Lastname1" "table_row" should not exist
@javascript
@javascript @skip_chrome_zerosize
Scenario: Tokens can be filtered by user and by service
Given the following "core_webservice > Service" exists:
| name | Site information |
+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":"AAwBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,oBAAvB,CAA6C,mBAA7C,CAAD,CAAoE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+BC,CAA/B,CAA6C,CAEnH,MAAoD,CAShDC,QAAQ,CAAE,kBAASC,CAAT,CAAaC,CAAb,CAAmB,CAEzB,GAAIC,CAAAA,CAAI,CAAGP,CAAC,CAAC,wBAAyBK,CAAzB,CAA8B,KAA/B,CAAZ,CACAJ,CAAG,CAACO,UAAJ,CAAe,SAAf,CAA0B,gBAA1B,EAA4CC,IAA5C,CAAiD,SAASC,CAAT,CAAqB,CAElE,GAAIC,CAAAA,CAAQ,CAAGX,CAAC,CAAC,MAAD,CAAhB,CACAM,CAAI,CAACM,OAAL,CAAa,SAASC,CAAT,CAAe,CACxBF,CAAQ,CAACG,MAAT,CAAgB,OAASD,CAAT,CAAgB,OAAhC,CACH,CAFD,EAGAF,CAAQ,CAACG,MAAT,CAAgB,OAAhB,EAEA,MAAOZ,CAAAA,CAAY,CAACa,MAAb,CAAoB,CACvBC,KAAK,CAAEN,CADgB,CAEvBO,IAAI,CAAEN,CAAQ,CAACO,IAAT,EAFiB,CAGvBC,KAAK,GAHkB,CAApB,CAIJZ,CAJI,CAMV,CAdD,EAcGa,KAdH,CAcSjB,CAAY,CAACkB,SAdtB,CAeH,CA3B+C,CA6BvD,CA/BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Shows a dialogue with info about this logs.\n *\n * @module tool_analytics/log_info\n * @class log_info\n * @package tool_analytics\n * @copyright 2017 David Monllao {@link http://www.davidmonllao.com}\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], function($, str, ModalFactory, Notification) {\n\n return /** @alias module:tool_analytics/log_info */ {\n\n /**\n * Prepares a modal info for a log's results.\n *\n * @method loadInfo\n * @param {int} id\n * @param {string[]} info\n */\n loadInfo: function(id, info) {\n\n var link = $('[data-model-log-id=\"' + id + '\"]');\n str.get_string('loginfo', 'tool_analytics').then(function(langString) {\n\n var bodyInfo = $(\"<ul>\");\n info.forEach(function(item) {\n bodyInfo.append('<li>' + item + '</li>');\n });\n bodyInfo.append(\"</ul>\");\n\n return ModalFactory.create({\n title: langString,\n body: bodyInfo.html(),\n large: true,\n }, link);\n\n }).catch(Notification.exception);\n }\n };\n});\n"],"file":"log_info.min.js"}
{"version":3,"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":"AAyBAA,OAAM,qCAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAE9C,MAA8D,CAE1DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAQ,CAAG,EAAf,CACA,GAAIL,CAAC,CAACM,OAAF,CAAUF,CAAV,CAAJ,CAAwB,CACpBJ,CAAC,CAACO,IAAF,CAAOH,CAAP,CAAgB,SAASI,CAAT,CAAgBC,CAAhB,CAAyB,CACrCJ,CAAQ,CAACK,IAAT,CAAc,CACVC,KAAK,CAAEF,CAAO,CAACG,EADL,CAEVC,KAAK,CAAEJ,CAAO,CAACK,IAFL,CAAd,CAIH,CALD,EAMA,MAAOT,CAAAA,CAEV,CATD,IASO,CACH,MAAOD,CAAAA,CACV,CACJ,CAhByD,CAkB1DW,SAAS,CAAE,mBAASZ,CAAT,CAAmBa,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAG/CC,CAAO,CAAGpB,CAAC,CAACG,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,SAAjB,GAA+B,IAHM,CAInDF,CAAO,CAAGlB,CAAI,CAACqB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,mCADK,CAEjBC,IAAI,CAAE,CACFR,KAAK,CAAEA,CADL,CAEFI,OAAO,CAAEA,CAFP,CAFW,CAAD,CAAV,CAAV,CAQAD,CAAO,CAAC,CAAD,CAAP,CAAWM,IAAX,CAAgBR,CAAhB,EAAyBS,IAAzB,CAA8BR,CAA9B,CACH,CA/ByD,CAmCjE,CArCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Potential contexts selector module.\n *\n * @module tool_analytics/potential-contexts\n * @class potential-contexts\n * @package tool_analytics\n * @copyright 2019 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n return /** @alias module:tool_analytics/potential-contexts */ {\n\n processResults: function(selector, results) {\n var contexts = [];\n if ($.isArray(results)) {\n $.each(results, function(index, context) {\n contexts.push({\n value: context.id,\n label: context.name\n });\n });\n return contexts;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n let modelid = $(selector).attr('modelid') || null;\n promise = Ajax.call([{\n methodname: 'tool_analytics_potential_contexts',\n args: {\n query: query,\n modelid: modelid\n }\n }]);\n\n promise[0].then(success).fail(failure);\n }\n\n };\n\n});\n"],"file":"potential-contexts.min.js"}
{"version":3,"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"}
-2
View File
@@ -17,8 +17,6 @@
* Shows a dialogue with info about this logs.
*
* @module tool_analytics/log_info
* @class log_info
* @package tool_analytics
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -17,8 +17,6 @@
* Potential contexts selector module.
*
* @module tool_analytics/potential-contexts
* @class potential-contexts
* @package tool_analytics
* @copyright 2019 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+1 -1
View File
@@ -137,7 +137,7 @@ if (!empty($validdatasets) && !$model->is_enabled() && $options['non-interactive
}
// Refresh the instance to prevent unexpected issues.
$model = new \core_analytics\model($modelobj);
$model = new \core_analytics\model($options['modelid']);
// Set the time splitting method file and enable it.
$model->enable($input);
@@ -24,13 +24,17 @@
* @since Moodle 3.8
*/
namespace tool_analytics\external;
use externallib_advanced_testcase;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/webservice/tests/helpers.php');
require_once(__DIR__ . '/../../../../analytics/tests/fixtures/test_indicator_max.php');
require_once(__DIR__ . '/../../../../analytics/tests/fixtures/test_target_course_level_shortname.php');
require_once($CFG->dirroot . '/analytics/tests/fixtures/test_indicator_max.php');
require_once($CFG->dirroot . '/analytics/tests/fixtures/test_target_course_level_shortname.php');
/**
* Tool analytics external functions tests
@@ -41,7 +45,7 @@ require_once(__DIR__ . '/../../../../analytics/tests/fixtures/test_target_course
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since Moodle 3.8
*/
class tool_analytics_external_testcase extends externallib_advanced_testcase {
class external_test extends externallib_advanced_testcase {
/**
* test_potential_contexts description
@@ -73,7 +77,7 @@ class tool_analytics_external_testcase extends externallib_advanced_testcase {
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
$this->expectException(required_capability_exception::class);
$this->expectException(\required_capability_exception::class);
$this->assertCount(2, \tool_analytics\external::potential_contexts());
}
}
@@ -48,7 +48,7 @@ Feature: Verify that all form fields values can be get and set
And the "Unenrol users" select box should not contain "Baker"
And the "Unenrol users" select box should not contain "President, Baker"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I press "Create page"
# Text (textarea & editor) & Select (multi-select) - Checking "I set the following fields to these values".
When I set the following fields to these values:
@@ -61,8 +61,7 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" ticked.
And I set the field "Force format" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value "1"
@@ -70,8 +69,7 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Force format" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value ""
@@ -80,8 +78,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
@@ -92,8 +89,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
@@ -126,14 +122,13 @@ Feature: Verify that all form fields values can be get and set
| section | 1 |
| allowupdate | 1 |
And I am on "Course 1" course homepage
And I follow "Test choice name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And I set the field "Option 1" to "one"
And I set the field "Option 2" to "two"
And I set the field "Option 3" to "three"
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I follow "Test choice name"
And I am on the "Test choice name" "choice activity" page
And I set the field "one" to "1"
And I press "Save my choice"
And the field "one" matches value "1"
@@ -183,31 +178,23 @@ Feature: Verify that all form fields values can be get and set
And I press "Cancel"
# Advanced checkbox requires real browser to allow uncheck to work. MDL-58681. MDL-55386.
# Advanced checkbox - Checking "I set the field" and "The field matches value" ticked.
And I am on "Course 1" course homepage
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And I set the field "Display description on course page" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value "1"
And the field "Display description on course page" does not match value ""
# Advanced checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Display description on course page" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value ""
And the field "Display description on course page" does not match value "1"
# Advanced checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" ticked.
And I set the following fields to these values:
| Display description on course page | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | 1 |
And the following fields do not match these values:
@@ -216,9 +203,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Display description on course page | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | |
And the following fields do not match these values:
@@ -0,0 +1,85 @@
@tool @tool_behat
Feature: Use core page resolvers for the I am on the page steps
In order to write tests correctly
As a developer
I need to have steps which take me straight to a page
Scenario Outline: When I am on an instance
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
And the following "activity" exists:
| course | ECON101 |
| activity | forum |
| name | Fundamentals of Economics |
| idnumber | fundamentalsofeconomics |
And I log in as "admin"
When I am on the <identifier> <type> page
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Scenario Outline: When I am on an instance logged in as
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
And the following "activity" exists:
| course | ECON101 |
| activity | forum |
| name | Fundamentals of Economics |
| idnumber | fundamentalsofeconomics |
When I am on the <identifier> <type> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Scenario Outline: When I am on a named page
Given I log in as "admin"
When I am on the <identifier> page
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
Scenario Outline: When I am on a named page logged in as
When I am on the <identifier> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
@@ -0,0 +1,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"
@@ -0,0 +1,191 @@
<?php
// This file is part of Moodle - https://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
/**
* Tests for behat_form_text class
*
* @copyright 2022 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_behat;
use behat_form_text;
use Behat\Mink\Session;
use Behat\Mink\Element\NodeElement;
use core_string_manager_standard;
defined('MOODLE_INTERNAL') || die;
global $CFG;
require_once($CFG->libdir . '/behat/classes/behat_session_interface.php');
require_once($CFG->libdir . '/behat/classes/behat_session_trait.php');
require_once($CFG->libdir . '/behat/form_field/behat_form_text.php');
/**
* Tests for the behat_form_text class
*
* @package tool_behat
* @category test
* @copyright 2022 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*
* @covers \behat_form_text
* @covers \behat_form_field
*/
class behat_form_text_test extends \basic_testcase {
/**
* Data provider for the test_set_get_value() method.
*
* @return array of value and expectation pairs to be tested.
*/
public function provider_test_set_get_value() {
return [
'null' => [null, null],
'int' => [3, 3],
'float' => [3.14, 3.14],
'string' => ['hello', 'hello'],
'utf8' => ['你好', '你好'],
];
}
/**
* Test the set_value() and get_value() methods.
*
* @param mixed $value value to be set.
* @param mixed $expectation value to be checked.
* @dataProvider provider_test_set_get_value()
*/
public function test_set_get_value($value, $expectation) {
$session = $this->createMock(Session::class);
$node = $this->createMock(NodeElement::class);
$node->method('getValue')->willReturn($value);
$field = new behat_form_text($session, $node);
$field->set_value($value);
$this->assertEquals($expectation, $field->get_value());
}
/**
* Data provider for the test_text_matches() method.
*
* @return array of decsep, value, match and result pairs to be tested.
*/
public function provider_test_matches() {
return [
'lazy true' => ['.', 'hello', 'hello', true],
'lazy false' => ['.', 'hello', 'bye', false],
'float true' => ['.', '3.14', '3.1400', true],
'float false' => ['.', '3.14', '3.1401', false],
'float and float string true' => ['.', 3.14, '3.1400', true],
'float and unrelated string false' => ['.', 3.14, 'hello', false],
'float hash decsep true' => ['#', '3#14', '3#1400', true],
'float hash decsep false' => ['#', '3#14', '3#1401', false],
'float and float string hash decsep true' => ['#', 3.14, '3.1400', true],
'float and unrelated string hash decsep false' => ['#', 3.14, 'hello', false],
'float custom-default decsep mix1 true' => ['#', '3#14', '3.1400', true],
'float custom-default decsep mix2 true' => ['#', '3.14', '3#1400', true],
'float 2-custom decsep mix1 false' => ['#', '3#14', '3,1400', false],
'float 2-custom decsep mix2 false' => [',', '3#14', '3,1400', false],
'float default-custom decsep mix1 false' => ['.', '3#14', '3.1400', false],
'float default-custom decsep mix2 false' => ['.', '3.14', '3#1400', false],
];
}
/**
* Test the matches() method.
*
* @param string $decsep decimal separator to use.
* @param mixed $value value to be set.
* @param mixed $match value to be matched.
* @param bool $result expected return status of the function.
* @dataProvider provider_test_matches()
*/
public function test_matches($decsep, $value, $match, $result) {
global $CFG;
// Switch of string manager to avoid having to (slow) customise the lang file.
$origcustom = $CFG->config_php_settings['customstringmanager'] ?? null;
$CFG->config_php_settings['customstringmanager'] = '\tool_behat\phpunit_string_manager';
$manager = get_string_manager(true);
$manager->set_string('decsep', 'langconfig', $decsep);
$session = $this->createMock(Session::class);
$node = $this->createMock(NodeElement::class);
$node->method('getValue')->willReturn($value);
$field = new behat_form_text($session, $node);
$field->set_value($value);
$this->assertSame($result, $field->matches($match));
// Switch back to the original string manager.
if (is_null($origcustom)) {
unset($CFG->config_php_settings['customstringmanager']);
} else {
$CFG->config_php_settings['customstringmanager'] = $origcustom;
}
$manager = get_string_manager(true);
}
}
/**
* Customised values that will be used instead of standard manager one.
*
* If an existing component/identifier is found, return it instead of the real
* one from language files. Note this doesn't support place holders or another niceties.
*
* @package tool_behat
* @category test
* @copyright 2022 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class phpunit_string_manager extends core_string_manager_standard {
/** @var array language customisations provided by the manager without asking for real contents */
protected $customstrings = [];
/**
* Get String returns a requested string
*
* @param string $identifier The identifier of the string to search for
* @param string $component The module the string is associated with
* @param string|object|array $a An object, string or number that can be used
* within translation strings
* @param string $lang moodle translation language, null means use current
* @return string The String !
*/
public function get_string($identifier, $component = '', $a = null, $lang = null) {
$key = trim($component) . '/' . trim($identifier);
if (isset($this->customstrings[$key])) {
return $this->customstrings[$key];
}
return parent::get_string($identifier, $component, $a, $lang);
}
/**
* Sets a custom string to be returned by the string manager instead of the language file one.
*
* @param string $identifier The identifier of the string to search for
* @param string $component The module the string is associated with
* @param string $value the contents of the language string to be returned by get_string()
*/
public function set_string($identifier, $component, $value) {
$key = trim($component) . '/' . trim($identifier);
$this->customstrings[$key] = $value;
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
// @codingStandardsIgnoreFile
// phpcs:ignoreFile
// @codeCoverageIgnoreStart
// This file is part of Moodle - http://moodle.org/
@@ -40,14 +40,15 @@ class content_too_long extends brickfield_accessibility_test {
$contentlengthlimit = 500;
$pagetext = '';
foreach ($this->get_all_elements(null, 'text') as $element) {
$text = $element->nodeValue;
// There will be only one, but array is returned anyway.
foreach ($this->get_all_elements('body') as $element) {
$text = $element->textContent;
if ($text != null) {
$pagetext = $pagetext . $text;
}
}
$wordcount = str_word_count($pagetext);
$wordcount = count_words($pagetext);
if ($wordcount > $contentlengthlimit) {
$this->add_report(null, "<p id='wc'>Word Count: " . $wordcount . "</p>", false);
}
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="admin/tool/brickfield/db" VERSION="20200215" COMMENT="XMLDB file for Moodle admin/tool/brickfield"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="tool_brickfield_checks" COMMENT="Checks details">
+55 -51
View File
@@ -16,6 +16,11 @@
namespace tool_brickfield;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/admin/tool/brickfield/tests/area_test_base.php');
/**
* Class tool_brickfield_area_testcase
*
@@ -23,8 +28,7 @@ namespace tool_brickfield;
* @copyright 2020 onward: Brickfield Education Labs, https://www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class area_test extends \advanced_testcase {
class area_test extends area_test_base {
/**
* Test for the area assign intro
*/
@@ -46,7 +50,7 @@ class area_test extends \advanced_testcase {
$resultsrs = $c->find_course_areas($course1->id);
$resultsrs2 = $c->find_course_areas($course2->id);
// Set up a results array from the recordset for easier testing.
$results = array_merge(self::array_from_recordset($resultsrs), self::array_from_recordset($resultsrs2));
$results = array_merge($this->array_from_recordset($resultsrs), $this->array_from_recordset($resultsrs2));
$this->assertEquals([
(object)[
'type' => area_base::TYPE_FIELD,
@@ -76,7 +80,7 @@ class area_test extends \advanced_testcase {
$event = \core\event\course_module_updated::create_from_cm($cm1);
$relevantresultsrs = $c->find_relevant_areas($event);
// Set up a relevantresults array from the recordset for easier testing.
$relevantresults = self::array_from_recordset($relevantresultsrs);
$relevantresults = $this->array_from_recordset($relevantresultsrs);
$this->assertEquals([$results[0]], $relevantresults);
}
@@ -87,43 +91,57 @@ class area_test extends \advanced_testcase {
$this->resetAfterTest();
/** @var \core_question_generator $generator */
$generator = $this->getDataGenerator()->get_plugin_generator('core_question');
$component = 'core_question';
list($category1, $course1, $qcat1, $questions1) = $generator->setup_course_and_questions('course');
list($category2, $course2, $qcat2, $questions2) = $generator->setup_course_and_questions('category');
list($category3, $course3, $qcat3, $questions3) = $generator->setup_course_and_questions('system');
$c = new \tool_brickfield\local\areas\core_question\questiontext();
$results1 = self::array_from_recordset($c->find_course_areas($course1->id));
$results2 = self::array_from_recordset($c->find_course_areas($course2->id));
$results3 = self::array_from_recordset($c->find_course_areas($course3->id));
$results4 = self::array_from_recordset($c->find_system_areas());
// Set up a results array from the recordset for easier testing.
// Set up results arrays from the recordset for easier testing.
$course1areas = $this->array_from_recordset($c->find_course_areas($course1->id));
$course2areas = $c->find_course_areas($course2->id);
$course3areas = $c->find_course_areas($course3->id);
$sysareas = $this->array_from_recordset($c->find_system_areas());
$this->assertCount(2, $results1);
$this->assertCount(0, $results2);
$this->assertCount(0, $results3);
$this->assertCount(4, $results4);
// Validate the contexts, courseid and categoryid of the returned results.
$this->assertEquals(\context_course::instance($course1->id)->id, $results1[0]->contextid);
$this->assertEquals($course1->id, $results1[0]->courseid);
$this->assertEmpty($results1[0]->categoryid);
$this->assertEquals(\context_coursecat::instance($category2->id)->id, $results4[0]->contextid);
$this->assertEquals(SITEID, $results4[0]->courseid);
$this->assertEquals($category2->id, $results4[0]->categoryid);
$this->assertEquals(\context_system::instance()->id, $results4[2]->contextid);
$this->assertEmpty($results4[2]->categoryid);
$this->assertEquals(SITEID, $results4[2]->courseid);
// Results4 should contain id's for questions 1 and 2.
$this->assertTrue(($questions3[0]->id == $results4[2]->itemid) || ($questions3[0]->id == $results4[3]->itemid));
$this->assertTrue(($questions3[1]->id == $results4[2]->itemid) || ($questions3[1]->id == $results4[3]->itemid));
// Assert the core_question area exists for the individual question's context, courseid and categoryid.
$this->assert_area_in_array(
$course1areas,
$component,
\context_course::instance($course1->id)->id,
$questions1[0]->id,
$course1->id,
null
);
$this->assert_area_in_array(
$sysareas,
$component,
\context_coursecat::instance($category2->id)->id,
$questions2[0]->id,
SITEID,
$category2->id
);
$this->assert_area_in_array(
$sysareas,
$component,
\context_system::instance()->id,
$questions3[0]->id,
SITEID,
null
);
// Emulate the question_created event.
$event = \core\event\question_created::create_from_question_instance($questions1[1],
\context_course::instance($course1->id));
$relevantresultsrs = $c->find_relevant_areas($event);
// Set up a relevantresults array from the recordset for easier testing.
$relevantresults = self::array_from_recordset($relevantresultsrs);
$this->assertEquals([$results1[1]], $relevantresults);
$relevantresults = $this->array_from_recordset($c->find_relevant_areas($event));
$this->assert_area_in_array(
$course1areas,
$component,
\context_course::instance($relevantresults[0]->courseid)->id,
$relevantresults[0]->itemid,
$relevantresults[0]->courseid,
$relevantresults[0]->categoryid
);
}
/**
@@ -147,7 +165,7 @@ class area_test extends \advanced_testcase {
$c = new \tool_brickfield\local\areas\core_question\questionanswers();
$resultsrs = $c->find_course_areas($course->id);
$results = self::array_from_recordset($resultsrs);
$results = $this->array_from_recordset($resultsrs);
// There will be the same number of results as the number of records in the question_answers table.
$this->assertEquals(count($dbanswers), count($results));
@@ -157,7 +175,7 @@ class area_test extends \advanced_testcase {
\context_course::instance($course->id));
$relevantresultsrs = $c->find_relevant_areas($event);
// Set up a relevantresults array from the recordset for easier testing.
$relevantresults = self::array_from_recordset($relevantresultsrs);
$relevantresults = $this->array_from_recordset($relevantresultsrs);
$dbanswers = array_values($DB->get_records('question_answers', ['question' => $question1->id], 'id'));
$this->assertEquals(count($dbanswers), count($relevantresults));
@@ -190,7 +208,7 @@ class area_test extends \advanced_testcase {
$c = new \tool_brickfield\local\areas\mod_choice\intro();
$resultsrs = $c->find_course_areas($course->id);
// Set up a results array from the recordset for easier testing.
$results = self::array_from_recordset($resultsrs);
$results = $this->array_from_recordset($resultsrs);
$this->assertCount(2, $results);
$this->assertEquals($cm1->id, $results[0]->cmid);
@@ -199,14 +217,14 @@ class area_test extends \advanced_testcase {
// Emulate the course_module_created event.
$event = \core\event\course_module_created::create_from_cm($cm1);
$relevantresultsrs = $c->find_relevant_areas($event);
$relevantresults = self::array_from_recordset($relevantresultsrs);
$relevantresults = $this->array_from_recordset($relevantresultsrs);
$this->assertEquals([$results[0]], $relevantresults);
// Testing the choice options.
$c = new \tool_brickfield\local\areas\mod_choice\option();
$resultsrs = $c->find_course_areas($course->id);
// Set up a results array from the recordset for easier testing.
$results = self::array_from_recordset($resultsrs);
$results = $this->array_from_recordset($resultsrs);
$this->assertCount(5, $results);
$this->assertEquals($cm2->id, $results[3]->cmid);
@@ -220,21 +238,7 @@ class area_test extends \advanced_testcase {
// Emulate the course_module_updated event.
$event = \core\event\course_module_updated::create_from_cm($cm2);
$relevantresultsrs = $c->find_relevant_areas($event);
$relevantresults = self::array_from_recordset($relevantresultsrs);
$relevantresults = $this->array_from_recordset($relevantresultsrs);
$this->assertEquals([$results[3], $results[4]], $relevantresults);
}
/**
* Array from recordset.
* @param \moodle_recordset $rs
* @return array
*/
private static function array_from_recordset($rs) {
$records = [];
foreach ($rs as $record) {
$records[] = $record;
}
$rs->close();
return $records;
}
}
@@ -0,0 +1,94 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield;
/**
* Class area_test_base provides some utility functions that can be used by testing.
*
* @package tool_brickfield
* @copyright 2020 onward: Brickfield Education Labs, https://www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class area_test_base extends \advanced_testcase {
/** @var string Message for failed area test. */
protected $areatestmessage = 'Expected %component% area not found';
/**
* Create and return an array from a recordset. Recordset is destroyed.
* @param \moodle_recordset $rs
* @return array
*/
public function array_from_recordset(\moodle_recordset $rs): array {
$records = [];
foreach ($rs as $record) {
$records[] = $record;
}
// Can't rewind a recordset, so might as well close it.
$rs->close();
return $records;
}
/**
* Test for specified component information present in area recordset. Recordset cannot be reused.
* @param \moodle_recordset $areasrs
* @param string $component
* @param int $contextid
* @param int $itemid
* @param int|null $courseid
* @param int|null $categoryid
* @return void
*/
public function assert_area_in_recordset(\moodle_recordset $areasrs, string $component, int $contextid, int $itemid,
?int $courseid, ?int $categoryid): void {
$this->assert_area_in_array(
$this->array_from_recordset($areasrs),
$component,
$contextid,
$itemid,
$courseid,
$categoryid
);
}
/**
* Test for specified component information present in area array.
* @param array $areas
* @param string $component
* @param int $contextid
* @param int $itemid
* @param int|null $courseid
* @param int|null $categoryid
* @return void
*/
public function assert_area_in_array(array $areas, string $component, int $contextid, int $itemid,
?int $courseid, ?int $categoryid): void {
$found = false;
$message = str_replace('%component%', $component, $this->areatestmessage);
foreach ($areas as $area) {
if (($area->component == $component) &&
($area->contextid == $contextid) &&
((empty($courseid) ? empty($area->courseid) : ($area->courseid == $courseid))) &&
((empty($categoryid) ? empty($area->categoryid) : ($area->categoryid == $categoryid))) &&
($area->itemid == $itemid)
) {
$found = true;
break;
}
}
$this->assertTrue($found, $message);
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ use tool_brickfield\local\tool\filter;
* @author Jay Churchward (jay.churchward@poetopensource.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class filter_test extends \advanced_testcase {
class filters_test extends \advanced_testcase {
public function test_constructor() {
$this->resetAfterTest();
@@ -13,9 +13,15 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_brickfield\local\areas\core_question;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/admin/tool/brickfield/tests/area_test_base.php');
use tool_brickfield\area_test_base;
/**
* Tests for questiontext.
*
@@ -23,8 +29,7 @@ namespace tool_brickfield\local\areas\core_question;
* @copyright 2020 onward: Brickfield Education Labs, https://www.brickfield.ie
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class questiontext_test extends \advanced_testcase {
class questiontext_test extends area_test_base {
/**
* Set up before class.
*/
@@ -158,30 +163,31 @@ class questiontext_test extends \advanced_testcase {
$catcontext = \context_coursecat::instance($category->id);
$systemcontext = \context_system::instance();
$generator = $this->getDataGenerator()->get_plugin_generator('core_question');
$component = 'core_question';
$cat = $generator->create_question_category(['contextid' => $catcontext->id]);
$cat2 = $generator->create_question_category(['contextid' => $systemcontext->id]);
$question = $generator->create_question('multichoice', null, ['category' => $cat2->id]);
$question2 = $generator->create_question('multichoice', null, ['category' => $cat->id]);
$questiontext = new questiontext();
$rs = $questiontext->find_system_areas();
$this->assertNotNull($rs);
$areas = $this->array_from_recordset($questiontext->find_system_areas());
$count = 0;
foreach ($rs as $rec) {
$count++;
if ($count <= 1) {
$this->assertEquals($systemcontext->id, $rec->contextid);
$this->assertEquals(1, $rec->courseid);
$this->assertEquals(0, $rec->categoryid);
$this->assertEquals($question->id, $rec->itemid);
} else {
$this->assertEquals($catcontext->id, $rec->contextid);
$this->assertEquals(1, $rec->courseid);
$this->assertEquals($category->id, $rec->categoryid);
$this->assertEquals($question2->id, $rec->itemid);
}
}
$rs->close();
$this->assertEquals(2, $count);
// Assert the core_question area exists for the individual question's context, courseid and categoryid.
$this->assert_area_in_array(
$areas,
$component,
$systemcontext->id,
$question->id,
SITEID,
null
);
$this->assert_area_in_array(
$areas,
$component,
$catcontext->id,
$question2->id,
SITEID,
$category->id
);
}
}
@@ -37,20 +37,15 @@ class content_too_long_test extends all_checks {
/** @var string Html fail */
private $htmlfail = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>Content must not exceed a certain length</title>
</head>
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent accumsan, ante varius viverra aliquam, dolor risus
<p><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent accumsan, ante varius viverra aliquam, dolor risus
scelerisque massa, ut lacinia ipsum felis id est. Nullam convallis odio ante, in commodo elit fermentum sed. Vivamus ullamcorper
tincidunt sagittis. Sed et semper sapien. Quisque malesuada lacus nec libero cursus, aliquam malesuada neque ultricies. Cras sit
amet enim vel orci tristique porttitor a vitae urna. Suspendisse mi leo, hendrerit et eleifend a, mollis at ex. Maecenas eget
magna nec sem dignissim pharetra vel nec ex. Donec in porta lectus. Aenean porttitor euismod lectus, sodales eleifend ex egestas
in. Donec sed metus sodales, lobortis velit quis, dictum arcu.
Praesent mollis urna eget odio cursus, sit amet sollicitudin ante aliquam. Integer nec massa nec ipsum tincidunt laoreet in
vitae metus. Integer massa lacus, elementum quis dui sed, eleifend fringilla turpis. In hac habitasse platea dictumst. Phasellus
in. Donec sed metus sodales, lobortis velit quis, dictum arcu.</span></p>
<p><span>Praesent mollis urna eget odio cursus, sit amet sollicitudin ante aliquam. Integer nec massa nec ipsum tincidunt
laoreet in vitae metus.
Integer massa lacus, elementum quis dui sed, eleifend fringilla turpis. In hac habitasse platea dictumst. Phasellus
efficitur quis felis non eleifend. Sed et mauris vel lorem ultrices porta. Mauris commodo condimentum felis, vel dictum ex
laoreet sit amet. Duis venenatis ut lacus non ultrices. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
inceptos himenaeos. Nam nunc magna, semper feugiat feugiat a, pellentesque vel nulla.
@@ -59,9 +54,10 @@ class content_too_long_test extends all_checks {
blandit eget elit sit amet, suscipit mollis ligula. Suspendisse rutrum sem ex, eu commodo nisi aliquam sit amet. Fusce ut felis
justo. Sed a quam at lectus consectetur vulputate. Proin elementum dui nisi, in condimentum diam porttitor eget. Donec vehicula
condimentum velit vel semper. Mauris vehicula tortor lectus, quis convallis erat aliquet vel. In dictum nunc ac posuere porta.
Sed vel leo aliquam, volutpat ligula ac, blandit diam. Donec nec ligula lacus.
Mauris ac libero vel ex fringilla fringilla. Ut vehicula justo eu nunc imperdiet ultricies. Sed interdum ligula at nisi rhoncus
auctor. Sed tempus tellus eget risus placerat, et viverra dolor gravida. Sed ultricies neque id ex tempor viverra. Ut imperdiet
Sed vel leo aliquam, volutpat ligula ac, blandit diam. Donec nec ligula lacus.</span></p>
<p><span>Mauris ac libero vel ex fringilla fringilla. Ut vehicula justo eu nunc imperdiet ultricies. Sed interdum ligula at nisi
rhoncus auctor.
Sed tempus tellus eget risus placerat, et viverra dolor gravida. Sed ultricies neque id ex tempor viverra. Ut imperdiet
pharetra magna sed tristique. Pellentesque blandit elit ac neque lacinia finibus. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Donec vel auctor dolor. Morbi id elit mollis ante mattis semper eu ac lectus. Integer elit turpis, facilisis
vel metus eget, blandit tempus arcu. Pellentesque eget magna eu ex eleifend tincidunt. Curabitur sit amet congue nisi.
@@ -69,29 +65,60 @@ class content_too_long_test extends all_checks {
turpis. Aenean tincidunt tristique dui, pretium lacinia felis posuere vel. Donec massa ligula, luctus vitae enim nec, sagittis
hendrerit lorem. In consequat sodales metus vel porttitor. Aenean fringilla fringilla risus, vitae interdum turpis egestas quis.
Aenean volutpat arcu leo, ut dictum purus consectetur id. Cras enim ipsum, tincidunt vitae mi vel, varius convallis ex. Fusce
pretium porttitor tempus.
Morbi laoreet dapibus lectus ut efficitur. Donec at hendrerit nunc. Vivamus venenatis augue non nulla finibus vestibulum. Nam
pretium porttitor tempus.</span></p>
<p>Morbi laoreet dapibus lectus ut efficitur. Donec at hendrerit nunc. Vivamus venenatis augue non nulla finibus vestibulum. Nam
nunc magna, hendrerit a ipsum nec, pulvinar imperdiet augue. Fusce vel metus maximus, mattis magna at, egestas enim. Suspendisse
et nisl at enim mollis scelerisque. Duis ut ipsum vel turpis eleifend aliquet a a ante. Nam lacinia purus vulputate purus
tincidunt, aliquet sagittis nisi sagittis. Pellentesque efficitur massa non ex sodales pretium. Cras convallis vitae ex et
dignissim. Nunc suscipit bibendum aliquam. Maecenas interdum tellus varius, laoreet velit sed, ornare arcu. Nunc pulvinar
elementum sem eget scelerisque. Duis volutpat tellus ut risus finibus, nec molestie erat fermentum
</p>
</body>
</html>
EOD;
/** @var string Multibyte html falure */
private $htmlfail2 = <<<EOD
<p><span>ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル ブルース カンベッル
</span></p>
EOD;
/** @var string Html pass */
private $htmlpass = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>Content must not exceed a certain length/title>
</head>
<body>
<p>Nice and short text</p>
</body>
</html>
EOD;
/**
@@ -101,6 +128,9 @@ EOD;
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->message == '<p id=\'wc\'>Word Count: 578</p>');
$results = $this->get_checker_results($this->htmlfail2);
$this->assertTrue($results[0]->message == '<p id=\'wc\'>Word Count: 504</p>');
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}
@@ -101,6 +101,6 @@ class printable_test extends \advanced_testcase {
$object->set_filter($filter);
$output = $object->get_output();
$this->assertStringContainsString('<i class="icon fa fa-tachometer fa-fw " title="Total activities" '.
'aria-label="Total activities">', $output);
'role="img" aria-label="Total activities">', $output);
}
}
@@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
defined('MOODLE_INTERNAL') || die();
namespace tool_capability\event;
/**
* Class for capability overview events.
@@ -31,7 +31,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2014 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
class tool_capability_events_testcase extends advanced_testcase {
class events_test extends \advanced_testcase {
/**
* Setup testcase.
@@ -54,11 +54,11 @@ class tool_capability_events_testcase extends advanced_testcase {
$event = reset($events);
$this->assertInstanceOf('\tool_capability\event\report_viewed', $event);
$this->assertEquals(context_system::instance(), $event->get_context());
$this->assertEquals(\context_system::instance(), $event->get_context());
$expected = array(SITEID, "admin", "tool capability", "tool/capability/index.php");
$this->assertEventLegacyLogData($expected, $event);
$this->assertEventContextNotUsed($event);
$url = new moodle_url('/admin/tool/capability/index.php');
$url = new \moodle_url('/admin/tool/capability/index.php');
$this->assertEquals($url, $event->get_url());
$event->get_name();
}
@@ -21,6 +21,7 @@
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
namespace tool_capability;
defined('MOODLE_INTERNAL') || die();
global $CFG;
@@ -30,7 +31,7 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/tool/capability/locallib.php'
/**
* Tests for the capability overview helper functions.
*/
class tool_capability_locallib_testcase extends advanced_testcase {
class locallib_test extends \advanced_testcase {
/**
* Test the function that gets the data - simple case.
@@ -40,7 +41,7 @@ class tool_capability_locallib_testcase extends advanced_testcase {
$data = tool_capability_calculate_role_data('mod/quiz:attempt', get_all_roles());
$systcontext = context_system::instance();
$systcontext = \context_system::instance();
$studentroleid = $DB->get_field('role', 'id', ['shortname' => 'student']);
$this->assertArrayHasKey($systcontext->id, $data);
@@ -63,10 +64,10 @@ class tool_capability_locallib_testcase extends advanced_testcase {
// This simulates a situation that seems to happen sometimes, where
// we end up with contexts with path = NULL in the database.
$systcontext = context_system::instance();
$systcontext = \context_system::instance();
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$coursecontext = context_course::instance($course->id);
$coursecontext = \context_course::instance($course->id);
$studentroleid = $DB->get_field('role', 'id', ['shortname' => 'student']);
role_change_permission($studentroleid, $coursecontext, 'mod/quiz:attempt', CAP_PREVENT);
// This is where we simulate the breakage.
@@ -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"]});
+3
View File
@@ -47,5 +47,8 @@ function xmldb_tool_cohortroles_upgrade($oldversion) {
// Automatically generated Moodle v3.10.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.11.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+10 -20
View File
@@ -14,17 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* API tests.
*
* @package tool_cohortroles
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
use tool_cohortroles\api;
namespace tool_cohortroles;
/**
* API tests.
@@ -33,17 +23,17 @@ use tool_cohortroles\api;
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_cohortroles_api_testcase extends advanced_testcase {
/** @var stdClass $cohort */
class api_test extends \advanced_testcase {
/** @var \stdClass $cohort */
protected $cohort = null;
/** @var stdClass $userassignto */
/** @var \stdClass $userassignto */
protected $userassignto = null;
/** @var stdClass $userassignover */
/** @var \stdClass $userassignover */
protected $userassignover = null;
/** @var stdClass $role */
/** @var \stdClass $role */
protected $role = null;
/**
@@ -67,7 +57,7 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
'roleid' => $this->roleid,
'cohortid' => $this->cohort->id
);
$this->expectException(required_capability_exception::class);
$this->expectException(\required_capability_exception::class);
api::create_cohort_role_assignment($params);
}
@@ -105,7 +95,7 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
);
$result = api::create_cohort_role_assignment($params);
$this->setUser($this->userassignto);
$this->expectException(required_capability_exception::class);
$this->expectException(\required_capability_exception::class);
api::delete_cohort_role_assignment($result->get('id'));
}
@@ -117,7 +107,7 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
'cohortid' => $this->cohort->id
);
$result = api::create_cohort_role_assignment($params);
$this->expectException(dml_missing_record_exception::class);
$this->expectException(\dml_missing_record_exception::class);
api::delete_cohort_role_assignment($result->get('id') + 1);
}
@@ -274,7 +264,7 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
$this->assertEquals($sync, $expected);
// Verify roles assigned by any other component are not removed.
$usercontext = context_user::instance($this->userassignover->id);
$usercontext = \context_user::instance($this->userassignover->id);
role_assign($this->roleid, $this->userassignto->id, $usercontext->id);
$sync = api::sync_all_cohort_roles();
@@ -22,14 +22,15 @@
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_cohortroles\privacy;
defined('MOODLE_INTERNAL') || die();
global $CFG;
use \core_privacy\local\request\writer;
use \core_privacy\local\request\approved_contextlist;
use \tool_cohortroles\api;
use \tool_cohortroles\privacy\provider;
use core_privacy\local\request\writer;
use core_privacy\local\request\approved_contextlist;
use tool_cohortroles\api;
use tool_cohortroles\privacy\provider;
use core_privacy\local\request\approved_userlist;
/**
@@ -38,7 +39,7 @@ use core_privacy\local\request\approved_userlist;
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_testcase {
class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Overriding setUp() function to always reset after tests.
@@ -61,7 +62,7 @@ class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_tes
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
$systemctx = \context_system::instance();
// Create course.
$course = $this->getDataGenerator()->create_course();
$coursectx = \context_course::instance($course->id);
@@ -102,7 +103,7 @@ class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_tes
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
$systemctx = \context_system::instance();
// Create course.
$course = $this->getDataGenerator()->create_course();
$coursectx = \context_course::instance($course->id);
@@ -154,7 +155,7 @@ class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_tes
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
$systemctx = \context_system::instance();
$this->setup_test_scenario_data($user->id, $systemctx, 1);
$this->setup_test_scenario_data($user->id, $coursecategoryctx, 1, 'Sausage roll 2',
@@ -170,7 +171,7 @@ class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_tes
$this->assertCount(2, $contexts);
// Make sure the user data is only being deleted in within the system and course category context.
$usercontext = context_user::instance($user->id);
$usercontext = \context_user::instance($user->id);
// Delete all the User's records in mdl_tool_cohortroles table by the user context.
provider::delete_data_for_all_users_in_context($usercontext);
@@ -213,7 +214,7 @@ class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_tes
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
$systemctx = \context_system::instance();
$this->setup_test_scenario_data($user->id, $systemctx, 1);
$this->setup_test_scenario_data($user->id, $coursecategoryctx, 1, 'Sausage roll 2',
@@ -229,7 +230,7 @@ class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_tes
$this->assertCount(2, $contexts);
// Make sure the user data is only being deleted in within the system and the course category contexts.
$usercontext = context_user::instance($user->id);
$usercontext = \context_user::instance($user->id);
// Delete all the User's records in mdl_tool_cohortroles table by the specified approved context list.
$approvedcontextlist = new approved_contextlist($user, 'tool_cohortroles', [$usercontext->id]);
provider::delete_data_for_user($approvedcontextlist);
@@ -255,12 +256,12 @@ class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_tes
// Create a user.
$user = $this->getDataGenerator()->create_user();
$usercontext = context_user::instance($user->id);
$usercontext = \context_user::instance($user->id);
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
$systemctx = \context_system::instance();
$this->setAdminUser();
@@ -301,12 +302,12 @@ class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_tes
$user2 = $this->getDataGenerator()->create_user();
// Create user3.
$user3 = $this->getDataGenerator()->create_user();
$usercontext3 = context_user::instance($user3->id);
$usercontext3 = \context_user::instance($user3->id);
// Create course category.
$coursecategory = $this->getDataGenerator()->create_category();
$coursecategoryctx = \context_coursecat::instance($coursecategory->id);
$systemctx = context_system::instance();
$systemctx = \context_system::instance();
$this->setAdminUser();
+4 -4
View File
@@ -10,9 +10,9 @@
<FIELD NAME="lang" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" COMMENT="The code of the language this string belongs to. Like en, cs or es"/>
<FIELD NAME="componentid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The id of the component"/>
<FIELD NAME="stringid" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The identifier of the string"/>
<FIELD NAME="original" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" COMMENT="English original of the string"/>
<FIELD NAME="master" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="Master translation of the string as is distributed in the official lang pack, null if not translated"/>
<FIELD NAME="local" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="Local customization of the string, null if not customized"/>
<FIELD NAME="original" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="English original of the string"/>
<FIELD NAME="master" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Master translation of the string as is distributed in the official lang pack, null if not translated"/>
<FIELD NAME="local" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Local customization of the string, null if not customized"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The timestamp of when the original or master was recently modified"/>
<FIELD NAME="timecustomized" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="The timestamp of when the value of the local translation was recently modified, null if not customized yet"/>
<FIELD NAME="outdated" TYPE="int" LENGTH="3" NOTNULL="false" DEFAULT="0" SEQUENCE="false" COMMENT="Either the English original or the master translation changed and the customization may be outdated"/>
@@ -37,4 +37,4 @@
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
</XMLDB>
+3
View File
@@ -44,5 +44,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
// Automatically generated Moodle v3.10.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.11.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -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>
@@ -36,7 +36,7 @@ use moodle_exception;
* @copyright 2020 Ferran Recio <ferran@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class langstring_testcase extends advanced_testcase {
class langstring_test extends advanced_testcase {
/**
* Sanity 1.x string
@@ -34,7 +34,7 @@ use moodle_exception;
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class phpparser_testcase extends advanced_testcase {
class phpparser_test extends advanced_testcase {
/**
+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/contactdpo",["exports","core_form/modalform","core/notification","core/str","core/toast"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=f(b);c=f(c);function f(a){return a&&a.__esModule?a:{default:a}}var g={CONTACT_DPO:"[data-action=\"contactdpo\"]"};a.init=function init(){var a=document.querySelector(g.CONTACT_DPO);a.addEventListener("click",function(f){f.preventDefault();var g=new b.default({modalConfig:{title:(0,d.get_string)("contactdataprotectionofficer","tool_dataprivacy")},formClass:"tool_dataprivacy\\form\\contactdpo",saveButtonText:(0,d.get_string)("send","tool_dataprivacy"),returnFocus:a});g.addEventListener(g.events.FORM_SUBMITTED,function(a){if(a.detail.result){(0,d.get_string)("requestsubmitted","tool_dataprivacy").then(e.add).catch()}else{var b=a.detail.warnings.map(function(a){return a.message});c.default.addNotification({type:"error",message:b.join("<br>")})}});g.show()})}});
//# sourceMappingURL=contactdpo.min.js.map
define("tool_dataprivacy/contactdpo",["exports","core_form/modalform","core/notification","core/str","core/toast"],(function(_exports,_modalform,_notification,_str,_toast){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}
/**
* Javascript module for contacting the site DPO
*
* @module tool_dataprivacy/contactdpo
* @copyright 2021 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_modalform=_interopRequireDefault(_modalform),_notification=_interopRequireDefault(_notification);var SELECTORS_CONTACT_DPO='[data-action="contactdpo"]';_exports.init=function(){var triggerElement=document.querySelector(SELECTORS_CONTACT_DPO);triggerElement.addEventListener("click",(function(event){event.preventDefault();var modalForm=new _modalform.default({modalConfig:{title:(0,_str.get_string)("contactdataprotectionofficer","tool_dataprivacy")},formClass:"tool_dataprivacy\\form\\contactdpo",saveButtonText:(0,_str.get_string)("send","tool_dataprivacy"),returnFocus:triggerElement});modalForm.addEventListener(modalForm.events.FORM_SUBMITTED,(function(event){if(event.detail.result)(0,_str.get_string)("requestsubmitted","tool_dataprivacy").then(_toast.add).catch();else{var warningMessages=event.detail.warnings.map((function(warning){return warning.message}));_notification.default.addNotification({type:"error",message:warningMessages.join("<br>")})}})),modalForm.show()}))}}));
//# sourceMappingURL=contactdpo.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/contactdpo.js"],"names":["SELECTORS","CONTACT_DPO","init","triggerElement","document","querySelector","addEventListener","event","preventDefault","modalForm","ModalForm","modalConfig","title","formClass","saveButtonText","returnFocus","events","FORM_SUBMITTED","detail","result","then","addToast","catch","warningMessages","warnings","map","warning","message","Notification","addNotification","type","join","show"],"mappings":"oNAwBA,OACA,O,sDAIMA,CAAAA,CAAS,CAAG,CACdC,WAAW,CAAE,8BADC,C,QAOE,QAAPC,CAAAA,IAAO,EAAM,CACtB,GAAMC,CAAAA,CAAc,CAAGC,QAAQ,CAACC,aAAT,CAAuBL,CAAS,CAACC,WAAjC,CAAvB,CAEAE,CAAc,CAACG,gBAAf,CAAgC,OAAhC,CAAyC,SAAAC,CAAK,CAAI,CAC9CA,CAAK,CAACC,cAAN,GAEA,GAAMC,CAAAA,CAAS,CAAG,GAAIC,UAAJ,CAAc,CAC5BC,WAAW,CAAE,CACTC,KAAK,CAAE,iBAAU,8BAAV,CAA0C,kBAA1C,CADE,CADe,CAI5BC,SAAS,CAAE,oCAJiB,CAK5BC,cAAc,CAAE,iBAAU,MAAV,CAAkB,kBAAlB,CALY,CAM5BC,WAAW,CAAEZ,CANe,CAAd,CAAlB,CAUAM,CAAS,CAACH,gBAAV,CAA2BG,CAAS,CAACO,MAAV,CAAiBC,cAA5C,CAA4D,SAAAV,CAAK,CAAI,CACjE,GAAIA,CAAK,CAACW,MAAN,CAAaC,MAAjB,CAAyB,CACrB,iBAAU,kBAAV,CAA8B,kBAA9B,EAAkDC,IAAlD,CAAuDC,KAAvD,EAAiEC,KAAjE,EACH,CAFD,IAEO,CACH,GAAMC,CAAAA,CAAe,CAAGhB,CAAK,CAACW,MAAN,CAAaM,QAAb,CAAsBC,GAAtB,CAA0B,SAAAC,CAAO,QAAIA,CAAAA,CAAO,CAACC,OAAZ,CAAjC,CAAxB,CACAC,UAAaC,eAAb,CAA6B,CACzBC,IAAI,CAAE,OADmB,CAEzBH,OAAO,CAAEJ,CAAe,CAACQ,IAAhB,CAAqB,MAArB,CAFgB,CAA7B,CAIH,CACJ,CAVD,EAYAtB,CAAS,CAACuB,IAAV,EACH,CA1BD,CA2BH,C","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 * Javascript module for contacting the site DPO\n *\n * @module tool_dataprivacy/contactdpo\n * @package tool_dataprivacy\n * @copyright 2021 Paul Holden <paulh@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport ModalForm from 'core_form/modalform';\nimport Notification from 'core/notification';\nimport {get_string as getString} from 'core/str';\nimport {add as addToast} from 'core/toast';\n\nconst SELECTORS = {\n CONTACT_DPO: '[data-action=\"contactdpo\"]',\n};\n\n/**\n * Initialize module\n */\nexport const init = () => {\n const triggerElement = document.querySelector(SELECTORS.CONTACT_DPO);\n\n triggerElement.addEventListener('click', event => {\n event.preventDefault();\n\n const modalForm = new ModalForm({\n modalConfig: {\n title: getString('contactdataprotectionofficer', 'tool_dataprivacy'),\n },\n formClass: 'tool_dataprivacy\\\\form\\\\contactdpo',\n saveButtonText: getString('send', 'tool_dataprivacy'),\n returnFocus: triggerElement,\n });\n\n // Show a toast notification when the form is submitted.\n modalForm.addEventListener(modalForm.events.FORM_SUBMITTED, event => {\n if (event.detail.result) {\n getString('requestsubmitted', 'tool_dataprivacy').then(addToast).catch();\n } else {\n const warningMessages = event.detail.warnings.map(warning => warning.message);\n Notification.addNotification({\n type: 'error',\n message: warningMessages.join('<br>')\n });\n }\n });\n\n modalForm.show();\n });\n};\n"],"file":"contactdpo.min.js"}
{"version":3,"file":"contactdpo.min.js","sources":["../src/contactdpo.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 * Javascript module for contacting the site DPO\n *\n * @module tool_dataprivacy/contactdpo\n * @copyright 2021 Paul Holden <paulh@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport ModalForm from 'core_form/modalform';\nimport Notification from 'core/notification';\nimport {get_string as getString} from 'core/str';\nimport {add as addToast} from 'core/toast';\n\nconst SELECTORS = {\n CONTACT_DPO: '[data-action=\"contactdpo\"]',\n};\n\n/**\n * Initialize module\n */\nexport const init = () => {\n const triggerElement = document.querySelector(SELECTORS.CONTACT_DPO);\n\n triggerElement.addEventListener('click', event => {\n event.preventDefault();\n\n const modalForm = new ModalForm({\n modalConfig: {\n title: getString('contactdataprotectionofficer', 'tool_dataprivacy'),\n },\n formClass: 'tool_dataprivacy\\\\form\\\\contactdpo',\n saveButtonText: getString('send', 'tool_dataprivacy'),\n returnFocus: triggerElement,\n });\n\n // Show a toast notification when the form is submitted.\n modalForm.addEventListener(modalForm.events.FORM_SUBMITTED, event => {\n if (event.detail.result) {\n getString('requestsubmitted', 'tool_dataprivacy').then(addToast).catch();\n } else {\n const warningMessages = event.detail.warnings.map(warning => warning.message);\n Notification.addNotification({\n type: 'error',\n message: warningMessages.join('<br>')\n });\n }\n });\n\n modalForm.show();\n });\n};\n"],"names":["SELECTORS","triggerElement","document","querySelector","addEventListener","event","preventDefault","modalForm","ModalForm","modalConfig","title","formClass","saveButtonText","returnFocus","events","FORM_SUBMITTED","detail","result","then","addToast","catch","warningMessages","warnings","map","warning","message","addNotification","type","join","show"],"mappings":";;;;;;;wLA4BMA,sBACW,2CAMG,eACVC,eAAiBC,SAASC,cAAcH,uBAE9CC,eAAeG,iBAAiB,SAAS,SAAAC,OACrCA,MAAMC,qBAEAC,UAAY,IAAIC,mBAAU,CAC5BC,YAAa,CACTC,OAAO,mBAAU,+BAAgC,qBAErDC,UAAW,qCACXC,gBAAgB,mBAAU,OAAQ,oBAClCC,YAAaZ,iBAIjBM,UAAUH,iBAAiBG,UAAUO,OAAOC,gBAAgB,SAAAV,UACpDA,MAAMW,OAAOC,2BACH,mBAAoB,oBAAoBC,KAAKC,YAAUC,YAC9D,KACGC,gBAAkBhB,MAAMW,OAAOM,SAASC,KAAI,SAAAC,gBAAWA,QAAQC,iCACxDC,gBAAgB,CACzBC,KAAM,QACNF,QAASJ,gBAAgBO,KAAK,cAK1CrB,UAAUsB"}
+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":"AAuBAA,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 * @package tool_dataprivacy\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":"AAwBAA,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 * @class events\n * @package tool_dataprivacy\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":"AAyBAA,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 * @class form-user-selector\n * @package tool_dataprivacy\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"}
+3 -2
View File
@@ -1,2 +1,3 @@
define ("tool_dataprivacy/myrequestactions",["exports","core/ajax","core/notification","core/pending","core/str"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=f(b);c=f(c);d=f(d);function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b){return m(a)||l(a,b)||j(a,b)||h()}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(a,b){if(!a)return;if("string"==typeof a)return k(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return k(a,b)}function k(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);c<b;c++){d[c]=a[c]}return d}function l(a,b){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(a)))return;var c=[],d=!0,e=!1,f=void 0;try{for(var g=a[Symbol.iterator](),h;!(d=(h=g.next()).done);d=!0){c.push(h.value);if(b&&c.length===b)break}}catch(a){e=!0;f=a}finally{try{if(!d&&null!=g["return"])g["return"]()}finally{if(e)throw f}}return c}function m(a){if(Array.isArray(a))return a}var n={CANCEL_REQUEST:"[data-action=\"cancel\"][data-requestid]"};a.init=function init(){document.addEventListener("click",function(a){var f=a.target.closest(n.CANCEL_REQUEST);if(null===f){return}a.preventDefault();(0,e.get_strings)([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then(function(a){var e=g(a,2),h=e[0],i=e[1];return c.default.confirm(h,i,h,null,function(){var a=new d.default("tool/dataprivacy:cancelRequest"),e={methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:f.dataset.requestid}};b.default.call([e])[0].then(function(b){if(b.result){window.location.reload()}else{c.default.addNotification({type:"error",message:b.warnings[0].message})}return a.resolve()}).catch(c.default.exception)})}).catch()})}});
//# sourceMappingURL=myrequestactions.min.js.map
define("tool_dataprivacy/myrequestactions",["exports","core/ajax","core/notification","core/pending","core/str"],(function(_exports,_ajax,_notification,_pending,_str){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _slicedToArray(arr,i){return function(arr){if(Array.isArray(arr))return arr}(arr)||function(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_ajax=_interopRequireDefault(_ajax),_notification=_interopRequireDefault(_notification),_pending=_interopRequireDefault(_pending);var SELECTORS_CANCEL_REQUEST='[data-action="cancel"][data-requestid]';_exports.init=function(){document.addEventListener("click",(function(event){var triggerElement=event.target.closest(SELECTORS_CANCEL_REQUEST);if(null!==triggerElement){event.preventDefault();(0,_str.get_strings)([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then((function(_ref){var _ref2=_slicedToArray(_ref,2),cancelRequest=_ref2[0],cancelConfirm=_ref2[1];return _notification.default.confirm(cancelRequest,cancelConfirm,cancelRequest,null,(function(){var pendingPromise=new _pending.default("tool/dataprivacy:cancelRequest"),request={methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:triggerElement.dataset.requestid}};_ajax.default.call([request])[0].then((function(response){return response.result?window.location.reload():_notification.default.addNotification({type:"error",message:response.warnings[0].message}),pendingPromise.resolve()})).catch(_notification.default.exception)}))})).catch()}}))}}));
//# sourceMappingURL=myrequestactions.min.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/myrequestactions.js"],"names":["SELECTORS","CANCEL_REQUEST","init","document","addEventListener","event","triggerElement","target","closest","preventDefault","key","component","then","cancelRequest","cancelConfirm","Notification","confirm","pendingPromise","Pending","request","methodname","args","requestid","dataset","Ajax","call","response","result","window","location","reload","addNotification","type","message","warnings","resolve","catch","exception"],"mappings":"kNAwBA,OACA,OACA,O,khCAGMA,CAAAA,CAAS,CAAG,CACdC,cAAc,CAAE,0CADF,C,QAOE,QAAPC,CAAAA,IAAO,EAAM,CACtBC,QAAQ,CAACC,gBAAT,CAA0B,OAA1B,CAAmC,SAAAC,CAAK,CAAI,CACxC,GAAMC,CAAAA,CAAc,CAAGD,CAAK,CAACE,MAAN,CAAaC,OAAb,CAAqBR,CAAS,CAACC,cAA/B,CAAvB,CACA,GAAuB,IAAnB,GAAAK,CAAJ,CAA6B,CACzB,MACH,CAEDD,CAAK,CAACI,cAAN,GAOA,kBALwB,CACpB,CAACC,GAAG,CAAE,eAAN,CAAuBC,SAAS,CAAE,kBAAlC,CADoB,CAEpB,CAACD,GAAG,CAAE,2BAAN,CAAmCC,SAAS,CAAE,kBAA9C,CAFoB,CAKxB,EAA4BC,IAA5B,CAAiC,WAAoC,cAAlCC,CAAkC,MAAnBC,CAAmB,MACjE,MAAOC,WAAaC,OAAb,CAAqBH,CAArB,CAAoCC,CAApC,CAAmDD,CAAnD,CAAkE,IAAlE,CAAwE,UAAM,IAC3EI,CAAAA,CAAc,CAAG,GAAIC,UAAJ,CAAY,gCAAZ,CAD0D,CAE3EC,CAAO,CAAG,CACZC,UAAU,CAAE,sCADA,CAEZC,IAAI,CAAE,CAACC,SAAS,CAAEhB,CAAc,CAACiB,OAAf,CAAuBD,SAAnC,CAFM,CAFiE,CAOjFE,UAAKC,IAAL,CAAU,CAACN,CAAD,CAAV,EAAqB,CAArB,EAAwBP,IAAxB,CAA6B,SAAAc,CAAQ,CAAI,CACrC,GAAIA,CAAQ,CAACC,MAAb,CAAqB,CACjBC,MAAM,CAACC,QAAP,CAAgBC,MAAhB,EACH,CAFD,IAEO,CACHf,UAAagB,eAAb,CAA6B,CACzBC,IAAI,CAAE,OADmB,CAEzBC,OAAO,CAAEP,CAAQ,CAACQ,QAAT,CAAkB,CAAlB,EAAqBD,OAFL,CAA7B,CAIH,CACD,MAAOhB,CAAAA,CAAc,CAACkB,OAAf,EACV,CAVD,EAUGC,KAVH,CAUSrB,UAAasB,SAVtB,CAWH,CAlBM,CAmBV,CApBD,EAoBGD,KApBH,EAqBH,CAlCD,CAmCH,C","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 * AMD module to enable users to manage their own data requests.\n *\n * @module tool_dataprivacy/myrequestactions\n * @package tool_dataprivacy\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Ajax from 'core/ajax';\nimport Notification from 'core/notification';\nimport Pending from 'core/pending';\nimport {get_strings as getStrings} from 'core/str';\n\nconst SELECTORS = {\n CANCEL_REQUEST: '[data-action=\"cancel\"][data-requestid]',\n};\n\n/**\n * Initialize module\n */\nexport const init = () => {\n document.addEventListener('click', event => {\n const triggerElement = event.target.closest(SELECTORS.CANCEL_REQUEST);\n if (triggerElement === null) {\n return;\n }\n\n event.preventDefault();\n\n const requiredStrings = [\n {key: 'cancelrequest', component: 'tool_dataprivacy'},\n {key: 'cancelrequestconfirmation', component: 'tool_dataprivacy'},\n ];\n\n getStrings(requiredStrings).then(([cancelRequest, cancelConfirm]) => {\n return Notification.confirm(cancelRequest, cancelConfirm, cancelRequest, null, () => {\n const pendingPromise = new Pending('tool/dataprivacy:cancelRequest');\n const request = {\n methodname: 'tool_dataprivacy_cancel_data_request',\n args: {requestid: triggerElement.dataset.requestid}\n };\n\n Ajax.call([request])[0].then(response => {\n if (response.result) {\n window.location.reload();\n } else {\n Notification.addNotification({\n type: 'error',\n message: response.warnings[0].message\n });\n }\n return pendingPromise.resolve();\n }).catch(Notification.exception);\n });\n }).catch();\n });\n};\n"],"file":"myrequestactions.min.js"}
{"version":3,"file":"myrequestactions.min.js","sources":["../src/myrequestactions.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 * AMD module to enable users to manage their own data requests.\n *\n * @module tool_dataprivacy/myrequestactions\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Ajax from 'core/ajax';\nimport Notification from 'core/notification';\nimport Pending from 'core/pending';\nimport {get_strings as getStrings} from 'core/str';\n\nconst SELECTORS = {\n CANCEL_REQUEST: '[data-action=\"cancel\"][data-requestid]',\n};\n\n/**\n * Initialize module\n */\nexport const init = () => {\n document.addEventListener('click', event => {\n const triggerElement = event.target.closest(SELECTORS.CANCEL_REQUEST);\n if (triggerElement === null) {\n return;\n }\n\n event.preventDefault();\n\n const requiredStrings = [\n {key: 'cancelrequest', component: 'tool_dataprivacy'},\n {key: 'cancelrequestconfirmation', component: 'tool_dataprivacy'},\n ];\n\n getStrings(requiredStrings).then(([cancelRequest, cancelConfirm]) => {\n return Notification.confirm(cancelRequest, cancelConfirm, cancelRequest, null, () => {\n const pendingPromise = new Pending('tool/dataprivacy:cancelRequest');\n const request = {\n methodname: 'tool_dataprivacy_cancel_data_request',\n args: {requestid: triggerElement.dataset.requestid}\n };\n\n Ajax.call([request])[0].then(response => {\n if (response.result) {\n window.location.reload();\n } else {\n Notification.addNotification({\n type: 'error',\n message: response.warnings[0].message\n });\n }\n return pendingPromise.resolve();\n }).catch(Notification.exception);\n });\n }).catch();\n });\n};\n"],"names":["SELECTORS","document","addEventListener","event","triggerElement","target","closest","preventDefault","key","component","then","cancelRequest","cancelConfirm","Notification","confirm","pendingPromise","Pending","request","methodname","args","requestid","dataset","call","response","result","window","location","reload","addNotification","type","message","warnings","resolve","catch","exception"],"mappings":"ikDA4BMA,yBACc,uDAMA,WAChBC,SAASC,iBAAiB,SAAS,SAAAC,WACzBC,eAAiBD,MAAME,OAAOC,QAAQN,6BACrB,OAAnBI,gBAIJD,MAAMI,sCAEkB,CACpB,CAACC,IAAK,gBAAiBC,UAAW,oBAClC,CAACD,IAAK,4BAA6BC,UAAW,sBAGtBC,MAAK,gDAAEC,uBAAeC,8BACvCC,sBAAaC,QAAQH,cAAeC,cAAeD,cAAe,MAAM,eACrEI,eAAiB,IAAIC,iBAAQ,kCAC7BC,QAAU,CACZC,WAAY,uCACZC,KAAM,CAACC,UAAWhB,eAAeiB,QAAQD,0BAGxCE,KAAK,CAACL,UAAU,GAAGP,MAAK,SAAAa,iBACrBA,SAASC,OACTC,OAAOC,SAASC,+BAEHC,gBAAgB,CACzBC,KAAM,QACNC,QAASP,SAASQ,SAAS,GAAGD,UAG/Bf,eAAeiB,aACvBC,MAAMpB,sBAAaqB,iBAE3BD"}
+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":"AAuBAA,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 * @package tool_dataprivacy\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
@@ -17,7 +17,6 @@
* Module to add categories.
*
* @module tool_dataprivacy/add_category
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -17,7 +17,6 @@
* Module to add purposes.
*
* @module tool_dataprivacy/add_purpose
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -17,7 +17,6 @@
* AMD module for categories actions.
*
* @module tool_dataprivacy/categoriesactions
* @package tool_dataprivacy
* @copyright 2018 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -17,7 +17,6 @@
* Javascript module for contacting the site DPO
*
* @module tool_dataprivacy/contactdpo
* @package tool_dataprivacy
* @copyright 2021 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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