Compare commits

..

382 Commits

Author SHA1 Message Date
Jun Pataleta 0fae900b58 Moodle release 4.0.7 2023-03-11 13:10:44 +08:00
Jun Pataleta 202cd371a1 weekly release 4.0.6+ 2023-03-10 22:09:56 +08:00
Jun Pataleta e60107a0d3 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-03-10 22:09:54 +08:00
Ilya Tregubov 1c6dcd21f9 Merge branch 'MDL-77429-400-fix' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-10 14:51:24 +08:00
Andrew Nicols 0be2c46692 MDL-77429 course: Change course date to previous day
When a test runs just after midnight, and the user time zone is not the
same as the server timezone, and the course is created using a generator
(which runs in server time zone) but the UI presented in the user
timezone, the course start time is still in the future.

We need to create the course a day earlier to ensure that the "This
week" indicator is in the correct day.
2023-03-10 14:11:23 +08:00
Andrew Nicols 4027a6f9fb MDL-77037 core_course: Add new courseindex test to classic excludelist 2023-03-10 13:32:15 +08:00
Jun Pataleta 2fc493dd9f Merge branch 'MDL-77458-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-10 12:06:03 +08:00
Jake Dallimore 25f8ff2446 Merge branch 'MDL-77517-400' of https://github.com/juancs/moodle into MOODLE_400_STABLE 2023-03-10 11:41:11 +08:00
Andrew Nicols 4287b7acd9 Merge branch 'MDL-77530-tool-task-checks-MOODLE_400_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_400_STABLE 2023-03-10 11:31:10 +08:00
Jake Dallimore a18d42a1bb Merge branch 'MDL-77219-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-03-10 10:36:45 +08:00
Jun Pataleta baabc32443 Merge branch 'MDL-76603-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-03-10 10:14:49 +08:00
Shamim Rezaie 05d383cdff MDL-76603 gradingforms: Some A11y fixes on editing form
- Use span instead of dummy input elements because form elements need a
  label
- Sufficient size for target is at least 24px by 24px (Success Criteria
  2.5.8)
2023-03-10 10:11:25 +08:00
Shamim Rezaie d6087552d0 MDL-76603 mod_assign: Move advanced grading grades out of the tables 2023-03-10 10:11:25 +08:00
Shamim Rezaie 27c9eb38a0 MDL-76603 gradingform_rubric: preserve bg colour on hover 2023-03-10 10:11:25 +08:00
Shamim Rezaie ea697ca8a0 MDL-76603 gradingform_rubric: fix roles
- set the role of table to none
- moved aria-label from <table> element (that doesn't has role="none")
  to the element that has the radiogroup role
- if it's not radiogroup/radio, it is list/listitem
- removed aria-label from the rubric table and used caption instead
2023-03-10 10:11:25 +08:00
Andrew Nicols 5ba62ce7ae Merge branch 'MDL-76849-400-5' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-03-10 09:29:56 +08:00
Jun Pataleta e851069e97 Merge branch 'MDL-70613-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-10 09:19:33 +08:00
Sara Arjona c231b4ff1b Merge branch 'MDL-77323-400' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_400_STABLE 2023-03-09 16:49:42 +01:00
Paul Holden 72f985e956 MDL-70613 mod_feedback: cast feedback text values for table sorting.
Specifically avoids Oracle ORA-00932 (inconsistent CLOB datatype).
2023-03-09 14:59:16 +00:00
Andrew Nicols 8284e13413 Merge branch 'MDL-77329-400-clr' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-03-09 22:19:25 +08:00
Andrew Nicols 0919443d33 Merge branch 'MDL-77429-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-09 22:11:28 +08:00
Andrew Nicols cdca553678 Merge branch 'MDL-77463-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-09 22:04:05 +08:00
Andrew Nicols aeef022c1c MDL-77037 core_course: Coding style fix in Behat feature 2023-03-09 22:00:00 +08:00
Andrew Nicols 2d3d946eef Merge branch 'MDL-77037-400' of https://github.com/laurentdavid/moodle into MOODLE_400_STABLE 2023-03-09 21:59:56 +08:00
James C fc4a4e6450 MDL-77329 course: Prevent collapse state loss 2023-03-09 12:01:27 +01:00
Sara Arjona abff12eda1 Merge branch 'MDL-76940-400' of https://github.com/laurentdavid/moodle into MOODLE_400_STABLE 2023-03-09 10:54:57 +01:00
Jun Pataleta 2570c08460 Merge branch 'MDL-77533-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-09 16:35:10 +08:00
Jun Pataleta b19ed507d1 Merge branch 'MDL-77559-400-2' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-09 15:53:34 +08:00
Laurent David e5f40a62d4 MDL-77037 core_courseformat: Refresh course index
* Refresh course index when language change
2023-03-09 08:44:28 +01:00
Brendan Heywood e3356e2a5a MDL-77530 tool_task: Fix coding errors in checks 2023-03-09 15:43:28 +11:00
Andrew Nicols 353b25f991 Merge branch 'MDL-77420-400' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-03-09 12:01:41 +08:00
Andrew Nicols f91555d94e Merge branch 'MDL-77014-400' of https://github.com/lucaboesch/moodle into MOODLE_400_STABLE 2023-03-09 11:42:16 +08:00
Andrew Nicols 8cba18bd0d Merge branch '76945-bootstrap-dropdowns-400' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_400_STABLE 2023-03-09 10:54:17 +08:00
Tim Hunt 5022583eec MDL-77467 retore: add progress tracking to potentially slow steps 2023-03-09 10:47:05 +08:00
Jun Pataleta c6abd93efb Merge branch 'MDL-77225_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-09 10:42:53 +08:00
Andrew Nicols 9893e93761 Merge branch 'MDL-77418-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-09 10:37:40 +08:00
Andrew Nicols af4fae4f5b Merge branch 'MOODLE_400_STABLE' of https://github.com/fcbsd/moodle into MOODLE_400_STABLE 2023-03-09 10:29:58 +08:00
Andrew Nicols 1bfc8f2097 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Jun Pataleta aa7d3faddb MDL-76849 qtype_essay: Allow question number inclusion in answer fields
* Have the following classes extend qtype_essay_format_renderer_base
  as they have been meant to:
  - qtype_essay_format_editor_renderer
  - qtype_essay_format_noinline_renderer
  - qtype_essay_format_plain_renderer
* Add a question_display_options instance variable for
qtype_essay_format_renderer_base so its subclasses can use it to
generate the label for their respective answer fields.
2023-03-09 08:58:52 +08:00
Jun Pataleta 05e3716ffe MDL-76849 qtype_shortanswer: Include question number in answer fields 2023-03-09 08:58:52 +08:00
Jun Pataleta f6c5e15bdf MDL-76849 qtype_numerical: Include question number in answer fields
* Also covers its qtype_calculated and qtype_calculatedsimple
which extend its renderer class
2023-03-09 08:58:52 +08:00
Jun Pataleta 9ba9723826 MDL-76849 qtype_multianswer: Include question number in answer fields
* Add the question number to the answer fields if it's available.
* Improve multiple choice question accessibility:
  - Label the multiple choice question groups appropriately by
    enclosing them in fieldset tags and applying sr-only legend tags to
    label them.
  - Apply Bootstrap form-check classes to the radio buttons, so they
    are rendered better and become responsive as well. This also helps
    avoid the use of the table element for layout purposes when
    rendering horizontal multiple choice sub-questions.
2023-03-09 08:58:52 +08:00
Jun Pataleta 716c223db5 MDL-76849 qtype_match: Include question number in answer fields 2023-03-09 08:58:52 +08:00
Jun Pataleta 8c6dbf8561 MDL-76849 qtype_truefalse: Include question number in answer fields
* Improve accessibility as well by grouping the radio buttons
in a fieldset.
2023-03-09 08:58:52 +08:00
Jun Pataleta fd13110bd4 MDL-76849 qtype_multichoice: Include question number in answer fields
* Improve accessibility as well by grouping the radio buttons/checkboxes
in a fieldset.
2023-03-09 08:58:52 +08:00
Jun Pataleta 2a5c62ab88 MDL-76849 qtype_ddwtos: Include question number in answer fields
* Plus include the item number so users will have an idea which blank
numbers they are currently on.
2023-03-09 08:58:52 +08:00
Jun Pataleta bad9e0a1bc MDL-76849 qtype_gapselect: Include question number in answer fields 2023-03-09 08:58:52 +08:00
Jun Pataleta b71d30097e MDL-76849 qtype: Add a questionidentifier instance variable
* Add an instance variable to question_display_options to store the
identifier associated with the question being rendered.
* This information can be used by question type plugins to improve the
accessibility of the answer fields being rendered by adding the
question identifier to the answer fields' labels.
* Adding the question identifier to the label can be achieved by using
question_display_options::add_question_identifier_to_label().

Co-authored-by: Tim Hunt <t.j.hunt@open.ac.uk>
2023-03-09 08:58:52 +08:00
Andrew Nicols 1852ad42b5 MDL-77559 js: Revert "MDL-75012 core: Bump NodeJS version requirements"
This reverts commit 7dc9c54ff6.
2023-03-09 08:21:36 +08:00
Andrew Nicols 3a0b800be7 MDL-77559 js: Revert "MDL-75012 js: Bump standard dependencies"
This reverts commit 86cc29f021.
2023-03-09 08:21:22 +08:00
Andrew Nicols 9e7a6d1c79 MDL-77559 js: Revert "MDL-75012 js: Remove grunt-contrib-uglify"
This reverts commit 415c9de634.
2023-03-09 08:21:19 +08:00
Andrew Nicols 7553895409 MDL-77559 js: Revert "MDL-75012 js: Bump stylelint and components"
This reverts commit e431f3a4d6.
2023-03-09 08:21:16 +08:00
Andrew Nicols 80a06b2966 MDL-77559 js: Revert "MDL-75012 js: Update browserslist"
This reverts commit a1d646d621.
2023-03-09 08:21:12 +08:00
Andrew Nicols e9e77f32e9 MDL-77559 js: Revert "MDL-75012 js: Bump node-sass"
This reverts commit d418ca209e.
2023-03-09 08:21:07 +08:00
Andrew Nicols c3097aab8c MDL-77559 js: Revert "MDL-75012 js: Audit fix"
This reverts commit 73d25ec0c6.
2023-03-09 08:21:03 +08:00
Andrew Nicols 290a7cffea MDL-77559 js: Revert "MDL-75012 js: Use our own jsdoc wrapper"
This reverts commit b7c2924b68.
2023-03-09 08:20:57 +08:00
Andrew Nicols 92b235d31b MDL-77559 js: Revert "MDL-75012 js: Bump shifter to new version"
This reverts commit 95b47d2432.
2023-03-09 08:20:53 +08:00
Andrew Nicols 9ea97cc350 MDL-77559 js: Revert "MDL-75012 js: Put shifter on a diet"
This reverts commit 77d822898a.
2023-03-09 08:20:49 +08:00
Andrew Nicols 62ed5dfd27 MDL-77559 js: Revert "MDL-75012 js: Remove unused babel-preset-minify dependency"
This reverts commit 8412495f5e.
2023-03-09 08:20:45 +08:00
Andrew Nicols dcabe38876 MDL-77559 js: Revert "MDL-75012 js: Bump Babel dependencies"
This reverts commit c90054e98e.
2023-03-09 08:20:42 +08:00
Andrew Nicols 3c05e673a3 MDL-77559 js: Revert "MDL-75012 js: Remove orphaned source maps"
This reverts commit 181e8f7686.
2023-03-09 08:20:09 +08:00
AMOS bot 1fd4f4b11b Automatically generated installer lang files 2023-03-09 00:07:38 +00:00
Tim Hunt f5645cf4a8 MDL-77225 questions: fix regrade of descriptions in finished attempts
The added logic is similar to the logic in other behaviours, and the new test fails without it.
2023-03-08 19:01:05 +00:00
Sara Arjona 4555270cfc Merge branch 'MDL-77464_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-08 16:14:53 +01:00
Laurent David a49c1483aa MDL-76940 core_courseformat: Index refreshing when role switch
* Hidden sections and content should not visible to students when switching role
2023-03-08 11:51:34 +01:00
Ilya Tregubov 7601dd8b7b Merge branch 'MDL-77414-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-08 17:05:46 +08:00
Angelia Dela Cruz a50c324721 MDL-77463 Behat: Coverage for assign submission notification to teacher 2023-03-08 17:03:53 +08:00
Angelia Dela Cruz 1885fd9a2f MDL-77429 Behat: Add coverage for changing course format as teacher 2023-03-08 15:49:32 +08:00
Luca Bösch 655cae8cc4 MDL-77014 course: Single activity format course title multilang. 2023-03-08 08:27:36 +01:00
Angelia Dela Cruz aacd3761aa MDL-77414 Behat: Coverage for "Require all group members submit" setting 2023-03-08 14:51:47 +08:00
Sara Arjona ff437575bc Merge branch 'MDL-77440_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-08 07:24:35 +01:00
Jun Pataleta c57bb0107c Merge branch 'MDL-77472-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-08 11:53:34 +08:00
Petr Skoda f057226154 MDL-77524 filter_algebra: fix error message 2023-03-08 11:27:13 +08:00
Paul Holden b946c528b0 MDL-75517 report_participation: filter report by viewable roles only. 2023-03-08 10:38:02 +08:00
Michael Hawkins e835233465 MDL-77204 mod_wiki: Clean filename in Moodle1 backup 2023-03-08 10:33:57 +08:00
Paul Holden 724c4fa373 MDL-77046 availability: validate profile field in condition. 2023-03-08 10:24:26 +08:00
Paul Holden 1bb6bd7381 MDL-76809 gradereport_history: pre-filter report userids filter.
Ensure current user is able to access each of the provided userids.
2023-03-08 10:01:08 +08:00
Ilya Tregubov 1cd3788793 Merge branch 'MDL-77446-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-08 09:19:27 +08:00
Petr Skoda 1d23929fa9 MDL-76645 filter_data: fix link title attribute 2023-03-08 00:55:19 +00:00
Paul Holden 586168df7c MDL-77129 tool_lp: remove redundant call to set page header. 2023-03-08 00:55:19 +00:00
Lars Bonczek e52133c631 MDL-75659 core: Don't render component argument twice in mustache pix helper 2023-03-08 00:55:19 +00:00
Jun Pataleta baca8dd626 Merge branch 'MDL-77416-400-enfix' of https://github.com/vmdef/moodle into MOODLE_400_STABLE 2023-03-08 08:50:16 +08:00
AMOS bot f0817b2e97 Automatically generated installer lang files 2023-03-08 00:07:40 +00:00
Tim Hunt 1397ce352a MDL-77464 questions: regrading was losing question_attempt metadata
This is very similar to MDL-77090, but at the time, I missed that this
also needed to be handled. (Question metadata is, I think, only used
by the quiz 'Try another question like this one' feature.)
2023-03-07 13:43:12 +00:00
Tim Hunt 33e98afe3c MDL-77464 questions: update comments in question_attempt_step
The class comment had some inaccuracies which I fixed.
I also replaced all uses of @link with @see.
2023-03-07 13:42:59 +00:00
Sara Arjona c11c5d26cd MDL-77219 behat: Fix issue with headless
Although the error in the "I check that I can import recordings into
the Recording activity and then if I delete them" scenario is unrelated
to this patch, this commit needs to be applied too, in order to avoid
behat failures (because the "Import recording links" button is in the
edge of the window).

This is a backport of MDL-74272.
2023-03-07 11:04:13 +01:00
Sara Arjona 6703d67439 MDL-77219 theme_boost: Remove plugin name on course page
In 4.0, the plugin name was added above their name. Based on the community
feedback and the research done by the UX team, this needs to be removed.
This commit removes the activity name when edit mode is disabled.

This is a backport of MDL-74272.
2023-03-07 11:04:12 +01:00
Angelia Dela Cruz 277c0ffc0d MDL-77446 Behat: Add coverage for changing uploaded file details 2023-03-07 16:13:26 +08:00
Andrew Nicols 6436f1532d Merge branch 'MDL-77094_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-07 12:23:24 +08:00
Andrew Nicols 95a95a80b0 Merge branch 'MDL-77336-400' of https://github.com/meirzamoodle/moodle into MOODLE_400_STABLE 2023-03-07 12:02:22 +08:00
AMOS bot ebe39a84db Automatically generated installer lang files 2023-03-07 00:07:38 +00:00
Tim Hunt 5c261335c7 MDL-77440 quiz: fix nav error reviewing after redoing a question 2023-03-06 16:17:30 +00:00
Sara Arjona 6b4edc0068 Merge branch 'MDL-77460-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-03-06 16:34:08 +01:00
Paul Holden 3fc4c17115 MDL-77472 grade: correct URL param type for adding tracking params. 2023-03-06 09:50:03 +00:00
Meirza 4a0793d898 MDL-77336 admin: fix typo in adminpreset data settings. 2023-03-06 16:46:54 +07:00
Paul Holden 91178b70f5 MDL-77533 customfield: fix exception thrown during handler retrieval. 2023-03-06 09:27:21 +00:00
Juan Segarra Montesinos 04bb96886d MDL-77517 js: Disable "Edit mode" button when clicked
When clicked, disable the "Edit mode" button just before doing a
redirection. It's been reported that after clicling several times the
button, an inconsistent state between the button and the editing mode is
achieved. The patch mitigates the issue.
2023-03-05 07:06:24 +01:00
Víctor Déniz 1eeb10cf08 MDL-77416 lang: Use fixed strings in tests 2023-03-03 13:21:02 +00:00
Helen Foster 201e5c1103 MDL-77416 lang: Import fixed English strings (en_fix) 2023-03-03 13:21:02 +00:00
Jun Pataleta 1635a0f1b0 Merge branch 'MDL-77428-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-03 16:34:58 +08:00
Jun Pataleta 3ca56cb7f1 MDL-76849 question: New lang strings for answer fields 2023-03-03 15:32:45 +08:00
Jake Dallimore 62cfa26cb9 weekly release 4.0.6+ 2023-03-03 11:08:39 +08:00
Jake Dallimore b890f223e4 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-03-03 11:08:36 +08:00
Andrew Nicols e2eb63f1d9 MDL-77458 core: Add supported php version info to phpcs config 2023-03-02 20:37:52 +08:00
Simey Lameze fc5eba83d2 MDL-77460 behat: improve roles.feature test 2023-03-02 18:25:22 +08:00
Angelia Dela Cruz 51a25fac44 MDL-77428 Behat: Add coverage for forum post word count 2023-03-02 13:47:25 +08:00
Jun Pataleta 181e8f7686 MDL-75012 js: Remove orphaned source maps 2023-03-02 13:13:42 +08:00
Jun Pataleta f5f3457173 Merge branch 'MDL-75012-400-5' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-02 12:28:05 +08:00
Andrew Nicols 58f411d2f1 MDL-75012 js: Full build of all grunt things 2023-03-02 12:15:25 +08:00
Andrew Nicols c90054e98e MDL-75012 js: Bump Babel dependencies
Please note that whilst some dependencies have higher versions
available, these are not compatible at this time.
2023-03-02 12:15:25 +08:00
Andrew Nicols 8412495f5e MDL-75012 js: Remove unused babel-preset-minify dependency 2023-03-02 12:15:25 +08:00
Jun Pataleta 2382d6188e Merge branch 'MDL-75719-400-4' of https://github.com/ilyatregubov/moodle into MOODLE_400_STABLE 2023-03-02 11:59:19 +08:00
Jake Dallimore 3f5d3f8952 Merge branch 'MDL-77461-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-03-02 11:42:55 +08:00
Paul Holden 7278c5f5b4 MDL-77368 forms: remove console logging of upload DOM element. 2023-03-02 11:20:09 +08:00
Andrew Nicols 0d08af8de6 MDL-77461 behat: Use get_course_id instead of DB fetch 2023-03-02 11:06:53 +08:00
Ilya Tregubov 8585a70700 MDL-75719 completion: Add Behat scenario for completion states. 2023-03-02 11:05:31 +08:00
Ilya Tregubov 62d0d76fe1 MDL-75719 completion: Fix unit tests and Behat tests.
Fix tests since we changed behavior of completions (completion
state an UI).
2023-03-02 11:05:30 +08:00
Ilya Tregubov 710fa8ed7a MDL-75719 completion: Fix viewed criteria.
When we unlock completion criteria and save changes 'viewed' criteria
still should be completed if user has viewed activity before. Seems
that that was broken by recent changes. Fixing here.
2023-03-02 11:05:30 +08:00
Ilya Tregubov 64efaed528 MDL-75719 completion: Fix completion state for hidden grade items.
For hidden grade items we used to mark students as completed if
they have any grade. But this was not working correctly when we
also set pass grade for activity and completion criteria based
on pass grade. So we will have these completion states

Competion criteria 'Receive grade':
No grade - COMPLETION_INCOMPLETE
Grade visible, achieved passing grade - COMPLETION_COMPLETE_PASS
Grade visible, failed passing grade - COMPLETION_COMPLETE_FAIL
Grade hidden - COMPLETION_COMPLETE

Completion criteris 'Receive passing grade'
No grade - COMPLETION_INCOMPLETE
Grade visible, achieved passing grade - COMPLETION_COMPLETE_PASS
Grade visible, failed passing grade - COMPLETION_COMPLETE_FAIL
Grade hidden, achieved passing grade - COMPLETION_COMPLETE_PASS
Grade hidden, failed passing grade - COMPLETION_COMPLETE_FAIL_HIDDEN
2023-03-02 11:05:30 +08:00
Jake Dallimore 9de063d19b Merge branch 'MDL-77318-400' of https://github.com/Utdanningsdirektoratet/moodle into MOODLE_400_STABLE 2023-03-02 10:56:15 +08:00
Andrew Nicols dd651bfe75 Merge branch 'MDL-77150-400' of https://github.com/roland04/moodle into MOODLE_400_STABLE 2023-03-02 10:49:02 +08:00
Andrew Nicols a3984be80b Merge branch 'MDL-75534-400-forum-usermodified-zero' of https://github.com/mudrd8mz/moodle into MOODLE_400_STABLE 2023-03-02 10:39:07 +08:00
Jake Dallimore 926a143dd6 Merge branch 'MDL-76298_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-02 10:13:23 +08:00
Jun Pataleta c5a99daa0c Merge branch 'MDL-77413-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-03-02 09:45:48 +08:00
Andrew Nicols 1ceb4e2691 Merge branch 'MDL-77391-m400' of https://github.com/jrchamp/moodle into MOODLE_400_STABLE 2023-03-02 09:27:17 +08:00
Andrew Nicols d46f7f29ce Merge branch 'MDL-77321-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-02 09:25:16 +08:00
Jun Pataleta 8d2296ef33 Merge branch 'MDL-74586-400-sqlrss' of https://github.com/mudrd8mz/moodle into MOODLE_400_STABLE 2023-03-02 08:58:15 +08:00
Jun Pataleta b961e519cf Merge branch 'MDL-76938_restore_comments_400' of https://github.com/davosmith/moodle into MOODLE_400_STABLE 2023-03-02 08:41:37 +08:00
AMOS bot 7995a6a7c9 Automatically generated installer lang files 2023-03-02 00:07:43 +00:00
fcbsd fc1adc914c MDL-77365 count_words: Make span> an inline tag MOODLE_400_STABLE 2023-03-01 16:05:24 +00:00
Jun Pataleta 5003c32dd2 Merge branch 'MDL-77417_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-03-01 23:54:09 +08:00
Mikel Martín 3bb68aefc0 MDL-77150 core_table: Fix classes added as columnsattributes are ignored
Fix columnattributes with key 'class' being ingored by adding them to every 'column_class'.
2023-03-01 11:16:23 +01:00
hieuvu 8304ad73a7 MDL-77323 question: Prevent drag item sent into two drop zone 2023-03-01 14:46:40 +07:00
Andrew Nicols 146441bf58 Merge branch 'MDL-58945_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-03-01 10:55:49 +08:00
Andrew Nicols e3264a1ebc Merge branch 'MDL-74585-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-01 10:52:07 +08:00
Andrew Nicols 960a32b2ae Merge branch 'MDL-77322_basicauth_checkbox-400' of https://github.com/leonstr/moodle into MOODLE_400_STABLE 2023-03-01 10:50:02 +08:00
Andrew Nicols 0082649a28 Merge branch 'MDL-72727-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-03-01 10:47:16 +08:00
AMOS bot 6e9ff0e536 Automatically generated installer lang files 2023-03-01 00:07:36 +00:00
Jonathan Champ 0e23d91ec3 MDL-77391 question admin: further improve query peformance in qtypes.php 2023-02-28 10:18:46 -05:00
Andrew Nicols a9cc05c9fd Merge branch 'MDL-77097_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-02-28 22:14:03 +08:00
David Mudrák 06d446aec1 MDL-74586 rss: Make rss_get_userid_from_token() use table index
Due to missing `AND k.script = 'rss'` condition, the query did not make
use of the existing script-value compound index defined for the table.
So it had to perform the full sequential scan for all rows when
searching for the token. This had serious performance issues on sites
with many users, especially in case on non-existing token / key.
2023-02-28 13:26:12 +01:00
Angelia Dela Cruz bef92dfbdc MDL-77413 Behat: Minor changes to optimise the existing tests 2023-02-28 17:23:58 +08:00
Angelia Dela Cruz 63a788899f MDL-77413 Behat: Add coverage to verify groups can have a picture 2023-02-28 17:23:40 +08:00
Jun Pataleta f5f57ba477 Merge branch 'MDL-77248-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-02-28 15:46:43 +08:00
Andrew Nicols 13a1d1d661 MDL-77248 mod_bigbluebuttonbn: Remove unused dpa pages 2023-02-28 12:04:51 +08:00
Andrew Nicols 223cdb0ed9 MDL-77248 mod_bigbluebuttonbn: Set dpa accepted when creating activities
This only applies when creating activities using the test data
generator.
2023-02-28 12:04:51 +08:00
Andrew Nicols c3f0e5ddaa MDL-77248 core: Move pre_enable_plugin_actions callback to enable_plugin 2023-02-28 12:04:51 +08:00
Andrew Nicols 77d822898a MDL-75012 js: Put shifter on a diet
This commit switches to a new custom version of Shifter which sees it
put on a massive diet.

Many of the standard Shifter features are totally unused by Moodle, but
they add dependency spaghetti. Some of those dependencies will start to
cause us issues as they have not been updated for a very long time, are
no longer maintained, and are no longer compatible with anything
resembling a recent version of NodeJS.
2023-02-28 10:22:45 +08:00
Andrew Nicols 95b47d2432 MDL-75012 js: Bump shifter to new version
This resolves an issue identified in 77083 which identified that GitHub
hashes shouldn't be treated as repeatable.

Whilst GitHub have reverted this change, it's still worth making this
change.
2023-02-28 10:19:51 +08:00
Andrew Nicols b7c2924b68 MDL-75012 js: Use our own jsdoc wrapper
grunt-jsdoc is abandoned and only works with an older version of jsdoc.

This is a very simple wrapper around jsdoc itself.
2023-02-28 10:19:51 +08:00
Andrew Nicols 73d25ec0c6 MDL-75012 js: Audit fix 2023-02-28 10:19:51 +08:00
Andrew Nicols d418ca209e MDL-75012 js: Bump node-sass 2023-02-28 10:19:51 +08:00
Andrew Nicols a1d646d621 MDL-75012 js: Update browserslist
To avoid build changes we exclude older versions of Android browser
2023-02-28 10:19:51 +08:00
Andrew Nicols e431f3a4d6 MDL-75012 js: Bump stylelint and components 2023-02-28 10:19:50 +08:00
Andrew Nicols 415c9de634 MDL-75012 js: Remove grunt-contrib-uglify
We stopped using this when we updated our processes to support ESMs in
MDL-62497. Removal of the dependency was missed at the time.
2023-02-28 10:19:50 +08:00
Andrew Nicols 86cc29f021 MDL-75012 js: Bump standard dependencies
This change bumps dependencies which have no impact upon the build
process
2023-02-28 10:19:50 +08:00
Andrew Nicols 7dc9c54ff6 MDL-75012 core: Bump NodeJS version requirements 2023-02-28 10:19:50 +08:00
Jun Pataleta 4200e6ee16 Merge branch 'MDL-76956-m400' of https://github.com/sammarshallou/moodle into MOODLE_400_STABLE 2023-02-28 10:07:27 +08:00
Paul Holden 8ce95fe759 MDL-72727 mod_forum: prevent default favourite toggle click event.
Allow the repository call to the web service method to complete before
re-directing, otherwise the call may not complete and/or races against
the page reload causing random Behat errors.
2023-02-27 23:30:40 +00:00
Paul Holden b60518501f MDL-77321 reportbuilder: cache list of loaded reports per user.
Since 0188af39 we've cached loaded reports, however there was an
edge case in those report sources that relied on the current user
as part of their own initialization (e.g. checking capabilities).

Co-authored-by: Marina Glancy <marina@moodle.com>
2023-02-27 21:21:45 +00:00
Paul Holden 3178dd5bb2 MDL-77418 mod_feedback: defensive use of analysis item data. 2023-02-27 19:21:33 +00:00
Ferran Recio e8bbcdae2c MDL-77420 core: fix modal close button on remove on close 2023-02-27 19:11:03 +01:00
Eloy Lafuente (stronk7) 0b6625e736 MDL-77417 behat: behat_error_handler meets deprecation error types
Right now, any E_DEPRECATED, E_USER_DEPRECATED error type leads
to exception in behat runs, because the behat error handled is
not aware of them. See MDL-38041 for the initial implementation.

We don't want that to happen and they must behave like other "low"
error types (notices, warnings...), that will be reported in logs
or output, but won't trigger any exception, so the test can continue.

This commit just adds those 2 "new" error types to the handler,
providing the very same behaviour for them than the rest.
2023-02-27 09:38:08 +01:00
Leon Stringer 079a2e0061 MDL-77322 oauth2: Fix basicauth checkbox
Following MDL-61880 you could turn on "Authenticate token requests via
HTTP headers" but not turn this off again.  This change fixes this and
adds a Behat scenario to test toggling this checkbox is saved
correctly.
2023-02-24 17:28:05 +00:00
Eloy Lafuente (stronk7) c0786c11c0 MDL-77097 store_mongodb: keep compatibility with PHP 7.4
Replaced 4 occurrences of get_debug_type() by gettype() to keep PHP 7.4 compatibility. Note this
has not been applied to 4.2dev and up because, there, it's safe to use get_debug_type().
2023-02-24 12:38:55 +01:00
Jun Pataleta 6458658400 weekly release 4.0.6+ 2023-02-24 15:43:29 +08:00
Jun Pataleta c3c22e7219 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-02-24 15:43:26 +08:00
Matt Porritt d38a0b2100 MDL-77376 Licensing: Update trademark.txt
Update Trademark policy in TRADEMARK.txt to
be in line with advice from the Moodle HQ
legal team
2023-02-24 12:35:35 +08:00
Andrew Nicols 2cde600dd2 Merge branch 'MDL-76611-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-23 12:01:42 +08:00
Andrew Nicols ce4622ec99 Merge branch 'MDL-76843_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-23 11:53:26 +08:00
Andrew Nicols 8c455b4ad6 Merge branch 'MDL-77271-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-02-23 11:49:36 +08:00
Ilya Tregubov fd5559e3d4 MDL-74433 mod_assign: Fix version.php 2023-02-23 11:47:35 +08:00
Ilya Tregubov acc02e0631 Merge branch 'MDL-74433_400' of https://github.com/larsbonczek/moodle into MOODLE_400_STABLE 2023-02-23 11:23:00 +08:00
Andrew Nicols e6ff8205f9 Merge branch 'MDL-77352-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-23 11:20:30 +08:00
Andrew Nicols c5c621dfce Merge branch 'MDL-75005_40' of https://github.com/skodak/moodle into MOODLE_400_STABLE 2023-02-23 10:29:41 +08:00
Andrew Nicols 6df8e613be MDL-77230 mod_feedback: Coding style violation fixes 2023-02-23 10:06:19 +08:00
Andrew Nicols 484516b450 Merge branch 'MDL-77230-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-02-23 10:06:16 +08:00
Ilya Tregubov 8d68d6c050 Merge branch 'MDL-76873-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-23 09:58:31 +08:00
Andrew Nicols 4a1e1081a5 Merge branch 'MDL-77210_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-23 09:23:07 +08:00
Andrew Nicols 72342d4c08 Merge branch 'MDL-77149-m400' of https://github.com/sammarshallou/moodle into MOODLE_400_STABLE 2023-02-23 09:21:32 +08:00
Paul Holden 6f91919237 MDL-74585 core: pass string identifier/component to network keepalive.
Avoid passing potentially large amounts of data in the page AMD call,
allow the `core/network` module to load actual string content itself.
2023-02-22 16:20:41 +00:00
Tim Hunt 467d99b7bb MDL-76843 quiz: add test to verify random essay stats now work 2023-02-22 15:12:03 +00:00
Tim Hunt 2580e7d399 MDL-76843 quiz: fix statistics questions for missing questions 2023-02-22 15:11:56 +00:00
Tim Hunt 89e2da51c9 MDL-76843 questions behat: enhancements requried to test this issue
* New steps to set up certian sorts of broken test data.
* Fix qtype_essay_question::un_summarise_response().
2023-02-22 15:10:23 +00:00
Tim Hunt 7ab289879a MDL-76298 drag-drop questions: validate the questions are complete
Previously, it was possible to create drag-drop markers and onto image
questions without any drag items or drop zones. This was non-sensical,
and broke statistics calculations.

So, missing validation added, and random guess score calculation made
robust.
2023-02-22 12:06:56 +00:00
Tim Hunt a15668409e MDL-58945 qbank: showing q text should give option of plain or full 2023-02-22 11:16:58 +00:00
Paul Holden 8c2b43f133 MDL-77352 javascript: declare debouncer outside the event handler.
It needs to be declared as such, otherwise each time the event is
triggered a new debouncer is created.
2023-02-21 22:47:58 +00:00
Paul Holden cdf532cf84 MDL-76602 mod_lti: array syntax/whitespace cleanup. 2023-02-21 17:10:22 +00:00
Paul Holden 2f794ccb3d Merge branch 'MDL-76602-400-lti13claims' of https://github.com/cengage/moodle into MOODLE_400_STABLE 2023-02-21 16:46:26 +00:00
sam marshall 3130c83f02 MDL-77149 core_files: Network filesystem (Amazon EFS) can warn
If you delete a file with a hash and then create another file with
the same hash, sometimes on EFS filesystems while trying to create
the new file, it returns true to the file_exists check even though
the file doesn't exist, but then fails other calls.

This change makes Moodle tolerate that behaviour.
2023-02-21 10:56:25 +00:00
Simey Lameze fcedef4566 MDL-77271 behat: verify user licence preference is remembered 2023-02-21 15:29:44 +08:00
AMOS bot d13319f328 Automatically generated installer lang files 2023-02-21 00:07:34 +00:00
Paul Holden f244de5a77 Merge branch 'MDL-76545-400' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-02-20 10:28:54 +00:00
Paul Holden 98c8165f6a Merge branch 'MDL-77287-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2023-02-20 09:55:09 +00:00
Audun Jørstad Lillekjendlie 4ccd18f6be MDL-77318 core: Add role attribute to user navigation div 2023-02-20 10:54:58 +01:00
Paul Holden e99051aabd MDL-76873 user: method for returning profile field instance of type.
Re-factor implementation of profile field access within user fields
class to use that already provided by the fields themselves.
2023-02-20 09:24:17 +00:00
Paul Holden 0e6bc44970 MDL-76873 reportbuilder: correct checks for profile field visibility. 2023-02-20 09:22:14 +00:00
Andrew Nicols 49af8b6508 Merge branch 'MDL-77020-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-20 09:55:18 +08:00
Ferran Recio e2e6e1407f MDL-76545 core: fix reactive debug panel
The reactive debug panel stops working when a new reactive instance is
created in the fly. This was not detected until the new dragf and drop
files into course uses a second reactive UI component in the same page.
2023-02-17 17:19:16 +01:00
Sara Arjona a47f28ee75 MDL-77230 mod_feedback: Validate feedback access
The get_items() and get_page_items() external methods should return
items only when the user has access. Otherwise, empty array for items
will be returned, with the exact error in the warnings parameter.
2023-02-17 12:43:33 +01:00
Petr Skoda 2f15514fa4 MDL-75005 core: remove invalid addslashes() 2023-02-17 09:49:45 +01:00
Jake Dallimore 831f0cf6ce MDL-77287 tool_oauth2: fix issuer form validation
This ensures validation errors from the issuer persistent are seen.
2023-02-17 15:16:11 +08:00
Ilya Tregubov cb2fa7a92d weekly release 4.0.6+ 2023-02-17 09:12:27 +08:00
Ilya Tregubov 1517a26b7e Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-02-17 09:12:24 +08:00
AMOS bot 41bd934db1 Automatically generated installer lang files 2023-02-17 00:07:47 +00:00
Paul Holden 162dfaaf85 MDL-77020 behat: refer to search input fields by name/role.
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-02-16 10:34:50 +00:00
Audun Jørstad Lillekjendlie e8cc15ecaa MDL-77020 core: Include a unique id in the search input field id 2023-02-16 10:24:45 +00:00
Andrew Nicols 31b6436f90 Merge branch 'MDL-75578-400' of https://github.com/mackensen/moodle into MOODLE_400_STABLE 2023-02-16 12:01:43 +08:00
Jun Pataleta 5a81c72bac Merge branch 'MDL-72182-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-16 11:55:44 +08:00
Jun Pataleta f291f78cab Merge branch 'MDL-76584-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-16 11:48:56 +08:00
Andrew Nicols bfddf75448 Merge branch 'MDL-74698_400' of https://github.com/jonof/moodle into MOODLE_400_STABLE 2023-02-16 11:07:04 +08:00
Ilya Tregubov fce1784938 MDL-76313 forum: code style changes. 2023-02-16 11:01:04 +08:00
Ilya Tregubov 846b0c890c Merge branch '76313-forum-improve-accessibility-400' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_400_STABLE 2023-02-16 11:00:43 +08:00
Ilya Tregubov 345c4a6a3c MDL-75379 core: Code style changes. 2023-02-16 10:50:30 +08:00
Ilya Tregubov 6c82a06f49 Merge branch 'MDL-75379_400' of https://github.com/larsbonczek/moodle into MOODLE_400_STABLE 2023-02-16 10:50:07 +08:00
Andrew Nicols f71d5a9b52 Merge branch 'MDL-76878-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-16 10:44:30 +08:00
Ilya Tregubov fe269e1bac Merge branch 'MDL-73519-400' of https://github.com/meirzamoodle/moodle into MOODLE_400_STABLE 2023-02-16 09:34:46 +08:00
Andrew Nicols 31db9d0c57 Merge branch 'MDL-76478-password-unmask-MOODLE_400_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_400_STABLE 2023-02-15 23:26:28 +08:00
Andrew Nicols 20437979e6 Merge branch 'MDL-76948_400' of https://github.com/larsbonczek/moodle into MOODLE_400_STABLE 2023-02-15 23:01:30 +08:00
Paul Holden a9b0d53459 Merge branch 'MDL-77147_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-15 11:49:23 +00:00
Ilya Tregubov 8d36719bc3 Merge branch 'MDL-75230-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-15 16:13:12 +08:00
Andrew Nicols f6ec6e9dce Merge branch 'MDL-77241-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-15 11:14:44 +08:00
Jun Pataleta cafd97276a Merge branch 'MDL-77223-400' of https://github.com/roland04/moodle into MOODLE_400_STABLE 2023-02-15 11:06:48 +08:00
AMOS bot 8e20336b30 Automatically generated installer lang files 2023-02-15 00:07:47 +00:00
Paul Holden 2c3c32e29e Merge branch 'MDL-75454-400' of https://github.com/davewoloszyn/moodle into MOODLE_400_STABLE 2023-02-14 15:06:05 +00:00
Paul Holden 3fced488b3 MDL-77241 course: optional chaining safety for section toggles. 2023-02-14 13:15:40 +00:00
Paul Holden 44c94ffad4 Merge branch 'MDL-63608_400' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_400_STABLE 2023-02-14 11:59:56 +00:00
Ilya Tregubov b8604c273c Merge branch 'MDL-76947-400' of https://github.com/davewoloszyn/moodle into MOODLE_400_STABLE 2023-02-14 13:53:59 +08:00
David Woloszyn ea5d5ea519 MDL-75454 cache: Reduced exposure of sesskey param 2023-02-14 11:29:01 +11:00
Tim Hunt c7f1203480 MDL-77210 quiz: fix regrade for attempts with redone questions 2023-02-13 16:58:40 +00:00
Mikel Martín d57345bf06 MDL-77223 reportbuilder: Fix first report column as integer 2023-02-13 16:16:11 +01:00
Lars Bonczek 589ca9aec6 MDL-75379 core: Use non-static template cache 2023-02-13 12:37:02 +01:00
Paul Holden ebaec57bb2 MDL-76611 cohort: prevent duplicate idnumber in inplace editable. 2023-02-13 10:33:34 +00:00
Ilya Tregubov 0888a32602 Merge branch 'MDL-77189-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-02-13 13:44:04 +08:00
Simey Lameze 326296c482 MDL-77189 behat: basic coverage for wikimedia repository 2023-02-13 13:23:54 +08:00
Jun Pataleta b93cb20e48 Merge branch '76314-forum-fix-forumtype-and-groupmode-validation-400' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_400_STABLE 2023-02-13 11:38:49 +08:00
Anupama Sarjoshi d7d375ed14 MDL-63608 quiz: Fix Access order when manually grading quizzes
Changes done to fix access order of attempts that need manual grading.
Changed button text from 'Save and go to next page' to 'Save and show next' to improve UI.
2023-02-10 17:44:33 +00:00
Paul Holden 44d77d0848 weekly release 4.0.6+ 2023-02-10 13:47:38 +00:00
Paul Holden 5169dd0f8b Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-02-10 13:47:36 +00:00
Julien Boulen 002ed2d867 MDL-76314 forum: add form check to prevent combining wrong parameters
Form validation prevents combining the forum type "single discussion" and the group mode "separate groups".
2023-02-10 11:07:38 +01:00
Andrew Nicols 0ebbecff73 Merge branch 'MDL-76904-400' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_400_STABLE 2023-02-09 12:04:49 +08:00
Andrew Nicols 941203b502 Merge branch 'MDL-74755-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-09 11:44:40 +08:00
Jun Pataleta 9f876fe558 Merge branch 'MDL-77052-400' of https://github.com/Utdanningsdirektoratet/moodle into MOODLE_400_STABLE 2023-02-09 11:27:04 +08:00
Andrew Nicols ebeb9a87fc Merge branch 'MDL-76354-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-09 10:59:34 +08:00
Andrew Nicols bac3842abc Merge branch 'MDL-77018_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-09 10:51:59 +08:00
Andrew Nicols 4efc9efd9b Merge branch 'MDL-76066-400' of https://github.com/aanabit/moodle into MOODLE_400_STABLE 2023-02-09 10:48:23 +08:00
Andrew Nicols 1278c93a06 Merge branch 'MDL-77057-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-09 10:21:23 +08:00
Andrew Nicols b7334e05db Merge branch 'MDL-76499-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-09 10:05:22 +08:00
Andrew Nicols e900f15c57 Merge branch 'MDL-70586-400' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-02-09 09:45:57 +08:00
Paul Holden 2b4711fdcd Merge branch 'MDL-76672-400' of https://github.com/Utdanningsdirektoratet/moodle into MOODLE_400_STABLE 2023-02-08 14:57:38 +00:00
Paul Holden 16d81dabab Merge branch 'MDL-76542-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-02-08 14:22:12 +00:00
Simey Lameze e844d6d366 MDL-76542 behat: add step to go to user edit page directly 2023-02-08 20:55:43 +08:00
Simey Lameze 28c1597e5a MDL-76542 behat: create custom profile fields using data generators
This commit also adds a new test to verify the custom profile fields
works using the user interface.
2023-02-08 20:55:43 +08:00
Paul Holden 8c08aeb863 Merge branch 'MDL-73692-400-Add-support-for-missing-timestamps-to-rss-block' of https://github.com/melanietreitinger/moodle into MOODLE_400_STABLE 2023-02-08 11:22:52 +00:00
Melanie Treitinger 1914fe6604 MDL-73692 blocks: Add support for missing timestamps to rss block. 2023-02-08 11:16:06 +01:00
Jun Pataleta b0cc1c096a Merge branch 'MDL-74905_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-02-08 17:19:18 +08:00
Angelia Dela Cruz 61737d06c5 MDL-75230 behat: Lesson Behat tests optimised
Replace steps that manually add Lesson instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-02-08 16:59:18 +08:00
Lars Bonczek 45b117f8e7 MDL-74433 mod_assign: Fix logging of submission removal 2023-02-07 12:38:03 +01:00
Andrew Nicols db37e1eb58 Merge branch 'MDL-77023-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-07 12:48:23 +08:00
Andrew Nicols feb10fbea9 Merge branch 'MDL-77123-400' of https://github.com/cameron1729/moodle into MOODLE_400_STABLE 2023-02-07 12:40:48 +08:00
Andrew Nicols d2306d35c6 Merge branch 'mdl-76729_400' of https://github.com/james-cnz/moodle into MOODLE_400_STABLE 2023-02-07 12:37:32 +08:00
Paul Holden ddff113f3b Merge branch 'MDL-77078-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-06 13:33:06 +00:00
Audun Jørstad Lillekjendlie b9a36a1562 MDL-76672 block_myoverview: add role attribute for filter div 2023-02-06 14:07:00 +01:00
Tim Hunt 5dd03dc296 MDL-77147 question admin: optimised the query in admin/qtypes.php 2023-02-06 12:48:16 +00:00
Audun Jørstad Lillekjendlie 5563c74c95 MDL-77052 block_recentlyaccesseditems: HTML role attribute
HTML elements with role=list must contain children with role=listitem
2023-02-06 13:47:35 +01:00
Paul Holden 7aacb04321 Merge branch 'MDL-76370-publicpaths-proxying-MOODLE_400_STABLE' of https://github.com/jaydn/moodle into MOODLE_400_STABLE 2023-02-06 11:02:48 +00:00
Marina Glancy 073901d019 MDL-72182 my: tests for resetting dashboard
Co-authored-by: Paul Holden <paulh@moodle.com>
2023-02-06 09:34:32 +00:00
Paul Holden cd7ec775ae MDL-72182 user: cross-DB compatibility for getting user pages/blocks. 2023-02-06 09:34:32 +00:00
Paul Holden 3419329a12 MDL-74755 block_accessreview: stricter checking of enabled config. 2023-02-06 09:31:45 +00:00
David Woloszyn 7821816fdd MDL-76947 css: Fixed layout regression on dropdown menus 2023-02-06 16:05:40 +11:00
Andrew Nicols 93f6ce8bfe Merge branch 'MDL-77091-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-06 12:59:46 +08:00
Angelia Dela Cruz 584c42e14d MDL-77078 Behat: Coverage for assignment submission statement 2023-02-06 11:32:11 +08:00
AMOS bot a252f3ca77 Automatically generated installer lang files 2023-02-06 00:07:37 +00:00
Andrew Nicols fecc3e0fa1 Merge branch 'MDL-76662-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-04 21:52:25 +08:00
Eloy Lafuente (stronk7) 2756ebfc7c MDL-74905 ci: travis and gha, some adjustments
Apply for some of the improvements made for 4.2:
- Use our own moodlehq/mysql-action
- Define the tmpfs size and ensure that binlogs are disabled.
2023-02-03 19:48:10 +01:00
Eloy Lafuente (stronk7) a279eba2f1 MDL-74905 environment: Apply agreed changes:
- PHP 8.0 required.
- Moodle 3.11.8 required (first minor supporting PHP 8.0 officially).
- MySQL 8.0 required.
- MariaDB 10.6.7 required.
- PostgreSQL 13 required.
- php-sodium extension required.
- 64-bit PHP required.
2023-02-03 19:48:10 +01:00
Eloy Lafuente (stronk7) 5160aa199e MDL-74905 environment: 4.2 base information
This is a direct copy of the 4.1 information, to
have all the real changes under control in next commit(s).
2023-02-03 19:48:10 +01:00
Paul Holden f2a4f26708 Merge branch 'MDL-76869-400' of https://github.com/cameron1729/moodle into MOODLE_400_STABLE 2023-02-03 14:58:31 +00:00
Paul Holden 21ebba9e39 Merge branch 'MDL-77090_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-03 14:46:54 +00:00
Tim Hunt 23e26675ff MDL-77090 questions: regrade of interactive attempts lose tries count
The behaviour-specific data was getting corrupted when the regrade
recreated the first step, because $oldstep->get_behaviour_data() was
stripping off the leading '-' characters from the names, and they were
not being added back.
2023-02-03 10:53:56 +00:00
Jun Pataleta a2b88160d7 weekly release 4.0.6+ 2023-02-03 15:43:41 +08:00
Angelia Dela Cruz edc5b03aa1 MDL-76499 behat: Resource Behat tests optimised
Replace steps that manually add resource instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.

Co-authored-by: David Woloszyn <david.woloszyn@moodle.com>
2023-02-03 14:09:46 +08:00
Jonathon Fowler 36c92bc955 MDL-74698 backup: correctly restore course format options
Old-version backups (< 3.11.7, < 4.0.1) lose their course-level format
options when restoring into newer versions after the backup structure
was changed.

Also, course-level format options were not accurately restored against
the appropriate format type. And section-level format options were
redundantly stored at course-level and restored without mapping their
sectionids, thus creating lint.
2023-02-03 10:22:09 +10:00
Andrew Nicols 0004ba1d1b Merge branch 'MDL-75345-400-fix' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-02 22:01:04 +08:00
Paul Holden bdb6fb7baf MDL-75345 reportbuilder: remove course summary filter checks. 2023-02-02 13:48:49 +00:00
Cameron Ball d92966f83e MDL-77123 message_airnotifier: Don't test configured providers 2023-02-02 14:50:02 +08:00
Andrew Nicols 70fdaa51aa Merge branch 'MDL-75870-400' of https://github.com/nwp90/moodle into MOODLE_400_STABLE 2023-02-02 12:34:53 +08:00
Andrew Nicols 16e2822e90 Merge branch 'MDL-75085-400-4' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-02-02 12:04:05 +08:00
Andrew Nicols 9842833fc1 Merge branch 'MDL-75830-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-02 11:58:31 +08:00
Andrew Nicols 69395127e0 Merge branch 'MDL-77024_400' of https://github.com/timhunt/moodle into MOODLE_400_STABLE 2023-02-02 11:52:59 +08:00
Andrew Nicols c1bc2d4dd2 Merge branch 'MDL-76675_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-02-02 11:04:12 +08:00
Jun Pataleta a4a9984650 Merge branch 'MDL-69690-400' of https://github.com/ilyatregubov/moodle into MOODLE_400_STABLE 2023-02-02 10:31:49 +08:00
Jun Pataleta 0b0874b063 Merge branch 'MDL-77092-m400' of https://github.com/sammarshallou/moodle into MOODLE_400_STABLE 2023-02-02 09:56:59 +08:00
Andrew Nicols 9c3af6a9ae Merge branch 'MDL-75912-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-02 09:44:43 +08:00
Ilya Tregubov cf6901bb9c Merge branch 'MDL-77079-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-02-02 09:17:22 +08:00
Jun Pataleta 37da5b7176 MDL-75085 mod: Pass proper $required param value external_format_value 2023-02-02 09:05:27 +08:00
Jun Pataleta f829545013 MDL-75085 external: Pass proper $required param value in tests 2023-02-02 09:05:27 +08:00
Angelia Dela Cruz b79f853484 MDL-75830 behat: Book behat tests optimised
Replace steps that manually add Book instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
Additionally, performed Behat cleanup and optimisation to affected
files.
2023-02-02 09:03:42 +08:00
Andrew Nicols d851bb1ad3 Merge branch 'MDL-77003-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-02 08:21:23 +08:00
Andrew Nicols 720007a54c Merge branch 'MDL-75345-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-02-02 08:18:38 +08:00
Nick Phillips 5d7411d864 MDL-75870 course: only section togglers to toggle sections 2023-02-02 11:32:15 +13:00
Paul Holden 7e4ef00e6d Merge branch 'MDL-76658-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-02-01 16:34:41 +00:00
Paul Holden 6299d39bf2 MDL-75345 reportbuilder: improve course/user custom report tests.
Ensure column and filters provided by each source have sufficient
coverage. Re-factor individual entity/helper class tests to test
their own specific implementation only.

Remove now-defunct test fixtures.
2023-02-01 15:41:24 +00:00
Paul Holden b56a5e0dfb MDL-77091 reportbuilder: set base time in schedule test generator.
The base time allows for the setting of the "current time" for the
purposes of the schedule test against recurrence configuration.

We should ensure the generator method allows this property so that
it can be used when calculating the initial "next send time" of the
schedule upon creation (and avoiding excessive recursion when the
actual current time is used for the calculation).
2023-02-01 14:39:44 +00:00
Paul Holden 6be9700e32 Merge branch 'MDL-76311-400' of https://github.com/meirzamoodle/moodle into MOODLE_400_STABLE 2023-02-01 14:16:19 +00:00
Meirza 4369ac81a7 MDL-76311 user: redirect to proper URL if a new user creation cancelled 2023-02-01 20:13:22 +07:00
Sara Arjona 4f5795037e MDL-70586 mod_feedback: Hide the Preview questions icon for students
The Preview questions icon shouldn't be displayed unless the user can
edit the feedback or access to the reports; otherwise, it's causing
confusion (especially when the feedback is not opened).
2023-02-01 12:36:29 +01:00
Paul Holden b3e9ba1785 Merge branch 'MDL-73847_400' of https://github.com/jonof/moodle into MOODLE_400_STABLE 2023-02-01 10:00:29 +00:00
Jun Pataleta fc88017acf Merge branch 'MDL-76985-MOODLE_400_STABLE' of https://github.com/sh-csg/moodle into MOODLE_400_STABLE 2023-02-01 14:10:36 +08:00
Ilya Tregubov 4f0c9f4f4b Merge branch 'MDL-76587-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-02-01 13:26:19 +08:00
Jun Pataleta 74bde5fb35 MDL-75085 external: Fix external_multiple_structure parameter passing
Some calls to the external_multiple_structure's constructor incorrectly
pass parameters where the value for the $description parameter is not
being passed. This results to invalid values being passed for the
$required parameter.
2023-02-01 12:29:08 +08:00
Jun Pataleta 58bef2f34e MDL-75085 webservice: Fix parameter passed to external_format_value 2023-02-01 12:29:08 +08:00
Angelia Dela Cruz f4965f1c72 MDL-75912 behat: Wiki behat generators use UI
Behat cleanup and optimisation
2023-02-01 11:22:35 +08:00
Angelia Dela Cruz f5666cffda MDL-75912 behat: Wiki Behat tests now use generators
Replace steps that manually add Wiki instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-02-01 11:21:36 +08:00
Simey Lameze ebd0c7fe8c MDL-77079 behat: use different step to validate presets table data 2023-02-01 09:04:01 +08:00
Tim Hunt 73a7a74d92 MDL-77094 quiz_statistics: improve efficiency of the recalculate task
quiz_settings::create() requires at least 3 DB queries, so the point is
that we can avoid doing that until after we have worked out if we need
to calculate statistics for this quiz.

Also, we order the list of quizzes to consier, to process the ones with
more recent attempts first.
2023-01-31 17:02:57 +00:00
Julien Boulen ae60dd25f6 MDL-76945 theme: fix the rendering of arrows on dropdown variants 2023-01-31 15:21:53 +01:00
sam marshall 029e6e7d89 MDL-77092 Behat: Expand all fieldsets fails with single fieldset
The Behat step to expand all fieldsets did not work if the page
contains only one fieldset.
2023-01-31 13:59:12 +00:00
Angelia Dela Cruz e8719fd65a MDL-76658 Behat: Coverage for course cohort enrolment groups
Co-authored-by: Simey Lameze <simey@moodle.com>
2023-01-31 19:23:54 +08:00
Ilya Tregubov c499c7079f Merge branch 'MDL-77077-400' of https://github.com/snake/moodle into MOODLE_400_STABLE 2023-01-31 18:14:17 +08:00
hieuvu 66c35154b8 MDL-76904 question: Keep question highlight in url 2023-01-31 16:39:56 +07:00
Simey Lameze b11dbf60c0 MDL-76587 behat: make grading page wider to avoid 'out of bounds' fail
This is because on classic theme the navigation block pushes the content
to the right and once behat changes the grades the 'Save changes' button
is no longer visible.
2023-01-31 11:20:13 +08:00
Charles Fulton 4400c34168 MDL-75578 course: require course library to resolve namespace issues 2023-01-30 10:45:48 -05:00
Jake Dallimore 365fff0ff2 MDL-77077 mod_lti: Fix JWT signature verify when alg missing from JWKS
Infer the algorithm, where necessary, using a combination of JWT
headers and known valid LTI algorithms.
2023-01-30 16:45:35 +08:00
Andrew Nicols 0386f27ba1 Merge branch 'MDL-77040-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-01-30 12:28:21 +08:00
Tim Hunt a493821bcc MDL-77018 qbank_statistics: only load stats for contexts that exist
Also, pre-load the contexts for efficiency.
2023-01-27 20:52:33 +00:00
Paul Holden d3d62a087b MDL-77057 group: format group names in module override pages. 2023-01-27 11:50:52 +00:00
Eloy Lafuente (stronk7) 45730b9a07 MDL-76675 date: Only test all TZ names with PHPUNIT_LONGTEST enabled
It happens often that some timezone is renamed, split, added to the
IANAs list of timezones (that, for PHP is kept updated by the
php-timezonedb PECL extension).

When the information coming from the extension changes, all the
PHPUnit jobs in the world start failing (that's when CIs update
their PHP images, when devs update their packages, ...).

So, what we are doing here is to move that test that check for
every single string existing to be run only when PHPUNIT_LONGTEST
is enabled. That way only places running all tests will run that
one. And every other run just will skip it.

This corresponds to point 1 & 2 of the issue, lower impact in general
and, still be able to enable the tests to run.
2023-01-27 08:49:36 +01:00
Andrew Nicols a73cddb9f9 Merge branch 'MDL-75978-400' of https://github.com/JBThong/moodle into MOODLE_400_STABLE 2023-01-27 13:11:22 +08:00
Paul Holden 83bb155b67 MDL-77040 core: assert types of returned Geoplugin data, not values.
The results we get from these tests are beyond our control, and are
unreliable for use in testing.

See also previous change 215cd2d8 in similar tests.
2023-01-26 13:24:11 +00:00
Paul Holden 8f8cea4f03 MDL-76662 tool_log: correct supported reports test assertions. 2023-01-26 13:09:08 +00:00
Davo Smith f95c68c141 MDL-76938 backup: fix restore of comments linked to a course format 2023-01-26 12:33:24 +00:00
Sara Arjona f5ec0df5d5 weekly release 4.0.6+ 2023-01-26 09:59:17 +01:00
Lars Bonczek 539b6b6c85 MDL-76948 mod_assign: Fix description of submission_unlocked event 2023-01-25 19:21:43 +01:00
Tim Hunt 28226981fc MDL-77024 quiz: fix metatdata on log events
Some had the wrong edulevel or crud
2023-01-25 16:13:34 +00:00
Jun Pataleta fa558bdbdc Merge branch 'MDL-76977-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-01-25 16:10:03 +08:00
Jun Pataleta f5babd9a75 Merge branch 'MDL-77036-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-01-25 16:02:11 +08:00
Stefan Hanauska f8a081f660 MDL-76985 course: Redirect to moved section 2023-01-25 09:00:39 +01:00
Simey Lameze a0115a8578 MDL-77036 core_iplookup: update test_ipv4 test expectations 2023-01-25 15:15:22 +08:00
Paul Holden 1d8744377f MDL-77003 javascript: improve string helper JSON detection.
Changes in fbc2732d made the JS template string helper method
too strict in regards to what it considers a valid JSON object.

Co-authored-by: Mike Churchward <mike@brickfieldlabs.ie>
2023-01-24 22:16:26 +00:00
Paul Holden 7d9c52b6bd MDL-77023 javascript: always normalise component of lang strings.
Co-authored-by: David Matamoros <davidmc@moodle.com>
2023-01-24 16:44:13 +00:00
Jun Pataleta 21aba2fb63 Merge branch 'MDL-76639-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-01-24 18:59:21 +08:00
Jun Pataleta d5f6993327 Merge branch 'MDL-76652-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-01-24 18:45:12 +08:00
Jun Pataleta 9f6fcd1e47 Merge branch 'MDL-76655-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-01-24 18:26:53 +08:00
Angelia Dela Cruz 9c4637c086 MDL-76655 behat: Coverage for workshop grading strategies 2023-01-24 09:37:59 +08:00
Paul Holden a5fb38a57c MDL-76354 competency: export user privacy data unconditionally.
We should ensure that any past competency data for a user is always
exported, regardless whether competencies are currently enabled.
2023-01-23 22:15:29 +00:00
Amaia Anabitarte 72773d10f6 MDL-76066 mod_data: Trigger field_deleted event when importing 2023-01-23 18:55:13 +01:00
sam marshall e926de79f3 MDL-76956 core_grades: Regrade progress bar should be more granular
This change makes the regrade progress bar send frequent updates to
the web browser, even when processing within the same grade item, to
avoid timeout problems when there are a large number of users.
2023-01-23 11:42:14 +00:00
Paul Holden 1037818475 MDL-76584 question: correct temporary questionid upgrade field.
Pass correct parameter/type in field constructor (`XMLDB_NOTNULL`)
for consistency. This corrects the definition and preserves the
truthyness of the value that was incorrectly passed previously.
2023-01-23 09:16:32 +00:00
Paul Holden 93a6761b9e MDL-76977 phpunit: ensure unique data provider keys in mustache test. 2023-01-20 17:21:36 +00:00
Ilya Tregubov 13bc06e37d weekly release 4.0.6+ 2023-01-20 09:41:46 +08:00
Paul Holden e961a93ee8 MDL-76878 user: amend permission callbacks for preference definitions.
Ensure those preferences that are used for storing state can always be
updated via web service requests for the current user.
2023-01-19 15:28:52 +00:00
Jun Pataleta 6cec3844dc Merge branch 'MDL-76725-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-01-19 12:04:57 +08:00
Ilya Tregubov 3c44c156e6 Merge branch 'MDL-76870-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-01-19 11:15:35 +08:00
Ilya Tregubov cd685999fa Merge branch 'MDL-76766-400' of https://github.com/aanabit/moodle into MOODLE_400_STABLE 2023-01-19 11:04:47 +08:00
Ilya Tregubov 56dc60887c Merge branch 'MDL-74756-MOODLE_400_STABLE' of https://github.com/sh-csg/moodle into MOODLE_400_STABLE 2023-01-19 10:31:06 +08:00
Andrew Nicols 76bb28ab0b Merge branch 'MDL-76841-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-01-19 08:55:28 +08:00
Andrew Nicols f28a05b21c Merge branch 'MDL-70070-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-01-19 08:50:58 +08:00
Jun Pataleta c7f189da0f Merge branch 'MDL-76525-MOODLE_400_STABLE' of https://github.com/PhMemmel/moodle into MOODLE_400_STABLE 2023-01-18 22:55:31 +08:00
Philipp Memmel 69d187f94b MDL-76525 mod_data: Add param validation for data fields 2023-01-18 12:12:37 +01:00
Claude Vervoort 644d3a5b3f MDL-76602 mod_lti: move lti13 claim declaration in subplugin 2023-01-17 16:56:58 -05:00
Jake Dallimore 963379d7a8 Merge branch 'MDL-66221-400' of https://github.com/raortegar/moodle into MOODLE_400_STABLE 2023-01-17 11:29:22 +08:00
Stefan Hanauska 366e1fae05 MDL-74756 availability_completion: Prev activity (completion n/enabled) 2023-01-16 22:20:42 +01:00
Paul Holden a8e796311e MDL-76841 tool_mobile: improve potential config issues test.
Avoid certificate checking of the default test site (`example.com`),
and update the assertion so we get clearer failures in the future.
2023-01-16 08:30:36 +00:00
Paul Holden dcb19eebc2 MDL-70070 phpunit: correct data provider method names.
They should not be prefixed `test_` because that's how actual
test methods containing assertions are identified by PHPUnit.
2023-01-16 08:28:25 +00:00
Jaydn Cunningham 5ed130b575 MDL-76370 curl: suppress CONNECT header when using HTTP proxy 2023-01-16 14:17:09 +10:30
Jonathon Fowler 587c9406a3 MDL-73847 lti: fetch keyset URLs using configured proxy settings 2023-01-16 10:00:26 +10:00
raortegar f2a95bf7fa MDL-66221 tool_recyclebin: Fix recycle bin with activity settings
If backup_auto_activities setting from Automated backup is disabled
the activities will not be stored for the recycle bin
2023-01-13 11:31:57 +01:00
Simey Lameze 914e611bd1 MDL-76870 question: change assertion to assertEqualsCanonicalizing
By using that assertion the arrays will be sorted before comparison
preventing any Oracle sorting related failures.

Credits for the solution go to Tim Hunt!
2023-01-13 18:13:19 +08:00
Angelia Dela Cruz e6eb08a448 MDL-76639 behat: Add Behat test coverage for quiz with limited attempts 2023-01-13 16:29:43 +08:00
Cameron Ball 4269b654b6 MDL-76869 gradebook: Pass exception to rollback 2023-01-12 16:35:54 +08:00
Ilya Tregubov f52cc16d34 MDL-69690 mod_workshop: Fix fieldname for workshop. 2023-01-12 14:42:24 +07:00
Amaia Anabitarte 5aae7cc4aa MDL-76766 mod_quiz: Allow shuffling quizes with no questions 2023-01-11 11:16:36 +01:00
Julien Boulen ad87801d2d MDL-76313 forum: improve accessibility on subscribers page
- add header on table of subscribers
- remove one redundant header
2023-01-10 11:17:16 +01:00
Meirza 46cb0bc324 MDL-73519 core_course: re-styling the unordered list.
Currently, the unordered list in the course content follows the original style and
is ordered from the top of the content section, which is not part of the description.
That's why the first occurrence of the list is the 2nd level which uses the circle as the marker/list type
instead of the disc. In contrast, the editor always uses the original style.

so we need to reset the CSS of the unordered list in the description to the original
which the disc as the first marker, a circle for the second marker,
and a square for the following levels.
2023-01-10 12:18:29 +07:00
james-cnz 77e664ce4a MDL-76729 filepicker: Restore file picker thumbnails in tree view 2023-01-10 11:49:28 +13:00
Simey Lameze ac754da8f2 MDL-76652 behat: use data generator and remove duplicated steps 2023-01-09 10:17:04 +08:00
Simey Lameze 492a8726e2 MDL-76652 behat: add coverage for postwithoutthrottling logic 2023-01-09 10:17:04 +08:00
Paul Holden a7d6f79bdd MDL-76725 mod_wiki: avoid named arguments in real path callback.
See also f4fb91ae. PHP8 now supports named arguments in calls to
the `call_user_func_array` method, which can result in differing
behaviour compared to PHP7, e.g. in this case it was throwing an
exception due to an unknown named parameter.
2023-01-04 14:08:06 +00:00
Thong Bui 1bde415012 MDL-75978 Quiz\D&D: on mobile, a moving line-wrap can bork the question 2022-12-22 10:08:59 +07:00
Brendan Heywood 940006d39f MDL-76478 formslib: Fix autocomplete bug of existing passwords 2022-12-06 12:34:17 +11:00
David Mudrák fd14e16617 MDL-75534 Fix usermodified in very old forum discussions
Very early Moodle versions used to leave the field empty. Recent Moodle
versions expect that the value always links to an existing user account.
2022-10-19 20:44:50 +02:00
507 changed files with 7245 additions and 3697 deletions
+3 -1
View File
@@ -66,7 +66,7 @@ jobs:
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: johanmeiring/mysql-action@tmpfs-patch
uses: moodlehq/mysql-action@v1
with:
collation server: utf8mb4_bin
mysql version: 5.7
@@ -74,6 +74,8 @@ jobs:
mysql user: test
mysql password: test
use tmpfs: true
tmpfs size: '1024M'
extra conf: --skip-log-bin
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
+3 -1
View File
@@ -81,7 +81,8 @@ install:
sudo service mysql stop
sudo mv /var/lib/mysql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql
sudo service mysql restart
echo -e "[mysqld]\nskip-log-bin" | sudo tee -a /etc/mysql/my.cnf
sudo service mysql start
fi
- >
if [ "$DB" = 'pgsql' ];
@@ -92,6 +93,7 @@ install:
sudo mv /var/lib/postgresql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/postgresql /var/lib/postgresql
sudo service postgresql start 9.6
sh -c 'until pg_isready -p 5432; do echo "Waiting for the DB to be up..."; sleep 2; done'
fi
- >
if [ "$TASK" = 'PHPUNIT' ];
+53 -35
View File
@@ -1,48 +1,66 @@
MOODLE TRADEMARKS POLICY
========================
The word "Moodle" is trademarked in many countries around the world. The word
was originally coined as an acronym: Modular Object-Oriented Dynamic Learning
Environment. The trademark is owned by Martin Dougiamas, Founder and Director
of Moodle.
The Moodle Trademark
--------------------
The law obligates trademark owners to police their marks and prevent the use of
confusingly similar names by third parties. Through this policy wed like to
make it clear how Moodle-related projects, organisations, and people can use
the Moodle trademark. Wed also like to be clear about how use of the word is
restricted when used to promote commercial Moodle services. We do this to
protect the very business model that allows us to continue developing Moodle
for you.
The brand and word "Moodle" has trade mark protection in many countries around
the world. Various Moodle™ trade marks are owned by either Moodle Pty Ltd or
one of its associated entities. The law obligates trade mark owners to police
their trade marks and prevent the use of confusingly similar names by
third parties.
Allowed uses
------------
We have created a more concise and thorough set of Trademark Guidelines
(https://moodle.com/wp-content/uploads/2023/02/Moodle-Trademark-Guidelines-2023-4.pdf)
to help you understand how to comply with Moodle's trade mark requirements.
The Trademark Guidelines will also assist our Moodle Certified Partners and the
community to understand some of the principles that inform Moodle's stance
whenever potential infringement has been detected by us or our community.
The following uses dont require any permission at all:
We need to be clear about use of the word "Moodle" and how we restrict its use
when promoting commercial Moodle™ branded services. The proper use of
trade marks reliably assures consumers about the quality of the associated
products or services and where they have been derived from. Because the
Moodle LMS is made available under the open source GNU General Public License'
that permits you to modify the copyrighted software, the distribution of such
modified software in combination with Moodle trade marks can potentially
mislead others in the community. To be clear, the GNU GPL does not include an
implied right or licence to use Moodle's trade marks.
* Referring to the software or the Moodle project.
* Describing your own Moodle implementation (including within corporate
settings).
We do all this to protect the very business model that allows us to continue
developing various Moodle software solutions for you.
Allowed uses of "Moodle"
------------------------
The following uses don't require any permission at all:
* Referring to the software or the Moodle project as the "Moodle™ software"
or the "Moodle™ project"
* Describing your own implementation of the Moodle™ software platform
(including within corporate settings).
* Describing a Moodle-based community hub.
* Describing some software youve made that integrates with Moodle
(eg a Moodle integration feature on another system).
* Describing certain software you've made that integrates with Moodle
branded software (e.g. a Moodle integration feature on another system).
Restricted uses
---------------
Restricted uses of "Moodle"
---------------------------
The following uses are generally prohibited without explicit and direct
permission being granted to you by Moodle Pty Ltd. We do this to protect the
Moodle project from software and sites which could confuse people. Please
contact us to ask for permission in writing.
Moodle project from software and sites which could confuse people. If in
doubt, reach out for clarification at <trademarks@moodle.com>
* You cant use "Moodle" in the name of your software (including Mobile apps)
* You cant use "Moodle" in your company name
* You cant use "Moodle" in your domain name
* You cant use "Moodle" in advertising-related keywords (such as Adsense)
* You cant use "Moodle" to describe services around Moodle (such as hosting,
training, support, consulting, course creation services, theme development,
customisation, installation, integration and certification). This applies
even if you do not charge for the services. Note that usually only Moodle
Partners have this permission.
For information about the Moodle Partner Certification Mark as well as for how
to contact us, please see <https://moodle.com/trademarks/>.
* You can't use the word "Moodle" or any Moodle logos for commercial purposes
without prior written permission from Moodle HQ.
* You can't use "Moodle" in the name of your software (including Mobile apps).
* You can't use "Moodle" in your company name.
* You can't use "Moodle" in your domain name.
* You can't use "Moodle" in advertising-related keywords (such as Adsense).
* You can't use "Moodle" to describe services around Moodle
(such as hosting, training, support, consulting, course creation services,
theme development, customisation, installation, integration, analytics
and certification) that cause consumers to be confused that you are
associated with Moodle HQ if you are not.
This applies even if you do not charge for the services.
Note that usually only Moodle Partners have this permission.
+187
View File
@@ -3924,4 +3924,191 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.2" 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_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+10 -19
View File
@@ -31,29 +31,20 @@
if (!empty($hide) and confirm_sesskey()) {
$class = \core_plugin_manager::resolve_plugininfo_class('mod');
$class::enable_plugin($hide, false);
admin_get_root(true, false); // settings not required - only pages
if ($class::enable_plugin($hide, false)) {
// Settings not required - only pages.
admin_get_root(true, false);
}
redirect(new moodle_url('/admin/modules.php'));
}
if (!empty($show) and confirm_sesskey()) {
$canenablemodule = true;
$modulename = $show;
// Invoking a callback function that enables plugins to force additional actions (e.g. displaying notifications,
// modals, etc.) and also specify through its returned value (bool) whether the process of enabling the plugin
// should continue after these actions or not.
if (component_callback_exists("mod_{$modulename}", 'pre_enable_plugin_actions')) {
$canenablemodule = component_callback("mod_{$modulename}", 'pre_enable_plugin_actions');
}
if ($canenablemodule) {
$class = \core_plugin_manager::resolve_plugininfo_class('mod');
$class::enable_plugin($show, true);
admin_get_root(true, false); // Settings not required - only pages.
redirect(new moodle_url('/admin/modules.php'));
if (!empty($show) && confirm_sesskey()) {
$class = \core_plugin_manager::resolve_plugininfo_class('mod');
if ($class::enable_plugin($show, true)) {
// Settings not required - only pages.
admin_get_root(true, false);
}
redirect(new moodle_url('/admin/modules.php'));
}
echo $OUTPUT->header();
@@ -34,7 +34,7 @@ class adminpresets_admin_setting_configselect extends adminpresets_setting {
*/
protected function set_value($value) {
// When we intantiate the class we need the choices.
if (empty($this->settindata->choices) && method_exists($this->settingdata, 'load_choices')) {
if (empty($this->settingdata->choices) && method_exists($this->settingdata, 'load_choices')) {
$this->settingdata->load_choices();
}
+17 -29
View File
@@ -24,6 +24,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use core_question\local\bank\question_version_status;
require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir . '/questionlib.php');
@@ -42,36 +43,23 @@ $qtypes = question_bank::get_all_qtypes();
$pluginmanager = core_plugin_manager::instance();
// Get some data we will need - question counts and which types are needed.
$hiddenstatus = \core_question\local\bank\question_version_status::QUESTION_STATUS_HIDDEN;
$draftstatus = \core_question\local\bank\question_version_status::QUESTION_STATUS_DRAFT;
// The second JOIN on question_versions (qv2) is to get the latest version of each question. 
// (Using this sort of JOIN is a known trick for doing this in the fastest possible way.)
$counts = $DB->get_records_sql("
SELECT q.qtype,
COUNT(qv.id) AS numquestions,
SUM(CASE WHEN qv.status = :hiddenstatus THEN 1 ELSE 0 END) AS numhidden,
SUM(CASE WHEN qv.status = :draftstatus THEN 1 ELSE 0 END) AS numdraft
FROM {question} q
JOIN {question_versions} qv ON q.id = qv.questionid
LEFT JOIN {question_versions} qv2 ON qv.questionbankentryid = qv2.questionbankentryid AND qv.version < qv2.version
WHERE qv2.questionbankentryid IS NULL
GROUP BY q.qtype
", [
'hiddenstatus' => question_version_status::QUESTION_STATUS_HIDDEN,
'draftstatus' => question_version_status::QUESTION_STATUS_DRAFT,
]);
$sql = "SELECT result.qtype,
SUM(result.numquestions) AS numquestions,
SUM(result.numhidden) AS numhidden,
SUM(result.numdraft) AS numdraft
FROM (SELECT data.qtype,
data.versionid,
COUNT(data.numquestions) AS numquestions,
(SELECT COUNT(qv.id)
FROM {question_versions} qv
WHERE qv.id = data.versionid
AND qv.status = :hiddenstatus) AS numhidden,
(SELECT COUNT(qv.id)
FROM {question_versions} qv
WHERE qv.id = data.versionid
AND qv.status = :draftstatus) AS numdraft
FROM (SELECT q.qtype, qv.id AS versionid, 1 AS numquestions
FROM {question} q
JOIN {question_versions} qv ON qv.questionid = q.id
JOIN {question_bank_entries} qbe ON qbe.id = qv.questionbankentryid
AND qv.version = (SELECT MAX(v.version)
FROM {question_versions} v
JOIN {question_bank_entries} be ON be.id = v.questionbankentryid
WHERE be.id = qbe.id)) data
GROUP BY data.qtype, data.versionid) result
GROUP BY result.qtype";
$counts = $DB->get_records_sql($sql, ['hiddenstatus' => $hiddenstatus, 'draftstatus' => $draftstatus]);
$needed = [];
foreach ($qtypes as $qtypename => $qtype) {
if (!isset($counts[$qtypename])) {
+2 -1
View File
@@ -477,7 +477,8 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), new lang_string('recyclebin_desc', 'backup')));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', new lang_string('generalusers', 'backup'), new lang_string('configgeneralusers', 'backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', new lang_string('generalactivities', 'backup'),
new lang_string('backupautoactivitiesdescription', 'backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), 1));
$temp->add(new admin_setting_configcheckbox(
'backup/backup_auto_files',
@@ -35,9 +35,7 @@ Feature: Allowing multiple accounts to have the same email address
| username | firstname | lastname | email |
| s1 | John | Doe | s1@example.com |
| s2 | Jane | Doe | s2@example.com |
When I log in as "admin"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I click on "Edit" "link" in the "Jane Doe" "table_row"
When I am on the "s2" "user > editing" page logged in as "admin"
And I set the field "Email address" to "<email>"
And I press "Update profile"
Then I should <expect> "This email address is already registered."
@@ -11,8 +11,11 @@ Feature: I can add a new preset with current settings
And I set the field "Name" to "Starter"
And I set the field "Description" to "Non-core starter preset"
When I click on "Create preset" "button"
Then I should see "Moodle with all of the most popular features" in the "Starter" "table_row"
And I should see "Starter" in the "Non-core starter preset" "table_row"
Then the following should exist in the "Site admin presets table" table:
| Name | Description |
| Starter | Moodle with all of the most popular features, including Assignment, Feedback, Forum, H5P, Quiz and Completion tracking. |
| Full | All the Starter features plus External (LTI) tool, SCORM, Workshop, Analytics, Badges, Competencies, Learning plans and lots more. |
| Starter | Non-core starter preset |
Scenario: Export current settings
Given I click on "Create preset" "button"
@@ -30,10 +30,9 @@ Feature: Verify that all form fields values can be get and set
| student2 | G2 |
| student3 | G2 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | firstpagetitle | wikimode | visible |
| wiki | C1 | wiki1 | Test this one | Test this one | Test this one | collaborative | 0 |
And I log in as "admin"
And I am on the "Course 1" "reset" page
| activity | course | idnumber | name | firstpagetitle | wikimode | visible |
| wiki | C1 | wiki1 | Test this one | Test this one | collaborative | 0 |
And I am on the "Course 1" "reset" page logged in as admin
# Select (multi-select) - Checking "the select box should contain".
And I expand all fieldsets
And the "Unenrol users" select box should contain "No roles"
@@ -60,16 +59,14 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" ticked.
And I set the field "Force format" to "1"
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the field "Force format" matches value "1"
And the field "Force format" does not match value ""
# Checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Force format" to ""
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the field "Force format" matches value ""
And the field "Force format" does not match value "1"
@@ -77,8 +74,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | 1 |
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the following fields match these values:
| Force format | 1 |
@@ -88,8 +84,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | |
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Settings" in current page administration
And I am on the "Test this one" "wiki activity editing" page
And I expand all fieldsets
And the following fields match these values:
| Force format | |
@@ -142,10 +137,11 @@ Feature: Verify that all form fields values can be get and set
And I navigate to "Settings" in current page administration
And the field "Course ID number" matches value "Course id number"
Scenario: with JS disabled all form fields getters and setters works as expected
@javascript
Scenario: with JS enabled all form fields getters and setters works as expected
Given the following "activities" exist:
| activity | course | name |
| lesson | C1 | Test lesson |
Then I am on the "Course 1" "groups" page
# Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain".
And I set the field "groups" to "Group 2"
@@ -157,11 +153,8 @@ Feature: Verify that all form fields values can be get and set
And the "members" select box should contain "Student 2 (s2@example.com)"
And the "members" select box should not contain "Student 3 (s3@example.com)"
# Checkbox (AJAX) - Checking "I set the field" and "I set the following fields to these values".
And I am on "Course 1" course homepage
And I add a "Lesson" to section "1"
And I am on the "Test lesson" "lesson activity editing" page
And I set the following fields to these values:
| Name | Test lesson |
| Description | Test lesson description |
| available[enabled] | 1 |
And I set the field "deadline[enabled]" to "1"
# Checkbox (AJAX) - Checking "the field matches value" before saving.
@@ -48,12 +48,7 @@ class accessibility {
public static function is_accessibility_enabled(): bool {
global $CFG;
if (isset($CFG->enableaccessibilitytools)) {
return $CFG->enableaccessibilitytools;
}
// Enabled by default.
return true;
return !empty($CFG->enableaccessibilitytools);
}
/**
@@ -274,7 +274,7 @@ $string['requesttypedelete'] = 'Delete all of my personal data';
$string['requesttypedeleteshort'] = 'Delete';
$string['requesttypeexport'] = 'Export all of my personal data';
$string['requesttypeexportshort'] = 'Export';
$string['requesttypeothers'] = 'General inquiry';
$string['requesttypeothers'] = 'General enquiry';
$string['requesttypeothersshort'] = 'Message';
$string['requireallenddatesforuserdeletion'] = 'Consider courses without end date as active';
$string['requireallenddatesforuserdeletion_desc'] = 'When calculating user expiry, several factors are considered:
@@ -20,7 +20,7 @@ Feature: Contact the privacy officer
And I click on "Send" "button" in the "Contact the privacy officer" "dialogue"
Then I should see "Your request has been submitted to the privacy officer"
And I click on "Data requests" "link"
And I should see "Hello DPO!" in the "General inquiry" "table_row"
And I should see "Hello DPO!" in the "General enquiry" "table_row"
Scenario: Contacting the privacy officer when not enabled
When I log in as "student1"
+1 -1
View File
@@ -5,6 +5,6 @@ define("tool_langimport/search",["exports","core/pending","core/utils"],(functio
* @module tool_langimport/search
* @copyright 2021 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_pending=(obj=_pending)&&obj.__esModule?obj:{default:obj};const SELECTORS_AVAILABLE_LANG_SELECT="select",SELECTORS_AVAILABLE_LANG_SEARCH='[data-action="search"]';var _default={init:form=>{const availableLangsElement=form.querySelector(SELECTORS_AVAILABLE_LANG_SELECT),availableLangsFilter=event=>{const pendingPromise=new _pending.default("tool_langimport/search:filter");availableLangsElement.querySelectorAll("option").forEach((option=>{option.remove()}));const searchTerm=event.target.value.toLowerCase(),availableLanguages=JSON.parse(availableLangsElement.dataset.availableLanguages),filteredLanguages=Object.keys(availableLanguages).reduce(((matches,langcode)=>(availableLanguages[langcode].toLowerCase().includes(searchTerm)&&(matches[langcode]=availableLanguages[langcode]),matches)),[]);Object.entries(filteredLanguages).forEach((_ref=>{let[langcode,langname]=_ref;const option=document.createElement("option");option.value=langcode,option.innerText=langname,availableLangsElement.append(option)})),pendingPromise.resolve()},availableLanguages={};availableLangsElement.querySelectorAll("option").forEach((option=>{availableLanguages[option.value]=option.text})),availableLangsElement.dataset.availableLanguages=JSON.stringify(availableLanguages);const availableLangsSearch=form.querySelector(SELECTORS_AVAILABLE_LANG_SEARCH);availableLangsSearch.addEventListener("keydown",(event=>{"Enter"===event.key&&event.preventDefault()})),availableLangsSearch.addEventListener("keyup",(event=>{const pendingPromise=new _pending.default("tool_langimport/search:keyup");(0,_utils.debounce)(availableLangsFilter,250)(event),setTimeout((()=>{pendingPromise.resolve()}),250)}))}};return _exports.default=_default,_exports.default}));
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_pending=(obj=_pending)&&obj.__esModule?obj:{default:obj};const SELECTORS_AVAILABLE_LANG_SELECT="select",SELECTORS_AVAILABLE_LANG_SEARCH='[data-action="search"]';_exports.init=form=>{const availableLangsElement=form.querySelector(SELECTORS_AVAILABLE_LANG_SELECT),availableLanguages={};availableLangsElement.querySelectorAll("option").forEach((option=>{availableLanguages[option.value]=option.text})),availableLangsElement.dataset.availableLanguages=JSON.stringify(availableLanguages);const availableLangsSearch=form.querySelector(SELECTORS_AVAILABLE_LANG_SEARCH);availableLangsSearch.addEventListener("keydown",(event=>{"Enter"===event.key&&event.preventDefault()}));const availableLangsSearchDebounce=(0,_utils.debounce)((event=>{const pendingPromise=new _pending.default("tool_langimport/search:filter");availableLangsElement.querySelectorAll("option").forEach((option=>{option.remove()}));const searchTerm=event.target.value.toLowerCase(),availableLanguages=JSON.parse(availableLangsElement.dataset.availableLanguages),filteredLanguages=Object.keys(availableLanguages).reduce(((matches,langcode)=>(availableLanguages[langcode].toLowerCase().includes(searchTerm)&&(matches[langcode]=availableLanguages[langcode]),matches)),[]);Object.entries(filteredLanguages).forEach((_ref=>{let[langcode,langname]=_ref;const option=document.createElement("option");option.value=langcode,option.innerText=langname,availableLangsElement.append(option)})),pendingPromise.resolve()}),250);availableLangsSearch.addEventListener("keyup",(event=>{const pendingPromise=new _pending.default("tool_langimport/search:keyup");availableLangsSearchDebounce(event),setTimeout((()=>{pendingPromise.resolve()}),250)}))}}));
//# sourceMappingURL=search.min.js.map
File diff suppressed because one or more lines are too long
+3 -6
View File
@@ -36,7 +36,7 @@ const DEBOUNCE_TIMER = 250;
*
* @param {Element} form
*/
const init = (form) => {
export const init = form => {
const availableLangsElement = form.querySelector(SELECTORS.AVAILABLE_LANG_SELECT);
const availableLangsFilter = (event) => {
@@ -84,16 +84,13 @@ const init = (form) => {
});
// Debounce the event listener to allow the user to finish typing.
const availableLangsSearchDebounce = debounce(availableLangsFilter, DEBOUNCE_TIMER);
availableLangsSearch.addEventListener('keyup', (event) => {
const pendingPromise = new Pending('tool_langimport/search:keyup');
debounce(availableLangsFilter, DEBOUNCE_TIMER)(event);
availableLangsSearchDebounce(event);
setTimeout(() => {
pendingPromise.resolve();
}, DEBOUNCE_TIMER);
});
};
export default {
init: init,
};
@@ -33,3 +33,26 @@ Feature: Licence manager
And "This is the site default licence" "icon" should exist in the "cc" "table_row"
And "Enable licence" "icon" should not exist in the "cc" "table_row"
And "This is the site default licence" "icon" should not exist in the "public" "table_row"
@javascript @_file_upload
Scenario Outline: User licence preference is remembered depending of setting value
Given the following config values are set as admin:
| sitedefaultlicense | cc |
| rememberuserlicensepref | <rememberuserlicensepref> |
And I log in as "admin"
And I follow "Private files" in the user menu
And I follow "Add..."
And I follow "Upload a file"
And the field with xpath "//select[@name='license']" matches value "Creative Commons"
And I click on "Close" "button" in the "File picker" "dialogue"
When I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as:
| Save as | empty_copy.txt |
| license | Public domain |
And I press "Save changes"
And I follow "Add..."
Then the field with xpath "//select[@name='license']" matches value "<expectedlicence>"
Examples:
| rememberuserlicensepref | expectedlicence |
| 0 | Creative Commons |
| 1 | Public domain |
@@ -33,8 +33,7 @@ class store_test extends \advanced_testcase {
* Tests log writing.
*
* @param bool $jsonformat True to test with JSON format
* @dataProvider test_log_writing_provider
* @throws moodle_exception
* @dataProvider log_writing_provider
*/
public function test_log_writing(bool $jsonformat) {
global $DB, $CFG;
@@ -252,9 +251,9 @@ class store_test extends \advanced_testcase {
* Returns different JSON format settings so the test can be run with JSON format either on or
* off.
*
* @return [bool] Array of true/false
* @return bool[] Array of true/false
*/
public static function test_log_writing_provider(): array {
public static function log_writing_provider(): array {
return [
[false],
[true]
@@ -311,17 +310,16 @@ class store_test extends \advanced_testcase {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');
$supportedreports = array(
'report_log' => '/report/log',
'report_loglive' => '/report/loglive'
);
// Make sure all supported reports are installed.
$expectedreports = array_keys(array_intersect_key($allreports, $supportedreports));
$reports = $logmanager->get_supported_reports('logstore_database');
$reports = array_keys($reports);
$expectedreports = array_intersect_key([
'log' => 'report_log',
'loglive' => 'report_loglive',
], $allreports);
$supportedreports = $logmanager->get_supported_reports('logstore_database');
foreach ($expectedreports as $expectedreport) {
$this->assertContains($expectedreport, $reports);
$this->assertArrayHasKey($expectedreport, $supportedreports);
}
}
}
@@ -217,20 +217,19 @@ class store_test extends \advanced_testcase {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');
$supportedreports = array(
'report_log' => '/report/log',
'report_loglive' => '/report/loglive',
'report_outline' => '/report/outline',
'report_participation' => '/report/participation',
'report_stats' => '/report/stats'
);
// Make sure all supported reports are installed.
$expectedreports = array_keys(array_intersect_key($allreports, $supportedreports));
$reports = $logmanager->get_supported_reports('logstore_legacy');
$reports = array_keys($reports);
$expectedreports = array_intersect_key([
'log' => 'report_log',
'loglive' => 'report_loglive',
'outline' => 'report_outline',
'participation' => 'report_participation',
'stats' => 'report_stats'
], $allreports);
$supportedreports = $logmanager->get_supported_reports('logstore_legacy');
foreach ($expectedreports as $expectedreport) {
$this->assertContains($expectedreport, $reports);
$this->assertArrayHasKey($expectedreport, $supportedreports);
}
}
@@ -38,8 +38,7 @@ class store_test extends \advanced_testcase {
* Tests log writing.
*
* @param bool $jsonformat True to test with JSON format
* @dataProvider test_log_writing_provider
* @throws moodle_exception
* @dataProvider log_writing_provider
*/
public function test_log_writing(bool $jsonformat) {
global $DB;
@@ -223,9 +222,9 @@ class store_test extends \advanced_testcase {
* Returns different JSON format settings so the test can be run with JSON format either on or
* off.
*
* @return [bool] Array of true/false
* @return bool[] Array of true/false
*/
public static function test_log_writing_provider(): array {
public static function log_writing_provider(): array {
return [
[false],
[true]
@@ -239,20 +238,19 @@ class store_test extends \advanced_testcase {
$logmanager = get_log_manager();
$allreports = \core_component::get_plugin_list('report');
$supportedreports = array(
'report_log' => '/report/log',
'report_loglive' => '/report/loglive',
'report_outline' => '/report/outline',
'report_participation' => '/report/participation',
'report_stats' => '/report/stats'
);
// Make sure all supported reports are installed.
$expectedreports = array_keys(array_intersect_key($allreports, $supportedreports));
$reports = $logmanager->get_supported_reports('logstore_standard');
$reports = array_keys($reports);
$expectedreports = array_intersect_key([
'log' => 'report_log',
'loglive' => 'report_loglive',
'outline' => 'report_outline',
'participation' => 'report_participation',
'stats' => 'report_stats'
], $allreports);
$supportedreports = $logmanager->get_supported_reports('logstore_standard');
foreach ($expectedreports as $expectedreport) {
$this->assertContains($expectedreport, $reports);
$this->assertArrayHasKey($expectedreport, $supportedreports);
}
}
@@ -368,7 +366,7 @@ class store_test extends \advanced_testcase {
* Tests the decode_other function can cope with both JSON and PHP serialized format.
*
* @param mixed $value Value to encode and decode
* @dataProvider test_decode_other_provider
* @dataProvider decode_other_provider
*/
public function test_decode_other($value) {
$this->assertEquals($value, \logstore_standard\log\store::decode_other(serialize($value)));
@@ -387,7 +385,7 @@ class store_test extends \advanced_testcase {
*
* @return array Array of parameters
*/
public function test_decode_other_provider(): array {
public function decode_other_provider(): array {
return [
[['info' => 'd2819896', 'logurl' => 'discuss.php?d=2819896']],
[null],
@@ -400,8 +398,7 @@ class store_test extends \advanced_testcase {
* Checks that backup and restore of log data works correctly.
*
* @param bool $jsonformat True to test with JSON format
* @dataProvider test_log_writing_provider
* @throws moodle_exception
* @dataProvider log_writing_provider
*/
public function test_backup_restore(bool $jsonformat) {
global $DB;
-2
View File
@@ -229,7 +229,6 @@ class page_helper {
$PAGE->set_pagelayout('standard');
$PAGE->set_url($url);
$PAGE->set_title($title);
$PAGE->set_heading(fullname($user));
if (!empty($plan)) {
$PAGE->navbar->add($title, $planurl);
@@ -303,7 +302,6 @@ class page_helper {
$PAGE->set_pagelayout('standard');
$PAGE->set_url($url);
$PAGE->set_title($title);
$PAGE->set_heading(fullname($user));
if (!empty($evidence)) {
$PAGE->navbar->add($title, $evidenceurl);
+11 -7
View File
@@ -59,22 +59,26 @@ class api_test extends \externallib_advanced_testcase {
*/
public function test_get_potential_config_issues() {
global $CFG;
require_once($CFG->dirroot . '/message/lib.php');
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->userquota = '73289234723498234723423489273423497234234';
// Set non-SSL wwwroot, to avoid spurious certificate checking.
$CFG->wwwroot = 'http://www.example.com';
$CFG->debugdisplay = 1;
set_config('debugauthdb', 1, 'auth_db');
set_config('debugdb', 1, 'enrol_database');
$expectedissues = array('adodbdebugwarning', 'displayerrorswarning');
// Get potential issues, obtain their keys for comparison.
$issues = api::get_potential_config_issues();
$this->assertCount(count($expectedissues), $issues);
foreach ($issues as $issue) {
$this->assertTrue(in_array($issue[0], $expectedissues));
}
$issuekeys = array_column($issues, 0);
$this->assertEqualsCanonicalizing([
'nohttpsformobilewarning',
'adodbdebugwarning',
'displayerrorswarning',
], $issuekeys);
}
/**
+1 -2
View File
@@ -108,7 +108,7 @@ class issuer extends persistent {
$mform->addHelpButton('clientsecret', 'issuerclientsecret', 'tool_oauth2');
// Use basic authentication.
$mform->addElement('checkbox', 'basicauth', get_string('usebasicauth', 'tool_oauth2'));
$mform->addElement('advcheckbox', 'basicauth', get_string('usebasicauth', 'tool_oauth2'));
$mform->addHelpButton('basicauth', 'usebasicauth', 'tool_oauth2');
// Base Url.
@@ -244,7 +244,6 @@ class issuer extends persistent {
* @return array of additional errors, or overridden errors.
*/
protected function extra_validation($data, $files, array &$errors) {
$errors = [];
if ($data->showonloginpage != \core\oauth2\issuer::SERVICEONLY) {
if (!strlen(trim($data->loginscopes))) {
$errors['loginscopes'] = get_string('required');
@@ -218,9 +218,13 @@ Feature: Basic OAuth2 functionality
| Name | Invalid custom service |
| Client ID | thisistheclientid |
| Client secret | supersecret |
| Service base URL | https://dc.imsglobal.org/ |
| Service base URL | http://dc.imsglobal.org/ |
When I press "Save changes"
Then I should see "Could not discover end points for identity issuer: Invalid custom service"
Then I should see "For security reasons only https connections are allowed, sorry"
And I set the following fields to these values:
| Service base URL | https://dc.imsglobal.org/ |
And I press "Save changes"
And I should see "Could not discover end points for identity issuer: Invalid custom service"
And I should see "URL: https://dc.imsglobal.org/.well-known/openid-configuration"
And "Allow services" "icon" should exist in the "Invalid custom service" "table_row"
And "Do not allow login" "icon" should exist in the "Invalid custom service" "table_row"
@@ -358,3 +362,21 @@ Feature: Basic OAuth2 functionality
And I navigate to "Server > OAuth 2 services" in site administration
And "Allow login" "icon" should exist in the "Empty custom service" "table_row"
And "Do not allow services" "icon" should exist in the "Empty custom service" "table_row"
@javascript
Scenario: Changes to "Authenticate token requests via HTTP headers" are saved
Given I press "Custom"
And I set the following fields to these values:
| Name | Custom service |
| Client ID | thisistheclientid |
| Client secret | supersecret |
And I press "Save changes"
When I click on "Edit" "link" in the "Custom service" "table_row"
And I click on "Authenticate token requests via HTTP headers" "checkbox"
And I press "Save changes"
And I click on "Edit" "link" in the "Custom service" "table_row"
And the field "Authenticate token requests via HTTP headers" matches value "1"
And I click on "Authenticate token requests via HTTP headers" "checkbox"
And I press "Save changes"
And I click on "Edit" "link" in the "Custom service" "table_row"
Then the field "Authenticate token requests via HTTP headers" matches value ""
@@ -462,7 +462,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I am on site homepage
And I change window size to "large"
And I follow "Log in"
When I press "Log in as a guest"
When I press "Access as a guest"
Then I should see "If you continue browsing this website, you agree to our policies"
# Confirm when navigating, the pop-up policies are displayed.
When I am on the "My courses" page
@@ -626,7 +626,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I am on site homepage
And I follow "Log in"
# First log in as a guest
And I press "Log in as a guest"
And I press "Access as a guest"
# Now sign up
And I follow "Log in"
When I click on "Create new account" "link"
@@ -133,6 +133,16 @@ class course_bin extends base_bin {
\backup::MODE_AUTOMATED,
$user->id
);
// When "backup_auto_activities" setting is disabled, activities can't be restored from recycle bin.
$plan = $controller->get_plan();
$activitiessettings = $plan->get_setting('activities');
$settingsvalue = $activitiessettings->get_value();
if (empty($settingsvalue)) {
$controller->destroy();
return;
}
$controller->execute_plan();
// We don't need the forced setting anymore, hence unsetting it.
@@ -242,6 +242,29 @@ class course_bin_test extends \advanced_testcase {
$this->assertEquals(true, $attemptobj->is_finished());
}
/**
* Test that the activity is NOT stored in bin when
* in Automated backup setup settings "backup_auto_activities" is disabled.
*
* @dataProvider recycle_bin_settings_provider
* @covers ::store_item
*/
public function test_coursemodule_restore_with_activity_setting_disabled() {
// Set the configuration to not include activities in the automated backup.
set_config('backup_auto_activities', false, 'backup');
// Delete the course module.
course_delete_module($this->quiz->cmid);
// Now, run the course module deletion adhoc task.
\phpunit_util::run_all_adhoc_tasks();
// Check there is no items in the recycle bin.
$recyclebin = new \tool_recyclebin\course_bin($this->course->id);
$this->assertEquals(0, count($recyclebin->get_items()));
}
/**
* Tests that user data is not restored when module is restored.
*
@@ -38,15 +38,6 @@ use core\check\result;
*/
class adhocqueue extends check {
/**
* Constructor
*/
public function __construct() {
global $CFG;
$this->id = 'adhocqueue';
$this->name = get_string('checkadhocqueue', 'tool_task');
}
/**
* Return result
* @return result
+7 -10
View File
@@ -38,17 +38,14 @@ use core\check\result;
class cronrunning extends check {
/**
* Constructor
* A link the running tasks report
*
* @return action_link|null
*/
public function __construct() {
global $CFG;
$this->id = 'cronrunning';
$this->name = get_string('checkcronrunning', 'tool_task');
if (empty($CFG->cronclionly)) {
$this->actionlink = new \action_link(
new \moodle_url('/admin/cron.php'),
get_string('cron', 'admin'));
}
public function get_action_link(): ?\action_link {
return new \action_link(
new \moodle_url('/admin/tool/task/runningtasks.php'),
get_string('runningtasks', 'tool_task'));
}
/**
@@ -39,15 +39,13 @@ use core\check\result;
class maxfaildelay extends check {
/**
* Constructor
* Links to the task log report
*
* @return \action_link|null
*/
public function __construct() {
global $CFG;
$this->id = 'cronfaildelay';
$this->name = get_string('checkmaxfaildelay', 'tool_task');
$this->actionlink = new \action_link(
new \moodle_url('/admin/tool/task/scheduledtasks.php'),
get_string('scheduledtasks', 'tool_task'));
public function get_action_link(): ?\action_link {
$url = new \moodle_url('/admin/tasklogs.php');
return new \action_link($url, get_string('tasklogs', 'tool_task'));
}
/**
@@ -125,12 +125,10 @@ Feature: Upload users
And I should see "Users created: 4"
And I press "Continue"
# Boost check.
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I click on ".icon[title=Edit]" "css_element" in the "jonest@example.com" "table_row"
And I am on the "jonest@example.com" "user > editing" page
And I should see "Boost"
# Classic check.
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I click on ".icon[title=Edit]" "css_element" in the "reznor@example.com" "table_row"
And I am on the "reznor@example.com" "user > editing" page
And I should see "Classic"
@javascript
@@ -152,14 +152,11 @@ Feature: Apply tour filters to a tour
| fullname | shortname | format | enablecompletion |
| 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 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Wiki" to section "1" and I fill the form with:
| Wiki name | Test wiki name |
| Description | Test wiki description |
| First page name | First page |
| Wiki mode | Collaborative wiki |
And I am on "Course 2" course homepage
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 |
@@ -277,13 +277,13 @@ class condition extends \core_availability\condition {
if (!isset($sectionprevious[$othercm->section])) {
$sectionprevious[$othercm->section] = $lastcmid;
}
if ($lastcmid) {
$this->modfastprevious[$othercm->id] = $lastcmid;
}
// Load previous to all cms with completion.
if ($othercm->completion == COMPLETION_TRACKING_NONE) {
continue;
}
if ($lastcmid) {
$this->modfastprevious[$othercm->id] = $lastcmid;
}
$lastcmid = $othercm->id;
}
// Fill empty sections index.
@@ -380,7 +380,7 @@ class condition_test extends \advanced_testcase {
/**
* Tests the is_available and get_description functions for previous activity option.
*
* @dataProvider test_previous_activity_data
* @dataProvider previous_activity_data
* @param int $grade the current assign grade (0 for none)
* @param int $condition true for complete, false for incomplete
* @param string $mark activity to mark as complete
@@ -469,7 +469,7 @@ class condition_test extends \advanced_testcase {
$this->assertMatchesRegularExpression($description, $information);
}
public function test_previous_activity_data(): array {
public function previous_activity_data(): array {
// Assign grade, condition, activity to complete, activity to test, result, resultnot, description.
return [
'Missing previous activity complete' => [
@@ -561,7 +561,7 @@ class condition_test extends \advanced_testcase {
* Tests the is_available and get_description functions for
* previous activity option in course sections.
*
* @dataProvider test_section_previous_activity_data
* @dataProvider section_previous_activity_data
* @param int $condition condition value
* @param bool $mark if Page 1 must be mark as completed
* @param string $section section to add the availability
@@ -634,7 +634,7 @@ class condition_test extends \advanced_testcase {
}
public function test_section_previous_activity_data(): array {
public function section_previous_activity_data(): array {
return [
// Condition, Activity completion, section to test, result, resultnot, description.
'Completion complete Section with no previous activity' => [
@@ -197,7 +197,12 @@ class condition extends \core_availability\condition {
$this->customfield);
}
} else {
$translatedfieldname = \core_user\fields::get_display_name($this->standardfield);
$standardfields = self::get_standard_profile_fields();
if (array_key_exists($this->standardfield, $standardfields)) {
$translatedfieldname = $standardfields[$this->standardfield];
} else {
$translatedfieldname = get_string('missing', 'availability_profile', $this->standardfield);
}
}
$a = new \stdClass();
// Not safe to call format_string here; use the special function to call it later.
@@ -321,6 +326,27 @@ class condition extends \core_availability\condition {
return $fieldconditionmet;
}
/**
* Return list of standard user profile fields used by the condition
*
* @return string[]
*/
public static function get_standard_profile_fields(): array {
return [
'firstname' => \core_user\fields::get_display_name('firstname'),
'lastname' => \core_user\fields::get_display_name('lastname'),
'email' => \core_user\fields::get_display_name('email'),
'city' => \core_user\fields::get_display_name('city'),
'country' => \core_user\fields::get_display_name('country'),
'idnumber' => \core_user\fields::get_display_name('idnumber'),
'institution' => \core_user\fields::get_display_name('institution'),
'department' => \core_user\fields::get_display_name('department'),
'phone1' => \core_user\fields::get_display_name('phone1'),
'phone2' => \core_user\fields::get_display_name('phone2'),
'address' => \core_user\fields::get_display_name('address'),
];
}
/**
* Gets data about custom profile fields. Cached statically in current
* request.
@@ -472,6 +498,11 @@ class condition extends \core_availability\condition {
$valuefield = 'data';
$default = $customfield->defaultdata;
} else {
$standardfields = self::get_standard_profile_fields();
if (!array_key_exists($this->standardfield, $standardfields)) {
// If the field isn't found, nobody matches.
return [];
}
$values = $DB->get_records_select('user', 'id ' . $sql, $params,
'', 'id, '. $this->standardfield);
$valuefield = $this->standardfield;
@@ -595,6 +626,11 @@ class condition extends \core_availability\condition {
$where = "(ud.data IS NOT NULL AND $condition)";
}
} else {
$standardfields = self::get_standard_profile_fields();
if (!array_key_exists($this->standardfield, $standardfields)) {
// If the field isn't found, nobody matches.
return ['SELECT id FROM {user} WHERE 0 = 1', []];
}
$tablesql = "JOIN {user} u ON u.id = userids.id";
list ($where, $mainparams) = $this->get_condition_sql(
'u.' . $this->standardfield);
@@ -42,20 +42,9 @@ class frontend extends \core_availability\frontend {
protected function get_javascript_init_params($course, \cm_info $cm = null,
\section_info $section = null) {
// Standard user fields.
$standardfields = array(
'firstname' => \core_user\fields::get_display_name('firstname'),
'lastname' => \core_user\fields::get_display_name('lastname'),
'email' => \core_user\fields::get_display_name('email'),
'city' => \core_user\fields::get_display_name('city'),
'country' => \core_user\fields::get_display_name('country'),
'idnumber' => \core_user\fields::get_display_name('idnumber'),
'institution' => \core_user\fields::get_display_name('institution'),
'department' => \core_user\fields::get_display_name('department'),
'phone1' => \core_user\fields::get_display_name('phone1'),
'phone2' => \core_user\fields::get_display_name('phone2'),
'address' => \core_user\fields::get_display_name('address')
);
$standardfields = condition::get_standard_profile_fields();
\core_collator::asort($standardfields);
// Custom fields.
@@ -39,7 +39,7 @@ $string['requires_notendswith'] = 'Your <strong>{$a->field}</strong> does not en
$string['requires_notisequalto'] = 'Your <strong>{$a->field}</strong> is not <strong>{$a->value}</strong>';
$string['requires_notstartswith'] = 'Your <strong>{$a->field}</strong> does not start with <strong>{$a->value}</strong>';
$string['requires_startswith'] = 'Your <strong>{$a->field}</strong> starts with <strong>{$a->value}</strong>';
$string['missing'] = '(Missing custom field: {$a})';
$string['missing'] = '(Missing field: {$a})';
$string['title'] = 'User profile';
$string['op_contains'] = 'contains';
$string['op_doesnotcontain'] = 'doesn\'t contain';
@@ -65,11 +65,8 @@ Feature: availability_profile
Given the following "custom profile fields" exist:
| datatype | shortname | name |
| text | superfield | Super field |
And I log in as "admin"
# Set field value for user.
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I click on ".icon[title=Edit]" "css_element" in the "s@example.com" "table_row"
And I am on the "s@example.com" "user > editing" page logged in as "admin"
And I expand all fieldsets
And I set the field "Super field" to "Bananaman"
And I click on "Update profile" "button"
@@ -55,7 +55,7 @@ Feature: display_availability
And I set the field "x[month]" to "March"
And I press "Save and return to course"
# Add a Page with 2 restrictions - one is set to hide from students if failed.
# Add a Page with 2 restrictions - one is set to Hide on course page if failed.
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | Page 2 |
+3 -1
View File
@@ -546,9 +546,11 @@ class backup_course_structure_step extends backup_structure_step {
backup_helper::is_sqlparam('course'),
backup::VAR_PARENTID));
// Section level settings are dealt with in backup_section_structure_step.
// We only need to deal with course level (sectionid = 0) here.
$courseformatoption->set_source_sql('SELECT id, format, sectionid, name, value
FROM {course_format_options}
WHERE courseid = ?', [ backup::VAR_PARENTID ]);
WHERE courseid = ? AND sectionid = 0', [ backup::VAR_PARENTID ]);
$handler = core_course\customfield\course_handler::create();
$fieldsforbackup = $handler->get_instance_data_for_backup($this->task->get_courseid());
@@ -246,16 +246,6 @@ abstract class restore_activity_task extends restore_task {
}
}
/**
* Given a commment area, return the itemname that contains the itemid mappings
*
* By default both are the same (commentarea = itemname), so return it. If some
* module uses a different approach, this method can be overriden in its taks
*/
public function get_comment_mapping_itemname($commentarea) {
return $commentarea;
}
/**
* Define (add) particular steps that each activity can have
*/
+21 -4
View File
@@ -767,6 +767,7 @@ class restore_decode_interlinks extends restore_execution_step {
protected function define_execution() {
// Get the decoder (from the plan)
/** @var restore_decode_processor $decoder */
$decoder = $this->task->get_decoder();
restore_decode_processor::register_link_decoders($decoder); // Add decoder contents and rules
// And launch it, everything will be processed
@@ -1952,6 +1953,10 @@ class restore_course_structure_step extends restore_structure_step {
// Course record ready, update it
$DB->update_record('course', $data);
// Apply any course format options that may be saved against the course
// entity in earlier-version backups.
course_get_format($data)->update_course_format_options($data);
// Role name aliases
restore_dbops::set_course_role_names($this->get_restoreid(), $this->get_courseid());
}
@@ -1989,8 +1994,14 @@ class restore_course_structure_step extends restore_structure_step {
public function process_course_format_option(array $data) : void {
global $DB;
if ($data['sectionid']) {
// Ignore section-level format options saved course-level in earlier-version backups.
return;
}
$courseid = $this->get_courseid();
$record = $DB->get_record('course_format_options', [ 'courseid' => $courseid, 'name' => $data['name'] ], 'id');
$record = $DB->get_record('course_format_options', [ 'courseid' => $courseid, 'name' => $data['name'],
'format' => $data['format'], 'sectionid' => 0 ], 'id');
if ($record !== false) {
$DB->update_record('course_format_options', (object) [ 'id' => $record->id, 'value' => $data['value'] ]);
} else {
@@ -5458,17 +5469,22 @@ class restore_process_file_aliases_queue extends restore_execution_step {
protected function define_execution() {
global $DB;
$this->log('processing file aliases queue', backup::LOG_DEBUG);
$fs = get_file_storage();
// Load the queue.
$aliascount = $DB->count_records('backup_ids_temp',
['backupid' => $this->get_restoreid(), 'itemname' => 'file_aliases_queue']);
$rs = $DB->get_recordset('backup_ids_temp',
array('backupid' => $this->get_restoreid(), 'itemname' => 'file_aliases_queue'),
['backupid' => $this->get_restoreid(), 'itemname' => 'file_aliases_queue'],
'', 'info');
$this->log('processing file aliases queue. ' . $aliascount . ' entries.', backup::LOG_DEBUG);
$progress = $this->task->get_progress();
$progress->start_progress('Processing file aliases queue', $aliascount);
// Iterate over aliases in the queue.
foreach ($rs as $record) {
$progress->increment_progress();
$info = backup_controller_dbops::decode_backup_temp_info($record->info);
// Try to pick a repository instance that should serve the alias.
@@ -5593,6 +5609,7 @@ class restore_process_file_aliases_queue extends restore_execution_step {
}
}
}
$progress->end_progress();
$rs->close();
}
@@ -77,6 +77,7 @@ class restore_decode_processor {
*/
public function execute() {
// Iterate over all contents, visiting them
/** @var restore_decode_content $content */
foreach ($this->contents as $content) {
$content->process($this);
}
+7
View File
@@ -201,9 +201,16 @@ class restore_plan extends base_plan implements loggable {
*/
public function execute_after_restore() {
// Simply iterate over each task in the plan and delegate to them the execution
$progress = $this->get_progress();
$progress->start_progress($this->get_name() .
': executing execute_after_restore for all tasks', count($this->tasks));
/** @var base_task $task */
foreach ($this->tasks as $task) {
$task->execute_after_restore();
$progress->increment_progress();
}
$progress->end_progress();
}
}
+13
View File
@@ -95,6 +95,19 @@ abstract class restore_task extends base_task {
return $this->plan->get_info()->original_system_contextid;
}
/**
* Given a commment area, return the itemname that contains the itemid mappings
*
* By default, both are the same (commentarea = itemname), so return it. If some
* plugins use a different approach, this method can be overriden in its task.
*
* @param string $commentarea area defined for this comment
* @return string itemname that contains the related itemid mapping
*/
public function get_comment_mapping_itemname($commentarea) {
return $commentarea;
}
/**
* If the task has been executed, launch its after_restore()
* method if available
+1 -3
View File
@@ -171,9 +171,7 @@ class block_accessreview extends block_base {
* @return bool
*/
public function can_block_be_added(moodle_page $page): bool {
global $CFG;
return $CFG->enableaccessibilitytools;
return accessibility::is_accessibility_enabled();
}
/**
+4 -1
View File
@@ -51,7 +51,9 @@ function block_accessreview_get_fontawesome_icon_map() {
/**
* Define preferences which may be set via the core_user_set_user_preferences external function.
*
* @return array
* @uses core_user::is_current_user
*
* @return array[]
*/
function block_accessreview_user_preferences(): array {
return [
@@ -60,6 +62,7 @@ function block_accessreview_user_preferences(): array {
'null' => NULL_NOT_ALLOWED,
'default' => 0,
'choices' => [0, 1],
'permissioncallback' => [core_user::class, 'is_current_user'],
],
];
}
+16 -7
View File
@@ -74,9 +74,11 @@ define('BLOCK_MYOVERVIEW_DISPLAY_CATEGORIES_OFF', 'off');
/**
* Get the current user preferences that are available
*
* @return mixed Array representing current options along with defaults
* @uses core_user::is_current_user
*
* @return array[] Array representing current options along with defaults
*/
function block_myoverview_user_preferences() {
function block_myoverview_user_preferences(): array {
$preferences['block_myoverview_user_grouping_preference'] = array(
'null' => NULL_NOT_ALLOWED,
'default' => BLOCK_MYOVERVIEW_GROUPING_ALL,
@@ -90,13 +92,15 @@ function block_myoverview_user_preferences() {
BLOCK_MYOVERVIEW_GROUPING_FAVOURITES,
BLOCK_MYOVERVIEW_GROUPING_HIDDEN,
BLOCK_MYOVERVIEW_GROUPING_CUSTOMFIELD,
)
),
'permissioncallback' => [core_user::class, 'is_current_user'],
);
$preferences['block_myoverview_user_grouping_customfieldvalue_preference'] = [
'null' => NULL_ALLOWED,
'default' => null,
'type' => PARAM_RAW,
'permissioncallback' => [core_user::class, 'is_current_user'],
];
$preferences['block_myoverview_user_sort_preference'] = array(
@@ -107,8 +111,10 @@ function block_myoverview_user_preferences() {
BLOCK_MYOVERVIEW_SORTING_TITLE,
BLOCK_MYOVERVIEW_SORTING_LASTACCESSED,
BLOCK_MYOVERVIEW_SORTING_SHORTNAME
)
),
'permissioncallback' => [core_user::class, 'is_current_user'],
);
$preferences['block_myoverview_user_view_preference'] = array(
'null' => NULL_NOT_ALLOWED,
'default' => BLOCK_MYOVERVIEW_VIEW_CARD,
@@ -117,7 +123,8 @@ function block_myoverview_user_preferences() {
BLOCK_MYOVERVIEW_VIEW_CARD,
BLOCK_MYOVERVIEW_VIEW_LIST,
BLOCK_MYOVERVIEW_VIEW_SUMMARY
)
),
'permissioncallback' => [core_user::class, 'is_current_user'],
);
$preferences['/^block_myoverview_hidden_course_(\d)+$/'] = array(
@@ -125,7 +132,8 @@ function block_myoverview_user_preferences() {
'choices' => array(0, 1),
'type' => PARAM_INT,
'null' => NULL_NOT_ALLOWED,
'default' => 'none'
'default' => 0,
'permissioncallback' => [core_user::class, 'is_current_user'],
);
$preferences['block_myoverview_user_paging_preference'] = array(
@@ -138,7 +146,8 @@ function block_myoverview_user_preferences() {
BLOCK_MYOVERVIEW_PAGING_48,
BLOCK_MYOVERVIEW_PAGING_96,
BLOCK_MYOVERVIEW_PAGING_ALL
)
),
'permissioncallback' => [core_user::class, 'is_current_user'],
);
return $preferences;
+1 -1
View File
@@ -26,7 +26,7 @@
<div id="block-myoverview-{{uniqid}}" class="block-myoverview block-cards" data-region="myoverview" role="navigation">
<hr class="mt-0"/>
<div data-region="filter" class="d-flex align-items-center my-2" aria-label="{{#str}} aria:controls, block_myoverview {{/str}}">
<div role="search" data-region="filter" class="d-flex align-items-center my-2" aria-label="{{#str}} aria:controls, block_myoverview {{/str}}">
<div class="row no-gutters">
{{> block_myoverview/nav-grouping-selector }}
@@ -42,7 +42,7 @@
<div class="card-deck dashboard-card-deck one-row" data-region="items-list" role="list">
{{#items}}
<a class="card dashboard-card mb-1" href="{{{viewurl}}}" title="{{{name}}}">
<a class="card dashboard-card mb-1" href="{{{viewurl}}}" title="{{{name}}}" role="listitem">
<div class="card-body p-2 m-1">
<div class="d-flex text-truncate">
<div class="d-flex align-self-center activityiconcontainer {{purpose}}">
@@ -37,7 +37,7 @@ Feature: The recently accessed items block allows users to easily access their m
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| assign | Test assignment name | Test assignment description | C1 | assign1 |
| book | Test book name | Test book description | C1 | book1 |
| book | Test book name | | C1 | book1 |
| choice | Test choice name | Test choice description | C1 | choice1 |
| data | Test database name | Test database description | C1 | data1 |
And I change window size to "large"
@@ -92,8 +92,11 @@ class renderer extends \plugin_renderer_base {
* @return string
*/
public function format_published_date($timestamp) {
return strftime(get_string('strftimerecentfull', 'langconfig'), $timestamp);
return date('j F Y, g:i a', $timestamp);
if (empty($timestamp)) {
return '';
} else {
return strftime(get_string('strftimerecentfull', 'langconfig'), $timestamp);
}
}
/**
@@ -57,8 +57,8 @@ Feature: Edit activities in main menu block
And I click on "Edit settings" "link" in the "My forum name" activity in site main menu block
And I expand all fieldsets
And the "Availability" select box should contain "Show on course page"
And the "Availability" select box should contain "Hide from students"
And the field "Availability" matches value "Make available but not shown on course page"
And the "Availability" select box should contain "Hide on course page"
And the field "Availability" matches value "Make available but don't show on course page"
And I press "Save and return to course"
And "My forum name" activity in site main menu block should be available but hidden from course page
And I turn editing mode off
@@ -67,8 +67,8 @@ Feature: Edit activities in social activities block
And I click on "Edit settings" "link" in the "My forum name" activity in social activities block
And I expand all fieldsets
And the "Availability" select box should contain "Show on course page"
And the "Availability" select box should contain "Hide from students"
And the field "Availability" matches value "Make available but not shown on course page"
And the "Availability" select box should contain "Hide on course page"
And the field "Availability" matches value "Make available but don't show on course page"
And I press "Save and return to course"
And "My forum name" activity in social activities block should be available but hidden from course page
And I turn editing mode off
+7 -10
View File
@@ -15,16 +15,13 @@ Feature: Block appearances
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | description | course | idnumber | section | template |
| survey | Test survey name | | C1 | survey1 | 1 | 4 |
| book | Test book name | Test book description | C1 | book1 | 1 | |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I click on "Test book name" "link" in the "region-main" "region"
And I set the following fields to these values:
| Chapter title | Book title |
| Content | Book content test test |
And I press "Save changes"
| activity | name | course | idnumber | section | template |
| survey | Test survey name | C1 | survey1 | 1 | 4 |
| book | Test book name | C1 | book1 | 1 | |
And the following "mod_book > chapter" exists:
| book | Test book name |
| title | Book title |
| content | Book content test test |
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
+5 -11
View File
@@ -17,17 +17,11 @@ Feature: Block region moving
And the following "activities" exist:
| activity | course | name | template |
| survey | C1 | Test survey name | 4 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Book" to section "1" and I fill the form with:
| Name | Test book name |
| Description | Test book description |
And I follow "Test book name"
And I set the following fields to these values:
| Chapter title | Book title |
| Content | Book content test test |
And I press "Save changes"
And I log out
| book | C1 | Test book name | |
And the following "mod_book > chapter" exists:
| book | Test book name |
| title | Book title |
| content | Book content test test |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Comments" block
+10 -5
View File
@@ -43,14 +43,17 @@ define('BLOCK_TIMELINE_ACTIVITIES_LIMIT_DEFAULT', 5);
/**
* Returns the name of the user preferences as well as the details this plugin uses.
*
* @return array
* @uses core_user::is_current_user
*
* @return array[]
*/
function block_timeline_user_preferences() {
function block_timeline_user_preferences(): array {
$preferences['block_timeline_user_sort_preference'] = array(
'null' => NULL_NOT_ALLOWED,
'default' => BLOCK_TIMELINE_SORT_BY_DATES,
'type' => PARAM_ALPHA,
'choices' => array(BLOCK_TIMELINE_SORT_BY_DATES, BLOCK_TIMELINE_SORT_BY_COURSES)
'choices' => array(BLOCK_TIMELINE_SORT_BY_DATES, BLOCK_TIMELINE_SORT_BY_COURSES),
'permissioncallback' => [core_user::class, 'is_current_user'],
);
$preferences['block_timeline_user_filter_preference'] = array(
@@ -64,13 +67,15 @@ function block_timeline_user_preferences() {
BLOCK_TIMELINE_FILTER_BY_30_DAYS,
BLOCK_TIMELINE_FILTER_BY_3_MONTHS,
BLOCK_TIMELINE_FILTER_BY_6_MONTHS
)
),
'permissioncallback' => [core_user::class, 'is_current_user'],
);
$preferences['block_timeline_user_limit_preference'] = array(
'null' => NULL_NOT_ALLOWED,
'default' => BLOCK_TIMELINE_ACTIVITIES_LIMIT_DEFAULT,
'type' => PARAM_INT
'type' => PARAM_INT,
'permissioncallback' => [core_user::class, 'is_current_user'],
);
return $preferences;
+1 -1
View File
@@ -52,7 +52,7 @@ $PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('cacheconfig', 'cache'), new moodle_url('/cache/admin.php'));
// Handle page actions in admin helper class.
if (!empty($action) && confirm_sesskey()) {
if (!empty($action)) {
$forminfo = $adminhelper->perform_cache_actions($action, $forminfo);
}
+14 -8
View File
@@ -66,14 +66,14 @@ class administration_display_helper extends \core_cache\administration_helper {
// Edit mappings.
$actions[] = $OUTPUT->action_link(
new \moodle_url('/cache/admin.php', array('action' => 'editdefinitionmapping',
'definition' => $definitionsummary['id'], 'sesskey' => sesskey())),
'definition' => $definitionsummary['id'])),
get_string('editmappings', 'cache')
);
// Edit sharing.
if (count($definitionsummary['sharingoptions']) > 1) {
$actions[] = $OUTPUT->action_link(
new \moodle_url('/cache/admin.php', array('action' => 'editdefinitionsharing',
'definition' => $definitionsummary['id'], 'sesskey' => sesskey())),
'definition' => $definitionsummary['id'])),
get_string('editsharing', 'cache')
);
}
@@ -100,21 +100,22 @@ class administration_display_helper extends \core_cache\administration_helper {
global $OUTPUT;
$actions = array();
if (has_capability('moodle/site:config', \context_system::instance())) {
$baseurl = new \moodle_url('/cache/admin.php', array('store' => $name, 'sesskey' => sesskey()));
$baseurl = new \moodle_url('/cache/admin.php', array('store' => $name));
if (empty($storedetails['default'])) {
// Edit store.
$actions[] = $OUTPUT->action_link(
new \moodle_url($baseurl, array('action' => 'editstore', 'plugin' => $storedetails['plugin'])),
get_string('editstore', 'cache')
);
// Delete store.
$actions[] = $OUTPUT->action_link(
new \moodle_url($baseurl, array('action' => 'deletestore')),
get_string('deletestore', 'cache')
);
}
// Purge store.
$actions[] = $OUTPUT->action_link(
new \moodle_url($baseurl, array('action' => 'purgestore')),
new \moodle_url($baseurl, array('action' => 'purgestore', 'sesskey' => sesskey())),
get_string('purge', 'cache')
);
}
@@ -135,7 +136,7 @@ class administration_display_helper extends \core_cache\administration_helper {
if (has_capability('moodle/site:config', \context_system::instance())) {
if (!empty($plugindetails['canaddinstance'])) {
$url = new \moodle_url('/cache/admin.php',
array('action' => 'addstore', 'plugin' => $name, 'sesskey' => sesskey()));
array('action' => 'addstore', 'plugin' => $name));
$actions[] = $OUTPUT->action_link(
$url,
get_string('addinstance', 'cache')
@@ -429,6 +430,7 @@ class administration_display_helper extends \core_cache\administration_helper {
public function action_rescan_definition() {
global $PAGE;
require_sesskey();
\cache_config_writer::update_definitions();
redirect($PAGE->url);
}
@@ -537,6 +539,7 @@ class administration_display_helper extends \core_cache\administration_helper {
echo $OUTPUT->footer();
exit;
} else {
require_sesskey();
$writer = \cache_config_writer::instance();
$writer->delete_store_instance($store);
redirect($PAGE->url, get_string('deletestoresuccess', 'cache'), 5);
@@ -657,6 +660,7 @@ class administration_display_helper extends \core_cache\administration_helper {
public function action_purgedefinition() {
global $PAGE;
require_sesskey();
$id = required_param('definition', PARAM_SAFEPATH);
list($component, $area) = explode('/', $id, 2);
$factory = cache_factory::instance();
@@ -688,6 +692,7 @@ class administration_display_helper extends \core_cache\administration_helper {
public function action_purge() {
global $PAGE;
require_sesskey();
$store = required_param('store', PARAM_TEXT);
cache_helper::purge_store($store);
$message = get_string('purgexstoresuccess', 'cache', ['store' => $store]);
@@ -758,6 +763,7 @@ class administration_display_helper extends \core_cache\administration_helper {
echo $OUTPUT->footer();
exit;
} else {
require_sesskey();
$writer = cache_config_writer::instance();
$writer->delete_lock_instance($lock);
redirect($PAGE->url, get_string('deletelocksuccess', 'cache'), 5);
@@ -790,7 +796,7 @@ class administration_display_helper extends \core_cache\administration_helper {
$applicationstore = join(', ', $defaultmodestores[cache_store::MODE_APPLICATION]);
$sessionstore = join(', ', $defaultmodestores[cache_store::MODE_SESSION]);
$requeststore = join(', ', $defaultmodestores[cache_store::MODE_REQUEST]);
$editurl = new \moodle_url('/cache/admin.php', array('action' => 'editmodemappings', 'sesskey' => sesskey()));
$editurl = new \moodle_url('/cache/admin.php', array('action' => 'editmodemappings'));
$html .= $renderer->mode_mappings($applicationstore, $sessionstore, $requeststore, $editurl);
return $html;
+2 -2
View File
@@ -353,7 +353,7 @@ class renderer extends \plugin_renderer_base {
foreach ($locks as $lock) {
$actions = array();
if ($lock['uses'] === 0 && !$lock['default']) {
$url = new moodle_url('/cache/admin.php', array('lock' => $lock['name'], 'action' => 'deletelock', 'sesskey' => sesskey()));
$url = new moodle_url('/cache/admin.php', array('lock' => $lock['name'], 'action' => 'deletelock'));
$actions[] = html_writer::link($url, get_string('delete', 'cache'));
}
$table->data[] = new html_table_row(array(
@@ -378,7 +378,7 @@ class renderer extends \plugin_renderer_base {
* @return string
*/
public function additional_lock_actions() : string {
$url = new moodle_url('/cache/admin.php', array('action' => 'newlockinstance', 'sesskey' => sesskey()));
$url = new moodle_url('/cache/admin.php', array('action' => 'newlockinstance'));
$select = new single_select($url, 'lock', cache_factory::get_administration_display_helper()->get_addable_lock_options());
$select->label = get_string('addnewlockinstance', 'cache');
@@ -20,7 +20,7 @@ namespace MongoDB\Exception;
use MongoDB\Driver\Exception\InvalidArgumentException as DriverInvalidArgumentException;
use function array_pop;
use function count;
use function get_debug_type;
use function gettype;
use function implode;
use function is_array;
use function sprintf;
@@ -56,6 +56,6 @@ class InvalidArgumentException extends DriverInvalidArgumentException implements
$expectedType = $typeString;
}
return new static(sprintf('Expected %s to have type "%s" but found "%s"', $name, $expectedType, get_debug_type($value)));
return new static(sprintf('Expected %s to have type "%s" but found "%s"', $name, $expectedType, gettype($value)));
}
}
@@ -17,7 +17,7 @@
namespace MongoDB\Exception;
use function get_debug_type;
use function gettype;
use function sprintf;
class ResumeTokenException extends RuntimeException
@@ -30,7 +30,7 @@ class ResumeTokenException extends RuntimeException
*/
public static function invalidType($value)
{
return new static(sprintf('Expected resume token to have type "array or object" but found "%s"', get_debug_type($value)));
return new static(sprintf('Expected resume token to have type "array or object" but found "%s"', gettype($value)));
}
/**
+4
View File
@@ -10,3 +10,7 @@ Import procedure:
- Check the minim php driver version in https://docs.mongodb.com/drivers/php#compatibility and change the value in the "are_requirements_met" method if necessary.
This version (1.8.0) requires PHP mongodb extension >= 1.8.0
Local changes:
- Replaced 4 occurrences of get_debug_type() by gettype() to keep PHP 7.4 compatibility. Note this
has not been applied to 4.2dev and up because, there, it's safe to use get_debug_type().
+5 -5
View File
@@ -2795,7 +2795,7 @@ class externallib_test extends externallib_advanced_testcase {
*
* @return array
*/
public function test_get_calendar_event_by_id_prevent_read_other_users_events_data_provider(): array {
public function get_calendar_event_by_id_prevent_read_other_users_events_data_provider(): array {
$syscontext = \context_system::instance();
$managerrole = 'manager';
return [
@@ -2810,7 +2810,7 @@ class externallib_test extends externallib_advanced_testcase {
* Prevent user from reading other user's event.
*
* @covers \core_calendar_external::get_calendar_event_by_id
* @dataProvider test_get_calendar_event_by_id_prevent_read_other_users_events_data_provider
* @dataProvider get_calendar_event_by_id_prevent_read_other_users_events_data_provider
*
* @param bool $isadminevent Is admin's event
* @param bool $isadmin Is current user admin user
@@ -2866,7 +2866,7 @@ class externallib_test extends externallib_advanced_testcase {
*
* @return array
*/
public function test_edit_or_delete_other_users_events_data_provider(): array {
public function edit_or_delete_other_users_events_data_provider(): array {
$syscontext = \context_system::instance();
$managerrole = 'manager';
return [
@@ -2880,7 +2880,7 @@ class externallib_test extends externallib_advanced_testcase {
/**
* Test the behavior of deleting other users' user events.
*
* @dataProvider test_edit_or_delete_other_users_events_data_provider
* @dataProvider edit_or_delete_other_users_events_data_provider
* @covers \core_calendar_external::delete_calendar_events
* @param bool $isadmin Whether the current user is admin.
* @param bool $isadminevent Whether it's an admin event or not.
@@ -2927,7 +2927,7 @@ class externallib_test extends externallib_advanced_testcase {
/**
* Test the behavior of editing other users' user events
*
* @dataProvider test_edit_or_delete_other_users_events_data_provider
* @dataProvider edit_or_delete_other_users_events_data_provider
* @covers \core_calendar_external::submit_create_update_form
* @param bool $isadmin Whether the current user is admin.
* @param bool $isadminevent Whether it's an admin event or not.
+6 -6
View File
@@ -49,7 +49,7 @@ class std_proxy_test extends \advanced_testcase {
/**
* Test proxying.
*
* @dataProvider test_proxy_testcases()
* @dataProvider proxy_testcases
* @param int $id Object ID.
* @param string $member Object member to retrieve.
* @param mixed $expected Expected value of member.
@@ -65,7 +65,7 @@ class std_proxy_test extends \advanced_testcase {
/**
* Test setting values with a base class.
*
* @dataProvider test_proxy_testcases()
* @dataProvider proxy_testcases
* @param int $id Object ID.
* @param string $member Object member to retrieve.
* @param mixed $storedvalue Value as would be stored externally.
@@ -86,7 +86,7 @@ class std_proxy_test extends \advanced_testcase {
/**
* Test getting a non existant member.
*
* @dataProvider test_get_set_testcases()
* @dataProvider get_set_testcases
* @param int $id ID of the object being proxied.
*/
public function test_get_invalid_member($id) {
@@ -101,7 +101,7 @@ class std_proxy_test extends \advanced_testcase {
/**
* Test get proxied instance.
*
* @dataProvider test_get_set_testcases()
* @dataProvider get_set_testcases
* @param int $id Object ID.
*/
public function test_get_proxied_instance($id) {
@@ -115,7 +115,7 @@ class std_proxy_test extends \advanced_testcase {
/**
* Test cases for proxying test.
*/
public function test_proxy_testcases() {
public function proxy_testcases() {
return [
'Object 1 member 1' => [
1,
@@ -153,7 +153,7 @@ class std_proxy_test extends \advanced_testcase {
/**
* Test cases for getting and setting tests.
*/
public function test_get_set_testcases() {
public function get_set_testcases() {
return [
'Object 1' => [1],
'Object 2' => [5]
+5 -3
View File
@@ -63,9 +63,11 @@ class cohortidnumber extends \core\output\inplace_editable {
$cohortcontext = \context::instance_by_id($cohort->contextid);
\external_api::validate_context($cohortcontext);
require_capability('moodle/cohort:manage', $cohortcontext);
$record = (object)array('id' => $cohort->id, 'idnumber' => $newvalue, 'contextid' => $cohort->contextid);
cohort_update_cohort($record);
$cohort->idnumber = $newvalue;
if ($newvalue == '' || !$DB->record_exists_select('cohort', 'idnumber = ? AND id != ?', [$newvalue, $cohort->id])) {
$record = (object) ['id' => $cohort->id, 'idnumber' => $newvalue, 'contextid' => $cohort->contextid];
cohort_update_cohort($record);
$cohort->idnumber = $newvalue;
}
return new static($cohort);
}
}
+7 -10
View File
@@ -14,17 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Data provider.
*
* @package core_competency
* @copyright 2018 Frédéric Massart
* @author Frédéric Massart <fred@branchup.tech>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_competency\privacy;
defined('MOODLE_INTERNAL') || die();
use context;
use context_course;
@@ -584,9 +574,16 @@ class provider implements
/**
* Export all user data for the specified user, in the specified contexts.
*
* We skip the enabled check for competencies, as there could be historical data. This avoids exceptions thrown from
* the {@see api::require_enabled} method, which is called at various points during export via the competency API
*
* @param approved_contextlist $contextlist The approved contexts to export information for.
*/
public static function export_user_data(approved_contextlist $contextlist) {
// Export even if competencies are not currently enabled.
api::skip_enabled();
$user = $contextlist->get_user();
$userid = $user->id;
+1
View File
@@ -339,6 +339,7 @@ class core_completion_external extends external_api {
)
]
),
'Completion status details',
VALUE_DEFAULT,
[]
),
@@ -0,0 +1,137 @@
@core @core_completion
Feature: Students will be shown relevant completion state based on grade item visibility.
In order to understand completion states of course modules
As a student
I need to see relevant completion information for various combination of activity passgrade settings
Background:
Given the following "courses" exist:
| fullname | shortname | category | enablecompletion |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
| student2 | Student | Second | student2@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| name | Test assignment name |
| intro | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| completion | 2 |
| completionpassgrade | 1 |
| completionusegrade | 1 |
| gradepass | 50 |
And I am on the "Course 1" course page logged in as teacher1
And "Student First" user has not completed "Test assignment name" activity
And I log out
And I am on the "Course 1" course page logged in as student1
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "todo"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "todo"
And I log out
Scenario: Passing grade and receive a grade completions for visible grade item (passgrade completion enabled)
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "21" to the user "Student First" for the grade item "Test assignment name"
And I give the grade "50" to the user "Student Second" for the grade item "Test assignment name"
And I press "Save changes"
And I am on "Course 1" course homepage
And "Student First" user has completed "Test assignment name" activity
And "Student Second" user has completed "Test assignment name" activity
And I log out
When I am on the "Course 1" course page logged in as student1
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "failed"
And I log out
And I am on the "Course 1" course page logged in as student2
Then the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "done"
Scenario: Passing grade and receive a grade completions for hidden grade item (passgrade completion enabled)
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I hide the grade item "Test assignment name"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "21" to the user "Student First" for the grade item "Test assignment name"
And I give the grade "50" to the user "Student Second" for the grade item "Test assignment name"
And I press "Save changes"
And I am on "Course 1" course homepage
And "Student First" user has not completed "Test assignment name" activity
And "Student Second" user has completed "Test assignment name" activity
And I log out
And I am on the "Course 1" course page logged in as student1
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "todo"
And I log out
And I am on the "Course 1" course page logged in as student2
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "done"
Scenario: Receive a grade completion for visible grade item (passgrade completion disabled)
Given I am on the "Test assignment name" Activity page logged in as teacher1
When I navigate to "Settings" in current page administration
And I set the following fields to these values:
| completionpassgrade | 0 |
And I press "Save and display"
And I log out
And I am on the "Course 1" course page logged in as student1
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "todo"
And I should not see "Receive a passing grade"
And I log out
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "21" to the user "Student First" for the grade item "Test assignment name"
And I give the grade "50" to the user "Student Second" for the grade item "Test assignment name"
And I press "Save changes"
And I am on "Course 1" course homepage
And "Student First" user has completed "Test assignment name" activity
And "Student Second" user has completed "Test assignment name" activity
And I log out
When I am on the "Course 1" course page logged in as student1
# Once MDL-75582 is fixed "failed" should be changed to "done"
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "failed"
And I should not see "Receive a passing grade"
And I log out
And I am on the "Course 1" course page logged in as student2
Then the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
Scenario: Receive a grade completion for hidden grade item (passgrade completion disabled)
Given I am on the "Test assignment name" Activity page logged in as teacher1
When I navigate to "Settings" in current page administration
And I set the following fields to these values:
| completionpassgrade | 0 |
And I press "Save and display"
And I log out
And I am on the "Course 1" course page logged in as student1
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "todo"
And I should not see "Receive a passing grade"
And I log out
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I hide the grade item "Test assignment name"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "21" to the user "Student First" for the grade item "Test assignment name"
And I give the grade "50" to the user "Student Second" for the grade item "Test assignment name"
And I press "Save changes"
And I am on "Course 1" course homepage
And "Student First" user has completed "Test assignment name" activity
And "Student Second" user has completed "Test assignment name" activity
And I log out
When I am on the "Course 1" course page logged in as student1
Then the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And I should not see "Receive a passing grade"
And I log out
And I am on the "Course 1" course page logged in as student2
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
+1 -1
View File
@@ -6,6 +6,6 @@ define("core_contentbank/selectors",["exports"],(function(_exports){Object.defin
* @copyright 2020 Sara Arjona <sara@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
const getDataSelector=(name,value)=>"[data-".concat(name,'="').concat(value,'"]');var _default={regions:{cbcontentname:getDataSelector("region","cb-content-name"),contentbank:getDataSelector("region","contentbank"),filearea:getDataSelector("region","filearea")},actions:{search:getDataSelector("action","searchcontent"),clearSearch:getDataSelector("action","clearsearch"),viewgrid:getDataSelector("action","viewgrid"),viewlist:getDataSelector("action","viewlist"),sortname:getDataSelector("action","sortname"),sortuses:getDataSelector("action","sortuses"),sortdate:getDataSelector("action","sortdate"),sortsize:getDataSelector("action","sortsize"),sorttype:getDataSelector("action","sorttype"),sortauthor:getDataSelector("action","sortauthor")},elements:{listitem:".cb-listitem",heading:".cb-heading",cell:".cb-column",cbnavbarbreadcrumb:".cb-navbar-breadbrumb",cbnavbartotalsearch:".cb-navbar-totalsearch",searchinput:"#searchinput",sortbutton:".cb-btnsort"}};return _exports.default=_default,_exports.default}));
const getDataSelector=(name,value)=>"[data-".concat(name,'="').concat(value,'"]');var _default={regions:{cbcontentname:getDataSelector("region","cb-content-name"),contentbank:getDataSelector("region","contentbank"),filearea:getDataSelector("region","filearea")},actions:{search:getDataSelector("action","searchcontent"),clearSearch:getDataSelector("action","clearsearch"),viewgrid:getDataSelector("action","viewgrid"),viewlist:getDataSelector("action","viewlist"),sortname:getDataSelector("action","sortname"),sortuses:getDataSelector("action","sortuses"),sortdate:getDataSelector("action","sortdate"),sortsize:getDataSelector("action","sortsize"),sorttype:getDataSelector("action","sorttype"),sortauthor:getDataSelector("action","sortauthor")},elements:{listitem:".cb-listitem",heading:".cb-heading",cell:".cb-column",cbnavbarbreadcrumb:".cb-navbar-breadbrumb",cbnavbartotalsearch:".cb-navbar-totalsearch",searchinput:'[role="searchbox"]',sortbutton:".cb-btnsort"}};return _exports.default=_default,_exports.default}));
//# sourceMappingURL=selectors.min.js.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"selectors.min.js","sources":["../src/selectors.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Define all of the selectors we will be using on the contentbank interface.\n *\n * @module core_contentbank/selectors\n * @copyright 2020 Sara Arjona <sara@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * A small helper function to build queryable data selectors.\n *\n * @method getDataSelector\n * @param {String} name\n * @param {String} value\n * @return {string}\n */\nconst getDataSelector = (name, value) => {\n return `[data-${name}=\"${value}\"]`;\n};\n\nexport default {\n regions: {\n cbcontentname: getDataSelector('region', 'cb-content-name'),\n contentbank: getDataSelector('region', 'contentbank'),\n filearea: getDataSelector('region', 'filearea')\n },\n actions: {\n search: getDataSelector('action', 'searchcontent'),\n clearSearch: getDataSelector('action', 'clearsearch'),\n viewgrid: getDataSelector('action', 'viewgrid'),\n viewlist: getDataSelector('action', 'viewlist'),\n sortname: getDataSelector('action', 'sortname'),\n sortuses: getDataSelector('action', 'sortuses'),\n sortdate: getDataSelector('action', 'sortdate'),\n sortsize: getDataSelector('action', 'sortsize'),\n sorttype: getDataSelector('action', 'sorttype'),\n sortauthor: getDataSelector('action', 'sortauthor'),\n },\n elements: {\n listitem: '.cb-listitem',\n heading: '.cb-heading',\n cell: '.cb-column',\n cbnavbarbreadcrumb: '.cb-navbar-breadbrumb',\n cbnavbartotalsearch: '.cb-navbar-totalsearch',\n searchinput: '#searchinput',\n sortbutton: '.cb-btnsort'\n },\n};\n"],"names":["getDataSelector","name","value","regions","cbcontentname","contentbank","filearea","actions","search","clearSearch","viewgrid","viewlist","sortname","sortuses","sortdate","sortsize","sorttype","sortauthor","elements","listitem","heading","cell","cbnavbarbreadcrumb","cbnavbartotalsearch","searchinput","sortbutton"],"mappings":";;;;;;;;MA+BMA,gBAAkB,CAACC,KAAMC,wBACXD,kBAASC,yBAGd,CACXC,QAAS,CACLC,cAAeJ,gBAAgB,SAAU,mBACzCK,YAAaL,gBAAgB,SAAU,eACvCM,SAAUN,gBAAgB,SAAU,aAExCO,QAAS,CACLC,OAAQR,gBAAgB,SAAU,iBAClCS,YAAaT,gBAAgB,SAAU,eACvCU,SAAUV,gBAAgB,SAAU,YACpCW,SAAUX,gBAAgB,SAAU,YACpCY,SAAUZ,gBAAgB,SAAU,YACpCa,SAAUb,gBAAgB,SAAU,YACpCc,SAAUd,gBAAgB,SAAU,YACpCe,SAAUf,gBAAgB,SAAU,YACpCgB,SAAUhB,gBAAgB,SAAU,YACpCiB,WAAYjB,gBAAgB,SAAU,eAE1CkB,SAAU,CACNC,SAAU,eACVC,QAAS,cACTC,KAAM,aACNC,mBAAoB,wBACpBC,oBAAqB,yBACrBC,YAAa,eACbC,WAAY"}
{"version":3,"file":"selectors.min.js","sources":["../src/selectors.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Define all of the selectors we will be using on the contentbank interface.\n *\n * @module core_contentbank/selectors\n * @copyright 2020 Sara Arjona <sara@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * A small helper function to build queryable data selectors.\n *\n * @method getDataSelector\n * @param {String} name\n * @param {String} value\n * @return {string}\n */\nconst getDataSelector = (name, value) => {\n return `[data-${name}=\"${value}\"]`;\n};\n\nexport default {\n regions: {\n cbcontentname: getDataSelector('region', 'cb-content-name'),\n contentbank: getDataSelector('region', 'contentbank'),\n filearea: getDataSelector('region', 'filearea')\n },\n actions: {\n search: getDataSelector('action', 'searchcontent'),\n clearSearch: getDataSelector('action', 'clearsearch'),\n viewgrid: getDataSelector('action', 'viewgrid'),\n viewlist: getDataSelector('action', 'viewlist'),\n sortname: getDataSelector('action', 'sortname'),\n sortuses: getDataSelector('action', 'sortuses'),\n sortdate: getDataSelector('action', 'sortdate'),\n sortsize: getDataSelector('action', 'sortsize'),\n sorttype: getDataSelector('action', 'sorttype'),\n sortauthor: getDataSelector('action', 'sortauthor'),\n },\n elements: {\n listitem: '.cb-listitem',\n heading: '.cb-heading',\n cell: '.cb-column',\n cbnavbarbreadcrumb: '.cb-navbar-breadbrumb',\n cbnavbartotalsearch: '.cb-navbar-totalsearch',\n searchinput: '[role=\"searchbox\"]',\n sortbutton: '.cb-btnsort'\n },\n};\n"],"names":["getDataSelector","name","value","regions","cbcontentname","contentbank","filearea","actions","search","clearSearch","viewgrid","viewlist","sortname","sortuses","sortdate","sortsize","sorttype","sortauthor","elements","listitem","heading","cell","cbnavbarbreadcrumb","cbnavbartotalsearch","searchinput","sortbutton"],"mappings":";;;;;;;;MA+BMA,gBAAkB,CAACC,KAAMC,wBACXD,kBAASC,yBAGd,CACXC,QAAS,CACLC,cAAeJ,gBAAgB,SAAU,mBACzCK,YAAaL,gBAAgB,SAAU,eACvCM,SAAUN,gBAAgB,SAAU,aAExCO,QAAS,CACLC,OAAQR,gBAAgB,SAAU,iBAClCS,YAAaT,gBAAgB,SAAU,eACvCU,SAAUV,gBAAgB,SAAU,YACpCW,SAAUX,gBAAgB,SAAU,YACpCY,SAAUZ,gBAAgB,SAAU,YACpCa,SAAUb,gBAAgB,SAAU,YACpCc,SAAUd,gBAAgB,SAAU,YACpCe,SAAUf,gBAAgB,SAAU,YACpCgB,SAAUhB,gBAAgB,SAAU,YACpCiB,WAAYjB,gBAAgB,SAAU,eAE1CkB,SAAU,CACNC,SAAU,eACVC,QAAS,cACTC,KAAM,aACNC,mBAAoB,wBACpBC,oBAAqB,yBACrBC,YAAa,qBACbC,WAAY"}
+1 -1
View File
@@ -57,7 +57,7 @@ export default {
cell: '.cb-column',
cbnavbarbreadcrumb: '.cb-navbar-breadbrumb',
cbnavbartotalsearch: '.cb-navbar-totalsearch',
searchinput: '#searchinput',
searchinput: '[role="searchbox"]',
sortbutton: '.cb-btnsort'
},
};
+6 -3
View File
@@ -27,15 +27,18 @@ use \core_contentbank\content;
/**
* Get the current user preferences that are available
*
* @return Array preferences configuration
* @uses core_user::is_current_user
*
* @return array[] preferences configuration
*/
function core_contentbank_user_preferences() {
function core_contentbank_user_preferences(): array {
return [
'core_contentbank_view_list' => [
'choices' => array(0, 1),
'type' => PARAM_INT,
'null' => NULL_NOT_ALLOWED,
'default' => 'none'
'default' => 0,
'permissioncallback' => [core_user::class, 'is_current_user'],
],
'core_contentbank_visibility' => [
'choices' => [content::VISIBILITY_UNLISTED, content::VISIBILITY_PUBLIC],
+2
View File
@@ -26,6 +26,8 @@ namespace core_course\management;
defined('MOODLE_INTERNAL') || die;
require_once($CFG->dirroot . '/course/lib.php');
/**
* Course and category management interface helper class.
*
+4 -3
View File
@@ -483,6 +483,7 @@ class core_course_external extends external_api {
'dataid' => new external_value(PARAM_NOTAGS, 'cm data id', VALUE_OPTIONAL),
)
),
'Course dates',
VALUE_DEFAULT,
[]
),
@@ -514,7 +515,7 @@ class core_course_external extends external_api {
VALUE_OPTIONAL
),
)
), VALUE_DEFAULT, array()
), 'Course contents', VALUE_DEFAULT, array()
),
'contentsinfo' => new external_single_structure(
array(
@@ -1305,7 +1306,7 @@ class core_course_external extends external_api {
'value' => new external_value(PARAM_RAW, 'the value for the option 1 (yes) or 0 (no)'
)
)
), VALUE_DEFAULT, array()
), 'Course duplication options', VALUE_DEFAULT, array()
),
)
);
@@ -1532,7 +1533,7 @@ class core_course_external extends external_api {
'value' => new external_value(PARAM_RAW, 'the value for the option 1 (yes) or 0 (no)'
)
)
), VALUE_DEFAULT, array()
), 'Course import options', VALUE_DEFAULT, array()
),
)
);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4 -1
View File
@@ -158,7 +158,10 @@ export default class Component extends BaseComponent {
*/
_sectionTogglers(event) {
const sectionlink = event.target.closest(this.selectors.TOGGLER);
const isChevron = event.target.closest(this.selectors.COLLAPSE);
const closestCollapse = event.target.closest(this.selectors.COLLAPSE);
// Assume that chevron is the only collapse toggler in a section heading;
// I think this is the most efficient way to verify at the moment.
const isChevron = closestCollapse?.closest(this.selectors.SECTION_ITEM);
if (sectionlink || isChevron) {
@@ -295,6 +295,9 @@ export default class {
*/
async sectionIndexCollapsed(stateManager, sectionIds, collapsed) {
const collapsedIds = this._updateStateSectionPreference(stateManager, 'indexcollapsed', sectionIds, collapsed);
if (!collapsedIds) {
return;
}
const course = stateManager.get('course');
await this._callEditWebservice('section_index_collapsed', course.id, collapsedIds);
}
@@ -308,6 +311,9 @@ export default class {
*/
async sectionContentCollapsed(stateManager, sectionIds, collapsed) {
const collapsedIds = this._updateStateSectionPreference(stateManager, 'contentcollapsed', sectionIds, collapsed);
if (!collapsedIds) {
return;
}
const course = stateManager.get('course');
await this._callEditWebservice('section_content_collapsed', course.id, collapsedIds);
}
@@ -319,7 +325,7 @@ export default class {
* @param {string} preferenceName the preference name
* @param {array} sectionIds the affected section ids
* @param {boolean} preferenceValue the new preferenceValue value
* @return {array} the list of all sections with that preference set to true
* @return {Number[]|null} sections ids with the preference value true or null if no update is required
*/
_updateStateSectionPreference(stateManager, preferenceName, sectionIds, preferenceValue) {
stateManager.setReadOnly(false);
@@ -328,7 +334,7 @@ export default class {
sectionIds.forEach(sectionId => {
const section = stateManager.get('section', sectionId);
if (section === undefined) {
return;
return null;
}
const newValue = preferenceValue ?? section[preferenceName];
if (section[preferenceName] != newValue) {
@@ -338,7 +344,7 @@ export default class {
});
stateManager.setReadOnly(true);
if (affectedSections.size == 0) {
return [];
return null;
}
// Get all collapsed section ids.
const collapsedSectionIds = [];
+12
View File
@@ -225,6 +225,18 @@ abstract class base {
self::$instances = array();
}
}
/**
* Reset the current user for all courses.
*
* The course format cache resets every time the course cache resets but
* also when the user changes their language, all course editors
*
* @return void
*/
public static function session_cache_reset_all(): void {
$statecache = cache::make('core', 'courseeditorstate');
$statecache->purge();
}
/**
* Reset the current user course format cache.
@@ -102,12 +102,15 @@ class cmname implements named_templatable, renderable {
'url' => $mod->url,
'icon' => $mod->get_icon_url(),
'modname' => $mod->modname,
'pluginname' => get_string('pluginname', 'mod_' . $mod->modname),
'textclasses' => $displayoptions['textclasses'] ?? '',
'purpose' => plugin_supports('mod', $mod->modname, FEATURE_MOD_PURPOSE, MOD_PURPOSE_OTHER),
'activityname' => $this->get_title_data($output),
];
if ($this->format->show_editor()) {
$data['pluginname'] = get_string('pluginname', 'mod_' . $mod->modname);
}
return $data;
}
@@ -76,3 +76,13 @@ Feature: Activity navigation in a single activity course
Given I log in as "student2"
When I am on "Course 1" course homepage
Then I should see "You cannot enrol yourself in this course"
Scenario: The single activity course format supports multilang course names
Given the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
When I am on the "Course 1" "course editing" page logged in as "teacher1"
And I expand all fieldsets
And I set the field "Course full name" in the "General" "fieldset" to "<span lang=\"de\" class=\"multilang\">Kurs</span><span lang=\"en\" class=\"multilang\">Course</span> 1"
And I click on "Save and display" "button"
Then I should see "Course 1" in the ".page-header-headings" "css_element"
And I should not see "KursCourse 1" in the ".page-header-headings" "css_element"
@@ -70,7 +70,7 @@
{{/ core_courseformat/local/content/cm/cmname }}
{{/cmname}}
{{#afterlink}}
<div class="afterlink">
<div class="afterlink d-flex align-items-center ml-3">
{{{afterlink}}}
</div>
{{/afterlink}}
@@ -50,9 +50,11 @@
<img src="{{{icon}}}" class="activityicon " alt="{{{modname}}} icon">
</div>
<div class="media-body align-self-center">
{{#pluginname}}
<div class="text-uppercase small">
{{{pluginname}}}
</div>
{{/pluginname}}
<div class="activityname">
{{#activityname}}
{{$ core/inplace_editable }}
@@ -18,7 +18,7 @@ Feature: Course content collapsed user preferences
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
| assign | Activity sample 4 | Test assignment description | C1 | sample1 | 4 |
| assign | Activity sample 5 | Test assignment description | C1 | sample1 | 5 |
@@ -18,7 +18,7 @@ Feature: Course index depending on role
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
And the following "course enrolments" exist:
| user | course | role |
@@ -129,10 +129,9 @@ Feature: Course index depending on role
@javascript
Scenario: Course index toggling
Given the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| book | Second activity in section 1 | Test book description | C1 | sample4 | 1 |
And I log in as "teacher1"
When I am on "Course 1" course homepage
| activity | name | course | idnumber | section |
| book | Second activity in section 1 | C1 | sample4 | 1 |
When I am on the "Course 1" course page logged in as teacher1
# Sections should be opened by default.
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
@@ -298,3 +297,14 @@ Feature: Course index depending on role
| large | be | Close | not be | Open | be |
| tablet | not be | Open | not be | Open | not be |
| mobile | not be | Open | not be | Open | not be |
@javascript
Scenario: Course index is refreshed when we change role.
When I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I hide section "1"
And I turn editing mode off
And I should see "Topic 1" in the "courseindex-content" "region"
And I follow "Switch role to..." in the user menu
And I press "Student"
Then I should not see "Topic 1" in the "courseindex-content" "region"
@@ -14,7 +14,7 @@ Feature: Verify that courseindex is usable with the keyboard
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
Given I am on the "C1" "Course" page logged in as "admin"
And I change window size to "large"
@@ -0,0 +1,36 @@
@core @core_course @core_courseformat
Feature: The course index language should change according to user preferences.
As a user in a course
I should see the same language in the course index and the course content when I switch languages.
Background:
Given remote langimport tests are enabled
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| enablecompletion | 1 |
| numsections | 4 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "language pack" exists:
| language | fr |
And I change window size to "large"
@javascript
Scenario Outline: Course index is refreshed when we change language.
Given I am on the "C1" "Course" page logged in as "<user>"
When I follow "Language" in the user menu
Then I should see "Language selector" user submenu
And I follow "Français (fr)"
Then I should see "Généralités" in the "courseindex-content" "region"
Examples:
| user |
| student1 |
| teacher1 |
@@ -14,7 +14,7 @@ Feature: Move activity using keyboard
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
| choice | Other sample 3 | Test choice description | C1 | sample31 | 3 |
And I log in as "admin"
@@ -14,7 +14,7 @@ Feature: Move a section using keyboard
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
| choice | Other sample 3 | Test choice description | C1 | sample31 | 3 |
And I log in as "admin"
@@ -14,7 +14,7 @@ Feature: Sections can be edited and deleted in topics format
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Test assignment name | Test assignment description | C1 | assign1 | 0 |
| book | Test book name | Test book description | C1 | book1 | 1 |
| book | Test book name | | C1 | book1 | 1 |
| chat | Test chat name | Test chat description | C1 | chat1 | 4 |
| choice | Test choice name | Test choice description | C1 | choice1 | 5 |
And the following "course enrolments" exist:
@@ -14,7 +14,7 @@ Feature: Sections can be edited and deleted in weeks format
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Test assignment name | Test assignment description | C1 | assign1 | 0 |
| book | Test book name | Test book description | C1 | book1 | 1 |
| book | Test book name | | C1 | book1 | 1 |
| chat | Test chat name | Test chat description | C1 | chat1 | 4 |
| choice | Test choice name | Test choice description | C1 | choice1 | 5 |
And the following "course enrolments" exist:
@@ -57,8 +57,8 @@ Feature: Toggle activities visibility from the course page
And I click on "Edit settings" "link" in the "Test forum name" activity
And I expand all fieldsets
And the "Availability" select box should contain "Show on course page"
And the "Availability" select box should not contain "Make available but not shown on course page"
And the field "Availability" matches value "Hide from students"
And the "Availability" select box should not contain "Make available but don't show on course page"
And the field "Availability" matches value "Hide on course page"
And I press "Save and return to course"
And "Test forum name" activity should be hidden
And I turn editing mode off
@@ -100,10 +100,10 @@ Feature: Toggle activities visibility from the course page
And I open "Test forum name" actions menu
And I click on "Edit settings" "link" in the "Test forum name" activity
And I expand all fieldsets
And the "Availability" select box should contain "Hide from students"
And the "Availability" select box should contain "Make available but not shown on course page"
And the "Availability" select box should contain "Hide on course page"
And the "Availability" select box should contain "Make available but don't show on course page"
And the "Availability" select box should not contain "Show on course page"
And I set the field "Availability" to "Make available but not shown on course page"
And I set the field "Availability" to "Make available but don't show on course page"
And I press "Save and return to course"
And "Test forum name" activity should be available but hidden from course page
And I turn editing mode off
@@ -142,8 +142,8 @@ Feature: Toggle activities visibility from the course page
And I click on "Edit settings" "link" in the "Test assignment name" activity
And I expand all fieldsets
And the "Availability" select box should contain "Show on course page"
And the "Availability" select box should contain "Hide from students"
And the field "Availability" matches value "Make available but not shown on course page"
And the "Availability" select box should contain "Hide on course page"
And the field "Availability" matches value "Make available but don't show on course page"
And I press "Save and return to course"
And "Test assignment name" activity should be available but hidden from course page
And I turn editing mode off
@@ -22,8 +22,8 @@ Feature: Collapse course sections
| activity | name | intro | course | idnumber | section | completion |
| assign | Assignment 1 | Test assignment description1 | C1 | assign1 | 1 | 1 |
| assign | Assignment 2 | Test assignment description2 | C1 | assign2 | 2 | 1 |
| book | Book 2 | Test book description2 | C1 | book2 | 2 | 1 |
| book | Book 3 | Test book description3 | C1 | book3 | 3 | 1 |
| book | Book 2 | | C1 | book2 | 2 | 1 |
| book | Book 3 | | C1 | book3 | 3 | 1 |
| forum | Forum 4 | Test forum description4 | C1 | forum4 | 4 | 1 |
| forum | Forum 5 | Test forum description5 | C1 | forum5 | 5 | 1 |
And the following "course enrolments" exist:
@@ -58,8 +58,7 @@ Feature: Collapse course sections
@javascript
Scenario: Expand/collapse sections for Topics format.
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 "[data-toggle=collapse]" "css_element" should exist in the "region-main" "region"
And I should see "Assignment 1" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
@@ -97,8 +96,7 @@ Feature: Collapse course sections
@javascript
Scenario: Expand/collapse sections for Weeks format.
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
When I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
+80
View File
@@ -0,0 +1,80 @@
@core @core_course
Feature: Teacher can change the course format
In order to change course format
As a teacher
I should be able to edit a course
@javascript
Scenario: Teacher can change the course format
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
# Course format is initially set to Topics format
And the following "courses" exist:
| fullname | shortname | format | startdate |
| Course 1 | C1 | topics | ## 1 day ago ## |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
# Confirm that course format is Topics
When I am on the "Course 1" course page logged in as teacher1
Then I should see "Topic 1"
And I am on the "Course 1" "course editing" page
And I expand all fieldsets
# Fields that appear for Topics format exist
# Also confirm contents of Hidden sections and Course layout select box
And I should see "Hidden sections"
And the "Hidden sections" select box should contain "Hidden sections are shown as not available"
And the "Hidden sections" select box should contain "Hidden sections are completely invisible"
# Hidden sections default value is 1 (Hidden sections are completely invisible)
And the field "Hidden sections" matches value "1"
And I should see "Course layout"
And the "Course layout" select box should contain "Show all sections on one page"
And the "Course layout" select box should contain "Show one section per page"
# Course layout default value is 0 (Show all sections on one page)
And the field "Course layout" matches value "0"
# Set course format to Single activity format
And I set the field "Format" to "Single activity format"
And I expand all fieldsets
# Confirm that fields that appear for Single activity format appears
And I should see "Type of activity"
And I set the field "Type of activity" to "Glossary"
And I press "Save and display"
And I set the field "Name" to "Glossary 1"
And I press "Save and display"
# Confirm that course page displays single activity of type Glossary
And I should see "Browse the glossary using this index"
And I should not see "Topic 1"
And I am on the "Course 1" "course editing" page
And I expand all fieldsets
# Set course format to Weekly format
And I set the field "Format" to "Weekly format"
And I expand all fieldsets
# Confirm that fields that appear for Weekly format appears
# Also confirm contents of Hidden sections and Course layout select box
And I should see "Hidden sections"
And the "Hidden sections" select box should contain "Hidden sections are shown as not available"
And the "Hidden sections" select box should contain "Hidden sections are completely invisible"
# Hidden sections default value is 1 (Hidden sections are completely invisible)
And the field "Hidden sections" matches value "1"
And I should see "Course layout"
And the "Course layout" select box should contain "Show all sections on one page"
And the "Course layout" select box should contain "Show one section per page"
# Course layout default value is 0 (Show all sections on one page)
And the field "Course layout" matches value "0"
And I press "Save and display"
# Confirm that course page displays weekly sections
And I should see "This week"
And I should not see "Browse the glossary using this index"
And I am on the "Course 1" "course editing" page
And I expand all fieldsets
# Set course format to Social format
And I set the field "Format" to "Social format"
# Confirm that fields that appear for Social format appears
And I expand all fieldsets
And I should see "Number of discussions"
And the field "Number of discussions" matches value "10"
And I press "Save and display"
# Confirm that course page displays a forum
And I should see "There are no discussion topics yet in this forum"
And I should not see "This week"
@@ -21,7 +21,7 @@ Feature: Show/hide course sections
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test hidden forum 11 name |
| Description | Test hidden forum 11 description |
| Availability | Hide from students |
| Availability | Hide on course page |
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test hidden forum 12 name |
| Description | Test hidden forum 12 description |
@@ -29,7 +29,7 @@ Feature: Show/hide course sections
And I add a "Forum" to section "2" and I fill the form with:
| Forum name | Test hidden forum 21 name |
| Description | Test hidden forum 21 description |
| Availability | Hide from students |
| Availability | Hide on course page |
And I add a "Forum" to section "2" and I fill the form with:
| Forum name | Test hidden forum 22 name |
| Description | Test hidden forum 22 description |
@@ -37,7 +37,7 @@ Feature: Show/hide course sections
And I add a "Forum" to section "3" and I fill the form with:
| Forum name | Test hidden forum 31 name |
| Description | Test hidden forum 31 description |
| Availability | Hide from students |
| Availability | Hide on course page |
And I add a "Forum" to section "3" and I fill the form with:
| Forum name | Test hidden forum 32 name |
| Description | Test hidden forum 32 description |
@@ -21,6 +21,11 @@ namespace core_course\reportbuilder\datasource;
use core_customfield_generator;
use core_reportbuilder_testcase;
use core_reportbuilder_generator;
use core_reportbuilder\local\filters\boolean_select;
use core_reportbuilder\local\filters\date;
use core_reportbuilder\local\filters\select;
use core_reportbuilder\local\filters\text;
use core_reportbuilder\local\helpers\user_filter_manager;
defined('MOODLE_INTERNAL') || die();
@@ -38,9 +43,9 @@ require_once("{$CFG->dirroot}/reportbuilder/tests/helpers.php");
class courses_test extends core_reportbuilder_testcase {
/**
* Test courses datasource
* Test default datasource
*/
public function test_courses_datasource(): void {
public function test_datasource_default(): void {
$this->resetAfterTest();
// Test subject.
@@ -54,20 +59,92 @@ class courses_test extends core_reportbuilder_testcase {
/** @var core_reportbuilder_generator $generator */
$generator = $this->getDataGenerator()->get_plugin_generator('core_reportbuilder');
$report = $generator->create_report(['name' => 'Courses', 'source' => courses::class]);
$report = $generator->create_report(['name' => 'Courses', 'source' => courses::class, 'default' => 1]);
$content = $this->get_custom_report_content($report->get('id'));
$this->assertCount(1, $content);
$contentrow = array_values(reset($content));
$contentrow = array_values($content[0]);
$this->assertEquals([
'My cats', // Category name.
'C101', // Course shortname.
'All about cats', // Course fullname.
'CAT101', // Course ID number.
$category->get_formatted_name(),
$course->shortname,
$course->fullname,
$course->idnumber,
], $contentrow);
}
/**
* Test datasource columns that aren't added by default
*/
public function test_datasource_non_default_columns(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category([
'name' => 'Animals',
'idnumber' => 'CAT101',
'description' => 'Category description',
]);
$course = $this->getDataGenerator()->create_course([
'category' => $category->id,
'fullname' => 'Cats',
'summary' => 'Course description',
]);
/** @var core_reportbuilder_generator $generator */
$generator = $this->getDataGenerator()->get_plugin_generator('core_reportbuilder');
$report = $generator->create_report(['name' => 'Courses', 'source' => courses::class, 'default' => 0]);
// Category.
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course_category:path']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course_category:idnumber']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course_category:description']);
// Course.
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:coursefullnamewithlink']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:courseshortnamewithlink']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:courseidnumberewithlink']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:summary']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:format']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:startdate']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:enddate']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:visible']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:groupmode']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:groupmodeforce']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:lang']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:calendartype']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:theme']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:enablecompletion']);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:downloadcontent']);
$content = $this->get_custom_report_content($report->get('id'));
$this->assertCount(1, $content);
$courserow = array_values($content[0]);
// Category.
$this->assertEquals($category->get_nested_name(false), $courserow[0]);
$this->assertEquals($category->idnumber, $courserow[1]);
$this->assertEquals(format_text($category->description, $category->descriptionformat), $courserow[2]);
// Course.
$this->assertStringContainsString($course->fullname, $courserow[3]);
$this->assertStringContainsString($course->shortname, $courserow[4]);
$this->assertStringContainsString($course->idnumber, $courserow[5]);
$this->assertEquals(format_text($course->summary, $course->summaryformat), $courserow[6]);
$this->assertEquals('Topics format', $courserow[7]);
$this->assertEquals(userdate($course->startdate), $courserow[8]);
$this->assertEmpty($courserow[9]);
$this->assertEquals('Yes', $courserow[10]);
$this->assertEquals('No groups', $courserow[11]);
$this->assertEquals('No', $courserow[12]);
$this->assertEmpty($courserow[13]);
$this->assertEmpty($courserow[14]);
$this->assertEmpty($courserow[15]);
$this->assertEquals('No', $courserow[16]);
$this->assertEmpty($courserow[17]);
}
/**
* Tests courses datasource using multilang filters
*/
@@ -106,6 +183,181 @@ class courses_test extends core_reportbuilder_testcase {
], $contentrow);
}
/**
* Data provider for {@see test_datasource_filters}
*
* @return array[]
*/
public function datasource_filters_provider(): array {
return [
// Category.
'Filter category' => ['course_category:name', [
'course_category:name_operator' => select::EQUAL_TO,
'course_category:name_value' => -1,
], false],
'Filter category idnumber' => ['course_category:idnumber', [
'course_category:idnumber_operator' => text::IS_EQUAL_TO,
'course_category:idnumber_value' => 'CAT101',
], true],
'Filter category idnumber (no match)' => ['course_category:idnumber', [
'course_category:idnumber_operator' => text::CONTAINS,
'course_category:idnumber_value' => 'FRUIT',
], false],
// Course.
'Filter course' => ['course:courseselector', [
'course:courseselector_values' => [-1],
], false],
'Filter course fullname' => ['course:fullname', [
'course:fullname_operator' => text::IS_EQUAL_TO,
'course:fullname_value' => 'Equine',
], true],
'Filter course fullname (no match)' => ['course:fullname', [
'course:fullname_operator' => text::IS_EQUAL_TO,
'course:fullname_value' => 'Foxes',
], false],
'Filter course shortname' => ['course:shortname', [
'course:shortname_operator' => text::IS_EQUAL_TO,
'course:shortname_value' => 'EQ101',
], true],
'Filter course shortname (no match)' => ['course:shortname', [
'course:shortname_operator' => text::IS_EQUAL_TO,
'course:shortname_value' => 'FX101',
], false],
'Filter course idnumber' => ['course:idnumber', [
'course:idnumber_operator' => text::IS_EQUAL_TO,
'course:idnumber_value' => 'E-101AB',
], true],
'Filter course idnumber (no match)' => ['course:idnumber', [
'course:idnumber_operator' => text::IS_EQUAL_TO,
'course:idnumber_value' => 'F-101XT',
], false],
'Filter course format' => ['course:format', [
'course:format_operator' => select::EQUAL_TO,
'course:format_value' => 'topics',
], true],
'Filter course format (no match)' => ['course:format', [
'course:format_operator' => select::EQUAL_TO,
'course:format_value' => 'weekly',
], false],
'Filter course startdate' => ['course:startdate', [
'course:startdate_operator' => date::DATE_RANGE,
'course:startdate_from' => 1622502000,
], true],
'Filter course startdate (no match)' => ['course:startdate', [
'course:startdate_operator' => date::DATE_RANGE,
'course:startdate_to' => 1622502000,
], false],
'Filter course enddate' => ['course:enddate', [
'course:enddate_operator' => date::DATE_EMPTY,
], true],
'Filter course enddate (no match)' => ['course:enddate', [
'course:enddate_operator' => date::DATE_NOT_EMPTY,
], false],
'Filter course visible' => ['course:visible', [
'course:visible_operator' => boolean_select::CHECKED,
], true],
'Filter course visible (no match)' => ['course:visible', [
'course:visible_operator' => boolean_select::NOT_CHECKED,
], false],
'Filter course groupmode' => ['course:groupmode', [
'course:groupmode_operator' => select::EQUAL_TO,
'course:groupmode_value' => 0, // No groups.
], true],
'Filter course groupmode (no match)' => ['course:groupmode', [
'course:groupmode_operator' => select::EQUAL_TO,
'course:groupmode_value' => 1, // Separate groups.
], false],
'Filter course groupmodeforce' => ['course:groupmodeforce', [
'course:groupmodeforce_operator' => boolean_select::NOT_CHECKED,
], true],
'Filter course groupmodeforce (no match)' => ['course:groupmodeforce', [
'course:groupmodeforce_operator' => boolean_select::CHECKED,
], false],
'Filter course lang' => ['course:lang', [
'course:lang_operator' => select::EQUAL_TO,
'course:lang_value' => 'en',
], true],
'Filter course lang (no match)' => ['course:lang', [
'course:lang_operator' => select::EQUAL_TO,
'course:lang_value' => 'de',
], false],
'Filter course calendartype' => ['course:calendartype', [
'course:calendartype_operator' => select::EQUAL_TO,
'course:calendartype_value' => 'gregorian',
], true],
'Filter course calendartype (no match)' => ['course:calendartype', [
'course:calendartype_operator' => select::EQUAL_TO,
'course:calendartype_value' => 'hijri',
], false],
'Filter course theme' => ['course:theme', [
'course:theme_operator' => select::EQUAL_TO,
'course:theme_value' => 'boost',
], true],
'Filter course theme (no match)' => ['course:theme', [
'course:theme_operator' => select::EQUAL_TO,
'course:theme_value' => 'classic',
], false],
'Filter course enablecompletion' => ['course:enablecompletion', [
'course:enablecompletion_operator' => boolean_select::NOT_CHECKED,
], true],
'Filter course enablecompletion (no match)' => ['course:enablecompletion', [
'course:enablecompletion_operator' => boolean_select::CHECKED,
], false],
'Filter course downloadcontent' => ['course:downloadcontent', [
'course:downloadcontent_operator' => boolean_select::CHECKED,
], true],
'Filter course downloadcontent (no match)' => ['course:downloadcontent', [
'course:downloadcontent_operator' => boolean_select::NOT_CHECKED,
], false],
];
}
/**
* Test datasource filters
*
* @param string $filtername
* @param array $filtervalues
* @param bool $expectmatch
*
* @dataProvider datasource_filters_provider
*/
public function test_datasource_filters(string $filtername, array $filtervalues, bool $expectmatch): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category(['name' => 'Animals', 'idnumber' => 'CAT101']);
$course = $this->getDataGenerator()->create_course([
'category' => $category->id,
'fullname' => 'Equine',
'shortname' => 'EQ101',
'idnumber' => 'E-101AB',
'lang' => 'en',
'calendartype' => 'gregorian',
'theme' => 'boost',
'downloadcontent' => 1,
]);
/** @var core_reportbuilder_generator $generator */
$generator = $this->getDataGenerator()->get_plugin_generator('core_reportbuilder');
// Create report containing single column, and given filter.
$report = $generator->create_report(['name' => 'Tasks', 'source' => courses::class, 'default' => 0]);
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:fullname']);
// Add filter, set it's values.
$generator->create_filter(['reportid' => $report->get('id'), 'uniqueidentifier' => $filtername]);
user_filter_manager::set($report->get('id'), $filtervalues);
$content = $this->get_custom_report_content($report->get('id'));
if ($expectmatch) {
$this->assertCount(1, $content);
$this->assertEquals($course->fullname, reset($content[0]));
} else {
$this->assertEmpty($content);
}
}
/**
* Stress test datasource
*

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