3303 Commits

Author SHA1 Message Date
Laurent David
4a91802a44 MDL-77781 core_completion: Completion view must be deleted too
When resetting a course, completion view entries should also be
deleted

Co-authored-by: Georg Moser <georg@moser.link>
2023-05-03 14:27:54 +02:00
Jun Pataleta
8dd488cb5b Merge branch 'MDL-77989-master' of https://github.com/andrewnicols/moodle 2023-04-21 13:44:51 +08:00
Andrew Nicols
1a53cbbae4 MDL-77989 testing: Add test file isolation helper
When we deprecate the use of a file, we often include tests which ensure
that the legacy behaviour is maintained. There are also legacy uses
in the community where people would like to use the deprecated API for a
period.

The issue that we face is that, if the deprecated file is included once,
then it will be included for all other, unrelated, tests. This means
that other tests may not detect cases where the deprecated file was
included.

We can solve these cases by running the test that performs the inclusion
in a deprecated process. This means that the inclusion is only performed
in that isolated process, and other unrelated tests do not include the
file.

However, we also then need to detect which files which are including the
file and which we do not know about.

This change introduces:
- an override to the TestCase::setInIsolation method to define a
  constant when the test is running in isolation
- a new function that a file can call when it is included, to make sure
  that the test process was isolated, where there is any test.
2023-04-21 13:33:56 +08:00
Paul Holden
a8da761f8b
MDL-77959 moodlenet: void return type style fixes in test. 2023-04-19 17:35:12 +01:00
Paul Holden
5338fc591e
Merge branch 'MDL-77959-master' of https://github.com/HuongNV13/moodle 2023-04-19 17:25:14 +01:00
Huong Nguyen
5548b91e3e MDL-77959 core_moodlenet: Convert activity intro to plaintext 2023-04-19 17:40:21 +07:00
Andrew Nicols
3ac1acacca MDL-77958 moodlenet: Various style fixes
This change contains various style fixes which I encountered and fixed
whilst addressing the other issues identified in this issue.
2023-04-19 16:12:50 +08:00
Andrew Nicols
581ccb9a47 MDL-77958 moodlenet: Pass stored_file to improve memory usage
Previously the content of the stored file was extracted and stored in a
variable, passed around, and then submitted to MoodleNet. This results
in very high memory consumption when dealing with MoodleNet.

The stored_file should be passed around as a first-level param to
discourage this, and the content should _never_ be loaded into memory.
Instead file streams and resources should be used to allow Guzzle/Curl
to buffer the file from disk/other storage straight to MoodleNet.
2023-04-19 16:12:50 +08:00
Paul Holden
fd8184a295
MDL-77954 moodlenet: store packaged activities in user draft.
We shouldn't invent fileareas with invalid values (specifically in
this case, the `itemid` overflowed maximum length of the field on
Oracle).

Given the generated file is transitory in nature, instead store it
in the users draft area.
2023-04-18 18:40:15 +01:00
Jake Dallimore
c9e8aa0406 Merge branch 'MDL-75316-master-4' of https://github.com/mickhawkins/moodle 2023-04-18 17:24:55 +08:00
Michael Hawkins
2e024f304a MDL-75316 core: MoodleNet integration final improvements 2023-04-18 17:00:54 +08:00
Huong Nguyen
58ced4add0 MDL-75316 core_moodlenet: Share to MoodleNet modal and activity menu
Originally implemented as MDL-75785
2023-04-18 17:05:07 +08:00
Huong Nguyen
6a877d438b MDL-75316 core: Webservice for sending activity to MoodleNet
Originally implemented as MDL-75933
2023-04-18 17:04:46 +08:00
Michael Hawkins
77f85ed287 MDL-75316 core: Add activity sender & moodlenet_client to MoodleNet API
This makes it possible to share a single activity to a MoodleNet
instance (which has been enabled for sharing in site admin).
This utilises the core\moodlenet\activity_packager to create an
activity backup, then sends it using the MoodleNet create resource
API specification.

Originally implemented as MDL-75932
2023-04-18 17:04:14 +08:00
raortegar
9bc769a610 MDL-75316 core: Add activity packager to MoodleNet API
This makes it possible to package a single activity as a Moodle backup
file, excluding user data so it is ready to be shared as a MoodleNet
resource.

Co-authored-by: Michael Hawkins <michaelh@moodle.com>

Originally implemented as MDL-75932
2023-04-18 17:03:45 +08:00
Michael Hawkins
d6c4c0fbbd MDL-75316 core: Set up MoodleNet API structure and utilities helper
Initial folder structure and declaring API.
Created utilities class.

Originally implemented as MDL-75932
2023-04-18 17:03:18 +08:00
Huong Nguyen
ef2a1934a0 MDL-75316 core_moodlenet: Add setting to control sharing
Originally implemented as MDL-75319
2023-04-18 17:01:38 +08:00
Ilya Tregubov
688c9b13d4 Merge branch 'MDL-77827-master' of https://github.com/HuongNV13/moodle 2023-04-18 08:58:33 +08:00
Huong Nguyen
f5867c078d MDL-77827 events: Changed JSON comparison to be less strict 2023-04-14 12:28:55 +07:00
Sara Arjona
bdc106e840 Merge branch 'MDL-76859-master' of https://github.com/sarjona/moodle 2023-04-13 16:24:20 +02:00
Sara Arjona
9ce4fb65fd Merge branch 'MDL-77164-master' of https://github.com/marinaglancy/moodle 2023-04-13 14:00:18 +02:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Ilya Tregubov
cfbb0ea4d5 Merge branch 'MDL-70975-adhoc-carneval' of https://github.com/catalyst/moodle 2023-04-13 09:07:58 +08:00
Petr Skoda
43b56a90d9 MDL-76859 h5p: Fix behat failures
- Only resize if the H5P EmbedCommunicator is defined (otherwise, it was causing a
JS error)
- An unnecessary image has been removed from the greeting-card.h5p fixture package.
That way, the text will always be displayed (even if the iframe is still not
resized). Instead of replacing the original greeting-card-887.h5p file, I've
renamed it to greeting-card.h5p, to remove these ugly and unnecessary numbers
at the end of the file name).
2023-04-12 12:26:23 +02:00
Sara Arjona
dbabe07db8 Merge branch 'MDL-77148' of https://github.com/AnupamaSarjoshi/moodle 2023-04-11 10:17:03 +02:00
Anupama Sarjoshi
e6a3295fba MDL-77148 core: Fix to export params for templates in correct format
When questions are filtered by tags in the question bank, the qtagids
params are passed in the array format. Though moodle_url handles this,
single_button::export_for_template cannot. Hence changes done in
weblib.php to provide params for export_for_template in the
suitable format.
Thanks Huong. I have added the Behat test you provided in the patch.
2023-04-06 13:22:01 +01:00
Andrew Nicols
eb1b172397 Merge branch 'MDL-65471-outageless' of https://github.com/Peterburnett/moodle 2023-04-06 08:36:25 +02:00
Peter Burnett
027c770eab
MDL-65471 upgrade: framework to reduce maintenance mode 2023-04-06 11:38:26 +10:00
Srdjan
85323070e7 MDL-70975 task: adhoctasks.php - queued ad hoc tasks report
Similar to scheduled tasks report

core\task\manager::adhoc_task_from_record() now raises moodle_exception
2023-04-05 11:29:46 +10:00
Srdjan
3491ea1650 MDL-70975 task: Support for running adhoc tasks filtered by class
* CLI adhoc_task.php: new option --classname
* core\task\manager::get_next_adhoc_task(): new param $classname
  for filtering tasks
2023-04-05 11:00:46 +10:00
Srdjan
9405b5aa6d MDL-70975 task: Support for running adhoc tasks by id
* CLI adhoc_task.php: new option --id
* cron::run_adhoc_task($taskid) for running tasks by id
* core\task\manager::get_adhoc_task($taskid) for retreival/locking
2023-04-05 10:55:18 +10:00
Andrew Nicols
a262ba5d6e Merge branch 'MDL-74936' of https://github.com/skodak/moodle 2023-04-04 11:22:49 +08:00
Paul Holden
cea2bf47eb
Merge branch 'MDL-77227-master' of https://github.com/aanabit/moodle 2023-04-03 10:56:13 +01:00
Petr Skoda
176191dab5 MDL-74936 core: tidy up context API 2023-03-31 23:09:39 +02:00
Jake Dallimore
aeb7763a0d Merge branch 'MDL-77033-master-3' of https://github.com/ilyatregubov/moodle 2023-03-31 11:29:45 +08:00
Ilya Tregubov
5b8c1ffd84 Merge branch 'MDL-77406' of https://github.com/AnupamaSarjoshi/moodle 2023-03-31 09:47:23 +08:00
Ilya Tregubov
e2f4cf48a5 Merge branch 'MDL-70976-master' of https://github.com/laurentdavid/moodle 2023-03-31 09:41:17 +08:00
Jun Pataleta
64c1a5c337 Merge branch 'MDL-77306-master' of https://github.com/junpataleta/moodle 2023-03-30 23:38:57 +08:00
Ilya Tregubov
8b4bc3d31a MDL-77033 core_behat: Refactor behat steps to be reusable.
We will need similar step definitions for gradebook setup page.
So moving those from grader plugin to the core.
2023-03-30 20:20:10 +08:00
Sara Arjona
afe1f192c4 Merge branch 'MDL-76895-master' of https://github.com/ferranrecio/moodle 2023-03-30 12:51:03 +02:00
Ferran Recio
0436605df5 MDL-76895 core_courseformat: add fast bulk selections 2023-03-30 11:40:45 +02:00
Jun Pataleta
ae3e9667c2 MDL-72350 core: Add @covers for test_check_mod_assignment_is_used
Plus, remove getStatus() assertion when running the test with
mod_assignment reinstalled since it check_mod_assignment returns a
null result.
2023-03-30 13:00:39 +08:00
Stevani Andolo
26d78531e7 MDL-72350 core: Added environment check for mod_assignment
Decided to add an environment check before uninstalling the
mod_assignment plugin to prevent data lost.
2023-03-30 09:00:06 +08:00
Amaia Anabitarte
fd5db65c0b MDL-77227 roles: Remove extra information for override page 2023-03-29 18:15:46 +02:00
Laurent David
4281b6e859 MDL-70976 core_files: Allow for draft files url inserted in content
* The file file_remove_editor_orphaned_files should take into account URL that
have been embedded in a tag content instead of an attribute (like src attribute)
* This will fix issue with inserting H5P content in calendar events.
2023-03-29 09:09:56 +02:00
Matt Porritt
4c76cc46f8 MDL-77306 Site Registration: add extra statistics
Add the DB type, count of courses with start or end dates set,
default site theme, and primary auth type statistics to those
collected as part of the site registration data.
2023-03-29 15:22:28 +11:00
Anupama Sarjoshi
42f4b0a991 MDL-77406 core: Logs to record user file uploaded in draft area 2023-03-28 17:49:54 +01:00
Jun Pataleta
cd0afd5c76 MDL-77105 core: Method to determine whether a plugin has monolog icons 2023-03-27 13:32:09 +08:00
Jun Pataleta
40a59bccff Merge branch 'MDL-76147-master-2' of https://github.com/ilyatregubov/moodle 2023-03-24 09:32:40 +08:00
Ilya Tregubov
de32a9e57d MDL-76147 gradereport_grader: Fix Behat tests. 2023-03-24 09:26:45 +08:00