Compare commits

..

365 Commits

Author SHA1 Message Date
Shamim Rezaie b156b18c72 Moodle release 4.1.5 2023-08-11 23:20:36 +10:00
Jun Pataleta 88459bba94 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:11:05 +07:00
Huong Nguyen b201bcb878 Merge branch 'MDL-78983-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-11 12:53:50 +07:00
Jun Pataleta b504d19c12 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:10 +08:00
Huong Nguyen 1c13aba0a2 weekly release 4.1.4+ 2023-08-10 22:50:53 +07:00
Huong Nguyen 8a2c1509d7 Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-08-10 22:50:51 +07:00
meirzamoodle 033f742e4a MDL-78685 auth_oauth2: Added logged-in status check 2023-08-10 18:44:29 +07:00
Jun Pataleta 9e665137d4 Merge branch 'MDL-78962_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-08-10 18:44:29 +07:00
Jun Pataleta 53b33f7b0e Merge branch 'MDL-77817-401' of https://github.com/meirzamoodle/moodle into MOODLE_401_STABLE 2023-08-10 18:44:27 +07:00
Jun Pataleta 7d7c342a2c Merge branch 'MDL-78674-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-10 18:44:14 +07:00
Sara Arjona ce77250706 Merge branch 'MDL-76123-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-10 18:44:14 +07:00
Jun Pataleta 770b11c3d9 Merge branch 'MDL-77378_401_v3' of https://github.com/TomoTsuyuki/moodle into MOODLE_401_STABLE 2023-08-10 18:44:14 +07:00
Michael Hawkins a18da528cc MDL-78763 tool_policy: Initialise returnurl as a moodle_url in viewall 2023-08-10 18:44:14 +07:00
Paul Holden d4cec28c30 MDL-78792 message: access checks in processor fragment callback. 2023-08-10 18:44:14 +07:00
raortegar 48dc9e6582 MDL-74289 lib: Improve the proxy bypass matching 2023-08-10 18:44:10 +07:00
Jun Pataleta 8390f1a03d 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:38:07 +08:00
Santosh Nagargoje 2713f2ea17 MDL-78674 calendar: Added fix to rebuild module cache in calendar 2023-08-10 09:38:07 +08:00
Tim Hunt e726198d4d MDL-78962 core/loadingicon: remove jQuery requirement in the API 2023-08-09 21:20:32 +01:00
Paul Holden a11938293e MDL-78647 files: safer unserializing of file reference data. 2023-08-09 04:50:21 +00:00
Shamim Rezaie cfe33b82e3 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:50:21 +00:00
Matt Porritt cd95c30cb5 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:50:21 +00:00
Rajneel Totaram da05f15e3b MDL-71728 mod_quiz: check if user can access this page 2023-08-09 04:50:21 +00:00
Huong Nguyen efdf0e48c8 Merge branch 'MDL-78904-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-09 11:43:24 +07:00
Huong Nguyen 00e6ac4ad8 Merge branch 'MDL-75047-MOODLE_401_STABLE' of https://github.com/SysBind/moodle into MOODLE_401_STABLE 2023-08-09 11:30:49 +07:00
Jun Pataleta 4de338f002 Merge branch 'MDL-78872-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-09 12:10:16 +08:00
Ilya Tregubov 4732fa0b13 Merge branch 'MDL-78714-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-08-09 12:05:24 +08:00
Huong Nguyen 93ab65454a Merge branch 'MDL-78235-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-08-09 10:43:35 +07:00
Andrew Nicols d8c911ccb4 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 10:21:39 +08:00
Andrew Nicols e8eb8943e1 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 10:21:39 +08:00
Andrew Nicols 737f657bad MDL-78714 editor_tiny: Move TinyMCE import instructions to correct path 2023-08-09 09:05:23 +08:00
Huong Nguyen 8ce08d5cd1 Merge branch 'MDL-78492_aurora_mysql_rowformat_401' of https://github.com/mark-webster-catalyst/moodle into MOODLE_401_STABLE 2023-08-08 21:43:36 +07:00
Sara Arjona e250a61e40 Merge branch 'MDL-78770-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-08 13:55:40 +02:00
Sara Arjona bc9138ecba Merge branch 'MDL-77658-MOODLE_401_STABLE' of https://github.com/SysBind/moodle into MOODLE_401_STABLE 2023-08-08 13:29:53 +02:00
Sara Arjona fe7a12a9fd Merge branch 'MDL-78559-401' of https://github.com/rmady/moodle into MOODLE_401_STABLE 2023-08-08 13:02:06 +02:00
Paul Holden 75de5704de MDL-76123 course: multilingual module icon alt text attribute. 2023-08-08 08:29:27 +01:00
Jun Pataleta 1347048659 Merge branch 'MDL-78896-401-enfix' of https://github.com/vmdef/moodle into MOODLE_401_STABLE 2023-08-08 15:29:26 +08:00
AMOS bot 86ff18c9fe Automatically generated installer lang files 2023-08-08 00:10:31 +00:00
Rodrigo Mady 961c7ef3e0 MDL-78559 mod_chat: Fix chat report loading with TeX filter 2023-08-07 09:55:16 -03:00
Helen Foster 7b4d19308e MDL-78896 lang: Import fixed English strings (en_fix) 2023-08-07 11:31:43 +01:00
Ilya Tregubov c9143efd7e Merge branch 'MDL-78800_401' of https://github.com/stronk7/moodle into MOODLE_401_STABLE 2023-08-07 16:58:26 +08:00
Ilya Tregubov 52b234d69a Merge branch 'MDL-78550-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-08-07 11:34:49 +08:00
chen levy 896e87228c MDL-77658 theme: Fixed RTL manage course categories menu
fixed course checkboxes that appears on the categories menu on RTL
2023-08-06 09:54:23 +03:00
Eloy Lafuente (stronk7) 772236e08c 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 php74 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-05 11:17:10 +02:00
Sara Arjona 614563082b weekly release 4.1.4+ 2023-08-04 12:40:10 +02:00
Jun Pataleta 0975a83b7a MDL-78904 user: Remove non-existent require
* And enclose context parameter in an array.
2023-08-04 14:42:49 +08:00
meirzamoodle f8691f2e28 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:12 +07:00
Jun Pataleta d25c0c5448 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:32 +08:00
Ilya Tregubov cf393e9aae Merge branch 'MDL-78866-401' of https://github.com/danghieu1407/moodle into MOODLE_401_STABLE 2023-08-03 09:39:17 +08:00
Ilya Tregubov e3dd019685 Merge branch 'MDL-78742-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-03 09:25:28 +08:00
Sara Arjona ceb153b1c7 Merge branch 'MDL-78460-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-02 08:51:13 +02:00
Jun Pataleta 1967ccccc0 Merge branch 'MDL-78498-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-08-02 11:22:58 +08:00
Paul Holden 58836d7143 MDL-78872 grade: fix external class execute method visibility. 2023-08-02 02:18:51 +01:00
Sara Arjona d04d701c18 Merge branch 'MDL-78703-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-08-01 13:45:11 +02:00
danghieu1407 1b4ee84aee MDL-78866 question: question_created trigger pre-saving extra fields 2023-08-01 15:59:57 +07:00
Simey Lameze 33d829716e 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:10 +08:00
Angelia Dela Cruz 73a08e3ccd 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:10 +08:00
Andrew Nicols 8c8cb002c0 MDL-78632 core: Update upgrade versions 2023-08-01 09:32:36 +08:00
Andrew Nicols ea6adbc72e Merge branch 'M401-MDL-78632' of https://github.com/marcusboon/moodle into MOODLE_401_STABLE 2023-08-01 09:31:42 +08:00
Tomo Tsuyuki 2ba3b8b27e MDL-77378 qtype_multianswer: Fix division by zero errors 2023-08-01 11:26:44 +10:00
Michael Aherne affda87228 MDL-78235 userprofile: Check for defaultdata with isset(). 2023-07-31 19:33:06 +08:00
Jun Pataleta ebe27cf615 MDL-78550 core: Ensure spacing between more menu item attributes 2023-07-28 17:33:07 +08:00
Jun Pataleta 27f453d6e9 MDL-78550 grade: Hide empty fillers from the accessibility tree
* And remove the title attribute for the filler as it is unnecessary.
2023-07-28 17:28:58 +08:00
Jun Pataleta b98fb9032c MDL-78550 grade: Avoid rendering an empty <h2> heading 2023-07-28 17:28:57 +08:00
Jun Pataleta e953e71c54 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:28:56 +08:00
Marcus Boon 3295c4bc1d MDL-78632 filetypes: Introduce yaml file type 2023-07-28 15:28:15 +10:00
Ilya Tregubov 13553c25da weekly release 4.1.4+ 2023-07-28 10:44:15 +08:00
Ilya Tregubov c9fc2bfeb4 Merge branch 'MDL-78782-401' of https://github.com/ferranrecio/moodle into MOODLE_401_STABLE 2023-07-27 10:00:01 +08:00
Ferran Recio dcd7261175 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:19:57 +02:00
Huong Nguyen bca23d5477 Merge branch 'MDL-78618_401' of https://github.com/larsbonczek/moodle into MOODLE_401_STABLE 2023-07-26 14:22:42 +07:00
Mark Webster 28aaa93df9 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:57:38 +01:00
Huong Nguyen 533ce56743 weekly release 4.1.4+ 2023-07-21 20:56:32 +07:00
Huong Nguyen e677d31003 Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-07-21 20:56:30 +07:00
Paul Holden 5f35d838d1 MDL-78742 tool_uploadcourse: configure show activity dates value. 2023-07-20 16:28:41 +01:00
Jun Pataleta 61d3f1345a MDL-78770 tiny_recordrtc: Use proper window.console.warn() function 2023-07-20 14:32:52 +08:00
Jun Pataleta 9cb8b3fa50 MDL-78770 atto_recordrtc: Use proper window.console.warn() function 2023-07-20 14:23:01 +08:00
Huong Nguyen 8eb8fb844a Merge branch 'MDL-78525-401' of github.com:HuongNV13/moodle into MOODLE_401_STABLE 2023-07-20 10:58:06 +07:00
Huong Nguyen 792530cfe6 MDL-78525 core: Update upgrade.txt for count_words and count_letters 2023-07-20 10:54:57 +07:00
Ilya Tregubov 974cbce6e8 Merge branch 'MDL-76854-subscription_deleted-401' of https://github.com/leonstr/moodle into MOODLE_401_STABLE 2023-07-20 10:49:55 +08:00
Huong Nguyen 9c47f4e461 Merge branch 'MDL-78525/401' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-07-20 09:04:31 +07:00
Ilya Tregubov cbadd18581 Merge branch 'MDL-75115-401' of https://github.com/meirzamoodle/moodle into MOODLE_401_STABLE 2023-07-20 09:41:33 +08:00
Andrew Nicols 97c95140c3 Merge branch 'MDL-78716-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-20 00:29:09 +08:00
Andrew Nicols 0311f95fee Merge branch 'MDL-78715-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-20 00:17:33 +08:00
Andrew Nicols f852e35976 Merge branch 'MDL-77645-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-20 00:11:59 +08:00
Andrew Nicols 05c485dc97 Merge branch 'MDL-78704-401' of https://github.com/rjnl/moodle into MOODLE_401_STABLE 2023-07-19 21:57:52 +08:00
AMOS bot 36918dfbfc Automatically generated installer lang files 2023-07-19 00:11:00 +00:00
Shamim Rezaie d0bef0b899 Merge branch 'MDL-78564-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-17 20:36:00 +10:00
Leon Stringer ad5e75ddf1 MDL-76854 tool_monitor: subscription_deleted ctx
Fix course context for subscription_deleted event when deleting rules
with multiple subscriptions.
2023-07-15 08:08:22 +01:00
Paul Holden ba6143d1ac MDL-78703 behat: fix HTTP GET method capitalization on redirect. 2023-07-15 01:00:07 +01:00
Paul Holden 0c7a684fcc MDL-78715 payment: prevent action menus flowing under container. 2023-07-14 17:17:00 +01:00
Paul Holden 587ea4d3f3 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:59 +01:00
Paul Holden f6583c57c8 MDL-78460 mod_forum: correctly render timed post label information. 2023-07-14 10:15:40 +01:00
Petr Skoda f25ad012c5 MDL-78525 core: fix word and character counting 2023-07-14 08:44:15 +02:00
Ilya Tregubov 272fdb321a weekly release 4.1.4+ 2023-07-14 09:25:40 +08:00
Rajneel Totaram 962a3f866c MDL-78704 course: Render unescaped HTML for activity dates 2023-07-14 10:17:04 +12:00
Tim Hunt 0a6f40cb21 MDL-76757 delete questions: fix message generation logic
The order was getting scrambled.
2023-07-13 21:44:04 +02:00
Jun Pataleta 85232e735d Merge branch 'MDL-76046-401' of https://github.com/stevandoMoodle/moodle into MOODLE_401_STABLE 2023-07-13 11:19:30 +08:00
Huong Nguyen 90c15c62f4 Merge branch 'MDL-75195-401' of https://github.com/raortegar/moodle into MOODLE_401_STABLE 2023-07-13 09:57:23 +07:00
Huong Nguyen dcd80cff04 Merge branch 'MDL-76757-401' of https://github.com/danghieu1407/moodle into MOODLE_401_STABLE 2023-07-13 09:46:59 +07:00
Ilya Tregubov e0dc36f27e Merge branch 'mdl-7133-401' of https://github.com/juancs/moodle into MOODLE_401_STABLE 2023-07-13 10:31:28 +08:00
Huong Nguyen 73cce7054c Merge branch 'MDL-77990-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-07-13 09:22:19 +07:00
Jake Dallimore a6b769bddd Merge branch 'MDL-77912_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-07-13 10:09:45 +08:00
Andrew Nicols 94080683ba Merge branch 'MDL-78157-401' of https://github.com/golenkovm/moodle into MOODLE_401_STABLE 2023-07-13 09:48:19 +08:00
Andrew Nicols 10cdb9c72d Merge branch 'MDL-78556-401' of https://github.com/danghieu1407/moodle into MOODLE_401_STABLE 2023-07-13 09:29:04 +08:00
Andrew Nicols 57af739134 Merge branch 'MDL-76996_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-07-13 09:25:35 +08:00
Ilya Tregubov 8cf9b77cdb Merge branch 'MDL-73213_401' of https://github.com/pedrojordao/moodle into MOODLE_401_STABLE 2023-07-13 09:18:31 +08:00
Sara Arjona 07ef1c6aa5 Merge branch 'MDL-78673-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-07-12 18:18:13 +02:00
Andrew Nicols b3820bdc44 Merge branch 'MDL-77450-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-07-13 00:10:14 +08:00
Andrew Nicols a80a370e0a Merge branch 'MDL-78676-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-07-13 00:06:36 +08:00
Sara Arjona 4fbc7a28ae Merge branch 'MDL-78455-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-07-12 17:37:14 +02:00
Paul Holden 0202597261 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:33 +01:00
Tim Hunt c589ced794 MDL-76996 question bank: fix errors when qbank_statistics is disabled 2023-07-12 11:47:37 +01:00
Sara Arjona 4abfc497e2 Merge branch '76319-gradebook-add-missing-continue-button-401' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_401_STABLE 2023-07-12 08:28:15 +02:00
Miri Lipson 03a7d208f9 MDL-75115 theme_boost: Fix Bootstrap tooltips in RTL mode 2023-07-12 09:11:33 +07:00
Tim Hunt 0ece3bcfc1 MDL-77912 questions: make multi-choice stats calc robust to bad data 2023-07-11 16:57:45 +01:00
raortegar f904f52240 MDL-75195 core: Added supportemail option to install_database.php 2023-07-11 11:13:49 +02:00
danghieu1407 173da3666c MDL-78556 tablelib: flexible_table should support caption tag 2023-07-11 14:18:54 +07:00
Angelia Dela Cruz 9a55a771c1 MDL-77450 Behat: Behat cleanup and optimisation 2023-07-11 14:22:35 +08:00
Ilya Tregubov c057bc092d Merge branch 'MDL-67852_MOODLE_401_NEW' of https://github.com/aydevworks/moodle into MOODLE_401_STABLE 2023-07-11 11:12:16 +08:00
Ilya Tregubov 5cecf47fd1 Merge branch 'MDL-77690-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-07-11 09:52:05 +08:00
Ilya Tregubov f4e0c7d6bf Merge branch 'MDL-75359-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-11 09:30:14 +08:00
Julien Boulen 231577e4b0 MDL-76319 gradebook: add continue button after csv grades import error 2023-07-10 10:18:14 +02:00
danghieu1407 cf0b6e06e2 MDL-76757 Question bank: Can not delete the question completely 2023-07-10 14:34:32 +07:00
Andrew Nicols 43d00eaeba MDL-78673 grade: Switch test to use generators 2023-07-10 11:30:14 +08:00
Andrew Nicols 23c2c5d08e MDL-78673 grade: Switch to behat navigation steps 2023-07-10 11:30:14 +08:00
Andrew Nicols 7961e169b1 MDL-78673 grade: Address random failure due to toast 2023-07-10 11:30:09 +08:00
Andrew Nicols e0c28bebcb MDL-78673 behat: Allow plugins to define their expansion of > 2023-07-10 11:29:39 +08:00
Andrew Nicols 51dc88fa84 Merge branch 'MDL-77180-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-09 22:14:37 +08:00
Alex Yeung 236f4654c0 MDL-67852 tool_dataprivacy: Fix security checks 2023-07-09 14:50:10 +01:00
Juan Segarra Montesinos 031e583402 MDL-71133 mod_assign: Grade decimals missing with marking workflow 2023-07-09 08:12:22 +02:00
Sara Arjona e8897600a1 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:23 +02:00
Paul Holden e9191587be 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:54 +01:00
Paul Holden 73939586b6 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:29 +01:00
Ilya Tregubov f29f757f5f weekly release 4.1.4+ 2023-07-07 11:52:28 +08:00
Ilya Tregubov 5246118a3b Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-07-07 11:52:26 +08:00
Pedro Jordao 2ace3d54dc 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:33:47 -03:00
Lars Bonczek 24b8efe27a MDL-78618 core_course: use UNION in get_nearest_editable_subcategory 2023-07-06 18:52:36 +02:00
Sara Arjona d9c911598c Merge branch 'MDL-78391-401' of https://github.com/HuongNV13/moodle into MOODLE_401_STABLE 2023-07-06 11:03:18 +02:00
Huong Nguyen 7a582cf628 MDL-78391 atto_recordrtc: Fix recording issue with Chrome 2023-07-06 15:49:56 +07:00
Huong Nguyen 0f7151e2ba MDL-78391 tiny_recordrtc: Fix recording issue with Chrome 2023-07-06 15:49:55 +07:00
Sara Arjona 082a862366 Merge branch 'MDL-77375-401-patch' of https://github.com/ilyatregubov/moodle into MOODLE_401_STABLE 2023-07-06 10:12:00 +02:00
Misha Golenkov d06d29ef5d MDL-78379 js: Add missing newline character 2023-07-06 16:16:39 +10:00
Ilya Tregubov c7877e7bb3 MDL-77375 tool_dataprivacy: Fix menus going floaty. 2023-07-06 13:12:53 +08:00
Jun Pataleta 6509d6d944 Merge branch 'MDL-78391-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-07-06 11:59:46 +08:00
Jun Pataleta 3601d38c01 Merge branch 'MDL-78488_401' of https://github.com/t-schroeder/moodle into MOODLE_401_STABLE 2023-07-06 11:17:57 +08:00
Ilya Tregubov fa52ecfdf2 Merge branch 'MDL-69983-401' of https://github.com/davewoloszyn/moodle into MOODLE_401_STABLE 2023-07-06 10:26:27 +08:00
Ilya Tregubov 83748b3b19 Merge branch 'MDL-78608_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-07-06 09:57:21 +08:00
Jun Pataleta 461c0bd947 Merge branch 'MDL-78484-401' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_401_STABLE 2023-07-06 09:41:24 +08:00
Ilya Tregubov ff652d5c2c Merge branch 'MDL-77375-401' of https://github.com/rezaies/moodle into MOODLE_401_STABLE 2023-07-06 09:21:18 +08:00
Jun Pataleta d584ca7b7f Merge branch 'MDL-74893-MOODLE_401_STABLE-fix_auto_login_guest' of https://github.com/praxisdigital/moodle into MOODLE_401_STABLE 2023-07-06 09:14:09 +08:00
Paul Holden c537169f84 Merge branch 'MDL-78542-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-07-05 17:13:18 +01:00
Andrew Nicols b3246582c4 Merge branch 'MDL-78644-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-05 22:10:42 +08:00
Andrew Nicols c3c39d78c4 Merge branch 'MDL-78338-401_toolbrickfieldlinkinnewwindow' of https://github.com/brickfield/moodle into MOODLE_401_STABLE 2023-07-05 22:03:04 +08:00
Andrew Nicols 2811bedd48 Merge branch 'MDL-78622_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-07-05 21:56:35 +08:00
Andrew Nicols ba32d69255 Merge branch 'MDL-64152-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-07-05 21:49:20 +08:00
Andrew Nicols 17b4837fb6 Merge branch 'MDL-78614-401' of https://github.com/noeldemartin/moodle into MOODLE_401_STABLE 2023-07-05 20:30:42 +08:00
Paul Holden f09241fafe 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:41 +01:00
Ilya Tregubov a9fe9bbb0c Merge branch 'MDL-78485-401' of https://github.com/stevandoMoodle/moodle into MOODLE_401_STABLE 2023-07-05 11:52:11 +08:00
Andrew Nicols e5f747ffa4 Merge branch 'MDL-78158-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-07-05 10:24:07 +08:00
Huong Nguyen 28263edd35 Merge branch 'MOODLE_401_MDL-77396' of https://github.com/Dineshdurai/moodle into MOODLE_401_STABLE 2023-07-04 16:15:48 +07:00
Huong Nguyen 25432feda8 Merge branch 'MDL-78596-coursecard-divider-401' of https://github.com/leonstr/moodle into MOODLE_401_STABLE 2023-07-04 15:28:30 +07:00
Huong Nguyen e8058e6981 Merge branch 'MDL-78578-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-07-04 15:16:15 +07:00
Huong Nguyen d19936b1c6 Merge branch 'MDL-76853-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-07-04 12:46:26 +07:00
Huong Nguyen 1751f4e658 Merge branch 'MDL-78138-401' of https://github.com/lucaboesch/moodle into MOODLE_401_STABLE 2023-07-04 12:38:59 +07:00
Stevani Andolo 419db61006 MDL-78485 editor_tiny: Allowed script tag to be added in tinyMCE editor 2023-07-04 13:36:47 +08:00
Andrew Nicols 48a4ad4d4c Merge branch 'MDL-75324-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-07-04 13:30:15 +08:00
Andrew Nicols daccd01a0e Merge branch 'MDL-76840_401' of https://github.com/uzimike/moodle into MOODLE_401_STABLE 2023-07-04 13:21:30 +08:00
Simey Lameze a34591cc0b MDL-75324 behat: use a proper step to verify completion status 2023-07-04 11:20:23 +08:00
Jun Pataleta 5db1843de2 Merge branch 'MDL-78572_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-07-04 09:47:43 +08:00
Angelia Dela Cruz 241a8eb343 MDL-78158 behat: Behat cleanup and optimisation 2023-07-04 08:36:58 +08:00
AMOS bot 55ba6b010a Automatically generated installer lang files 2023-07-04 00:11:38 +00:00
Sara Arjona b90771ef97 Merge branch 'MDL-77868-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-03 17:29:40 +02:00
Sara Arjona 7cf23d5396 Merge branch 'MDL-76661-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-07-03 17:26:29 +02:00
Angelia Dela Cruz 0d5b8d1337 MDL-78158 Behat: Use data generators to add blocks 2023-07-03 19:17:35 +08:00
Tim Hunt bcf0112c36 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:19 +01:00
Paul Holden d88a8851ac MDL-76661 mod_bigbluebuttonbn: fix meeting attendee role comparison. 2023-07-03 11:41:13 +01:00
Noel De Martin 73fcdb1bf4 MDL-78614 behat: Remove trailing quotes 2023-07-03 11:18:42 +02:00
Andrew Nicols 0830ca48f9 MDL-78391 atto_recordrtc: Improve MacOS codec compatability 2023-07-03 16:52:28 +08:00
Andrew Nicols ed6054fdf8 MDL-78391 tiny_recordrtc: Set filename according to container 2023-07-03 16:52:26 +08:00
Andrew Nicols 3faf81d578 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 756d9fa18d 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:12 +08:00
Andrew Nicols d73ad3b532 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 9c97536a9f MDL-76853 editor_tiny: Refactor behat helpers into trait 2023-07-03 09:38:24 +08:00
Karen Holland 1f6fa90a02 MDL-78338 tool_brickfield: Allow link open in new window with warning 2023-07-01 23:14:26 +01:00
Shamim Rezaie 2d8c924d71 MDL-77375 core_grades: set boundary of the dropdowns in grade setup page 2023-07-02 00:40:15 +10:00
Shamim Rezaie ddb1b56f36 MDL-77375 gradereport_singleview: set boundary of the dropdowns 2023-07-02 00:06:14 +10:00
Shamim Rezaie f30316be5d MDL-77375 tool_dataprivacy: set boundary of the dropdowns 2023-07-02 00:06:13 +10:00
Shamim Rezaie 2f108b6430 MDL-77375 mod_forum: set boundary of the dropdown
Also removed the unnecessary button role from the <button> element
2023-07-02 00:06:13 +10:00
Shamim Rezaie ebe8674636 MDL-77375 mod_assign: set overflow constraint boundary of the dropdowns 2023-07-02 00:06:13 +10:00
Shamim Rezaie 88f66617a0 MDL-77375 output: Allow additional options for dropdowns 2023-07-02 00:06:13 +10:00
Shamim Rezaie ba07bb42e1 MDL-77375 theme: Re-fix the bootstrap scrollbar issue 2023-07-02 00:06:13 +10:00
Paul Holden 315e8dd327 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:09 +01:00
Jun Pataleta 14d4f0aed3 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:51:12 +08:00
Jun Pataleta 213223d162 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:51:12 +08:00
Tim Schroeder be118c06b3 MDL-78488 question bank: don't load statistics when they are disabled 2023-06-30 11:47:04 +02:00
Jun Pataleta 415de4b23e MDL-77690 user: Add sr-only heading for the user profile page 2023-06-30 17:46:57 +08:00
Jun Pataleta 2f305e5a10 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:32 +08:00
Jun Pataleta 7ffbc23426 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:32 +08:00
Jun Pataleta f6c05b8980 MDL-78542 mod_url: Use the module name for the URL resource's link text 2023-06-30 17:27:32 +08:00
Jake Dallimore 32ad202b06 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:37 +08:00
Jun Pataleta 1d92fd1ed3 Merge branch 'MDL-78068-401' of https://github.com/laurentdavid/moodle into MOODLE_401_STABLE 2023-06-30 16:42:31 +08:00
Franziska Hübler 09a97ba0bf MDL-69983 backup: Save async backups in correct area. 2023-06-30 10:13:17 +10:00
AMOS bot cc4ed8ebb4 Automatically generated installer lang files 2023-06-30 00:08:41 +00:00
Stevani Andolo 322e681c65 MDL-76046 core: Fixed secondary navigation on smaller screen 2023-06-30 06:31:22 +08:00
Luca Bösch 18dfb832d1 MDL-78138 theme_boost: Reliably remove TYPE_CATEGORY breadcrumbs. 2023-06-29 21:48:41 +02:00
Tim Hunt 2a2dd08ff1 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:27:01 +01:00
Huong Nguyen 6628845087 weekly release 4.1.4+ 2023-06-29 22:22:22 +07:00
Sara Arjona 9137b58fca Merge branch 'MDL-78554-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-29 17:39:05 +08:00
Andrew Nicols d949e40268 Merge branch 'MDL-78599-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-06-29 11:33:22 +08:00
Jun Pataleta 648aa897cf Merge branch 'MDL-77993-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-29 11:28:07 +08:00
Jun Pataleta d73c514909 Merge branch 'MDL-78432-401' of https://github.com/laurentdavid/moodle into MOODLE_401_STABLE 2023-06-29 11:25:12 +08:00
Andrew Nicols 2fd55eddff Merge branch 'MDL-78018-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-29 11:02:09 +08:00
Ilya Tregubov 76ec26032e Merge branch 'MDL-77286-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-06-29 09:44:32 +08:00
Ilya Tregubov de210a84e7 Merge branch 'MDL-78521-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-06-29 09:35:06 +08:00
Huong Nguyen 52cd821ac9 Merge branch 'MDL-77679_401' of https://github.com/mkassaei/moodle into MOODLE_401_STABLE 2023-06-28 21:19:10 +07:00
Jake Dallimore 0c0b1ac1d6 MDL-78599 enrol_lti: fix SQL syntax error in course grade sync 2023-06-28 18:13:27 +08:00
Jake Dallimore 07b0f65aac 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 18:13:26 +08:00
Leon Stringer fa9705a870 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:41 +01:00
Dinesh Durai 201c577a85 MDL-77396 wiki: Fix print without background 2023-06-27 17:59:37 +05:30
Simey Lameze edf6ad1ee2 MDL-77286 behat: change window size to large to avoid random fails 2023-06-27 17:12:21 +08:00
Laurent David 54e62e6997 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:12:57 +02:00
Andrew Nicols ea900c4def Merge branch 'MDL-78459-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-27 13:14:50 +08:00
Ilya Tregubov aa44a1643e Merge branch 'MDL-78443-401' of https://github.com/jleyva/moodle into MOODLE_401_STABLE 2023-06-27 11:01:44 +08:00
Jake Dallimore 8d3fd17313 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:07:25 +08:00
mkassaei fff6af7c20 MDL-77679 Drag and drop question type weird behavior 2023-06-26 17:07:51 +01:00
Jun Pataleta 6f0dfe8b4b Merge branch 'MDL-76724_401' of https://github.com/stronk7/moodle into MOODLE_401_STABLE 2023-06-26 19:38:03 +08:00
Huong Nguyen d53b1b1cfe MDL-78554 tiny_link: Fix cannot create link for selection text
Backport of MDL-78065
2023-06-26 15:47:33 +08:00
Paul Holden 32f9d1eeb5 MDL-78554 tiny_link: define help link text language string.
Backport of MDL-77874
2023-06-26 15:47:14 +08:00
Huong Nguyen 684889be8f MDL-78554 tiny_link: Add a TinyMCE link plugin
Backport of MDL-76520

Co-authored-by: Andrew Lyons <andrew@nicols.co.uk>
2023-06-26 15:45:56 +08:00
Laurent David 29eb09287a MDL-78068 mod_h5pactivity: Fix sort the paragraph activity
* Fix sort the paragraph/sequencing activity report in H5P.
2023-06-26 08:42:39 +02:00
Simey Lameze 31c2baeafd MDL-78521 behat: reload page before asserting content
This commit also reword a Scenario name to make it unique
2023-06-26 11:19:48 +08:00
Sara Arjona 78ec9c1c12 MDL-78572 badges: Improve debugging information for Badgr
This is a backport from MDL-77842.

In MDL-77086 some extra information was added when a badge can't be
sent to a backpack. However, as the Badgr is not following the
specification, it's still hard to debug it when it fails (as
raised in MDL-75552, Badgr is not working because, in some cases,
it's returning the "Method Not Allowed / Request method 'POST'
not supported" error.
2023-06-25 17:40:32 +01:00
Sara Arjona 8e965a9661 MDL-78572 badges: Improve debugging
Display more information, like the status error, when the badge can't
be sent to the backpack.

Backport from MDL-77086
2023-06-25 17:40:03 +01:00
Andrew Nicols d9745d9852 Merge branch 'MDL-78237-401' of https://github.com/davewoloszyn/moodle into MOODLE_401_STABLE 2023-06-24 23:21:58 +08:00
Andrew Nicols 378eae6144 Merge branch 'MDL-76673-401' of https://github.com/meirzamoodle/moodle into MOODLE_401_STABLE 2023-06-24 22:47:10 +08:00
Andrew Nicols 889e1d4e35 Merge branch 'MDL-78544-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-06-24 22:26:57 +08:00
Andrew Nicols 99d941bd6a Merge branch 'MDL-77152-MOODLE_401_STABLE' of https://github.com/sh-csg/moodle into MOODLE_401_STABLE 2023-06-24 22:18:00 +08:00
Andrew Nicols 904e04a14f Merge branch 'MDL-78172-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-24 22:00:12 +08:00
Eloy Lafuente (stronk7) 3c99a0a9ec 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:30:01 +02:00
Stefan Hanauska e3c84dcb32 MDL-77152 files: Ensure trailing/leading slash 2023-06-24 10:32:02 +02:00
Sara Arjona eb1fab720a weekly release 4.1.4+ 2023-06-23 09:00:18 +02:00
Andrew Nicols 4e7a476651 Merge branch 'MDL-78004_401' of https://github.com/mwehr/moodle into MOODLE_401_STABLE 2023-06-22 14:37:45 +02:00
Ilya Tregubov 84a7937643 Merge branch 'MDL-78434-m401' of https://github.com/sammarshallou/moodle into MOODLE_401_STABLE 2023-06-22 14:37:45 +02:00
Julien Boulen fd7e43ef34 MDL-77986 backup: trim extra white spaces on search forms 2023-06-22 14:37:44 +02:00
Andrew Nicols acb9789b89 Merge branch 'MDL-78071-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-22 14:37:44 +02:00
Andrew Nicols fd87f7b46d Merge branch 'MDL-78541/401' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-06-22 14:37:44 +02:00
Andrew Nicols 675ca18cfa Merge branch 'MDL-78350-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-22 14:37:44 +02:00
Andrew Nicols 1186e8a7e5 Merge branch 'MDL-68067-41' of https://github.com/Chocolate-lightning/moodle into MOODLE_401_STABLE 2023-06-22 14:37:44 +02:00
Andrew Nicols 70a0c87fd3 Merge branch 'MDL-78056-401' of https://github.com/laurentdavid/moodle into MOODLE_401_STABLE 2023-06-22 14:37:44 +02:00
Andrew Nicols e67fd9663d Merge branch 'MDL-78263-401' of https://github.com/jleyva/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
Andrew Nicols 0e3c4ad99b Merge branch 'MDL-78435-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
Andrew Nicols de329f8268 Merge branch 'MDL-75913-401' of https://github.com/davewoloszyn/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
Andrew Nicols 3488b2ae01 Merge branch 'MDL-78477_401' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
Andrew Nicols 2452db088e Merge branch 'MDL-77865_MOODLE_401_STABLE' of https://github.com/tuanngocnguyen/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
hieuvu 14079fa738 MDL-78484 formslib: Move enable checkbox display before the date picker 2023-06-22 11:08:47 +07:00
Jake Dallimore 331f47a4f3 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 11:01:17 +08:00
Paul Holden e8526347a3 MDL-78350 reportbuilder: parse javascript before rendering template. 2023-06-21 17:33:33 +01:00
Paul Holden 61ae9500d7 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:40 +01:00
Juan Leyva 8cbf1bb945 MDL-78263 airnotifier: keep notification name as part of the payload 2023-06-21 18:00:58 +02:00
Petr Skoda 9fee59de2a 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:47:06 +02:00
Sara Arjona 97b7c894f3 Merge branch 'MDL-76635-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-06-21 14:02:22 +02:00
Sara Arjona c047801eb6 Merge branch 'MDL-63120_Badges_cron_task_fails-MOODLE_401_STABLE' of https://github.com/mebis-lp/moodle into MOODLE_401_STABLE 2023-06-21 11:50:28 +02:00
Anupama Sarjoshi e954482cb0 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:44:38 +01:00
Ilya Tregubov e34bb395fc Merge branch 'MDL-77591-401' of https://github.com/justusdieckmann/moodle into MOODLE_401_STABLE 2023-06-21 16:58:44 +08:00
Ilya Tregubov f64e9f96aa Merge branch 'MDL-76174_401' of https://github.com/larsbonczek/moodle into MOODLE_401_STABLE 2023-06-21 14:27:10 +08:00
Simey Lameze 39811c4b40 MDL-76635 comment: render the delete icon in the right place
Special thanks to Andrew Lyons.
2023-06-21 12:45:36 +08:00
Simey Lameze 8bcadeff35 MDL-76635 behat: improve submission comments test 2023-06-21 12:45:36 +08:00
Justus Dieckmann 049815cd5f 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-20 20:19:44 +02:00
Lars Bonczek 44f60f1b8e MDL-76174 core_course: get_nearest_editable_subcategory performance fix 2023-06-20 14:43:16 +02:00
Ilya Tregubov a69d5ffe33 Merge branch 'MDL-78259-htmlpurify-media-tags-401' of https://github.com/ilyatregubov/moodle into MOODLE_401_STABLE 2023-06-20 16:38:43 +08:00
Julien Boulen 4001902464 MDL-78259 weblib: purify audio/video tags as inline elements 2023-06-20 16:37:02 +08:00
Ilya Tregubov dea9c9534c Merge branch 'MDL-77525/401' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-06-20 13:05:29 +08:00
eWallah 71a818f0ff MDL-68067 tool_mobile: Mobile tool link does not have a class attribute. 2023-06-20 10:27:01 +08:00
Jun Pataleta d963201f0a Merge branch 'MDL-74021-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-06-20 10:13:22 +08:00
Jun Pataleta 64f4f58cb8 Merge branch 'MDL-78369_401' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_401_STABLE 2023-06-19 23:16:46 +08:00
Paul Holden 2060b48377 MDL-78071 cohort: disable report actions for managed cohorts. 2023-06-19 15:05:26 +01:00
Paul Holden 7f8d290022 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:03:36 +01:00
Angelia Dela Cruz 07df782303 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:14:19 +08:00
David Woloszyn 86a2213223 MDL-75913 behat: Use alternatives to Atto in tests 2023-06-19 16:38:18 +10:00
David Woloszyn 94b98082a3 MDL-75913 behat: Switch to TinyMCE editor iframe 2023-06-19 16:38:18 +10:00
David Woloszyn 7f6d6d240f MDL-75913 behat: Private files data generator 2023-06-19 16:38:18 +10:00
Andrew Nicols a6e11f20da MDL-75913 behat: Add support for file uploads in page generators 2023-06-19 16:38:18 +10:00
Andrew Nicols 1f553279d2 MDL-75913 behat: Add support for file uploads in generators 2023-06-19 16:38:18 +10:00
Anders Rasmussen c5471d260e MDL-74893 authentication: Fix auto-login guest
Fixed auto-login as guest, when Guest login button is hidden
2023-06-19 07:49:24 +02:00
Laurent David 301f556e41 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:05 +02:00
Paul Holden 38e53fdcb6 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:53 +01:00
Petr Skoda 52e39db7ad MDL-77525 filter: add filtering stages 2023-06-17 16:49:34 +02:00
Paul Holden 0f052d1c35 MDL-78435 mod_assign: ensure due date is always after start date. 2023-06-16 18:42:10 +01:00
Juan Leyva bc2fb3b5e8 MDL-78443 course: Missing require for course_request 2023-06-16 10:17:45 +02:00
Andrew Nicols 64b701190d weekly release 4.1.4+ 2023-06-16 12:04:26 +08:00
Andrew Nicols 202e6a788f Merge branch 'install_401_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_401_STABLE 2023-06-16 12:04:23 +08:00
Angelia Dela Cruz e08630b394 MDL-78455 Behat: Behat cleanup and optimisation for blog/tests/behat 2023-06-16 09:19:13 +08:00
Angelia Dela Cruz e4a8e344ba MDL-78455 Behat: Add Behat for adding, editing and deleting blog entries 2023-06-16 09:16:32 +08:00
Nathan Nguyen 35f0386bd3 MDL-77865 qtype_ddwtos: fix incorrect inplace class 2023-06-15 15:03:54 +10:00
Ilya Tregubov a3692234ed Merge branch 'MDL-70152-401-fix' of https://github.com/ilyatregubov/moodle into MOODLE_401_STABLE 2023-06-15 12:12:18 +08:00
Simey Lameze 460e2c0c1e MDL-70152 behat: reply to post using data generator 2023-06-15 12:05:41 +08:00
Andrew Nicols 4997295c38 Merge branch 'MDL-77224-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-15 12:02:40 +08:00
Andrew Nicols b66d82ccb4 Merge branch 'MDL-77569-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-15 12:00:55 +08:00
Andrew Nicols e2f07cf2b4 Merge branch 'MDL-78066-401' of https://github.com/snake/moodle into MOODLE_401_STABLE 2023-06-15 11:27:02 +08:00
Andrew Nicols dedfbb7e63 Merge branch 'MDL-78461-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-15 11:23:27 +08:00
Andrew Nicols 196ed7530b Merge branch 'MDL-69231-401' of https://github.com/lameze/moodle into MOODLE_401_STABLE 2023-06-15 10:56:53 +08:00
Ilya Tregubov 7e523dfff9 Merge branch 'MDL-77542-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-15 10:36:34 +08:00
Ilya Tregubov 053ad4a57e Merge branch 'MDL-76733-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-15 10:23:36 +08:00
Andrew Nicols 46f3dc6538 Merge branch 'MDL-78478-401' of https://github.com/dasistwas/moodle into MOODLE_401_STABLE 2023-06-15 09:56:18 +08:00
Jake Dallimore 68b6ca2f69 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:44:21 +08:00
Jake Dallimore 32a34f805f 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:44:17 +08:00
Andrew Nicols 1adbb84d07 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 b5fa1ee8dc 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 5472d69233 Merge branch 'MDL-78102-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-06-15 09:04:09 +08:00
AMOS bot ba4f42dfff Automatically generated installer lang files 2023-06-15 00:16:23 +00:00
Sara Arjona 36a7924b64 Merge branch 'MDL-78055-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-14 16:54:57 +02:00
Sara Arjona 4dcf2db446 Merge branch 'MDL-74824-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-06-14 16:51:11 +02:00
Sara Arjona 86b030d671 Merge branch 'MDL-76733-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-14 16:22:26 +02:00
David Bogner c461b4d8fc MDL-78478 forms: Fix repeated elements in dynamic forms 2023-06-14 15:30:32 +02:00
Paul Holden b8f3aa4d12 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:12 +01:00
Sara Arjona 29d1702f82 Merge branch 'MDL-76715-401' of https://github.com/aanabit/moodle into MOODLE_401_STABLE 2023-06-14 13:19:03 +02:00
Sara Arjona 4c6e5c977d Merge branch 'MDL-64648-401_enrol_manual_expirynotify_default_in_enrol_instance' of https://github.com/vtos/moodle into MOODLE_401_STABLE 2023-06-14 13:08:25 +02:00
Jun Pataleta 302d6f2a3e Merge branch 'MDL-78466-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-06-14 16:05:55 +08:00
Ilya Tregubov beb0328060 Merge branch 'MDL-70152-401' of https://github.com/andelacruz/moodle into MOODLE_401_STABLE 2023-06-14 13:25:03 +08:00
Jun Pataleta e460f1ed4e Merge branch 'MDL-76445-401-patch' of https://github.com/ilyatregubov/moodle into MOODLE_401_STABLE 2023-06-14 12:19:03 +08:00
Ilya Tregubov c162f90445 MDL-76445 gradereport_singleview: Fix Behat test
When you unenrol a user, the notification blocks some tertiary
navigation links.
2023-06-14 11:38:04 +08:00
Andrew Nicols fdf7ea57f0 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 09:35:40 +08:00
Ilya Tregubov b699da1461 MDL-76445 core_grades: Use group select instead of group search
On Moodle 4.1 we don't have group search on grader report.
That is only available in 4.2+
2023-06-14 09:34:22 +08:00
Andrew Nicols 02652c7651 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:28:48 +08:00
vtos e0145522c9 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:23:35 +02:00
Paul Holden 43d715777a MDL-78461 core: fix base plugininfo class reference to root directory. 2023-06-13 14:05:31 +01:00
Sara Arjona 7e74ec4a3c 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:52 +02:00
sam marshall 673576142e MDL-78434 Lib: PHP 8.1 incompatible code relating to LDAP\Connection 2023-06-13 09:45:04 +01:00
Ilya Tregubov f6650607d6 Merge branch 'MDL-76445-401-2' of https://github.com/mihailges/moodle into MOODLE_401_STABLE 2023-06-13 15:46:29 +08:00
Amaia Anabitarte 789361ae13 MDL-76715 mod_data: Remove data_records when the last field is deleted 2023-06-13 09:35:09 +02:00
Mihail Geshoski 6ceb137f04 MDL-76445 gradereport_singleview: Usability fixes 2023-06-13 15:20:03 +08:00
Mihail Geshoski e60edbf0cb MDL-76445 gradereport_user: Usability fixes 2023-06-13 15:20:03 +08:00
Mihail Geshoski f057a2aef9 MDL-76445 grade: Helper that returns all gradable users in a course 2023-06-13 15:20:03 +08:00
Jake Dallimore f5e4dcf609 Merge branch 'MDL-73052-401' of https://github.com/sarjona/moodle into MOODLE_401_STABLE 2023-06-13 14:44:52 +08:00
Andrew Nicols a4cc94f3d0 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:06:20 +08:00
michaelkotlyar c893e3f9b8 MDL-76840 mod_assign: Account for extension when calculating time left. 2023-06-13 14:54:11 +12:00
Anupama Sarjoshi 6664e73599 MDL-78369 Multiple choice: Increase Choice and feedback boxes size 2023-06-12 12:02:21 +01:00
Jun Pataleta fcdad9f31c Merge branch 'MDL-75937-401' of https://github.com/stevandoMoodle/moodle into MOODLE_401_STABLE 2023-06-12 16:10:45 +08:00
Stevani Andolo f0211bbfb1 MDL-75937 admin: Fixed config data display inconsistency 2023-06-12 15:29:54 +08:00
Andrew Nicols 73a55b6268 Merge branch 'MDL-78297-401' of https://github.com/MartinGauk/moodle into MOODLE_401_STABLE 2023-06-12 10:19:43 +08:00
Paul Holden d9c8e2561e MDL-77224 mod_h5pactivity: clean up attempt data on activity deletion. 2023-06-11 18:37:13 +01:00
Paul Holden 99681d7df8 MDL-77993 mod_lesson: ensure report action menu always present. 2023-06-11 18:35:14 +01:00
Paul Holden 05074c1ca3 MDL-74824 user: fix custom change password URL in login notification. 2023-06-11 17:41:09 +01:00
Paul Holden 3215a7b190 MDL-78018 mod_assign: format group name in grading table. 2023-06-11 15:02:36 +01:00
Paul Holden afe9d11746 MDL-77542 mod_assign: remove duplicate grade heading from grader.
It's already part of the subsequent rendered form.
2023-06-11 15:01:35 +01:00
Paul Holden 9ed9a010d6 MDL-78172 mod_forum: ensure group names are correctly formatted. 2023-06-11 15:00:28 +01:00
Paul Holden eea061bc42 MDL-77569 reportbuilder: cache custom report element persistents.
During request lifecycle ensure that column, filter and condition
persistents are only loaded a single time to prevent additional
database reads.

Provide invalidation method, used by the report helpers, to ensure
that the persistents are re-loaded appropriately.

This is a backport of MDL-76901.

Co-authored-by: Marina Glancy <marina@moodle.com>
2023-06-08 10:00:19 +01:00
David Woloszyn 0596ff2d2b MDL-78237 editor_tiny: Prevent navbar obscuring modal content 2023-06-08 17:15:13 +10:00
David Woloszyn 2d677835ec MDL-78237 css: Make navbar height available for non sass-use 2023-06-08 17:15:13 +10:00
Martin Gauk 190db6962e MDL-78297 core: Less cache lookups in deprecated capabilities feature
Avoid use of $cache->has.
2023-06-07 12:04:36 +02:00
Sara Arjona 8caeea5c47 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:38 +02:00
Simey Lameze fc10598d63 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:42:35 +08:00
Andrew Nicols b67b10af29 MDL-69231 behat: Update tests to use new generator 2023-06-02 12:42:35 +08:00
Andrew Nicols c4cd52ce5a MDL-69231 tests: Add role capability setting generator 2023-06-02 12:42:35 +08:00
Andrew Nicols c49877c8f5 MDL-69231 tests: Improve existing role generator
Support definition of context levels and permissions.
2023-06-02 12:42:35 +08:00
Angelia Dela Cruz 948ac8f62b MDL-70152 behat: Forum behat generators use UI
Behat cleanup and optimisation
2023-05-29 10:28:04 +08:00
Angelia Dela Cruz d7752f9576 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:27:33 +08:00
Andrew Nicols c38a977f3d 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:27:33 +08:00
Meirza e076d036c2 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 13:56:50 +07:00
Meirza c6b52f6822 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 13:56:50 +07:00
Wehr Mario d7194d3de0 MDL-78004 cache: Fix deprecated null value in Redis connect 2023-05-26 13:22:35 +02:00
= 282a908540 MDL-63120 core_badges: Avoid multiple joins in sql statement 2023-05-24 13:36:41 +02:00
Andrew Nicols 1450dade43 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:58:07 +08:00
Jake Dallimore 75ba439f5b MDL-77990 enrol_lti: fix http_client shim by using curl getResponse
Fixes an error in the parsing of response headers containing multiple
HTTP responses in the raw response. Curl already handles this, so let
it do the work.
2023-05-05 10:44:19 +08:00
Jake Dallimore 159a131989 MDL-77990 enrol_lti: test covering the response header parsing
Makes sure the http_client shim properly returns the correct, final
http headers, not intermediate headers such as 302, 100 etc.
2023-05-05 10:44:18 +08:00
Miri Lipson a10f75360b MDL-75047 icons: Define the orientation of the question mark in right-to-left languages. 2023-01-23 17:26:45 +02:00
571 changed files with 8844 additions and 4899 deletions
+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);
@@ -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 |
@@ -376,19 +376,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);
}
}
}
}
@@ -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);
}
}
@@ -285,7 +285,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' => 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,15 +48,18 @@ 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;
/**
* Prepare the page for rendering.
*
*/
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
@@ -128,6 +128,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),
)
);
}
@@ -138,9 +139,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();
@@ -149,7 +151,8 @@ class core_backup_external extends external_api {
self::get_async_backup_links_backup_parameters(),
array(
'filename' => $filename,
'contextid' => $contextid
'contextid' => $contextid,
'backupid' => $backupid,
)
);
@@ -158,10 +161,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 the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_modules | Course | C1 | course-view-* | side-pre |
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
@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);
}
+27 -1
View File
@@ -272,8 +272,34 @@ class backpack_api2p1 {
$msg['status'] = \core\output\notification::NOTIFY_SUCCESS;
$msg['message'] = get_string('addedtobackpack', 'badges');
} else {
if ($response) {
// Although the specification defines that status error is a string, some providers, like Badgr, are wrongly
// returning an array. It has been reported, but adding these extra checks doesn't hurt, just in case.
if (
property_exists($response, 'status') &&
is_object($response->status) &&
property_exists($response->status, 'error')
) {
$statuserror = $response->status->error;
if (is_array($statuserror)) {
$statuserror = implode($statuserror);
}
} else if (property_exists($response, 'error')) {
$statuserror = $response->error;
if (property_exists($response, 'message')) {
$statuserror .= '. Message: ' . $response->message;
}
}
} else {
$statuserror = 'Empty response';
}
$data = [
'badgename' => $data['assertion']['badge']['name'],
'error' => $statuserror,
];
$msg['status'] = \core\output\notification::NOTIFY_ERROR;
$msg['message'] = get_string('backpackexporterror', 'badges', $data['assertion']['badge']['name']);
$msg['message'] = get_string('backpackexporterrorwithinfo', 'badges', $data);
}
return $msg;
}
+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 |
@@ -11,10 +11,12 @@ Feature: Edit activities in main menu block
| course | Acceptance test site |
| name | My forum name |
| idnumber | forum |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| site_main_menu | 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 "Main menu" block
When I set the field "Edit title" in the "My forum name" "block_site_main_menu > Activity" to "New forum name"
Then I should not see "My forum name"
And I should see "New forum name"
@@ -26,14 +28,16 @@ Feature: Edit activities in main menu block
Scenario: Activities in main menu block can be made available but not visible on a course page
Given the following config values are set as admin:
| allowstealth | 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| site_main_menu | System | 1 | site-index | side-post |
And the following "activities" exist:
| activity | course | section | name |
| forum | Acceptance test site | 0 | Visible forum |
| forum | Acceptance test site | 0 | My forum name |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Main menu" block
When I add a "Forum" to section "0" and I fill the form with:
| Forum name | Visible forum |
When I add a "Forum" to section "0" and I fill the form with:
| Forum name | My forum name |
And "My forum name" activity in site main menu block should have "Hide" editing icon
And "My forum name" activity in site main menu block should not have "Show" editing icon
And "My forum name" activity in site main menu block should not have "Make available" editing icon
@@ -19,12 +19,11 @@ Feature: Edit activities in social activities block
@javascript
Scenario: Edit name of activity in-place in social activities block
Given I log in as "user1"
Given the following "activities" exist:
| activity | course | name |
| forum | C1 | My forum name |
And I log in as "user1"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
And I set the field "Forum name" to "My forum name"
And I press "Save and return to course"
When I set the field "Edit title" in the "My forum name" "block_social_activities > Activity" to "New forum name"
Then I should not see "My forum name" in the "Social activities" "block"
And I should see "New forum name"
@@ -36,9 +35,11 @@ Feature: Edit activities in social activities block
Scenario: Activities in social activities block can be made available but not visible on a course page
Given the following config values are set as admin:
| allowstealth | 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| recent_activity | Course | C1 | course-view-* | side-pre |
And I log in as "user1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I press "Add an activity or resource"
And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
And I set the field "Forum name" to "My forum name"
@@ -75,8 +76,7 @@ Feature: Edit activities in social activities block
And "My forum name" activity in social activities block should be available but hidden from course page
And I log out
# Student will not see the module on the course page but can access it from other reports and blocks:
And I log in as "student1"
And I am on "Course 1" course homepage
And I should not see "My forum name" in the "Social activities" "block"
When I am on the "Course 1" course page logged in as student1
Then I should not see "My forum name" in the "Social activities" "block"
And I click on "My forum name" "link" in the "Recent activity" "block"
And I should see "My forum name" in the ".breadcrumb" "css_element"
+3 -2
View File
@@ -8,10 +8,11 @@ Feature: Block removal via modal
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | Course | C1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add the "Search forums" block
And "Search forums" "block" should exist
@javascript
Scenario: Removing a block via modal should remove the block on the page
@@ -11,12 +11,14 @@ Feature: Show hidden blocks in a docked block region when editing
And the following "course enrolments" exist:
| user | course | role |
| admin | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | Course | C1 | course-view-* | side-pre |
| news_items | Course | C1 | course-view-* | side-pre |
| calendar_upcoming | Course | C1 | course-view-* | side-pre |
| recent_activity | Course | C1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add the "Search forums" block
And I add the "Latest announcements" block
And I add the "Upcoming events" block
And I add the "Recent activity" block
# Hide all the blocks in the non-default region
And I configure the "Search forums" block
And I set the following fields to these values:
+5 -3
View File
@@ -8,18 +8,20 @@ Feature: Block visibility
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | Course | C1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Hiding all blocks on the page should remove the column they're in
Given I add the "Search forums" block
And I open the "Search forums" blocks action menu
When I open the "Search forums" blocks action menu
And I click on "Configure Search forums block" "link" in the "Search forums" "block"
And I set the field "Region" to "Right"
And I press "Save changes"
And I turn editing mode off
And ".empty-region-side-post" "css_element" should not exist in the "body" "css_element"
Then ".empty-region-side-post" "css_element" should not exist in the "body" "css_element"
And I turn editing mode on
And I open the "Search forums" blocks action menu
And I click on "Hide Search forums block" "link" in the "Search forums" "block"
+3 -1
View File
@@ -22,9 +22,11 @@ Feature: Block appearances
| book | Test book name |
| title | Book title |
| content | Book content test test |
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 turn editing mode on
And I add the "Comments" block
And I configure the "Comments" block
And I set the following fields to these values:
| Display on page types | Any page |
+3 -1
View File
@@ -22,9 +22,11 @@ Feature: Block region moving
| book | Test book name |
| title | Book title |
| content | Book content test test |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | 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 "Comments" block
And I configure the "Comments" block
And I set the following fields to these values:
| Display on page types | Any page |

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