Compare commits

..

740 Commits

Author SHA1 Message Date
Shamim Rezaie 91e6642f16 Moodle release 4.2.2 2023-08-11 23:20:32 +10:00
Jun Pataleta 62169983fd MDL-78983 core: Preserve default behaviour of flipping question icon
Introduce a lang string `questioniconfollowlangdirection` that will
allow the current behaviour of displaying the question mark icon
in RTL languages in the same manner as the current language.
2023-08-11 16:10:47 +07:00
Huong Nguyen 459659ce89 Merge branch 'MDL-78983-402' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-08-11 12:53:23 +07:00
Jun Pataleta 18e34acffb MDL-78983 core: Fix question mark icon direction flipping
This fixes the changes made in MDL-75047:
* Change `thisicondirection` langconfig string to a more specific one
  like `questionicondirection`.
* Use existing direction string value `ltr` for the value of
  `questionicondirection`. Also add a comment to at least provide some
  form of documentation for it.
* Improve the logic for applying the horizontal flipping class for the
  question icon:
  - Check first if the icon is a question icon
  - Flip the icon if `questionicondirection` is set to `rtl`.
2023-08-11 11:48:02 +08:00
Huong Nguyen 571777775e weekly release 4.2.1+ 2023-08-10 22:50:48 +07:00
Huong Nguyen 4945852c97 Merge branch 'install_402_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_402_STABLE 2023-08-10 22:50:46 +07:00
Ilya Tregubov a15550e7ff MDL-78790 gradereport_grader: Fix sorting. 2023-08-10 18:43:20 +07:00
meirzamoodle 61bc6ed948 MDL-78685 auth_oauth2: Added logged-in status check 2023-08-10 18:43:20 +07:00
Jun Pataleta 9e32013053 Merge branch 'MDL-78957_402' of https://github.com/stronk7/moodle into MOODLE_402_STABLE 2023-08-10 18:43:20 +07:00
Jun Pataleta 76420650aa Merge branch 'MDL-78962_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-08-10 18:43:20 +07:00
Jun Pataleta 922cc4d23e Merge branch 'MDL-77817-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-08-10 18:43:18 +07:00
Jun Pataleta 8cf476dc6d Merge branch 'MDL-78674-402' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-08-10 18:42:58 +07:00
Ilya Tregubov dc9c9d16f4 Merge branch 'MDL-78939-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-08-10 18:42:58 +07:00
Paul Holden 0923a3979e MDL-78790 gradereport_grader: normalise report sort parameter safely. 2023-08-10 18:42:58 +07:00
Paul Holden e6eb379544 MDL-78871 gradereport_grader: capability check getting report users. 2023-08-10 18:42:58 +07:00
Sara Arjona 59f6c64947 Merge branch 'MDL-76123-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-08-10 18:42:57 +07:00
Jun Pataleta 5aac33d755 Merge branch 'MDL-77378_402_v3' of https://github.com/TomoTsuyuki/moodle into MOODLE_402_STABLE 2023-08-10 18:42:57 +07:00
Michael Hawkins 82c04ab972 MDL-78763 tool_policy: Initialise returnurl as a moodle_url in viewall 2023-08-10 18:42:57 +07:00
Paul Holden 5047ae82f9 MDL-78792 message: access checks in processor fragment callback. 2023-08-10 18:42:57 +07:00
raortegar 3ef202da9c MDL-74289 lib: Improve the proxy bypass matching 2023-08-10 18:42:52 +07:00
Jun Pataleta fd65fe1bdf MDL-78674 calendar: No need to call get_course_and_cm_from_instance()
The course ID and CM id can already be fetched from the event object.
2023-08-10 09:37:58 +08:00
Santosh Nagargoje 9ffdcf3da1 MDL-78674 calendar: Added fix to rebuild module cache in calendar 2023-08-10 09:37:58 +08:00
Tim Hunt 8905ebffb7 MDL-78962 core/loadingicon: remove jQuery requirement in the API 2023-08-09 21:17:05 +01:00
Eloy Lafuente (stronk7) a3ed617072 MDL-78957 libraries: Fix php82 undefined property deprecation
This was detected only in master (4.3dev) because MDL-40084
added a unit test covering it. But the very same patch is
needed in 402_STABLE, no matter it's not covered there.
2023-08-09 15:26:58 +02:00
Paul Holden e3d93edc6d MDL-78647 files: safer unserializing of file reference data. 2023-08-09 04:53:19 +00:00
Shamim Rezaie 6f93f45c53 MDL-66212 tool_lpimport: properly check capabilities
The moodle/competency:competencymanage capability should be checked
before showing the import and export pages.
2023-08-09 04:53:19 +00:00
Matt Porritt d043d3daf7 MDL-78340 Blocks: Dashboards now respect block permission overrides
Patch makes user dashboard respect permission overrides
that have been set on individual blocks on the system
dashboard (indexsys.php). When a user dashboard is created
either when the user visits their dashboard for the first
time or after an admin reset. When blcoks are copied to
the new dashbaord overriden permissions are also copied.
2023-08-09 04:53:19 +00:00
Rajneel Totaram c85b2a4566 MDL-71728 mod_quiz: check if user can access this page 2023-08-09 04:53:19 +00:00
Huong Nguyen 1933e6a39f Merge branch 'MDL-78904-402' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-08-09 11:42:56 +07:00
Huong Nguyen 68366595f2 Merge branch 'MDL-75047-MOODLE_402_STABLE' of https://github.com/SysBind/moodle into MOODLE_402_STABLE 2023-08-09 11:30:15 +07:00
Jun Pataleta a8e8576e0b Merge branch 'MDL-78872-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-08-09 12:10:23 +08:00
Ilya Tregubov a14e8aaae7 Merge branch 'MDL-78714-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-08-09 12:05:05 +08:00
Huong Nguyen 1b05063d00 Merge branch 'MDL-78235-402' of https://github.com/lameze/moodle into MOODLE_402_STABLE 2023-08-09 10:43:03 +07:00
Ilya Tregubov ae4ae605b4 Merge branch 'MOODLE_402_STABLE_MDL-78860' of https://github.com/mattporritt/moodle into MOODLE_402_STABLE 2023-08-09 09:43:08 +08:00
Andrew Nicols 9de452c011 MDL-78714 editor_tiny: Disable HTML Sanitisation in TinyMCE
This is in keeping with other Editors such as Atto and resolves an issue
where DOM Purification incorrectly identifies HTML-like string content
as an HTML tag with a JS variable.

Moodle already performs XSS sanitisation using HTML Purifier in PHP.
2023-08-09 09:07:04 +08:00
Andrew Nicols ff9d561d82 MDL-78714 editor_tiny: Add xss_sanitize option to TinyMCE
To address a potential data loss issue, a feature introduced in TinyMCE
6.4.0 to disable client-side XSS sanitisation must be backported.
2023-08-09 09:05:25 +08:00
Andrew Nicols 5acae49336 MDL-78714 editor_tiny: Move TinyMCE import instructions to correct path 2023-08-09 09:05:23 +08:00
Huong Nguyen c5f9df8d11 Merge branch 'MDL-78492_aurora_mysql_rowformat_402' of https://github.com/mark-webster-catalyst/moodle into MOODLE_402_STABLE 2023-08-08 21:42:59 +07:00
Sara Arjona 08d97e4b30 Merge branch 'MDL-78770-402' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-08-08 13:55:32 +02:00
Sara Arjona 9a1aea7c91 Merge branch 'MDL-77658-MOODLE_402_STABLE' of https://github.com/SysBind/moodle into MOODLE_402_STABLE 2023-08-08 13:29:48 +02:00
Sara Arjona c662c08d89 Merge branch 'MDL-78559-402' of https://github.com/rmady/moodle into MOODLE_402_STABLE 2023-08-08 13:02:01 +02:00
Paul Holden ab962f6e20 MDL-76123 course: multilingual module icon alt text attribute. 2023-08-08 08:29:20 +01:00
Jun Pataleta a27734b6f1 Merge branch 'MDL-78896-402-enfix' of https://github.com/vmdef/moodle into MOODLE_402_STABLE 2023-08-08 15:29:14 +08:00
Paul Holden 3e11151348 MDL-78939 qformat_xml: fix reference to calculated question files. 2023-08-08 08:09:38 +01:00
AMOS bot 9b01237187 Automatically generated installer lang files 2023-08-08 00:10:35 +00:00
Helen Foster 63440b3216 MDL-78896 lang: Import fixed English strings (en_fix) 2023-08-07 11:26:45 +01:00
Ilya Tregubov 410d8cf0ba Merge branch 'MDL-78800_402' of https://github.com/stronk7/moodle into MOODLE_402_STABLE 2023-08-07 16:58:05 +08:00
Ilya Tregubov 9f24926e1a Merge branch 'MDL-78550-402' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-08-07 11:34:27 +08:00
chen levy cd2d34a055 MDL-77658 theme: Fixed RTL manage course categories menu
fixed course checkboxes that appears on the categories menu on RTL
2023-08-06 09:56:29 +03:00
Eloy Lafuente (stronk7) 11510dadbc MDL-78800 composer: Bump dependencies to current ones
This bumps direct dependencies to current ones:

- phpunit: 9.5.x No updates here, there is the 9.6.x series
  available but a lot of deprecation warnings have been
  introduced there without any alternative to use. See:
  - https://github.com/sebastianbergmann/phpunit/issues/5160
  - https://github.com/sebastianbergmann/phpunit/issues/5062
  - ...
  While that will be handy to prepare ourselves to PHPUnit 10
  in some months... we cannot force everybody to jump to 9.6.x
  because that will make a lot of tests to start emitting
  warnings.
  So we stay with PHPUnit 9.5.x for the life of this branch.
- mink-phpwebdriver: 1.2.1 No updates here, just changed the
  constraint because we cannot advance to 1.3.x yet, there is
  a change there causing some app tests to fail. See:
  - https://github.com/oleg-andreyev/MinkPhpWebDriver/pull/81
  So we stay with 1.2.x until that issue is fixed/clarified,
  only then we'll review the status.
- behat: 3.12.x => 3.13.x

And also, automatically, a bunch of 2nd and deepest dependencies.

Generated with php80 that is the lowest php version supported
by this branch and, also, by some of the dependencies, as per
documented @ https://moodledev.io/general/development/tools/composer

Worth mentioning behat/mink-goutte-driver, that we should move
to mink-browserkit-driver, but that's out from this issue scope.
2023-08-04 15:08:51 +02:00
Sara Arjona 6f40d9ffd7 weekly release 4.2.1+ 2023-08-04 12:40:05 +02:00
Jun Pataleta a5742d7845 MDL-78904 user: Remove non-existent require
* And enclose context parameter in an array.
2023-08-04 14:42:39 +08:00
Matt Porritt 6177a2f994 MDL-78860 qtype_calculatedmulti: PHP 8.2 compatibility
PHP 8.2 has deprecated setting properties on objects dynamically.
The qtype_calculatedmulti question type had two properties being
set this way($correctanswerlength and$correctanswerformat).
This patch extends the question_answer class to add the properties
when the object is instantiated.
2023-08-04 15:46:46 +10:00
meirzamoodle ab0a36e796 MDL-77817 editor_tiny: Fix menu and dialogue window position
The boost theme makes the TinyMCE editor rendered in a scrollable container,
scrolling the editor’s container will cause TinyMCE UI elements to be detached from the anchor.
Therefore, to keep the tinyMCE menu in the correct position,
adjustments must be made on the page drawers style.

When using TinyMCE editor in Safari browsers, a problem may occur where the dialogue
windows (such as modal dialogs) overlap with page drawers due to a specific behavior
in Safari's rendering. This function addresses the issue by adjusting the CSS overflow
property of the page drawers, ensuring they do not obscure the dialogue windows.
2023-08-03 11:40:17 +07:00
Jun Pataleta c3f70b3ef5 MDL-78498 mod_forum: Prevent race condition in forum recent activity
* Using the generator to create the forum discussions, the timecreated
of a discussion can be set before the user's last course access which
will prevent forum_print_recent_activity() from including this generated
discussion in the recent activity results. To work around this, generate
the forum discussion 1 second after the current time to make sure that
the user's last course access will always be before the discussion's
creation time.
* This patch also includes some optimisations by:
  - Removing the unnecessary @javascript tag for the
    `Time limit expires` scenario
  - Bringing the discussion generation to each scenario to allow each
    scenario to customise the data passed to the generator like for the
    `Time limit expires` scenario.
  - Navigating directly to the forum instance.
2023-08-03 11:33:24 +08:00
Ilya Tregubov abfdb19e80 Merge branch 'MDL-78866-402' of https://github.com/danghieu1407/moodle into MOODLE_402_STABLE 2023-08-03 09:38:55 +08:00
Ilya Tregubov 4fb54bb52f Merge branch 'MDL-78742-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-08-03 09:24:03 +08:00
Sara Arjona 46e3110812 Merge branch 'MDL-78460-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-08-02 08:51:06 +02:00
Jun Pataleta 2dc7fc1497 Merge branch 'MDL-78498-402' of https://github.com/lameze/moodle into MOODLE_402_STABLE 2023-08-02 11:23:10 +08:00
Paul Holden e30c0b63b7 MDL-78872 grade: fix external class execute method visibility. 2023-08-02 02:15:13 +01:00
Sara Arjona 7dbeef905e Merge branch 'MDL-78703-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-08-01 13:44:59 +02:00
danghieu1407 d7b79e57a9 MDL-78866 question: question_created trigger pre-saving extra fields 2023-08-01 16:00:49 +07:00
Simey Lameze bcd8431a7f MDL-78498 behat: add support for private replies
This commit adds support for private replies in the
'the following forum replies exist in course' custom step.
2023-08-01 16:08:00 +08:00
Angelia Dela Cruz 03795be887 MDL-78498 Behat: Use data generators for forum posts and replies
This commit does few things:
* Replace manual forum posts and replies to use data generator.
* It also changes the code to handle social forums.
* Other behat clean-ups and optimization.

Co-authored-by: Simey Lameze <simey@moodle.com>
2023-08-01 16:08:00 +08:00
Andrew Nicols b74cea9834 MDL-78632 core: Update upgrade versions 2023-08-01 09:31:11 +08:00
Andrew Nicols ce9eee67cb Merge branch 'M402-MDL-78632' of https://github.com/marcusboon/moodle into MOODLE_402_STABLE 2023-08-01 09:29:51 +08:00
Tomo Tsuyuki 1d1b5908db MDL-77378 qtype_multianswer: Fix division by zero errors 2023-08-01 11:25:42 +10:00
Michael Aherne 10cb2941e5 MDL-78235 userprofile: Check for defaultdata with isset(). 2023-07-31 19:32:55 +08:00
Jun Pataleta 1dc6a35d24 MDL-78550 core: Ensure spacing between more menu item attributes 2023-07-28 17:25:44 +08:00
Jun Pataleta 5c0af05e15 MDL-78550 grade: Hide empty filler rows from the accessibility tree 2023-07-28 17:25:22 +08:00
Jun Pataleta 997d5e44a8 MDL-78550 grade: Avoid rendering an empty <h2> heading 2023-07-28 17:25:21 +08:00
Jun Pataleta d351633fb9 MDL-78550 grade: Fix HTML validator errors
* Remove invalid "text" attribute in <td> elements
* Use proper id value for grade category checkboxes.
2023-07-28 17:25:20 +08:00
Marcus Boon db9b34b993 MDL-78632 filetypes: Introduce yaml file type 2023-07-28 15:27:26 +10:00
Ilya Tregubov e4919b0feb weekly release 4.2.1+ 2023-07-28 10:44:10 +08:00
Ilya Tregubov 520a212057 Merge branch 'MDL-78782-402' of https://github.com/ferranrecio/moodle into MOODLE_402_STABLE 2023-07-27 09:59:42 +08:00
Ferran Recio ad4e61c2a2 MDL-78782 behat: optimize with editing mode step
The current I am on course homepage with editing mode loads twice the
course page. This patch prevents this from happening by going directly
to editmode.php.
2023-07-26 16:20:06 +02:00
Huong Nguyen 170a0d0eb9 Merge branch 'MDL-78618_402' of https://github.com/larsbonczek/moodle into MOODLE_402_STABLE 2023-07-26 14:22:13 +07:00
Jun Pataleta 7629c4ff44 Merge branch 'MDL-78377-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-26 10:47:34 +08:00
Mark Webster afc6f0953c MDL-78492 dml: Better support for auroramysql
Aurora MySQL does not support row format COMPRESSED and falls back
to COMPACT if you try to use it, cuasing column size too large
errors if you try to use it with utf8mb4 collation.
2023-07-25 11:58:08 +01:00
Miri Lipson bbcf3db3c5 MDL-75047 icons: Define the orientation of the question mark in right-to-left languages. 2023-07-25 11:04:37 +03:00
Huong Nguyen acf600a9b4 weekly release 4.2.1+ 2023-07-21 20:56:27 +07:00
Huong Nguyen 917780c2cb Merge branch 'install_402_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_402_STABLE 2023-07-21 20:56:26 +07:00
Paul Holden 124a575813 MDL-78742 tool_uploadcourse: configure show activity dates value. 2023-07-20 16:28:39 +01:00
Jun Pataleta 1d12df6e12 MDL-78770 tiny_recordrtc: Use proper window.console.warn() function 2023-07-20 14:32:46 +08:00
Jun Pataleta e5acfffa04 MDL-78770 atto_recordrtc: Use proper window.console.warn() function 2023-07-20 14:23:14 +08:00
Huong Nguyen 9f2d2332de Merge branch 'MDL-78525-402' of github.com:HuongNV13/moodle into MOODLE_402_STABLE 2023-07-20 10:57:47 +07:00
Huong Nguyen d3e42f9a8b MDL-78525 core: Update upgrade.txt for count_words and count_letters 2023-07-20 10:53:56 +07:00
Ilya Tregubov b222d8927b Merge branch 'MDL-76854-subscription_deleted-402' of https://github.com/leonstr/moodle into MOODLE_402_STABLE 2023-07-20 10:49:32 +08:00
Huong Nguyen 44f4d3b123 Merge branch 'MDL-78525/402' of https://github.com/skodak/moodle into MOODLE_402_STABLE 2023-07-20 09:04:12 +07:00
Ilya Tregubov cfe04a6891 Merge branch 'MDL-75115-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-07-20 09:41:07 +08:00
Andrew Nicols 7f50d30e9f Merge branch 'MDL-78716-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-20 00:28:36 +08:00
Andrew Nicols 97fbf797c4 Merge branch 'MDL-78715-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-20 00:17:21 +08:00
Andrew Nicols 45561f7d84 Merge branch 'MDL-77645-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-20 00:11:36 +08:00
Andrew Nicols 3f3409cfd7 Merge branch 'MDL-77328-402-fix' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-07-19 23:47:51 +08:00
Andrew Nicols 66c3430f2d Merge branch 'MDL-78704-402' of https://github.com/rjnl/moodle into MOODLE_402_STABLE 2023-07-19 21:57:37 +08:00
Jun Pataleta ac846f9fd7 MDL-77328 qformat_xml: Avoid dynamic declaration for question_answer
Declare qformat_xml::answerfiles and qformat_xml::feedbackfiles instead
of dynamically declaring answerfiles and feedbackfiles for the
question_answer instance when exporting questions and answers to XML
format.
2023-07-19 14:33:41 +08:00
Jun Pataleta fe7295010e MDL-77328 qtype_caclulatedmulti: Use qtype_calculated_answer
The question answers for question type plugins extending
\qtype_calculated now have the type
\qtype_calculated\qtype_calculated_answer. So the answers for test
helper functions make_calculatedmulti_question_singleresponse() and
make_calculatedmulti_question_multiresponse() should also be changed
accordingly.
2023-07-19 14:33:41 +08:00
Jun Pataleta 5fe5629ef2 MDL-77328 qtype_caclulatedsimple: Use qtype_calculated_answer
The question answers for question type plugins extending
\qtype_calculated now have the type
\qtype_calculated\qtype_calculated_answer. So the answers for
make_calculatedsimple_question_sum() should be changed accordingly.
2023-07-19 14:33:41 +08:00
Jun Pataleta 6ec5cfa4e8 MDL-77328 qtype_calculated: Add upgrade.txt notes
* Question type plugins that extend qtype_calculated should be made
aware of the changes about the new question_answer type
\qtype_calculated\qtype_calculated_answer.
2023-07-19 14:33:41 +08:00
Jun Pataleta 91430abc21 Merge branch 'MDL-77328-402' of https://github.com/rezaies/moodle into MOODLE_402_STABLE 2023-07-19 09:54:18 +08:00
AMOS bot a6ef6a2253 Automatically generated installer lang files 2023-07-19 00:11:05 +00:00
Shamim Rezaie e88e9f6327 Merge branch 'MDL-78564-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-17 20:36:32 +10:00
Leon Stringer b755271b8d MDL-76854 tool_monitor: subscription_deleted ctx
Fix course context for subscription_deleted event when deleting rules
with multiple subscriptions.
2023-07-15 08:20:08 +01:00
Paul Holden f5aca82d20 MDL-78703 behat: fix HTTP GET method capitalization on redirect. 2023-07-15 00:59:59 +01:00
Paul Holden c7ac993b9e MDL-78715 payment: prevent action menus flowing under container. 2023-07-14 17:16:54 +01:00
Paul Holden 0bd734bdda MDL-78716 course: fix category idnumber updating logic.
Where only the case of the idnumber field was being updated, we
triggered an exception because checking for an exising idnumber
was not excluding the current category (i.e. the one being updated).
2023-07-14 15:14:16 +01:00
Paul Holden 79bfce98af MDL-78460 mod_forum: correctly render timed post label information. 2023-07-14 10:14:57 +01:00
Petr Skoda b3fa09d554 MDL-78525 core: fix word and character counting 2023-07-14 08:44:26 +02:00
Ilya Tregubov 0ac092cc92 weekly release 4.2.1+ 2023-07-14 09:25:36 +08:00
Rajneel Totaram 6b8b79c3f4 MDL-78704 course: Render unescaped HTML for activity dates 2023-07-14 10:19:54 +12:00
Tim Hunt b69cc0c26d MDL-76757 delete questions: fix message generation logic
The order was getting scrambled.
2023-07-13 21:43:48 +02:00
Meirza 6e4e0abad7 MDL-77328 qtype_multianswer: Refactor for PHP 8.2 compatibility
This commit addresses compatibility issues in the qtype_multianswer
question type. The following changes were made:

- The usage of the undeclared property $maxmark on subquestions in
  qtype_multianswer was identified as problematic. To resolve this,
  the existing declared property $defaultmark is now being used for
  the same purpose.

By switching to the declared property $defaultmark, compatibility with
PHP 8.2 is ensured and the issue with the undeclared property is
resolved.
2023-07-13 21:04:48 +10:00
Shamim Rezaie 35b64b004a MDL-77328 qtype_calculated: Refactor for PHP 8.2 compatibility
This commit addresses compatibility issues in the qtype_calculated
question type. The following problems were identified and resolved:

- qtype_calculated was reusing the qtype_numerical_answer class and
  setting two additional properties ($correctanswerlength and
  $correctanswerformat) that were not declared. To resolve this, a new
  class, qtype_calculated_answer, was defined and utilised.
- During grading in qtype_numerical, there were references to an
  undeclared property ($unitisright) used to track calculation details.
  This issue was fixed using a 'replace temp with query' refactoring.

These changes ensure the qtype_calculated question type is compatible
with PHP 8.2 and addresses the identified issues.
2023-07-13 21:04:48 +10:00
Meirza b8949b4c90 MDL-77328 qtype_truefalse: Refactor for PHP 8.2 compatibility
This commit addresses the following issues and improvements in the
qtype_truefalse class:

- Added missing class properties:
 - public $truefeedbackformat
 - public $falsefeedbackformat
 - public $showstandardinstruction
- Updated qtype_truefalse_question to include type hinting for better
  IDE support.
2023-07-13 21:04:48 +10:00
Jun Pataleta 89d84af752 Merge branch 'MDL-76046-402' of https://github.com/stevandoMoodle/moodle into MOODLE_402_STABLE 2023-07-13 11:19:36 +08:00
Huong Nguyen b7bf1d6fc3 Merge branch 'MDL-75195-402' of https://github.com/raortegar/moodle into MOODLE_402_STABLE 2023-07-13 09:57:55 +07:00
Huong Nguyen 68d5bfe6e3 Merge branch 'MDL-76757-402' of https://github.com/danghieu1407/moodle into MOODLE_402_STABLE 2023-07-13 09:46:44 +07:00
Ilya Tregubov af4ff2b867 Merge branch 'mdl-7133-402' of https://github.com/juancs/moodle into MOODLE_402_STABLE 2023-07-13 10:31:11 +08:00
Jake Dallimore 73ec043d4b Merge branch 'MDL-77912_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-07-13 10:09:26 +08:00
Andrew Nicols 951d0b8987 Merge branch 'MDL-78157-402' of https://github.com/golenkovm/moodle into MOODLE_402_STABLE 2023-07-13 09:48:03 +08:00
Andrew Nicols 2578646f10 Merge branch 'MDL-78556-402' of https://github.com/danghieu1407/moodle into MOODLE_402_STABLE 2023-07-13 09:28:49 +08:00
Andrew Nicols 10b7e70014 Merge branch 'MDL-76996_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-07-13 09:25:24 +08:00
Ilya Tregubov 3779f0fb4a Merge branch 'MDL-73213_402' of https://github.com/pedrojordao/moodle into MOODLE_402_STABLE 2023-07-13 09:18:09 +08:00
Sara Arjona c52c8e85dd Merge branch 'MDL-78673-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-07-12 18:18:08 +02:00
Andrew Nicols c18f100ea0 Merge branch 'MDL-77450-402' of https://github.com/andelacruz/moodle into MOODLE_402_STABLE 2023-07-13 00:09:58 +08:00
Andrew Nicols 954d38e6f2 Merge branch 'MDL-78676-402' of https://github.com/sarjona/moodle into MOODLE_402_STABLE 2023-07-13 00:06:22 +08:00
Sara Arjona 79b2271482 Merge branch 'MDL-78455-402' of https://github.com/andelacruz/moodle into MOODLE_402_STABLE 2023-07-12 17:37:07 +02:00
Sara Arjona 819aa90469 Merge branch 'MDL-78642-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-12 17:21:42 +02:00
Sara Arjona 6ac3d62125 Merge branch 'MDL-78522-402' of https://github.com/ilyatregubov/moodle into MOODLE_402_STABLE 2023-07-12 16:57:42 +02:00
Paul Holden 6bdf4bb2b1 MDL-77645 course: ensure active enrolments are considered for drawer.
Otherwise the enrolment index page tries to load the course index
drawer, which doesn't exist at this point and triggers exceptions in
the editor module.

Co-authored-by: Tim Volckmann <tim.volckmann@mastersolution.com>
2023-07-12 14:35:23 +01:00
Tim Hunt 22c57001d1 MDL-76996 question bank: fix errors when qbank_statistics is disabled 2023-07-12 11:47:17 +01:00
Sara Arjona 92ee7151e5 Merge branch '76319-gradebook-add-missing-continue-button-402' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_402_STABLE 2023-07-12 08:28:09 +02:00
Miri Lipson 0e2342d79d MDL-75115 theme_boost: Fix Bootstrap tooltips in RTL mode 2023-07-12 09:11:42 +07:00
Ilya Tregubov bcfc49e3ab Merge branch 'MDL-78216-402-1' of https://github.com/mihailges/moodle into MOODLE_402_STABLE 2023-07-12 09:47:49 +08:00
Tim Hunt 0fc9bfa71a MDL-77912 questions: make multi-choice stats calc robust to bad data 2023-07-11 16:57:58 +01:00
raortegar bed2352e67 MDL-75195 core: Added supportemail option to install_database.php 2023-07-11 11:13:54 +02:00
danghieu1407 38d1c5f174 MDL-78556 tablelib: flexible_table should support caption tag 2023-07-11 14:15:22 +07:00
Angelia Dela Cruz b98876efa1 MDL-77450 Behat: Behat cleanup and optimisation 2023-07-11 13:31:45 +08:00
Ilya Tregubov b0be75b9ac Merge branch 'MDL-67852_MOODLE_402_NEW' of https://github.com/aydevworks/moodle into MOODLE_402_STABLE 2023-07-11 11:11:54 +08:00
Ilya Tregubov 47cb335ea2 Merge branch 'MDL-77690-402' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-07-11 09:51:42 +08:00
Ilya Tregubov e046077a13 Merge branch 'MDL-75359-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-11 09:29:49 +08:00
Julien Boulen 96b5cb56e8 MDL-76319 gradebook: add continue button after csv grades import error 2023-07-10 10:18:31 +02:00
danghieu1407 bb7d15c7e0 MDL-76757 Question bank: Can not delete the question completely 2023-07-10 14:32:35 +07:00
Andrew Nicols a8105bccf9 MDL-78673 grade: Switch test to use generators 2023-07-10 11:28:00 +08:00
Andrew Nicols 6a79b98768 MDL-78673 grade: Switch to behat navigation steps 2023-07-10 11:27:09 +08:00
Andrew Nicols ded705eacd MDL-78673 grade: Address random failure due to toast 2023-07-10 11:26:38 +08:00
Andrew Nicols 2e8bbe2c94 MDL-78673 behat: Allow plugins to define their expansion of > 2023-07-10 11:26:38 +08:00
Andrew Nicols 3e34904ce9 Merge branch 'MDL-77180-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-09 22:14:11 +08:00
Alex Yeung b4deb483ce MDL-67852 tool_dataprivacy: Fix security checks 2023-07-09 14:51:32 +01:00
Juan Segarra Montesinos ebc281d14f MDL-71133 mod_assign: Grade decimals missing with marking workflow 2023-07-09 08:12:50 +02:00
Sara Arjona fdf3daa6a9 MDL-78676 mod_data: Check completion rules properly
The completion_rule_enabled() method was not checking all the fields
and, in some cases, it was returning false (because it was not checking
that "Count of entries" field was enabled).
2023-07-07 18:28:29 +02:00
Paul Holden 8c540d58f2 MDL-77180 customfield: allow entry of formatted category names.
Change the param type of the category name when editing to allow
for entry of multilang tags, the formatting of which is already
supported when returning category name.

Co-authored-by: Hiroto Kagotani <hiroto.kagotani@gmail.com>
2023-07-07 14:59:49 +01:00
Paul Holden a75a0a596e MDL-75359 reportbuilder: fixes for custom/user profile field elements.
Ensures cross-DB compatibility for all types of both custom and user
profile fields, specifically when they're filtered and/or aggregated.

Implement stress testing of both via appropriate report sources.
2023-07-07 14:43:24 +01:00
Ilya Tregubov d7a0dcbdae MDL-78522 cohort: Fix capability/visibility check. 2023-07-07 15:58:27 +08:00
Ilya Tregubov 2ef6a3b9b9 weekly release 4.2.1+ 2023-07-07 11:52:21 +08:00
Ilya Tregubov 4aa826356b Merge branch 'install_402_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_402_STABLE 2023-07-07 11:52:18 +08:00
Pedro Jordao f4727c3922 MDL-73213 autocomplete: keep selected value when the state changes.
The selected value of the dropdown was being cleared when the dropdown
was opened, this was causing an error when submitting the form if the
field was required. The main cause was that we were emptying the
select before loading new values, this solution was created because
of an issue where we could not deselect values if the list was
reloaded. To fix this problem, I added an empty option as the first
element of the select only when deselecting a certain item.
2023-07-06 15:42:57 -03:00
Lars Bonczek 67dea5b53b MDL-78618 core_course: use UNION in get_nearest_editable_subcategory 2023-07-06 18:52:17 +02:00
Sara Arjona 3231d72a96 Merge branch 'MDL-78391-402' of https://github.com/HuongNV13/moodle into MOODLE_402_STABLE 2023-07-06 11:03:11 +02:00
Huong Nguyen f1a8189dfb MDL-78391 atto_recordrtc: Fix recording issue with Chrome 2023-07-06 15:47:47 +07:00
Huong Nguyen 395f8c49d8 MDL-78391 tiny_recordrtc: Fix recording issue with Chrome 2023-07-06 15:47:44 +07:00
Sara Arjona bdd7ea645e Merge branch 'MDL-77375-402-patch' of https://github.com/ilyatregubov/moodle into MOODLE_402_STABLE 2023-07-06 10:12:22 +02:00
Paul Holden 882d676a66 MDL-78642 mod_assign: typecast portfolio button renderer return.
Internally the button return is nullable, which we need to account
for in the renderer.
2023-07-06 09:04:54 +01:00
Misha Golenkov 412231454f MDL-78379 js: Add missing newline character 2023-07-06 16:15:36 +10:00
Ilya Tregubov e9c4e02202 MDL-77375 tool_dataprivacy: Fix menus going floaty. 2023-07-06 13:11:47 +08:00
Jun Pataleta c17ed92914 Merge branch 'MDL-78391-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-07-06 11:59:15 +08:00
Jun Pataleta 3e592b11fe Merge branch 'MDL-78488_402' of https://github.com/t-schroeder/moodle into MOODLE_402_STABLE 2023-07-06 11:17:19 +08:00
Ilya Tregubov d5e8ce4743 Merge branch 'MDL-69983-402' of https://github.com/davewoloszyn/moodle into MOODLE_402_STABLE 2023-07-06 10:26:06 +08:00
Ilya Tregubov 57d3069711 Merge branch 'MDL-78608_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-07-06 09:57:00 +08:00
Jun Pataleta a5b351cf10 Merge branch 'MDL-78484-402' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_402_STABLE 2023-07-06 09:41:33 +08:00
Ilya Tregubov 2ad8691f81 Merge branch 'MDL-77375-402' of https://github.com/rezaies/moodle into MOODLE_402_STABLE 2023-07-06 09:20:36 +08:00
Jun Pataleta 4af519c068 Merge branch 'MDL-74893-MOODLE_402_STABLE-fix_auto_login_guest' of https://github.com/praxisdigital/moodle into MOODLE_402_STABLE 2023-07-06 09:14:17 +08:00
Paul Holden 079269febb Merge branch 'MDL-78542-402' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-07-05 17:13:19 +01:00
Andrew Nicols 3bdf0bdffe Merge branch 'MDL-78644-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-05 22:10:30 +08:00
Andrew Nicols 5f71eb0d12 Merge branch 'MDL-78338-402_toolbrickfieldlinkinnewwindow' of https://github.com/brickfield/moodle into MOODLE_402_STABLE 2023-07-05 22:01:48 +08:00
Rodrigo Mady 4e233eb6b0 MDL-78559 mod_chat: Fix chat report loading with TeX filter 2023-07-05 10:57:38 -03:00
Andrew Nicols 1eb52d00f1 Merge branch 'MDL-78622_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-07-05 21:56:14 +08:00
Andrew Nicols dee8468aa9 Merge branch 'MDL-64152-402' of https://github.com/snake/moodle into MOODLE_402_STABLE 2023-07-05 21:49:05 +08:00
Andrew Nicols 3c3bd19f49 Merge branch 'MDL-78614-402' of https://github.com/noeldemartin/moodle into MOODLE_402_STABLE 2023-07-05 20:30:28 +08:00
Paul Holden e2fd30a2c5 MDL-78644 files: more fault tolerant resizing of logos/icons.
If we cannot resize the given file (files such as ICO can't be, for
SVG it makes no sense), then we should just return the original file
as is rather than an error.
2023-07-05 12:51:36 +01:00
Ilya Tregubov 0db5c697d7 Merge branch 'MDL-78485-402' of https://github.com/stevandoMoodle/moodle into MOODLE_402_STABLE 2023-07-05 11:51:48 +08:00
Andrew Nicols 935664bc95 Merge branch 'MDL-78158-402' of https://github.com/andelacruz/moodle into MOODLE_402_STABLE 2023-07-05 10:23:55 +08:00
Andrew Nicols 178fe9f0c7 Merge branch 'MDL-77873-402' of https://github.com/lucaboesch/moodle into MOODLE_402_STABLE 2023-07-05 10:04:22 +08:00
Luca Bösch c65dabf79b MDL-77873 quiz: style the question number edit elements. 2023-07-04 23:06:59 +02:00
Huong Nguyen 2bcdfcf638 Merge branch 'MOODLE_402_MDL-77396_Fix' of https://github.com/Dineshdurai/moodle into MOODLE_402_STABLE 2023-07-04 16:15:26 +07:00
Huong Nguyen d8e0807dd2 Merge branch 'MDL-78596-coursecard-divider-402' of https://github.com/leonstr/moodle into MOODLE_402_STABLE 2023-07-04 15:28:01 +07:00
Huong Nguyen 86e27a7eb1 Merge branch 'MDL-78578-402' of https://github.com/snake/moodle into MOODLE_402_STABLE 2023-07-04 15:16:00 +07:00
Huong Nguyen a52d5c9e28 Merge branch 'MDL-76853-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-07-04 12:46:10 +07:00
Huong Nguyen 442c94a808 Merge branch 'MDL-78138-402' of https://github.com/lucaboesch/moodle into MOODLE_402_STABLE 2023-07-04 12:38:35 +07:00
Stevani Andolo c270d87fec MDL-78485 editor_tiny: Allowed script tag to be added in tinyMCE editor 2023-07-04 13:36:34 +08:00
Andrew Nicols 9047a30cd9 Merge branch 'MDL-75324-402' of https://github.com/lameze/moodle into MOODLE_402_STABLE 2023-07-04 13:30:04 +08:00
Andrew Nicols 3970ad4264 Merge branch 'MDL-76840_402' of https://github.com/uzimike/moodle into MOODLE_402_STABLE 2023-07-04 13:21:18 +08:00
Simey Lameze a51864ad26 MDL-75324 behat: use a proper step to verify completion status 2023-07-04 11:20:14 +08:00
AMOS bot 1169389d47 Automatically generated installer lang files 2023-07-04 00:11:41 +00:00
Angelia Dela Cruz 09792257fd MDL-78158 behat: Behat cleanup and optimisation 2023-07-04 07:49:46 +08:00
Sara Arjona 28005f7f39 Merge branch 'MDL-77868-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-03 17:29:35 +02:00
Sara Arjona 576ae57607 Merge branch 'MDL-76661-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-07-03 17:26:21 +02:00
Paul Holden a2a899b204 MDL-78377 grade: reset page number when filtering by group. 2023-07-03 12:54:53 +01:00
Angelia Dela Cruz 82fdb9e20e MDL-78158 Behat: Use data generators to add blocks 2023-07-03 18:59:19 +08:00
Tim Hunt 9512b017b2 MDL-78622 quiz: add question query must include contextid
It is logically requried and necessary for the query to use the index
2023-07-03 11:51:36 +01:00
Paul Holden 97ea22bc19 MDL-76661 mod_bigbluebuttonbn: fix meeting attendee role comparison. 2023-07-03 11:41:10 +01:00
Noel De Martin c3c2180169 MDL-78614 behat: Remove trailing quotes 2023-07-03 11:18:30 +02:00
Andrew Nicols e18af1ab61 MDL-78391 atto_recordrtc: Improve MacOS codec compatability 2023-07-03 16:52:28 +08:00
Andrew Nicols b31b0f7479 MDL-78391 tiny_recordrtc: Set filename according to container 2023-07-03 16:52:26 +08:00
Andrew Nicols 0f07221c64 MDL-78391 tiny_recordrtc: Switch to mp4 container for h264
Theh WebM container does not support H.264 / AVC.

For more information see:
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers#webm

General purpose video, preferably in an open format
WebM (ideally with MP4 fallback)
2023-07-03 16:52:07 +08:00
Andrew Nicols cf681dc724 MDL-78391 tiny_recordrtc: Improve codec selection
From my experimentation I have discovered that Safari does not properly
respect the standard MediaRecorder mimetype. Instead of using `codecs=`
it uses `codecs:`.

This change copies the codec array to have the list of possible codecs
include both codecs= and codecs: whilst remaining in order.
2023-07-03 16:50:13 +08:00
Andrew Nicols be8a7442e7 MDL-78391 tiny_recordrtc: Respect codec options
The audio and video plugins were overriding the wrong method, and thus
preventing selection of a relevant codec and breaking playback on some
devices.
2023-07-03 16:50:11 +08:00
Andrew Nicols 2f6c1b56e4 MDL-76853 editor_tiny: Refactor behat helpers into trait 2023-07-03 09:38:23 +08:00
Karen Holland e72f030874 MDL-78338 tool_brickfield: Allow link open in new window with warning 2023-07-01 23:11:18 +01:00
Shamim Rezaie 91acee489d MDL-77375 core_grades: set boundary of the dropdowns in grade setup page 2023-07-02 00:05:18 +10:00
Shamim Rezaie 72d853549a MDL-77375 gradereport_singleview: set boundary of the dropdowns 2023-07-02 00:05:18 +10:00
Shamim Rezaie 4059ac3e29 MDL-77375 tool_dataprivacy: set boundary of the dropdowns 2023-07-02 00:03:04 +10:00
Shamim Rezaie 1d724c4a4a MDL-77375 mod_forum: set boundary of the dropdown
Also removed the unnecessary button role from the <button> element
2023-07-02 00:03:03 +10:00
Shamim Rezaie 73da2849e5 MDL-77375 mod_assign: set overflow constraint boundary of the dropdowns 2023-07-02 00:03:03 +10:00
Shamim Rezaie 8dda51d57e MDL-77375 output: Allow additional options for dropdowns 2023-07-02 00:03:03 +10:00
Shamim Rezaie 5c945e1283 MDL-77375 theme: Re-fix the bootstrap scrollbar issue 2023-07-02 00:03:03 +10:00
Paul Holden ed5a1cdef1 MDL-78564 mod_assign: ensure submission statement is present.
Don't require acceptance of statement, if no such statements exists,
during assignment submission.
2023-06-30 14:20:02 +01:00
Jun Pataleta 5491e32ef3 MDL-77690 mod_lesson: Lesson accessibility fixes
* Set the heading levels of lesson pages appropriately to avoid skipped
heading issues.
* Add appropriate labels for tertiary navigation select menus.
2023-06-30 17:55:09 +08:00
Jun Pataleta abd334b104 MDL-77690 core: New activity_header method get_heading_level()
Add a new method for activity_header that determines the heading level
depending on whether the theme displays a heading for the activity
header (usually a h2 heading with the activity name).

E.g. in Boost, the activity name is already being displayed in a
heading. So page headings can be rendered as h2. However, on Classic,
the activity name is being displayed as a h2 heading. So headings need
to be adjusted for the activity pages.
2023-06-30 17:55:04 +08:00
Tim Schroeder 5014d7bbb4 MDL-78488 question bank: don't load statistics when they are disabled 2023-06-30 11:47:50 +02:00
Jun Pataleta d32cccf278 MDL-77690 user: Add sr-only heading for the user profile page 2023-06-30 17:45:25 +08:00
Jun Pataleta d6fc042d06 MDL-78542 mod_url: clicktoopen lang string fix
- Improve the grammatical structure of the lang string.
- Remove the mention of "link", for sighted users, it should already
be obvious that it's a link. For screen reader users, screen readers
already announce links. So it would be confusing for them to hear
something like "Click 'Moodle.org, link' link to open resource"
2023-06-30 17:27:45 +08:00
Jun Pataleta 628c5c07de MDL-78542 mod_url: Add a help text for URL resource name field
Add a help text explaining that the URL resource's name field will be
used for the link text. Also add basic guidelines about naming links for
the benefit of screen reader users.
2023-06-30 17:27:45 +08:00
Jun Pataleta eeabb5303f MDL-78542 mod_url: Use the module name for the URL resource's link text 2023-06-30 17:27:43 +08:00
Jun Pataleta 9f23aa9036 Merge branch 'MDL-78068-402' of https://github.com/laurentdavid/moodle into MOODLE_402_STABLE 2023-06-30 16:42:37 +08:00
Jake Dallimore 059dab5861 MDL-64152 library: Fix legacy LTI launches when using reverse proxy
LTI 1.1 uses OAuth 1.0, which requires 'hostname', among other things,
as part of signature verification. When Moodle is run behind a reverse
proxy, $_SERVER['SERVER_NAME'] is an unreliable way to fetch hostname.
It isn't always equal to the external hostname but instead can contain
the local host, meaning the signature verification will fail. This
change replaces the use of $_SERVER vars with $FULLME - which already
takes this into account - to fix the signature verification.

Co-authored-by: Berengar W. Lehr <Berengar.Lehr@uni-jena.de>
2023-06-30 16:42:02 +08:00
Franziska Hübler 1da8cc11f2 MDL-69983 backup: Save async backups in correct area. 2023-06-30 10:13:17 +10:00
AMOS bot fe7f1346bf Automatically generated installer lang files 2023-06-30 00:08:45 +00:00
Stevani Andolo e334506829 MDL-76046 core: Fixed secondary navigation on smaller screen 2023-06-30 06:31:05 +08:00
Luca Bösch d2c83565d9 MDL-78138 theme_boost: Reliably remove TYPE_CATEGORY breadcrumbs. 2023-06-29 21:42:31 +02:00
Tim Hunt 3c311cc9af MDL-78608 question stats: avoid loading data for missing contexts
It turns out that there are plugins which don't (currently)
clean up their question attempts when a context is deleted.
Therefore, we need to make Moodle core robust to that.
2023-06-29 16:26:13 +01:00
Huong Nguyen b509652427 weekly release 4.2.1+ 2023-06-29 22:22:17 +07:00
Andrew Nicols 024fe89697 Merge branch 'MDL-78599-402' of https://github.com/snake/moodle into MOODLE_402_STABLE 2023-06-29 11:33:06 +08:00
Jun Pataleta dc5f74ce5d Merge branch 'MDL-77993-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-29 11:27:58 +08:00
Jun Pataleta e6d3a4817e Merge branch 'MDL-78432-402' of https://github.com/laurentdavid/moodle into MOODLE_402_STABLE 2023-06-29 11:25:48 +08:00
Andrew Nicols c807000e6d Merge branch 'MDL-78018-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-29 11:01:57 +08:00
Ilya Tregubov 18e1093d07 Merge branch 'MDL-77286-402' of https://github.com/lameze/moodle into MOODLE_402_STABLE 2023-06-29 09:44:59 +08:00
Ilya Tregubov b401a8b4c9 Merge branch 'MDL-78521-402' of https://github.com/lameze/moodle into MOODLE_402_STABLE 2023-06-29 09:34:44 +08:00
Huong Nguyen 6c3cf7dce0 Merge branch 'MDL-77679_402' of https://github.com/mkassaei/moodle into MOODLE_402_STABLE 2023-06-28 21:17:53 +07:00
Jake Dallimore bafffc90d1 MDL-78599 enrol_lti: fix SQL syntax error in course grade sync 2023-06-28 12:40:33 +08:00
Jake Dallimore 4f5d62730f MDL-78599 enrol_lti: test covering decoupled, course context grade syncs
This covers the case where a course is published and the launch data
doesn't include the 'lineitem' property of the ags claim, meaning the
tool can manage its own line items.
2023-06-28 12:40:22 +08:00
Leon Stringer def6434c79 MDL-78596 core_course: Remove divider
With courselistshortnames enabled Moodle 3.11 and earlier showed
"Category | Short name" on the first line of course cards (for example
in block_myoverview).  From Moodle 4.0 the category is moved to the last
line making the first line "Short name |".  This change removes that
stray "|".
2023-06-27 17:40:15 +01:00
Simey Lameze e81aa45dec MDL-77286 behat: change window size to large to avoid random fails 2023-06-27 17:12:12 +08:00
Laurent David 7075ea60ea MDL-78432 mod_label: Process markdown in label name
* Process markdown and other allowed formats (see FORMAT_XXX) in get_label_name
so it does not display it as a litteral string in the course index menu.
2023-06-27 08:13:01 +02:00
Andrew Nicols cecd6ed530 Merge branch 'MDL-78459-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-27 13:14:23 +08:00
Ilya Tregubov 59227e27fa Merge branch 'MDL-78443-402' of https://github.com/jleyva/moodle into MOODLE_402_STABLE 2023-06-27 11:01:22 +08:00
Jake Dallimore 9434b600c9 MDL-78578 enrol_lti: permit launch cache access during launch redirects
This handles things like site policies, which store the current URL,
redirect to the policy agreement, then redirect back the current URL
afterwards. In such cases, we want to redirect back with 'launchid' set
so that we can fetch the id_token from the session cache. This is the
same thing we already do during account binding, so the patch only
makes sure the PAGE->url is properly set before calling require_login.
2023-06-27 10:06:14 +08:00
Dinesh Durai 62b3a19b17 MDL-77396 wiki: Fix print without background 2023-06-27 00:53:47 +05:30
mkassaei 2345dcbdfa MDL-77679 Drag and drop question type weird behavior 2023-06-26 17:04:41 +01:00
Jun Pataleta 8e90f17e65 Merge branch 'MDL-76724_402' of https://github.com/stronk7/moodle into MOODLE_402_STABLE 2023-06-26 19:26:00 +08:00
Laurent David b312ed4b11 MDL-78068 mod_h5pactivity: Fix sort the paragraph activity
* Fix sort the paragraph/sequencing activity report in H5P.
2023-06-26 08:42:44 +02:00
Jun Pataleta 961137d435 Merge branch 'MDL-78168-402-final' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-06-26 11:20:01 +08:00
Simey Lameze 33fc59cfc5 MDL-78521 behat: reload page before asserting content
This commit also reword a Scenario name to make it unique
2023-06-26 11:19:39 +08:00
Andrew Nicols 2273c1f8e7 Merge branch 'MDL-78237-402' of https://github.com/davewoloszyn/moodle into MOODLE_402_STABLE 2023-06-24 23:21:41 +08:00
Andrew Nicols 84b160f432 Merge branch 'MDL-76673-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-24 22:46:37 +08:00
Andrew Nicols ff32f911a3 Merge branch 'MDL-78544-402' of https://github.com/snake/moodle into MOODLE_402_STABLE 2023-06-24 22:26:41 +08:00
Andrew Nicols d8cecb3d25 Merge branch 'MDL-77152-MOODLE_402_STABLE' of https://github.com/sh-csg/moodle into MOODLE_402_STABLE 2023-06-24 22:17:43 +08:00
Andrew Nicols 3054ef4de3 Merge branch 'MDL-78172-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-24 21:59:58 +08:00
Eloy Lafuente (stronk7) a5aa29cd2a MDL-76724 phpcs: Moodle 4.2.x is going to use php80 to php82 only
Now that it has been decided to backport php82 to Moodle 4.2.x, we
can already fix the php versions to be checked by the coding
standard (they were previously open for the branch).
2023-06-24 12:29:53 +02:00
Eloy Lafuente (stronk7) 3ac9bda79a MDL-76724 environment: Moodle 4.3 requirements
Note that there aren't changes since Moodle 4.2
so this is a complete copy of the information
for that version.
2023-06-24 12:29:53 +02:00
Andrew Nicols cb6d999911 MDL-78168 mod_assign: Stop storing properties dynamically
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.

In these cases, mod_assign was treating other unrelated objects as its
personal object store. These have been updated to not require this.
2023-06-24 13:35:13 +08:00
Sara Arjona 56c8910c4b weekly release 4.2.1+ 2023-06-23 09:00:07 +02:00
Andrew Nicols f37ded7607 Merge branch 'MDL-78004_402' of https://github.com/mwehr/moodle into MOODLE_402_STABLE 2023-06-22 14:34:42 +02:00
Ilya Tregubov a70d3dcdb6 Merge branch 'MDL-78434-m402' of https://github.com/sammarshallou/moodle into MOODLE_402_STABLE 2023-06-22 14:34:42 +02:00
Julien Boulen 4e4264c058 MDL-77986 backup: trim extra white spaces on search forms 2023-06-22 14:34:42 +02:00
Andrew Nicols 470d53ca58 Merge branch 'MDL-78071-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-22 14:34:42 +02:00
Andrew Nicols 88d7a6c496 Merge branch 'MDL-78541/402' of https://github.com/skodak/moodle into MOODLE_402_STABLE 2023-06-22 14:34:42 +02:00
Andrew Nicols 9879ed8f06 Merge branch 'MDL-78350-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-22 14:34:41 +02:00
Andrew Nicols db9c75632a Merge branch 'MDL-68067-42' of https://github.com/Chocolate-lightning/moodle into MOODLE_402_STABLE 2023-06-22 14:34:41 +02:00
Andrew Nicols 4a8db46d03 Merge branch 'MDL-78056-402' of https://github.com/laurentdavid/moodle into MOODLE_402_STABLE 2023-06-22 14:34:41 +02:00
Andrew Nicols db19db585b Merge branch 'MDL-78263-402' of https://github.com/jleyva/moodle into MOODLE_402_STABLE 2023-06-22 14:34:41 +02:00
Andrew Nicols 2e9c7a7af5 Merge branch 'MDL-78435-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-22 14:34:41 +02:00
Andrew Nicols f3ef477d4c Merge branch 'MDL-75913-402' of https://github.com/davewoloszyn/moodle into MOODLE_402_STABLE 2023-06-22 14:34:40 +02:00
Andrew Nicols 087043b0fe Merge branch 'MDL-78477_402' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_402_STABLE 2023-06-22 14:34:40 +02:00
Andrew Nicols bcada07b27 Merge branch 'MDL-78159-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-22 14:34:40 +02:00
Andrew Nicols 8ddac57a20 Merge branch 'MDL-77865_MOODLE_402_STABLE' of https://github.com/tuanngocnguyen/moodle into MOODLE_402_STABLE 2023-06-22 14:34:40 +02:00
Andrew Nicols 2a9a1b8117 Merge branch 'MDL-78164-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-22 14:34:39 +02:00
hieuvu d91659242b MDL-78484 formslib: Move enable checkbox display before the date picker 2023-06-22 11:03:16 +07:00
Jake Dallimore 18339a5fa7 MDL-78544 forms: fix string to number comparison bug in duration element
Prior to PHP 8, 0 == "", but now no more. We should use empty instead.
See: https://www.php.net/manual/en/migration80.incompatible.php
2023-06-22 10:59:37 +08:00
Paul Holden ea5509263a MDL-78350 reportbuilder: parse javascript before rendering template. 2023-06-21 17:33:37 +01:00
Paul Holden 402709b93d MDL-78350 output: parse returned dynamic tab javascript when loading.
Ensure we don't create nested <script> tags when rendering templates,
which triggers console errors since 1ef815cd.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-06-21 17:25:37 +01:00
Petr Skoda 570405db75 MDL-78541 admin: ignore headings in admin_apply_default_settings()
This is a workaround for plugins that do not have
unique setting names.
2023-06-21 15:46:47 +02:00
Sara Arjona 4df28116eb Merge branch 'MDL-76635-402' of https://github.com/lameze/moodle into MOODLE_402_STABLE 2023-06-21 14:02:16 +02:00
Anupama Sarjoshi cc2638d1b2 MDL-78477 qbank_history: Fix and improve UI for edit menu delete option
Changes done to fix the warnings thrown in the history view when the
last version of a question is deleted and improved UI to display the
message and a Continue button, to navigate back to the Question bank.
2023-06-21 10:46:51 +01:00
Sara Arjona af3eebdcf9 Merge branch 'MDL-63120_Badges_cron_task_fails-MOODLE_402_STABLE' of https://github.com/mebis-lp/moodle into MOODLE_402_STABLE 2023-06-21 11:43:10 +02:00
Ilya Tregubov 3769c65a97 Merge branch 'MDL-77591-402' of https://github.com/justusdieckmann/moodle into MOODLE_402_STABLE 2023-06-21 16:58:18 +08:00
Meirza 8bdda22ea1 MDL-78159 lib: Added missing properties for core libraries
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-06-21 15:42:59 +07:00
Meirza 5dee6a318c MDL-78164 lib: Added class properties that are not declared in grade
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-06-21 14:47:46 +07:00
Ilya Tregubov b280b960e3 Merge branch 'MDL-76174_402' of https://github.com/larsbonczek/moodle into MOODLE_402_STABLE 2023-06-21 14:26:45 +08:00
Simey Lameze 3c566431b1 MDL-76635 comment: render the delete icon in the right place
Special thanks to Andrew Lyons.
2023-06-21 12:45:27 +08:00
Simey Lameze 104eb90f4d MDL-76635 behat: improve submission comments test 2023-06-21 12:45:27 +08:00
Andrew Nicols 692ca82c6d Merge branch 'MDL-78163-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-21 11:59:25 +08:00
Andrew Nicols 262c1241bf Merge branch 'MDL-78160-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-21 10:22:16 +08:00
Lars Bonczek 62036a3e8b MDL-76174 core_course: get_nearest_editable_subcategory performance fix 2023-06-20 14:42:54 +02:00
Ilya Tregubov 371d086fcb Merge branch 'MDL-78259-htmlpurify-media-tags-402' of https://github.com/ilyatregubov/moodle into MOODLE_402_STABLE 2023-06-20 14:36:50 +08:00
Julien Boulen bd7702ca83 MDL-78259 weblib: purify audio/video tags as inline elements 2023-06-20 14:34:10 +08:00
Ilya Tregubov 049c3e85f9 Merge branch 'MDL-77525/402' of https://github.com/skodak/moodle into MOODLE_402_STABLE 2023-06-20 13:04:28 +08:00
eWallah 0423dd3b75 MDL-68067 tool_mobile: Mobile tool link does not have a class attribute. 2023-06-20 10:26:13 +08:00
Jun Pataleta 0733bec58f Merge branch 'MDL-74021-402' of https://github.com/andelacruz/moodle into MOODLE_402_STABLE 2023-06-20 10:13:29 +08:00
Jun Pataleta 24496360d2 Merge branch 'MDL-78369_402' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_402_STABLE 2023-06-19 23:16:55 +08:00
Mihail Geshoski ac4099d93b MDL-78216 gradereport_grader: Fix overlapping caused by sticky cells 2023-06-19 22:19:59 +08:00
Paul Holden fab09fb1c6 MDL-78071 cohort: disable report actions for managed cohorts. 2023-06-19 15:05:20 +01:00
Meirza 22d912df33 MDL-78160 lib: Added class properties that are not declared in dml
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.

At the test_transaction_with_events() I changed $this->_called into $called local var,
since the $called is used inside the anonymous function I added the third param as
a variable passed by reference so the last assert can get the newest value.
2023-06-19 19:57:43 +07:00
Paul Holden 8f47df378a MDL-78459 tool_mobile: use site context in mobile manifest file.
Prevents debugging notices when the site shortname is formatted in
the response data.
2023-06-19 13:01:59 +01:00
Angelia Dela Cruz 218d456ca0 MDL-74021 behat: Page behat generators use UI
Replace steps that manually add page instances via the UI and use
Behat generators. This improves the speed of Behat test runs.

Co-authored-by: Simey Lameze <simey@moodle.com>
2023-06-19 17:09:20 +08:00
David Woloszyn d9c38222f2 MDL-75913 behat: Use alternatives to Atto in tests 2023-06-19 16:38:42 +10:00
David Woloszyn c9af94efcd MDL-75913 behat: Switch to TinyMCE editor iframe 2023-06-19 16:38:42 +10:00
David Woloszyn bfcc39996f MDL-75913 behat: Private files data generator 2023-06-19 16:38:42 +10:00
Andrew Nicols 0b80e3a887 MDL-75913 behat: Add support for file uploads in page generators 2023-06-19 16:38:42 +10:00
Andrew Nicols 7a35fe7213 MDL-75913 behat: Add support for file uploads in generators 2023-06-19 16:38:42 +10:00
Anders Rasmussen 3222658b8b MDL-74893 authentication: Fix auto-login guest
Fixed auto-login as guest, when Guest login button is hidden
2023-06-19 07:50:33 +02:00
Laurent David 91e6a55056 MDL-78056 mod_h5pactivity: Fix incorrect attempt report
* Fix interpretation of the results on the attempt report whenever case
sensitive option is enabled.
2023-06-19 06:12:01 +02:00
Paul Holden 6f97a0325c MDL-77868 mod_bigbluebuttonbn: default config for welcome editable.
The property was added to the config options in c3f4123b, however no
default value was provided, meaning if it was ever unset then a PHP
type error would be triggered on the null return.
2023-06-18 19:19:48 +01:00
Stefan Hanauska 377aa25c81 MDL-77152 files: Ensure trailing/leading slash 2023-06-18 16:22:20 +02:00
Petr Skoda 15217816ff MDL-77525 filter: add filtering stages 2023-06-17 16:48:40 +02:00
Paul Holden 53f513b9c6 MDL-78435 mod_assign: ensure due date is always after start date. 2023-06-16 18:41:58 +01:00
Juan Leyva a622730742 MDL-78443 course: Missing require for course_request 2023-06-16 10:17:40 +02:00
Andrew Nicols 95e0d9ce66 weekly release 4.2.1+ 2023-06-16 12:04:18 +08:00
Andrew Nicols 2d78e70d7b Merge branch 'install_402_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_402_STABLE 2023-06-16 12:04:15 +08:00
Angelia Dela Cruz 01b8a0b596 MDL-78455 Behat: Behat cleanup and optimisation for blog/tests/behat 2023-06-16 09:12:37 +08:00
Angelia Dela Cruz 6165917109 MDL-78455 Behat: Add Behat for adding, editing and deleting blog entries 2023-06-16 09:11:22 +08:00
Juan Leyva a98016f5c7 MDL-78263 airnotifier: keep notification name as part of the payload 2023-06-15 17:28:15 +02:00
Sara Arjona 686a27c470 Merge branch 'MDL-78165-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-06-15 10:17:05 +02:00
Andrew Nicols a6f69bb3e1 MDL-78165 mod_bigbluebuttonbn: Fetch cron status using API 2023-06-15 16:02:53 +08:00
Nathan Nguyen 5b8f9536e0 MDL-77865 qtype_ddwtos: fix incorrect inplace class 2023-06-15 15:02:14 +10:00
Ilya Tregubov 0bf0a489fb Merge branch 'MDL-70152-402-fix' of https://github.com/ilyatregubov/moodle into MOODLE_402_STABLE 2023-06-15 12:12:37 +08:00
Simey Lameze 7b5b10df16 MDL-70152 behat: reply to post using data generator 2023-06-15 12:03:54 +08:00
Andrew Nicols dfd3cf1ca2 Merge branch 'MDL-77224-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-15 12:02:24 +08:00
Andrew Nicols ca3cd0d583 Merge branch 'MDL-78066-402' of https://github.com/snake/moodle into MOODLE_402_STABLE 2023-06-15 11:26:47 +08:00
Andrew Nicols f526079781 Merge branch 'MDL-78461-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-15 11:23:21 +08:00
Andrew Nicols 4548c9ac70 Merge branch 'MDL-78385-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-15 11:07:13 +08:00
Andrew Nicols 8f15bff75d Merge branch 'MDL-78141-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-15 11:03:02 +08:00
Andrew Nicols 42c06e002a Merge branch 'MDL-69231-402' of https://github.com/lameze/moodle into MOODLE_402_STABLE 2023-06-15 10:59:34 +08:00
Ilya Tregubov a5cd8f3e91 Merge branch 'MDL-77542-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-15 10:36:59 +08:00
Ilya Tregubov 7a6deae378 Merge branch 'MDL-76733-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-06-15 10:23:09 +08:00
Andrew Nicols 13d0035479 Merge branch 'MDL-78165-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-15 10:00:01 +08:00
Andrew Nicols fb22161d75 Merge branch 'MDL-78478-402' of https://github.com/dasistwas/moodle into MOODLE_402_STABLE 2023-06-15 09:56:03 +08:00
Jake Dallimore 31e371e554 MDL-78066 enrol_lti: fix deep linking error in multiple grade items case
If an activity, like workshop or forum, has multiple grade items,
declarative binding of the grade item (line item) isn't supported.
Instead of throwing an exception, handle the case more elegantly
and just omit the 'add to gradebook' option for these activities.
2023-06-15 09:42:51 +08:00
Jake Dallimore 1aa2996451 MDL-78066 enrol_lti: test showing multi-grade-items failure
This test demonstrates the failure of the repository to properly fetch
published resources which are compatible with declarative line item
binding.
2023-06-15 09:42:48 +08:00
Andrew Nicols d33ae4187d MDL-76733 mod_assign: Remove JS requirement for time-based tests
Converting these tests to use an onlinetext submission and drop the JS
requirement means that they are much less susceptible to runtime issues,
and not susceptible to those caused by JS at all.
2023-06-15 09:34:06 +08:00
Andrew Nicols 1a6d3fe529 MDL-76733 mod_assign: Address random failure
This random failure was happening because of the time required to render
and interact with the file picker which sometimes exceeded 2 seconds,
depending on the speed of the machine running the tests.

Converting these tests to use an onlinetext submission and drop the JS
requirement means that they are much less susceptible to runtime issues,
and not susceptible to those caused by JS at all.
2023-06-15 09:33:42 +08:00
Ilya Tregubov ce7eed3bbc Merge branch 'MDL-78102-402' of https://github.com/sarjona/moodle into MOODLE_402_STABLE 2023-06-15 09:03:46 +08:00
AMOS bot 4ef6372aa4 Automatically generated installer lang files 2023-06-15 00:16:27 +00:00
Sara Arjona 289afaad9b Merge branch 'MDL-78055-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-14 16:54:52 +02:00
Sara Arjona 052c85bd72 Merge branch 'MDL-74824-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-14 16:51:06 +02:00
Sara Arjona 3cb0f37200 Merge branch 'MDL-76733-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-06-14 16:22:17 +02:00
David Bogner 9113605691 MDL-78478 forms: Fix repeated elements in dynamic forms 2023-06-14 15:39:05 +02:00
Meirza 352932e61f MDL-78165 lib: Added class properties that are not declared in classes
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-06-14 20:18:24 +07:00
Paul Holden 98080048cd MDL-78055 themes: account for undefined extrascsscallback config.
Where a theme didn't define this property, it would raise debugging
deprecation warnings in PHP8.1.
2023-06-14 13:51:09 +01:00
Paul Holden eb1b246855 MDL-78385 course: fix non-AJAX activity indentation URL parameter. 2023-06-14 13:00:40 +01:00
Sara Arjona 0c357b9b3f Merge branch 'MDL-76715-402' of https://github.com/aanabit/moodle into MOODLE_402_STABLE 2023-06-14 13:18:20 +02:00
Sara Arjona d0c63dda2e Merge branch 'MDL-64648-402_enrol_manual_expirynotify_default_in_enrol_instance' of https://github.com/vtos/moodle into MOODLE_402_STABLE 2023-06-14 13:08:19 +02:00
Jun Pataleta 4b90d6a142 Merge branch 'MDL-78466-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-06-14 16:00:25 +08:00
Jake Dallimore 0e0af39f4b Merge branch 'MDL-78144-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-14 14:16:24 +08:00
Ilya Tregubov 79d4938240 Merge branch 'MDL-70152-402' of https://github.com/andelacruz/moodle into MOODLE_402_STABLE 2023-06-14 13:24:40 +08:00
Jun Pataleta 25be7facf2 Merge branch 'MDL-76445-402-patch' of https://github.com/ilyatregubov/moodle into MOODLE_402_STABLE 2023-06-14 12:18:49 +08:00
Andrew Nicols 36d7db23d0 MDL-78466 cache: Add new result_found helper
This helper is intended to prevent recurrences of this issue by moving
the guess-work to something well tested.
2023-06-14 11:58:06 +08:00
Meirza 020f7e655a MDL-78144 libraries: Added #[AllowDynamicProperties] to ltiprovider
To prevent the PHP 8.2 warning about Dynamic Properties' deprecation,
the #[\AllowDynamicProperties] attributes was added.
2023-06-14 10:28:24 +07:00
Meirza b613c4bbde MDL-78163 lib: Added class properties that are not declared in form
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-06-14 09:53:22 +07:00
Jun Pataleta ace64f66e3 Merge branch 'MDL-78313-blocks-performance-MOODLE_402_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_402_STABLE 2023-06-14 10:15:36 +08:00
Andrew Nicols e528b5dab4 MDL-78466 cache: Perform strict test on static cache values
If a statically accelerated cache returns an empty array then the value
was still fetched from the non-static cache store.

The check of the `$result` should be strictly checked against `false`,
which is the value used if no value was found.
2023-06-14 09:27:25 +08:00
Ilya Tregubov eb0e8f6bd5 MDL-76445 gradereport_singleview: Fix Behat test
When you unenrol a user, the notification blocks some tertiary
navigation links.
2023-06-14 09:05:00 +08:00
vtos 76b28ab6c0 MDL-64648 enrol_manual: fixed default setting of 'expirynotify'
When creating a course, a manual enrolment instance is added by default. The instance settings should inherit the values of those
for the manual enrolment plugin and properly calculate its extra settings. The 'expirynotify' setting wasn't inherited correctly
in case it had 'Enroller + Enrolled' value.
A functional test was added to test the behaviour of settings inheritance.
2023-06-13 18:21:28 +02:00
Paul Holden 10bc8af009 MDL-78461 core: fix base plugininfo class reference to root directory. 2023-06-13 14:05:24 +01:00
Sara Arjona 32f001d98d MDL-78102 badges: Check empty backpack email/password
For backpack connection using OBv2.0, email and password can't be
blank.
This patch adds some extra checks to validate this and displays an
error to the users before trying to connect to the backpack.
Besides, the error displayed when any error is returned by the
backpack (like invalid credentials), has also been improved, to
make it clearer for the users.
2023-06-13 11:21:58 +02:00
sam marshall 029325bb3b MDL-78434 Lib: PHP 8.1 incompatible code relating to LDAP\Connection 2023-06-13 09:46:01 +01:00
Brendan Heywood 2f6ef17322 MDL-78313 admin: Improve performance of manage blocks page
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-06-13 17:49:57 +10:00
Ilya Tregubov 10d4819083 Merge branch 'MDL-76445-402-2' of https://github.com/mihailges/moodle into MOODLE_402_STABLE 2023-06-13 15:45:50 +08:00
Amaia Anabitarte aa85dad6c1 MDL-76715 mod_data: Remove data_records when the last field is deleted 2023-06-13 09:33:30 +02:00
Mihail Geshoski 3415229bf1 MDL-76445 gradereport_singleview: Usability fixes 2023-06-13 15:14:21 +08:00
Mihail Geshoski 40d2a8cb93 MDL-76445 gradereport_user: Usability fixes 2023-06-13 15:14:21 +08:00
Mihail Geshoski 932ebd1c2e MDL-76445 grade: Helper that returns all gradable users in a course 2023-06-13 15:14:21 +08:00
Jake Dallimore afd992fd6d Merge branch 'MDL-73052-402' of https://github.com/sarjona/moodle into MOODLE_402_STABLE 2023-06-13 14:44:37 +08:00
Andrew Nicols 167d24f052 MDL-78297 core: Bump version to update cache config
The missing version bump caused cache configuration to not be updated,
and the static acceleration cache size was therefore not updated. The
result here was that the static acceleration cache was constantly
emptied leading to an increased page load time.
2023-06-13 11:05:57 +08:00
michaelkotlyar f45045aa85 MDL-76840 mod_assign: Account for extension when calculating time left. 2023-06-13 14:53:02 +12:00
Anupama Sarjoshi cc2512d450 MDL-78369 Multiple choice: Increase Choice and feedback boxes size 2023-06-12 12:07:47 +01:00
Jun Pataleta 3a1b6ac250 Merge branch 'MDL-75937-402' of https://github.com/stevandoMoodle/moodle into MOODLE_402_STABLE 2023-06-12 16:10:31 +08:00
Stevani Andolo 56edfcf6d5 MDL-75937 admin: Fixed config data display inconsistency 2023-06-12 15:24:51 +08:00
Jake Dallimore cd7b95205b Merge branch 'MDL-78167-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-12 15:06:32 +08:00
Andrew Nicols c6d04cbb1c Merge branch 'MDL-78166-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-12 12:25:53 +08:00
Andrew Nicols 13ba731659 Merge branch 'MDL-78355-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-12 10:26:56 +08:00
Andrew Nicols 7886051f83 Merge branch 'MDL-78297-402' of https://github.com/MartinGauk/moodle into MOODLE_402_STABLE 2023-06-12 10:19:13 +08:00
Paul Holden b1b41636a4 MDL-77224 mod_h5pactivity: clean up attempt data on activity deletion. 2023-06-11 18:37:08 +01:00
Paul Holden fff6b8b710 MDL-77993 mod_lesson: ensure report action menu always present. 2023-06-11 18:35:09 +01:00
Paul Holden 64734d59af MDL-74824 user: fix custom change password URL in login notification. 2023-06-11 17:41:01 +01:00
Paul Holden 419fcadcc8 MDL-78018 mod_assign: format group name in grading table. 2023-06-11 15:02:31 +01:00
Paul Holden 900534adc0 MDL-77542 mod_assign: remove duplicate grade heading from grader.
It's already part of the subsequent rendered form.
2023-06-11 15:01:28 +01:00
Paul Holden a30b75f9f8 MDL-78172 mod_forum: ensure group names are correctly formatted. 2023-06-11 15:00:23 +01:00
Ilya Tregubov 8c989335be Moodle release 4.2.1 2023-06-10 14:07:52 +08:00
Justus Dieckmann 87dc0ccfc3 MDL-77591 mod_assign: Fix feedback zip import for group submissions
Import now checks whether assignment is an group submission and
matches group ids instead of user ids in that case.

Additionally check for original unchanged files to not import in
group files instead of user files.
2023-06-09 14:47:27 +02:00
Ilya Tregubov d4937c4527 weekly release 4.2+ 2023-06-09 13:14:22 +08:00
Sara Arjona 62e7dc94d9 Merge branch 'MDL-78415-402-enfix' of https://github.com/vmdef/moodle into MOODLE_402_STABLE 2023-06-08 20:33:07 +02:00
Víctor Déniz cf40395830 MDL-78415 lang: Fix typo in Behat tests 2023-06-08 18:48:39 +01:00
Víctor Déniz ab62e5f23f MDL-78415 lang: Fix Behat tests regressions after merging en_fix strings 2023-06-08 11:52:38 +01:00
Víctor Déniz a29056941b MDL-78415 lang: Add parameter to reopencolumn string 2023-06-08 11:51:59 +01:00
Helen Foster 78db6582ba MDL-78415 lang: Import fixed English strings (en_fix) 2023-06-08 11:50:02 +01:00
David Woloszyn 80db7a0873 MDL-78237 editor_tiny: Prevent navbar obscuring modal content 2023-06-08 17:15:12 +10:00
David Woloszyn f77fe1c652 MDL-78237 css: Make navbar height available for non sass-use 2023-06-08 17:15:12 +10:00
Sara Arjona b1ccbfc24d Merge branch 'MDL-77946-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-08 06:56:51 +02:00
Sara Arjona 8c9545ca78 Merge branch 'MDL-78308-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-08 06:48:35 +02:00
Andrew Nicols 5b48a61484 Merge branch 'MDL-75696_402_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_402_STABLE 2023-06-08 12:31:03 +08:00
Andrew Nicols ef3eb09347 Merge branch 'MDL-78364-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-08 12:18:50 +08:00
Andrew Nicols abff2a6570 Merge branch 'MDL-78008_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-06-08 12:10:28 +08:00
Andrew Nicols 15afb64771 Merge branch 'MDL-77933-402' of https://github.com/snake/moodle into MOODLE_402_STABLE 2023-06-08 12:03:17 +08:00
Andrew Nicols c8631653cd MDL-76838 core: Add unit test for invalid unicode sequences 2023-06-08 11:59:14 +08:00
Andrew Nicols 30add0c159 Merge branch 'MDL-76838-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-08 11:54:25 +08:00
Cameron Ball 2fbb766149 MDL-75898 assignfeedback_editpdf: Improve page count mismatch logic
MDL-45580 introduced the readonlypages filearea, and when loading
page images for an attempt, the code would check if the pages existed
, creating them if not. The code inside this block also contained
a guard clause for the case where no readonly pages existed - which
is a situation that should not happen. Whenever readonly pages are
requested, they should exist.

MDL-66626 introduced a situation where page counts not matching would
also retrigger page generation. However this led to a situation where
the guard clause could be entered when requesting readonly pages.

This patch refactors the guard clause, and improves the logic to
regenerate pages.
2023-06-08 11:44:19 +08:00
Cameron Ball 3fa41951f3 MDL-75898 assignfeedback_editpdf: Don't poll readonly pages
When requesting the readonly version of pages (which contain
teacher annotations), they should always be available - the
PHP side even throws an exception when they're not. This
means we don't need to worry about polling document converters
from the JS side and can just return the pages immediately.
2023-06-08 11:44:19 +08:00
Cameron Ball 3d02f36f87 MDL-75898 assignfeedback_editpdf: Add randomness to PDF annotations
The behat step "I draw on the pdf" creates the exact same line every
time it is called. This can cause issues in a situation like the following:

- Student uploads PDF
- Teacher annotates page 1
- Student edits submission, adding another PDF
- Teacher annotates page 1 again
- When the student looks at their annotated PDF it appears the same as
  before they added the second PDF (i.e., they don't see extra pages for
  the second PDF)

Exactly why this happens isn't clear, and in practice this probably never
happens because the chances of drawing the exact same line twice are almost
0. However, when testing the functionality added in MDL-45580 it was causing
issues.
2023-06-08 11:44:19 +08:00
Andrew Nicols dcd20bec34 Merge branch 'MDL-78026-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-08 11:36:40 +08:00
Andrew Nicols fec48e90ac Merge branch 'MDL-77264-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-08 11:34:06 +08:00
Andrew Nicols 1a469cda51 Merge branch 'MDL-76821-402' of https://github.com/snake/moodle into MOODLE_402_STABLE 2023-06-08 11:29:11 +08:00
Jake Dallimore f98b725610 MDL-77933 enrol_lti: return site name and logo during registration
Instead of the Moodle icon and the 'moodle' lang string, return the
site fullname and compact logo during dynamic registration.
2023-06-08 11:28:38 +08:00
Andrew Nicols cc9f2527a8 Merge branch 'MDL-77799-m402' of https://github.com/sammarshallou/moodle into MOODLE_402_STABLE 2023-06-08 11:21:14 +08:00
Andrew Nicols 8e5f9ca9d4 Merge branch 'MDL-78408-402' of https://github.com/snake/moodle into MOODLE_402_STABLE 2023-06-08 11:05:20 +08:00
Jun Pataleta d247ea08e9 Merge branch 'MDL-78036_402' of https://github.com/stronk7/moodle into MOODLE_402_STABLE 2023-06-08 11:03:33 +08:00
Andrew Nicols eab902354f Merge branch 'wip_MDL-78400_m42' of https://github.com/gjb2048/moodle into MOODLE_402_STABLE 2023-06-08 10:51:34 +08:00
Andrew Nicols d3e4957556 Merge branch 'MDL-76406-402' of https://github.com/safatshahin/moodle into MOODLE_402_STABLE 2023-06-08 10:37:53 +08:00
Jun Pataleta 40b68fd88f Merge branch 'MDL-76842-402' of https://github.com/snake/moodle into MOODLE_402_STABLE 2023-06-08 10:34:37 +08:00
Jun Pataleta c180b1babd Merge branch 'MDL-78229-402' of https://github.com/lucaboesch/moodle into MOODLE_402_STABLE 2023-06-08 10:30:34 +08:00
Jun Pataleta a1e281a31d Merge branch 'MDL-78431-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-06-08 10:28:25 +08:00
Jake Dallimore ab12596a7b MDL-76842 enrol_lti: fix user record updates in user_repository
Only call user_update_user when the relevant user data has changed,
preventing unnecessary user_updated events. This also removes the
line setting timemodified on the user since user_update_user already
handles this.
2023-06-08 10:28:24 +08:00
Jake Dallimore fd5585777f MDL-76842 enrol_lti: test confirming the erroneous user_updated events
This test will fail until the fix - only updating users when data has
changed - is put in place in the following commit.
2023-06-08 09:37:45 +08:00
Jake Dallimore 5132a27822 MDL-76842 auth_lti: don't update the user unless data has changed
When receiving data from the LTI launch, or service call, only update
the user record when we know something has changed. This prevents the
creation of many \core\event\user_updated events.
2023-06-08 09:37:44 +08:00
Stevani Andolo 9f6fbc11dd MDL-78215 core: Added support unit test 2023-06-08 09:36:40 +08:00
Stevani Andolo a801a741b9 MDL-78215 core: support checking if 0.0.0.0 is in subnet 2023-06-08 09:36:40 +08:00
Jake Dallimore 685be3d41b MDL-76842 auth_lti: don't update the user after membership creation
This isn't required and generates excess events. The only thing update
does, other than update the user fields, is to update the picture, but
in this case, that's unset in membership-based auths anyway, so it's
entirely safe to remove this.
2023-06-08 09:36:17 +08:00
Jake Dallimore 0e504f73ee MDL-76842 auth_lti: test confirming the erroneous user_updated events
This test will fail until the fix - only updating users when data has
changed - is put in place in the following commit.
2023-06-08 09:36:16 +08:00
Jun Pataleta 7dfcc7e3f5 Merge branch 'MDL-78378-402' of https://github.com/sarjona/moodle into MOODLE_402_STABLE 2023-06-07 23:25:42 +08:00
Jun Pataleta 35500db40c Merge branch 'MDL-76745_402_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_402_STABLE 2023-06-07 22:54:16 +08:00
Andrew Nicols cfb5b76ba7 MDL-78431 core: Abort after config for source maps 2023-06-07 21:07:43 +08:00
Sara Arjona ff68353e39 Merge branch 'MDL-78322-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-07 12:43:03 +02:00
Sara Arjona 0f410c087a Merge branch 'MDL-78352-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-07 12:41:11 +02:00
Sara Arjona e160cdd8a7 Merge branch 'MDL-78047-402' of https://github.com/stevandoMoodle/moodle into MOODLE_402_STABLE 2023-06-07 18:14:20 +08:00
Sara Arjona d25ad8aaf9 Merge branch 'MDL-78010-402' of https://github.com/ferranrecio/moodle into MOODLE_402_STABLE 2023-06-07 18:14:20 +08:00
Sara Arjona c938c41de8 Merge branch 'MDL-78143-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-07 18:14:19 +08:00
Sara Arjona 04996f2cf8 Merge branch 'MDL-78147-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-07 18:14:19 +08:00
Martin Gauk 801ccfebe4 MDL-78297 core: Less cache lookups in deprecated capabilities feature
Avoid use of $cache->has.
2023-06-07 12:07:14 +02:00
sam marshall 5481c31fe6 MDL-77799 webservice_rest: unhandled exception should go in server log 2023-06-07 10:02:05 +01:00
Jake Dallimore 79a9167a1e MDL-78408 core: fix restoration of anchor to wantsurl during login 2023-06-07 14:28:57 +08:00
Stevani Andolo 4d035d0f80 MDL-78047 core_courseformat: Wrapping added to text and media activity 2023-06-07 12:58:52 +08:00
Paul Holden cd885856f3 MDL-77193 mnet: correct sorting of access control table. 2023-06-07 09:53:31 +08:00
Meirza 5f67d77aae MDL-78147 h5p: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-06-07 05:17:33 +07:00
Ferran Recio d59a10108c MDL-78010 mod_label: improve upgrade performance 2023-06-06 21:33:16 +02:00
Meirza b4cf5c50bf MDL-78143 lib: Added class properties in html purifier
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-06-06 21:48:13 +07:00
Paul Holden e5e6bb9764 MDL-78355 xapi: correct coverage notation for delete state test. 2023-06-06 12:04:09 +01:00
Eloy Lafuente (stronk7) 71440dc236 MDL-78036 behat: Move all links from old docs to new counterparts 2023-06-06 12:38:49 +02:00
Petr Skoda 75264720ac MDL-76683 core_group: fix template 2023-06-06 09:33:15 +00:00
Hiroto Kagotani 735c2c6b47 MDL-76936 course: purge course cache on resetting start date 2023-06-06 11:22:39 +02:00
Paul Holden 319d3954f8 MDL-78364 reportbuilder: earlier calculation of schedule recipients. 2023-06-05 16:22:30 +01:00
Gareth Barnard 0fc6e59121 MDL-78400 JavaScript: Building JS puts build files in src dir on Win. 2023-06-05 14:54:24 +01:00
Luca Bösch ace6e8db3d MDL-78229 quiz: quiz editing page less narrow.
This is a backport of MDL-77872.
2023-06-02 08:34:08 +02:00
Sara Arjona 2d4d196f97 MDL-73052 page: Fix page description when it has only an image
This is as regression of MDL-72413, when description was moved to a
standard module API.
In some cases, when description has only images, it's was not
displayed.
2023-06-02 08:20:42 +02:00
Sara Arjona 2970f0f433 MDL-78378 survey: Display default introduction when description is empty
This is a regression when the activity pages were redessigned in Moodle
4.0. The default introduction should be displayed when the activity
description is empty.
2023-06-02 08:19:53 +02:00
Simey Lameze 719b351f86 MDL-69231 behat: remaining work for role capability generator
This commit does few things:
* Unify data generators usage to role short name.
* Replace remaining manual steps to use the new data generator.
* Also replaced other manual steps to set config to use data generators.
* Tidy up of some tests, aligning pipes and splitting one line steps into multiple lines.
* Fixes tests to have one Given/When/Then per scenario.
2023-06-02 12:45:36 +08:00
Andrew Nicols fc2b45f960 MDL-69231 behat: Update tests to use new generator 2023-06-02 12:45:36 +08:00
Andrew Nicols fb6e93d98a MDL-69231 tests: Add role capability setting generator 2023-06-02 12:45:36 +08:00
Andrew Nicols 1281e34e02 MDL-69231 tests: Improve existing role generator
Support definition of context levels and permissions.
2023-06-02 12:45:36 +08:00
Safat 4899d8c11a MDL-76406 core: Add environment check for versions not supporting 8.2 2023-06-02 12:05:24 +10:00
Ilya Tregubov 20302d4f86 weekly release 4.2+ 2023-06-02 09:55:35 +08:00
Ilya Tregubov d1053fe035 Merge branch 'install_402_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_402_STABLE 2023-06-02 09:55:33 +08:00
Mark Johnson 5d361ee332 MDL-76745 cache: Implement cache_loader_with_locking in cache_disabled
If a plugin attempts to do something that would lock coursemodinfo cache
during install (such as creating a course module), this currently fails
as check_lock_state is not implemented in cache_disabled. Adding the
cache_loader_with_locking interface ensures that all lock methods are
implemented.
2023-06-01 15:04:39 +01:00
Brendan Heywood a43b2b2998 MDL-77749 admin: Fix code error with unset config duration 2023-06-01 13:32:37 +08:00
Jun Pataleta cf46e93304 Merge branch 'MDL-78092-m402' of https://github.com/sammarshallou/moodle into MOODLE_402_STABLE 2023-06-01 11:36:32 +08:00
Andrew Nicols bb7b0f996d Merge branch 'MDL-78383_m402' of https://github.com/jrchamp/moodle into MOODLE_402_STABLE 2023-06-01 11:12:45 +08:00
Andrew Nicols 9c5e63cf17 Merge branch 'MDL-78146-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-01 11:07:03 +08:00
Andrew Nicols 5d89ce0058 Merge branch 'MDL-78327_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-06-01 10:52:31 +08:00
Ilya Tregubov 6143ad4b1b Merge branch 'MDL-78196-402' of https://github.com/jleyva/moodle into MOODLE_402_STABLE 2023-06-01 10:40:17 +08:00
Andrew Nicols d54edef0f7 Merge branch 'MDL-78142-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-06-01 09:54:24 +08:00
Ilya Tregubov 02d2e80bae Merge branch 'MDL-77259-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-06-01 09:29:39 +08:00
Ilya Tregubov 5cf5134a12 Merge branch 'MDL-75961-402' of https://github.com/lameze/moodle into MOODLE_402_STABLE 2023-06-01 09:08:02 +08:00
AMOS bot 5112c89929 Automatically generated installer lang files 2023-06-01 00:11:06 +00:00
Juan Leyva fab3b2ccbc MDL-78196 user: Fix files used space check 2023-05-31 17:15:18 +02:00
Sara Arjona 56f75d7aea Merge branch 'MDL-76693-402' of https://github.com/roland04/moodle into MOODLE_402_STABLE 2023-05-31 17:08:55 +02:00
Simey Lameze 2f10bf1a1f MDL-77547 behat: run recalculate task before checking values 2023-05-31 15:04:54 +02:00
Tim Hunt 0384f8dfa0 MDL-78327 question stats: store same timestamp for all question stats 2023-05-31 12:02:23 +01:00
Sara Arjona e05576d74c Merge branch 'MDL-77547-402' of https://github.com/andelacruz/moodle into MOODLE_402_STABLE 2023-05-31 12:51:25 +02:00
Sara Arjona 01b577ee65 Merge branch 'MDL-77907-402' of https://github.com/andelacruz/moodle into MOODLE_402_STABLE 2023-05-31 12:18:07 +02:00
Sara Arjona 0f5a1a61f7 Merge branch 'MDL-78145-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-05-31 12:09:24 +02:00
Sara Arjona b4479d7981 Merge branch 'MDL-78148-402' of https://github.com/ferranrecio/moodle into MOODLE_402_STABLE 2023-05-31 11:42:12 +02:00
Sara Arjona 2a2badacb2 Merge branch 'MDL-73648-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-31 11:38:13 +02:00
Jonathan Champ eb0585ea72 MDL-78383 cache: Remove unused class property configlockmappings 2023-05-30 19:45:28 -04:00
Ilya Tregubov 7faf41dce5 Merge branch 'MDL-73138-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-30 12:54:09 +08:00
Ilya Tregubov 6aa360ae83 Merge branch 'MDL-77723-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-30 12:44:28 +08:00
AMOS bot 804e8b62da Automatically generated installer lang files 2023-05-30 00:10:40 +00:00
Jun Pataleta 1092a998ae Merge branch 'MDL-78314-402' of https://github.com/lucaboesch/moodle into MOODLE_402_STABLE 2023-05-29 17:35:15 +08:00
Mikel Martín 027e3c6660 MDL-76693 core_course: Fix activity chooser summary overlap
In activity chooser modal, there is an overlap issue in the information "sub-page".
Changing some classes in the layout solves the problem.
2023-05-29 09:38:32 +02:00
Ferran Recio 2b407d891f MDL-78148 core_courseformat: reduce the use of uniqid in templates 2023-05-29 08:40:20 +02:00
Angelia Dela Cruz 865ca1d6a2 MDL-70152 behat: Forum behat generators use UI
Behat cleanup and optimisation
2023-05-29 10:30:44 +08:00
Angelia Dela Cruz 0f11899e33 MDL-70152 behat: Forum behat generators use UI
Replace steps that manually add forum and forum post instances
via the UI and use Behat generators. This improves the speed of
Behat test runs.
2023-05-29 10:30:32 +08:00
Andrew Nicols da0459f75f MDL-70152 forum: Create behat data generator
* Convert track_read_posts.feature to use activity and discussion
data generators as exmaple.

Co-authored-by: Jun Pataleta <jun@moodle.com>
2023-05-29 10:30:32 +08:00
Meirza 8a5b788914 MDL-76673 atto: Check color contrast only on elements that have text
If the content in Atto is wrapped by an element with only a background color, without text color,
the accessibility checker will use the parent text-color as the foreground color, which is owned by form-control,
it becomes a problem if the wrapped element background using #34274f and the parent text-color is #495057 then
the low contrast as a result.

To avoid such a situation, the patch will only calculate color contrast if only the element has text,
so it will give results per element if the accessibility checker is unsatisfied.
2023-05-27 14:01:09 +07:00
Meirza 5d893a4748 MDL-76673 tiny: Check color contrast only on elements that have text
If the content in Tiny is wrapped by an element with only a background color, without text color,
the accessibility checker will use the parent text-color as the foreground color, which is owned by form-control,
it becomes a problem if the wrapped element background using #34274f and the parent text-color is #495057 then
the low contrast as a result.

To avoid such a situation, the patch will only calculate color contrast if only the element has text,
so it will give results per element if the accessibility checker is unsatisfied.

The patch also changes the selected element from 'body > *' to 'body *',
so it will return all elements (parents and children) in the content instead of parents only.

And minor modifications on the warning_content.mustache to fix the numbering format.
2023-05-27 14:01:09 +07:00
Meirza 1b284001ac MDL-78146 lib: Added missing class properties in phpmailer
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-27 11:27:14 +07:00
Meirza b3350a0ea7 MDL-78145 lib: Added missing class properties in pear
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-27 11:11:29 +07:00
Meirza 0ffed15ee4 MDL-78142 lib: Added class properties that are not declared in bennu
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-27 09:50:11 +07:00
meirzamoodle a385c75dca MDL-78141 libraries: Apply some changes from ADOdb 5.22.5
To make Moodle 4.2 compatible with PHP 8.2 regarding the deprecation of dynamic properties,
several changes have been made from version 5.22.5 (https://github.com/adodb/adodb/compare/v5.22.4...v5.22.5) and
then applied the changes to Moodle 4.2.
2023-05-27 09:48:13 +07:00
Meirza 62bd66ccf9 MDL-78166 lib: Added missing class properties in portfolio
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.

Removing the existing $id property at portfolio_format_leap2a_writer, because
the $id only needed inside the __construct().
2023-05-27 09:29:33 +07:00
Meirza 0e7a7318af MDL-78167 lib: Added missing class properties in tests
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.

Adding @runTestsInSeparateProcesses and removing setUp() and tearDown() at the
component_test.php, so the test will run in a separate process making sure that
whatever changes happen to the in-memory version of the component class in its thread,
therefore does not impact other tests and makes it more safe.
2023-05-27 09:27:10 +07:00
Eloy Lafuente (stronk7) d20cf16533 MDL-78036 behat: Fix php81 deprecation warning 2023-05-26 18:04:18 +02:00
Luca Bösch 3e13847324 MDL-78314 quiz: style button fieldset in "Manually grade question". 2023-05-26 15:10:33 +02:00
Paul Holden 24f646038c MDL-78352 webservice: use default user context page heading. 2023-05-26 12:27:40 +01:00
Wehr Mario b29be1a2ed MDL-78004 cache: Fix deprecated null value in Redis connect 2023-05-26 13:24:32 +02:00
Paul Holden 928760f865 MDL-73648 badges: add Behat generator class for creating badges. 2023-05-26 12:19:20 +01:00
Paul Holden 9a3f097da5 MDL-73138 group: remove double encoding of group/role names. 2023-05-26 10:25:42 +01:00
Paul Holden 1198d57f71 MDL-73138 user: avoid double encoding participant filter values. 2023-05-26 10:25:42 +01:00
Sara Arjona 6b8884e13b weekly release 4.2+ 2023-05-26 09:28:41 +02:00
Sara Arjona 7edbca66f9 Merge branch 'install_402_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_402_STABLE 2023-05-26 09:28:36 +02:00
Jun Pataleta e0c8854480 Merge branch 'MDL-78346-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-05-25 16:22:41 +08:00
Andrew Nicols 7d5b30290f MDL-78346 tool_langimport: Print any notifications before redirect 2023-05-25 14:54:58 +08:00
Jun Pataleta 3e2bf77656 Merge branch 'MDL-78339-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-25 12:01:10 +08:00
Jun Pataleta 15b0cd25e6 Merge branch 'MDL-76065-402' of https://github.com/lameze/moodle into MOODLE_402_STABLE 2023-05-25 11:57:05 +08:00
Jun Pataleta e99fcecdf9 Merge branch 'MDL-78320-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-25 11:48:47 +08:00
Jun Pataleta 5feb510035 Merge branch 'MDL-78346-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-05-25 11:43:43 +08:00
Andrew Nicols cae92e5a92 MDL-78346 tool_langimport: Redirect after action to prevent resubmission 2023-05-25 11:14:15 +08:00
Andrew Nicols 1342f28224 MDL-78346 tool_langimport: Prevent uninstallation of invalid targets 2023-05-25 11:14:14 +08:00
Andrew Nicols b0b214bbf2 Merge branch 'MDL-77341-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-05-25 10:46:32 +08:00
Andrew Nicols 1ff32127d4 Merge branch 'MDL-78307-402' of https://github.com/dpalou/moodle into MOODLE_402_STABLE 2023-05-25 10:42:57 +08:00
Andrew Nicols a443a29b79 Merge branch 'MDL-77995-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-25 09:50:34 +08:00
Paul Holden f92c748a2d MDL-78320 quiz_overview: format group names in overview report. 2023-05-24 16:19:32 +01:00
Andrew Nicols af0f37405f Merge branch 'MDL-77983-402' of https://github.com/rjnl/moodle into MOODLE_402_STABLE 2023-05-24 21:15:03 +08:00
= 3180479b87 MDL-63120 core_badges: Avoid multiple joins in sql statement 2023-05-24 13:35:27 +02:00
Dani Palou fb71a7a8c7 MDL-78307 quiz: Fix URL passed to secure_window.init_close_button 2023-05-24 13:10:45 +02:00
Dani Palou b10afcdd4c MDL-78307 quiz: Fix contexturl passed to attempt_overdue message 2023-05-24 13:10:45 +02:00
Paul Holden 93c35a89bb MDL-78339 webservice: correctly namespace external API. 2023-05-24 09:38:08 +01:00
Jun Pataleta 43fdf37a96 Merge branch 'MDL-78005-402' of https://github.com/davewoloszyn/moodle into MOODLE_402_STABLE 2023-05-24 12:06:45 +08:00
Simey Lameze b490a0ae08 MDL-75961 behat: review and enhance mod_imscp tests
This commit makes the following improvements to mod_imscp tests:
* Removes unnecessary @javascript and @_file_upload tags from non-JS tests.
* Removes user/enrol data generation from tests that can be performed as admin.
* Removes "I log out" and other unnecessary steps.
2023-05-24 10:40:44 +08:00
Angelia Dela Cruz 80410a354b MDL-75961 behat: IMSCP behat generators use UI
Replace steps that manually add IMSCP instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-05-24 10:40:44 +08:00
Sara Arjona b1b0c2d59b Merge branch 'MDL-78176_402' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_402_STABLE 2023-05-23 17:45:52 +02:00
Sara Arjona aa7aec1088 Merge branch 'MDL-78242-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-23 17:36:54 +02:00
Jun Pataleta 7bae6c8ca6 Merge branch 'MDL-76688/402' of https://github.com/skodak/moodle into MOODLE_402_STABLE 2023-05-23 15:22:14 +08:00
Angelia Dela Cruz 7a5806d3cb MDL-77547 Behat: Coverage to check for bad multichoice questions 2023-05-23 15:16:04 +08:00
Simey Lameze 279cc50e5c MDL-76065 behat: Review and enhance mod_lti Behat tests
In this commit, the following improvements were made to the mod_lti Behat tests:

* Replaced manual steps with data generators to set completion.
* Eliminated unnecessary user and course enrolments data generation as some tests can be performed as an admin.
* Removed the @javascript tag from non-JS tests.
* Updated the LTI data generator to generate an internal Moodle URL in the toolurl field, enabling the use of XML files.
2023-05-23 12:13:53 +08:00
Angelia Dela Cruz dc4ff6a2f5 MDL-76065 behat: LTI behat generators use UI
Replace steps that manually add LTI instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-05-23 12:13:53 +08:00
Andrew Nicols 7c64a411d7 MDL-76733 mod_assign: Tidy up availability behat tests
This feature had lots of small issues and it made sense to fix it whilst
investigating a query:

* most of the steps do not require JavaScript
* it uses the UI to set an admin setting, for every scenario:
** only 3-4 of the scenarios actually test that setting
** it is very slow to do it his way when we have a generator step we can use
* we create two assignments in the Background, but each test only uses one of them
* we create the assignments in the Background with a generator, but
  update them to modify various settings in each Scenario using the UI
  when we should just create one assignment for each test and set it up
  correctly for that Scenario
2023-05-23 10:55:42 +08:00
Andrew Nicols fb343534d0 Merge branch 'MDL-78170-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-23 10:28:05 +08:00
Andrew Nicols b4935649b3 Merge branch 'MDL-78087-402' of https://github.com/sarjona/moodle into MOODLE_402_STABLE 2023-05-23 10:26:39 +08:00
AMOS bot 0d426e571a Automatically generated installer lang files 2023-05-23 00:10:30 +00:00
Paul Holden b938b53096 MDL-76838 backup: remove invalid utf8 code sequences writing XML.
The surrogate blocks FFFE and FFFF are non-characters, specifically
disallowed in the character range for XML documents.
2023-05-22 21:04:07 +01:00
Paul Holden 525b69dc69 MDL-78322 tool_cohortroles: don't assign roles to deleted users. 2023-05-22 20:14:34 +01:00
Tim Hunt 5630f86d81 MDL-78008 qtype_multianswer: random guess score with missing subqs
Sometimes, due to other bugs, subquestions can get lost, so the code
needs to be robust to this.
2023-05-22 17:01:59 +01:00
Sara Arjona 30ac87781a Merge branch 'MDL-78211-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-22 17:41:42 +02:00
Sara Arjona 2b9a9286d0 Merge branch 'MDL-78226-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-22 17:29:21 +02:00
Sara Arjona 2e6d8b72b1 Merge branch 'MDL-78225-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-22 12:04:13 +02:00
sam marshall 2724eb6041 MDL-78092 Cache: Modinfo locking with Redis store does not work
The feature added in 4.1 to lock the modinfo cache does not work when
using Redis, because:

* The API to acquire a cache lock is confusing, and the code did not
  check that it successfully acquired a lock before going on to build
  the cache anyway.

* Unlike the other types of cache lock, the Redis store did not retry
  the lock for a timeout period before giving up and failing.

This change fixes both points.
2023-05-22 10:44:15 +01:00
Jun Pataleta df8413ade0 Merge branch 'MDL-78157-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-05-22 15:29:36 +08:00
Andrew Nicols 414f0df046 MDL-78157 js: Be more careful about inserting missing module names
It is perfectly legitimate to create and/or use a method named `define`
in JS outside of RequireJS.

Unfortunately our requirejs.php wrapper is dumb and does not understand
this.

In the long term we need to stop doing this at all. We really should be
able to already, but every time I try to something prevents it.

In the interim, this change adds a secondary check to see if there is an
existing define which _does_ have the right name in it already.
2023-05-22 14:40:41 +08:00
Jun Pataleta 29a7e00f9c Merge branch 'MDL-78323-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-05-22 14:29:10 +08:00
Andrew Nicols 81b9a51fb7 MDL-78323 gradereport_grader: Fix jsdoc syntax 2023-05-22 09:23:47 +08:00
Meirza 03c461ab87 MDL-77341 mnet: Added missing class properties
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-20 21:38:35 +07:00
Anupama Sarjoshi c2fbb10a52 MDL-78176 Question: Fix D&D onto image and D&D markers theme issue 2023-05-19 16:31:44 +01:00
Jun Pataleta 4781b41631 weekly release 4.2+ 2023-05-19 21:13:51 +08:00
Jun Pataleta caf4da762c Merge branch 'install_402_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_402_STABLE 2023-05-19 21:13:48 +08:00
Andrew Nicols 0ab5bf01f0 MDL-77733 behat: Remove extraneous no-axe option
There is no need for no-axe if we make axe a boolean value. We already
have automatic support for negated boolean flags.
2023-05-19 11:27:57 +08:00
Mark Johnson 078782e656 MDL-75696 quiz: Fix restoring pre-4.0 quizzes with random questions
Restoring multiple quizzes from a pre-4.0 backup was broken when
the quizzes shared a random question. This is because after the
first quiz created a set reference in place of the random question,
it deleted the question record so it was not there for the second
quiz to use. This change tracks the IDs of random questions so
they can be deleted at the end.
2023-05-18 15:55:39 +01:00
Mark Johnson 2b6456c1d0 MDL-75696 quiz: Set default value for includingsubcategories on restore 2023-05-18 15:55:39 +01:00
Mark Johnson a37ce627a8 MDL-75696 backup: Fix backup version checks
Several version checks were incorrectly using
restore_controller::info::moodle_release instead of moodle_version as a
version number. This replaces all of those checks with a common pair of
methods to make the checks clearer and more maintainable.
2023-05-18 15:55:38 +01:00
Paul Holden 26b885edb6 MDL-78308 output: better parsing of custom menu item configuration.
Previously certain values would cause deprecation notices in PHP8.1.
2023-05-18 10:19:20 +01:00
Jun Pataleta b514f0bb1d Merge branch 'MDL-78116-402' of https://github.com/andrewnicols/moodle into MOODLE_402_STABLE 2023-05-18 12:11:39 +08:00
Andrew Nicols 12dc12c954 Merge branch 'MDL-77451-402' of https://github.com/rezaies/moodle into MOODLE_402_STABLE 2023-05-18 11:59:41 +08:00
Jun Pataleta ec7b3cab86 Merge branch 'MDL-78135-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-18 11:54:58 +08:00
Andrew Nicols 6808c8f3b2 Merge branch 'MDL-78260_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-05-18 11:51:32 +08:00
Andrew Nicols 109a0ffeb9 Merge branch 'MDL-78151-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-18 11:48:26 +08:00
Simey Lameze 4a04cda71b MDL-77733 behat: enable Axe accessibility tests by default 2023-05-18 11:43:57 +08:00
David Woloszyn a0920d8b8d MDL-78005 editor_tiny: Declared vars to supress error logging 2023-05-18 13:02:55 +10:00
Jun Pataleta 11bf54289f Merge branch 'MOODLE_402_STABLE_MDL-78048' of https://github.com/mattporritt/moodle into MOODLE_402_STABLE 2023-05-18 10:14:47 +08:00
Tim Hunt 666708b561 MDL-78260 quiz stats: fix View details for random questions 2023-05-17 09:10:20 +01:00
Rajneel Totaram a1162e3943 MDL-77983 core_user: Avoid passing nulls to base64_decode 2023-05-17 19:37:15 +12:00
Ilya Tregubov 9de9651809 Merge branch 'MDL-78152-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-17 15:07:17 +08:00
Sara Arjona dcb3ce31ce Merge branch 'MDL-77350-402' of https://github.com/meirzamoodle/moodle into MOODLE_402_STABLE 2023-05-17 08:26:39 +02:00
Meirza 8b641a1b0d MDL-77350 tag: Added class properties that are not declared 2023-05-17 09:00:09 +07:00
Meirza 8fa53a336e MDL-77350 competency: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza 5a22258f42 MDL-77350 favourites: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.

// Removed test_add_malformed_favourite()
PHPUnit version >= 9.5 no longer converts PHP deprecations to exceptions by default.
To comply with PHP 8.2, which will deprecate the dynamic properties,
we need to remove test_add_malformed_favourite()
because the test will raise a warning for dynamic property deprecations.
2023-05-17 09:00:09 +07:00
Meirza 92cba2c5ba MDL-77350 auth: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza 7d8a40fe3e MDL-77350 availability: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza 2de2d6bc30 MDL-77350 badges: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza beb55edffc MDL-77350 blocks: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza ae8466162d MDL-77350 blog: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza b5f98e022d MDL-77350 cache: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza b9d21ee2ad MDL-77350 calendar: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza 04fb9beb20 MDL-77350 comment: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza 3be559b763 MDL-77350 completion: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza 88a1d4d4c2 MDL-77350 course: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza e0045688b3 MDL-77350 enrol: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza c645df564a MDL-77350 filter: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza 8bac8a2da7 MDL-77350 media: Added missing class properties
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza 2e339446d8 MDL-77350 message: Added missing class properties
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:09 +07:00
Meirza 1c9379ab09 MDL-77350 mod_h5pactivity: Added missing class properties
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:08 +07:00
Meirza 24ad6848aa MDL-77350 portfolio: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:08 +07:00
Meirza da43ea4ef7 MDL-77350 rating: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:08 +07:00
Meirza f49f24c516 MDL-77350 report: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:08 +07:00
Meirza 473cfc369d MDL-77350 search: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:08 +07:00
Meirza 0ba9466281 MDL-77350 webservice: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-17 09:00:08 +07:00
AMOS bot 9e6f6c0e7e Automatically generated installer lang files 2023-05-17 00:11:02 +00:00
Matt Porritt b87a75110b MDL-78048 Site Registration: Course Dates
Course date registration data reports correctly.

MDL-77306 added a count of how many courses there are
without start and end dates. However, all courses have
a start date, it is only the end date that is optional.
This patch fixes the data collection and makes the lang
string describing it clearer.
2023-05-17 09:03:20 +10:00
Jun Pataleta 52bcdf9e06 Merge branch 'MDL-77439-402' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-05-16 20:38:50 +08:00
Peter Mayer f113d4c116 MDL-77439 lib_filebrowser: Splitup query to speedup get_courses 2023-05-16 20:37:47 +08:00
Paul Holden 16bac432fd MDL-78026 group: format retrieved group names from external methods. 2023-05-16 10:10:01 +01:00
Paul Holden 4e28613a16 MDL-77264 grade: define fallback name of abstract export event. 2023-05-16 09:54:34 +01:00
Paul Holden 1df40c823e MDL-77259 tool_monitor: 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).
2023-05-16 09:50:17 +01:00
Angelia Dela Cruz 5dfec00bb1 MDL-77907 Behat: Coverage for duplicating competency framework 2023-05-16 15:45:05 +08:00
Jake Dallimore c00c6dd4cf Merge branch 'MDL-77930-402' of https://github.com/rjnl/moodle into MOODLE_402_STABLE 2023-05-16 10:49:46 +08:00
Jake Dallimore 0f687a9028 Merge branch 'MDL-78120-402' of https://github.com/lucaboesch/moodle into MOODLE_402_STABLE 2023-05-16 10:44:49 +08:00
Jun Pataleta 1d2b0ade40 Merge branch 'MDL-75576_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-05-16 09:59:11 +08:00
Ilya Tregubov a5f2c1d591 Merge branch 'MDL-77840-402' of https://github.com/davewoloszyn/moodle into MOODLE_402_STABLE 2023-05-16 09:48:13 +08:00
Andrew Nicols 5e59ad2b6e Merge branch 'MDL-77432-402' of https://github.com/lucaboesch/moodle into MOODLE_402_STABLE 2023-05-15 22:12:31 +08:00
Andrew Nicols 441003231f Merge branch 'MDL-78149-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-15 22:06:20 +08:00
Andrew Nicols 54c8336373 Merge branch 'MDL-78140-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-15 22:03:44 +08:00
Paul Holden e3ac233307 MDL-78242 roles: consistently check course contact config. 2023-05-15 13:04:39 +01:00
Tim Hunt 4d263b0505 MDL-75576 quiz/question statistics: don't expire by time
Previously, a set of calculated quiz statistics would only 'last' for
15 minutes. Then they would be considered invalid and not used.

Now, computed statistics are kept indefinitely. Instead, when a new
batch of values are computed for a particular set of settings, older numbers
for the same settings are deleted first. Therefore,
question_stats_cleanup_task is no more.
2023-05-15 10:03:27 +01:00
Tim Hunt 25953f9c7f MDL-75576 quiz statistics: don't time-limit the use of cached values
This should have been done as part of  MDL-74762, but was missed.
2023-05-15 10:03:26 +01:00
Tim Hunt b112cee58c MDL-75576 quiz statistics: don't compute when a user views the qbank
Previously, when users viewed the question bank, if the quiz statistics
had not already been calculated, we would try to compute them there an then.
This could be very, very slow, leading to session lock problems.

Now, we never try to compute the statistics on the fly. Instead, we rely
on the existing \quiz_statistics\task\recalculate scheduled task to do it.
2023-05-15 10:03:26 +01:00
Tim Hunt bc7dacecb6 MDL-75576 question bank: bulk-load statistics for all questions at once
There is a new method on the column class, for the column to declare any
statistics it requires. The question then efficiently loads all those
statistics in one go, and makes them available as the columns are
rendererd, or do any subsequent processing.
2023-05-15 10:03:26 +01:00
Tim Hunt d1fcfd1de2 MDL-75576 qbank_statistics: remove copy-pasted PHPdoc comments
These methods are already correctly documented on the base class.
2023-05-15 10:03:25 +01:00
Luca Bösch 32bc50a135 MDL-78120 login: handle empty wantsurl on login with alternateloginurl. 2023-05-15 10:20:24 +02:00
Paul Holden 02e893a575 MDL-77995 javascript: more precise path matching building JS. 2023-05-15 09:05:44 +01:00
Paul Holden 59c75c928d MDL-77723 user: ensure identity refers to a valid custom profile field. 2023-05-15 09:03:34 +01:00
Andrew Nicols c2a74815c0 Merge branch 'MDL-78156_402' of https://github.com/stronk7/moodle into MOODLE_402_STABLE 2023-05-15 12:43:38 +08:00
Jun Pataleta 9ac38f5db6 Merge branch 'MDL-76903-402' of https://github.com/laurentdavid/moodle into MOODLE_402_STABLE 2023-05-15 12:06:09 +08:00
Andrew Nicols 04b35cb3db Merge branch 'MDL-78125-402' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-05-15 11:57:59 +08:00
Jun Pataleta c6cc0449ed MDL-78125 qtype_multianswer: Convert popover trigger to link
According to Boostrap Popovers documentation for popovers triggered
on focus:
"For proper cross-browser and cross-platform behavior, you must use the
<a> tag, not the <button> tag, and you also must include a tabindex
attribute."
2023-05-12 22:47:18 +08:00
Luca Bösch 30f1f0778f MDL-77432 mod_assign: Confirm submission page standard and not incourse 2023-05-12 09:20:14 +02:00
Ilya Tregubov f9edf5c1be weekly release 4.2+ 2023-05-12 08:56:43 +08:00
Ilya Tregubov c4f7a44824 Merge branch 'install_402_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_402_STABLE 2023-05-12 08:56:41 +08:00
Paul Holden 26dbb8466a MDL-78226 contentbank: verify presence of bank heading element. 2023-05-11 23:16:29 +01:00
Paul Holden 2fb84af337 MDL-78225 output: add sesskey for post requests only in renderables. 2023-05-11 22:48:48 +01:00
Laurent David 717c74a448 MDL-76903 mod_book: Fix activity completion
* Check only visibles pages to set completion status.
* Make sure we have consistent completion value in API and on the view page.
2023-05-11 12:09:26 +02:00
Paul Holden 4a2e621012 MDL-78140 analytics: improve context restrictions manager test.
This test apparently fails sporadically on Oracle, without obvious
causes. The failure however was hard to interpret, and the test
itself made a lot of assumptions about the system re. naming of
categories/courses. This could be prone to errors, so improve that.
2023-05-11 09:37:46 +01:00
Sara Arjona 732dc4f334 MDL-78087 h5p: Fix TimeLine display bug
When the H5P third-party library was upgraded to moodle-1.23, the calls to
libraryToString(xxx, true) where replaced with libraryToFolderName().
We missed this, which was doing the H5P Timeline activities weren't
displayed properly.

Thanks Joseph for raising this and preparing a patch! Well done!

Co-authored: Joseph Rézeau
2023-05-11 10:22:48 +02:00
Paul Holden c348119685 MDL-77946 access: fix category sort order of capability contexts. 2023-05-11 08:33:27 +01:00
Jun Pataleta ced8835b5f Merge branch 'MDL-76344-402-fix' of https://github.com/stevandoMoodle/moodle into MOODLE_402_STABLE 2023-05-11 14:35:13 +08:00
Stevani Andolo a5cf13cd90 MDL-76344 course: Fixed course image 'non image file' layout 2023-05-11 14:11:00 +08:00
Jake Dallimore 10f9d0d51a Merge branch 'MDL-75552-402' of https://github.com/sarjona/moodle into MOODLE_402_STABLE 2023-05-11 11:23:33 +08:00
Sara Arjona 9bdfec812d Merge branch 'MDL-78040-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-10 19:45:14 +02:00
Paul Holden 78d90e3c16 MDL-78211 contentbank: fix context option when formatting categories. 2023-05-10 17:42:23 +01:00
Paul Holden d5ec3594cc MDL-78151 core: account for timezone differences in intl extension.
Recent additions to timezones from the IANA TZDB are not necessarily
reflected in those used by the intl extension and/or ICU zones:

 * America/Ciudad_Juarez
 * America/Nuuk
 * Europe/Kyiv
 * Pacific/Kanton

Create mapping to allow these zones to be used without errors.
2023-05-10 17:12:16 +01:00
Mikhail Golenkov 5303c032bb MDL-77592 filter_tex: Use request dir instead of temp shared storage 2023-05-10 13:03:29 +08:00
Andrew Nicols b2cca9ef62 Merge branch 'MDL-78034-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-10 12:59:57 +08:00
Ilya Tregubov 87736d9a0b Merge branch 'MDL-75623-MOODLE_402_STABLE' of https://github.com/ilyatregubov/moodle into MOODLE_402_STABLE 2023-05-10 11:45:49 +08:00
Stefan Hanauska b1496fa5df MDL-75623 backup: Encode pluginfile URLs 2023-05-10 11:44:45 +08:00
Paul Holden 411dc66fd9 MDL-78170 rating: consistently calculate average rating aggregation.
Ensure it's always cast by the database as a float, to avoid loss of
precision.
2023-05-09 15:57:37 +01:00
Jun Pataleta c58d3b4759 Merge branch 'MDL-78065-402' of https://github.com/HuongNV13/moodle into MOODLE_402_STABLE 2023-05-09 22:41:56 +08:00
Paul Holden 39a930f762 MDL-78149 mod_data: ensure group selector is always present. 2023-05-09 12:20:29 +01:00
Paul Holden 3493d9ebc3 MDL-78152 mod_book: set permissions required for page editing. 2023-05-09 12:11:26 +01:00
Jun Pataleta eff51c6001 Merge branch 'MDL-78093-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-09 17:26:18 +08:00
Shamim Rezaie 7365bc38b2 MDL-77451 gradereport: stress handling for multiple clicks 2023-05-09 16:57:10 +10:00
Andrew Nicols 856803faf8 MDL-75552 badges: move apiBase consumption to backpack
The apiBase in .well-known/badgeconnect.json was ignored and it was
causing some failures when connecting or sending badges to an
external backpack.
For OBv2.1, it has been changed to always use the apiBase defined
in the badgeconnect.json backpack provider.
2023-05-09 08:51:25 +02:00
Rajneel Totaram 97d935b337 MDL-77930 accesslib: php81 deprecation warnings on missing plugins 2023-05-09 17:48:45 +12:00
Eloy Lafuente (stronk7) f46e5fc229 MDL-78156 groups: Make groups_get_user_groups() order deterministic
Right now the order of the groups returned by groups_get_user_groups()
is not fixed and, every DB, can return them in any order. While 99%
of times the order will be the creation one, depending of the RDBMS
decisions, they can be returned in any order.

This is specially noticeable with Oracle, but can affect to any DB.

And that makes some tests (expecting a given order) to fail.

This commit fixes the problem by making the order of the groups
deterministic, because that's the way we use to fix these problems.

Alternative is to relax the tests so only values are asserted by
using assertEqualsCanonicalizing().
2023-05-08 18:25:05 +02:00
Petr Skoda 8a6c536b29 MDL-76688 filter_text: prevent LaTeX3 syntax 2023-05-08 10:11:55 +02:00
AMOS bot 84da51dafd Automatically generated installer lang files 2023-05-07 00:07:29 +00:00
Paul Holden 98448477d9 MDL-78135 completion: include required criteria library in test. 2023-05-05 16:45:39 +01:00
Jake Dallimore 62076a191e MDL-76821 enrol_lti: prevent legacy launches via upgraded enrolment
If the enrolment instance (the 'published resource') has been upgraded
from LTI 1.1/2.0 to LTI 1.3 (i.e. a new instance was not created),
prevent legacy launches which may occur from old resource links. Only
LTI Advantage launches should be permitted through the method.
2023-05-05 17:10:12 +08:00
Jake Dallimore b1a7ae63c3 MDL-76821 enrol_lti: fix bug in repo causing return of legacy lti users
If the enrolment method is updated from an LTI 1.1/2.0 tool to an LTI
1.3 tool, it may have associated enrol_lti_users records not having
ltideploymentid values. These are legacy users and must not be returned
by the repository, which deals only with LTI 1.3 LTI users.
2023-05-05 17:10:12 +08:00
Jun Pataleta 929ad63114 Merge branch 'MDL-76344-402' of https://github.com/stevandoMoodle/moodle into MOODLE_402_STABLE 2023-05-05 10:35:07 +08:00
Sara Arjona 29a21ee986 weekly release 4.2+ 2023-05-04 12:42:42 +02:00
Eloy Lafuente (stronk7) c721cc6803 MDL-78116 core: Run tests against Windows on GHA
Signed-off-by: Andrew Nicols <andrew@nicols.co.uk>
2023-05-04 15:41:54 +08:00
Dani Palou 2ccc6a2346 MDL-78054 airnotifier: Fix data encrypted several times 2023-05-04 12:06:28 +08:00
Stevani Andolo cd3643a149 MDL-76344 course: Fixed course image 'non image file' layout 2023-05-04 10:28:03 +08:00
Jake Dallimore 2138619b01 Merge branch 'MDL-78002_402' of https://github.com/stronk7/moodle into MOODLE_402_STABLE 2023-05-04 10:08:09 +08:00
Ilya Tregubov 97f6672420 Merge branch 'MDL-78094-402' of https://github.com/snake/moodle into MOODLE_402_STABLE 2023-05-04 08:54:07 +08:00
Paul Holden f6afe82978 MDL-78040 block_glossary_random: switch to block test generator.
Random failures after manually adding block instances (specifically
on slow/Oracle systems) can be entirely avoided by using the block
test generator for scenarios that are not specifically concerned with
manually adding blocks.
2023-05-03 16:45:16 +01:00
Laurent David 16f91dfdb3 MDL-77781 core_completion: Completion view must be deleted too
When resetting a course, completion view entries should also be
deleted

Co-authored-by: Georg Moser <georg@moser.link>
2023-05-03 16:05:10 +02:00
Jun Pataleta da46551bea Merge branch 'MDL-77398-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 20:36:28 +08:00
Jake Dallimore 861ce57a8a Merge branch 'MDL-77384-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 16:52:21 +08:00
Jake Dallimore 048070e25f Merge branch 'MDL-78023-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 16:15:42 +08:00
Sara Arjona 223b1afabf Merge branch 'MDL-77312-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 09:59:17 +02:00
Sara Arjona 92a57c95be Merge branch 'MDL-78049-MOODLE_402_STABLE' of https://github.com/PhMemmel/moodle into MOODLE_402_STABLE 2023-05-03 09:45:16 +02:00
Ilya Tregubov 680644b593 Merge branch 'MDL-77320-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 15:36:34 +08:00
Sara Arjona bdaed5ec3c Merge branch '42_MDL-78057' of https://github.com/danmarsden/moodle into MOODLE_402_STABLE 2023-05-03 09:22:39 +02:00
Sara Arjona 812219fcb2 Merge branch 'MDL-76971-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 09:18:23 +02:00
Sara Arjona 514865575c Merge branch 'MDL-78006-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 09:04:35 +02:00
Ilya Tregubov 1b1c1a56b1 Merge branch 'MDL-77810-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 13:08:32 +08:00
Ilya Tregubov 33f62c3309 Merge branch 'MDL-77987_402' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_402_STABLE 2023-05-03 12:40:12 +08:00
Jake Dallimore 0f66c8fe5c Merge branch 'MDL-78052-402' of https://github.com/sarjona/moodle into MOODLE_402_STABLE 2023-05-03 12:06:45 +08:00
Ilya Tregubov a56ca931aa Merge branch 'MDL-77546-402' of https://github.com/mihailges/moodle into MOODLE_402_STABLE 2023-05-03 10:57:05 +08:00
Jun Pataleta 453ea97395 Merge branch 'MDL-77394-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 10:31:07 +08:00
Jun Pataleta 4e9be8c131 Merge branch 'MDL-78038-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 10:25:37 +08:00
Ilya Tregubov a7055da32d Merge branch 'MDL-77936-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 10:07:40 +08:00
Jun Pataleta bd85500e2a Merge branch 'MDL-78011-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-03 09:58:10 +08:00
Jake Dallimore e0e94dbf84 MDL-78094 webservice_soap: fix use of core_external in locallib 2023-05-03 09:43:29 +08:00
Ilya Tregubov 9de24c27c6 Merge branch 'MDL-76835-402' of https://github.com/aya-saad1/moodle into MOODLE_402_STABLE 2023-05-03 09:29:32 +08:00
David Woloszyn 89215b79fb MDL-77840 enrol_lti: Avoid passing nulls to base64_encode 2023-05-03 09:34:29 +10:00
Paul Holden 4065904ad1 MDL-78093 gradereport_grader: handle modal retrieval promise failures. 2023-05-02 16:19:52 +01:00
Paul Holden 3862ec015d MDL-78093 grade: standardize additional external parameter type. 2023-05-02 16:19:38 +01:00
Sara Arjona c516a6fc14 Merge branch 'MDL-77858-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-05-02 16:49:48 +02:00
Sara Arjona fb14c67dec Merge branch 'MDL-77791_402' of https://github.com/dvdcastro/moodle into MOODLE_402_STABLE 2023-05-02 12:03:53 +02:00
Jun Pataleta b297347f12 Merge branch 'MDL-76857-402' of https://github.com/sarjona/moodle into MOODLE_402_STABLE 2023-05-02 15:45:09 +08:00
Huong Nguyen b89351f084 MDL-78065 tiny_link: Fix cannot create link for selection text 2023-05-02 11:38:01 +07:00
David Woloszyn b78a8983ed MDL-77840 lti: Avoid passing nulls to base64_encode 2023-05-02 13:50:14 +10:00
David Woloszyn 84ddb8c655 MDL-77840 backup: Avoid passing nulls to base64_encode 2023-05-02 13:50:14 +10:00
David Woloszyn cc3828c85a MDL-77840 mnet: Avoid passing nulls to base64_encode 2023-05-02 13:50:14 +10:00
Ilya Tregubov 7af8bddad7 Merge branch 'MDL-78025_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-05-02 11:43:12 +08:00
Dan Marsden 3bdfc594b6 MDL-78057 core_user: Use correct class for context check. 2023-05-01 08:50:40 +12:00
Eloy Lafuente (stronk7) c6ff4c551e MDL-78002 phpunit: Ensure that all uses of psr streams are closed
While the uses here were not causing too much problem with PHPUnit
execution in any OS, better have them explicitly closed to better
serve as reference for other, future uses anywhere in codebase.

Always that a stream is used, better we close it as soon as possible,
not relying on destructors, gc and friends.
2023-04-29 23:08:27 +02:00
Eloy Lafuente (stronk7) b6531bf613 MDL-78002 moodlenet: Always close the request stream explicitly
And do it as soon as it's not needed any more. Else, only
_destruct() / shutdown / gc will, and that can be problematic
if many streams are open, or, under some environments like
Windows that consider the stream underlying files still busy,
because they have not been closed.
2023-04-29 20:33:09 +02:00
Paul Holden 7c4fc1725f MDL-77810 gradereport_summary: show localised plugin name in report. 2023-04-27 15:19:27 +01:00
Ilya Tregubov 4f625c1e2e weekly release 4.2+ 2023-04-27 19:28:33 +08:00
Sara Arjona 99e38b7118 MDL-78052 lib: Set Moodle files after Font Awesome upgrade 2023-04-27 13:22:20 +02:00
Sara Arjona 5650cab0d6 MDL-78052 theme: Update FontAwesome to 6.4.0
This version also fixes a regression in 6.3.0 where a number of
icons weren't centered properly in their viewboxes.
2023-04-27 13:22:20 +02:00
Sara Arjona 4b23b98e16 MDL-76857 filter_displayh5p: Improve behat tests
Although the screenshots in the failures for some of the scenarios in
filter/displayh5p/tests/behat/h5p_filter.feature, like "Render a local
H5P file as teacher" were displaying the expected result, there were
some javascript errors (probably due to behat is quicker and the
iframes were not always ready).
I've added one extra step before accessing the iframe to give more
time to the H5P player to load and confirm the page is displayed
properly.
2023-04-27 11:21:26 +02:00
Paul Holden c7595a7169 MDL-77320 tool_licensemanager: restrict exposure of user sesskey. 2023-04-27 09:33:33 +01:00
Paul Holden b97ffab51a MDL-77936 grade: omit second cell action divider when not required. 2023-04-27 08:42:52 +01:00
Philipp Memmel f1633ba0f8 MDL-78049 core_external: Run test_all_external_info in separate process 2023-04-27 08:30:57 +02:00
Mihail Geshoski 3f4b46b16a MDL-77546 gradereport_singleview: Fix item order in grade item selector 2023-04-27 11:59:06 +08:00
danghieu1407 32df1530ff MDL-77883 forms: fix display of client-side validation for textareas 2023-04-27 11:08:42 +08:00
Jun Pataleta 20e1d18c29 Merge branch 'MDL-77997_402' of https://github.com/timhunt/moodle into MOODLE_402_STABLE 2023-04-27 10:40:49 +08:00
Paul Holden 01fd68f06d MDL-78038 mod_bigbluebuttonbn: observe course format section config. 2023-04-26 16:10:45 +01:00
Tim Hunt a8a3855c6d MDL-78025 questions: improve the comment on question_references.version 2023-04-26 15:36:57 +01:00
Tim Hunt 950aa78611 MDL-78025 questions: fix PHPdoc on question_require_capability_on 2023-04-26 15:36:57 +01:00
Tim Hunt b2e36b6baa MDL-78025 quiz: fix the quiz_questions_in_use logic 2023-04-26 15:36:57 +01:00
Tim Hunt 85662b721b MDL-78025 questions: questions_in_use should check question_references
This avoids the needs for plugins to do separate queries, which is
easier for them, and better performing.
2023-04-26 15:36:56 +01:00
Tim Hunt eb6c618fd4 MDL-78025 question generator: make the behaviour less surprising
* The object returned by update_question is alwasy a new clone
  and the $question passed in will not be modified.

* The returned object has the fields like questionbankentryid and
  the ones related to versionning, so it is more like the data
  returned by question_bank::load_question_data.
2023-04-26 15:36:56 +01:00
Paul Holden d43dc80d65 MDL-78034 mod_bigbluebuttonbn: format instance group names. 2023-04-26 15:31:38 +01:00
Tim Hunt 8e1583455e MDL-78025 question: move hiding logic into question_delete_question
This logic belongs in the API, so it is applied consistently.

Also this avoids calling the expensive function questions_in_use
twice per question.
2023-04-26 15:30:58 +01:00
Aya Saad 4bfce15818 MDL-76835 theme: Fix unordered lists indentation 2023-04-26 14:01:47 +02:00
Ilya Tregubov 6b8aeb5c90 Merge branch 'MDL-76929-402' of https://github.com/ilyatregubov/moodle into MOODLE_402_STABLE 2023-04-26 09:28:52 +08:00
Matt Porritt d9f71f0666 MDL-76929 Libraries: Upgrade phpxmlrpc to 4.10.1 2023-04-26 09:26:40 +08:00
David Castro 9e0d12e5ae MDL-77791 data: Fix file attachment to search doc 2023-04-25 19:56:26 -05:00
Paul Holden 86fd45f0de MDL-78023 tool_policy: cast timemodified column on table download. 2023-04-25 14:51:04 +01:00
Sara Arjona ffd32bacba Merge branch 'MDL-77313-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE 2023-04-25 15:18:35 +02:00
Paul Holden 3ee04ecf78 Merge branch 'MDL-78007-402' of https://github.com/HuongNV13/moodle into MOODLE_402_STABLE 2023-04-25 12:36:08 +01:00
Max Larkin c675170c4e MDL-73331 tool_brickfield: Update advanced tab display 2023-04-25 12:04:36 +01:00
Paul Holden 0c74bbfa06 Merge branch 'MDL-77766-402-2' of https://github.com/junpataleta/moodle into MOODLE_402_STABLE 2023-04-25 09:38:36 +01:00
Anupama Sarjoshi 4f7ccd0432 MDL-77987 Backup: add progress tracking to some slow steps 2023-04-25 09:19:36 +01:00
Paul Holden 4806324231 MDL-77384 check: clarify statistics check name. 2023-04-25 09:05:45 +01:00
Paul Holden 9c779fefc7 MDL-76971 reportbuilder: switch remaining classes to external_api.
Continues on the work started in a3cc26f8, to remove the last
remnants of usage of previous external API classes.
2023-04-25 08:50:27 +01:00
Paul Holden b82cc59782 MDL-78011 qbank_managecategories: require library for pagesize const. 2023-04-24 15:35:47 +01:00
Jun Pataleta e38a933fa2 MDL-77766 qtype_truefalse: Respect showstandardinstruction
* When showstandardinstruction is set to no, replace the standard
instruction with the generic "Answer" text for the answer options
fieldset's legend.
2023-04-24 20:11:10 +08:00
Jun Pataleta 9ef5ed8527 MDL-77766 qtype_multichoice: Respect showstandardinstruction
* When showstandardinstruction is set to no, replace the standard
instruction with the generic "Answer" text for the answer options
fieldset's legend.
2023-04-24 20:11:10 +08:00
Marina Glancy f1afcf6616 MDL-78006 course: test for adding activity in a new section 2023-04-24 11:42:07 +01:00
Paul Holden 0a05336551 MDL-78006 course: register activity chooser listeners just once. 2023-04-24 11:41:57 +01:00
Tim Hunt a9c5734f04 MDL-77997 questions: add back Export as XML to the preview screen
The used the exist in Moodle up to 3.11, but then was removed with
insufficient thought in 4.0 (because we had grander long-term plans
which still have not happened). Until those plans happen, this
commit adds the simple link back on the preview screen.
2023-04-24 11:30:28 +01:00
Paul Holden 1e81424bdd MDL-77312 files: exclude drafts when determining license usage. 2023-04-24 11:08:18 +01:00
Paul Holden 4aaaaa5f57 MDL-77313 restore: re-add field to indicate course/category search.
When the two restore forms for searching courses and categories were
converted to core templates in eb9935c9 they lost the named submit
button, which broke searching.
2023-04-24 11:05:13 +01:00
Paul Holden 963b56cf7e MDL-77858 javascript: correct core/notification exception imports. 2023-04-24 10:45:55 +01:00
Paul Holden f3368a55b5 MDL-77394 mod_forum: de-couple discussion pinned/starred options. 2023-04-24 10:38:28 +01:00
Paul Holden 37564d61d5 MDL-77398 mod_assign: disable form submit protection for batch options. 2023-04-24 10:35:49 +01:00
Huong Nguyen 94a87bc47e MDL-78007 tiny_media: Fix wrong condition for the Tiny Media
Including in this commit:
 - Switched to Tiny editor in manually_mark_question.feature
2023-04-24 15:59:26 +07:00
Jun Pataleta e6615e587f MDL-78000 upgrade: add the 4.2.0 separation line to all upgrade scripts 2023-04-24 13:22:41 +08:00
6038 changed files with 122262 additions and 268287 deletions
+94 -31
View File
@@ -1,12 +1,8 @@
{
'plugins': [
'@babel',
'babel',
'promise',
'jsdoc'
],
'extends': [
'eslint:recommended',
'plugin:promise/recommended'
'jsdoc',
],
'env': {
'browser': true,
@@ -20,19 +16,42 @@
'M': true,
'Y': true
},
// Warn about unused eslint-disable statements.
'reportUnusedDisableDirectives': true,
'rules': {
// See http://eslint.org/docs/rules/ for all rules and explanations of all
// rules.
// === Possible Errors ===
'comma-dangle': 'off',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-console': 'error',
'no-constant-condition': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty': 'warn',
'no-empty-character-class': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-parens': 'off',
'no-extra-semi': 'error',
'no-func-assign': 'error',
'no-inner-declarations': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-obj-calls': 'error',
'no-prototype-builtins': 'off',
'no-regex-spaces': 'error',
'no-sparse-arrays': 'error',
'no-unexpected-multiline': 'error',
'no-unreachable': 'warn',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'use-isnan': 'error',
'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
'valid-typeof': 'error',
// === Best Practices ===
// (these mostly match our jshint config)
@@ -44,12 +63,15 @@
'dot-notation': 'warn',
'no-alert': 'warn',
'no-caller': 'error',
'no-case-declarations': 'error',
'no-div-regex': 'error',
'no-empty-pattern': 'error',
'no-empty-function': 'warn',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'warn',
'no-fallthrough': 'error',
'no-floating-decimal': 'warn',
'no-global-assign': 'warn',
'no-implied-eval': 'error',
@@ -61,22 +83,28 @@
'no-multi-str': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-redeclare': 'warn',
'no-restricted-globals': ['error', { 'name': 'Notification' }],
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-sequences': 'warn',
'no-throw-literal': 'warn',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-useless-call': 'warn',
'no-useless-escape': 'warn',
'no-with': 'error',
'wrap-iife': ['error', 'any'],
// === Variables ===
'no-delete-var': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
@@ -109,6 +137,8 @@
'max-statements-per-line': ['warn', { max: 2 }],
'new-cap': ['warn', { 'properties': false }],
'new-parens': 'warn',
'newline-after-var': 'off',
'newline-before-return': 'off',
'newline-per-chained-call': 'off',
'no-array-constructor': 'off',
'no-bitwise': 'error',
@@ -116,6 +146,7 @@
'no-inline-comments': 'off',
'no-lonely-if': 'off',
'no-mixed-operators': 'off',
'no-mixed-spaces-and-tabs': 'error',
'no-multiple-empty-lines': 'warn',
'no-negated-condition': 'off',
'no-nested-ternary': 'warn',
@@ -137,6 +168,7 @@
'padded-blocks': 'off',
'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
'quotes': 'off',
'require-jsdoc': 'warn',
'semi': 'error',
'semi-spacing': ['warn', {'before': false, 'after': true}],
'sort-vars': 'off',
@@ -149,19 +181,21 @@
'unicode-bom': 'error',
'wrap-regex': 'off',
// === Promises (override plugin:promise/recommended) ===
// === Promises ===
'promise/always-return': 'warn',
'promise/no-return-wrap': 'warn',
'promise/param-names': 'warn',
'promise/catch-or-return': ['warn', {terminationMethod: ['catch', 'fail', 'always'], allowFinally: true}],
'promise/catch-or-return': ['warn', {terminationMethod: ['catch', 'fail']}],
'promise/no-native': 'warn',
'promise/no-promise-in-callback': 'warn',
'promise/no-callback-in-promise': 'warn',
'promise/avoid-new': 'warn',
// === Deprecations ===
"no-restricted-properties": ['warn', {
'object': 'M',
'property': 'str',
'message': 'Use "core/str" module or M.util.get_string()'
'message': 'Use AMD module "core/str" or M.util.get_string()'
}],
},
overrides: [
@@ -201,6 +235,7 @@
parser: '@babel/eslint-parser',
// Check AMD with some slightly stricter rules.
rules: {
'no-unused-vars': 'error',
'no-implicit-globals': 'error',
// Disable all of the rules that have babel versions.
'new-cap': 'off',
@@ -212,37 +247,65 @@
'semi': 'off',
'no-unused-expressions': 'off',
// Enable all of the babel version of these rules.
'@babel/new-cap': ['warn', { 'properties': false }],
'babel/new-cap': ['warn', { 'properties': false }],
// Not using this rule for the time being because it isn't
// compatible with jQuery and ES6.
'@babel/no-invalid-this': 'off',
'@babel/object-curly-spacing': 'warn',
'@babel/semi': 'error',
'@babel/no-unused-expressions': 'error',
'babel/no-invalid-this': 'off',
'babel/object-curly-spacing': 'warn',
// This is off in the original style int.
'babel/quotes': 'off',
'babel/semi': 'error',
'babel/no-unused-expressions': 'error',
// === Promises ===
// We have Promise now that we're using ES6.
'promise/no-native': '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'
"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: {
'sourceType': 'module',
'requireConfigFile': false
'requireConfigFile': false,
}
}
]
+6 -12
View File
@@ -7,15 +7,9 @@ on:
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.2
php: 8.1
jobs:
Grunt:
@@ -23,10 +17,10 @@ jobs:
steps:
- name: Checking out code
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Configuring node & npm
uses: actions/setup-node@v4
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
@@ -67,7 +61,7 @@ jobs:
db: mysqli
# PostgreSQL builds always run with the highest PHP supported version.
- os: ubuntu-22.04
php: 8.2
php: 8.1
db: pgsql
steps:
@@ -105,7 +99,7 @@ jobs:
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Setting up PHPUnit
env:
@@ -121,4 +115,4 @@ jobs:
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
run: vendor/bin/phpunit $phpunit_options
+8 -13
View File
@@ -1,14 +1,9 @@
name: Windows Testing
on:
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
workflow_dispatch
env:
php: 8.2
php: 8.1
jobs:
Grunt:
@@ -21,10 +16,10 @@ jobs:
git config --global core.eol lf
- name: Checking out code
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Configuring node & npm
uses: actions/setup-node@v4
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
@@ -51,13 +46,13 @@ jobs:
matrix:
include:
- os: windows-latest
php: 8.2
php: 8.1
# Ideally we should use mysql/mariadb, but they are 4x slower without tweaks and configuration
# so let's run only postgres (1.5h vs 6h) only, If some day we want to improve the mysql runs,
# this is the place to enable them.
# db: mysqli
db: pgsql
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium, zip
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium
- os: windows-latest
php: 8.0
db: pgsql
@@ -117,7 +112,7 @@ jobs:
git config --global core.eol lf
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v4
uses: actions/checkout@v3
# Needs to be done after php is available, git configured and Moodle checkout has happened.
- name: Setting up moodle-exttests service
@@ -146,4 +141,4 @@ jobs:
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
run: vendor/bin/phpunit $phpunit_options
+1 -1
View File
@@ -16,4 +16,4 @@ Moodle - the world's open source learning platform
This generated documentation includes API documentation for JavaScript written in the AMD and ES2015 module formats within Moodle.
## Related information
See [https://moodledev.io](https://moodledev.io) for other related Developer Documentation.
See [https://docs.moodle.org/dev](https://docs.moodle.org/dev) for other related Developer Documentation.
+1 -1
View File
@@ -114,7 +114,7 @@ module.exports = {
],
"menu": {
"Developer Docs": {
href: "https://moodledev.io",
href: "https://docs.moodle.org/dev",
target: "_blank",
"class": "menu-item",
id: "devdocs"
+19 -7
View File
@@ -21,7 +21,7 @@
*/
/**
* Function to generate the destination for the minification task
* Function to generate the destination for the uglify task
* (e.g. build/file.min.js). This function will be passed to
* the rename property of files array when building dynamically:
* http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
@@ -60,6 +60,7 @@ module.exports = grunt => {
grunt.registerTask('js', ['amd', 'yui']);
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-rollup');
@@ -103,7 +104,6 @@ module.exports = grunt => {
// The queue runner will run the next `size` items in the queue.
const runQueue = (size = 1) => {
queue.splice(0, size).forEach(resolve => {
grunt.log.debug(`Item resolved. Kicking off next one.`);
resolve();
});
};
@@ -113,17 +113,15 @@ module.exports = grunt => {
// The options hook is run in parallel.
// We can return an unresolved Promise which is queued for later resolution.
options: async(options) => {
options: async() => {
return new Promise(resolve => {
queue.push(resolve);
startQueue();
return options;
});
},
// When an item in the queue completes, start the next item in the queue.
generateBundle: (options, bundle) => {
grunt.log.debug(`Finished output phase for ${Object.keys(bundle).join(', ')}`);
buildEnd: () => {
runQueue();
},
};
@@ -153,10 +151,24 @@ module.exports = grunt => {
//
// 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')
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.3%",
"last 2 versions",
"not ie >= 0",
"not op_mini all",
"not Opera > 0",
"not dead"
]
},
modules: false,
useBuiltIns: false
}]
+12 -28
View File
@@ -20,33 +20,17 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = (grunt) => {
const path = require('path');
grunt.registerTask('jsdoc', 'Generate JavaScript documentation using jsdoc', function() {
const done = this.async();
const configuration = path.resolve('.grunt/jsdoc/jsdoc.conf.js');
grunt.util.spawn({
cmd: 'jsdoc',
args: [
'--configure',
configuration,
]
}, function(error, result, code) {
if (result.stdout) {
grunt.log.write(result.stdout);
}
if (result.stderr) {
grunt.log.error(result.stderr);
}
if (error) {
grunt.fail.fatal(`JSDoc failed with error code ${code}`);
} else {
grunt.log.write('JSDoc completed successfully'.green);
}
done();
});
module.exports = grunt => {
// Project configuration.
grunt.config.merge({
jsdoc: {
dist: {
options: {
configure: ".grunt/jsdoc/jsdoc.conf.js",
},
},
},
});
grunt.loadNpmTasks('grunt-jsdoc');
};
+1 -5
View File
@@ -29,7 +29,6 @@ module.exports = grunt => {
// Use a fully-qualified path.
src: files,
options: {
quietDeprecationWarnings: true,
configOverrides: {
rules: {
// These rules have to be disabled in .stylelintrc for scss compat.
@@ -46,10 +45,7 @@ module.exports = grunt => {
return {
stylelint: {
scss: {
options: {
quietDeprecationWarnings: true,
customSyntax: 'postcss-scss',
},
options: {syntax: 'scss'},
src: files,
},
},
+1 -1
View File
@@ -1 +1 @@
lts/iron
lts/gallium
+4 -16
View File
@@ -1,14 +1,9 @@
{
"customSyntax": "postcss-scss",
"plugins": [
"stylelint-csstree-validator"
],
"rules": {
"csstree/validator": {
"syntaxExtensions": [
"sass"
]
},
"csstree/validator": true,
"at-rule-empty-line-before": [ "always",
{"except": [ "blockless-after-blockless"], ignore: ["after-comment", "inside-block"]}
],
@@ -50,7 +45,7 @@
"function-name-case": "lower",
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never-single-line",
"function-url-scheme-disallowed-list": ["data"],
"function-url-scheme-blacklist": ["data"],
"function-whitespace-after": "always",
"indentation": 4,
"keyframe-declaration-no-important": true,
@@ -89,19 +84,12 @@
"selector-type-no-unknown": true,
"string-no-newline": true,
"time-min-milliseconds": 100,
"unit-disallowed-list": ["pt"],
"unit-blacklist": ["pt"],
"unit-case": "lower",
"unit-no-unknown": true,
"value-keyword-case": ["lower", {"ignoreKeywords": ["/(@|$)/"]}],
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
},
"overrides": [
{
"files": ["**/yui/**/*.css"],
"rules": {
}
}
]
}
}
+3 -3
View File
@@ -6,7 +6,7 @@ of developers, designers, teachers, testers, translators and other users. We
work in universities, schools, companies and other places. You are very welcome
to join us and contribute to the project.
See <https://moodledev.io/general/community/contribute> for the many ways you
See <https://docs.moodle.org/dev/Contributing_to_Moodle> for the many ways you
can help, not only with coding.
Moodle is open to community contributions to core, though all code must go
@@ -35,7 +35,7 @@ submitted patches has evolved.
* New features are developed on the master branch. Bug fixes are also
backported to currently supported maintenance (stable) branches.
For further details, see <https://moodledev.io/general/development/process>.
For further details, see <https://docs.moodle.org/dev/Process>.
Moodle plugins
--------------
@@ -53,4 +53,4 @@ be easily installed and updated via the Moodle administration interface.
the plugins directory. We do not pull from your code repository; you must do
it explicitly.
For further details, see <https://moodledev.io/general/community/plugincontribution>.
For further details, see <https://docs.moodle.org/dev/Plugin_contribution>.
+1 -1
View File
@@ -20,7 +20,7 @@ Moodle is widely used around the world by universities, schools, companies and
all manner of organisations and individuals.
Moodle is provided freely as open source software, under the GNU General Public
License <https://moodledev.io/general/license>.
License <https://docs.moodle.org/dev/License>.
Moodle is written in PHP and JavaScript and uses an SQL database for storing
the data.
+2 -1
View File
@@ -131,7 +131,8 @@ if ($savebutton) {
$outputhtml .= html_writer::end_tag('div');
}
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $settingspage->visiblepath));
$visiblepathtosection = array_reverse($settingspage->visiblepath);
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
$PAGE->set_heading($SITE->fullname);
if ($buttons) {
$PAGE->set_button($buttons);
@@ -78,17 +78,6 @@ class task_logs extends datasource {
];
}
/**
* Return the column sorting that will be added to the report upon creation
*
* @return int[]
*/
public function get_default_column_sorting(): array {
return [
'task_log:starttime' => SORT_DESC,
];
}
/**
* Return the filters that will be added to the report upon creation
*
-285
View File
@@ -1,285 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_admin\table;
use core_plugin_manager;
use flexible_table;
use html_writer;
use stdClass;
defined('MOODLE_INTERNAL') || die();
require_once("{$CFG->libdir}/tablelib.php");
/**
* Plugin Management table.
*
* @package core_admin
* @copyright 2023 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class hook_list_table extends flexible_table {
/** @var \core\plugininfo\base[] The plugin list */
protected array $plugins = [];
/** @var int The number of enabled plugins of this type */
protected int $enabledplugincount = 0;
/** @var core_plugin_manager */
protected core_plugin_manager $pluginmanager;
/** @var string The plugininfo class for this plugintype */
protected string $plugininfoclass;
/** @var stdClass[] The list of emitted hooks with metadata */
protected array $emitters;
public function __construct() {
global $CFG;
$this->define_baseurl('/admin/hooks.php');
parent::__construct('core_admin-hook_list_table');
// Add emitted hooks.
$this->emitters = \core\hook\manager::discover_known_hooks();
$this->setup_column_configuration();
$this->setup();
}
/**
* Set up the column configuration for this table.
*/
protected function setup_column_configuration(): void {
$columnlist = [
'details' => get_string('hookname', 'core_admin'),
'callbacks' => get_string('hookcallbacks', 'core_admin'),
'deprecates' => get_string('hookdeprecates', 'core_admin'),
];
$this->define_columns(array_keys($columnlist));
$this->define_headers(array_values($columnlist));
$columnswithhelp = [
'callbacks' => new \help_icon('hookcallbacks', 'admin'),
];
$columnhelp = array_map(function (string $column) use ($columnswithhelp): ?\renderable {
if (array_key_exists($column, $columnswithhelp)) {
return $columnswithhelp[$column];
}
return null;
}, array_keys($columnlist));
$this->define_help_for_headers($columnhelp);
}
/**
* Print the table.
*/
public function out(): void {
// All hook consumers referenced from the db/hooks.php files.
$hookmanager = \core\hook\manager::get_instance();
$allhooks = (array)$hookmanager->get_all_callbacks();
// Add any unused hooks.
foreach (array_keys($this->emitters) as $classname) {
if (isset($allhooks[$classname])) {
continue;
}
$allhooks[$classname] = [];
}
// Order rows by hook name, putting core first.
\core_collator::ksort($allhooks);
$corehooks = [];
foreach ($allhooks as $classname => $consumers) {
if (str_starts_with($classname, 'core\\')) {
$corehooks[$classname] = $consumers;
unset($allhooks[$classname]);
}
}
$allhooks = array_merge($corehooks, $allhooks);
foreach ($allhooks as $classname => $consumers) {
$this->add_data_keyed(
$this->format_row((object) [
'classname' => $classname,
'callbacks' => $consumers,
]),
$this->get_row_class($classname),
);
}
$this->finish_output(false);
}
protected function col_details(stdClass $row): string {
return $row->classname .
$this->get_description($row) .
html_writer::div($this->get_tags_for_row($row));
}
/**
* Show the name column content.
*
* @param stdClass $row
* @return string
*/
protected function get_description(stdClass $row): string {
if (!array_key_exists($row->classname, $this->emitters)) {
return '';
}
return html_writer::tag(
'small',
clean_text(markdown_to_html($this->emitters[$row->classname]['description']), FORMAT_HTML),
);
}
protected function col_deprecates(stdClass $row): string {
if (!class_exists($row->classname)) {
return '';
}
$rc = new \ReflectionClass($row->classname);
if (!$rc->implementsInterface(\core\hook\deprecated_callback_replacement::class)) {
return '';
}
$deprecates = call_user_func([$row->classname, 'get_deprecated_plugin_callbacks']);
if (count($deprecates) === 0) {
return '';
}
$content = html_writer::start_tag('ul');
foreach ($deprecates as $deprecatedmethod) {
$content .= html_writer::tag('li', $deprecatedmethod);
}
$content .= html_writer::end_tag('ul');
return $content;
}
protected function col_callbacks(stdClass $row): string {
global $CFG;
$hookclass = $row->classname;
$cbinfo = [];
foreach ($row->callbacks as $definition) {
$iscallable = is_callable($definition['callback'], false, $callbackname);
$isoverridden = isset($CFG->hooks_callback_overrides[$hookclass][$definition['callback']]);
$info = "{$callbackname}&nbsp;({$definition['priority']})";
if (!$iscallable) {
$info .= '&nbsp;';
$info .= $this->get_tag(
get_string('error'),
'danger',
get_string('hookcallbacknotcallable', 'core_admin', $callbackname),
);
}
if ($isoverridden) {
// The lang string meaning should be close enough here.
$info .= $this->get_tag(
get_string('hookconfigoverride', 'core_admin'),
'warning',
get_string('hookconfigoverride_help', 'core_admin'),
);
}
$cbinfo[] = $info;
}
if ($cbinfo) {
$output = html_writer::start_tag('ol');
foreach ($cbinfo as $callback) {
$class = '';
if ($definition['disabled']) {
$class = 'dimmed_text';
}
$output .= html_writer::tag('li', $callback, ['class' => $class]);
}
$output .= html_writer::end_tag('ol');
return $output;
} else {
return '';
}
}
/**
* Get the HTML to display the badge with tooltip.
*
* @param string $tag The main text to display
* @param null|string $type The pill type
* @param null|string $tooltip The content of the tooltip
* @return string
*/
protected function get_tag(
string $tag,
?string $type = null,
?string $tooltip = null,
): string {
$attributes = [];
if ($type === null) {
$type = 'info';
}
if ($tooltip) {
$attributes['data-toggle'] = 'tooltip';
$attributes['title'] = $tooltip;
}
return html_writer::span($tag, "badge badge-{$type}", $attributes);
}
/**
* Get the code to display a set of tags for this table row.
*
* @param stdClass $row
* @return string
*/
protected function get_tags_for_row(stdClass $row): string {
if (!array_key_exists($row->classname, $this->emitters)) {
// This hook has been defined in the db/hooks.php file
// but does not refer to a hook in this version of Moodle.
return $this->get_tag(
get_string('hookunknown', 'core_admin'),
'warning',
get_string('hookunknown_desc', 'core_admin'),
);
}
if (!class_exists($row->classname)) {
// This hook has been defined in a hook discovery agent, but the class it refers to could not be found.
return $this->get_tag(
get_string('hookclassmissing', 'core_admin'),
'warning',
get_string('hookclassmissing_desc', 'core_admin'),
);
}
$tags = $this->emitters[$row->classname]['tags'] ?? [];
$taglist = array_map(function($tag): string {
if (is_array($tag)) {
return $this->get_tag(...$tag);
}
return $this->get_tag($tag, 'badge badge-info');
}, $tags);
return implode("\n", $taglist);
}
protected function get_row_class(string $classname): string {
return '';
}
}
@@ -19,7 +19,7 @@ namespace core_admin\table;
use moodle_url;
/**
* Admin tool settings.
* Tiny admin settings.
*
* @package core_admin
* @copyright 2023 Andrew Lyons <andrew@nicols.co.uk>
@@ -30,6 +30,12 @@ class tool_plugin_management_table extends \core_admin\table\plugin_management_t
return 'tool';
}
public function guess_base_url(): void {
$this->define_baseurl(
new moodle_url('/admin/tools.php')
);
}
protected function get_column_list(): array {
$columns = parent::get_column_list();
@@ -39,6 +45,6 @@ class tool_plugin_management_table extends \core_admin\table\plugin_management_t
}
protected function get_action_url(array $params = []): moodle_url {
return new moodle_url('/admin/settings.php', array_merge(['section' => 'toolsmanagement'], $params));
return new moodle_url('/admin/tool.php', $params);
}
}
+5 -1
View File
@@ -39,6 +39,8 @@ if ($unrecognized) {
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
// TODO: MDL-71421 - Remove the openssl alternative once sodium becomes a requirement in Moodle 4.2.
if ($options['help']) {
echo "Generate secure key
@@ -52,7 +54,9 @@ may be manually installed on multiple servers.
Options:
-h, --help Print out this help
--method <method> Generate key for specified encryption method instead of default (sodium)
--method <method> Generate key for specified encryption method instead of default.
* sodium
* openssl-aes-256-ctr
Example:
php admin/cli/generate_key.php
+2 -2
View File
@@ -80,8 +80,8 @@ if (!$category = $DB->get_record('course_categories', ['id' => $options['categor
throw new \moodle_exception('invalidcategoryid');
}
$backupdir = restore_controller::get_tempdir_name(SITEID, $USER->id);
$path = make_backup_temp_directory($backupdir);
$backupdir = "restore_" . uniqid();
$path = $CFG->tempdir . DIRECTORY_SEPARATOR . "backup" . DIRECTORY_SEPARATOR . $backupdir;
cli_heading(get_string('extractingbackupfileto', 'backup', $path));
$fp = get_file_packer('application/vnd.moodle.backup');
+7 -39
View File
@@ -36,8 +36,6 @@ list($options, $unrecognized) = cli_get_params(
'showsql' => false,
'showdebugging' => false,
'force' => false,
'disable' => false,
'enable' => false,
], [
'h' => 'help',
'f' => 'force',
@@ -49,15 +47,11 @@ if ($unrecognized) {
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
$commands = ['list', 'execute', 'disable', 'enable'];
$hascommand = count(array_filter($commands, fn($command) => $options[$command])) > 0;
if ($options['help'] || !$hascommand) {
if ($options['help'] or (!$options['list'] and !$options['execute'])) {
$help =
"Scheduled cron tasks.
Options:
--disable=\\some\\task Disable scheduled task
--enable=\\some\\task Enable scheduled task
--execute=\\some\\task Execute scheduled task manually
--list List all scheduled tasks
--showsql Show sql queries before they are executed
@@ -125,43 +119,17 @@ if ($options['list']) {
exit(0);
}
if (moodle_needs_upgrading()) {
mtrace("Moodle upgrade pending, cannot manage tasks.");
exit(1);
}
if ($disable = $options['disable']) {
if (!$task = \core\task\manager::get_scheduled_task($disable)) {
mtrace("Task '$disable' not found");
exit(1);
}
try {
$task->disable();
mtrace("Disabled '$disable'");
} catch (Exception $e) {
mtrace("$e->getMessage()");
exit(1);
}
} else if ($enable = $options['enable']) {
if (!$task = \core\task\manager::get_scheduled_task($enable)) {
mtrace("Task '$enable' not found");
exit(1);
}
try {
$task->enable();
mtrace("Enabled '$enable'");
} catch (Exception $e) {
mtrace("$e->getMessage()");
exit(1);
}
} else if ($execute = $options['execute']) {
if ($execute = $options['execute']) {
if (!$task = \core\task\manager::get_scheduled_task($execute)) {
mtrace("Task '$execute' not found");
exit(1);
}
if (moodle_needs_upgrading()) {
mtrace("Moodle upgrade pending, cannot execute tasks.");
exit(1);
}
if (!get_config('core', 'cron_enabled') && !$options['force']) {
mtrace('Cron is disabled. Use --force to override.');
exit(1);
-65
View File
@@ -1,65 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Communication and its plugins settings.
*
* @package core
* @subpackage communication
* @copyright 2023 Huong Nguyen <huongnv13@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../config.php');
require_once($CFG->libdir . '/adminlib.php');
$action = required_param('action', PARAM_ALPHANUMEXT);
$name = required_param('name', PARAM_PLUGIN);
$syscontext = context_system::instance();
$PAGE->set_url('/admin/communication.php');
$PAGE->set_context($syscontext);
require_admin();
require_sesskey();
$return = new moodle_url('/admin/settings.php', ['section' => 'managecommunicationproviders']);
$plugins = core_plugin_manager::instance()->get_plugins_of_type('communication');
$sortorder = array_flip(array_keys($plugins));
if (!isset($plugins[$name])) {
throw new moodle_exception('communicationprovidernotfound', 'core_communication', $return, $name);
}
$plugintypename = $plugins[$name]->type . '_' . $plugins[$name]->name;
switch ($action) {
case 'disable':
if ($plugins[$name]->is_enabled()) {
$class = core_plugin_manager::resolve_plugininfo_class('communication');
$class::enable_plugin($name, false);
}
break;
case 'enable':
if (!$plugins[$name]->is_enabled()) {
$class = core_plugin_manager::resolve_plugininfo_class('communication');
$class::enable_plugin($name, true);
}
break;
}
redirect($return);
-203
View File
@@ -3923,8 +3923,6 @@
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_oracle_usage" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.2" requires="3.11.8">
@@ -3941,7 +3939,6 @@
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.0.0" level="required">
<RESTRICT function="restrict_php_version_83" message="unsupportedphpversion83" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -4115,8 +4112,6 @@
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_oracle_usage" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.3" requires="3.11.8">
@@ -4133,7 +4128,6 @@
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.0.0" level="required">
<RESTRICT function="restrict_php_version_83" message="unsupportedphpversion83" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -4307,203 +4301,6 @@
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_db_prefix_length" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_oracle_usage" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.4" requires="4.1.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.6.7" />
<VENDOR name="mysql" version="8.0" />
<VENDOR name="postgres" version="13" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.1.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="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="required"/>
<PHP_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="required">
<FEEDBACK>
<ON_ERROR message="sixtyfourbitsrequired" />
</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_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_db_prefix_length" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_oracle_usage" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
-41
View File
@@ -1,41 +0,0 @@
<?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/>.
/**
* Hooks overview page.
*
* @package core
* @author Petr Skoda
* @copyright 2022 Open LMS
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/tablelib.php');
admin_externalpage_setup('hooksoverview');
require_capability('moodle/site:config', \core\context\system::instance());
$hookmanager = \core\hook\manager::get_instance();
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('hooksoverview', 'core_admin'));
$table = new \core_admin\table\hook_list_table();
$table->out();
echo $OUTPUT->footer();
+3 -3
View File
@@ -224,7 +224,7 @@ if (!core_tables_exist()) {
$strlicense = get_string('license');
$PAGE->navbar->add($strlicense);
$PAGE->set_title($strinstallation . moodle_page::TITLE_SEPARATOR . 'Moodle ' . $CFG->target_release, false);
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
$PAGE->set_heading($strinstallation);
$PAGE->set_cacheable(false);
@@ -267,7 +267,7 @@ if (!core_tables_exist()) {
upgrade_init_javascript();
$PAGE->navbar->add($strdatabasesetup);
$PAGE->set_title($strinstallation . moodle_page::TITLE_SEPARATOR . $CFG->target_release, false);
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
$PAGE->set_heading($strinstallation);
$PAGE->set_cacheable(false);
@@ -818,7 +818,7 @@ $context = context_system::instance();
if (!has_capability('moodle/site:config', $context)) {
// Do not throw exception display an empty page with administration menu if visible for current user.
$PAGE->set_title(get_string('home'));
$PAGE->set_title($SITE->fullname);
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->footer();
+1 -1
View File
@@ -21,7 +21,7 @@
* Displays the list of found local plugins, their version (if found) and
* a link to delete the local plugin.
*
* @see https://moodledev.io/docs/apis/plugintypes/local
* @see http://docs.moodle.org/dev/Local_customisation
* @package admin
* @copyright 2010 David Mudrak <david.mudrak@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+1 -1
View File
@@ -20,7 +20,7 @@
* Displays the list of found plagiarism plugins, their version (if found) and
* a link to uninstall the plagiarism plugin.
*
* @see https://moodledev.io/docs/apis/subsystems/plagiarism
* @see http://docs.moodle.org/dev/Plagiarism_API
* @package admin
* @copyright 2012 Dan Marsden <dan@danmarsden.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -29,14 +29,42 @@ class adminpresets_admin_setting_configmultiselect extends adminpresets_setting
/** @var \admin_setting_configmultiselect $settingdata */
protected $settingdata;
/**
* Ensure that the $value values are setting choices.
*
* @param mixed $value Setting value
* @return mixed Returns false if wrong param value
*/
protected function set_value($value) {
if ($value) {
$options = explode(',', $value);
foreach ($options as $option) {
foreach ($this->settingdata->choices as $key => $choice) {
if ($key == $option) {
$this->value = $option;
$this->set_visiblevalue();
return true;
}
}
}
$value = implode(',', $options);
}
$this->value = $value;
$this->set_visiblevalue();
return true;
}
protected function set_visiblevalue() {
$values = explode(',', $this->value);
$visiblevalues = [];
foreach ($values as $value) {
// Ensure that each value exists as a setting choice.
if (array_key_exists($value, $this->settingdata->choices)) {
if (!empty($this->settingdata->choices[$value])) {
$visiblevalues[] = $this->settingdata->choices[$value];
}
}
@@ -19,8 +19,6 @@ namespace core_adminpresets\local\setting;
/**
* Reimplementation to allow human friendly view of the selected regexps.
*
* @deprecated Moodle 4.3 MDL-78468 - No longer used since the devicedetectregex was removed.
* @todo Final deprecation on Moodle 4.7 MDL-79052
* @package core_adminpresets
* @copyright 2021 Pimenko <support@pimenko.com><pimenko.com>
* @author Jordan Kesraoui | Sylvain Revenu | Pimenko based on David Monllaó <david.monllao@urv.cat> code
@@ -28,16 +26,7 @@ namespace core_adminpresets\local\setting;
*/
class adminpresets_admin_setting_devicedetectregex extends adminpresets_admin_setting_configtext {
/**
* @deprecated Moodle 4.3 MDL-78468 - No longer used since the devicedetectregex was removed.
* @todo Final deprecation on Moodle 4.7 MDL-79052
*/
public function set_visiblevalue() {
debugging(
__FUNCTION__ . '() is deprecated.' .
'All functions associated with devicedetectregex theme setting are being removed.',
DEBUG_DEVELOPER
);
$values = json_decode($this->get_value());
if (!$values) {
+2 -2
View File
@@ -761,8 +761,8 @@ class manager {
public function delete_preset(int $presetid): void {
global $DB;
// Check the preset exists (cannot delete the pre-installed core "Starter" and "Full" presets).
$preset = $DB->get_record('adminpresets', ['id' => $presetid, 'iscore' => self::NONCORE_PRESET]);
// Check the preset exists.
$preset = $DB->get_record('adminpresets', ['id' => $presetid]);
if (!$preset) {
throw new moodle_exception('errordeleting', 'core_adminpresets');
}
+1 -20
View File
@@ -16,7 +16,6 @@
namespace core_adminpresets;
use moodle_exception;
use stdClass;
/**
@@ -600,28 +599,10 @@ class manager_test extends \advanced_testcase {
$manager = new manager();
$this->expectException(moodle_exception::class);
$this->expectExceptionMessage('Error deleting from database');
$this->expectException(\moodle_exception::class);
$manager->delete_preset($unexistingid);
}
/**
* Test trying to delete the core/pre-defined presets
*
* @covers ::delete_preset
*/
public function test_delete_preset_core(): void {
global $DB;
$this->resetAfterTest();
$starterpreset = $DB->get_record('adminpresets', ['iscore' => manager::STARTER_PRESET]);
$this->expectException(moodle_exception::class);
$this->expectExceptionMessage('Error deleting from database');
(new manager())->delete_preset($starterpreset->id);
}
/**
* Test the behaviour of delete_preset() method.
*
+4 -4
View File
@@ -27,8 +27,7 @@
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
use core\event\qbank_plugin_enabled;
use core\event\qbank_plugin_disabled;
use qbank_columnsortorder\column_manager;
$action = required_param('action', PARAM_ALPHANUMEXT);
$name = required_param('name', PARAM_PLUGIN);
@@ -50,11 +49,12 @@ if (!isset($plugins[$name])) {
}
$plugintypename = $plugins[$name]->type . '_' . $plugins[$name]->name;
$columnsortordermanager = new column_manager();
switch ($action) {
case 'disable':
if ($plugins[$name]->is_enabled()) {
qbank_plugin_disabled::create_for_plugin($plugintypename)->trigger();
$columnsortordermanager->disable_columns($plugintypename);
$class = \core_plugin_manager::resolve_plugininfo_class('qbank');
$class::enable_plugin($name, false);
set_config('disabled', 1, 'qbank_'. $name);
@@ -62,7 +62,7 @@ switch ($action) {
break;
case 'enable':
if (!$plugins[$name]->is_enabled()) {
qbank_plugin_enabled::create_for_plugin($plugintypename)->trigger();
$columnsortordermanager->enable_columns($plugintypename);
$class = \core_plugin_manager::resolve_plugininfo_class('qbank');
$class::enable_plugin($name, true);
}
+6 -8
View File
@@ -44,7 +44,7 @@ class core_admin_renderer extends plugin_renderer_base {
$output .= $this->heading(get_string('copyrightnotice'));
$output .= $this->box($copyrightnotice, 'copyrightnotice');
$output .= html_writer::empty_tag('br');
$output .= $this->confirm(get_string('doyouagree'), $continue, "https://moodledev.io/general/license");
$output .= $this->confirm(get_string('doyouagree'), $continue, "http://docs.moodle.org/dev/License");
$output .= $this->footer();
return $output;
@@ -745,10 +745,10 @@ class core_admin_renderer extends plugin_renderer_base {
//////////////////////////////////////////////////////////////////////////////////////////////////
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
'<a href="https://moodledev.io/general/releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
'<a href="http://docs.moodle.org/dev/Releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
'Copyright &copy; 1999 onwards, Martin Dougiamas<br />'.
'and <a href="http://moodle.org/dev">many other contributors</a>.<br />'.
'<a href="https://moodledev.io/general/license">GNU Public License</a>';
'<a href="http://docs.moodle.org/dev/License">GNU Public License</a>';
//////////////////////////////////////////////////////////////////////////////////////////////////
return $this->box($copyrighttext, 'copyright');
@@ -897,8 +897,7 @@ class core_admin_renderer extends plugin_renderer_base {
$url = "https://campaign.moodle.org/current/lms/{$lang}/install/";
$params = [
'url' => $url,
'iframeid' => 'campaign-content',
'title' => get_string('campaign', 'admin'),
'iframeid' => 'campaign-content'
];
return $this->render_from_template('core/external_content_banner', $params);
@@ -919,8 +918,7 @@ class core_admin_renderer extends plugin_renderer_base {
$url = "https://campaign.moodle.org/current/lms/{$lang}/servicesandsupport/";
$params = [
'url' => $url,
'iframeid' => 'services-support-content',
'title' => get_string('supportandservices', 'admin'),
'iframeid' => 'services-support-content'
];
return $this->render_from_template('core/external_content_banner', $params);
@@ -992,7 +990,7 @@ class core_admin_renderer extends plugin_renderer_base {
* @return string HTML to output.
*/
protected function release_notes_link() {
$releasenoteslink = get_string('releasenoteslink', 'admin', 'https://moodledev.io/general/releases');
$releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/dev/Releases');
$releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
return $this->box($releasenoteslink, 'generalbox alert alert-info');
}
+43 -32
View File
@@ -49,11 +49,26 @@ if ($action == 'newon') {
admin_externalpage_setup($pagename);
// The URL used for redirection, and that all edit related URLs will be based off.
$baseurl = new moodle_url('/admin/repository.php');
$sesskeyurl = $CFG->wwwroot.'/'.$CFG->admin.'/repository.php?sesskey=' . sesskey();
$baseurl = $CFG->wwwroot.'/'.$CFG->admin.'/repository.php';
$configstr = get_string('manage', 'repository');
$return = true;
if (!empty($action)) {
require_sesskey();
}
/**
* Helper function that generates a moodle_url object
* relevant to the repository
*/
function repository_action_url($repository) {
global $baseurl;
return new moodle_url($baseurl, array('sesskey'=>sesskey(), 'repos'=>$repository));
}
if (($action == 'edit') || ($action == 'new')) {
$pluginname = '';
if ($action == 'edit') {
@@ -167,12 +182,16 @@ if (($action == 'edit') || ($action == 'new')) {
}
}
} else if ($action == 'show') {
require_sesskey();
if (!confirm_sesskey()) {
throw new \moodle_exception('confirmsesskeybad', '', $baseurl);
}
$class = \core_plugin_manager::resolve_plugininfo_class('repository');
$class::enable_plugin($repository, 1);
$return = true;
} else if ($action == 'hide') {
require_sesskey();
if (!confirm_sesskey()) {
throw new \moodle_exception('confirmsesskeybad', '', $baseurl);
}
$class = \core_plugin_manager::resolve_plugininfo_class('repository');
$class::enable_plugin($repository, 0);
$return = true;
@@ -180,7 +199,9 @@ if (($action == 'edit') || ($action == 'new')) {
$repositorytype = repository::get_type_by_typename($repository);
if ($sure) {
$PAGE->set_pagetype('admin-repository-' . $repository);
require_sesskey();
if (!confirm_sesskey()) {
throw new \moodle_exception('confirmsesskeybad', '', $baseurl);
}
if ($repositorytype->delete($downloadcontents)) {
// Include this information into config changes table.
@@ -199,15 +220,20 @@ if (($action == 'edit') || ($action == 'new')) {
$output = $OUTPUT->box_start('generalbox', 'notice');
$output .= html_writer::tag('p', $message);
$removeurl = new moodle_url($baseurl, [
$removeurl = new moodle_url($sesskeyurl);
$removeurl->params(array(
'action' =>'delete',
'repos' => $repository,
'sure' => 'yes',
]);
));
$removeanddownloadurl = new moodle_url($removeurl, [
$removeanddownloadurl = new moodle_url($sesskeyurl);
$removeanddownloadurl->params(array(
'action' =>'delete',
'repos'=> $repository,
'sure' => 'yes',
'downloadcontents' => 1,
]);
));
$output .= $OUTPUT->single_button($removeurl, get_string('continueuninstall', 'repository'));
$output .= $OUTPUT->single_button($removeanddownloadurl, get_string('continueuninstallanddownload', 'repository'));
@@ -219,11 +245,9 @@ if (($action == 'edit') || ($action == 'new')) {
$return = false;
}
} else if ($action == 'moveup') {
require_sesskey();
$repositorytype = repository::get_type_by_typename($repository);
$repositorytype->move_order('up');
} else if ($action == 'movedown') {
require_sesskey();
$repositorytype = repository::get_type_by_typename($repository);
$repositorytype->move_order('down');
} else {
@@ -315,7 +339,8 @@ if (($action == 'edit') || ($action == 'new')) {
$userinstancenumbertext = "";
}
$settings = html_writer::link(new moodle_url($baseurl, ['action' => 'edit', 'repos' => $typename]), $settingsstr);
$settings .= '<a href="' . $sesskeyurl . '&amp;action=edit&amp;repos=' . $typename . '">' . $settingsstr .'</a>';
$settings .= $OUTPUT->container_start('mdl-left');
$settings .= '<br/>';
$settings .= $admininstancenumbertext;
@@ -332,34 +357,22 @@ if (($action == 'edit') || ($action == 'new')) {
$currentaction = 'hide';
}
// Active toggle.
$selectaction = new moodle_url($baseurl, ['sesskey' => sesskey(), 'repos' => $typename]);
$select = new single_select($selectaction, 'action', $actionchoicesforexisting, $currentaction, null,
'applyto' . basename($typename));
$select = new single_select(repository_action_url($typename, 'repos'), 'action', $actionchoicesforexisting, $currentaction, null, 'applyto' . basename($typename));
$select->set_label(get_string('action'), array('class' => 'accesshide'));
// Display up/down link
$updown = '';
$spacer = $OUTPUT->spacer(array('height'=>15, 'width'=>15)); // should be done with CSS instead
if ($updowncount > 1) {
$moveupaction = new moodle_url($baseurl, [
'sesskey' => sesskey(),
'action' => 'moveup',
'repos' => $typename,
]);
$updown .= html_writer::link($moveupaction, $OUTPUT->pix_icon('t/up', get_string('moveup'))) . '&nbsp;';
$updown .= "<a href=\"$sesskeyurl&amp;action=moveup&amp;repos=".$typename."\">";
$updown .= $OUTPUT->pix_icon('t/up', get_string('moveup')) . "</a>&nbsp;";
}
else {
$updown .= $spacer;
}
if ($updowncount < $totalrepositorytypes) {
$movedownaction = new moodle_url($baseurl, [
'sesskey' => sesskey(),
'action' => 'movedown',
'repos' => $typename,
]);
$updown .= html_writer::link($movedownaction, $OUTPUT->pix_icon('t/down', get_string('movedown'))) . '&nbsp;';
$updown .= "<a href=\"$sesskeyurl&amp;action=movedown&amp;repos=".$typename."\">";
$updown .= $OUTPUT->pix_icon('t/down', get_string('movedown')) . "</a>&nbsp;";
}
else {
$updown .= $spacer;
@@ -387,9 +400,7 @@ if (($action == 'edit') || ($action == 'new')) {
foreach ($plugins as $plugin => $dir) {
// Check that it has not already been listed
if (!in_array($plugin, $alreadyplugins)) {
$selectaction = new moodle_url($baseurl, ['sesskey' => sesskey(), 'repos' => $plugin]);
$select = new single_select($selectaction, 'action', $actionchoicesfornew, 'delete', null,
'applyto' . basename($plugin));
$select = new single_select(repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
$select->set_label(get_string('action'), array('class' => 'accesshide'));
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $plugin, 'manage')) {
+10 -9
View File
@@ -18,6 +18,8 @@ require_once(__DIR__ . '/../config.php');
require_once($CFG->dirroot . '/repository/lib.php');
require_once($CFG->libdir . '/adminlib.php');
require_sesskey();
// id of repository
$edit = optional_param('edit', 0, PARAM_INT);
$new = optional_param('new', '', PARAM_PLUGIN);
@@ -41,8 +43,12 @@ if ($edit){
admin_externalpage_setup($pagename, '', null, new moodle_url('/admin/repositoryinstance.php'));
// The URL used for redirection, and that all edit related URLs will be based off.
$parenturl = new moodle_url('/admin/repository.php', ['action' => 'edit']);
$baseurl = new moodle_url("/$CFG->admin/repositoryinstance.php", array('sesskey'=>sesskey()));
$parenturl = new moodle_url("/$CFG->admin/repository.php", array(
'sesskey'=>sesskey(),
'action'=>'edit',
));
if ($new) {
$parenturl->param('repos', $new);
@@ -110,7 +116,6 @@ if (!empty($edit) || !empty($new)) {
$return = false;
}
} else if (!empty($hide)) {
require_sesskey();
$instance = repository::get_type_by_typename($hide);
$instance->hide();
core_plugin_manager::reset_caches();
@@ -124,7 +129,6 @@ if (!empty($edit) || !empty($new)) {
throw new repository_exception('nopermissiontoaccess', 'repository');
}
if ($sure) {
require_sesskey();
if ($instance->delete($downloadcontents)) {
$deletedstr = get_string('instancedeleted', 'repository');
core_plugin_manager::reset_caches();
@@ -137,17 +141,14 @@ if (!empty($edit) || !empty($new)) {
echo $OUTPUT->header();
echo $OUTPUT->box_start('generalbox', 'notice');
$continueurl = new moodle_url($PAGE->url, [
$continueurl = new moodle_url($baseurl, array(
'type' => $type,
'delete' => $delete,
'sure' => 'yes',
]);
));
$continueanddownloadurl = new moodle_url($continueurl, array(
'downloadcontents' => 1
));
$message = get_string('confirmdelete', 'repository', $instance->name);
echo html_writer::tag('p', $message);
-13
View File
@@ -38,19 +38,6 @@ if (!is_siteadmin()) {
}
$admisselector = new core_role_admins_existing_selector();
if (array_key_exists('siteadmins', $CFG->config_php_settings)) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('manageadmins', 'core_role'), 3);
echo $OUTPUT->notification(get_string('siteadministratorsconfigphp', 'core_role'), \core\output\notification::NOTIFY_INFO);
echo $OUTPUT->box_start();
echo $OUTPUT->paragraph(get_string('existingadmins', 'core_role'));
$admisselector->display();
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
die();
}
$potentialadmisselector = new core_role_admins_potential_selector();
if ($addusersaction) {
@@ -1,171 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_role\reportbuilder\local\entities;
use context;
use context_helper;
use lang_string;
use stdClass;
use core_reportbuilder\local\entities\base;
use core_reportbuilder\local\filters\select;
use core_reportbuilder\local\report\{column, filter};
/**
* Role entity
*
* @package core_role
* @copyright 2023 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class role extends base {
/**
* Database tables that this entity uses and their default aliases
*
* @return array
*/
protected function get_default_table_aliases(): array {
return [
'context' => 'rctx',
'role' => 'r',
];
}
/**
* The default title for this entity
*
* @return lang_string
*/
protected function get_default_entity_title(): lang_string {
return new lang_string('role');
}
/**
* Initialise the entity
*
* @return base
*/
public function initialise(): base {
$columns = $this->get_all_columns();
foreach ($columns as $column) {
$this->add_column($column);
}
// All the filters defined by the entity can also be used as conditions.
$filters = $this->get_all_filters();
foreach ($filters as $filter) {
$this
->add_filter($filter)
->add_condition($filter);
}
return $this;
}
/**
* Returns list of all available columns
*
* @return column[]
*/
protected function get_all_columns(): array {
global $DB;
$contextalias = $this->get_table_alias('context');
$rolealias = $this->get_table_alias('role');
// Name column.
$columns[] = (new column(
'name',
new lang_string('rolefullname', 'core_role'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_TEXT)
->add_fields("{$rolealias}.name, {$rolealias}.shortname, {$rolealias}.id, {$contextalias}.id AS contextid")
->add_fields(context_helper::get_preload_record_columns_sql($contextalias))
->set_is_sortable(true, ["CASE WHEN {$rolealias}.name = '' THEN {$rolealias}.shortname ELSE {$rolealias}.name END"])
->set_callback(static function($name, stdClass $role): string {
if ($name === null) {
return '';
}
context_helper::preload_from_record($role);
$context = context::instance_by_id($role->contextid);
return role_get_name($role, $context, ROLENAME_BOTH);
});
// Short name column.
$columns[] = (new column(
'shortname',
new lang_string('roleshortname', 'core_role'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_TEXT)
->add_fields("{$rolealias}.shortname")
->set_is_sortable(true);
// Description column.
$descriptionfieldsql = "{$rolealias}.description";
if ($DB->get_dbfamily() === 'oracle') {
$descriptionfieldsql = $DB->sql_order_by_text($descriptionfieldsql, 1024);
}
$columns[] = (new column(
'description',
new lang_string('description'),
$this->get_entity_name()
))
->add_joins($this->get_joins())
->set_type(column::TYPE_LONGTEXT)
->add_field($descriptionfieldsql, 'description')
->add_field("{$rolealias}.shortname")
->set_callback(static function($description, stdClass $role): string {
if ($description === null) {
return '';
}
return role_get_description($role);
});
return $columns;
}
/**
* Return list of all available filters
*
* @return filter[]
*/
protected function get_all_filters(): array {
$rolealias = $this->get_table_alias('role');
// Name filter.
$filters[] = (new filter(
select::class,
'name',
new lang_string('rolefullname', 'core_role'),
$this->get_entity_name(),
"{$rolealias}.id"
))
->add_joins($this->get_joins())
->set_options_callback(static function(): array {
return role_get_names(null, ROLENAME_ORIGINAL, true);
});
return $filters;
}
}
+1 -1
View File
@@ -76,7 +76,7 @@ switch ($action) {
$optionsyes = array('action'=>'delete', 'roleid'=>$roleid, 'sesskey'=>sesskey(), 'confirm'=>1);
$a = new stdClass();
$a->id = $roleid;
$a->name = $roles[$roleid]->localname;
$a->name = $roles[$roleid]->name;
$a->shortname = $roles[$roleid]->shortname;
$a->count = $DB->count_records_select('role_assignments',
'roleid = ?', array($roleid), 'COUNT(DISTINCT userid)');
+2 -2
View File
@@ -32,7 +32,7 @@ require_once($CFG->libdir . '/adminlib.php');
admin_externalpage_setup('searchareas', '', null, (new moodle_url('/admin/searchreindex.php'))->out(false));
// Get area parameter and check it exists.
$areaid = required_param('areaid', PARAM_ALPHANUMEXT);
$areaid = required_param('areaid', PARAM_ALPHAEXT);
$area = \core_search\manager::get_search_area($areaid);
if ($area === false) {
throw new moodle_exception('invalidrequest');
@@ -44,7 +44,7 @@ $PAGE->set_secondary_active_tab('modules');
// Start page output.
$heading = get_string('gradualreindex', 'search', '');
$PAGE->set_title($areaname . ' - ' . get_string('gradualreindex', 'search', ''));
$PAGE->set_title($PAGE->title . ': ' . $heading);
$PAGE->navbar->add($heading);
echo $OUTPUT->header();
echo $OUTPUT->heading($heading);
+3 -1
View File
@@ -129,7 +129,9 @@ if (empty($SITE->fullname)) {
$PAGE->set_button($buttons);
}
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $settingspage->visiblepath));
$visiblepathtosection = array_reverse($settingspage->visiblepath);
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
+4 -14
View File
@@ -46,6 +46,8 @@ reports,core_reportbuilder|/reportbuilder/index.php',
'50',
'10'
));
$temp->add(new admin_setting_configcheckbox('enabledevicedetection', new lang_string('enabledevicedetection', 'admin'), new lang_string('configenabledevicedetection', 'admin'), 1));
$temp->add(new admin_setting_devicedetectregex('devicedetectregex', new lang_string('devicedetectregex', 'admin'), new lang_string('devicedetectregex_desc', 'admin'), ''));
$ADMIN->add('themes', $temp);
$ADMIN->add('themes', new admin_externalpage('themeselector', new lang_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
@@ -200,14 +202,14 @@ reports,core_reportbuilder|/reportbuilder/index.php',
));
$choices = [HOMEPAGE_SITE => new lang_string('home')];
if (!isset($CFG->enabledashboard) || $CFG->enabledashboard) {
if (!empty($CFG->enabledashboard)) {
$choices[HOMEPAGE_MY] = new lang_string('mymoodle', 'admin');
}
$choices[HOMEPAGE_MYCOURSES] = new lang_string('mycourses', 'admin');
$choices[HOMEPAGE_USER] = new lang_string('userpreference', 'admin');
$temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'),
new lang_string('configdefaulthomepage', 'admin'), get_default_home_page(), $choices));
if (!isset($CFG->enabledashboard) || $CFG->enabledashboard) {
if (!empty($CFG->enabledashboard)) {
$temp->add(new admin_setting_configcheckbox(
'allowguestmymoodle',
new lang_string('allowguestmymoodle', 'admin'),
@@ -242,18 +244,6 @@ reports,core_reportbuilder|/reportbuilder/index.php',
// "htmlsettings" settingpage
$temp = new admin_settingpage('htmlsettings', new lang_string('htmlsettings', 'admin'));
$sitenameintitleoptions = [
'shortname' => new lang_string('shortname'),
'fullname' => new lang_string('fullname'),
];
$sitenameintitleconfig = new admin_setting_configselect(
'sitenameintitle',
new lang_string('sitenameintitle', 'admin'),
new lang_string('sitenameintitle_help', 'admin'),
'shortname',
$sitenameintitleoptions
);
$temp->add($sitenameintitleconfig);
$temp->add(new admin_setting_configcheckbox('formatstringstriptags', new lang_string('stripalltitletags', 'admin'), new lang_string('configstripalltitletags', 'admin'), 1));
$temp->add(new admin_setting_emoticons());
$ADMIN->add('appearance', $temp);
+38 -106
View File
@@ -43,6 +43,12 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
array('moodle/category:manage', 'moodle/course:create')
)
);
$ADMIN->add('courses',
new admin_externalpage('course_customfield', new lang_string('course_customfield', 'admin'),
$CFG->wwwroot . '/course/customfield.php',
array('moodle/course:configurecustomfields')
)
);
$ADMIN->add('courses',
new admin_externalpage('addcategory', new lang_string('addcategory', 'admin'),
new moodle_url('/course/editcategory.php', array('parent' => 0)),
@@ -62,49 +68,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
)
);
// Download course content.
$downloadcoursedefaulturl = new moodle_url('/admin/settings.php', ['section' => 'coursesettings']);
$temp = new admin_settingpage('downloadcoursecontent', new lang_string('downloadcoursecontent', 'course'));
$temp->add(new admin_setting_configcheckbox('downloadcoursecontentallowed',
new lang_string('downloadcoursecontentallowed', 'admin'),
new lang_string('downloadcoursecontentallowed_desc', 'admin', $downloadcoursedefaulturl->out()), 0));
// 50MB default maximum size per file when downloading course content.
$defaultmaxdownloadsize = 50 * filesize::UNIT_MB;
$temp->add(new filesize('maxsizeperdownloadcoursefile', new lang_string('maxsizeperdownloadcoursefile', 'admin'),
new lang_string('maxsizeperdownloadcoursefile_desc', 'admin'), $defaultmaxdownloadsize, filesize::UNIT_MB));
$temp->hide_if('maxsizeperdownloadcoursefile', 'downloadcoursecontentallowed');
$ADMIN->add('courses', $temp);
// "courserequests" settingpage.
$temp = new admin_settingpage('courserequest', new lang_string('courserequest'));
$temp->add(new admin_setting_configcheckbox('enablecourserequests',
new lang_string('enablecourserequests', 'admin'),
new lang_string('configenablecourserequests', 'admin'), 1));
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory',
new lang_string('defaultrequestcategory', 'admin'),
new lang_string('configdefaultrequestcategory', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('lockrequestcategory',
new lang_string('lockrequestcategory', 'admin'),
new lang_string('configlockrequestcategory', 'admin'), 0));
$temp->add(new admin_setting_users_with_capability(
'courserequestnotify',
new lang_string('courserequestnotify', 'admin'),
new lang_string('configcourserequestnotify2', 'admin'),
[],
'moodle/site:approvecourse'
));
$ADMIN->add('courses', $temp);
// Pending course requests.
if (!empty($CFG->enablecourserequests)) {
$ADMIN->add('courses', new admin_externalpage('coursespending', new lang_string('pendingrequests'),
$CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse')));
}
// Add a category for the course Default settings.
$ADMIN->add('courses', new admin_category('coursedefaultsettings', new lang_string('defaultsettingscategory', 'course')));
// Course Default Settings Page.
// NOTE: these settings must be applied after all other settings because they depend on them.
@@ -251,73 +214,42 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$temp->add(new admin_setting_configselect('moodlecourse/groupmode', new lang_string('groupmode'), '', key($choices),$choices));
$temp->add(new admin_setting_configselect('moodlecourse/groupmodeforce', new lang_string('force'), new lang_string('coursehelpforce'), 0,array(0 => new lang_string('no'), 1 => new lang_string('yes'))));
// Communication.
$temp->add(new admin_setting_heading('communication',
new lang_string('communication', 'core_communication'), ''));
$ADMIN->add('courses', $temp);
list($communicationproviders, $defaulprovider) = \core_communication\api::
get_enabled_providers_and_default();
// Download course content.
$downloadcoursedefaulturl = new moodle_url('/admin/settings.php', ['section' => 'coursesettings']);
$temp = new admin_settingpage('downloadcoursecontent', new lang_string('downloadcoursecontent', 'course'));
$temp->add(new admin_setting_configcheckbox('downloadcoursecontentallowed',
new lang_string('downloadcoursecontentallowed', 'admin'),
new lang_string('downloadcoursecontentallowed_desc', 'admin', $downloadcoursedefaulturl->out()), 0));
$temp->add(new admin_setting_configselect('moodlecourse/coursecommunicationprovider',
new lang_string('selectcommunicationprovider', 'communication'),
new lang_string('coursecommunication_desc', 'course'),
$defaulprovider, $communicationproviders));
// 50MB default maximum size per file when downloading course content.
$defaultmaxdownloadsize = 50 * filesize::UNIT_MB;
$temp->add(new filesize('maxsizeperdownloadcoursefile', new lang_string('maxsizeperdownloadcoursefile', 'admin'),
new lang_string('maxsizeperdownloadcoursefile_desc', 'admin'), $defaultmaxdownloadsize, filesize::UNIT_MB));
$temp->hide_if('maxsizeperdownloadcoursefile', 'downloadcoursecontentallowed');
$ADMIN->add('coursedefaultsettings', $temp);
if (!empty($CFG->enablecompletion)) {
$ADMIN->add('coursedefaultsettings', new admin_externalpage(
'sitedefaultcompletion',
new lang_string('defaultcompletion', 'completion'),
new moodle_url('/course/defaultcompletion.php', ['id' => $SITE->id]),
['moodle/course:manageactivities'])
);
$ADMIN->add('courses', $temp);
// "courserequests" settingpage.
$temp = new admin_settingpage('courserequest', new lang_string('courserequest'));
$temp->add(new admin_setting_configcheckbox('enablecourserequests',
new lang_string('enablecourserequests', 'admin'),
new lang_string('configenablecourserequests', 'admin'), 1));
$temp->add(new admin_settings_coursecat_select('defaultrequestcategory',
new lang_string('defaultrequestcategory', 'admin'),
new lang_string('configdefaultrequestcategory', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('lockrequestcategory',
new lang_string('lockrequestcategory', 'admin'),
new lang_string('configlockrequestcategory', 'admin'), 0));
$temp->add(new admin_setting_users_with_capability('courserequestnotify', new lang_string('courserequestnotify', 'admin'), new lang_string('configcourserequestnotify2', 'admin'), array(), 'moodle/site:approvecourse'));
$ADMIN->add('courses', $temp);
// Pending course requests.
if (!empty($CFG->enablecourserequests)) {
$ADMIN->add('courses', new admin_externalpage('coursespending', new lang_string('pendingrequests'),
$CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse')));
}
$ADMIN->add('coursedefaultsettings', new admin_externalpage(
'course_customfield',
new lang_string('course_customfield', 'admin'),
$CFG->wwwroot . '/course/customfield.php',
['moodle/course:configurecustomfields'])
);
$temp = new admin_settingpage('activitychoosersettings', new lang_string('activitychoosersettings', 'course'));
// Tab mode for the activity chooser.
$temp->add(
new admin_setting_configselect(
'activitychoosertabmode',
new lang_string('activitychoosertabmode', 'course'),
new lang_string('activitychoosertabmode_desc', 'course'),
3,
[
3 => new lang_string('activitychoosertabmodefour', 'course'),
4 => new lang_string('activitychoosertabmodefive', 'course'),
5 => new lang_string('activitychoosertabmodesix', 'course'),
0 => new lang_string('activitychoosertabmodeone', 'course'),
1 => new lang_string('activitychoosertabmodetwo', 'course'),
2 => new lang_string('activitychoosertabmodethree', 'course'),
]
)
);
// Add a category for the Groups.
$ADMIN->add('courses', new admin_category('groups', new lang_string('groups')));
$ADMIN->add(
'groups',
new admin_externalpage(
'group_customfield',
new lang_string('group_customfield', 'admin'),
$CFG->wwwroot . '/group/customfield.php',
['moodle/group:configurecustomfields']
)
);
$ADMIN->add(
'groups',
new admin_externalpage(
'grouping_customfield',
new lang_string('grouping_customfield', 'admin'),
$CFG->wwwroot . '/group/grouping_customfield.php',
['moodle/group:configurecustomfields']
)
);
// Add a category for the Activity Chooser.
$ADMIN->add('courses', new admin_category('activitychooser', new lang_string('activitychoosercategory', 'course')));
-8
View File
@@ -38,11 +38,6 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
new lang_string('enablesharingtomoodlenet', 'core_admin'),
new lang_string('enablesharingtomoodlenet_desc', 'core_admin'), 0));
// New communication subsystem setting.
$temp->add(new admin_setting_configcheckbox('enablecommunicationsubsystem',
new lang_string('enablecommunicationsubsystem', 'core_admin'),
new lang_string('enablecommunicationsubsystem_desc', 'core_admin'), 0));
$ADMIN->add('experimental', $temp);
// "debugging" settingpage
@@ -121,7 +116,4 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
"$CFG->wwwroot/$CFG->admin/purgecaches.php"));
$ADMIN->add('development', new admin_externalpage('thirdpartylibs', new lang_string('thirdpartylibs','admin'), "$CFG->wwwroot/$CFG->admin/thirdpartylibs.php"));
$ADMIN->add('development', new admin_externalpage('hooksoverview',
new lang_string('hooksoverview', 'admin'), "$CFG->wwwroot/$CFG->admin/hooks.php"));
} // end of speedup
-14
View File
@@ -41,18 +41,4 @@ if (!empty($defaulth5plib)) {
$settings->add(new admin_settings_h5plib_handler_select('h5plibraryhandler', new lang_string('h5plibraryhandler', 'core_h5p'),
new lang_string('h5plibraryhandler_help', 'core_h5p'), $defaulth5plib));
$setting = new admin_setting_configtextarea(
'core_h5p/h5pcustomcss',
new lang_string('h5pcustomcss', 'core_h5p'),
new lang_string('h5pcustomcss_help', 'core_h5p'),
'',
PARAM_NOTAGS
);
$setting->set_updatedcallback(function () {
// Enables use of file_storage constants.
\core_h5p\local\library\autoloader::register();
\core_h5p\file_storage::generate_custom_styles();
});
$settings->add($setting);
}
-25
View File
@@ -116,17 +116,6 @@ if ($hassiteconfig) {
$temp->add($setting);
$temp->add(new admin_setting_configcheckbox('verifychangedemail', new lang_string('verifychangedemail', 'admin'), new lang_string('configverifychangedemail', 'admin'), 1));
// ReCaptcha.
$temp->add(new admin_setting_configselect('enableloginrecaptcha',
new lang_string('auth_loginrecaptcha', 'auth'),
new lang_string('auth_loginrecaptcha_desc', 'auth'),
0,
[
new lang_string('no'),
new lang_string('yes'),
],
));
$setting = new admin_setting_configtext('recaptchapublickey', new lang_string('recaptchapublickey', 'admin'), new lang_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS);
$setting->set_force_ltr(true);
$temp->add($setting);
@@ -792,20 +781,6 @@ if ($hassiteconfig) {
}
}
// Communication plugins.
if ($hassiteconfig && core_communication\api::is_available()) {
$ADMIN->add('modules', new admin_category('communicationsettings', new lang_string('communication', 'core_communication')));
$temp = new admin_settingpage('managecommunicationproviders',
new lang_string('managecommunicationproviders', 'core_communication'));
$temp->add(new \core_communication\admin\manage_communication_providers_page());
$ADMIN->add('communicationsettings', $temp);
$plugins = core_plugin_manager::instance()->get_plugins_of_type('communication');
foreach ($plugins as $plugin) {
/** @var \core\plugininfo\communication $plugin */
$plugin->load_settings($ADMIN, 'communicationsettings', $hassiteconfig);
}
}
// Content bank content types.
if ($hassiteconfig) {
$ADMIN->add('modules', new admin_category('contentbanksettings', new lang_string('contentbank')));
+2 -1
View File
@@ -145,7 +145,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp->add(new admin_setting_heading('adminpresets', new lang_string('siteadminpresetspluginname', 'core_adminpresets'), ''));
$sensiblesettingsdefault = 'recaptchapublickey@@none, recaptchaprivatekey@@none, googlemapkey3@@none, ';
$sensiblesettingsdefault .= 'secretphrase@@url, cronremotepassword@@none, smtpuser@@none, ';
$sensiblesettingsdefault .= 'smtppass@@none, proxypassword@@none, quizpassword@@quiz, allowedip@@none, blockedip@@none, ';
$sensiblesettingsdefault .= 'smtppass@none, proxypassword@@none, quizpassword@@quiz, allowedip@@none, blockedip@@none, ';
$sensiblesettingsdefault .= 'dbpass@@logstore_database, messageinbound_hostpass@@none, ';
$sensiblesettingsdefault .= 'bind_pw@@auth_cas, pass@@auth_db, bind_pw@@auth_ldap, ';
$sensiblesettingsdefault .= 'dbpass@@enrol_database, bind_pw@@enrol_ldap, ';
@@ -164,6 +164,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp = new admin_settingpage('httpsecurity', new lang_string('httpsecurity', 'admin'));
$temp->add(new admin_setting_configcheckbox('cookiesecure', new lang_string('cookiesecure', 'admin'), new lang_string('configcookiesecure', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('cookiehttponly', new lang_string('cookiehttponly', 'admin'), new lang_string('configcookiehttponly', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('allowframembedding', new lang_string('allowframembedding', 'admin'), new lang_string('allowframembedding_help', 'admin'), 0));
// Settings elements used by the \core\files\curl_security_helper class.
+1 -11
View File
@@ -453,12 +453,6 @@ if ($hassiteconfig) {
// Outgoing mail configuration.
$temp = new admin_settingpage('outgoingmailconfig', new lang_string('outgoingmailconfig', 'admin'));
if (!empty($CFG->noemailever)) {
$noemaileverwarning = new \core\output\notification(get_string('noemaileverwarning', 'admin'),
\core\output\notification::NOTIFY_ERROR);
$temp->add(new admin_setting_heading('outgoingmaildisabled', '', $OUTPUT->render($noemaileverwarning)));
}
$temp->add(new admin_setting_heading('smtpheading', new lang_string('smtp', 'admin'),
new lang_string('smtpdetail', 'admin')));
@@ -522,12 +516,8 @@ if ($hassiteconfig) {
$temp->add(new admin_setting_heading('noreplydomainheading', new lang_string('noreplydomain', 'admin'),
new lang_string('noreplydomaindetail', 'admin')));
$default = clean_param('noreply@' . get_host_from_url($CFG->wwwroot), PARAM_EMAIL);
if (!$default) {
$default = null;
}
$temp->add(new admin_setting_configtext('noreplyaddress', new lang_string('noreplyaddress', 'admin'),
new lang_string('confignoreplyaddress', 'admin'), $default, PARAM_EMAIL));
new lang_string('confignoreplyaddress', 'admin'), 'noreply@' . get_host_from_url($CFG->wwwroot), PARAM_EMAIL));
$temp->add(new admin_setting_configtextarea('allowedemaildomains',
new lang_string('allowedemaildomains', 'admin'),
+2
View File
@@ -31,6 +31,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
1 => get_string('completionactivitydefault', 'completion'),
0 => get_string('completion_none', 'completion')
);
$optionalsubsystems->add(new admin_setting_configselect('completiondefault', new lang_string('completiondefault', 'completion'),
new lang_string('configcompletiondefault', 'completion'), 1, $options));
$optionalsubsystems->add($checkbox = new admin_setting_configcheckbox('enableavailability',
new lang_string('enableavailability', 'availability'),
@@ -23,15 +23,12 @@
* name - form element name
* hasoptions - there are some options
* options - list of options containing name, key, id, checked, label
* readonly - bool
Example context (json):
{
"name": "test",
"hasoptions": true,
"options": [ { "name": "Option", "key": "k1", "id": "id0", "checked": true, "label": "Option label"} ],
"readonly": false
"options": [ { "name": "Option", "key": "k1", "id": "id0", "checked": true, "label": "Option label"} ]
}
}}
<div class="form-multicheckbox">
@@ -40,7 +37,7 @@
<ul>
{{#options}}
<li>
<input type="checkbox" name="{{name}}[{{key}}]" value="1" id="{{id}}_{{key}}" {{#readonly}}disabled{{/readonly}} {{#checked}}checked{{/checked}}>
<input type="checkbox" name="{{name}}[{{key}}]" value="1" id="{{id}}_{{key}}" {{#checked}}checked{{/checked}}>
<label for="{{id}}_{{key}}">{{{label}}}</label>
</li>
{{/options}}
@@ -15,8 +15,6 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@deprecated since Moodle 4.3
@todo Final deprecation on Moodle 4.7 MDL-79052
@template core_admin/setting_devicedetectregex
Admin devicedetectregex setting template.
@@ -1,47 +0,0 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template core_admin/webservice_token_new
This is the template for displaying the newly created webservice token.
Context variable required for this template:
* token - Token value
Example context (json):
{
"token": "ef9ee4d0c6eed5eab8453a63b93b5b8b"
}
}}
<div class="d-inline-block">
<div class="alert alert-warning">
<div class="lead">{{#str}}tokennewmessage, webservice{{/str}}</div>
</div>
<div class="alert alert-primary">
<div class="lead">{{tokenname}}</div>
<div class="d-flex justify-content-start align-middle">
<div class="lead text-break pt-1" id="copytoclipboardtoken">{{token}}</div>
<button class="btn btn-primary ml-2" data-action="copytoclipboard" data-clipboard-target="#copytoclipboardtoken" data-clipboard-success-message="{{#str}}tokencopied, webservice{{/str}}">
{{#pix}}t/copy, core {{/pix}}{{#str}}copytoclipboard{{/str}}</button>
</div>
</div>
</div>
{{#js}}
require(['core/copy_to_clipboard']);
{{/js}}
-6
View File
@@ -40,12 +40,6 @@ if ($form->is_cancelled()) {
echo $OUTPUT->header();
echo $OUTPUT->heading($headingtitle);
// Displaying noemailever warning.
if (!empty($CFG->noemailever)) {
$msg = get_string('noemaileverwarning', 'admin');
echo $OUTPUT->notification($msg, \core\output\notification::NOTIFY_ERROR);
}
$data = $form->get_data();
if ($data) {
$emailuser = new stdClass();
+2 -2
View File
@@ -56,7 +56,7 @@ Feature: Staff can assign user roles
Scenario: Enrol at activity level using custom field search
When I am on the "page1" "Activity" page logged in as "admin"
And I navigate to "Permissions" in current page administration
And I set the field "Participants tertiary navigation" to "Locally assigned roles"
And I select "Locally assigned roles" from the "jump" singleselect
And I follow "Teacher"
And I set the field "addselect_searchtext" to "Kermit"
# The Behat 'I should see' step doesn't work for optgroup labels.
@@ -72,7 +72,7 @@ Feature: Staff can assign user roles
| user1 | editingteacher | Activity module | page1 |
When I am on the "page1" "Activity" page logged in as "admin"
And I navigate to "Permissions" in current page administration
And I set the field "Participants tertiary navigation" to "Locally assigned roles"
And I select "Locally assigned roles" from the "jump" singleselect
And I follow "Teacher"
And I set the field "removeselect_searchtext" to "Kermit"
# The Behat 'I should see' step doesn't work for optgroup labels.
+2 -2
View File
@@ -28,7 +28,7 @@ Feature: Staff can check user permissions
@javascript
Scenario: Search for a user (enrolled on the course) by custom field and select them to see permissions
When I am on the "C1" "permissions" page logged in as "admin"
And I set the field "Participants tertiary navigation" to "Check permissions"
And I select "Check permissions" from the "jump" singleselect
And I set the field "Search" to "Kermit"
# The Behat 'I should see' step doesn't work for optgroup labels.
Then "optgroup[label='Matching enrolled users (1)']" "css_element" should exist
@@ -42,7 +42,7 @@ Feature: Staff can check user permissions
@javascript
Scenario: Search for a user (not enrolled on the course) by custom field and select them to see permissions
When I am on the "C1" "permissions" page logged in as "admin"
And I set the field "Participants tertiary navigation" to "Check permissions"
And I select "Check permissions" from the "jump" singleselect
And I set the field "Search" to "Kermit"
# The Behat 'I should see' step doesn't work for optgroup labels.
Then "optgroup[label*='Potential users matching'][label*=' (1)']" "css_element" should exist
+9 -36
View File
@@ -19,32 +19,19 @@ Feature: Manage external services tokens
And I am on site homepage
And I navigate to "Server > Web services > Manage tokens" in site administration
And I press "Create token"
And I set the field "Name" to "Webservice1"
And I set the field "User" to "Firstname1 Lastname1"
And I set the field "Service" to "Moodle mobile web service"
And I set the field "IP restriction" to "127.0.0.1"
When I press "Save changes"
Then the following should exist in the "generaltable" table:
| Name | First name | Service | IP restriction | Last access |
| Webservice1 | Firstname1 Lastname1 | Moodle mobile web service | 127.0.0.1 | Never |
# Verify the message and the "Copy to clipboard" button.
And I should see "Copy the token now. It won't be shown again once you leave this page."
And "Copy to clipboard" "button" should exist
# New token can only read once.
And I reload the page
And I should not see "Copy the token now. It won't be shown again once you leave this page."
And "Copy to clipboard" "button" should not exist
# Delete token.
And I click on "Delete" "link" in the "Webservice1" "table_row"
Then I should see "Moodle mobile web service" in the "Firstname1 Lastname1" "table_row"
And I should see "127.0.0.1" in the "Firstname1 Lastname1" "table_row"
And I click on "Delete" "link" in the "Firstname1 Lastname1" "table_row"
And I should see "Do you really want to delete this web service token for Firstname1 Lastname1 on the service Moodle mobile web service?"
And I press "Delete"
And "Webservice1" "table_row" should not exist
And "Firstname1 Lastname1" "table_row" should not exist
@javascript @skip_chrome_zerosize
Scenario: Tokens can be filtered by name (case-insensitive), by user and by service
Scenario: Tokens can be filtered by user and by service
Given the following "core_webservice > Service" exists:
| name | Site information |
| shortname | siteinfo |
@@ -53,10 +40,10 @@ Feature: Manage external services tokens
| service | siteinfo |
| functions | core_webservice_get_site_info |
And the following "core_webservice > Tokens" exist:
| user | service | name |
| user2 | siteinfo | WEBservice1 |
| user3 | moodle_mobile_app | webservicE3 |
| user4 | siteinfo | New service2 |
| user | service |
| user2 | siteinfo |
| user3 | moodle_mobile_app |
| user4 | siteinfo |
When I log in as "admin"
And I navigate to "Server > Web services > Manage tokens" in site administration
@@ -66,20 +53,6 @@ Feature: Manage external services tokens
And I should see "Moodle mobile web service" in the "Firstname3 Lastname3" "table_row"
And I should see "Site information" in the "Firstname4 Lastname4" "table_row"
# Filter tokens by by name (case-insensitive).
And I click on "Tokens filter" "link"
And I set the field "Name" to "webservice"
And I press "Show only matching tokens"
And I should see "Site information" in the "Firstname2 Lastname2" "table_row"
And I should see "Moodle mobile web service" in the "Firstname3 Lastname3" "table_row"
And "Firstname4 Lastname4" "table_row" should not exist
# Reset the filter.
And I press "Show all tokens"
And I should see "Site information" in the "Firstname2 Lastname2" "table_row"
And I should see "Moodle mobile web service" in the "Firstname3 Lastname3" "table_row"
And I should see "Site information" in the "Firstname4 Lastname4" "table_row"
# Filter tokens by user (note we can select the user by the identity field here).
When I click on "Tokens filter" "link"
And I set the field "User" to "user2@example.com"
+12 -18
View File
@@ -73,35 +73,27 @@ class set_plugin_order_test extends \externallib_advanced_testcase {
* @return array
*/
public function execute_editor_provider(): array {
$pluginmanager = \core_plugin_manager::instance();
$allplugins = array_keys($pluginmanager->get_plugins_of_type('editor'));
// Disabled editors are listed alphabetically at the end.
$getorder = function (array $plugins) use ($allplugins) {
return array_merge(
$plugins,
array_diff($allplugins, array_values($plugins)),
);
};
return [
[
'initialstate' => 'textarea,tiny',
'pluginname' => 'editor_textarea',
'direction' => 1, // DOWN.
'expected' => $getorder([
'expected' => [
'tiny',
'textarea',
]),
'atto',
],
'newtexteditors' => 'tiny,textarea',
],
[
'initialstate' => 'textarea,tiny',
'pluginname' => 'editor_textarea',
'direction' => -1, // UP.
'expected' => $getorder([
'expected' => [
'textarea',
'tiny',
]),
'atto',
],
'newtexteditors' => 'textarea,tiny',
],
[
@@ -109,10 +101,11 @@ class set_plugin_order_test extends \externallib_advanced_testcase {
'pluginname' => 'editor_tiny',
'direction' => 1, // DOWN.
// Tiny is already at the bottom of the list of enabled plugins.
'expected' => $getorder([
'expected' => [
'textarea',
'tiny',
]),
'atto',
],
'newtexteditors' => 'textarea,tiny',
],
[
@@ -120,10 +113,11 @@ class set_plugin_order_test extends \externallib_advanced_testcase {
'pluginname' => 'editor_atto',
'direction' => 1, // DOWN.
// Atto is not enabled. Disabled editors are listed lexically after enabled editors.
'expected' => $getorder([
'expected' => [
'textarea',
'tiny',
]),
'atto',
],
'newtexteditors' => 'textarea,tiny',
],
];
@@ -46,24 +46,17 @@ class task_logs_test extends core_reportbuilder_testcase {
$this->resetAfterTest();
$this->generate_task_log_data(true, 3, 2, 1654038000, 1654038060);
$this->generate_task_log_data(false, 5, 1, 1654556400, 1654556700);
/** @var core_reportbuilder_generator $generator */
$generator = $this->getDataGenerator()->get_plugin_generator('core_reportbuilder');
$report = $generator->create_report(['name' => 'Tasks', 'source' => task_logs::class, 'default' => 1]);
$content = $this->get_custom_report_content($report->get('id'));
$this->assertCount(2, $content);
$this->assertCount(1, $content);
// Default columns are name, start time, duration, result. Sorted by start time descending.
// Default columns are name, starttime, duration, result.
[$name, $timestart, $duration, $result] = array_values($content[0]);
$this->assertStringContainsString(send_schedules::class, $name);
$this->assertEquals('7/06/22, 07:00:00', $timestart);
$this->assertEquals('5 mins', $duration);
$this->assertEquals('Fail', $result);
[$name, $timestart, $duration, $result] = array_values($content[1]);
$this->assertStringContainsString(send_schedules::class, $name);
$this->assertEquals('1/06/22, 07:00:00', $timestart);
$this->assertEquals('1 min', $duration);
$this->assertEquals('Success', $result);
@@ -42,8 +42,8 @@ class import_form extends moodleform {
$mform->setType('name', PARAM_TEXT);
// File upload.
$mform->addElement('filepicker', 'xmlfile', get_string('selectfile', 'tool_admin_presets'), null,
['accepted_types' => ['.xml']]);
$mform->addElement('filepicker', 'xmlfile',
get_string('selectfile', 'tool_admin_presets'));
$mform->addRule('xmlfile', null, 'required');
$this->add_action_buttons(true, get_string('import', 'tool_admin_presets'));
@@ -16,7 +16,6 @@
namespace tool_admin_presets\local\action;
use core_adminpresets\manager;
use moodle_exception;
/**
@@ -35,8 +34,8 @@ class delete extends base {
public function show(): void {
global $DB, $OUTPUT;
// Check the preset exists (cannot delete the pre-installed core "Starter" and "Full" presets).
$presetdata = $DB->get_record('adminpresets', ['id' => $this->id, 'iscore' => manager::NONCORE_PRESET], 'name');
// Getting the preset name.
$presetdata = $DB->get_record('adminpresets', ['id' => $this->id], 'name');
if ($presetdata) {
$deletetext = get_string('deletepreset', 'tool_admin_presets', $presetdata->name);
@@ -65,7 +64,7 @@ class delete extends base {
* Delete the DB preset
*/
public function execute(): void {
require_sesskey();
confirm_sesskey();
$this->manager->delete_preset($this->id);
@@ -52,6 +52,8 @@ class export extends base {
* Stores a preset into the DB.
*/
public function execute(): void {
confirm_sesskey();
$url = new \moodle_url('/admin/tool/admin_presets/index.php', ['action' => 'export', 'mode' => 'execute']);
$this->moodleform = new export_form($url);
@@ -85,7 +87,7 @@ class export extends base {
* @throws xml_writer_exception
*/
public function download_xml(): void {
require_sesskey();
confirm_sesskey();
list($xmlstr, $filename) = $this->manager->download_preset($this->id);
@@ -40,6 +40,8 @@ class import extends base {
* Imports the xmlfile into DB
*/
public function execute(): void {
confirm_sesskey();
$url = new \moodle_url('/admin/tool/admin_presets/index.php', ['action' => 'import', 'mode' => 'execute']);
$this->moodleform = new import_form($url);
@@ -38,6 +38,8 @@ class load extends base {
public function execute(): void {
global $OUTPUT;
confirm_sesskey();
$url = new \moodle_url('/admin/tool/admin_presets/index.php', ['action' => 'load', 'mode' => 'execute']);
$this->moodleform = new load_form($url);
@@ -73,7 +73,7 @@ class rollback extends base {
public function execute(): void {
global $OUTPUT;
require_sesskey();
confirm_sesskey();
list($presetapp, $rollback, $failures) = $this->manager->revert_preset($this->id);
+2 -2
View File
@@ -26,5 +26,5 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'tool_admin_presets';
$plugin->version = 2023100900;
$plugin->requires = 2023100400;
$plugin->version = 2023042400;
$plugin->requires = 2023041800;
+7 -7
View File
@@ -1,10 +1,10 @@
define("tool_analytics/log_info",["exports","core/modal","core/str"],(function(_exports,_modal,_str){var obj;
/**
* 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
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.loadInfo=void 0,_modal=(obj=_modal)&&obj.__esModule?obj:{default:obj};_exports.loadInfo=(id,info)=>{document.addEventListener("click",(e=>{if(!e.target.closest('[data-model-log-id="'.concat(id,'"]')))return;e.preventDefault();const bodyInfo=document.createElement("ul");info.forEach((item=>{const li=document.createElement("li");li.innerHTML=item,bodyInfo.append(li)})),_modal.default.create({title:(0,_str.get_string)("loginfo","tool_analytics"),body:bodyInfo.outerHTML,large:!0,show:!0,removeOnClose:!0})}))}}));
* 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,"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 */\nimport Modal from 'core/modal';\nimport {get_string as getString} from 'core/str';\n\n/**\n * Prepares a modal info for a log's results.\n *\n * @param {Number} id\n * @param {string[]} info\n */\nexport const loadInfo = (id, info) => {\n document.addEventListener('click', (e) => {\n const link = e.target.closest(`[data-model-log-id=\"${id}\"]`);\n if (!link) {\n return;\n }\n e.preventDefault();\n const bodyInfo = document.createElement('ul');\n info.forEach((item) => {\n const li = document.createElement('li');\n li.innerHTML = item;\n bodyInfo.append(li);\n });\n\n Modal.create({\n title: getString('loginfo', 'tool_analytics'),\n body: bodyInfo.outerHTML,\n large: true,\n show: true,\n removeOnClose: true,\n });\n });\n};\n"],"names":["id","info","document","addEventListener","e","target","closest","preventDefault","bodyInfo","createElement","forEach","item","li","innerHTML","append","create","title","body","outerHTML","large","show","removeOnClose"],"mappings":";;;;;;;8JA+BwB,CAACA,GAAIC,QACzBC,SAASC,iBAAiB,SAAUC,QACnBA,EAAEC,OAAOC,sCAA+BN,iBAIrDI,EAAEG,uBACIC,SAAWN,SAASO,cAAc,MACxCR,KAAKS,SAASC,aACJC,GAAKV,SAASO,cAAc,MAClCG,GAAGC,UAAYF,KACfH,SAASM,OAAOF,sBAGdG,OAAO,CACTC,OAAO,mBAAU,UAAW,kBAC5BC,KAAMT,SAASU,UACfC,OAAO,EACPC,MAAM,EACNC,eAAe"}
{"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"}
+1 -1
View File
@@ -5,6 +5,6 @@
* @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_save_cancel","core/modal_cancel","core/modal_events","core/templates"],(function($,Str,log,Notification,ModalSaveCancel,ModalCancel,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=ModalSaveCancel.create({});$.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");ModalSaveCancel.create({title:Str.get_string("evaluatemodel","tool_analytics"),body:Templates.render("tool_analytics/evaluation_options",{trainedexternally:trainedOnlyExternally,timesplittingmethods:JSON.parse(timeSplittingMethods)}),removeOnClose:!0,buttons:{save:Str.get_string("evaluate","tool_analytics")},show:!0}).then((modal=>(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))).catch(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=ModalSaveCancel.create({body:Templates.render("tool_analytics/export_options",{}),removeOnClose:!0});$.when(stringsPromise,modalPromise).then((function(strings,modal){return modal.setTitle(strings[0]),modal.setSaveButtonText(strings[0]),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)}))}}}));
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
+30 -30
View File
@@ -20,35 +20,35 @@
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
import Modal from 'core/modal';
import {get_string as getString} from 'core/str';
define(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], function($, str, ModalFactory, Notification) {
/**
* Prepares a modal info for a log's results.
*
* @param {Number} id
* @param {string[]} info
*/
export const loadInfo = (id, info) => {
document.addEventListener('click', (e) => {
const link = e.target.closest(`[data-model-log-id="${id}"]`);
if (!link) {
return;
return /** @alias module:tool_analytics/log_info */ {
/**
* Prepares a modal info for a log's results.
*
* @method loadInfo
* @param {int} id
* @param {string[]} info
*/
loadInfo: function(id, info) {
var link = $('[data-model-log-id="' + id + '"]');
str.get_string('loginfo', 'tool_analytics').then(function(langString) {
var bodyInfo = $("<ul>");
info.forEach(function(item) {
bodyInfo.append('<li>' + item + '</li>');
});
bodyInfo.append("</ul>");
return ModalFactory.create({
title: langString,
body: bodyInfo.html(),
large: true,
}, link);
}).catch(Notification.exception);
}
e.preventDefault();
const bodyInfo = document.createElement('ul');
info.forEach((item) => {
const li = document.createElement('li');
li.innerHTML = item;
bodyInfo.append(li);
});
Modal.create({
title: getString('loginfo', 'tool_analytics'),
body: bodyInfo.outerHTML,
large: true,
show: true,
removeOnClose: true,
});
});
};
};
});
+36 -23
View File
@@ -20,10 +20,8 @@
* @copyright 2017 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define([
'jquery', 'core/str', 'core/log', 'core/notification', 'core/modal_save_cancel',
'core/modal_cancel', 'core/modal_events', 'core/templates'],
function($, Str, log, Notification, ModalSaveCancel, ModalCancel, ModalEvents, Templates) {
define(['jquery', 'core/str', 'core/log', 'core/notification', 'core/modal_factory', 'core/modal_events', 'core/templates'],
function($, Str, log, Notification, ModalFactory, ModalEvents, Templates) {
/**
* List of actions that require confirmation and confirmation message.
@@ -95,7 +93,7 @@ define([
reqStrings[1].param = getModelName(a);
var stringsPromise = Str.get_strings(reqStrings);
var modalPromise = ModalSaveCancel.create({});
var modalPromise = ModalFactory.create({type: ModalFactory.types.SAVE_CANCEL});
$.when(stringsPromise, modalPromise).then(function(strings, modal) {
modal.setTitle(strings[0]);
@@ -124,20 +122,32 @@ define([
var timeSplittingMethods = $(this).attr('data-timesplitting-methods');
ModalSaveCancel.create({
title: Str.get_string('evaluatemodel', 'tool_analytics'),
body: Templates.render('tool_analytics/evaluation_options', {
trainedexternally: trainedOnlyExternally,
timesplittingmethods: JSON.parse(timeSplittingMethods)
}),
removeOnClose: true,
buttons: {
save: Str.get_string('evaluate', 'tool_analytics'),
},
show: true,
})
.then((modal) => {
var stringsPromise = Str.get_strings([
{
key: 'evaluatemodel',
component: 'tool_analytics'
}, {
key: 'evaluate',
component: 'tool_analytics'
}
]);
var modalPromise = ModalFactory.create({type: ModalFactory.types.SAVE_CANCEL});
var bodyPromise = Templates.render('tool_analytics/evaluation_options', {
trainedexternally: trainedOnlyExternally,
timesplittingmethods: JSON.parse(timeSplittingMethods)
});
$.when(stringsPromise, modalPromise).then(function(strings, modal) {
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() {
// Evaluation mode.
var evaluationMode = $("input[name='evaluationmode']:checked").val();
if (evaluationMode == 'trainedmodel') {
@@ -152,8 +162,9 @@ define([
return;
});
modal.show();
return modal;
}).catch(Notification.exception);
}).fail(Notification.exception);
});
},
@@ -185,14 +196,16 @@ define([
component: 'tool_analytics'
}
]);
var modalPromise = ModalSaveCancel.create({
body: Templates.render('tool_analytics/export_options', {}),
removeOnClose: true,
});
var modalPromise = ModalFactory.create({type: ModalFactory.types.SAVE_CANCEL});
var bodyPromise = Templates.render('tool_analytics/export_options', {});
$.when(stringsPromise, modalPromise).then(function(strings, modal) {
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() {
+7 -7
View File
@@ -97,28 +97,28 @@ if ($onlycli === false) {
switch ($action) {
case 'enable':
require_sesskey();
confirm_sesskey();
$model->enable();
redirect($returnurl);
break;
case 'disable':
require_sesskey();
confirm_sesskey();
$model->update(0, false, false);
redirect($returnurl);
break;
case 'delete':
require_sesskey();
confirm_sesskey();
$model->delete();
redirect($returnurl);
break;
case 'edit':
require_sesskey();
confirm_sesskey();
$invalidcurrenttimesplitting = $model->invalid_timesplitting_selected();
$potentialtimesplittings = $model->get_potential_timesplittings();
@@ -183,7 +183,7 @@ switch ($action) {
break;
case 'evaluate':
require_sesskey();
confirm_sesskey();
if ($model->is_static()) {
throw new moodle_exception('errornostaticevaluate', 'tool_analytics');
@@ -226,7 +226,7 @@ switch ($action) {
break;
case 'scheduledanalysis':
require_sesskey();
confirm_sesskey();
if ($onlycli) {
throw new moodle_exception('erroronlycli', 'tool_analytics');
@@ -292,7 +292,7 @@ switch ($action) {
break;
case 'clear':
require_sesskey();
confirm_sesskey();
$model->clear();
redirect($returnurl);
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2023100900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023100400; // Requires this Moodle version.
$plugin->version = 2023042400; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023041800; // Requires this Moodle version.
$plugin->component = 'tool_analytics'; // Full name of the plugin (used for diagnostics).
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2023100900;
$plugin->requires = 2023100400;
$plugin->version = 2023042400;
$plugin->requires = 2023041800;
$plugin->component = 'tool_availabilityconditions';
@@ -58,7 +58,7 @@ Feature: Set up contextual data for tests
And I am on the "Course 1" "groups" page
Then I should see "Group 1"
And I should see "Group 2"
And I set the field "Participants tertiary navigation" to "Groupings"
And I select "Groupings" from the "jump" singleselect
And I should see "Grouping 1"
And I should see "Grouping 2"
@@ -100,7 +100,8 @@ Feature: Set up contextual data for tests
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
When I am on the "Course 1" course page logged in as student1
When I log in as "student1"
And I am on "Course 1" course homepage
Then I should see "Topic 1"
Scenario: Add role assigns
@@ -134,11 +135,17 @@ Feature: Set up contextual data for tests
When I log in as "user1"
And I am on site homepage
Then edit mode should be available on the current page
And I am on the "Course 1" course page logged in as user2
And I log out
And I log in as "user2"
And I am on "Course 1" course homepage
Then edit mode should be available on the current page
And I am on the "Course 1" course page logged in as user3
And I log out
And I log in as "user3"
And I am on "Course 1" course homepage
Then edit mode should be available on the current page
And I am on the "Course 1" course page logged in as user4
And I log out
And I log in as "user4"
And I am on "Course 1" course homepage
Then edit mode should be available on the current page
And I log out
And I log in as "user5"
@@ -179,7 +186,8 @@ Feature: Set up contextual data for tests
And the following "activities" exist:
| activity | name | intro | course | idnumber | grade |
| assign | Test assignment name with scale | Test assignment description | C1 | assign1 | Test Scale 1 |
When I am on the "Course 1" course page logged in as admin
When I log in as "admin"
And I am on "Course 1" course homepage
Then I should see "Test assignment name"
# Assignment 2.2 module type is disabled by default
# And I should see "Test assignment22 name"
@@ -295,7 +303,9 @@ Feature: Set up contextual data for tests
And the following "grade categories" exist:
| fullname | course | gradecategory |
| Grade sub category 2 | C1 | Grade category 1 |
When I am on the "Course 1" "grades > Grader report > View" page logged in as "admin"
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
Then I should see "Grade category 1"
And I should see "Grade sub category 2"
@@ -316,27 +326,29 @@ Feature: Set up contextual data for tests
| itemname | course | gradecategory |
| Test Grade Item 2 | C1 | Grade category 1 |
| Test Grade Item 3 | C1 | Grade sub category 2 |
When I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Grade Item 1"
And I click on grade item menu "Test Grade Item 1" of type "gradeitem" on "setup" page
And I choose "Edit grade item" in the open action menu
And I expand all fieldsets
And I should see "Course 1"
And I click on "Cancel" "button" in the "Edit grade item" "dialogue"
And I press "Cancel"
And I should see "Grade category 1"
And I should see "Test Grade Item 2"
And I click on grade item menu "Test Grade Item 2" of type "gradeitem" on "setup" page
And I choose "Edit grade item" in the open action menu
And I expand all fieldsets
And I should see "Grade category 1"
And I click on "Cancel" "button" in the "Edit grade item" "dialogue"
And I press "Cancel"
And I should see "Grade sub category 2"
And I should see "Test Grade Item 3"
And I click on grade item menu "Test Grade Item 3" of type "gradeitem" on "setup" page
And I choose "Edit grade item" in the open action menu
And I expand all fieldsets
And I should see "Grade sub category 2"
And I click on "Cancel" "button" in the "Edit grade item" "dialogue"
And I press "Cancel"
Scenario: Add a bunch of scales
Given the following "courses" exist:
@@ -345,7 +357,9 @@ Feature: Set up contextual data for tests
And the following "scales" exist:
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
When I am on the "Course 1" "grades > scales" page logged in as admin
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Scales" in the course gradebook
Then I should see "Test Scale 1"
And I should see "Disappointing, Good, Very good, Excellent"
@@ -364,7 +378,9 @@ Feature: Set up contextual data for tests
| Grade outcome 2 | OT2 | C1 | Test Scale 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I am on the "Course 1" "grades > outcomes" page logged in as admin
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "More > Outcomes" in the course gradebook
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element"
And I press "Manage outcomes"
@@ -390,12 +406,14 @@ Feature: Set up contextual data for tests
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Outcome Grade Item 1"
And I click on grade item menu "Test Outcome Grade Item 1" of type "gradeitem" on "setup" page
And I choose "Edit grade item" in the open action menu
And I click on "Show more..." "link" in the "Edit outcome item" "dialogue"
And the field "Outcome" matches value "Grade outcome 1"
And I expand all fieldsets
And I should see "Grade category 1" in the "Grade category" "form_row"
And I press "Cancel"
@@ -406,5 +424,6 @@ Feature: Set up contextual data for tests
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| online_users | Course | C1 | course-view-* | site-pre |
When I am on the "Course 1" course page logged in as admin
When I log in as "admin"
And I am on "Course 1" course homepage
Then I should see "Online users"
@@ -70,12 +70,13 @@ Feature: Edit capabilities
@javascript
Scenario: Edit permissions escapes role names correctly
When I am on the "Course 1" "renameroles" page logged in as "admin"
When I am on the "C1" "Course" page logged in as "admin"
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Your word for 'Teacher' | Teacher >= editing |
| Your word for 'Non-editing teacher' | Teacher < "editing" |
| Your word for 'Student' | Studier & 'learner' |
And I press "Save"
And I press "Save and display"
And I navigate to course participants
Then I should see "Teacher >= editing (Teacher)" in the "Teacher 1" "table_row"
And I should see "Teacher < \"editing\" (Non-editing teacher)" in the "Teaching Assistant" "table_row"
-34
View File
@@ -1,34 +0,0 @@
@tool_behat
Feature: Confirm that we can open multiple browser tabs
In order to use multiple browser tabs
As a test writer
I need the relevant Behat steps to work
@javascript @_switch_window
Scenario: Open multiple browser tabs
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
| Course 2 | C2 |
| Course 3 | C3 |
And I am on the "C1" "Course" page logged in as "admin"
# Open a new tab on the same page.
When I open a tab named "CourseViewer1" on the current page
And I should see "Course 1" in the "h1" "css_element"
And I am on the "C2" "Course" page
# Open new tab for specified page with identifier.
And I open a tab named "CourseViewer2" on the "C3" "Course" page
# And for a specified page without identifier.
And I open a tab named "CourseViewer4" on the "My courses" page
# Switch between all the tabs and confirm their different contents.
Then I should see "You're not enrolled in any course"
And I switch to "CourseViewer2" tab
And "Course 3" "heading" should exist
And I switch to "CourseViewer1" tab
And "Course 2" "heading" should exist
And I switch to the main tab
And "Course 1" "heading" should exist
+1 -9
View File
@@ -1,18 +1,10 @@
This files describes API changes in the tool_behat code.
=== 4.3 ===
* The goutte behat mink driver has been replaced by the browserkit one because the former has been abandoned. The change should
be completely transparent for (near) everybody. Only if you are using some custom-generated behat.yml file or other configuration
alternatives different from the Moodle default one, then, any "goutte" browser occurrence needs to be changed to "browserkit_http"
when configuring the behat mink extension. See MDL-78934 for more details and changes applied.
=== 4.2 ===
=== 4.2.1 ===
* Behat is initialised with Axe accessibility tests enabled by default, if you want to disable them please use the --no-axe option.
=== 3.7 ===
* Behat will now look for behat step definitions in the current
theme and any parents the theme may have.
=== 2.7 ===
* Constants behat_base::cap_allow, behat_base::cap_prevent and
behat_base::cap_prohibit have been removed in favour of the
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2023100900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023100400; // Requires this Moodle version.
$plugin->version = 2023042401; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023041800; // Requires this Moodle version.
$plugin->component = 'tool_behat'; // Full name of the plugin (used for diagnostics)
@@ -170,19 +170,6 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
'yellowgreen' => '9acd32'
];
/** @var string[] Define estimated relative font-size codes to pt values. */
public $fontsizenames = [
'xx-small' => 9,
'x-small' => 10,
'small' => 11,
'smaller' => 11,
'medium' => 12,
'large' => 14,
'larger' => 14,
'x-large' => 18,
'xx-large' => 24,
];
/**
* Helper method that finds the luminosity between the provided
* foreground and background parameters.
@@ -240,8 +227,7 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
$l2 = (.2126 * $r4 + 0.7152 * $g4 + 0.0722 * $b4);
}
// Increase round to 4 to avoid a 4.49 contrast being round up to a false pass of 4.5.
$luminosity = round(($l1 + 0.05) / ($l2 + 0.05), 4);
$luminosity = round(($l1 + 0.05) / ($l2 + 0.05), 2);
return $luminosity;
}
@@ -376,35 +362,4 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
: $backrgb['b'] - $forergb['b'];
return ['red' => $reddiff, 'green' => $greendiff, 'blue' => $bluediff];
}
/**
* Helper method that finds the estimated font-size for the provided
* string font-size parameter.
* @param string $fontsize The css font-size, in various formats
* @return int The estimated font-size
*/
public function get_fontsize(string $fontsize): int {
$newfontsize = 12; // Default value, in pt, equivalent to 16px.
// Search for rem, em, and px initially, typical font-size values.
$pos1 = stripos($fontsize, 'rem');
$pos2 = stripos($fontsize, 'em');
$pos3 = stripos($fontsize, 'px');
if ($pos1 !== false) {
$rem = substr($fontsize, 0, -3);
$newfontsize = $newfontsize * $rem;
} else if ($pos2 !== false) {
$em = substr($fontsize, 0, -2);
$newfontsize = $newfontsize * $em;
} else if ($pos3 !== false) {
$px = substr($fontsize, 0, -2);
$newfontsize = 0.75 * $px;
} else if (in_array($fontsize, array_keys($this->fontsizenames))) {
$newfontsize = $this->fontsizenames[$fontsize];
} else {
preg_match_all('!\d+!', $fontsize, $matches);
$newfontsize = $matches[0][0] ?? $newfontsize;
}
return (int) $newfontsize;
}
}
@@ -92,7 +92,8 @@ class css_text_has_contrast extends brickfield_accessibility_color_test {
$italic = false;
if (isset($style['font-size'])) {
$fontsize = $this->get_fontsize($style['font-size']);
preg_match_all('!\d+!', $style['font-size'], $matches);
$fontsize = $matches[0][0];
}
if (isset($style['font-weight'])) {
-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM256 416c35.3 0 64-28.7 64-64c0-17.4-6.9-33.1-18.1-44.6L366 161.7c5.3-12.1-.2-26.3-12.3-31.6s-26.3 .2-31.6 12.3L257.9 288c-.6 0-1.3 0-1.9 0c-35.3 0-64 28.7-64 64s28.7 64 64 64zM176 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM96 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm352-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/></svg>

Before

Width:  |  Height:  |  Size: 694 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L369 209z"/></svg>

Before

Width:  |  Height:  |  Size: 539 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M64 80c-8.8 0-16 7.2-16 16V416c0 8.8 7.2 16 16 16H384c8.8 0 16-7.2 16-16V96c0-8.8-7.2-16-16-16H64zM0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>

Before

Width:  |  Height:  |  Size: 646 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c-9.4 9.4-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0z"/></svg>

Before

Width:  |  Height:  |  Size: 625 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M32 32c17.7 0 32 14.3 32 32V400c0 8.8 7.2 16 16 16H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H80c-44.2 0-80-35.8-80-80V64C0 46.3 14.3 32 32 32zM160 224c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32s-32-14.3-32-32V256c0-17.7 14.3-32 32-32zm128-64V320c0 17.7-14.3 32-32 32s-32-14.3-32-32V160c0-17.7 14.3-32 32-32s32 14.3 32 32zm64 32c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32s-32-14.3-32-32V224c0-17.7 14.3-32 32-32zM480 96V320c0 17.7-14.3 32-32 32s-32-14.3-32-32V96c0-17.7 14.3-32 32-32s32 14.3 32 32z"/></svg>

Before

Width:  |  Height:  |  Size: 798 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M441 58.9L453.1 71c9.4 9.4 9.4 24.6 0 33.9L424 134.1 377.9 88 407 58.9c9.4-9.4 24.6-9.4 33.9 0zM209.8 256.2L344 121.9 390.1 168 255.8 302.2c-2.9 2.9-6.5 5-10.4 6.1l-58.5 16.7 16.7-58.5c1.1-3.9 3.2-7.5 6.1-10.4zM373.1 25L175.8 222.2c-8.7 8.7-15 19.4-18.3 31.1l-28.6 100c-2.4 8.4-.1 17.4 6.1 23.6s15.2 8.5 23.6 6.1l100-28.6c11.8-3.4 22.5-9.7 31.1-18.3L487 138.9c28.1-28.1 28.1-73.7 0-101.8L474.9 25C446.8-3.1 401.2-3.1 373.1 25zM88 64C39.4 64 0 103.4 0 152V424c0 48.6 39.4 88 88 88H360c48.6 0 88-39.4 88-88V312c0-13.3-10.7-24-24-24s-24 10.7-24 24V424c0 22.1-17.9 40-40 40H88c-22.1 0-40-17.9-40-40V152c0-22.1 17.9-40 40-40H200c13.3 0 24-10.7 24-24s-10.7-24-24-24H88z"/></svg>

Before

Width:  |  Height:  |  Size: 962 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M448 80c8.8 0 16 7.2 16 16V415.8l-5-6.5-136-176c-4.5-5.9-11.6-9.3-19-9.3s-14.4 3.4-19 9.3L202 340.7l-30.5-42.7C167 291.7 159.8 288 152 288s-15 3.7-19.5 10.1l-80 112L48 416.3l0-.3V96c0-8.8 7.2-16 16-16H448zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm80 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>

Before

Width:  |  Height:  |  Size: 650 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M448 96V224H288V96H448zm0 192V416H288V288H448zM224 224H64V96H224V224zM64 288H224V416H64V288zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"/></svg>

Before

Width:  |  Height:  |  Size: 495 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 640 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"/></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c7.6-4.2 16.8-4.1 24.3 .5l144 88c7.1 4.4 11.5 12.1 11.5 20.5s-4.4 16.1-11.5 20.5l-144 88c-7.4 4.5-16.7 4.7-24.3 .5s-12.3-12.2-12.3-20.9V168c0-8.7 4.7-16.7 12.3-20.9z"/></svg>

Before

Width:  |  Height:  |  Size: 573 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M64 256V160H224v96H64zm0 64H224v96H64V320zm224 96V320H448v96H288zM448 256H288V160H448v96zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"/></svg>

Before

Width:  |  Height:  |  Size: 492 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32h-1.8l18-48H303.8l18 48H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H390.2L254 52.8zM279.8 304H168.2L224 155.1 279.8 304z"/></svg>

Before

Width:  |  Height:  |  Size: 595 B

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 384 512" preserveAspectRatio="xMinYMid meet"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM96 64H288c17.7 0 32 14.3 32 32v32c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zm32 160a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zM96 352a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM64 416c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32-14.3-32-32zM192 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm32 64a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm64-64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm32 64a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zM288 448a32 32 0 1 1 0-64 32 32 0 1 1 0 64z"/></svg>

Before

Width:  |  Height:  |  Size: 895 B

@@ -178,54 +178,6 @@ EOD;
</html>
EOD;
/** @var string HTML with px18 fail colour values. */
private $px18 = <<<EOD
<body><p style="color:#EF0000; background-color:white; font-size: 18px">
This is not contrasty enough.</p></body>
EOD;
/** @var string HTML with px19bold pass colour values. */
private $px19bold = <<<EOD
<body><p style="color:#EF0000; background-color:white; font-size: 19px; font-weight: bold;">
This is contrasty enough.</p></body>
EOD;
/** @var string HTML with px18 pass colour values. */
private $px18pass = <<<EOD
<body><p style="color:#E60000; background-color:white; font-size: 18px">
This is contrasty enough.</p></body>
EOD;
/** @var string HTML with medium size colour values. */
private $mediumfail = <<<EOD
<body><p style="color:#EF0000; background-color:white; font-size: medium">
This is not contrasty enough.</p></body>
EOD;
/** @var string HTML with px18 colour values. */
private $mediumpass = <<<EOD
<body><p style="color:#E60000; background-color:white; font-size: medium">
This is contrasty enough.</p></body>
EOD;
/** @var string HTML with larger fail colour values. */
private $largerfail = <<<EOD
<body><p style="color:#FF6161; background-color:white; font-size: larger">
This is not contrasty enough.</p></body>
EOD;
/** @var string HTML with px18 colour values. */
private $largerpass = <<<EOD
<body><p style="color:#FF5C5C; background-color:white; font-size: larger;">
This is contrasty enough.</p></body>
EOD;
/** @var string HTML with px18 colour values. */
private $largerboldpass = <<<EOD
<body><p style="color:#FF5C5C; background-color:white; font-size: larger; font-weight: bold;">
This is contrasty enough.</p></body>
EOD;
/**
* Test for the area assign intro
*/
@@ -283,68 +235,4 @@ EOD;
$results = $this->get_checker_results($this->emptyvalue);
$this->assertEmpty($results);
}
/**
* Test for text px18 with insufficient contrast of 4.49.
*/
public function test_check_for_px18_fail() {
$results = $this->get_checker_results($this->px18);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test for text px19 bold with sufficient contrast of 4.49.
*/
public function test_check_for_px19bold_pass() {
$results = $this->get_checker_results($this->px19bold);
$this->assertEmpty($results);
}
/**
* Test for text px18 with sufficient contrast of 4.81.
*/
public function test_check_for_px18_pass() {
$results = $this->get_checker_results($this->px18pass);
$this->assertEmpty($results);
}
/**
* Test for medium (12pt) text with insufficient contrast of 4.49.
*/
public function test_check_for_medium_fail() {
$results = $this->get_checker_results($this->mediumfail);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test for medium (12pt) text with sufficient contrast of 4.81.
*/
public function test_check_for_medium_pass() {
$results = $this->get_checker_results($this->mediumpass);
$this->assertEmpty($results);
}
/**
* Test for larger (14pt) text with insufficient contrast of 2.94.
*/
public function test_check_for_larger_fail() {
$results = $this->get_checker_results($this->largerfail);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test for larger (14pt) text with insufficient contrast of 3.02.
*/
public function test_check_for_larger_pass() {
$results = $this->get_checker_results($this->largerpass);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test for larger (14pt) bold text with sufficient contrast of 3.02.
*/
public function test_check_for_largerbold_pass() {
$results = $this->get_checker_results($this->largerboldpass);
$this->assertEmpty($results);
}
}
+2 -2
View File
@@ -25,5 +25,5 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'tool_brickfield';
$plugin->version = 2023100900;
$plugin->requires = 2023100400;
$plugin->version = 2023042400;
$plugin->requires = 2023041800;
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2023100900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023100400; // Requires this Moodle version.
$plugin->version = 2023042400; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023041800; // Requires this Moodle version.
$plugin->component = 'tool_capability'; // Full name of the plugin (used for diagnostics).
-3
View File
@@ -61,8 +61,5 @@ function xmldb_tool_cohortroles_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2023042401, 'tool', 'cohortroles');
}
// Automatically generated Moodle v4.3.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+2 -2
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2023100900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023100400; // Requires this Moodle version.
$plugin->version = 2023042401; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023041800; // Requires this Moodle version.
$plugin->component = 'tool_cohortroles'; // Full name of the plugin (used for diagnostics).
@@ -9,7 +9,7 @@ menu: "main"
## Moodle templates
[Moodle templates](https://moodledev.io/docs/guides/templates) are use to write HTML and Javascript using mustache files.
[Moodle templates](https://docs.moodle.org/dev/Templates) are use to write HTML and Javascript using mustache files.
If you are creating your own pages in the UI Component library you can load core templates using this (shortcode) syntax:
@@ -51,3 +51,4 @@ This is the result of adding the core/notification template on this page:
"extraclasses": "foo bar"
}
{{< /mustache >}}
@@ -1,212 +0,0 @@
---
layout: docs
title: "Action menus"
description: "A reusable action menu component"
date: 2023-07-27T10:10:00+08:00
draft: false
tags:
- MDL-78665
- "4.3"
---
## How it works
Moodle action menus are a reusable component that can display a list of actions in a dropdown menu. They are used in many places in Moodle, including the user menu, the course administration menu, and the activity administration menu.
## Source files
- `lib/outputcomponents.php`: contains the main `action_menu`, `action_menu_link` and `pix_icon`.
- `lib/classes/output/local/action_menu/subpanel.php`: contains the `subpanel` menu item class.
- `lib/templates/action_menu.mustache`: contains the main template for the action menu.
- `lib/templates/action_menu_*`: location for the legacy auxliar mustache files.
- `lib/templates/local/action_menu/*`: location for any new auxiliar mustache files.
## Examples
<!-- markdownlint-disable-next-line MD033 -->
<iframe src="../../../../examples/actionmenu.php" style="overflow:hidden;height:400px;width:100%;border:0" title="Moodle action menus"></iframe>
## Usage
### Rendering an action menu
The component output classes can render an action menu entirely in PHP. The steps to do it are:
1. Create an action menu instance (with or without items)
2. (optional) Setup the action menu trigger
3. (optional) Add items to the menu (if they are not added on creation)
4. Render the menu.
The following code is a basic example of an action menu:
{{< php >}}
/** @var core_renderer $output*/
$output = $PAGE->get_renderer('core');
$menu = new action_menu();
// Add items.
$menu->add(new action_menu_link(
new moodle_url($PAGE->url, ['foo' => 'bar']),
new pix_icon('t/emptystar', ''),
'Action link example',
false
));
echo $output->render($menu);
{{< / php >}}
And this is the same example but passing the items in the creation:
{{< php >}}
/** @var core_renderer $output*/
$output = $PAGE->get_renderer('core');
$menu = new action_menu([
new action_menu_link(
new moodle_url($PAGE->url, ['foo' => 'bar']),
new pix_icon('t/emptystar', ''),
'Action link example',
false
),
]);
echo $output->render($menu);
{{< / php >}}
### Setup the menu trigger
By default, the action menu trigger is a cog icon. However, the class has methods to convert it to a kebab menu or even display any arbitrary content.
Example of a kebab menu:
{{< php >}}
/** @var core_renderer $output*/
$output = $PAGE->get_renderer('core');
$menu = new action_menu();
$menu->set_kebab_trigger(get_string('edit'), $output);
$menu->set_additional_classes('fields-actions');
{{< / php >}}
Example of a custom trigger:
{{< php >}}
/** @var core_renderer $output*/
$output = $PAGE->get_renderer('core');
$menu = new action_menu();
$menu->set_menu_trigger(get_string('edit'));
{{< / php >}}
### Add items
Items can be added as an array on creation or using the `add` method. Depending on the param passed to `add` the item can be displayed in two different locations:
Primary items: are displayed next to the trigger button as direct actions.
Secondary items: are displayed inside the action menu dropdown.
The item location must be configured before adding the element. The following example shows different ways to add primary and secondary menu items.
{{< php >}}
// Primary items examples.
$menu->add(new action_menu_link(
new moodle_url($PAGE->url),
new pix_icon('t/emptystar', ''),
'Action link example',
true
));
$menu->add(new action_menu_link_primary(
$PAGE->url,
new pix_icon('t/emptystar', ''),
'Action link example',
));
// Secondary items examples.
$menu->add(new action_menu_link(
new moodle_url($PAGE->url),
new pix_icon('t/emptystar', ''),
'Action link example',
false
));
$menu->add(new action_menu_link_secondary(
$PAGE->url,
new pix_icon('t/user', ''),
'Action link example',
));
{{< / php >}}
## Types of items
The `add` method accepts several item types.
### `action_menu_link`
The `action_menu_link` class is the generic class for link items. It has several construct params:
- `moodle_url $url`: the link URL.
- `pix_icon $icon`: an optional pix_icon. If none passed, the item will show the trigger icon or none if it is a kebab menu.
- `string $text`: the text to display.
- `bool $primary`: if the item is primary or secondary. By default, all items are primary.
- `array $attributes`: an optional array of HTML attributes.
Two convenience classes extend `action_menu_link`:
- `action_menu_link_primary`: will be added as a primary item.
- `action_menu_link_secondary`: will be added as a secondary item.
### `pix_icon`
The action menu can render `pix_icon` as primary actions. The `pix_icon` is a standard output class for generating icons in Moodle.
Construct params:
- `String $pix`: the internal icon location. For example, "t/user".
- `String $alt`: an optional alternative text
- `String $component`: the pix icon component. By default, only core icons from the `pix` folder will be used
- `Array $attributes`: optional HTML attributes.
### `core\output\local\action_menu\subpanel`
The `core\output\local\action_menu` allow the `action_menu` to add items that display subpanels when hovered or clicked.
Construct params:
- `string $text`: text to display in the menu item
- `renderable $subpanel`: the output to render inside the subpanel. This param should be renderable using the standard `output::render` method.
- `array $attributes` optional HTML attributes
The following example creates a subpanel using a renderable choicelist instance:
{{< php >}}
/** @var core_renderer $output*/
$output = $PAGE->get_renderer('core');
// A choice list is a renderable class to outpout a user choice.
$choice = new core\output\choicelist('Choice example');
$choice->add_option("statusa", "Status A", [
'url' => $PAGE->url,
'description' => 'Status A description',
'icon' => new pix_icon('t/user', '', ''),
]);
$choice->add_option("statusb", "Status B", [
'url' => $PAGE->url,
'description' => 'Status B description',
'icon' => new pix_icon('t/groupv', '', ''),
]);
$choice->set_selected_value('statusb');
$menu = new action_menu();
// Add subpanel item.
$menu->add(new core\output\local\action_menu\subpanel(
'Subpanel example',
$choice
));
echo $output->render($menu);
{{< / php >}}
### HTML string
If a plain string is added to an action_menu, the action_menu::add method will be printed as it is inside the dropdown menu (as a secondary item).
@@ -68,15 +68,17 @@ each defined as 'MOD_PURPOSE_X', so Assessment is MOD_PURPOSE_ASSESSMENT.
### Purpose colours
The activity icon colours can be customised using the theme Boost 'Raw initial SCSS' feature. Simply copy any of these scss variables that you want to customize, change the colour value and done! There is no background colour for the 'Other' type purpose, it defaults to ```light-grey: #f8f9fa```.
The activity icon colours can be customised using the theme Boost 'Raw initial SCSS' feature. Simply copy this array of scss colours, customise the colours and done! There is no background colour for the 'Other' type purpose, it defaults to ```light-grey: #f8f9fa```.
{{< highlight scss >}}
$activity-icon-administration-bg: #5d63f6;
$activity-icon-assessment-bg: #eb66a2;
$activity-icon-collaboration-bg: #f7634d;
$activity-icon-communication-bg: #11a676;
$activity-icon-content-bg: #399be2;
$activity-icon-interface-bg: #a378ff;
$activity-icon-colors: (
"administration": #5d63f6,
"assessment": #eb00a2,
"collaboration": #f7634d,
"communication": #11a676,
"content": #399be2,
"interface": #a378ff
);
{{</ highlight >}}
### Custom activity icons
@@ -1,378 +0,0 @@
---
layout: docs
title: "Dropdowns"
description: "A reusable dropdown component"
date: 2023-06-13T10:10:00+08:00
draft: false
tags:
- MDL-78279
- "4.3"
---
## How it works
Moodle dropdowns are output components to generate elements that expand extra floating information when clicked.
Currently, the core comes with two prebuild dropdowns:
- Dropdown dialog: to display rich content inside the dropdown area.
- Dropdown status: to display a list of available statuses
## Source files
- `lib/classes/output/local/dialog.php`: to define a dropdown dialog.
- `lib/classes/output/local/dialog.php`: to define a dropdown dialog.
- `lib/classes/output/choicelist.php`: generic output class to define a user choice.
- `lib/templates/local/dropdown/dialog.mustache`
- `lib/templates/local/dropdown/status.mustache`
## Usage
### Dropdown dialog
The constructor for the dropdown dialog class only requires three parameters.
- The button content
- The dropdown content
- An array of additional definitions. However, the output public methods can override all the definition values once the instance is created. Check out the examples to learn how to use them
The following example is the most simple example of creating a dropdown:
{{< php >}}
$dialog = new core\output\local\dropdown\dialog('Open dialog button', 'Dialog content');
echo $OUTPUT->render($dialog);
{{< / php >}}
You have the option to include additional classes to the main component but also to the button itself.
{{< php >}}
$dialog = new core\output\local\dropdown\dialog(
'Open dialog',
'Dialog content',
[
'classes' => 'mb-4',
'buttonclasses' => 'btn btn-primary extraclass',
]
);
echo $OUTPUT->render($dialog);
{{< / php >}}
{{< mustache template="core/local/dropdown/dialog" >}}
{
"buttonid" : "example01",
"buttoncontent" : "Open dialog",
"dialogcontent" : "Dialog content",
"buttonclasses": "btn btn-primary extraclass"
}
{{< /mustache >}}
If a specific item is floating towards the end of the page, you might consider aligning the dropdown menu to the left rather than to the right. To achieve this, you can use the POSITION constant values to set the `dropdownposition` $definition attribute or input it into the `set_position` method.
{{< php >}}
$dialog = new core\output\local\dropdown\dialog('Open dialog', 'Dialog content');
$dialog->set_position(core\output\local\dropdown\dialog::POSITION['end']);
echo $OUTPUT->render($dialog);
{{< / php >}}
By default, the dropdown width will adapt to the content. However, for long texts, there may be better scenarios. You can use the WIDTH constant values to set the `dialogwidth` $definition attribute or input it into the `set_dialog_width` method.
{{< php >}}
// Big but fixed-width example.
$dialog = new core\output\local\dropdown\dialog('Big dialog', $content);
$dialog->set_dialog_width(core\output\local\dropdown\dialog::WIDTH['big']);
echo $OUTPUT->render($dialog);
// Small width example.
$dialog = new core\output\local\dropdown\dialog('Small dialog', $content);
$dialog->set_dialog_width(core\output\local\dropdown\dialog::WIDTH['small']);
echo $OUTPUT->render($dialog);
{{< / php >}}
{{< mustache template="core/local/dropdown/dialog" >}}
{
"buttonid" : "example02",
"buttoncontent" : "Big dialog",
"dialogcontent" : "This is a long content for a big dialog that will be displayed in a fixed-width container.",
"buttonclasses": "btn btn-primary extraclass",
"dialogclasses": "dialog-big"
}
{{< /mustache >}}
### Dropdown status
The dropdown status is a user-choice wrapper. To create it, first, you need to create an instance of `core\output\choicelist` that will be used to generate the dropdown content data.
{{< php >}}
$choice = new core\output\choicelist('Dialog content');
$choice->add_option('option1', 'Option 1');
$choice->add_option('option2', 'Option 2');
$choice->add_option('option3', 'Option 3');
$choice->set_selected_value('option2');
$dialog = new core\output\local\dropdown\status('Open dialog button', $choice);
echo $OUTPUT->render($dialog);
{{< / php >}}
{{< mustache template="core/local/dropdown/status" >}}
{
"buttonid" : "example04",
"buttoncontent" : "Open dialog button",
"dialogcontent" : "Dialog content",
"choices" : {
"hasoptions" : true,
"options" : [
{
"optionid" : "option1",
"value" : "option1",
"name" : "Option 1",
"hasicon" : false,
"first" : true,
"optionnumber" : 1,
"optionuniqid" : "option1uniqid"
},
{
"optionid" : "option2",
"value" : "option2",
"name" : "Option 2",
"hasicon" : false,
"selected" : true,
"optionnumber" : 2,
"optionuniqid" : "option2uniqid"
},
{
"optionid" : "option3",
"value" : "option3",
"name" : "Option 3",
"hasicon" : false,
"optionnumber" : 3,
"optionuniqid" : "option3uniqid"
}
]
}
}
{{< /mustache >}}
The status dropdown is an extension of the dropdown dialog, which means that all the definitions mentioned earlier can also be applied to it.
- The status dropdown is also compatible with all the `core\output\choicelist` extra features like:
- Adding additional icons and descriptions to the options
- Disable options
- Add links to options
The following example shows how to use the advanced features:
{{< php >}}
$choice = new core\output\choicelist('Dialog content');
// Option one is a link.
$choice->add_option('option1', 'Option 1', [
'url' => new moodle_url('/'),
]);
// Option two has an icon and description.
$choice->add_option('option2', 'Option 2', [
'description' => 'Option 2 description',
'icon' => new pix_icon('t/hide', 'Eye icon 2')
]);
// Option three is disabled.
$choice->add_option('option3', 'Option 3', [
'disabled' => true,
]);
$choice->set_selected_value('option2');
$dialog = new core\output\local\dropdown\status('Open dialog button', $choice);
echo $OUTPUT->render($dialog);
{{< / php >}}
#### Sync button text with selected status
The status dropdown can be configured to sync the button text with the selected status.
To do so, you need to set the `buttonsync` $definition attribute to `true`.
{{< php >}}
$choice = new core\output\choicelist();
$choice->add_option('option1', get_string('option1', YOURPLUGIN));
$choice->add_option('option2', get_string('option2', YOURPLUGIN));
$choice->set_selected_value('option2');
// Add some attribute to select through a query selector.
$dialog = new core\output\local\dropdown\status(
get_string('buttontext', YOURPLUGIN),
$choice,
[
'extras' => ['id' => 'mydropdown'],
'buttonsync' => true,
// With 'updatestatus' it will change the status when the user clicks an option
// See "Dropdown status in update mode" section for more information.
'updatestatus' => true,
]
);
echo $OUTPUT->render($dialog);
{{< / php >}}
## Javascript
### Controlling dropdowns
Both `core/local/dropdown/status` and `core/local/dropdown/status` AMD modules provide functions to:
- Open and close the dropdown.
- Change the button content.
- Get the main dropdown HTML element.
Both modules are object-oriented. To get the dropdown instance, the process is as follows:
1. Add id or data attributes to the main component to select it using a query selector.
2. Import `getDropdownDialog` from `core/local/dropdown/dialog`, or `getDropdownStatus` from `core/local/dropdown/status`, depending on whether you use a dialogue or a status dropdown.
3. Call `getDropdownDialog` or `getDropdownStatus` with the query selector to get the instance
Both classes provide the following methods:
- `setVisible(Boolean)` to open or close the dropdown.
- `isVisible()` to know if it is open or closed.
- `setButtonContent(String)` to replace the button content.
- `getElement()`to get the main HTMLElement to add eventListeners.
The following example uses the module to open the dropdown when an extra button is preset:
```js
import {getDropdownDialog} from 'core/local/dropdown/';
const dialog = getDropdownDialog('[MYDROPDOWNSELECTOR]');
document.querySelector('[data-for="openDropdown"]').addEventListener('click', (event) => {
event.stopPropagation();
dialog.setVisible(true);
});
```
### Specific dropdown status methods
The `core/local/dropdown/status` provides extra controls for the status selector, such as:
- `getSelectedValue()` and `setSelectedValue(String)` to control the currently selected status.
- `isButtonSyncEnabled()` and `setButtonSyncEnabled(Boolean)` to synchronise the button text with the selected status.
- `isUpdateStatusEnabled()` and `setUpdateStatusEnabled(Boolean)` to control the auto-update status mode.
## Using dropdown status from the frontend
The dropdown status can operate in two different ways.
### Dropdown status in display only
The display-only is the default behaviour for any dropdown. In display-only mode, the component will show all the status values to the user, but it won't handle and click the event nor change the current status.
If a plugin wants to change the status value when the user clicks, it should code a custom module to:
1. Capture `click` event listeners to the choice items.
2. Send the new status to the backend (using an ad-hoc webservice).
3. If the webservice execution is ok, update the component value using the `setSelectedValue` instance method.
The following example shows how to render a display-only dropdown status in the backend:
{{< php >}}
$choice = new core\output\choicelist('Dialog content');
// Add some data attributes to the choices.
$choice->add_option(
'option1',
get_string('option1', YOURPLUGIN), [
extras' => ['data-action' => 'updateActionName']
]);
$choice->add_option(
'option2',
get_string('option2', YOURPLUGIN), [
extras' => ['data-action' => 'updateActionName']
]);
$choice->set_selected_value('option2');
// Add some attribute to select through a query selector.
$dialog = new core\output\local\dropdown\status(
get_string('buttontext', YOURPLUGIN),
$choice,
['extras' => ['id' => 'mydropdown']]
);
echo $OUTPUT->render($dialog);
{{< / php >}}
Having this PHP code, the AMD controller could be something like:
```js
import {getDropdownStatus} from 'core/local/dropdown/status';
import {sendValueToTheBackend} from 'YOURPLUGIN/example';
const status = getDropdownStatus('#mydropdown');
status.getElement().addEventListener('click', (event) => {
const option = event.target.closest("[data-action='updateActionName']");
if (!option) {
return;
}
try {
if(sendValueToTheBackend(option.dataset.value)) {
status.setSelectedValue(option.dataset.value);
}
} catch (error) {
// Do some error handling here.
}
});
```
### Dropdown status in update mode
The component will act more like an HTML radio button in update mode. It will store the current status value and will trigger `change` events when the value changes.
In this case, the plugin controller has to:
1. Capture the component element `change` event. Remember that, as in radio events, the `change` event won't bubble, so it cannot be delegated to a parent element.
2. Send the new status to the backend (using an ad-hoc webservice).
3. If the webservice execution fails, do a value rollback using the `setSelectedValue` instance method.
The following example shows how to render an update mode dropdown status in the backend:
{{< php >}}
$choice = new core\output\choicelist('Dialog content');
$choice->add_option('option1', get_string('option1', YOURPLUGIN));
$choice->add_option('option2', get_string('option2', YOURPLUGIN));
$choice->set_selected_value('option2');
// Add some attribute to select through a query selector.
$dialog = new core\output\local\dropdown\status(
get_string('buttontext', YOURPLUGIN),
$choice,
[
'extras' => ['id' => 'mydropdown'],
'updatestatus' => true,
]
);
echo $OUTPUT->render($dialog);
{{< / php >}}
Having this PHP code, the AMD controller could be something like:
```js
import {getDropdownStatus} from 'core/local/dropdown/status';
import {sendValueToTheBackend} from 'YOURPLUGIN/example';
const status = getDropdownStatus('#mydropdown');
let currentValue = status.getSelectedValue();
status.getElement().addEventListener('change', (event) => {
if (currentValue == status.getSelectedValue()) {
return;
}
try {
sendValueToTheBackend(status.getSelectedValue());
currentValue = status.getSelectedValue();
} catch (error) {
status.setSelectedValue(currentValue);
}
});
```
**Note**: the `event.target` is also the main element. You can also get the current value from `event.target.dataset.value` if you prefer.
## Examples
<!-- markdownlint-disable-next-line MD033 -->
<iframe src="../../../../examples/dropdowns.php" style="overflow:hidden;height:400px;width:100%;border:0" title="Moodle dynamic tabs"></iframe>

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