Compare commits

..

409 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
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
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
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
Paul Holden e5e6bb9764 MDL-78355 xapi: correct coverage notation for delete state test. 2023-06-06 12:04:09 +01: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
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
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
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
Wehr Mario b29be1a2ed MDL-78004 cache: Fix deprecated null value in Redis connect 2023-05-26 13:24:32 +02:00
= 3180479b87 MDL-63120 core_badges: Avoid multiple joins in sql statement 2023-05-24 13:35:27 +02: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
678 changed files with 8409 additions and 5301 deletions
+19 -19
View File
@@ -35,28 +35,29 @@ class block_management_table extends \core_admin\table\plugin_management_table {
/** @var stdClass[] A list of basic block data */
protected array $blockdata;
/** @var array<string,int> A list of course counts */
protected array $courseblocks;
public function __construct() {
global $DB;
parent::__construct();
$this->undeletableblocktypes = \block_manager::get_undeletable_block_types();
$sql = <<<EOF
SELECT
b.name,
b.id,
b.name,
COUNT(DISTINCT binst.id) as totalcount,
COUNT(DISTINCT bcinst.id) as courseviewcount
FROM {block} b
LEFT JOIN {block_instances} binst ON binst.blockname = b.name
LEFT JOIN {block_instances} bcinst ON
bcinst.blockname = b.name AND
bcinst.pagetypepattern = 'course-view-*'
GROUP BY b.id, b.name, b.visible, binst.blockname, bcinst.blockname
ORDER BY b.name ASC
EOF;
$sql = 'SELECT b.name,
b.id,
COUNT(DISTINCT binst.id) as totalcount
FROM {block} b
LEFT JOIN {block_instances} binst ON binst.blockname = b.name
GROUP BY b.id,
b.name
ORDER BY b.name ASC';
$this->blockdata = $DB->get_records_sql($sql);
$sql = "SELECT blockname
FROM {block_instances}
WHERE pagetypepattern = 'course-view-*'
GROUP BY blockname";
$this->courseblocks = $DB->get_records_sql($sql);
}
protected function get_plugintype(): string {
@@ -102,11 +103,10 @@ class block_management_table extends \core_admin\table\plugin_management_table {
*/
protected function col_instances(stdClass $row): string {
$blockdata = $this->blockdata[$row->plugininfo->name];
if ($blockdata->courseviewcount > 0) {
if (array_key_exists($blockdata->name, $this->courseblocks)) {
return html_writer::link(
new moodle_url('/course/search.php', [
'blocklist' => $row->plugininfo->name,
'sesskey' => sesskey(),
'blocklist' => $blockdata->id,
]),
$blockdata->totalcount,
);
+11
View File
@@ -57,6 +57,7 @@ Options:
--fullname=STRING Name of the site
--shortname=STRING Name of the site
--summary=STRING The summary to be displayed on the front page
--supportemail=STRING Email address for support and help.
-h, --help Print out this help
Example:
@@ -98,6 +99,7 @@ list($options, $unrecognized) = cli_get_params(
'fullname' => '',
'shortname' => '',
'summary' => '',
'supportemail' => '',
'agree-license' => false,
'help' => false
),
@@ -136,6 +138,15 @@ if (!empty($options['adminemail']) && !validate_email($options['adminemail'])) {
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
// Validate that the supportemail provided was an e-mail address.
if (!empty($options['supportemail']) && !validate_email($options['supportemail'])) {
$a = (object) [
'option' => 'supportemail',
'value' => $options['supportemail']
];
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
}
$options['lang'] = clean_param($options['lang'], PARAM_SAFEDIR);
if (!file_exists($CFG->dirroot.'/install/lang/'.$options['lang'])) {
$options['lang'] = 'en';
+189
View File
@@ -4114,4 +4114,193 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.3" requires="3.11.8">
<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.0.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_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+4 -8
View File
@@ -96,20 +96,16 @@ function core_admin_pluginfile($course, $cm, $context, $filearea, $args, $forced
send_file_not_found();
}
// No need for resizing, but if the file should be cached we save it so we can serve it fast next time.
if (empty($maxwidth) && empty($maxheight)) {
// Check whether width/height are specified, and we can resize the image (some types such as ICO cannot be resized).
if (($maxwidth === 0 && $maxheight === 0) ||
!$filedata = $file->resize_image($maxwidth, $maxheight)) {
if ($lifetime) {
file_safe_save_content($file->get_content(), $candidate);
}
send_stored_file($file, $lifetime, 0, false, $options);
}
// Proceed with the resizing.
$filedata = $file->resize_image($maxwidth, $maxheight);
if (!$filedata) {
send_file_not_found();
}
// If we don't want to cached the file, serve now and quit.
if (!$lifetime) {
send_content_uncached($filedata, $filename);
@@ -26,6 +26,9 @@ namespace core_adminpresets\local\setting;
*/
class adminpresets_admin_setting_configmultiselect extends adminpresets_setting {
/** @var \admin_setting_configmultiselect $settingdata */
protected $settingdata;
/**
* Ensure that the $value values are setting choices.
*
@@ -26,6 +26,9 @@ namespace core_adminpresets\local\setting;
*/
class adminpresets_admin_setting_configselect extends adminpresets_setting {
/** @var \admin_setting_configselect $settingdata */
protected $settingdata;
/**
* Sets the setting value cleaning it.
*
@@ -26,6 +26,9 @@ namespace core_adminpresets\local\setting;
*/
class adminpresets_admin_setting_configtime extends adminpresets_setting {
/** @var \admin_setting_configtime $settingdata */
protected $settingdata;
/**
* To check that the value is one of the options
*
@@ -28,6 +28,9 @@ namespace core_adminpresets\local\setting;
*/
class adminpresets_admin_setting_special_backupdays extends adminpresets_setting {
/** @var \admin_setting_special_backupdays $settingdata */
protected $settingdata;
protected function set_value($value) {
$this->value = clean_param($value, PARAM_SEQUENCE);
$this->set_visiblevalue();
@@ -26,6 +26,9 @@ namespace core_adminpresets\local\setting;
*/
class adminpresets_admin_setting_users_with_capability extends adminpresets_admin_setting_configmultiselect {
/** @var \admin_setting_configmultiselect $settingdata */
protected $settingdata;
protected function set_behaviors() {
$this->behaviors['loadchoices'] = &$this->settingdata;
}
-1
View File
@@ -141,7 +141,6 @@ abstract class core_role_allow_role_page {
$table->cellspacing = 0;
$table->width = '90%';
$table->align = array('left');
$table->rotateheaders = true;
$table->head = array('&#xa0;');
$table->colclasses = array('');
@@ -34,8 +34,11 @@ Feature: Manage availability conditions
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "activity" exists:
| activity | page |
| course | C1 |
| name | P1 |
And I log in as "admin"
And I am on site homepage
When I navigate to "Plugins > Availability restrictions > Manage restrictions" in site administration
# Check the icon is there (it should be a Hide icon, meaning is currently visible).
@@ -51,8 +54,7 @@ Feature: Manage availability conditions
# OK, toggling works. Set the grade one to Hide and we'll go see if it actually worked.
And I click on "Hide" "icon" in the "Restriction by grade" "table_row"
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And "Add restriction..." "dialogue" should be visible
@@ -21,12 +21,15 @@ Feature: Edit capabilities
Scenario: Default system capabilities modification
Given I log in as "admin"
And I set the following system permissions of "Teacher" role:
And I navigate to "Users > Permissions > Define roles" in site administration
And I click on "Edit Teacher role" "link"
And I fill the capabilities form with the following permissions:
| capability | permission |
| block/mnet_hosts:myaddinstance | Allow |
| moodle/site:messageanyuser | Inherit |
| moodle/grade:managesharedforms | Prevent |
| moodle/course:request | Prohibit |
And I press "Save changes"
When I follow "Edit Teacher role"
Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission
And "moodle/site:messageanyuser" capability has "Not set" permission
@@ -48,16 +51,12 @@ Feature: Edit capabilities
And "mod/forum:addquestion" capability has "Allow" permission
Scenario: Module capabilities overrides
Given I log in as "teacher1"
And the following "activity" exists:
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | 00001 |
| name | I'm the name |
| intro | I'm the introduction |
| section | 1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "I'm the name"
And I am on the "I'm the name" "forum activity" page logged in as teacher1
And I navigate to "Permissions" in current page administration
And I override the system permissions of "Student" role with:
| mod/forum:deleteanypost | Prohibit |
@@ -379,19 +379,61 @@ class brickfield_accessibility_test {
return false;
}
/**
* Returns an array of the newwindowphrases for all enabled language packs.
* @return array of the newwindowphrases for all enabled language packs.
*/
public static function get_all_newwindowphrases(): array {
// Need to process all enabled lang versions of newwindowphrases.
return static::get_all_phrases('newwindowphrases');
}
/**
* Returns an array of the invalidlinkphrases for all enabled language packs.
* @return array of the invalidlinkphrases for all enabled language packs.
*/
public static function get_all_invalidlinkphrases(): array {
// Need to process all enabled lang versions of invalidlinkphrases.
return static::get_all_phrases('invalidlinkphrases');
}
/**
* Returns an array of the relevant phrases for all enabled language packs.
* @param string $stringname the language string identifier you want get the phrases for.
* @return array of the invalidlinkphrases for all enabled language packs.
*/
protected static function get_all_phrases(string $stringname): array {
$stringmgr = get_string_manager();
$allstrings = [];
$enabledlangs = get_string_manager()->get_list_of_translations();
// Somehow, an invalid string was requested. Add exception handling for this in the future.
if (!$stringmgr->string_exists($stringname, manager::PLUGINNAME)) {
return $allstrings;
}
// Need to process all enabled lang versions of invalidlinkphrases.
$enabledlangs = $stringmgr->get_list_of_translations();
foreach ($enabledlangs as $lang => $value) {
$tmpstring = (string)new \lang_string('invalidlinkphrases', manager::PLUGINNAME, null, $lang);
$tmpstring = (string)new \lang_string($stringname, manager::PLUGINNAME, null, $lang);
$tmplangarray = explode('|', $tmpstring);
$allstrings = array_merge($allstrings, $tmplangarray);
}
// Removing duplicates if a lang is enabled, yet using default 'en' due to no relevant lang file.
$allstrings = array_unique($allstrings);
return $allstrings;
}
/**
* Assesses whether a string contains any readable text, which is text that
* contains any characters other than whitespace characters.
*
* @param string $text
* @return bool
*/
public static function is_text_readable(string $text): bool {
// These characters in order are a space, tab, line feed, carriage return,
// NUL-byte, vertical tab and non-breaking space unicode character \xc2\xa0.
$emptycharacters = " \t\n\r\0\x0B\xc2\xa0";
return trim($text, $emptycharacters) != '';
}
}
@@ -39,9 +39,27 @@ class a_links_dont_open_new_window extends brickfield_accessibility_test {
* The main check function. This is called by the parent class to actually check content.
*/
public function check(): void {
// Need to process all enabled lang versions of newwindowphrases.
$text = brickfield_accessibility_test::get_all_newwindowphrases();
foreach ($this->get_all_elements('a') as $a) {
if ($a->hasAttribute('target') && !in_array($a->getAttribute('target'), $this->allowedtargets)) {
$this->add_report($a);
$phrasefound = false;
foreach ($text as $phrase) {
// Sanity check for readable text.
if (!brickfield_accessibility_test::is_text_readable($phrase)) {
break;
}
$pos = stripos($a->nodeValue, $phrase);
if ($pos !== false) {
$phrasefound = true;
break;
}
}
if (!$phrasefound) {
$this->add_report($a);
}
}
}
}
@@ -39,9 +39,26 @@ class area_dont_open_new_window extends brickfield_accessibility_test {
* The main check function. This is called by the parent class to actually check content
*/
public function check(): void {
// Need to process all enabled lang versions of newwindowphrases.
$text = brickfield_accessibility_test::get_all_newwindowphrases();
foreach ($this->get_all_elements('area') as $area) {
if ($area->hasAttribute('target') && !in_array($area->getAttribute('target'), $this->allowedtargets)) {
$this->add_report($area);
$phrasefound = false;
foreach ($text as $phrase) {
// Sanity check for readable text.
if (!brickfield_accessibility_test::is_text_readable($phrase)) {
break;
}
$pos = stripos($area->getAttribute('alt'), $phrase);
if ($pos !== false) {
$phrasefound = true;
break;
}
}
if (!$phrasefound) {
$this->add_report($area);
}
}
}
}
@@ -76,7 +76,6 @@ class renderer extends plugin_renderer_base {
$label = $tool->get_toolshortname();
}
$tab = new tabobject($idprefix . $toolname, $link, $label);
$tab->extraclass = isset($extraclass[$toolname]) ? $extraclass[$toolname] : null;
$tabs[] = $tab;
}
return $this->render(new tabtree($tabs, $idprefix . $filter->tab));
@@ -93,6 +93,7 @@ $string['invalidcourseid'] = 'Invalid course, please check your input';
$string['invalidlinkphrases'] = 'click|click here|here|more|more here|info|info here|information|information here|read more|read more here|further information|further information here|further details|further details here';
$string['module'] = 'Module';
$string['modulename'] = 'Name';
$string['newwindowphrases'] = 'new window|new-window|new_window';
$string['noerrorsfound'] = 'No common accessibility errors were found for your search parameters. Congratulations!';
$string['norecords'] = 'No relevant records were found for your search parameters.';
$string['notregistered'] = 'Your accessibility toolkit needs to be registered.';
@@ -87,6 +87,19 @@ EOD;
</html>
EOD;
/** @var string Html pass 4 */
private $htmlpass4 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>A link can indicate that it will open in a new window</title>
</head>
<body>
<a href="www.youtube.com" target="_blank">This is youtube (opens in a new window)</a>
</body>
</html>
EOD;
/**
* Test for links opening a new tab or window
*/
@@ -102,5 +115,8 @@ EOD;
$results = $this->get_checker_results($this->htmlpass3);
$this->assertEmpty($results);
$results = $this->get_checker_results($this->htmlpass4);
$this->assertEmpty($results);
}
}
@@ -87,6 +87,19 @@ EOD;
</html>
EOD;
/** @var string Html pass 4 */
private $htmlpass4 = <<<EOD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>A link can indicate that it will open in a new window</title>
</head>
<body>
<area target="_blank" alt="(opens in a new window)"></area>
</body>
</html>
EOD;
/**
* Test Area tags opening new window without warning
*/
@@ -102,5 +115,8 @@ EOD;
$results = $this->get_checker_results($this->htmlpass3);
$this->assertEmpty($results);
$results = $this->get_checker_results($this->htmlpass4);
$this->assertEmpty($results);
}
}
@@ -288,7 +288,7 @@ class data_requests_table extends table_sql {
$actionsmenu = new action_menu($actions);
$actionsmenu->set_menu_trigger(get_string('actions'));
$actionsmenu->set_owner_selector('request-actions-' . $requestid);
$actionsmenu->set_constraint('[data-region=data-requests-table] > .no-overflow');
$actionsmenu->set_boundary('window');
return $OUTPUT->render($actionsmenu);
}
@@ -71,7 +71,7 @@
{{/filter}}
</div>
<div class="mt-1 mb-1" data-region="data-requests-table">
<div class="position-relative mt-1 mb-1" data-region="data-requests-table">
{{{datarequests}}}
</div>
</div>
@@ -30,6 +30,12 @@ Feature: Protected data should not be deleted
| Site purpose | PT1H | 0 |
| prot | P1D | 1 |
| unprot | P1D | 0 |
And the following "mod_forum > discussions" exist:
| user | forum | name | message |
| u1 | forump1 | Discussion subject | Test post in forump1 |
| u1 | forumu1 | Discussion subject | Test post in forumu1 |
| u1 | forump2 | Discussion subject | Test post in forump2 |
| u1 | forumu2 | Discussion subject | Test post in forumu2 |
And I set the category and purpose for the "forump1" "forum" in course "C1" to "CAT" and "prot"
And I set the category and purpose for the "forump2" "forum" in course "C2" to "CAT" and "prot"
And I set the category and purpose for the "forumu1" "forum" in course "C1" to "CAT" and "unprot"
@@ -38,47 +44,25 @@ Feature: Protected data should not be deleted
@javascripta
Scenario: Unexpired and protected data is not removed
Given I log in as "u1"
And I am on "C1" course homepage
And I add a new discussion to "forump1" forum with:
| Subject | Discussion subject |
| Message | Test post in forump1 |
And I am on "C1" course homepage
And I add a new discussion to "forumu1" forum with:
| Subject | Discussion subject |
| Message | Test post in forumu1 |
And I am on "C2" course homepage
And I add a new discussion to "forump2" forum with:
| Subject | Discussion subject |
| Message | Test post in forump2 |
And I am on "C2" course homepage
And I add a new discussion to "forumu2" forum with:
| Subject | Discussion subject |
| Message | Test post in forumu2 |
And I log out
And I log in as "admin"
Given I log in as "admin"
And I create a dataprivacy "delete" request for "u1"
And I approve a dataprivacy "delete" request for "u1"
And I run all adhoc tasks
And I navigate to "Users > Privacy and policies > Data requests" in site administration
And I should see "Deleted" in the "u1" "table_row"
And I am on "C1" course homepage
And I follow "forump1"
And I am on the "forump1" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forump1"
When I am on "C1" course homepage
And I follow "forumu1"
When I am on the "forumu1" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forumu1"
And I am on "C2" course homepage
And I follow "forump2"
And I am on the "forump2" "forum activity" page
And I follow "Discussion subject"
Then I should see "Test post in forump2"
When I am on "C2" course homepage
And I follow "forumu2"
When I am on the "forumu2" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forumu2"
+11 -17
View File
@@ -15,6 +15,17 @@ Feature: Manage plan workflow
| usermanageowndraftplan | User manage own draft plan role | user |
| usermanageownplan | User manage own plan role | user |
| manageplan | Manager all plans role | manager |
And the following "role capabilities" exist:
| role | moodle/competency:planmanageowndraft | moodle/competency:planmanageown |
| usermanageowndraftplan | allow | |
| usermanageownplan | allow | allow |
| manageplan | allow | allow |
And the following "role capability" exists:
| role | manageplan |
| moodle/competency:planmanage | allow |
| moodle/competency:planview | allow |
| moodle/competency:planreview | allow |
| moodle/competency:planrequestreview | allow |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| user1 | usermanageowndraftplan | System | |
@@ -40,23 +51,6 @@ Feature: Manage plan workflow
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| lp | System | 1 | my-index | content |
And I log in as "admin"
And I set the following system permissions of "User manage own draft plan role" role:
| capability | permission |
| moodle/competency:planmanageowndraft | Allow |
And I set the following system permissions of "User manage own plan role" role:
| capability | permission |
| moodle/competency:planmanageowndraft | Allow |
| moodle/competency:planmanageown | Allow |
And I set the following system permissions of "Manager all plans role" role:
| capability | permission |
| moodle/competency:planmanage | Allow |
| moodle/competency:planmanagedraft | Allow |
| moodle/competency:planmanageowndraft | Allow |
| moodle/competency:planview | Allow |
| moodle/competency:planreview | Allow |
| moodle/competency:planrequestreview | Allow |
And I log out
Scenario: User can manages his own plan draft
Given I log in as "user1"
+2
View File
@@ -25,6 +25,8 @@
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toollpexportcsv');
$pagetitle = get_string('exportnavlink', 'tool_lpimportcsv');
$context = context_system::instance();
+2
View File
@@ -25,6 +25,8 @@ define('NO_OUTPUT_BUFFERING', true);
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toollpimportcsv');
$pagetitle = get_string('pluginname', 'tool_lpimportcsv');
$context = context_system::instance();
+1 -1
View File
@@ -222,7 +222,7 @@ function tool_mobile_standard_footer_html() {
global $CFG;
$output = '';
if (!empty($CFG->enablemobilewebservice) && $url = tool_mobile_create_app_download_url()) {
$output .= html_writer::link($url, get_string('getmoodleonyourmobile', 'tool_mobile'));
$output .= html_writer::link($url, get_string('getmoodleonyourmobile', 'tool_mobile'), ['class' => 'mobilelink']);
}
return $output;
}
+3 -2
View File
@@ -31,7 +31,6 @@ define('NO_DEBUG_DISPLAY', true);
define('NO_MOODLE_COOKIES', true);
require_once(__DIR__ . '/../../../config.php');
use tool_mobile\api;
header('Content-Type: application/json; charset: utf-8');
@@ -41,7 +40,9 @@ if (!empty($CFG->enablemobilewebservice) && !empty($mobilesettings->enablesmarta
!empty($mobilesettings->androidappid)) {
$manifest = new StdClass;
$manifest->short_name = format_string($SITE->shortname);
$manifest->short_name = format_string($SITE->shortname, true, [
'context' => \core\context\system::instance(),
]);
$manifest->prefer_related_applications = true;
$manifest->icons = [(object)
[
@@ -194,10 +194,9 @@ class subscription_manager {
if (!is_null($coursecontext)) {
$context = $coursecontext;
$courseid = $subscription->courseid;
} else if (!empty($subscription->courseid) && ($coursecontext =
} else if (!empty($subscription->courseid) && ($context =
\context_course::instance($subscription->courseid, IGNORE_MISSING))) {
$courseid = $subscription->courseid;
$context = $coursecontext;
} else {
$courseid = 0;
$context = \context_system::instance();
@@ -169,10 +169,9 @@ Feature: tool_monitor_subscriptions
And I should not see "You can manage rules the from the Event monitoring rules page."
Scenario: No manage rules link when user does not have permission
Given I log in as "admin"
And I set the following system permissions of "Non-editing teacher" role:
| tool/monitor:managerules | Prohibit |
And I log out
Given the following "role capability" exists:
| role | teacher |
| tool/monitor:managerules | prohibit |
And I log in as "teacher1"
And I follow "Preferences" in the user menu
And I follow "Event monitoring"
@@ -48,8 +48,8 @@ use tool_policy\policy_version;
*/
class page_viewalldoc implements renderable, templatable {
/** @var string Return url */
private $returnurl;
/** @var ?moodle_url Return url */
private $returnurl = null;
/** @var array List current (active) policy versions. */
private array $policies = [];
@@ -59,7 +59,10 @@ class page_viewalldoc implements renderable, templatable {
*
*/
public function __construct($returnurl) {
$this->returnurl = $returnurl;
if (!empty($returnurl)) {
$this->returnurl = new moodle_url($returnurl);
}
$this->prepare_global_page_access();
$this->prepare_policies();
}
@@ -48,11 +48,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And "Pending" "text" should exist in the "User Two" "table_row"
Scenario: Agree on behalf of another user as a manager, single policy, javascript off
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -73,11 +71,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Agree on behalf of another user as a manager, single policy, javascript on
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -135,13 +131,13 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And "Pending" "text" should exist in the "This privacy policy" "table_row"
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript off
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Continue"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -167,14 +163,14 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript on
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Activate"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -215,11 +211,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And I should not see "Policies and agreements"
Scenario: Policies and agreements profile link visible also for users who can access on behalf of others
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -231,11 +225,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
Then I should see "Policies and agreements"
Scenario: Agree on behalf of another user as an admin who is logged in as a manager
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -261,14 +253,14 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Bulk agree on behalf of another users as a manager, multiple policies, javascript on
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Activate"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
+1 -1
View File
@@ -101,7 +101,7 @@ class tool_uploadcourse_course {
/** @var array fields allowed as course data. */
static protected $validfields = array('fullname', 'shortname', 'idnumber', 'category', 'visible', 'startdate', 'enddate',
'summary', 'format', 'theme', 'lang', 'newsitems', 'showgrades', 'showreports', 'legacyfiles', 'maxbytes',
'groupmode', 'groupmodeforce', 'enablecompletion', 'downloadcontent');
'groupmode', 'groupmodeforce', 'enablecompletion', 'downloadcontent', 'showactivitydates');
/** @var array fields required on course creation. */
static protected $mandatoryfields = array('fullname', 'category');
@@ -192,6 +192,10 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form {
$mform->addHelpButton('defaults[enablecompletion]', 'enablecompletion', 'completion');
}
$mform->addElement('selectyesno', 'defaults[showactivitydates]', get_string('showactivitydates'));
$mform->addHelpButton('defaults[showactivitydates]', 'showactivitydates');
$mform->setDefault('defaults[showactivitydates]', $courseconfig->showactivitydates);
// Add custom fields to the form.
$handler = \core_course\customfield\course_handler::create();
$handler->instance_form_definition($mform, 0, 'defaultvaluescustomfieldcategory', 'tool_uploadcourse');
@@ -166,6 +166,7 @@ $defaults['groupmodeforce'] = $courseconfig->groupmodeforce;
$defaults['visible'] = $courseconfig->visible;
$defaults['lang'] = $courseconfig->lang;
$defaults['enablecompletion'] = $courseconfig->enablecompletion;
$defaults['showactivitydates'] = $courseconfig->showactivitydates;
// Course template.
if (isset($options['templatecourse'])) {
@@ -425,6 +425,7 @@ class course_test extends \advanced_testcase {
'groupmode' => '2',
'groupmodeforce' => '1',
'enablecompletion' => '1',
'showactivitydates' => '1',
'tags' => 'Cat, Dog',
'role_teacher' => 'Knight',
@@ -478,6 +479,7 @@ class course_test extends \advanced_testcase {
$this->assertEquals($data['groupmode'], $course->groupmode);
$this->assertEquals($data['groupmodeforce'], $course->groupmodeforce);
$this->assertEquals($data['enablecompletion'], $course->enablecompletion);
$this->assertEquals($data['showactivitydates'], $course->showactivitydates);
$this->assertEquals($data['tags'], join(', ', \core_tag_tag::get_item_tags_array('core', 'course', $course->id)));
// Roles.
@@ -530,6 +532,7 @@ class course_test extends \advanced_testcase {
'groupmode' => '1',
'groupmodeforce' => '0',
'enablecompletion' => '0',
'showactivitydates' => '0',
'role_teacher' => 'Teacher',
'role_manager' => 'Manager',
@@ -583,6 +586,7 @@ class course_test extends \advanced_testcase {
$this->assertEquals($data['groupmode'], $course->groupmode);
$this->assertEquals($data['groupmodeforce'], $course->groupmodeforce);
$this->assertEquals($data['enablecompletion'], $course->enablecompletion);
$this->assertEquals($data['showactivitydates'], $course->showactivitydates);
// Roles.
$roleids = array();
@@ -644,6 +648,7 @@ class course_test extends \advanced_testcase {
'groupmode' => '2',
'groupmodeforce' => '1',
'enablecompletion' => '1',
'showactivitydates' => '1',
);
$this->assertFalse($DB->record_exists('course', array('shortname' => 'c1')));
@@ -673,6 +678,7 @@ class course_test extends \advanced_testcase {
$this->assertEquals($defaultdata['groupmode'], $course->groupmode);
$this->assertEquals($defaultdata['groupmodeforce'], $course->groupmodeforce);
$this->assertEquals($defaultdata['enablecompletion'], $course->enablecompletion);
$this->assertEquals($defaultdata['showactivitydates'], $course->showactivitydates);
// Update.
$cat = $this->getDataGenerator()->create_category();
@@ -701,6 +707,7 @@ class course_test extends \advanced_testcase {
'groupmode' => '1',
'groupmodeforce' => '0',
'enablecompletion' => '0',
'showactivitydates' => '0',
);
$this->assertTrue($DB->record_exists('course', array('shortname' => 'c1')));
@@ -730,6 +737,7 @@ class course_test extends \advanced_testcase {
$this->assertEquals($defaultdata['groupmode'], $course->groupmode);
$this->assertEquals($defaultdata['groupmodeforce'], $course->groupmodeforce);
$this->assertEquals($defaultdata['enablecompletion'], $course->enablecompletion);
$this->assertEquals($defaultdata['showactivitydates'], $course->showactivitydates);
}
public function test_rename() {
@@ -153,14 +153,10 @@ Feature: Apply tour filters to a tour
| Course 1 | C1 | topics | 1 |
| Course 2 | C2 | topics | 1 |
And the following "activities" exist:
| activity | course | name | firstpagetitle | wikimode |
| wiki | C1 | Test wiki name | First page | collaborative |
| activity | course | name | firstpagetitle | wikimode | idnumber | intro | type |
| wiki | C1 | Test wiki name | First page | collaborative | | | |
| forum | C2 | Test forum name | | | 001 | Test forum description | general |
And I log in as "admin"
And I am on "Course 2" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
And I add a new user tour with:
| Name | Wiki tour |
| Description | A tour with both matches |
+14 -8
View File
@@ -48,11 +48,7 @@ if ($confirmed) {
throw new \moodle_exception('cannotfinduser', '', '', $userid);
}
if (!$user->suspended) {
complete_user_login($user);
\core\session\manager::apply_concurrent_login_limit($user->id, session_id());
if ($user->id == $USER->id) {
// Check where to go, $redirect has a higher preference.
if (empty($redirect) and !empty($SESSION->wantsurl) ) {
$redirect = $SESSION->wantsurl;
@@ -69,14 +65,24 @@ if ($confirmed) {
$PAGE->set_heading($COURSE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter');
echo "<h3>".get_string("thanks").", ". fullname($USER) . "</h3>\n";
echo "<h3>".get_string("thanks").", ". fullname($user) . "</h3>\n";
echo "<p>".get_string("confirmed")."</p>\n";
echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
// If $wantsurl and $redirect are empty, then the button will navigate the identical user to the dashboard.
if ($user->id == $USER->id) {
echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
} else if (!isloggedin() || isguestuser()) {
echo $OUTPUT->single_button(get_login_url(), get_string('login'));
} else {
echo $OUTPUT->single_button("$CFG->wwwroot/login/logout.php", get_string('logout'));
}
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
exit;
} else {
\core\notification::error(get_string('confirmationinvalid', 'auth_oauth2'));
// Avoid error if logged-in user visiting the page.
if (!isloggedin()) {
\core\notification::error(get_string('confirmationinvalid', 'auth_oauth2'));
}
}
redirect("$CFG->wwwroot/");
@@ -16,26 +16,15 @@ Feature: availability_completion
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name | completion |
| page | C1 | Page 1 | 1 |
| page | C1 | Page 2 | |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add a Page with a completion tickbox.
And I add a "Page" to section "1" and I fill the form with:
| Name | Page 1 |
| Description | Test |
| Page content | Test |
| Completion tracking | 1 |
# And another one that depends on it (hidden otherwise).
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | Page 2 |
| Description | Test |
| Page content | Test |
Given I am on the "Page 2" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
@@ -44,9 +33,7 @@ Feature: availability_completion
And I press "Save and return to course"
# Log back in as student.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# Page 2 should not appear yet.
Then I should not see "Page 2" in the "region-main" "region"
@@ -58,27 +45,12 @@ Feature: availability_completion
@javascript
Scenario: Test completion and course cache rebuild
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| forum | forum 1 | forum 1 | C1 | forum1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I open "forum 1" actions menu
And I click on "Edit settings" "link" in the "forum 1" activity
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| completionview | 1 |
| completionpostsenabled | 1 |
| completionposts | 2 |
And I press "Save and return to course"
And I add a new discussion to "forum 1" forum with:
| Subject | Forum post 1 |
| Message | This is the body |
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | Page 2 |
| Description | Test |
| Page content | Test |
| activity | name | course | idnumber | completion | completionview | completionpostsenabled | completionposts |
| forum | forum 1 | C1 | forum1 | 2 | 1 | 1 | 2 |
And the following "mod_forum > discussions" exist:
| forum | subject | message |
| forum1 | Forum post 1 | This is the body |
And I am on the "Page 2" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I press "Add restriction..."
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
@@ -87,25 +59,18 @@ Feature: availability_completion
| Required completion status | must be marked complete |
| cm | forum 1 |
And I press "Save and return to course"
And I log out
And I log in as "student1"
When I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# Page 2 should not appear yet.
Then I should not see "Page 2" in the "region-main" "region"
And I click on "forum 1" "link" in the "region-main" "region"
# Page 2 should not appear yet.
And I should not see "Page 2" in the "region-main" "region"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "forum 1" "forum activity editing" page
And I am on the "forum 1" "forum activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I set the following fields to these values:
| completionpostsenabled | 0 |
And I press "Save and display"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" "course" page logged in as "student1"
And I click on "forum 1" "link" in the "region-main" "region"
And I am on "Course 1" course homepage
And I should see "Page 2" in the "region-main" "region"
@@ -18,21 +18,17 @@ Feature: Confirm that conditions on completion no longer cause a bug
@javascript
Scenario: Multiple completion conditions on glossary
# Set up course.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" "course" page logged in as "teacher1"
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the field "Enable completion tracking" to "Yes"
And I press "Save and display"
And I turn editing mode on
# Add a couple of Pages with manual completion.
And I add a "Page" to section "1" and I fill the form with:
| Name | Page1 |
| Page content | x |
And I add a "Page" to section "1" and I fill the form with:
| Name | Page2 |
| Page content | x |
And the following "activities" exist:
| activity | course | name | completion |
| page | C1 | Page1 | 1 |
| page | C1 | Page2 | 1 |
# Add a Glossary.
When I add a "Glossary" to section "1"
@@ -16,19 +16,15 @@ Feature: availability_date
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name |
| page | C1 | Page 1 |
| page | C1 | Page 2 |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add a Page with a date condition that does match (from the past).
And I add a "Page" to section "1"
And I set the following fields to these values:
| Name | Page 1 |
| Description | Test |
| Page content | Test |
Given I am on the "Page 1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Date" "button" in the "Add restriction..." "dialogue"
@@ -37,11 +33,7 @@ Feature: availability_date
And I press "Save and return to course"
# Add a Page with a date condition that doesn't match (until the past).
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | Page 2 |
| Description | Test |
| Page content | Test |
And I am on the "Page 2" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Date" "button" in the "Add restriction..." "dialogue"
@@ -51,9 +43,7 @@ Feature: availability_date
And I press "Save and return to course"
# Log back in as student.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# Page 1 should appear, but page 2 does not.
Then I should see "Page 1" in the "region-main" "region"
@@ -17,26 +17,17 @@ Feature: availability_grade
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
# Add an assignment.
And the following "activity" exists:
| activity | assign |
| course | C1 |
| section | 1 |
| name | A1 |
| intro | x |
| assignsubmission_onlinetext_enabled | 1 |
And the following "activities" exist:
| activity | course | name | assignsubmission_onlinetext_enabled |
| assign | C1 | A1 | 1 |
| page | C1 | P1 | |
| page | C1 | P2 | |
| page | C1 | P3 | |
| page | C1 | P4 | |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add a Page with a grade condition for 'any grade'.
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | P2 |
| Description | x |
| Page content | x |
Given I am on the "P2" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
@@ -45,11 +36,7 @@ Feature: availability_grade
And I press "Save and return to course"
# Add a Page with a grade condition for 50%.
And I add a "Page" to section "3"
And I set the following fields to these values:
| Name | P3 |
| Description | x |
| Page content | x |
And I am on the "P3" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
@@ -62,23 +49,16 @@ Feature: availability_grade
And I press "Save and return to course"
# Check if disabling a part of the restriction is get saved.
And I open "P3" actions menu
And I click on "Edit settings" "link" in the "P3" activity
And I am on the "P3" "page activity editing" page
And I expand all fieldsets
And I click on "max" "checkbox" in the ".availability-item" "css_element"
And I press "Save and return to course"
And I open "P3" actions menu
And I click on "Edit settings" "link" in the "P3" activity
And I expand all fieldsets
And I am on the "P3" "page activity editing" page
And the field "Maximum grade percentage (exclusive)" matches value ""
And I am on "Course 1" course homepage
# Add a Page with a grade condition for 10%.
And I add a "Page" to section "4"
And I set the following fields to these values:
| Name | P4 |
| Description | x |
| Page content | x |
And I am on the "P4" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
@@ -88,8 +68,6 @@ Feature: availability_grade
And I set the field "Minimum grade percentage (inclusive)" to "10"
And I press "Save and return to course"
And I log out
# Log in as student without a grade yet.
When I am on the "A1" "assign activity" page logged in as student1
@@ -104,7 +82,6 @@ Feature: availability_grade
And I should not see "P3" in the "region-main" "region"
And I should not see "P4" in the "region-main" "region"
And I should see "A1" in the "region-main" "region"
And I log out
# Log back in as teacher.
When I am on the "A1" "assign activity" page logged in as teacher1
@@ -143,12 +120,8 @@ Feature: availability_grade
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
And I set the field "Grade" to "A-One"
@@ -16,15 +16,16 @@ Feature: availability_group
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name |
| page | C1 | P1 |
| page | C1 | P2 |
| page | C1 | P3 |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Start to add a Page. If there aren't any groups, there's no Group option.
And I add a "Page" to section "1"
Given I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
Then "Group" "button" should not exist in the "Add restriction..." "dialogue"
@@ -37,8 +38,7 @@ Feature: availability_group
| G2 | C1 | GI2 |
# This step used to be 'And I follow "C1"', but Chrome thinks the breadcrumb
# is not clickable, so we'll go via the home page instead.
And I am on "Course 1" course homepage
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
Then "Group" "button" should exist in the "Add restriction..." "dialogue"
@@ -47,18 +47,10 @@ Feature: availability_group
Given I click on "Group" "button" in the "Add restriction..." "dialogue"
And I set the field "Group" to "(Any group)"
And I click on ".availability-item .availability-eye img" "css_element"
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Save and return to course" "button"
# Page P2 with group G1.
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | P2 |
| Description | x |
| Page content | x |
And I am on the "P2" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Group" "button" in the "Add restriction..." "dialogue"
@@ -67,11 +59,7 @@ Feature: availability_group
And I click on "Save and return to course" "button"
# Page P3 with group G2
And I add a "Page" to section "3"
And I set the following fields to these values:
| Name | P3 |
| Description | x |
| Page content | x |
And I am on the "P3" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Group" "button" in the "Add restriction..." "dialogue"
@@ -80,9 +68,7 @@ Feature: availability_group
And I click on "Save and return to course" "button"
# Log back in as student.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# No pages should appear yet.
Then I should not see "P1" in the "region-main" "region"
@@ -93,8 +79,6 @@ Feature: availability_group
Given the following "group members" exist:
| user | group |
| student1 | GI1 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
# P1 (any groups) and P2 should show but not P3.
@@ -113,19 +97,12 @@ Feature: availability_group
# The activity names filter is enabled because it triggered a bug in older versions.
And the "activitynames" filter is "on"
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Add restriction..." "button"
And I click on "Group" "button" in the "Add restriction..." "dialogue"
And I set the field "Group" to "G-One"
And I click on "Save and return to course" "button"
And I log out
# Student sees information about no access to group, with group name in correct language.
When I am on the "C1" "Course" page logged in as "student1"
@@ -22,15 +22,16 @@ Feature: availability_grouping
And the following "group members" exist:
| user | group |
| student1 | GI1 |
# Basic setup.
And the following "activities" exist:
| activity | course | name |
| page | C1 | P1 |
| page | C1 | P2 |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Start to add a Page. If there aren't any groupings, there's no Grouping option.
And I add a "Page" to section "1"
Given I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
Then "Grouping" "button" should not exist in the "Add restriction..." "dialogue"
@@ -44,7 +45,7 @@ Feature: availability_grouping
| name | course | idnumber |
| GX1 | C1 | GXI1 |
| GX2 | C1 | GXI2 |
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
Then "Grouping" "button" should exist in the "Add restriction..." "dialogue"
@@ -53,18 +54,10 @@ Feature: availability_grouping
Given I click on "Grouping" "button"
And I set the field "Grouping" to "GX1"
And I click on ".availability-item .availability-eye img" "css_element"
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Save and return to course" "button"
# Page P2 with grouping GX2.
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | P2 |
| Description | x |
| Page content | x |
And I am on the "P2" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grouping" "button"
@@ -73,21 +66,17 @@ Feature: availability_grouping
And I click on "Save and return to course" "button"
# Log back in as student.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# No pages should appear yet.
Then I should not see "P1" in the "region-main" "region"
And I should not see "P2" in the "region-main" "region"
# Add group to grouping and log out/in again.
And I log out
And the following "grouping groups" exist:
| grouping | group |
| GXI1 | GI1 |
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" "course" page logged in as "student1"
# P1 should show but not B2.
Then I should see "P1" in the "region-main" "region"
@@ -129,14 +118,10 @@ Feature: availability_grouping
# The activity names filter is enabled because it triggered a bug in older versions.
And the "activitynames" filter is "on"
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I open "Test assign" actions menu
And I choose "Edit settings" in the open action menu
And I am on the "Test assign" "assign activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I press "Add group/grouping access restriction"
And I press "Save and return to course"
And I log out
# Student sees information about no access to group, with group name in correct language.
When I am on the "C1" "Course" page logged in as "student1"
@@ -16,19 +16,15 @@ Feature: availability_profile
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name |
| page | C1 | P1 |
| page | C1 | P2 |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add
And I add a "Page" to section "1"
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
Given I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
@@ -38,11 +34,7 @@ Feature: availability_profile
And I click on "Save and return to course" "button"
# Add
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | P2 |
| Description | x |
| Page content | x |
And I am on the "P2" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
@@ -52,9 +44,7 @@ Feature: availability_profile
And I click on "Save and return to course" "button"
# Log back in as student.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# I see P1 but not P2.
Then I should see "P1" in the "region-main" "region"
@@ -72,12 +62,7 @@ Feature: availability_profile
And I click on "Update profile" "button"
# Set Page activity which has requirement on this field.
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "1"
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
@@ -94,9 +79,7 @@ Feature: availability_profile
And the field "Value to compare against" matches value "Bananaman"
# Log out and back in as student. Should be able to see activity.
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" "course" page logged in as "student1"
Then I should see "P1" in the "region-main" "region"
@javascript
@@ -110,14 +93,8 @@ Feature: availability_profile
# The activity names filter is enabled because it triggered a bug in older versions.
And the "activitynames" filter is "on"
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Add restriction..." "button"
And I click on "User profile" "button" in the "Add restriction..." "dialogue"
And I set the following fields to these values:
@@ -34,19 +34,16 @@ Feature: display_availability
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | section | name |
| page | C1 | 1 | Page 1 |
| page | C1 | 2 | Page 2 |
| page | C1 | 3 | Page 3 |
@javascript
Scenario: Activity availability display
# Set up.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add a Page with 1 restriction.
When I add a "Page" to section "1"
And I set the following fields to these values:
| Name | Page 1 |
| Description | Test |
| Page content | Test |
Given I am on the "Page 1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I press "Add restriction..."
And I click on "Date" "button" in the "Add restriction..." "dialogue"
@@ -56,11 +53,7 @@ Feature: display_availability
And I press "Save and return to course"
# Add a Page with 2 restrictions - one is set to hide from students if failed.
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | Page 2 |
| Description | Test |
| Page content | Test |
And I am on the "Page 2" "page activity editing" page
And I expand all fieldsets
And I press "Add restriction..."
And I click on "Date" "button" in the "Add restriction..." "dialogue"
@@ -75,12 +68,6 @@ Feature: display_availability
And I set the field "Method of comparison" to "is equal to"
And I press "Save and return to course"
# Add another Page with no restrictions.
And I add a "Page" to section "3" and I fill the form with:
| Name | Page 3 |
| Description | Test |
| Page content | Test |
# Page 1 should show in single-line format, showing the date
Then I should see "Available until" in the "#section-1 .availabilityinfo" "css_element"
And I should see "2013" in the "#section-1 .availabilityinfo" "css_element"
@@ -98,9 +85,7 @@ Feature: display_availability
And "#section-3 .availabilityinfo" "css_element" should not exist
# Change to student view.
Given I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "C1" "Course" page logged in as "student1"
# Page 1 display still there but should not be a link.
Then I should see "Page 1" in the "#section-1" "css_element"
@@ -119,8 +104,8 @@ Feature: display_availability
@javascript
Scenario: Section availability display
# Set up.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Given I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
# Add a restriction to section 1 (visible to students).
When I edit the section "1"
@@ -144,29 +129,13 @@ Feature: display_availability
# This is necessary because otherwise it fails in Chrome, see MDL-44959
And I am on "Course 1" course homepage
# Add Pages to each section.
And I add a "Page" to section "1" and I fill the form with:
| Name | Page 1 |
| Description | Test |
| Page content | Test |
And I add a "Page" to section "2" and I fill the form with:
| Name | Page 2 |
| Description | Test |
| Page content | Test |
And I add a "Page" to section "3" and I fill the form with:
| Name | Page 3 |
| Description | Test |
| Page content | Test |
# Check display
Then I should see "Available until" in the "#section-1 .availabilityinfo" "css_element"
And I should see "Available until" in the "#section-2 .availabilityinfo" "css_element"
And I should see "hidden otherwise" in the "#section-2 .availabilityinfo" "css_element"
# Change to student view.
Given I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" "Course" page logged in as "student1"
# The contents of both sections should be hidden.
Then I should not see "Page 1" in the "region-main" "region"
@@ -27,6 +27,10 @@ Feature: edit_availability
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | forum |
| course | C1 |
| name | MyForum |
Scenario: Confirm the 'enable availability' option is working
Given the following config values are set as admin:
@@ -55,12 +59,8 @@ Feature: edit_availability
| activity | page |
| course | C1 |
| idnumber | 0002 |
| section | 1 |
| name | Page2 |
| intro | pageintro |
And I am on "Course 1" course homepage
And I follow "Page2"
And I navigate to "Settings" in current page administration
And I am on the "Page2" "page activity editing" page
Then "Restrict access" "fieldset" should exist
Given I am on "Course 1" course homepage
@@ -70,9 +70,12 @@ Feature: edit_availability
@javascript
Scenario: Edit availability using settings in activity form
# Set up.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "1"
Given the following "activity" exists:
| activity | page |
| course | C1 |
| section | 1 |
| name | P1 |
And I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
Then I should see "None" in the "Restrict access" "fieldset"
@@ -178,9 +181,7 @@ Feature: edit_availability
# Button does not exist when conditional access restrictions are turned off.
Given the following config values are set as admin:
| enableavailability | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1"
And I am on the "MyForum" "forum activity editing" page logged in as admin
When I expand all fieldsets
Then "Add group/grouping access restriction" "button" should not exist
@@ -190,12 +191,7 @@ Feature: edit_availability
Given the following "groupings" exist:
| name | course | idnumber |
| GX1 | C1 | GXI1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1"
And I set the following fields to these values:
| Forum name | MyForum |
| Description | x |
And I am on the "MyForum" "forum activity editing" page logged in as admin
When I expand all fieldsets
Then the "Add group/grouping access restriction" "button" should be disabled
+17 -6
View File
@@ -132,6 +132,7 @@ class core_backup_external extends external_api {
array(
'filename' => new external_value(PARAM_FILE, 'Backup filename', VALUE_REQUIRED, null, NULL_NOT_ALLOWED),
'contextid' => new external_value(PARAM_INT, 'Context id', VALUE_REQUIRED, null, NULL_NOT_ALLOWED),
'backupid' => new external_value(PARAM_ALPHANUMEXT, 'Backup id', VALUE_REQUIRED, null, NULL_NOT_ALLOWED),
)
);
}
@@ -142,9 +143,10 @@ class core_backup_external extends external_api {
*
* @param string $filename The file name of the backup file.
* @param int $contextid The context the backup relates to.
* @param string $backupid The backup ID to get the backup settings.
* @since Moodle 3.7
*/
public static function get_async_backup_links_backup($filename, $contextid) {
public static function get_async_backup_links_backup($filename, $contextid, $backupid) {
// Release session lock.
\core\session\manager::write_close();
@@ -153,7 +155,8 @@ class core_backup_external extends external_api {
self::get_async_backup_links_backup_parameters(),
array(
'filename' => $filename,
'contextid' => $contextid
'contextid' => $contextid,
'backupid' => $backupid,
)
);
@@ -162,10 +165,18 @@ class core_backup_external extends external_api {
self::validate_context($context);
require_capability('moodle/backup:backupcourse', $context);
if ($cm) {
$filearea = 'activity';
} else {
$filearea = 'course';
// Backups without user info or with the anonymise functionality enabled are sent
// to user's "user_backup" file area.
$filearea = 'backup';
// Get useful info to render async status in correct area.
$bc = \backup_controller::load_controller($backupid);
list($hasusers, $isannon) = \async_helper::get_userdata_backup_settings($bc);
if ($hasusers && !$isannon) {
if ($cm) {
$filearea = 'activity';
} else {
$filearea = 'course';
}
}
$results = \async_helper::get_backup_file_info($filename, $filearea, $contextid);
+47 -1
View File
@@ -87,7 +87,7 @@ class async_backup_test extends \advanced_testcase {
set_config('buffersize', 0, 'logstore_standard');
get_log_manager(true);
// Start backup process.
// Case 1: Make a course backup without users.
$this->setUser($teacher->id);
// Make the backup controller for an async backup.
@@ -132,6 +132,52 @@ class async_backup_test extends \advanced_testcase {
'target' => 'course_backup'], '*', MUST_EXIST);
$otherdata = json_decode($logrec->other);
$this->assertEquals($backupid, $otherdata->backupid);
// Check backup was stored in correct area.
$usercontextid = $DB->get_field('context', 'id', ['contextlevel' => CONTEXT_USER, 'instanceid' => $teacher->id]);
$this->assertEquals(1, $DB->count_records('files', ['contextid' => $usercontextid,
'component' => 'user', 'filearea' => 'backup', 'filename' => 'backup.mbz']));
// Case 2: Make a second backup with users and not anonymised.
$this->setAdminUser();
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE,
backup::INTERACTIVE_YES, backup::MODE_ASYNC, $USER->id);
$bc->get_plan()->get_setting('users')->set_status(\backup_setting::NOT_LOCKED);
$bc->get_plan()->get_setting('users')->set_value(true);
$bc->get_plan()->get_setting('anonymize')->set_value(false);
$bc->finish_ui();
$backupid = $bc->get_backupid();
$bc->destroy();
// Create the adhoc task.
$asynctask = new \core\task\asynchronous_backup_task();
$asynctask->set_blocking(false);
$asynctask->set_custom_data(['backupid' => $backupid]);
\core\task\manager::queue_adhoc_task($asynctask);
// Execute adhoc task.
$now = time();
$task = \core\task\manager::get_next_adhoc_task($now);
$task->execute();
\core\task\manager::adhoc_task_complete($task);
$postbackuprec = $DB->get_record('backup_controllers', ['backupid' => $backupid]);
// Check backup was created successfully.
$this->assertEquals(backup::STATUS_FINISHED_OK, $postbackuprec->status);
$this->assertEquals(1.0, $postbackuprec->progress);
$this->assertEquals($USER->id, $postbackuprec->userid);
// Check that the backupid was logged correctly.
$logrec = $DB->get_record('logstore_standard_log', ['userid' => $postbackuprec->userid,
'target' => 'course_backup'], '*', MUST_EXIST);
$otherdata = json_decode($logrec->other);
$this->assertEquals($backupid, $otherdata->backupid);
// Check backup was stored in correct area.
$coursecontextid = $DB->get_field('context', 'id', ['contextlevel' => CONTEXT_COURSE, 'instanceid' => $course->id]);
$this->assertEquals(1, $DB->count_records('files', ['contextid' => $coursecontextid,
'component' => 'backup', 'filearea' => 'course', 'filename' => 'backup.mbz']));
}
/**
+59 -16
View File
@@ -313,39 +313,82 @@ class async_helper {
* Get markup for in progress async backups,
* to use in backup table UI.
*
* @param \core_backup_renderer $renderer The backup renderer object.
* @param string $filearea The filearea to get backup data for.
* @param integer $instanceid The context id to get backup data for.
* @return array $tabledata the rows of table data.
*/
public static function get_async_backups($renderer, $instanceid) {
public static function get_async_backups($filearea, $instanceid) {
global $DB;
$tabledata = array();
$backups = [];
// Get relevant backup ids based on context instance id.
$select = 'itemid = :itemid AND execution = :execution AND status < :status1 AND status > :status2 ' .
$table = 'backup_controllers';
$select = 'execution = :execution AND status < :status1 AND status > :status2 ' .
'AND operation = :operation';
$params = [
'itemid' => $instanceid,
'execution' => backup::EXECUTION_DELAYED,
'status1' => backup::STATUS_FINISHED_ERR,
'status2' => backup::STATUS_NEED_PRECHECK,
'operation' => 'backup',
];
$sort = 'timecreated DESC';
$fields = 'id, backupid, status, timecreated';
$backups = $DB->get_records_select('backup_controllers', $select, $params, 'timecreated DESC', 'id, backupid, timecreated');
foreach ($backups as $backup) {
$bc = \backup_controller::load_controller($backup->backupid); // Get the backup controller.
$filename = $bc->get_plan()->get_setting('filename')->get_value();
$timecreated = $backup->timecreated;
$status = $renderer->get_status_display($bc->get_status(), $bc->get_backupid());
$bc->destroy();
if ($filearea == 'backup') {
// Get relevant backup ids based on user id.
$params['userid'] = $instanceid;
$select = 'userid = :userid AND ' . $select;
$records = $DB->get_records_select($table, $select, $params, $sort, $fields);
foreach ($records as $record) {
$bc = \backup_controller::load_controller($record->backupid);
$tablerow = array($filename, userdate($timecreated), '-', '-', '-', $status);
$tabledata[] = $tablerow;
// Get useful info to render async status in correct area.
list($hasusers, $isannon) = self::get_userdata_backup_settings($bc);
// Backup has users and is not anonymised -> don't show it in users backup file area.
if ($hasusers && !$isannon) {
continue;
}
$record->filename = $bc->get_plan()->get_setting('filename')->get_value();
$bc->destroy();
array_push($backups, $record);
}
} else {
if ($filearea == 'course' || $filearea == 'activity') {
// Get relevant backup ids based on context instance id.
$params['itemid'] = $instanceid;
$select = 'itemid = :itemid AND ' . $select;
$records = $DB->get_records_select($table, $select, $params, $sort, $fields);
foreach ($records as $record) {
$bc = \backup_controller::load_controller($record->backupid);
// Get useful info to render async status in correct area.
list($hasusers, $isannon) = self::get_userdata_backup_settings($bc);
// Backup has no user or is anonymised -> don't show it in course/activity backup file area.
if (!$hasusers || $isannon) {
continue;
}
$record->filename = $bc->get_plan()->get_setting('filename')->get_value();
$bc->destroy();
array_push($backups, $record);
}
}
}
return $tabledata;
return $backups;
}
/**
* Get the user data settings for backups.
*
* @param \backup_controller $backupcontroller The backup controller object.
* @return array Array of user data settings.
*/
public static function get_userdata_backup_settings(\backup_controller $backupcontroller): array {
$hasusers = (bool)$backupcontroller->get_plan()->get_setting('users')->get_value(); // Backup has users.
$isannon = (bool)$backupcontroller->get_plan()->get_setting('anonymize')->get_value(); // Backup is anonymised.
return [$hasusers, $isannon];
}
/**
+1 -1
View File
@@ -331,7 +331,7 @@ abstract class backup_helper {
// enabled are sent to user's "user_backup"
// file area. Maintenance of such area is responsibility of
// the user via corresponding file manager frontend
if ($backupmode == backup::MODE_GENERAL && (!$hasusers || $isannon)) {
if (($backupmode == backup::MODE_GENERAL || $backupmode == backup::MODE_ASYNC) && (!$hasusers || $isannon)) {
$ctxid = context_user::instance($userid)->id;
$component = 'user';
$filearea = 'backup';
@@ -140,12 +140,11 @@ class async_helper_test extends \advanced_testcase {
unset($bc);
$coursecontext = \context_course::instance($course->id);
$renderer = $PAGE->get_renderer('core', 'backup');
$result = \async_helper::get_async_backups($renderer, $coursecontext->instanceid);
$result = \async_helper::get_async_backups('course', $coursecontext->instanceid);
$this->assertEquals(1, count($result));
$this->assertEquals('backup.mbz', $result[0][0]);
$this->assertEquals('backup.mbz', $result[0]->filename);
}
/**
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -100,7 +100,8 @@ define(['jquery', 'core/ajax', 'core/str', 'core/notification', 'core/templates'
methodname: 'core_backup_get_async_backup_links_backup',
args: {
'filename': filename,
'contextid': contextid
'contextid': contextid,
'backupid': backupid
},
}])[0].done(function(response) {
// We have the data now update the UI.
+14 -9
View File
@@ -619,10 +619,10 @@ class core_backup_renderer extends plugin_renderer_base {
* @return string
*/
public function render_backup_files_viewer(backup_files_viewer $viewer) {
global $CFG;
$files = $viewer->files;
$async = async_helper::is_async_enabled();
$async = \async_helper::is_async_enabled();
$tablehead = array(
get_string('filename', 'backup'),
@@ -638,16 +638,21 @@ class core_backup_renderer extends plugin_renderer_base {
$table->attributes['class'] = 'backup-files-table generaltable';
$table->head = $tablehead;
$table->width = '100%';
$table->data = array();
$table->data = [];
// First add in progress asynchronous backups.
// Only if asynchronous backups are enabled.
// Also only render async status in correct area. Courese OR activity (not both).
if ($async
&& (($viewer->filearea == 'course' && $viewer->currentcontext->contextlevel == CONTEXT_COURSE)
|| ($viewer->filearea == 'activity' && $viewer->currentcontext->contextlevel == CONTEXT_MODULE))
) {
$table->data = \async_helper::get_async_backups($this, $viewer->currentcontext->instanceid);
if ($async) {
$tabledata = [];
$backups = \async_helper::get_async_backups($viewer->filearea, $viewer->filecontext->instanceid);
// For each backup get, new item name, time restore created and progress.
foreach ($backups as $backup) {
$status = $this->get_status_display($backup->status, $backup->backupid);
$timecreated = $backup->timecreated;
$tablerow = [$backup->filename, userdate($timecreated), '-', '-', '-', $status];
$tabledata[] = $tablerow;
}
$table->data = $tabledata;
}
// Add completed backups.
+1
View File
@@ -85,6 +85,7 @@ abstract class restore_search_base implements renderable {
public function __construct(array $config = array()) {
$this->search = optional_param($this->get_varsearch(), self::DEFAULT_SEARCH, PARAM_NOTAGS);
$this->search = trim($this->search);
$this->maxresults = get_config('backup', 'import_general_maxresults');
foreach ($config as $name => $value) {
@@ -20,13 +20,13 @@ Feature: Import course's contents into another course
Scenario: Import course's contents to another course
Given I log in as "teacher1"
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| data | Test database name | Test database description | C1 | database1 | 2 |
| forum | Test forum name | Test forum name description | C1 | forum1 | 1 |
And I am on "Course 1" course homepage with editing mode on
And I add the "Comments" block
And I add the "Recent blog entries" block
And I turn editing mode off
| activity | name | course | idnumber |
| data | Test database name | C1 | database1 |
| forum | Test forum name | C1 | forum1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
| blog_recent | Course | C1 | course-view-* | side-pre |
When I import "Course 1" course into "Course 2" course using this options:
Then I should see "Test database name"
And I should see "Test forum name"
@@ -12,16 +12,16 @@ Feature: Restore Moodle 2 course backups
| Course 3 | C3 | 0 | topics | 2 | 0 |
| Course 4 | C4 | 0 | topics | 20 | 0 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | section | externalurl |
| assign | C3 | assign1 | Test assign name | Assign description | 1 | |
| data | C3 | data1 | Test database name | Database description | 2 | |
| url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org |
| activity | course | idnumber | name | intro | section | externalurl |
| assign | C3 | assign1 | Test assign name | Assign description | 1 | |
| data | C3 | data1 | Test database name | Database description | 2 | |
| forum | C1 | 0001 | Test forum name | | 1 | |
| url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
And I add the "Activities" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_modules | Course | C1 | course-view-* | side-pre |
@javascript
Scenario: Restore a course in another existing course
@@ -63,10 +63,11 @@ Feature: Restore Moodle 2 course backups
Scenario: Restore a backup into the same course removing it's contents before that
When I backup "Course 1" course using this options:
| Confirmation | Filename | test_backup.mbz |
And I am on "Course 1" course homepage
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum post backup name |
| Description | Test forum post backup description |
And the following "activity" exists:
| activity | forum |
| course | C1 |
| section | 1 |
| name | Test forum post backup name |
And I am on the "Course 1" "restore" page
And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options:
| Schema | Section 3 | 0 |
+1 -1
View File
@@ -50,7 +50,7 @@ if (!is_null($storedsecret)) {
// Make sure we have all the required information before trying to save the connection.
$backpackuid = $bp->authenticate();
if (empty($backpackuid) || !empty($backpackuid->error)) {
redirect(new moodle_url($redirect), get_string('backpackconnectionunexpectedresult', 'badges'),
redirect(new moodle_url($redirect), get_string('backpackconnectionunexpectedresult', 'badges', $backpackuid->error),
null, \core\output\notification::NOTIFY_ERROR);
}
+28 -19
View File
@@ -125,29 +125,38 @@ class backpack extends external_backpack {
* Validates form data
*/
public function validation($data, $files) {
global $CFG;
$errors = parent::validation($data, $files);
if (badges_open_badges_backpack_api() == OPEN_BADGES_V2P1) {
return [];
}
// We don't need to verify the email address if we're clearing a pending email verification attempt.
if (isset($data['revertbutton'])) {
return [];
}
$errors = [];
// Email and password can't be blank.
if (empty($data['backpackemail'])) {
$errors['backpackemail'] = get_string('backpackemail_required', 'badges');
}
if (empty($data['password'])) {
$errors['password'] = get_string('password_required', 'badges');
}
if (!empty($errors)) {
return $errors;
}
// We don't need to verify the email address if we're clearing a pending email verification attempt.
if (!isset($data['revertbutton'])) {
$check = new stdClass();
$check->email = $data['backpackemail'];
$check->password = $data['password'];
$sitebackpack = badges_get_site_backpack($data['externalbackpackid']);
$bp = new \core_badges\backpack_api($sitebackpack, $check);
$result = $bp->authenticate();
if ($result === false || !empty($result->error)) {
$errors['backpackemail'] = get_string('backpackconnectionunexpectedresult', 'badges');
$msg = $bp->get_authentication_error();
if (!empty($msg)) {
$errors['backpackemail'] .= '<br/><br/>';
$errors['backpackemail'] .= get_string('backpackconnectionunexpectedmessage', 'badges', $msg);
}
}
// Check the given credentials (email and password) are valid for this backpack.
$check = new stdClass();
$check->email = $data['backpackemail'];
$check->password = $data['password'];
$sitebackpack = badges_get_site_backpack($data['externalbackpackid']);
$bp = new \core_badges\backpack_api($sitebackpack, $check);
$result = $bp->authenticate();
if ($result === false || !empty($result->error)) {
$msg = $bp->get_authentication_error();
$errors['backpackemail'] = get_string('backpackconnectionunexpectedresult', 'badges', $msg);
}
return $errors;
}
+36 -12
View File
@@ -236,6 +236,7 @@ class award_criteria_activity extends award_criteria {
* @return array list($join, $where, $params)
*/
public function get_completed_criteria_sql() {
global $DB;
$join = '';
$where = '';
$params = array();
@@ -257,18 +258,41 @@ class award_criteria_activity extends award_criteria {
}
return array($join, $where, $params);
} else {
foreach ($this->params as $param) {
$join .= " LEFT JOIN {course_modules_completion} cmc{$param['module']} ON
cmc{$param['module']}.userid = u.id AND
cmc{$param['module']}.coursemoduleid = :completedmodule{$param['module']} AND
( cmc{$param['module']}.completionstate = :completionpass{$param['module']} OR
cmc{$param['module']}.completionstate = :completionfail{$param['module']} OR
cmc{$param['module']}.completionstate = :completioncomplete{$param['module']} )";
$where .= " AND cmc{$param['module']}.coursemoduleid IS NOT NULL ";
$params["completedmodule{$param['module']}"] = $param['module'];
$params["completionpass{$param['module']}"] = COMPLETION_COMPLETE_PASS;
$params["completionfail{$param['module']}"] = COMPLETION_COMPLETE_FAIL;
$params["completioncomplete{$param['module']}"] = COMPLETION_COMPLETE;
// Get all cmids of modules related to the criteria.
$cmids = array_map(fn ($x) => $x['module'], $this->params);
list($cmcmodulessql, $paramscmc) = $DB->get_in_or_equal($cmids, SQL_PARAMS_NAMED);
// Create a sql query to get all users who have worked on these course modules.
$sql = "SELECT DISTINCT userid FROM {course_modules_completion} cmc "
. "WHERE coursemoduleid " . $cmcmodulessql . " AND "
. "( cmc.completionstate IN ( :completionpass, :completionfail, :completioncomplete ) )";
$paramscmcs = [
'completionpass' => COMPLETION_COMPLETE_PASS,
'completionfail' => COMPLETION_COMPLETE_FAIL,
'completioncomplete' => COMPLETION_COMPLETE
];
$paramscmc = array_merge($paramscmc, $paramscmcs);
$userids = $DB->get_records_sql($sql, $paramscmc);
// Now check each user if the user has a completion of each module.
$useridsbadgeable = array_keys(array_filter(
$userids,
function ($user) use ($cmcmodulessql, $paramscmc, $cmids) {
global $DB;
$params = array_merge($paramscmc, ['userid' => $user->userid]);
$select = "coursemoduleid " . $cmcmodulessql . " AND userid = :userid";
$cmidsuser = $DB->get_fieldset_select('course_modules_completion', 'coursemoduleid', $select, $params);
return empty(array_diff($cmidsuser, $cmids));
}
));
// Finally create a where statement (if neccessary) with all userids who are allowed to get the badge.
// This list also includes all users who have previously received the badge. These are filtered out in the badge.php.
$join = "";
$where = "";
if (!empty($useridsbadgeable)) {
list($wherepart, $params) = $DB->get_in_or_equal($useridsbadgeable, SQL_PARAMS_NAMED);
$where = " AND u.id " . $wherepart;
}
return array($join, $where, $params);
}
+1
View File
@@ -139,6 +139,7 @@ if ($backpack) {
badges_disconnect_user_backpack($USER->id);
redirect(new moodle_url('/badges/mybackpack.php'));
} else if (isset($data->backpackemail)) {
// There are no errors, so the verification email can be sent.
if (badges_send_verification_email($data->backpackemail, $data->externalbackpackid, $data->password)) {
$a = get_user_preferences('badges_email_verify_backpackid');
redirect(new moodle_url('/badges/mybackpack.php'),
+79
View File
@@ -31,6 +31,7 @@ require_once($CFG->libdir . '/badgeslib.php');
require_once($CFG->dirroot . '/badges/lib.php');
use core_badges\helper;
use core\task\manager;
class badgeslib_test extends advanced_testcase {
protected $badgeid;
@@ -511,6 +512,84 @@ class badgeslib_test extends advanced_testcase {
$this->assertEquals(badge_message_from_template($message, $params), $result);
}
/**
* Test for working around the 61 tables join limit of mysql in award_criteria_activity in combination with the scheduled task.
*
* @covers \core_badges\badge::review_all_criteria
*/
public function test_badge_activity_criteria_with_a_huge_number_of_coursemodules() {
global $CFG;
require_once($CFG->dirroot.'/completion/criteria/completion_criteria_activity.php');
if (!PHPUNIT_LONGTEST) {
$this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
}
// Messaging is not compatible with transactions.
$this->preventResetByRollback();
// Create more than 61 modules to potentially trigger an mysql db error.
$assigncount = 75;
$assigns = [];
for ($i = 1; $i <= $assigncount; $i++) {
$assigns[] = $this->getDataGenerator()->create_module('assign', ['course' => $this->course->id], ['completion' => 1]);
}
$assigncmids = array_flip(array_map(fn ($assign) => $assign->cmid, $assigns));
$criteriaactivityarray = array_fill_keys(array_keys($assigncmids), 1);
// Set completion criteria.
$criteriadata = (object) [
'id' => $this->course->id,
'criteria_activity' => $criteriaactivityarray,
];
$criterion = new completion_criteria_activity();
$criterion->update_config($criteriadata);
$badge = new badge($this->coursebadge);
$criteriaoverall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_OVERALL, 'badgeid' => $badge->id));
$criteriaoverall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY));
$criteriaactivity = award_criteria::build(['criteriatype' => BADGE_CRITERIA_TYPE_ACTIVITY, 'badgeid' => $badge->id]);
$modulescrit = ['agg' => BADGE_CRITERIA_AGGREGATION_ALL];
foreach ($assigns as $assign) {
$modulescrit['module_' . $assign->cmid] = $assign->cmid;
}
$criteriaactivity->save($modulescrit);
// Take one assign to complete it later.
$assigntemp = array_shift($assigns);
// Mark the user to complete the modules.
foreach ($assigns as $assign) {
$cmassign = get_coursemodule_from_id('assign', $assign->cmid);
$completion = new \completion_info($this->course);
$completion->update_state($cmassign, COMPLETION_COMPLETE, $this->user->id);
}
// Run the scheduled task to issue the badge. But the badge should not be issued.
ob_start();
$task = manager::get_scheduled_task('core\task\badges_cron_task');
$task->execute();
ob_end_clean();
$this->assertFalse($badge->is_issued($this->user->id));
// Now complete the last uncompleted module.
$cmassign = get_coursemodule_from_id('assign', $assigntemp->cmid);
$completion = new \completion_info($this->course);
$completion->update_state($cmassign, COMPLETION_COMPLETE, $this->user->id);
// Run the scheduled task to issue the badge. Now the badge schould be issued.
ob_start();
$task = manager::get_scheduled_task('core\task\badges_cron_task');
$task->execute();
ob_end_clean();
$this->assertDebuggingCalled('Error baking badge image!');
$this->assertTrue($badge->is_issued($this->user->id));
}
/**
* Test badges observer when course module completion event id fired.
*/
+15
View File
@@ -181,3 +181,18 @@ Feature: Backpack badges
And I set the field "externalbackpackid" to "https://test.com/"
And I should see "Email address"
And I should see "Password"
@javascript
Scenario: Check backpack form validation as a student
Given I log in as "student1"
And I follow "Preferences" in the user menu
And I follow "Backpack settings"
And I set the field "externalbackpackid" to "https://test.com/"
And I set the field "password" to ""
When I click on "Connect to backpack" "button"
Then I should see "Password can't be blank"
And I should not see "Email address can't be blank"
And I set the field "backpackemail" to ""
And I click on "Connect to backpack" "button"
And I should see "Email address can't be blank"
And I should see "Password can't be blank"
@@ -21,8 +21,10 @@ Feature: The activity results block doesn't display student scores for unsupport
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber | assignsubmission_file_enabled |
| assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_results | Course | C1 | course-view-* | side-pre |
And I am on "Course 1" course homepage
And I add the "Activity results" block
And I configure the "Activity results" block
And I set the following fields to these values:
| config_showbest | 1 |
@@ -30,8 +32,7 @@ Feature: The activity results block doesn't display student scores for unsupport
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
And I press "Save changes"
When I follow "Test assignment"
And I navigate to "Settings" in current page administration
When I am on the "Test assignment" "assign activity editing" page
And I set the following fields to these values:
| id_grade_modgrade_type | None |
And I press "Save and return to course"
@@ -21,8 +21,6 @@ Feature: The activity results block can have administrator set defaults
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| intro | Offline text |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
@@ -50,8 +48,10 @@ Feature: The activity results block can have administrator set defaults
| config_showbest_locked | 1 | block_activity_results |
| config_showworst | 0 | block_activity_results |
| config_showworst_locked | 1 | block_activity_results |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_results | Course | C1 | course-view-* | side-pre |
And I am on "Course 1" course homepage
And I add the "Activity results" block
When I configure the "Activity results" block
And the following fields match these values:
| config_showbest | 0 |
@@ -14,13 +14,10 @@ Feature: Enable Block Badges on the frontpage and view awarded badges
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Latest badges" block
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| badges | System | 1 | site-index | side-pre |
And I am on the "Course 1" course page logged in as teacher1
# Issue badge 1 of 2
And I navigate to "Badges > Add a new badge" in current page administration
And I set the following fields to these values:
@@ -37,7 +34,5 @@ Feature: Enable Block Badges on the frontpage and view awarded badges
And I press "Award badge"
And I set the field "potentialrecipients[]" to "Teacher 1 (teacher1@example.com)"
And I press "Award badge"
And I log out
When I log in as "teacher1"
And I am on site homepage
When I am on site homepage
Then I should see "Badge 1" in the "Latest badges" "block"
@@ -26,16 +26,12 @@ Feature: Enable Block blog menu in an activity
| idnumber | 0001 |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment 1"
And I add the "Blog menu" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Activity module | 0001 | mod-assign-view | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add a new entry"
When I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -43,16 +39,13 @@ Feature: Enable Block blog menu in an activity
And I press "Save changes"
Then I should see "S1 First Blog"
And I should see "This is my awesome blog!"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Blog entries"
And I should see "S1 First Blog"
And I should see "This is my awesome blog!"
Scenario: Students use the blog menu block to view their blogs about the activity
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -61,10 +54,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -73,8 +63,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
@@ -83,17 +72,14 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
When I follow "View my entries about this Assignment"
Then I should see "S2 First Blog"
And I should not see "S2 Second Blog"
And I should not see "S1 First Blog"
Scenario: Students use the blog menu block to view all blogs about the assignment
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -102,10 +88,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -114,8 +97,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
@@ -124,17 +106,14 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
When I follow "View all entries about this Assignment"
Then I should see "S1 First Blog"
And I should see "S2 First Blog"
And I should not see "S2 Second Blog"
Scenario: Students use the blog menu block to view all their blog entries
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -143,10 +122,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -155,8 +131,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
@@ -165,17 +140,14 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
When I follow "Blog entries"
Then I should see "S2 First Blog"
And I should see "S2 Second Blog"
And I should not see "S1 First Blog"
Scenario: Teacher searches for student blogs
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -184,10 +156,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -196,8 +165,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
@@ -206,10 +174,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
When I am on the "Test assignment 1" "assign activity" page logged in as teacher1
And I set the field "Search" to "First"
And I press "Search"
Then I should see "S1 First Blog"
@@ -18,14 +18,12 @@ Feature: Students can use block blog menu in a course
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Blog menu" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Course | C1 | course-view-* | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add a new entry"
When I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -39,8 +37,7 @@ Feature: Students can use block blog menu in a course
And I should see "This is my awesome blog!"
Scenario: Students use the blog menu block to view their blogs about the course
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -49,9 +46,7 @@ Feature: Students can use block blog menu in a course
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -76,8 +71,7 @@ Feature: Students can use block blog menu in a course
And I should not see "S1 First Blog"
Scenario: Students use the blog menu block to view all blogs about the course
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -86,9 +80,7 @@ Feature: Students can use block blog menu in a course
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -113,8 +105,7 @@ Feature: Students can use block blog menu in a course
And I should not see "S2 Second Blog"
Scenario: Students use the blog menu block to view all their blog entries
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -123,9 +114,7 @@ Feature: Students can use block blog menu in a course
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -150,8 +139,7 @@ Feature: Students can use block blog menu in a course
And I should not see "S1 First Blog"
Scenario: Teacher searches for student blogs
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -160,9 +148,7 @@ Feature: Students can use block blog menu in a course
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -180,9 +166,7 @@ Feature: Students can use block blog menu in a course
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Course: C1"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as teacher1
And I set the field "Search" to "First"
And I press "Search"
Then I should see "S1 First Blog"
@@ -8,11 +8,9 @@ Feature: Enable Block blog menu on the frontpage
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | student1@example.com | S1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Blog menu" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | System | 1 | site-index | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"
@@ -26,17 +26,13 @@ Feature: Students can use the recent blog entries block to view recent entries o
| intro | Offline text |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment 1"
And I add the "Blog menu" block
And I add the "Recent blog entries" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Activity module | 0001 | mod-assign-view | side-pre |
| blog_recent | Activity module | 0001 | mod-assign-view | side-pre |
Scenario: Students use the recent blog entries block to view blogs
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
When I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -50,9 +46,7 @@ Feature: Students can use the recent blog entries block to view recent entries o
And I should see "This is my awesome blog!"
Scenario: Students only see a few entries in the recent blog entries block
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
# Blog 1 of 5
And I set the following fields to these values:
@@ -16,17 +16,15 @@ Feature: Students can use the recent blog entries block to view recent entries o
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Course | C1 | course-view-* | side-pre |
| blog_recent | Course | C1 | course-view-* | side-pre |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Blog menu" block
And I add the "Recent blog entries" block
And I log out
Scenario: Students use the recent blog entries block to view blogs
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
When I set the following fields to these values:
| Entry title | S1 First Blog <span lang="RU" class="multilang">RUSSIAN</span><span lang="EN" class="multilang">ENGLISH</span> |
@@ -40,8 +38,7 @@ Feature: Students can use the recent blog entries block to view recent entries o
And I should see "This is my awesome blog!"
Scenario: Students only see a few entries in the recent blog entries block
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
# Blog 1 of 5
And I set the following fields to these values:
@@ -8,12 +8,14 @@ Feature: Feature: Students can use the recent blog entries block to view recent
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | student1@example.com | S1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_recent | System | 1 | site-index | side-pre |
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Recent blog entries" block
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I log out
@@ -52,9 +52,10 @@ Feature: Enable the calendar block in a course and test it's functionality
@javascript
Scenario: View a user event in the calendar block
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Calendar" block
Given the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_month | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I create a calendar event with form data:
| id_eventtype | User |
| id_name | User Event |
@@ -72,9 +73,7 @@ Feature: Enable the calendar block in a course and test it's functionality
| user | group |
| student1 | G1 |
| student2 | G2 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
When I am on the "Course 1" "course editing" page logged in as teacher1
And I set the following fields to these values:
| id_groupmode | Separate groups |
| id_groupmodeforce | Yes |
@@ -87,12 +86,8 @@ Feature: Enable the calendar block in a course and test it's functionality
| Type of event | group |
| Group | Group 1 |
| Event title | Group Event |
And I log out
Then I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I hover over today in the mini-calendar block
And I should see "Group Event"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
Then I should see "Group Event"
And I am on the "Course 1" course page logged in as student2
And I should not see "Group Event"
@@ -9,10 +9,10 @@ Feature: Enable the calendar block on the site front page
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | student1@example.com | S1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_month | System | 1 | site-index | side-pre |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Calendar" block
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | Site Event |
@@ -8,6 +8,9 @@ Feature: View a site event on the frontpage
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_upcoming | System | 1 | site-index | side-pre |
@javascript
Scenario: View a site event in the upcoming events block on the frontpage
@@ -15,9 +18,6 @@ Feature: View a site event on the frontpage
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | My Site Event |
And I am on site homepage
And I turn editing mode on
And I add the "Upcoming events" block
And I log out
When I log in as "teacher1"
And I am on site homepage
@@ -16,12 +16,10 @@ Feature: Add a comment to the comments block
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Comments" block
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" course page logged in as student1
@javascript
Scenario: Add a comment with Javascript enabled
@@ -19,15 +19,12 @@ Feature: Enable Block comments on an activity page and view comments
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| page | C1 | page1 | Test page name | Test page description |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name"
And I add the "Comments" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Activity module | page1 | mod-page-* | side-pre |
And I am on the "Test page name" "page activity" page logged in as teacher1
And I follow "Show comments"
And I add "I'm a comment from the teacher" comment to comments block
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test page name"
When I am on the "Test page name" "page activity" page logged in as student1
And I follow "Show comments"
Then I should see "I'm a comment from the teacher"
@@ -16,13 +16,12 @@ Feature: Enable Block comments on a course page and view comments
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Comments" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" course page logged in as teacher1
And I follow "Show comments"
And I add "I'm a comment from the teacher" comment to comments block
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
And I follow "Show comments"
Then I should see "I'm a comment from the teacher"
@@ -8,10 +8,11 @@ Feature: Enable Block comments on the frontpage and view comments
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | System | 1 | site-index | side-pre |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Comments" block
And I follow "Show comments"
And I add "I'm a comment from admin" comment to comments block
And I log out
@@ -17,16 +17,12 @@ Feature: Delete comment block messages
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Comments" block
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" course page logged in as student1
And I add "Comment from student1" comment to comments block
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
And I add "Comment from teacher1" comment to comments block
When I delete "Comment from student1" comment from comments block
Then I should not see "Comment from student1"
@@ -18,24 +18,21 @@ Feature: Enable Block Completion in a course using manual completion by others
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | teacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| completionstatus | Course | C1 | course-view-* | side-pre |
Scenario: Add the block to a the course and mark a student complete.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Course completion status" block
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Teacher | 1 |
And I press "Save changes"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
And I should see "Status: Not yet started" in the "Course completion status" "block"
And I should see "No" in the "Teacher" "table_row"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Course completion" "link" in the "region-main" "region"
And I follow "Click to mark user complete"
@@ -44,18 +41,14 @@ Feature: Enable Block Completion in a course using manual completion by others
And I wait "1" seconds
And I run the scheduled task "core\task\completion_regular_task"
And I am on site homepage
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
Then I should see "Status: Complete" in the "Course completion status" "block"
And I should see "Yes" in the "Teacher" "table_row"
And I follow "More details"
And I should see "Yes" in the "Marked complete by Teacher" "table_row"
Scenario: Add the block to a the course and require multiple roles to mark a student complete.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Course completion status" block
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
@@ -63,30 +56,22 @@ Feature: Enable Block Completion in a course using manual completion by others
| Non-editing teacher | 1 |
| id_role_aggregation | ALL selected roles to mark when the condition is met |
And I press "Save changes"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
And I should see "Status: Not yet started" in the "Course completion status" "block"
And I should see "No" in the "Teacher" "table_row"
And I should see "No" in the "Non-editing teacher" "table_row"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Course completion" "link" in the "region-main" "region"
And I follow "Click to mark user complete"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I should see "Status: In progress" in the "Course completion status" "block"
And I should see "Yes" in the "Teacher" "table_row"
And I should see "No" in the "Non-editing teacher" "table_row"
And I follow "More details"
And I should see "Yes" in the "Marked complete by Teacher" "table_row"
And I should see "No" in the "Marked complete by Non-editing teacher" "table_row"
And I log out
And I log in as "teacher2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher2
And I navigate to "Reports" in current page administration
And I click on "Course completion" "link" in the "region-main" "region"
And I follow "Click to mark user complete"
@@ -95,9 +80,7 @@ Feature: Enable Block Completion in a course using manual completion by others
And I wait "1" seconds
And I run the scheduled task "core\task\completion_regular_task"
And I am on site homepage
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
Then I should see "Status: Complete" in the "Course completion status" "block"
And I should see "Yes" in the "Teacher" "table_row"
And I should see "Yes" in the "Non-editing teacher" "table_row"
@@ -17,18 +17,17 @@ Feature: Enable Block Completion in a course using manual self completion
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I enable "selfcompletion" "block" plugin
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Course completion status" block
And I add the "Self completion" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| completionstatus | Course | C1 | course-view-* | side-pre |
| selfcompletion | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| id_criteria_self | 1 |
And I press "Save changes"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
And I should see "Status: Not yet started" in the "Course completion status" "block"
And I should see "No" in the "Self completion" "table_row"
And I follow "Complete course"
@@ -17,21 +17,18 @@ Feature: Course summary block used in a course
| student1 | C101 | student |
| teacher1 | C101 | editingteacher |
And I enable "course_summary" "block" plugin
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Course/site summary" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| course_summary | Course | C101 | course-view-* | side-pre |
Scenario: Student can view course summary
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
Then "Course summary" "block" should exist
And I should see "Course summary" in the "Course summary" "block"
And I should see "Proved the course summary block works!" in the "Course summary" "block"
Scenario: Teacher can not see edit icon when edit mode is off
When I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as teacher1
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
And I should see "Course summary" in the "Course summary" "block"
And "Edit" "link" should not exist in the "Course summary" "block"
@@ -7,9 +7,10 @@ Feature: Course summary block used on the frontpage
Background:
Given I log in as "admin"
And I enable "course_summary" "block" plugin
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| course_summary | System | 1 | site-index | side-pre |
And I am on site homepage
And I turn editing mode on
And I add the "Course/site summary" block
And I navigate to "Site home > Site home settings" in site administration
And I set the following fields to these values:
| summary | Proved the summary block works! |
+4 -7
View File
@@ -8,19 +8,16 @@ Feature: Login from a block
Given the following "users" exist:
| username | password | firstname | lastname | email |
| testuser | testpass | Test | User | student1@example.com |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Login" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| login | System | 1 | site-index | side-pre |
Scenario: Login block visible to non-logged in users
Given I log out
When I am on homepage
Then "Login" "block" should exist
Scenario: Login as student through login block
Given I log out
And I am on homepage
Given I am on homepage
When I set the field "Username" to "testuser"
And I set the field "Password" to "testpass"
And I click on "Log in" "button" in the "Login" "block"
@@ -8,9 +8,9 @@ Feature: Add the network servers block when main feature is disabled
Given I log in as "admin"
And I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Enable" "icon" in the "MNet authentication" "table_row"
And I am on site homepage
And I turn editing mode on
And I add the "Network servers" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| mnet_hosts | System | 1 | site-index | side-pre |
When I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Disable" "icon" in the "MNet authentication" "table_row"
And I am on site homepage
@@ -21,10 +21,11 @@ Feature: Add the network servers block when main feature is disabled
Given I log in as "admin"
And I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Enable" "icon" in the "MNet authentication" "table_row"
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| mnet_hosts | System | 1 | site-index | side-pre |
And I am on site homepage
And I turn editing mode on
And I add the "Network servers" block
And I turn editing mode on
And I open the "Network servers" blocks action menu
And I click on "Delete Network servers block" "link" in the "Network servers" "block"
And "Delete block?" "dialogue" should exist
@@ -59,13 +59,14 @@ Feature: The my overview block allows users to hide their courses
And I click on "Removed from view" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Restore to view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
And I should not see "Course 2" in the "Course overview" "block"
And I click on "Removed from view" "button" in the "Course overview" "block"
When I click on "All" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Course 2" in the "Course overview" "block"
Scenario: Test show toggle functionality w/ favorites
Scenario: Test star and unstar functionality
Given I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
And I click on "All" "link" in the "Course overview" "block"
@@ -17,8 +17,8 @@ Feature: The logged in user block allows users to view their profile information
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| page | C1 | page1 | Test page name | Test page description |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name"
When I add the "Logged in user" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| myprofile | Activity module | page1 | mod-page-* | side-pre |
When I am on the "Test page name" "page activity" page logged in as teacher1
Then I should see "Teacher One" in the "Logged in user" "block"
@@ -8,11 +8,9 @@ Feature: The logged in user block allows users to view their profile information
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | One | teacher1@example.com | T1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Logged in user" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| myprofile | System | 1 | site-index | side-pre |
Scenario: Try to view the logged in user block as a guest
Given I log in as "guest"
@@ -39,29 +39,23 @@ Feature: Displaying the link to the Participants page
@javascript
Scenario: Course participants link is displayed to users depending on role permissions settings
And I log in as "admin"
And I am on "Course1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
And I am on the "Course1" "enrolment methods" page
Given the following "activities" exist:
| activity | course | name |
| forum | C1 | Test forum name |
And I am on the "Course1" "enrolment methods" page logged in as admin
And I click on "Edit" "link" in the "Guest access" "table_row"
And I set the following fields to these values:
| Allow guest access | Yes |
And I press "Save changes"
And I log out
When I log in as "guest"
And I am on "Course1" course homepage
When I am on the "Course1" course page logged in as guest
Then I should not see "Participants" in the "Navigation" "block"
And I am on the "Test forum name" "forum activity" page
And I should not see "Participants" in the "Navigation" "block"
And I log out
And I log in as "admin"
And I set the following system permissions of "Guest" role:
| capability | permission |
| moodle/course:viewparticipants | Allow |
And I log in as "guest"
And I am on "Course1" course homepage
And the following "role capability" exists:
| role | guest |
| moodle/course:viewparticipants | allow |
And I am on the "Course1" course page logged in as guest
And I should see "Participants" in the "Navigation" "block"
And I am on the "Test forum name" "forum activity" page
And I should see "Participants" in the "Navigation" "block"
@@ -9,17 +9,16 @@ Feature: Latest announcements block displays the course latest news
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And I log in as "admin"
And I create a course with:
| Course full name | Course 1 |
| Course short name | C1 |
| Number of announcements | 5 |
And I enrol "Teacher 1" user as "Teacher"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Latest announcements" block
And I turn editing mode off
And the following "courses" exist:
| fullname | shortname | category | newsitems |
| Course 1 | C1 | 0 | 5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| news_items | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" Course page logged in as teacher1
When I add a new topic to "Announcements" forum with:
| Subject | Discussion One |
| Message | Not important |
@@ -17,10 +17,10 @@ Feature: The private files block allows users to store files privately in moodle
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| page | C1 | page1 | Test page name | Test page description |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I am on the "Test page name" "page activity" page
And I add the "Private files" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | Activity module | page1 | mod-page-* | side-pre |
And I am on the "Test page name" "page activity" page logged in as teacher1
And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..."
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
@@ -14,9 +14,11 @@ Feature: The private files block allows users to store files privately in moodle
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Private files" block
And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..."
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
@@ -11,11 +11,9 @@ Feature: The private files block allows users to store files privately in moodle
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Private files" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | site-index | side-pre |
Scenario: Try to view the private files block as a guest
Given I log in as "guest"
@@ -47,38 +47,33 @@ Feature: View structural changes in recent activity block
Scenario: Check that Added module information is displayed respecting view capability
Given the following "activities" exist:
| activity | course | section | name | idnumber | description | groupmode | grouping | visible |
| forum | C1 | 1 | ForumVisibleGroups | forum1 | No description | 2 | | 1 |
| forum | C1 | 1 | ForumSeparateGroups | forum2 | No description | 1 | | 1 |
| forum | C1 | 1 | ForumHidden | forum3 | No description | 1 | | 0 |
| forum | C1 | 1 | ForumNoGroups | forum4 | No description | 0 | | 1 |
| forum | C1 | 2 | ForumVisibleGroupsG1 | forum5 | No description | 2 | GG1 | 1 |
| forum | C1 | 2 | ForumSeparateGroupsG1 | forum6 | No description | 1 | GG1 | 1 |
| forum | C1 | 3 | ForumVisibleGroupsG2 | forum7 | No description | 2 | GG2 | 1 |
| forum | C1 | 3 | ForumSeparateGroupsG2 | forum8 | No description | 1 | GG2 | 1 |
And I log in as "teacher1"
| activity | course | name | idnumber | groupmode | grouping | visible |
| forum | C1 | ForumVisibleGroups | forum1 | 2 | | 1 |
| forum | C1 | ForumSeparateGroups | forum2 | 1 | | 1 |
| forum | C1 | ForumHidden | forum3 | 1 | | 0 |
| forum | C1 | ForumNoGroups | forum4 | 0 | | 1 |
| forum | C1 | ForumVisibleGroupsG1 | forum5 | 2 | GG1 | 1 |
| forum | C1 | ForumSeparateGroupsG1 | forum6 | 1 | GG1 | 1 |
| forum | C1 | ForumVisibleGroupsG2 | forum7 | 2 | GG2 | 1 |
| forum | C1 | ForumSeparateGroupsG2 | forum8 | 1 | GG2 | 1 |
And I am on "Course 1" course homepage
And I click on "ForumVisibleGroupsG1" "link"
And I click on "Settings" "link"
And I am on the "ForumVisibleGroupsG1" "forum activity editing" page logged in as teacher1
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 1 |
And I press "Save and return to course"
And I click on "ForumSeparateGroupsG1" "link"
And I click on "Settings" "link"
And I am on the "ForumSeparateGroupsG1" "forum activity editing" page
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 1 |
And I press "Save and return to course"
And I click on "ForumVisibleGroupsG2" "link"
And I click on "Settings" "link"
And I am on the "ForumVisibleGroupsG2" "forum activity editing" page
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 2 |
And I press "Save and return to course"
And I click on "ForumSeparateGroupsG2" "link"
And I click on "Settings" "link"
And I am on the "ForumSeparateGroupsG2" "forum activity editing" page
And I set the following fields to these values:
| Access restrictions | Grouping: Grouping 2 |
And I press "Save and return to course"
@@ -94,10 +89,8 @@ Feature: View structural changes in recent activity block
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
And I should see "ForumNoGroups" in the "Recent activity" "block"
@@ -106,10 +99,8 @@ Feature: View structural changes in recent activity block
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
And I should not see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should not see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
And I should see "ForumNoGroups" in the "Recent activity" "block"
@@ -118,10 +109,8 @@ Feature: View structural changes in recent activity block
And I should not see "ForumSeparateGroupsG1" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I log out
And I log in as "student3"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student3
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
And I should see "ForumNoGroups" in the "Recent activity" "block"
@@ -130,17 +119,14 @@ Feature: View structural changes in recent activity block
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I log out
# Teachers have capability to see all groups and hidden activities
And I log in as "assistant1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as assistant1
And I should see "ForumHidden" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
And I log out
Scenario: Updates and deletes in recent activity block
Given the following "activity" exists:
@@ -148,7 +134,6 @@ Feature: View structural changes in recent activity block
| course | C1 |
| idnumber | forum1 |
| name | ForumNew |
| description | No description |
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
@@ -158,8 +143,7 @@ Feature: View structural changes in recent activity block
# Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.
And I wait "1" seconds
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I should see "Added Forum" in the "Recent activity" "block"
And I should see "ForumNew" in the "Recent activity" "block"
And I log out
@@ -167,10 +151,7 @@ Feature: View structural changes in recent activity block
And I wait "1" seconds
# Update forum as a teacher
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "ForumNew"
And I navigate to "Settings" in current page administration
And I am on the "ForumNew" "forum activity editing" page logged in as teacher1
And I set the following fields to these values:
| name | ForumUpdated |
And I press "Save and return to course"
@@ -178,8 +159,7 @@ Feature: View structural changes in recent activity block
And I wait "1" seconds
# Student 1 already saw that forum was created, now he can see that forum was updated
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I should not see "Added Forum" in the "Recent activity" "block"
And I should not see "ForumNew" in the "Recent activity" "block"
And I should see "Updated Forum" in the "Recent activity" "block"
@@ -188,8 +168,7 @@ Feature: View structural changes in recent activity block
And I wait "1" seconds
# Student 2 has bigger interval and he can see one entry that forum was created but with the new name
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I should see "Added Forum" in the "Recent activity" "block"
And I should not see "ForumNew" in the "Recent activity" "block"
And I should not see "Updated Forum" in the "Recent activity" "block"
@@ -206,8 +185,7 @@ Feature: View structural changes in recent activity block
And I wait "1" seconds
# Students 1 and 2 see that forum was deleted
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I should not see "Added Forum" in the "Recent activity" "block"
And I should not see "ForumNew" in the "Recent activity" "block"
And I should not see "Updated Forum" in the "Recent activity" "block"
@@ -217,8 +195,7 @@ Feature: View structural changes in recent activity block
And I wait "1" seconds
# Student 3 never knew that forum was created, so he does not see anything
And I log in as "student3"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student3
And I should not see "Added Forum" in the "Recent activity" "block"
And I should not see "ForumNew" in the "Recent activity" "block"
And I should not see "Updated Forum" in the "Recent activity" "block"
@@ -16,27 +16,22 @@ Feature: The search forums block allows users to search for forum posts on cours
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| news_items | Course | C1 | course-view-* | side-pre |
| search_forums | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" "course editing" page logged in as teacher1
And I set the field "id_newsitems" to "1"
And I press "Save and display"
And I turn editing mode on
And I add the "Latest announcements" block
And I add the "Search forums" block
And I log out
Scenario: Use the search forum block in a course without any forum posts
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
When I set the field "Search" to "Moodle"
And I press "Search"
Then I should see "No posts"
Scenario: Use the search forum block in a course with a hidden forum and search for posts
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I add a new topic to "Announcements" forum with:
Given I add a new topic to "Announcements" forum with:
| Subject | My subject |
| Message | My message |
And I am on "Course 1" course homepage with editing mode on
@@ -45,24 +40,18 @@ Feature: The search forums block allows users to search for forum posts on cours
And I expand all fieldsets
And I set the field "id_visible" to "0"
And I press "Save and return to course"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
And "Search forums" "block" should exist
When I set the field "Search" to "message"
And I set the field "Search" to "message"
And I press "Search"
Then I should see "No posts"
Scenario: Use the search forum block in a course and search for posts
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I add a new topic to "Announcements" forum with:
Given I add a new topic to "Announcements" forum with:
| Subject | My subject |
| Message | My message |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
And "Search forums" "block" should exist
When I set the field "Search" to "message"
And I set the field "Search" to "message"
And I press "Search"
Then I should see "My subject"
@@ -8,11 +8,9 @@ Feature: The search forums block allows users to search for forum posts on front
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | student1@example.com | S1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Search forums" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | System | 1 | site-index | side-pre |
Scenario: Use the search forum block on the frontpage and search for posts as a user
Given I log in as "student1"
@@ -18,16 +18,13 @@ Feature: The Section links block can be configured to display section name in ad
| student1 | C1 | student |
And the following config values are set as admin:
| showsectionname | 1 | block_section_links |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Section links" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| section_links | Course | C1 | course-view-* | side-pre |
Scenario: Student can see section name under the Section links block
Given I log in as "student1"
When I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
Then I should see "7: Topic 7" in the "Section links" "block"
And I follow "7: Topic 7"
And I should see "First assignment"
@@ -4,12 +4,19 @@ Feature: Add URL to main menu block
As a admin
I need to add URLs to the main menu block and check it works.
Background:
Given the following "courses" exist:
| fullname | shortname | category | enablecompletion |
| Course 1 | C1 | 0 | 1 |
| Course 2 | C2 | 0 | |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| site_main_menu | System | 1 | site-index | side-pre |
@javascript
Scenario: Add a URL in menu block and ensure it appears
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Main menu" block
And the following "activity" exists:
| activity | url |
| course | Acceptance test site |
@@ -22,20 +29,15 @@ Feature: Add URL to main menu block
And I set the following fields to these values:
| id_display | In pop-up |
And I press "Save and return to course"
And I turn editing mode on
Then "reference link" "link" should exist in the "Main menu" "block"
And "Add an activity or resource" "button" should exist in the "Main menu" "block"
@javascript
Scenario: Add a URL in menu block can appear in the entire site
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| enablecompletion | 1 |
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Main menu" block
And I configure the "Main menu" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
@@ -61,15 +63,9 @@ Feature: Add URL to main menu block
@javascript
Scenario: Add a URL in menu block can appear in any front page
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| enablecompletion | 1 |
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Main menu" block
And I configure the "Main menu" block
And I set the following fields to these values:
| Page contexts | Display on the site home and any pages added to the site home. |
@@ -95,22 +91,17 @@ Feature: Add URL to main menu block
@javascript
Scenario: When the "Main Menu" block is displayed throrought the entire site, adding an URL in a course
results in adding it in the course and not in the frontpage
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
And I log in as "admin"
results in adding it in the course and not in the frontpage
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Main menu" block
And I configure the "Main menu" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
When the following "activity" exists:
| activity | url |
| course | C1 |
| course | C2 |
| name | reference link |
| intro | mooooooooodle |
| externalurl | http://www.moodle.com |

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