From 7419d5d319f09426c3730b7c10b25ba5d8e6fdf2 Mon Sep 17 00:00:00 2001 From: Philipp Imhof <52650214+PhilippImhof@users.noreply.github.com> Date: Sun, 12 Nov 2023 14:19:27 +0100 Subject: [PATCH 01/75] MDL-80087 Questions: warn if preload_all_step_users was not called Co-authored-by: Tim Hunt --- mod/quiz/classes/external.php | 4 ++++ mod/quiz/tests/external/external_test.php | 2 +- question/engine/questionattemptstep.php | 24 +++++++++++++--------- question/engine/questionusage.php | 5 ++--- question/engine/tests/helpers.php | 16 +++++++++------ question/engine/tests/walkthrough_test.php | 8 ++++++++ 6 files changed, 39 insertions(+), 20 deletions(-) diff --git a/mod/quiz/classes/external.php b/mod/quiz/classes/external.php index e0120d8ea5d45..0f860ebe25964 100644 --- a/mod/quiz/classes/external.php +++ b/mod/quiz/classes/external.php @@ -1473,6 +1473,10 @@ public static function get_attempt_review($attemptid, $page = -1) { $page = 'all'; } + // Make sure all users associated to the attempt steps are loaded. Otherwise, this will + // trigger a debugging message. + $attemptobj->preload_all_attempt_step_users(); + // Prepare the output. $result = []; $result['attempt'] = $attemptobj->get_attempt(); diff --git a/mod/quiz/tests/external/external_test.php b/mod/quiz/tests/external/external_test.php index 9824e71e160e6..ff0c6be73d559 100644 --- a/mod/quiz/tests/external/external_test.php +++ b/mod/quiz/tests/external/external_test.php @@ -1720,7 +1720,7 @@ public function test_get_attempt_review() { $this->assertEquals('gradedright', $result['questions'][0]['state']); $this->assertEquals(1, $result['questions'][0]['slot']); - $this->assertCount(1, $result['additionaldata']); + $this->assertCount(1, $result['additionaldata']); $this->assertEquals('feedback', $result['additionaldata'][0]['id']); $this->assertEquals('Feedback', $result['additionaldata'][0]['title']); $this->assertEquals('Feedback text 1', $result['additionaldata'][0]['content']); diff --git a/question/engine/questionattemptstep.php b/question/engine/questionattemptstep.php index f8bddf6850733..da1750a090e49 100644 --- a/question/engine/questionattemptstep.php +++ b/question/engine/questionattemptstep.php @@ -87,10 +87,10 @@ class question_attempt_step { */ private $fraction = null; - /** @var integer the timestamp when this step was created. */ + /** @var int the timestamp when this step was created. */ private $timecreated; - /** @var integer the id of the user resonsible for creating this step. */ + /** @var int the id of the user responsible for creating this step. */ private $userid; /** @var array name => value pairs. The submitted data. */ @@ -99,7 +99,7 @@ class question_attempt_step { /** @var array name => array of {@see stored_file}s. Caches the contents of file areas. */ private $files = array(); - /** @var stdClass User information. */ + /** @var stdClass|null User information. */ private $user = null; /** @@ -107,12 +107,12 @@ class question_attempt_step { * normally created by {@see question_attempt} methods like * {@see question_attempt::process_action()}. * @param array $data the submitted data that defines this step. - * @param int $timestamp the time to record for the action. (If not given, use now.) - * @param int $userid the user to attribute the aciton to. (If not given, use the current user.) - * @param int $existingstepid if this step is going to replace an existing step + * @param int|null $timecreated the time to record for the action. (If not given, use now.) + * @param int|null $userid the user to attribute the aciton to. (If not given, use the current user.) + * @param int|null $existingstepid if this step is going to replace an existing step * (for example, during a regrade) this is the id of the previous step we are replacing. */ - public function __construct($data = array(), $timecreated = null, $userid = null, + public function __construct($data = [], $timecreated = null, $userid = null, $existingstepid = null) { global $USER; @@ -196,9 +196,13 @@ public function add_full_user_object(stdClass $user): void { /** * Return the full user object. * - * @return stdClass Get full user object. + * @return null|stdClass Get full user object. */ - public function get_user(): stdClass { + public function get_user(): ?stdClass { + if ($this->user === null) { + debugging('Attempt to access the step user before it was initialised. ' . + 'Did you forget to call question_usage_by_activity::preload_all_step_users() or similar?', DEBUG_DEVELOPER); + } return $this->user; } @@ -208,7 +212,7 @@ public function get_user(): stdClass { * @return string full name of user. */ public function get_user_fullname(): string { - return fullname($this->user); + return fullname($this->get_user()); } /** @return int the timestamp when this step was created. */ diff --git a/question/engine/questionusage.php b/question/engine/questionusage.php index c1aa1542014c1..798e369d738b7 100644 --- a/question/engine/questionusage.php +++ b/question/engine/questionusage.php @@ -1030,9 +1030,8 @@ public function preload_all_step_users(): void { // Update user information for steps. foreach ($this->questionattempts as $qa) { foreach ($qa->get_full_step_iterator() as $step) { - $user = $users[$step->get_user_id()]; - if (isset($user)) { - $step->add_full_user_object($user); + if (isset($users[$step->get_user_id()])) { + $step->add_full_user_object($users[$step->get_user_id()]); } } } diff --git a/question/engine/tests/helpers.php b/question/engine/tests/helpers.php index 402e2c10b5bb4..f83d9697a413e 100644 --- a/question/engine/tests/helpers.php +++ b/question/engine/tests/helpers.php @@ -791,11 +791,13 @@ public function __construct($pattern, $message = '') { abstract class qbehaviour_walkthrough_test_base extends question_testcase { /** @var question_display_options */ protected $displayoptions; + /** @var question_usage_by_activity */ protected $quba; - /** @var integer */ + /** @var int The slot number of the question_attempt we are using in $quba. */ protected $slot; + /** * @var string after {@link render()} has been called, this contains the * display of the question in its current state. @@ -804,7 +806,8 @@ abstract class qbehaviour_walkthrough_test_base extends question_testcase { protected function setUp(): void { parent::setUp(); - $this->resetAfterTest(true); + $this->resetAfterTest(); + $this->setAdminUser(); $this->displayoptions = new question_display_options(); $this->quba = question_engine::make_questions_usage_by_activity('unit_test', @@ -914,6 +917,7 @@ protected function check_current_mark($mark) { * $this->currentoutput so that it can be verified. */ protected function render() { + $this->quba->preload_all_step_users(); $this->currentoutput = $this->quba->render_question($this->slot, $this->displayoptions); } @@ -1005,9 +1009,9 @@ protected function get_tag_matcher($tag, $attributes) { * @param $condition one or more Expectations. (users varargs). */ protected function check_current_output() { - $html = $this->quba->render_question($this->slot, $this->displayoptions); + $this->render(); foreach (func_get_args() as $condition) { - $this->assert($condition, $html); + $this->assert($condition, $this->currentoutput); } } @@ -1019,9 +1023,9 @@ protected function check_current_output() { * @param question_contains_select_expectation $expectations One or more expectations. */ protected function check_output_contains_selectoptions(...$expectations) { - $html = $this->quba->render_question($this->slot, $this->displayoptions); + $this->render(); foreach ($expectations as $expectation) { - $this->assert_select_options($expectation, $html); + $this->assert_select_options($expectation, $this->currentoutput); } } diff --git a/question/engine/tests/walkthrough_test.php b/question/engine/tests/walkthrough_test.php index a834b003aa412..678f7a57d337d 100644 --- a/question/engine/tests/walkthrough_test.php +++ b/question/engine/tests/walkthrough_test.php @@ -107,6 +107,7 @@ public function test_action_author_with_display_options_testcase() { $displayoptions->userinfoinhistory = question_display_options::SHOW_ALL; $this->load_quba(); + $this->quba->preload_all_step_users(); $result = $this->quba->render_question($this->slot, $displayoptions); $numsteps = $this->quba->get_question_attempt($this->slot)->get_num_steps(); @@ -121,6 +122,13 @@ public function test_action_author_with_display_options_testcase() { $this->load_quba(); $result = $this->quba->render_question($this->slot, $displayoptions); + $message = 'Attempt to access the step user before it was initialised.'; + $message .= ' Did you forget to call question_usage_by_activity::preload_all_step_users() or similar?'; + $this->assertDebuggingCalled($message, DEBUG_DEVELOPER); + $this->resetDebugging(); + $this->quba->preload_all_step_users(); + $result = $this->quba->render_question($this->slot, $displayoptions); + $this->assertDebuggingNotCalled(); // The step just show the user profile link if the step's userid is different with student id. preg_match_all("/(.*)<\/a>/", $result, $matches); From d9a8eb2bdbc7d51630b465784a2281d7a76c8a14 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Sun, 7 Apr 2024 23:31:26 +0800 Subject: [PATCH 02/75] MDL-81457 core: Mark SSL test as skipped, not incomplete The incomplete test is intended for tests which are written but whose code does not yet exist. https://docs.phpunit.de/en/9.6/incomplete-and-skipped-tests.html --- lib/dml/tests/mysqli_native_moodle_database_test.php | 3 ++- lib/dml/tests/pgsql_native_moodle_database_test.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dml/tests/mysqli_native_moodle_database_test.php b/lib/dml/tests/mysqli_native_moodle_database_test.php index dd17338224abb..565ee41c26623 100644 --- a/lib/dml/tests/mysqli_native_moodle_database_test.php +++ b/lib/dml/tests/mysqli_native_moodle_database_test.php @@ -122,7 +122,8 @@ public function test_ssl_connection(): void { } catch (moodle_exception $e) { // ... or fail. // Unfortunately we cannot be sure with the error string. - $this->markTestIncomplete('SSL not supported?'); + $this->markTestSkipped('MySQL server does not support SSL. Unable to complete the test.'); + return; } try { diff --git a/lib/dml/tests/pgsql_native_moodle_database_test.php b/lib/dml/tests/pgsql_native_moodle_database_test.php index 3e0a32e554641..09e6030391dc4 100644 --- a/lib/dml/tests/pgsql_native_moodle_database_test.php +++ b/lib/dml/tests/pgsql_native_moodle_database_test.php @@ -409,7 +409,8 @@ public function test_ssl_connection(): void { // ... or fail with SSL not supported. $this->assertStringContainsString($pgconnerr, $e->debuginfo); $this->assertStringContainsString('server does not support SSL', $e->debuginfo); - $this->markTestIncomplete('SSL not supported.'); + $this->markTestSkipped('Postgres server does not support SSL. Unable to complete the test.'); + return; } try { From 5b9fdc0e9a8c8c1e006e67b00c79f4db4bf244f2 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Sun, 7 Apr 2024 23:31:26 +0800 Subject: [PATCH 03/75] MDL-81457 core: Do not mark tests as Incomplete when they are wrong This check was marking a test as Incomplete if there was a bug in any part of the test, rather than failing the test in such a way that the test bug may be found. https://docs.phpunit.de/en/9.6/incomplete-and-skipped-tests.html --- enrol/tests/externallib_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/enrol/tests/externallib_test.php b/enrol/tests/externallib_test.php index d5ebb5dce8755..c81ac56a14321 100644 --- a/enrol/tests/externallib_test.php +++ b/enrol/tests/externallib_test.php @@ -328,8 +328,9 @@ public function test_get_enrolled_users_visibility($settings, $results) { $this->expectExceptionMessage($exception['message']); } else { // Failed, only canview and exception are supported. - $this->markTestIncomplete('Incomplete, only canview and exception are supported'); + throw new \coding_exception('Incomplete, only canview and exception are supported'); } + // Switch to the user and assign the role. $this->setUser(${$user}); role_assign($roleid, $USER->id, $coursecontext); From dc0cf1f2735aeab764a324f784ff88497bd22102 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 13 Mar 2024 08:59:00 +0800 Subject: [PATCH 04/75] MDL-81209 core: Unit test should not care about plugin details --- lib/tests/component_test.php | 150 +++++++++++++++++++++++++++-------- 1 file changed, 118 insertions(+), 32 deletions(-) diff --git a/lib/tests/component_test.php b/lib/tests/component_test.php index 650a6d10ede17..2e82e59151827 100644 --- a/lib/tests/component_test.php +++ b/lib/tests/component_test.php @@ -26,7 +26,7 @@ * * @covers \core_component */ -class component_test extends advanced_testcase { +final class component_test extends advanced_testcase { /** * To be changed if number of subsystems increases/decreases, * this is defined here to annoy devs that try to add more without any thinking, @@ -508,8 +508,10 @@ public function test_get_plugin_list_with_file(): void { $this->assertEquals([], array_keys($list)); } + /** + * Tests for get_componenet_classes_in_namespace. + */ public function test_get_component_classes_in_namespace(): void { - // Unexisting. $this->assertCount(0, core_component::get_component_classes_in_namespace('core_unexistingcomponent', 'something')); $this->assertCount(0, core_component::get_component_classes_in_namespace('auth_cas', 'something')); @@ -519,36 +521,6 @@ public function test_get_component_classes_in_namespace(): void { $this->assertCount(0, core_component::get_component_classes_in_namespace('core_user', 'course')); $this->assertCount(0, core_component::get_component_classes_in_namespace('mod_forum', 'output\\emaildigest')); $this->assertCount(0, core_component::get_component_classes_in_namespace('mod_forum', '\\output\\emaildigest')); - $this->assertCount(2, core_component::get_component_classes_in_namespace('mod_forum', 'output\\email')); - $this->assertCount(2, core_component::get_component_classes_in_namespace('mod_forum', '\\output\\email')); - $this->assertCount(2, core_component::get_component_classes_in_namespace('mod_forum', 'output\\email\\')); - $this->assertCount(2, core_component::get_component_classes_in_namespace('mod_forum', '\\output\\email\\')); - - // Prefix with backslash if it doesn\'t come prefixed. - $this->assertCount(1, core_component::get_component_classes_in_namespace('auth_cas', 'task')); - $this->assertCount(1, core_component::get_component_classes_in_namespace('auth_cas', '\\task')); - - // Core as a component works, the function can normalise the component name. - $this->assertCount(7, core_component::get_component_classes_in_namespace('core', 'update')); - $this->assertCount(7, core_component::get_component_classes_in_namespace('', 'update')); - $this->assertCount(7, core_component::get_component_classes_in_namespace('moodle', 'update')); - - // Multiple levels. - $this->assertCount(5, core_component::get_component_classes_in_namespace('core_user', '\\output\\myprofile\\')); - $this->assertCount(5, core_component::get_component_classes_in_namespace('core_user', 'output\\myprofile\\')); - $this->assertCount(5, core_component::get_component_classes_in_namespace('core_user', '\\output\\myprofile')); - $this->assertCount(5, core_component::get_component_classes_in_namespace('core_user', 'output\\myprofile')); - - // Without namespace it returns classes/ classes. - $this->assertCount(8, core_component::get_component_classes_in_namespace('tool_mobile', '')); - $this->assertCount(2, core_component::get_component_classes_in_namespace('tool_filetypes')); - - // When no component is specified, classes are returned for the namespace in all components. - // (We don't assert exact amounts here as the count of `output` classes will change depending on plugins installed). - $this->assertGreaterThan( - count(\core_component::get_component_classes_in_namespace('core', 'output')), - count(\core_component::get_component_classes_in_namespace(null, 'output')) - ); // Without either a component or namespace it returns an empty array. $this->assertEmpty(\core_component::get_component_classes_in_namespace()); @@ -556,6 +528,120 @@ public function test_get_component_classes_in_namespace(): void { $this->assertEmpty(\core_component::get_component_classes_in_namespace(null, '')); } + /** + * Test that the get_component_classes_in_namespace() function returns classes in the correct namespace. + * + * @dataProvider get_component_classes_in_namespace_provider + * @param array $methodargs + * @param string $expectedclassnameformat + */ + public function test_get_component_classes_in_namespace_provider( + array $methodargs, + string $expectedclassnameformat, + ): void { + $classlist = core_component::get_component_classes_in_namespace(...$methodargs); + $this->assertGreaterThan(0, count($classlist)); + + foreach (array_keys($classlist) as $classname) { + $this->assertStringMatchesFormat($expectedclassnameformat, $classname); + } + } + + /** + * Data provider for get_component_classes_in_namespace tests. + * + * @return array + */ + public static function get_component_classes_in_namespace_provider(): array { + return [ + // Matches the last namespace level name not partials. + [ + ['mod_forum', 'output\\email'], + 'mod_forum\output\email\%s', + ], + [ + ['mod_forum', '\\output\\email'], + 'mod_forum\output\email\%s', + ], + [ + ['mod_forum', 'output\\email\\'], + 'mod_forum\output\email\%s', + ], + [ + ['mod_forum', '\\output\\email\\'], + 'mod_forum\output\email\%s', + ], + // Prefix with backslash if it doesn\'t come prefixed. + [ + ['auth_cas', 'task'], + 'auth_cas\task\%s', + ], + [ + ['auth_cas', '\\task'], + 'auth_cas\task\%s', + ], + + // Core as a component works, the function can normalise the component name. + [ + ['core', 'update'], + 'core\update\%s', + ], + [ + ['', 'update'], + 'core\update\%s', + ], + [ + ['moodle', 'update'], + 'core\update\%s', + ], + + // Multiple levels. + [ + ['core_user', '\\output\\myprofile\\'], + 'core_user\output\myprofile\%s', + ], + [ + ['core_user', 'output\\myprofile\\'], + 'core_user\output\myprofile\%s', + ], + [ + ['core_user', '\\output\\myprofile'], + 'core_user\output\myprofile\%s', + ], + [ + ['core_user', 'output\\myprofile'], + 'core_user\output\myprofile\%s', + ], + + // Without namespace it returns classes/ classes. + [ + ['tool_mobile', ''], + 'tool_mobile\%s', + ], + [ + ['tool_filetypes'], + 'tool_filetypes\%s', + ], + + // Multiple levels. + [ + ['core_user', '\\output\\myprofile\\'], + 'core_user\output\myprofile\%s', + ], + + // When no component is specified, classes are returned for the namespace in all components. + // (We don't assert exact amounts here as the count of `output` classes will change depending on plugins installed). + [ + ['core', 'output'], + 'core\%s', + ], + [ + [null, 'output'], + '%s', + ], + ]; + } + /** * Data provider for classloader test */ From 22e4cc9204fee87309eda654141b5627d331fa45 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 20 Mar 2024 14:13:28 +0000 Subject: [PATCH 05/75] MDL-81301 quiz: improve performance of deleting a quiz --- mod/quiz/lib.php | 26 +++++++++++++------------- mod/quiz/tests/lib_test.php | 18 ++++++++++-------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index 36a613b7aa439..db6b8294e5d8c 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -2434,24 +2434,24 @@ function mod_quiz_core_calendar_get_event_action_string(string $eventtype): stri } /** - * Delete question reference data. + * Delete all question references for a quiz. * * @param int $quizid The id of quiz. */ function quiz_delete_references($quizid): void { global $DB; - $slots = $DB->get_records('quiz_slots', ['quizid' => $quizid]); - foreach ($slots as $slot) { - $params = [ - 'itemid' => $slot->id, - 'component' => 'mod_quiz', - 'questionarea' => 'slot' - ]; - // Delete any set references. - $DB->delete_records('question_set_references', $params); - // Delete any references. - $DB->delete_records('question_references', $params); - } + + $cm = get_coursemodule_from_instance('quiz', $quizid); + $context = context_module::instance($cm->id); + + $conditions = [ + 'usingcontextid' => $context->id, + 'component' => 'mod_quiz', + 'questionarea' => 'slot', + ]; + + $DB->delete_records('question_references', $conditions); + $DB->delete_records('question_set_references', $conditions); } /** diff --git a/mod/quiz/tests/lib_test.php b/mod/quiz/tests/lib_test.php index 7a8bf4214081c..4b0536b4a487e 100644 --- a/mod/quiz/tests/lib_test.php +++ b/mod/quiz/tests/lib_test.php @@ -24,6 +24,7 @@ */ namespace mod_quiz; +use context_module; use core_external\external_api; use mod_quiz\quiz_settings; @@ -106,6 +107,7 @@ public function test_quiz_delete_instance() { // Setup a quiz with 1 standard and 1 random question. $quizgenerator = $this->getDataGenerator()->get_plugin_generator('mod_quiz'); $quiz = $quizgenerator->create_instance(['course' => $SITE->id, 'questionsperpage' => 3, 'grade' => 100.0]); + $context = context_module::instance($quiz->cmid); $questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question'); $cat = $questiongenerator->create_question_category(); @@ -121,20 +123,20 @@ public function test_quiz_delete_instance() { // Check that the random question was deleted. if ($randomq) { - $count = $DB->count_records('question', ['id' => $randomq->id]); - $this->assertEquals(0, $count); + $this->assertEquals(0, $DB->count_records('question', ['id' => $randomq->id])); } // Check that the standard question was not deleted. - $count = $DB->count_records('question', ['id' => $standardq->id]); - $this->assertEquals(1, $count); + $this->assertEquals(1, $DB->count_records('question', ['id' => $standardq->id])); // Check that all the slots were removed. - $count = $DB->count_records('quiz_slots', ['quizid' => $quiz->id]); - $this->assertEquals(0, $count); + $this->assertEquals(0, $DB->count_records('quiz_slots', ['quizid' => $quiz->id])); // Check that the quiz was removed. - $count = $DB->count_records('quiz', ['id' => $quiz->id]); - $this->assertEquals(0, $count); + $this->assertEquals(0, $DB->count_records('quiz', ['id' => $quiz->id])); + + // Check that any question references linked to this quiz are gone. + $this->assertEquals(0, $DB->count_records('question_references', ['usingcontextid' => $context->id])); + $this->assertEquals(0, $DB->count_records('question_set_references', ['usingcontextid' => $context->id])); } public function test_quiz_get_user_attempts() { From c550ef8dcbfd179028d3315233c3401c3fcb0c2c Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 17 Apr 2024 11:09:53 +0100 Subject: [PATCH 06/75] MDL-81578 user: disable form change checker for bulk user actions. When bulk user actions are used from the "Browse users" report. --- admin/user/user_bulk_forms.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/admin/user/user_bulk_forms.php b/admin/user/user_bulk_forms.php index 1a1604e225a51..62c4814fc7960 100644 --- a/admin/user/user_bulk_forms.php +++ b/admin/user/user_bulk_forms.php @@ -148,6 +148,10 @@ protected function build_actions(): array { public function definition() { $mform =& $this->_form; + // Most bulk actions perform a redirect on selection, so we shouldn't trigger formchange warnings (specifically because + // the user must have _already_ changed the current form by selecting users to perform the action on). + $mform->disable_form_change_checker(); + $mform->addElement('hidden', 'returnurl'); $mform->setType('returnurl', PARAM_LOCALURL); From 3c1b63c7d87c8393e79f2e383ce15291dd10bdcb Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Sat, 20 Apr 2024 20:56:34 +0800 Subject: [PATCH 07/75] MDL-81615 backup: Bump release to 4.5 --- backup/backup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup/backup.class.php b/backup/backup.class.php index 2107a2829e722..66026f870bd57 100644 --- a/backup/backup.class.php +++ b/backup/backup.class.php @@ -160,7 +160,7 @@ abstract class backup implements checksumable { /** * Usually same than major release zero version, mainly for informative/historic purposes. */ - const RELEASE = '4.4'; + const RELEASE = '4.5'; /** * Cipher to be used in backup and restore operations. From 78e5814a0f3111cedcb7aa8828faf7dfeed6ca04 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Sat, 20 Apr 2024 21:01:04 +0800 Subject: [PATCH 08/75] MDL-81616 upgrade: add the 4.4.0 separation line to all upgrade scripts --- admin/tool/cohortroles/db/upgrade.php | 3 +++ admin/tool/customlang/db/upgrade.php | 3 +++ admin/tool/dataprivacy/db/upgrade.php | 3 +++ admin/tool/log/db/upgrade.php | 3 +++ admin/tool/log/store/database/db/upgrade.php | 3 +++ admin/tool/log/store/standard/db/upgrade.php | 3 +++ admin/tool/mfa/factor/auth/db/upgrade.php | 3 +++ admin/tool/mobile/db/upgrade.php | 3 +++ admin/tool/monitor/db/upgrade.php | 3 +++ admin/tool/moodlenet/db/upgrade.php | 3 +++ admin/tool/policy/db/upgrade.php | 3 +++ admin/tool/usertours/db/upgrade.php | 3 +++ auth/cas/db/upgrade.php | 3 +++ auth/db/db/upgrade.php | 3 +++ auth/email/db/upgrade.php | 3 +++ auth/ldap/db/upgrade.php | 3 +++ auth/lti/db/upgrade.php | 3 +++ auth/manual/db/upgrade.php | 3 +++ auth/mnet/db/upgrade.php | 3 +++ auth/none/db/upgrade.php | 3 +++ auth/oauth2/db/upgrade.php | 3 +++ auth/shibboleth/db/upgrade.php | 3 +++ blocks/badges/db/upgrade.php | 3 +++ blocks/calendar_month/db/upgrade.php | 3 +++ blocks/calendar_upcoming/db/upgrade.php | 3 +++ blocks/completionstatus/db/upgrade.php | 3 +++ blocks/course_summary/db/upgrade.php | 3 +++ blocks/feedback/db/upgrade.php | 3 +++ blocks/html/db/upgrade.php | 3 +++ blocks/myoverview/db/upgrade.php | 3 +++ blocks/navigation/db/upgrade.php | 3 +++ blocks/recent_activity/db/upgrade.php | 3 +++ blocks/recentlyaccesseditems/db/upgrade.php | 3 +++ blocks/rss_client/db/upgrade.php | 3 +++ blocks/section_links/db/upgrade.php | 3 +++ blocks/selfcompletion/db/upgrade.php | 3 +++ blocks/settings/db/upgrade.php | 3 +++ blocks/tag_youtube/db/upgrade.php | 3 +++ blocks/timeline/db/upgrade.php | 3 +++ communication/provider/matrix/db/upgrade.php | 3 +++ course/format/topics/db/upgrade.php | 3 +++ course/format/weeks/db/upgrade.php | 3 +++ enrol/database/db/upgrade.php | 3 +++ enrol/flatfile/db/upgrade.php | 3 +++ enrol/guest/db/upgrade.php | 3 +++ enrol/imsenterprise/db/upgrade.php | 3 +++ enrol/lti/db/upgrade.php | 3 +++ enrol/manual/db/upgrade.php | 3 +++ enrol/mnet/db/upgrade.php | 3 +++ enrol/paypal/db/upgrade.php | 3 +++ enrol/self/db/upgrade.php | 3 +++ filter/displayh5p/db/upgrade.php | 3 +++ filter/mathjaxloader/db/upgrade.php | 3 +++ filter/mediaplugin/db/upgrade.php | 3 +++ filter/tex/db/upgrade.php | 3 +++ grade/grading/form/guide/db/upgrade.php | 3 +++ grade/grading/form/rubric/db/upgrade.php | 3 +++ grade/report/grader/db/upgrade.php | 3 +++ grade/report/history/db/upgrade.php | 3 +++ grade/report/overview/db/upgrade.php | 3 +++ grade/report/user/db/upgrade.php | 3 +++ lib/antivirus/clamav/db/upgrade.php | 3 +++ lib/db/upgrade.php | 3 +++ lib/editor/atto/db/upgrade.php | 3 +++ lib/editor/atto/plugins/equation/db/upgrade.php | 3 +++ lib/editor/atto/plugins/recordrtc/db/upgrade.php | 3 +++ media/player/videojs/db/upgrade.php | 3 +++ message/output/email/db/upgrade.php | 3 +++ message/output/popup/db/upgrade.php | 3 +++ mod/assign/db/upgrade.php | 3 +++ mod/assign/feedback/comments/db/upgrade.php | 3 +++ mod/assign/feedback/editpdf/db/upgrade.php | 3 +++ mod/assign/feedback/file/db/upgrade.php | 3 +++ mod/assign/submission/comments/db/upgrade.php | 3 +++ mod/assign/submission/file/db/upgrade.php | 3 +++ mod/assign/submission/onlinetext/db/upgrade.php | 3 +++ mod/bigbluebuttonbn/db/upgrade.php | 3 +++ mod/book/db/upgrade.php | 3 +++ mod/chat/db/upgrade.php | 3 +++ mod/choice/db/upgrade.php | 3 +++ mod/data/db/upgrade.php | 3 +++ mod/feedback/db/upgrade.php | 3 +++ mod/folder/db/upgrade.php | 3 +++ mod/forum/db/upgrade.php | 3 +++ mod/glossary/db/upgrade.php | 3 +++ mod/h5pactivity/db/upgrade.php | 3 +++ mod/imscp/db/upgrade.php | 3 +++ mod/label/db/upgrade.php | 3 +++ mod/lesson/db/upgrade.php | 3 +++ mod/lti/db/upgrade.php | 3 +++ mod/lti/service/gradebookservices/db/upgrade.php | 3 +++ mod/page/db/upgrade.php | 3 +++ mod/quiz/accessrule/seb/db/upgrade.php | 3 +++ mod/quiz/db/upgrade.php | 3 +++ mod/quiz/report/overview/db/upgrade.php | 3 +++ mod/quiz/report/statistics/db/upgrade.php | 3 +++ mod/resource/db/upgrade.php | 3 +++ mod/scorm/db/upgrade.php | 3 +++ mod/survey/db/upgrade.php | 3 +++ mod/url/db/upgrade.php | 3 +++ mod/wiki/db/upgrade.php | 3 +++ mod/workshop/db/upgrade.php | 3 +++ mod/workshop/form/accumulative/db/upgrade.php | 3 +++ mod/workshop/form/comments/db/upgrade.php | 3 +++ mod/workshop/form/numerrors/db/upgrade.php | 3 +++ mod/workshop/form/rubric/db/upgrade.php | 3 +++ payment/gateway/paypal/db/upgrade.php | 3 +++ portfolio/googledocs/db/upgrade.php | 3 +++ question/behaviour/manualgraded/db/upgrade.php | 3 +++ question/type/calculated/db/upgrade.php | 3 +++ question/type/calculatedmulti/db/upgrade.php | 3 +++ question/type/ddmarker/db/upgrade.php | 3 +++ question/type/essay/db/upgrade.php | 3 +++ question/type/match/db/upgrade.php | 3 +++ question/type/multianswer/db/upgrade.php | 3 +++ question/type/multichoice/db/upgrade.php | 3 +++ question/type/numerical/db/upgrade.php | 3 +++ question/type/ordering/db/upgrade.php | 3 +++ question/type/random/db/upgrade.php | 3 +++ question/type/randomsamatch/db/upgrade.php | 3 +++ question/type/shortanswer/db/upgrade.php | 3 +++ question/type/truefalse/db/upgrade.php | 3 +++ repository/dropbox/db/upgrade.php | 3 +++ repository/flickr/db/upgrade.php | 3 +++ repository/googledocs/db/upgrade.php | 3 +++ repository/onedrive/db/upgrade.php | 3 +++ search/engine/simpledb/db/upgrade.php | 3 +++ 127 files changed, 381 insertions(+) diff --git a/admin/tool/cohortroles/db/upgrade.php b/admin/tool/cohortroles/db/upgrade.php index b102f5b7a2b1b..ed03dab748f83 100644 --- a/admin/tool/cohortroles/db/upgrade.php +++ b/admin/tool/cohortroles/db/upgrade.php @@ -48,5 +48,8 @@ function xmldb_tool_cohortroles_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/customlang/db/upgrade.php b/admin/tool/customlang/db/upgrade.php index d9182cf16e3f1..a113e542e15fa 100644 --- a/admin/tool/customlang/db/upgrade.php +++ b/admin/tool/customlang/db/upgrade.php @@ -33,5 +33,8 @@ function xmldb_tool_customlang_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/dataprivacy/db/upgrade.php b/admin/tool/dataprivacy/db/upgrade.php index 935a364e04690..03282262f108c 100644 --- a/admin/tool/dataprivacy/db/upgrade.php +++ b/admin/tool/dataprivacy/db/upgrade.php @@ -103,5 +103,8 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/log/db/upgrade.php b/admin/tool/log/db/upgrade.php index 5420435a18ee9..4c963a947df99 100644 --- a/admin/tool/log/db/upgrade.php +++ b/admin/tool/log/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_tool_log_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/log/store/database/db/upgrade.php b/admin/tool/log/store/database/db/upgrade.php index bcc48974d653d..ba70293c25645 100644 --- a/admin/tool/log/store/database/db/upgrade.php +++ b/admin/tool/log/store/database/db/upgrade.php @@ -32,5 +32,8 @@ function xmldb_logstore_database_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/log/store/standard/db/upgrade.php b/admin/tool/log/store/standard/db/upgrade.php index 1f2d4862554b7..02be2a863e3f2 100644 --- a/admin/tool/log/store/standard/db/upgrade.php +++ b/admin/tool/log/store/standard/db/upgrade.php @@ -32,5 +32,8 @@ function xmldb_logstore_standard_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/mfa/factor/auth/db/upgrade.php b/admin/tool/mfa/factor/auth/db/upgrade.php index ed8a4bd52e54d..2c4e113767e02 100644 --- a/admin/tool/mfa/factor/auth/db/upgrade.php +++ b/admin/tool/mfa/factor/auth/db/upgrade.php @@ -48,5 +48,8 @@ function xmldb_factor_auth_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/mobile/db/upgrade.php b/admin/tool/mobile/db/upgrade.php index f5d3de9dafa69..586565f4e021b 100644 --- a/admin/tool/mobile/db/upgrade.php +++ b/admin/tool/mobile/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_tool_mobile_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/monitor/db/upgrade.php b/admin/tool/monitor/db/upgrade.php index 6036e73ea5fe8..a965e3d518880 100644 --- a/admin/tool/monitor/db/upgrade.php +++ b/admin/tool/monitor/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_tool_monitor_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/moodlenet/db/upgrade.php b/admin/tool/moodlenet/db/upgrade.php index 649e3df0f9e84..1c0ec164fa4b5 100644 --- a/admin/tool/moodlenet/db/upgrade.php +++ b/admin/tool/moodlenet/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_tool_moodlenet_upgrade(int $oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/policy/db/upgrade.php b/admin/tool/policy/db/upgrade.php index dc6e448ba7c74..d509c23eaaa80 100644 --- a/admin/tool/policy/db/upgrade.php +++ b/admin/tool/policy/db/upgrade.php @@ -39,5 +39,8 @@ function xmldb_tool_policy_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/usertours/db/upgrade.php b/admin/tool/usertours/db/upgrade.php index d0b7b12221847..e6aeceace911c 100644 --- a/admin/tool/usertours/db/upgrade.php +++ b/admin/tool/usertours/db/upgrade.php @@ -49,5 +49,8 @@ function xmldb_tool_usertours_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/cas/db/upgrade.php b/auth/cas/db/upgrade.php index 41bdd4130578d..d48cae169bc61 100644 --- a/auth/cas/db/upgrade.php +++ b/auth/cas/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_auth_cas_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/db/db/upgrade.php b/auth/db/db/upgrade.php index eb5b0994cc9d9..4f52f975b5d33 100644 --- a/auth/db/db/upgrade.php +++ b/auth/db/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_auth_db_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/email/db/upgrade.php b/auth/email/db/upgrade.php index ec4e562460797..c2916f6b7c907 100644 --- a/auth/email/db/upgrade.php +++ b/auth/email/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_auth_email_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/ldap/db/upgrade.php b/auth/ldap/db/upgrade.php index 3e3e0cf225939..7f3180ca2a88d 100644 --- a/auth/ldap/db/upgrade.php +++ b/auth/ldap/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_auth_ldap_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/lti/db/upgrade.php b/auth/lti/db/upgrade.php index bce94faf1aac9..963d5b1b5c950 100644 --- a/auth/lti/db/upgrade.php +++ b/auth/lti/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_auth_lti_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/manual/db/upgrade.php b/auth/manual/db/upgrade.php index 39d64b74cfdb1..800ba266f41bf 100644 --- a/auth/manual/db/upgrade.php +++ b/auth/manual/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_auth_manual_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/mnet/db/upgrade.php b/auth/mnet/db/upgrade.php index 59430a9c65900..86aa11a7aa211 100644 --- a/auth/mnet/db/upgrade.php +++ b/auth/mnet/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_auth_mnet_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/none/db/upgrade.php b/auth/none/db/upgrade.php index e5f98fbbfffdf..bc70e9b4dd4c1 100644 --- a/auth/none/db/upgrade.php +++ b/auth/none/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_auth_none_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/oauth2/db/upgrade.php b/auth/oauth2/db/upgrade.php index 9aec2b1b941d3..784aef02a335a 100644 --- a/auth/oauth2/db/upgrade.php +++ b/auth/oauth2/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_auth_oauth2_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/shibboleth/db/upgrade.php b/auth/shibboleth/db/upgrade.php index cf9ffd6824a56..3e9110f9921b3 100644 --- a/auth/shibboleth/db/upgrade.php +++ b/auth/shibboleth/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_auth_shibboleth_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/badges/db/upgrade.php b/blocks/badges/db/upgrade.php index 5defadbf4a4b1..29018eb29d813 100644 --- a/blocks/badges/db/upgrade.php +++ b/blocks/badges/db/upgrade.php @@ -52,5 +52,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/calendar_month/db/upgrade.php b/blocks/calendar_month/db/upgrade.php index d2ccf94793502..b187cc20b62e8 100644 --- a/blocks/calendar_month/db/upgrade.php +++ b/blocks/calendar_month/db/upgrade.php @@ -52,5 +52,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/calendar_upcoming/db/upgrade.php b/blocks/calendar_upcoming/db/upgrade.php index 8defbb45d1ade..30751c8660519 100644 --- a/blocks/calendar_upcoming/db/upgrade.php +++ b/blocks/calendar_upcoming/db/upgrade.php @@ -52,5 +52,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/completionstatus/db/upgrade.php b/blocks/completionstatus/db/upgrade.php index 70930bd0f4d26..74fd97e0aab76 100644 --- a/blocks/completionstatus/db/upgrade.php +++ b/blocks/completionstatus/db/upgrade.php @@ -53,5 +53,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/course_summary/db/upgrade.php b/blocks/course_summary/db/upgrade.php index 41473c0dd9663..c101513d62ccd 100644 --- a/blocks/course_summary/db/upgrade.php +++ b/blocks/course_summary/db/upgrade.php @@ -53,5 +53,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/feedback/db/upgrade.php b/blocks/feedback/db/upgrade.php index 93dcaf8c7b7e8..5bd28716c7045 100644 --- a/blocks/feedback/db/upgrade.php +++ b/blocks/feedback/db/upgrade.php @@ -52,5 +52,8 @@ function xmldb_block_feedback_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/html/db/upgrade.php b/blocks/html/db/upgrade.php index d4637d1cbc23f..96dee284c7b14 100644 --- a/blocks/html/db/upgrade.php +++ b/blocks/html/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_block_html_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/myoverview/db/upgrade.php b/blocks/myoverview/db/upgrade.php index c124b7788d8ff..ec9bcafb67ba4 100644 --- a/blocks/myoverview/db/upgrade.php +++ b/blocks/myoverview/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_block_myoverview_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/navigation/db/upgrade.php b/blocks/navigation/db/upgrade.php index d0f7187a874ad..f717b87d4fb03 100644 --- a/blocks/navigation/db/upgrade.php +++ b/blocks/navigation/db/upgrade.php @@ -60,5 +60,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/recent_activity/db/upgrade.php b/blocks/recent_activity/db/upgrade.php index cedeeca7caa30..e5bb424956c5e 100644 --- a/blocks/recent_activity/db/upgrade.php +++ b/blocks/recent_activity/db/upgrade.php @@ -52,5 +52,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/recentlyaccesseditems/db/upgrade.php b/blocks/recentlyaccesseditems/db/upgrade.php index 2073e881d4866..33c08ffd4cf57 100644 --- a/blocks/recentlyaccesseditems/db/upgrade.php +++ b/blocks/recentlyaccesseditems/db/upgrade.php @@ -52,5 +52,8 @@ function xmldb_block_recentlyaccesseditems_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/rss_client/db/upgrade.php b/blocks/rss_client/db/upgrade.php index 521b2b834ae77..30fad13d48227 100644 --- a/blocks/rss_client/db/upgrade.php +++ b/blocks/rss_client/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_block_rss_client_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/section_links/db/upgrade.php b/blocks/section_links/db/upgrade.php index d177c32048a1c..c1fd28adaca9e 100644 --- a/blocks/section_links/db/upgrade.php +++ b/blocks/section_links/db/upgrade.php @@ -54,5 +54,8 @@ function xmldb_block_section_links_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/selfcompletion/db/upgrade.php b/blocks/selfcompletion/db/upgrade.php index 9fbb61b72aae1..892246bcebd66 100644 --- a/blocks/selfcompletion/db/upgrade.php +++ b/blocks/selfcompletion/db/upgrade.php @@ -53,5 +53,8 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/settings/db/upgrade.php b/blocks/settings/db/upgrade.php index 6c8170dfbc44e..63dc5410e055a 100644 --- a/blocks/settings/db/upgrade.php +++ b/blocks/settings/db/upgrade.php @@ -60,5 +60,8 @@ function xmldb_block_settings_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/tag_youtube/db/upgrade.php b/blocks/tag_youtube/db/upgrade.php index fc123c496f98a..12576396d09cc 100644 --- a/blocks/tag_youtube/db/upgrade.php +++ b/blocks/tag_youtube/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_block_tag_youtube_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/timeline/db/upgrade.php b/blocks/timeline/db/upgrade.php index 67a6be3dda829..d91f019f04d1e 100644 --- a/blocks/timeline/db/upgrade.php +++ b/blocks/timeline/db/upgrade.php @@ -52,5 +52,8 @@ function xmldb_block_timeline_upgrade($oldversion, $block) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/communication/provider/matrix/db/upgrade.php b/communication/provider/matrix/db/upgrade.php index b06af8e155b2c..38b4f3fc7bd3e 100644 --- a/communication/provider/matrix/db/upgrade.php +++ b/communication/provider/matrix/db/upgrade.php @@ -54,5 +54,8 @@ function xmldb_communication_matrix_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/course/format/topics/db/upgrade.php b/course/format/topics/db/upgrade.php index 8690e5f38a587..4d6915d21b1d0 100644 --- a/course/format/topics/db/upgrade.php +++ b/course/format/topics/db/upgrade.php @@ -69,5 +69,8 @@ function xmldb_format_topics_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2023100901, 'format', 'topics'); } + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/course/format/weeks/db/upgrade.php b/course/format/weeks/db/upgrade.php index 4a2e225b715d9..971df63fa067a 100644 --- a/course/format/weeks/db/upgrade.php +++ b/course/format/weeks/db/upgrade.php @@ -51,5 +51,8 @@ function xmldb_format_weeks_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/database/db/upgrade.php b/enrol/database/db/upgrade.php index f9524cf264bf4..4658d2238dcbb 100644 --- a/enrol/database/db/upgrade.php +++ b/enrol/database/db/upgrade.php @@ -32,5 +32,8 @@ function xmldb_enrol_database_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/flatfile/db/upgrade.php b/enrol/flatfile/db/upgrade.php index b9183dd95dc55..f27b2656a9b8a 100644 --- a/enrol/flatfile/db/upgrade.php +++ b/enrol/flatfile/db/upgrade.php @@ -32,5 +32,8 @@ function xmldb_enrol_flatfile_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/guest/db/upgrade.php b/enrol/guest/db/upgrade.php index 11dba17306a85..d1719d14d6476 100644 --- a/enrol/guest/db/upgrade.php +++ b/enrol/guest/db/upgrade.php @@ -32,5 +32,8 @@ function xmldb_enrol_guest_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/imsenterprise/db/upgrade.php b/enrol/imsenterprise/db/upgrade.php index cd60ea8e3b000..ec9df3a07201c 100644 --- a/enrol/imsenterprise/db/upgrade.php +++ b/enrol/imsenterprise/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_enrol_imsenterprise_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/lti/db/upgrade.php b/enrol/lti/db/upgrade.php index 81f71013fe137..95f37a8119654 100644 --- a/enrol/lti/db/upgrade.php +++ b/enrol/lti/db/upgrade.php @@ -44,5 +44,8 @@ function xmldb_enrol_lti_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/manual/db/upgrade.php b/enrol/manual/db/upgrade.php index bfea1cc3a5a41..bb592770f3328 100644 --- a/enrol/manual/db/upgrade.php +++ b/enrol/manual/db/upgrade.php @@ -32,5 +32,8 @@ function xmldb_enrol_manual_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/mnet/db/upgrade.php b/enrol/mnet/db/upgrade.php index 3b69df6bd6160..da3c7a8406df4 100644 --- a/enrol/mnet/db/upgrade.php +++ b/enrol/mnet/db/upgrade.php @@ -32,5 +32,8 @@ function xmldb_enrol_mnet_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/paypal/db/upgrade.php b/enrol/paypal/db/upgrade.php index d715fbe791f5f..db601be973dfe 100644 --- a/enrol/paypal/db/upgrade.php +++ b/enrol/paypal/db/upgrade.php @@ -50,5 +50,8 @@ function xmldb_enrol_paypal_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/self/db/upgrade.php b/enrol/self/db/upgrade.php index f8677bd646aa3..73a822a8c7c7c 100644 --- a/enrol/self/db/upgrade.php +++ b/enrol/self/db/upgrade.php @@ -32,5 +32,8 @@ function xmldb_enrol_self_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/filter/displayh5p/db/upgrade.php b/filter/displayh5p/db/upgrade.php index d9bf449e1acc8..c5da55869bbb4 100644 --- a/filter/displayh5p/db/upgrade.php +++ b/filter/displayh5p/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_filter_displayh5p_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/filter/mathjaxloader/db/upgrade.php b/filter/mathjaxloader/db/upgrade.php index 455007064de7e..c2dada9e57686 100644 --- a/filter/mathjaxloader/db/upgrade.php +++ b/filter/mathjaxloader/db/upgrade.php @@ -36,5 +36,8 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/filter/mediaplugin/db/upgrade.php b/filter/mediaplugin/db/upgrade.php index 1ca6b5811b0cf..0a9a1a15bb3f9 100644 --- a/filter/mediaplugin/db/upgrade.php +++ b/filter/mediaplugin/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_filter_mediaplugin_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/filter/tex/db/upgrade.php b/filter/tex/db/upgrade.php index 9db1ecd761c2b..12d0647e5055d 100644 --- a/filter/tex/db/upgrade.php +++ b/filter/tex/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_filter_tex_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/grade/grading/form/guide/db/upgrade.php b/grade/grading/form/guide/db/upgrade.php index fd45ed63af719..df9b1331e3485 100644 --- a/grade/grading/form/guide/db/upgrade.php +++ b/grade/grading/form/guide/db/upgrade.php @@ -42,5 +42,8 @@ function xmldb_gradingform_guide_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/grade/grading/form/rubric/db/upgrade.php b/grade/grading/form/rubric/db/upgrade.php index 999296542f6e8..edaa2ddb0495f 100644 --- a/grade/grading/form/rubric/db/upgrade.php +++ b/grade/grading/form/rubric/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_gradingform_rubric_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/grade/report/grader/db/upgrade.php b/grade/report/grader/db/upgrade.php index c0af003d6c112..bb1c2b891e6bb 100644 --- a/grade/report/grader/db/upgrade.php +++ b/grade/report/grader/db/upgrade.php @@ -77,5 +77,8 @@ function xmldb_gradereport_grader_upgrade(int $oldversion): bool { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/grade/report/history/db/upgrade.php b/grade/report/history/db/upgrade.php index 26a444ced6bb0..a3909c35fe0b7 100644 --- a/grade/report/history/db/upgrade.php +++ b/grade/report/history/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_gradereport_history_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/grade/report/overview/db/upgrade.php b/grade/report/overview/db/upgrade.php index 5df0e8e7b8a6e..16c73681b915a 100644 --- a/grade/report/overview/db/upgrade.php +++ b/grade/report/overview/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_gradereport_overview_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/grade/report/user/db/upgrade.php b/grade/report/user/db/upgrade.php index 1cd616c3631ed..977a9f2518f68 100644 --- a/grade/report/user/db/upgrade.php +++ b/grade/report/user/db/upgrade.php @@ -36,5 +36,8 @@ function xmldb_gradereport_user_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/lib/antivirus/clamav/db/upgrade.php b/lib/antivirus/clamav/db/upgrade.php index 0d7b0d545b373..1ecd63dd951dd 100644 --- a/lib/antivirus/clamav/db/upgrade.php +++ b/lib/antivirus/clamav/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_antivirus_clamav_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index c7671471f5834..22b4c9bdb8d46 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1167,5 +1167,8 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2024041200.00); } + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/lib/editor/atto/db/upgrade.php b/lib/editor/atto/db/upgrade.php index fafd77fb6c57a..1c1352e74bde4 100644 --- a/lib/editor/atto/db/upgrade.php +++ b/lib/editor/atto/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_editor_atto_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/lib/editor/atto/plugins/equation/db/upgrade.php b/lib/editor/atto/plugins/equation/db/upgrade.php index adf83d5478373..cd834a38cfd3f 100644 --- a/lib/editor/atto/plugins/equation/db/upgrade.php +++ b/lib/editor/atto/plugins/equation/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_atto_equation_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/lib/editor/atto/plugins/recordrtc/db/upgrade.php b/lib/editor/atto/plugins/recordrtc/db/upgrade.php index f5c08aba072dd..10d7463819ca5 100644 --- a/lib/editor/atto/plugins/recordrtc/db/upgrade.php +++ b/lib/editor/atto/plugins/recordrtc/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_atto_recordrtc_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/media/player/videojs/db/upgrade.php b/media/player/videojs/db/upgrade.php index 4964964f9ebd4..b5d8ae3fef52c 100644 --- a/media/player/videojs/db/upgrade.php +++ b/media/player/videojs/db/upgrade.php @@ -58,5 +58,8 @@ function xmldb_media_videojs_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/message/output/email/db/upgrade.php b/message/output/email/db/upgrade.php index 96a2bd3f9fd01..1a080fcd6c63a 100644 --- a/message/output/email/db/upgrade.php +++ b/message/output/email/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_message_email_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/message/output/popup/db/upgrade.php b/message/output/popup/db/upgrade.php index e41d3f76bc28a..dac0a0909d858 100644 --- a/message/output/popup/db/upgrade.php +++ b/message/output/popup/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_message_popup_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/db/upgrade.php b/mod/assign/db/upgrade.php index e35248ff86417..1d99bf7f492df 100644 --- a/mod/assign/db/upgrade.php +++ b/mod/assign/db/upgrade.php @@ -63,5 +63,8 @@ function xmldb_assign_upgrade($oldversion) { upgrade_mod_savepoint(true, 2023103000, 'assign'); } + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/feedback/comments/db/upgrade.php b/mod/assign/feedback/comments/db/upgrade.php index b77eccb3de4cb..db24c1ec11991 100644 --- a/mod/assign/feedback/comments/db/upgrade.php +++ b/mod/assign/feedback/comments/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_assignfeedback_comments_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/feedback/editpdf/db/upgrade.php b/mod/assign/feedback/editpdf/db/upgrade.php index 4ab535ffb9c03..c8a8ee4b60ddc 100644 --- a/mod/assign/feedback/editpdf/db/upgrade.php +++ b/mod/assign/feedback/editpdf/db/upgrade.php @@ -48,5 +48,8 @@ function xmldb_assignfeedback_editpdf_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/feedback/file/db/upgrade.php b/mod/assign/feedback/file/db/upgrade.php index f9a4e5f2a84c2..64272266c0e81 100644 --- a/mod/assign/feedback/file/db/upgrade.php +++ b/mod/assign/feedback/file/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_assignfeedback_file_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/submission/comments/db/upgrade.php b/mod/assign/submission/comments/db/upgrade.php index 9fc6a20c7adc4..e25ebebc63748 100644 --- a/mod/assign/submission/comments/db/upgrade.php +++ b/mod/assign/submission/comments/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_assignsubmission_comments_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/submission/file/db/upgrade.php b/mod/assign/submission/file/db/upgrade.php index fcc9be2af6895..610e084dfeccf 100644 --- a/mod/assign/submission/file/db/upgrade.php +++ b/mod/assign/submission/file/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_assignsubmission_file_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/submission/onlinetext/db/upgrade.php b/mod/assign/submission/onlinetext/db/upgrade.php index ae0df7a7e2d2b..e83a5de6982f4 100644 --- a/mod/assign/submission/onlinetext/db/upgrade.php +++ b/mod/assign/submission/onlinetext/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_assignsubmission_onlinetext_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/bigbluebuttonbn/db/upgrade.php b/mod/bigbluebuttonbn/db/upgrade.php index 0223fa905e82e..7d107c7502903 100644 --- a/mod/bigbluebuttonbn/db/upgrade.php +++ b/mod/bigbluebuttonbn/db/upgrade.php @@ -73,6 +73,9 @@ function xmldb_bigbluebuttonbn_upgrade($oldversion = 0) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/book/db/upgrade.php b/mod/book/db/upgrade.php index c2b260eb1175f..8ba5706d7539d 100644 --- a/mod/book/db/upgrade.php +++ b/mod/book/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_book_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/chat/db/upgrade.php b/mod/chat/db/upgrade.php index e8aaf6d6e8dd4..d9366519db6ab 100644 --- a/mod/chat/db/upgrade.php +++ b/mod/chat/db/upgrade.php @@ -32,5 +32,8 @@ function xmldb_chat_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/choice/db/upgrade.php b/mod/choice/db/upgrade.php index 6de8108176967..249efbfc81688 100644 --- a/mod/choice/db/upgrade.php +++ b/mod/choice/db/upgrade.php @@ -49,5 +49,8 @@ function xmldb_choice_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/data/db/upgrade.php b/mod/data/db/upgrade.php index 32718e31e2e9d..9b90b57aac2fc 100644 --- a/mod/data/db/upgrade.php +++ b/mod/data/db/upgrade.php @@ -79,5 +79,8 @@ function xmldb_data_upgrade($oldversion) { upgrade_mod_savepoint(true, 2023100901, 'data'); } + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/feedback/db/upgrade.php b/mod/feedback/db/upgrade.php index db9af4ae70b01..8f6a5ae665af9 100644 --- a/mod/feedback/db/upgrade.php +++ b/mod/feedback/db/upgrade.php @@ -49,5 +49,8 @@ function xmldb_feedback_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/folder/db/upgrade.php b/mod/folder/db/upgrade.php index 472407fe9a349..695191b3c8963 100644 --- a/mod/folder/db/upgrade.php +++ b/mod/folder/db/upgrade.php @@ -52,5 +52,8 @@ function xmldb_folder_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/forum/db/upgrade.php b/mod/forum/db/upgrade.php index f28b2d2f83c6d..223f14f02ceb7 100644 --- a/mod/forum/db/upgrade.php +++ b/mod/forum/db/upgrade.php @@ -61,5 +61,8 @@ function xmldb_forum_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/glossary/db/upgrade.php b/mod/glossary/db/upgrade.php index a7d93da22cbff..781db646855ad 100644 --- a/mod/glossary/db/upgrade.php +++ b/mod/glossary/db/upgrade.php @@ -49,5 +49,8 @@ function xmldb_glossary_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/h5pactivity/db/upgrade.php b/mod/h5pactivity/db/upgrade.php index 46512f2fc95fb..31b7c7d2ad511 100644 --- a/mod/h5pactivity/db/upgrade.php +++ b/mod/h5pactivity/db/upgrade.php @@ -70,5 +70,8 @@ function xmldb_h5pactivity_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/imscp/db/upgrade.php b/mod/imscp/db/upgrade.php index ceb73199d81d5..6b51ba8f9fcba 100644 --- a/mod/imscp/db/upgrade.php +++ b/mod/imscp/db/upgrade.php @@ -36,5 +36,8 @@ function xmldb_imscp_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/label/db/upgrade.php b/mod/label/db/upgrade.php index c6edb5550e7c5..e0d32cbe8d272 100644 --- a/mod/label/db/upgrade.php +++ b/mod/label/db/upgrade.php @@ -97,5 +97,8 @@ function xmldb_label_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/lesson/db/upgrade.php b/mod/lesson/db/upgrade.php index 21afebb6ca788..eb412b7fa07de 100644 --- a/mod/lesson/db/upgrade.php +++ b/mod/lesson/db/upgrade.php @@ -57,5 +57,8 @@ function xmldb_lesson_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/lti/db/upgrade.php b/mod/lti/db/upgrade.php index 01f94cb5f95a9..cd1b205ea35b3 100644 --- a/mod/lti/db/upgrade.php +++ b/mod/lti/db/upgrade.php @@ -119,5 +119,8 @@ function xmldb_lti_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/lti/service/gradebookservices/db/upgrade.php b/mod/lti/service/gradebookservices/db/upgrade.php index 6f811f46bc5ed..a4419f0bf13b5 100644 --- a/mod/lti/service/gradebookservices/db/upgrade.php +++ b/mod/lti/service/gradebookservices/db/upgrade.php @@ -62,5 +62,8 @@ function xmldb_ltiservice_gradebookservices_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/page/db/upgrade.php b/mod/page/db/upgrade.php index 95a862e44e701..1c904d41241cd 100644 --- a/mod/page/db/upgrade.php +++ b/mod/page/db/upgrade.php @@ -52,5 +52,8 @@ function xmldb_page_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/quiz/accessrule/seb/db/upgrade.php b/mod/quiz/accessrule/seb/db/upgrade.php index f6529564f8f69..27ff6254b5a39 100644 --- a/mod/quiz/accessrule/seb/db/upgrade.php +++ b/mod/quiz/accessrule/seb/db/upgrade.php @@ -43,5 +43,8 @@ function xmldb_quizaccess_seb_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/quiz/db/upgrade.php b/mod/quiz/db/upgrade.php index a296b7020b4da..4748c3ad20011 100644 --- a/mod/quiz/db/upgrade.php +++ b/mod/quiz/db/upgrade.php @@ -132,5 +132,8 @@ function xmldb_quiz_upgrade($oldversion) { upgrade_mod_savepoint(true, 2023112402, 'quiz'); } + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/quiz/report/overview/db/upgrade.php b/mod/quiz/report/overview/db/upgrade.php index 621d4d9adde1c..b608b162760a5 100644 --- a/mod/quiz/report/overview/db/upgrade.php +++ b/mod/quiz/report/overview/db/upgrade.php @@ -36,5 +36,8 @@ function xmldb_quiz_overview_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/quiz/report/statistics/db/upgrade.php b/mod/quiz/report/statistics/db/upgrade.php index fefbfbaf371eb..0520dc77f292c 100644 --- a/mod/quiz/report/statistics/db/upgrade.php +++ b/mod/quiz/report/statistics/db/upgrade.php @@ -35,5 +35,8 @@ function xmldb_quiz_statistics_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/resource/db/upgrade.php b/mod/resource/db/upgrade.php index 23f7fa45792b9..86281fd990d5e 100644 --- a/mod/resource/db/upgrade.php +++ b/mod/resource/db/upgrade.php @@ -52,5 +52,8 @@ function xmldb_resource_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/scorm/db/upgrade.php b/mod/scorm/db/upgrade.php index d646aad07933a..41d5c29d4f1f2 100644 --- a/mod/scorm/db/upgrade.php +++ b/mod/scorm/db/upgrade.php @@ -190,5 +190,8 @@ function xmldb_scorm_upgrade($oldversion) { // Scorm savepoint reached. upgrade_mod_savepoint(true, 2023100901, 'scorm'); } + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/survey/db/upgrade.php b/mod/survey/db/upgrade.php index cac5ba4010d99..66c138cbba13f 100644 --- a/mod/survey/db/upgrade.php +++ b/mod/survey/db/upgrade.php @@ -49,5 +49,8 @@ function xmldb_survey_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/url/db/upgrade.php b/mod/url/db/upgrade.php index f6d991365a016..21df4b246b6b9 100644 --- a/mod/url/db/upgrade.php +++ b/mod/url/db/upgrade.php @@ -62,5 +62,8 @@ function xmldb_url_upgrade($oldversion) { upgrade_mod_savepoint(true, 2023100901, 'url'); } + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/wiki/db/upgrade.php b/mod/wiki/db/upgrade.php index 9689617ff3712..a9882a7b84f60 100644 --- a/mod/wiki/db/upgrade.php +++ b/mod/wiki/db/upgrade.php @@ -45,5 +45,8 @@ function xmldb_wiki_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/workshop/db/upgrade.php b/mod/workshop/db/upgrade.php index 0888187c5b9fc..f3ce0fbcfb767 100644 --- a/mod/workshop/db/upgrade.php +++ b/mod/workshop/db/upgrade.php @@ -42,5 +42,8 @@ function xmldb_workshop_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/workshop/form/accumulative/db/upgrade.php b/mod/workshop/form/accumulative/db/upgrade.php index 2eccedd08dd8b..3622bbf214505 100644 --- a/mod/workshop/form/accumulative/db/upgrade.php +++ b/mod/workshop/form/accumulative/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_workshopform_accumulative_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/workshop/form/comments/db/upgrade.php b/mod/workshop/form/comments/db/upgrade.php index 75ea0c2027e78..a6e4d35e07d8a 100644 --- a/mod/workshop/form/comments/db/upgrade.php +++ b/mod/workshop/form/comments/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_workshopform_comments_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/workshop/form/numerrors/db/upgrade.php b/mod/workshop/form/numerrors/db/upgrade.php index 7d925af09500b..e46a10133c4b9 100644 --- a/mod/workshop/form/numerrors/db/upgrade.php +++ b/mod/workshop/form/numerrors/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_workshopform_numerrors_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/workshop/form/rubric/db/upgrade.php b/mod/workshop/form/rubric/db/upgrade.php index 4f14d83542030..30758e445b33d 100644 --- a/mod/workshop/form/rubric/db/upgrade.php +++ b/mod/workshop/form/rubric/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_workshopform_rubric_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/payment/gateway/paypal/db/upgrade.php b/payment/gateway/paypal/db/upgrade.php index aa623ec631176..83035a4b95817 100644 --- a/payment/gateway/paypal/db/upgrade.php +++ b/payment/gateway/paypal/db/upgrade.php @@ -51,5 +51,8 @@ function xmldb_paygw_paypal_upgrade(int $oldversion): bool { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/portfolio/googledocs/db/upgrade.php b/portfolio/googledocs/db/upgrade.php index 152fb172a8360..c058e65a728de 100644 --- a/portfolio/googledocs/db/upgrade.php +++ b/portfolio/googledocs/db/upgrade.php @@ -28,5 +28,8 @@ function xmldb_portfolio_googledocs_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/behaviour/manualgraded/db/upgrade.php b/question/behaviour/manualgraded/db/upgrade.php index 5488a87442d4e..e5174e2c99daf 100644 --- a/question/behaviour/manualgraded/db/upgrade.php +++ b/question/behaviour/manualgraded/db/upgrade.php @@ -35,5 +35,8 @@ function xmldb_qbehaviour_manualgraded_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/calculated/db/upgrade.php b/question/type/calculated/db/upgrade.php index 3a3e941ffd52a..c6ecac95cece6 100644 --- a/question/type/calculated/db/upgrade.php +++ b/question/type/calculated/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_qtype_calculated_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/calculatedmulti/db/upgrade.php b/question/type/calculatedmulti/db/upgrade.php index fb2a012643701..23d3566b30661 100644 --- a/question/type/calculatedmulti/db/upgrade.php +++ b/question/type/calculatedmulti/db/upgrade.php @@ -51,5 +51,8 @@ function xmldb_qtype_calculatedmulti_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2024011700, 'qtype', 'calculatedmulti'); } + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/ddmarker/db/upgrade.php b/question/type/ddmarker/db/upgrade.php index 6b4b19a47c7da..419249a0059cf 100644 --- a/question/type/ddmarker/db/upgrade.php +++ b/question/type/ddmarker/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_qtype_ddmarker_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/essay/db/upgrade.php b/question/type/essay/db/upgrade.php index 2977627f81f53..2100696c0b936 100644 --- a/question/type/essay/db/upgrade.php +++ b/question/type/essay/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_qtype_essay_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/match/db/upgrade.php b/question/type/match/db/upgrade.php index e6d54ec1d3927..4935fcf9c0aca 100644 --- a/question/type/match/db/upgrade.php +++ b/question/type/match/db/upgrade.php @@ -36,5 +36,8 @@ function xmldb_qtype_match_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/multianswer/db/upgrade.php b/question/type/multianswer/db/upgrade.php index 49c4258dfa545..8a9cc9c5e6b3d 100644 --- a/question/type/multianswer/db/upgrade.php +++ b/question/type/multianswer/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_qtype_multianswer_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/multichoice/db/upgrade.php b/question/type/multichoice/db/upgrade.php index 3ff8a9e70cda8..7201b091d0105 100644 --- a/question/type/multichoice/db/upgrade.php +++ b/question/type/multichoice/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_qtype_multichoice_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/numerical/db/upgrade.php b/question/type/numerical/db/upgrade.php index 0e3dee5a086a3..acaab79b9b826 100644 --- a/question/type/numerical/db/upgrade.php +++ b/question/type/numerical/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_qtype_numerical_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/ordering/db/upgrade.php b/question/type/ordering/db/upgrade.php index b263cc7b22b62..e615d9ce5a0c0 100644 --- a/question/type/ordering/db/upgrade.php +++ b/question/type/ordering/db/upgrade.php @@ -367,5 +367,8 @@ function xmldb_qtype_ordering_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2024040401, 'qtype', 'ordering'); } + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/random/db/upgrade.php b/question/type/random/db/upgrade.php index 625a657d49da6..e3364d60b754e 100644 --- a/question/type/random/db/upgrade.php +++ b/question/type/random/db/upgrade.php @@ -36,5 +36,8 @@ function xmldb_qtype_random_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/randomsamatch/db/upgrade.php b/question/type/randomsamatch/db/upgrade.php index 57751b367cf72..9ef281ffc93b9 100644 --- a/question/type/randomsamatch/db/upgrade.php +++ b/question/type/randomsamatch/db/upgrade.php @@ -36,5 +36,8 @@ function xmldb_qtype_randomsamatch_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/shortanswer/db/upgrade.php b/question/type/shortanswer/db/upgrade.php index 6c92a152463c7..6b7cfc05880b3 100644 --- a/question/type/shortanswer/db/upgrade.php +++ b/question/type/shortanswer/db/upgrade.php @@ -37,5 +37,8 @@ function xmldb_qtype_shortanswer_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/question/type/truefalse/db/upgrade.php b/question/type/truefalse/db/upgrade.php index b8b7eac8b7ce3..6c158a600cdbc 100644 --- a/question/type/truefalse/db/upgrade.php +++ b/question/type/truefalse/db/upgrade.php @@ -38,5 +38,8 @@ function xmldb_qtype_truefalse_upgrade(int $oldversion): bool { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/repository/dropbox/db/upgrade.php b/repository/dropbox/db/upgrade.php index 8482a39122c23..806820e725bd3 100644 --- a/repository/dropbox/db/upgrade.php +++ b/repository/dropbox/db/upgrade.php @@ -28,5 +28,8 @@ function xmldb_repository_dropbox_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/repository/flickr/db/upgrade.php b/repository/flickr/db/upgrade.php index 12f4d3dedb146..708a40d805103 100644 --- a/repository/flickr/db/upgrade.php +++ b/repository/flickr/db/upgrade.php @@ -39,5 +39,8 @@ function xmldb_repository_flickr_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/repository/googledocs/db/upgrade.php b/repository/googledocs/db/upgrade.php index 789a53c9a1c3b..0c7d397162092 100644 --- a/repository/googledocs/db/upgrade.php +++ b/repository/googledocs/db/upgrade.php @@ -28,5 +28,8 @@ function xmldb_repository_googledocs_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/repository/onedrive/db/upgrade.php b/repository/onedrive/db/upgrade.php index 283a29e10dc2a..4171e8d4b9b6a 100644 --- a/repository/onedrive/db/upgrade.php +++ b/repository/onedrive/db/upgrade.php @@ -31,5 +31,8 @@ function xmldb_repository_onedrive_upgrade($oldversion) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/search/engine/simpledb/db/upgrade.php b/search/engine/simpledb/db/upgrade.php index 0ac5d8ffc64ad..ece82aa087ed9 100644 --- a/search/engine/simpledb/db/upgrade.php +++ b/search/engine/simpledb/db/upgrade.php @@ -36,5 +36,8 @@ function xmldb_search_simpledb_upgrade($oldversion = 0) { // Automatically generated Moodle v4.3.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v4.4.0 release upgrade line. + // Put any upgrade step following this. + return true; } From d7df0384650fb4cf8ed9d82d53a9c88c2d925c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Tue, 16 Apr 2024 15:38:10 +0200 Subject: [PATCH 09/75] MDL-81567 mod_quiz: Adopt edit section title pencil icons size. --- mod/quiz/styles.css | 1 - 1 file changed, 1 deletion(-) diff --git a/mod/quiz/styles.css b/mod/quiz/styles.css index 0cf4f33774ce0..64d2683b0d098 100644 --- a/mod/quiz/styles.css +++ b/mod/quiz/styles.css @@ -559,7 +559,6 @@ table.quizreviewsummary td.cell { } #page-mod-quiz-edit .section-heading .instancesectioncontainer { - font-size: 24px; display: inline; } From 6de045dea02b399731ebfe02da8a0d4aaaf04c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Mon, 8 Apr 2024 14:21:36 +0200 Subject: [PATCH 10/75] MDL-81460 theme_boost: Fix loading spinner wobbles --- .../output/icon_system_fontawesome.php | 4 ++-- theme/boost/scss/moodle/core.scss | 10 ++++---- theme/boost/scss/moodle/layout.scss | 4 ++-- theme/boost/scss/moodle/moodlenet.scss | 6 ++--- theme/boost/scss/moodle/tables.scss | 4 ++-- theme/boost/style/moodle.css | 24 +++++++++---------- theme/classic/style/moodle.css | 24 +++++++++---------- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/lib/classes/output/icon_system_fontawesome.php b/lib/classes/output/icon_system_fontawesome.php index 180d15def4001..e5d169047cf5c 100644 --- a/lib/classes/output/icon_system_fontawesome.php +++ b/lib/classes/output/icon_system_fontawesome.php @@ -265,8 +265,8 @@ public function get_core_icon_map() { 'core:i/info' => 'fa-info', 'core:i/invalid' => 'fa-times text-danger', 'core:i/item' => 'fa-circle', - 'core:i/loading' => 'fa-circle-o-notch fa-spin', - 'core:i/loading_small' => 'fa-circle-o-notch fa-spin', + 'core:i/loading' => 'fa-circle-o-notch fa-spin fa-sm', + 'core:i/loading_small' => 'fa-circle-o-notch fa-spin fa-sm', 'core:i/location' => 'fa-map-marker', 'core:i/lock' => 'fa-lock', 'core:i/log' => 'fa-list-alt', diff --git a/theme/boost/scss/moodle/core.scss b/theme/boost/scss/moodle/core.scss index fba267b83e80f..12278c2b686be 100644 --- a/theme/boost/scss/moodle/core.scss +++ b/theme/boost/scss/moodle/core.scss @@ -1521,8 +1521,8 @@ audio.mediaplugin_html5audio { .icon { display: block; font-size: 3em; - height: 1em; - width: 1em; + max-height: 3em; + max-width: 3em; } } .carousel-item .loading-icon .icon { @@ -2338,9 +2338,9 @@ $footer-link-color: $bg-inverse-link-color !default; transform: translate(-50%, -50%); .icon { - height: 30px; - width: 30px; - font-size: 30px; + max-height: 2em; + max-width: 2em; + font-size: 2em; } } } diff --git a/theme/boost/scss/moodle/layout.scss b/theme/boost/scss/moodle/layout.scss index be9b732959cc8..d00602f86a17b 100644 --- a/theme/boost/scss/moodle/layout.scss +++ b/theme/boost/scss/moodle/layout.scss @@ -25,8 +25,8 @@ top: 40%; position: fixed; .icon { - width: 1em; - height: 1em; + max-width: 4em; + max-height: 4em; font-size: 4em; } } diff --git a/theme/boost/scss/moodle/moodlenet.scss b/theme/boost/scss/moodle/moodlenet.scss index 475d3e000b9b6..c959a9fcdc265 100644 --- a/theme/boost/scss/moodle/moodlenet.scss +++ b/theme/boost/scss/moodle/moodlenet.scss @@ -60,9 +60,9 @@ .moodlenet-share-modal-content { .loading-icon { .icon { - width: 60px; - height: 60px; - font-size: 60px; + max-width: 4em; + max-height: 4em; + font-size: 4em; } } diff --git a/theme/boost/scss/moodle/tables.scss b/theme/boost/scss/moodle/tables.scss index 92958d6a946c1..56e01faa15dcd 100644 --- a/theme/boost/scss/moodle/tables.scss +++ b/theme/boost/scss/moodle/tables.scss @@ -76,8 +76,8 @@ table { left: calc(50% - 1.5rem); top: 200px; .icon { - height: 3rem; - width: 3rem; + max-height: 3rem; + max-width: 3rem; font-size: 3rem; } } diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index c4a0d0f28dfc5..efa84f2582eb2 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -24546,8 +24546,8 @@ audio.mediaplugin_html5audio { .modchooser .modal-body .loading-icon .icon { display: block; font-size: 3em; - height: 1em; - width: 1em; + max-height: 3em; + max-width: 3em; } .modchooser .modal-body .carousel-item .loading-icon .icon { margin: 1em auto; @@ -25282,9 +25282,9 @@ h3.sectionname .inplaceeditable.inplaceeditingon .editinstructions { transform: translate(-50%, -50%); } .overlay-icon-container .loading-icon .icon { - height: 30px; - width: 30px; - font-size: 30px; + max-height: 2em; + max-width: 2em; + font-size: 2em; } .w-auto { @@ -35146,8 +35146,8 @@ table .sticky-column { top: 200px; } .table-dynamic .loading-icon .icon { - height: 3rem; - width: 3rem; + max-height: 3rem; + max-width: 3rem; font-size: 3rem; } @@ -36861,8 +36861,8 @@ span[data-flexitour=container][x-placement=right] div[data-role=arrow]:after, sp position: fixed; } .layout.fullscreen .loading-icon .icon { - width: 1em; - height: 1em; + max-width: 4em; + max-height: 4em; font-size: 4em; } @@ -38637,9 +38637,9 @@ div.editor_atto_toolbar button .icon { padding: 1rem; } .moodlenet-share-dialog .modal-body .moodlenet-share-modal-content .loading-icon .icon { - width: 60px; - height: 60px; - font-size: 60px; + max-width: 4em; + max-height: 4em; + font-size: 4em; } .moodlenet-share-dialog .modal-body .moodlenet-share-modal-content .moodlenet-circle-status { height: 18rem; diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index dfd6ff997e024..84231bbec3110 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -24546,8 +24546,8 @@ audio.mediaplugin_html5audio { .modchooser .modal-body .loading-icon .icon { display: block; font-size: 3em; - height: 1em; - width: 1em; + max-height: 3em; + max-width: 3em; } .modchooser .modal-body .carousel-item .loading-icon .icon { margin: 1em auto; @@ -25282,9 +25282,9 @@ h3.sectionname .inplaceeditable.inplaceeditingon .editinstructions { transform: translate(-50%, -50%); } .overlay-icon-container .loading-icon .icon { - height: 30px; - width: 30px; - font-size: 30px; + max-height: 2em; + max-width: 2em; + font-size: 2em; } .w-auto { @@ -35146,8 +35146,8 @@ table .sticky-column { top: 200px; } .table-dynamic .loading-icon .icon { - height: 3rem; - width: 3rem; + max-height: 3rem; + max-width: 3rem; font-size: 3rem; } @@ -36795,8 +36795,8 @@ span[data-flexitour=container][x-placement=right] div[data-role=arrow]:after, sp position: fixed; } .layout.fullscreen .loading-icon .icon { - width: 1em; - height: 1em; + max-width: 4em; + max-height: 4em; font-size: 4em; } @@ -38571,9 +38571,9 @@ div.editor_atto_toolbar button .icon { padding: 1rem; } .moodlenet-share-dialog .modal-body .moodlenet-share-modal-content .loading-icon .icon { - width: 60px; - height: 60px; - font-size: 60px; + max-width: 4em; + max-height: 4em; + font-size: 4em; } .moodlenet-share-dialog .modal-body .moodlenet-share-modal-content .moodlenet-circle-status { height: 18rem; From f0e6e5addb889c557fdd57911bb4bf28b3ee7f71 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Tue, 16 Apr 2024 16:49:19 +0200 Subject: [PATCH 11/75] MDL-81570 tiny_premium: Add missing lang string --- lib/editor/tiny/plugins/premium/lang/en/tiny_premium.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/editor/tiny/plugins/premium/lang/en/tiny_premium.php b/lib/editor/tiny/plugins/premium/lang/en/tiny_premium.php index 917aeda955ef0..f9843b70337ee 100644 --- a/lib/editor/tiny/plugins/premium/lang/en/tiny_premium.php +++ b/lib/editor/tiny/plugins/premium/lang/en/tiny_premium.php @@ -28,5 +28,6 @@ $string['pluginname'] = 'TinyMCE Premium'; $string['apikey'] = 'API key'; $string['apikey_desc'] = '

Your API key is available on your Tiny Cloud account page if you have purchased a subscription, or if you are on a free trial.

See the list of available TinyMCE Premium features for Moodle in the documentation TinyMCE editor.

'; +$string['helplinktext'] = 'Premium plugins'; $string['premium:accesspremium'] = 'Access TinyMCE Premium features'; $string['privacy:metadata'] = 'The TinyMCE Premium plugin does not store any personal data.'; From 25780157bf0060f853e559ab9b73d0d237cdc8a3 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Thu, 18 Apr 2024 16:52:45 +0100 Subject: [PATCH 12/75] MDL-81603 reportbuilder: don't rely on real entity in datasource test. --- reportbuilder/tests/datasource_test.php | 112 +++++++++++++++--------- 1 file changed, 73 insertions(+), 39 deletions(-) diff --git a/reportbuilder/tests/datasource_test.php b/reportbuilder/tests/datasource_test.php index d1168f519baf3..f4057e8f9346c 100644 --- a/reportbuilder/tests/datasource_test.php +++ b/reportbuilder/tests/datasource_test.php @@ -28,7 +28,8 @@ use advanced_testcase; use core_reportbuilder_generator; -use core_reportbuilder\local\entities\user; +use core_reportbuilder\local\entities\base; +use core_reportbuilder\local\filters\text; use core_reportbuilder\local\report\{column, filter}; use lang_string; use ReflectionClass; @@ -43,7 +44,7 @@ * @copyright 2023 Paul Holden * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class datasource_test extends advanced_testcase { +final class datasource_test extends advanced_testcase { /** * Data provider for {@see test_add_columns_from_entity} @@ -52,20 +53,20 @@ class datasource_test extends advanced_testcase { */ public static function add_columns_from_entity_provider(): array { return [ - 'All column' => [ + 'All columns' => [ [], [], - 31, + 4, ], - 'Include columns (picture, fullname, fullnamewithlink, fullnamewithpicture, fullnamewithpicturelink)' => [ - ['picture', 'fullname*'], + 'Include columns (first, extra1, extra2)' => [ + ['first', 'extra*'], [], - 5, + 3, ], - 'Exclude columns (picture, fullname, fullnamewithlink, fullnamewithpicture, fullnamewithpicturelink)' => [ + 'Exclude columns (first, extra1, extra2)' => [ [], - ['picture', 'fullname*'], - 26, + ['first', 'extra*'], + 1, ], ]; } @@ -89,12 +90,12 @@ public function test_add_columns_from_entity( $instance = $this->get_datasource_test_source(); $method = (new ReflectionClass($instance))->getMethod('add_columns_from_entity'); - $method->invoke($instance, 'user', $include, $exclude); + $method->invoke($instance, 'datasource_test_entity', $include, $exclude); - // Get all our user entity columns. + // Get all our entity columns. $columns = array_filter( $instance->get_columns(), - fn(string $columnname) => strpos($columnname, 'user:') === 0, + fn(string $columnname) => strpos($columnname, 'datasource_test_entity:') === 0, ARRAY_FILTER_USE_KEY, ); @@ -111,17 +112,17 @@ public static function add_filters_from_entity_provider(): array { 'All filters' => [ [], [], - 28, + 4, ], - 'Include filters (department, phone1, phone2)' => [ - ['department', 'phone*'], + 'Include filters (first, extra1, extra2)' => [ + ['first', 'extra*'], [], 3, ], - 'Exclude filters (department, phone1, phone2)' => [ + 'Exclude filters (first, extra1, extra2)' => [ [], - ['department', 'phone*'], - 25, + ['first', 'extra*'], + 1, ], ]; } @@ -145,12 +146,12 @@ public function test_add_filters_from_entity( $instance = $this->get_datasource_test_source(); $method = (new ReflectionClass($instance))->getMethod('add_filters_from_entity'); - $method->invoke($instance, 'user', $include, $exclude); + $method->invoke($instance, 'datasource_test_entity', $include, $exclude); - // Get all our user entity filters. + // Get all our entity filters. $filters = array_filter( $instance->get_filters(), - fn(string $filtername) => strpos($filtername, 'user:') === 0, + fn(string $filtername) => strpos($filtername, 'datasource_test_entity:') === 0, ARRAY_FILTER_USE_KEY, ); @@ -167,17 +168,17 @@ public static function add_conditions_from_entity_provider(): array { 'All conditions' => [ [], [], - 28, + 4, ], - 'Include conditions (department, phone1, phone2)' => [ - ['department', 'phone*'], + 'Include conditions (first, extra1, extra2)' => [ + ['first', 'extra*'], [], 3, ], - 'Exclude conditions (department, phone1, phone2)' => [ + 'Exclude conditions (first, extra1, extra2)' => [ [], - ['department', 'phone*'], - 25, + ['first', 'extra*'], + 1, ], ]; } @@ -201,12 +202,12 @@ public function test_add_conditions_from_entity( $instance = $this->get_datasource_test_source(); $method = (new ReflectionClass($instance))->getMethod('add_conditions_from_entity'); - $method->invoke($instance, 'user', $include, $exclude); + $method->invoke($instance, 'datasource_test_entity', $include, $exclude); - // Get all our user entity conditions. + // Get all our entity conditions. $conditions = array_filter( $instance->get_conditions(), - fn(string $conditionname) => strpos($conditionname, 'user:') === 0, + fn(string $conditionname) => strpos($conditionname, 'datasource_test_entity:') === 0, ARRAY_FILTER_USE_KEY, ); @@ -222,19 +223,19 @@ public function test_add_all_from_entity(): void { $instance = $this->get_datasource_test_source(); $method = (new ReflectionClass($instance))->getMethod('add_all_from_entity'); - $method->invoke($instance, 'user', ['username'], ['firstname'], ['lastname']); + $method->invoke($instance, 'datasource_test_entity', ['first'], ['second'], ['extra1']); // Assert the column we added (plus one we didn't). - $this->assertInstanceOf(column::class, $instance->get_column('user:username')); - $this->assertNull($instance->get_column('user:email')); + $this->assertInstanceOf(column::class, $instance->get_column('datasource_test_entity:first')); + $this->assertNull($instance->get_column('datasource_test_entity:second')); // Assert the filter we added (plus one we didn't). - $this->assertInstanceOf(filter::class, $instance->get_filter('user:firstname')); - $this->assertNull($instance->get_filter('user:email')); + $this->assertInstanceOf(filter::class, $instance->get_filter('datasource_test_entity:second')); + $this->assertNull($instance->get_filter('datasource_test_entity:first')); // Assert the condition we added (plus one we didn't). - $this->assertInstanceOf(filter::class, $instance->get_condition('user:lastname')); - $this->assertNull($instance->get_condition('user:email')); + $this->assertInstanceOf(filter::class, $instance->get_condition('datasource_test_entity:extra1')); + $this->assertNull($instance->get_condition('datasource_test_entity:extra2')); } /** @@ -266,7 +267,7 @@ protected function initialise(): void { $this->add_column(new column('test', null, 'dummy')); // This is the entity from which we'll add our report elements. - $this->add_entity(new user()); + $this->add_entity(new datasource_test_entity()); } public static function get_name(): string { @@ -285,3 +286,36 @@ public function get_default_conditions(): array { return []; } } + +/** + * Simple implementation of the base entity + */ +class datasource_test_entity extends base { + + protected function get_default_tables(): array { + return ['course']; + } + + protected function get_default_entity_title(): lang_string { + return new lang_string('course'); + } + + /** + * We're going to add multiple columns/filters/conditions, each named as following: + * + * [first, second, extra1, extra2] + * + * @return base + */ + public function initialise(): base { + foreach (['first', 'second', 'extra1', 'extra2'] as $field) { + $name = new lang_string('customfieldcolumn', 'core_reportbuilder', $field); + + $this->add_column(new column($field, $name, $this->get_entity_name())); + $this->add_filter(new filter(text::class, $field, $name, $this->get_entity_name())); + $this->add_condition(new filter(text::class, $field, $name, $this->get_entity_name())); + } + + return $this; + } +} From 7594612fab738afac5a250477a31649ac74462e2 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 9 Apr 2024 17:52:37 +0100 Subject: [PATCH 13/75] MDL-81274 mod_data: observe current approved value on record import. --- .../local/importer/csv_entries_importer.php | 10 ++- mod/data/lib.php | 6 +- mod/data/tests/entries_import_test.php | 81 ++++++++++++++++--- .../test_data_import_with_approved.csv | 3 + mod/data/upgrade.txt | 3 + 5 files changed, 89 insertions(+), 14 deletions(-) create mode 100644 mod/data/tests/fixtures/test_data_import_with_approved.csv diff --git a/mod/data/classes/local/importer/csv_entries_importer.php b/mod/data/classes/local/importer/csv_entries_importer.php index a3b9064d1cad2..6fbc193839fe8 100644 --- a/mod/data/classes/local/importer/csv_entries_importer.php +++ b/mod/data/classes/local/importer/csv_entries_importer.php @@ -133,7 +133,15 @@ public function import_csv(stdClass $cm, stdClass $data, string $encoding, strin $authorid = $author->id; } } - if ($recordid = data_add_record($data, 0, $authorid)) { // Add instance to data_record. + + // Determine presence of "approved" field within the record to import. + $approved = true; + if (array_key_exists(get_string('approved', 'data'), $fieldnames)) { + $approvedindex = $fieldnames[get_string('approved', 'data')]; + $approved = !empty($record[$approvedindex]); + } + + if ($recordid = data_add_record($data, 0, $authorid, $approved)) { // Add instance to data_record. foreach ($fields as $field) { $fieldid = $fieldnames[$field->field->name]; if (isset($record[$fieldid])) { diff --git a/mod/data/lib.php b/mod/data/lib.php index 7715a3e4279e7..3bc9676dbe265 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -1156,9 +1156,11 @@ function data_numentries($data, $userid=null) { * @param object $data * @param int $groupid * @param int $userid + * @param bool $approved If specified, and the user has the capability to approve entries, then this value + * will be used as the approved status of the new record * @return bool */ -function data_add_record($data, $groupid = 0, $userid = null) { +function data_add_record($data, $groupid = 0, $userid = null, bool $approved = true) { global $USER, $DB; $cm = get_coursemodule_from_instance('data', $data->id); @@ -1170,7 +1172,7 @@ function data_add_record($data, $groupid = 0, $userid = null) { $record->groupid = $groupid; $record->timecreated = $record->timemodified = time(); if (has_capability('mod/data:approve', $context)) { - $record->approved = 1; + $record->approved = $approved; } else { $record->approved = 0; } diff --git a/mod/data/tests/entries_import_test.php b/mod/data/tests/entries_import_test.php index 66482dcbdde5f..8c2dd51d971a1 100644 --- a/mod/data/tests/entries_import_test.php +++ b/mod/data/tests/entries_import_test.php @@ -27,10 +27,12 @@ * * @package mod_data * @category test + * @covers \mod_data\local\importer\entries_importer + * @covers \mod_data\local\importer\csv_entries_importer * @copyright 2019 Tobias Reischmann * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class entries_import_test extends \advanced_testcase { +final class entries_import_test extends \advanced_testcase { /** * Set up function. @@ -271,11 +273,74 @@ public function test_import_with_field_username_without_userdata(): void { } /** - * Tests the import including files from a zip archive. + * Data provider for {@see test_import_without_approved} + * + * @return array[] + */ + public static function import_without_approved_provider(): array { + return [ + 'Teacher can approve entries' => ['teacher', [1, 1]], + 'Student cannot approve entries' => ['student', [0, 0]], + ]; + } + + /** + * Test importing file without approved status column + * + * @param string $user + * @param int[] $expected + * + * @dataProvider import_without_approved_provider + */ + public function test_import_without_approved(string $user, array $expected): void { + $testdata = $this->get_test_data(); + ['data' => $data, 'cm' => $cm] = $testdata; + + $this->setUser($testdata[$user]); + + $importer = new csv_entries_importer(__DIR__ . '/fixtures/test_data_import.csv', 'test_data_import.csv'); + $importer->import_csv($cm, $data, 'UTF-8', 'comma'); + + $records = $this->get_data_records($data->id); + $this->assertEquals($expected, array_column($records, 'approved')); + } + + /** + * Data provider for {@see test_import_with_approved} * - * @covers \mod_data\local\importer\entries_importer - * @covers \mod_data\local\importer\csv_entries_importer - * @return void + * @return array[] + */ + public static function import_with_approved_provider(): array { + return [ + 'Teacher can approve entries' => ['teacher', [1, 0]], + 'Student cannot approve entries' => ['student', [0, 0]], + ]; + } + + /** + * Test importing file with approved status column + * + * @param string $user + * @param int[] $expected + * + * @dataProvider import_with_approved_provider + */ + public function test_import_with_approved(string $user, array $expected): void { + $testdata = $this->get_test_data(); + ['data' => $data, 'cm' => $cm] = $testdata; + + $this->setUser($testdata[$user]); + + $importer = new csv_entries_importer(__DIR__ . '/fixtures/test_data_import_with_approved.csv', + 'test_data_import_with_approved.csv'); + $importer->import_csv($cm, $data, 'UTF-8', 'comma'); + + $records = $this->get_data_records($data->id); + $this->assertEquals($expected, array_column($records, 'approved')); + } + + /** + * Tests the import including files from a zip archive. */ public function test_import_with_files(): void { [ @@ -323,10 +388,6 @@ public function test_import_with_files(): void { /** * Tests the import including files from a zip archive. - * - * @covers \mod_data\local\importer\entries_importer - * @covers \mod_data\local\importer\csv_entries_importer - * @return void */ public function test_import_with_files_missing_file(): void { [ @@ -377,8 +438,6 @@ private function get_data_records(int $dataid): array { /** * Tests if the amount of imported records is counted properly. * - * @covers \mod_data\local\importer\csv_entries_importer::import_csv - * @covers \mod_data\local\importer\csv_entries_importer::get_added_records_messages * @dataProvider get_added_record_messages_provider * @param string $datafilecontent the content of the datafile to test as string * @param int $expectedcount the expected count of messages depending on the datafile content diff --git a/mod/data/tests/fixtures/test_data_import_with_approved.csv b/mod/data/tests/fixtures/test_data_import_with_approved.csv new file mode 100644 index 0000000000000..4a66bae07e5aa --- /dev/null +++ b/mod/data/tests/fixtures/test_data_import_with_approved.csv @@ -0,0 +1,3 @@ +ID,Param2,Approved +1,"My first entry",1 +2,"My second entry",0 diff --git a/mod/data/upgrade.txt b/mod/data/upgrade.txt index 24d03ae0e6091..cb658a91a2301 100644 --- a/mod/data/upgrade.txt +++ b/mod/data/upgrade.txt @@ -1,6 +1,9 @@ This files describes API changes in /mod/data - plugins, information provided here is intended especially for developers. +=== 4.5 === +* The `data_add_record` method accepts a new `$approved` parameter to set the corresponding state of the new record + === 4.4 === * The following behat steps are now deprecated. Use data generators instead: - I add a ":fieldtype" field to ":activityname" database and I fill the form with: From bbc91d47882e22a8e36cee44cd14475753bcb5e9 Mon Sep 17 00:00:00 2001 From: Daniel Neis Araujo Date: Fri, 19 Apr 2024 13:19:47 -0300 Subject: [PATCH 14/75] MDL-81613 report_log: fix user fullname export for log report --- report/log/classes/table_log.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/report/log/classes/table_log.php b/report/log/classes/table_log.php index d9fd538a0c5cd..06d450fa97d84 100644 --- a/report/log/classes/table_log.php +++ b/report/log/classes/table_log.php @@ -191,11 +191,13 @@ public function col_fullnameuser($event) { } else if ($eventusername) { if (empty($this->download)) { - $params = array('id' => $event->userid); + $params = ['id' => $event->userid]; if ($event->courseid) { $params['course'] = $event->courseid; } $username = html_writer::link(new moodle_url('/user/view.php', $params), $eventusername); + } else { + $username = $eventusername; } } else { $username = '-'; From da5de9e91e4e0bc7bece7a4597a49e4cbc2af3ad Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Thu, 16 Nov 2023 18:45:38 +0800 Subject: [PATCH 15/75] MDL-80107 gradingform: Behat test for defining marking guide --- .../tests/behat/define_marking_guide.feature | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 grade/grading/form/guide/tests/behat/define_marking_guide.feature diff --git a/grade/grading/form/guide/tests/behat/define_marking_guide.feature b/grade/grading/form/guide/tests/behat/define_marking_guide.feature new file mode 100644 index 0000000000000..04ccd8b9d76fe --- /dev/null +++ b/grade/grading/form/guide/tests/behat/define_marking_guide.feature @@ -0,0 +1,74 @@ +@gradingform @gradingform_guide +Feature: Teacher can define a marking guide + As a teacher, + I should be able to define a marking guide + + Background: + Given the following "users" exist: + | username | firtname | lastname | email | + | teacher1 | Teacher | One | teacher1@example.com | + And the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | course | name | advancedgradingmethod_submissions | + | assign | C1 | Assign 1 | guide | + And I am on the "Course 1" course page logged in as teacher1 + And I go to "Assign 1" advanced grading definition page + And I set the following fields to these values: + | Name | Marking guide 1 | + + Scenario: No criterion added to marking guide + When I press "Save as draft" + # Confirm that criterion parameters are required + Then I should see "Criterion name can not be empty" + And I should see "Criterion max score can not be empty" + # Confirm that marking guide is not saved due to the missing criterion + And I should not see "Marking guide 1 Draft" + And I should not see "Please note: the advanced grading form is not ready at the moment. Simple grading method will be used until the form has a valid status." + + @javascript + Scenario: Marking guide criterion is added to marking guide + Given I define the following marking guide: + | Criterion name | Description for students | Description for markers | Maximum score | + | Criteria 1 | Criteria 1 description for student | Criteria 1 description for marker | 70 | + | Criteria 2 | Criteria 2 description for student | Criteria 2 description for marker | 30 | + # Move Criteria 1 below Criteria 2 + And I click on "Move down" "button" in the "Criteria 1" "table_row" + When I press "Save as draft" + And I go to "Assign 1" advanced grading definition page + # Confirm that the order of criterion shown matches input -- Criteria 2 is listed before Criteria 1 + Then "Move down" "button" in the "Criteria 2" "table_row" should be visible + And "Move up" "button" in the "Criteria 2" "table_row" should not be visible + And "Move up" "button" in the "Criteria 1" "table_row" should be visible + And "Move down" "button" in the "Criteria 1" "table_row" should not be visible + # Confirm the other information entered were saved + And I should see "Criteria 2 description for student" in the "Criteria 2" "table_row" + And I should see "Criteria 2 description for marker" in the "Criteria 2" "table_row" + And I should see "30" in the "Criteria 2" "table_row" + And I should see "Criteria 1 description for student" in the "Criteria 1" "table_row" + And I should see "Criteria 1 description for marker" in the "Criteria 1" "table_row" + And I should see "70" in the "Criteria 1" "table_row" + + Scenario: Marking guide options and frequently used comment are added to marking guide + Given I define the following marking guide: + | Criterion name | Description for students | Description for markers | Maximum score | + | Criteria 1 | Criteria 1 description for student | Criteria 1 description for marker | 50 | + | Criteria 2 | Criteria 2 description for student | Criteria 2 description for marker | 50 | + # Add frequently used comments and other marking guide options + And I define the following frequently used comments: + | Comment 1 | + | Comment 2 | + And I set the following fields to these values: + | Show guide definition to students | 1 | + | Show marks per criterion to students | 0 | + When I press "Save as draft" + And I go to "Assign 1" advanced grading definition page + # Confirm that frequently used comments and marking guide options specified during registration are retained + Then I should see "Comment 1" + And I should see "Comment 2" + And the field "Show guide definition to students" matches value "1" + And the field "Show marks per criterion to students" matches value "0" From 735bef87d230ebede8b26bbebbed52fa4294992e Mon Sep 17 00:00:00 2001 From: ferranrecio Date: Wed, 17 Apr 2024 13:19:49 +0200 Subject: [PATCH 16/75] MDL-81575 core_courseformat: fix interactive section visibility badge --- .../output/local/content/section/visibility.php | 10 +++++++++- .../format/tests/behat/section_visibility.feature | 13 +++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/course/format/classes/output/local/content/section/visibility.php b/course/format/classes/output/local/content/section/visibility.php index 0d0cc6ba3703e..ecac3a61ab0b9 100644 --- a/course/format/classes/output/local/content/section/visibility.php +++ b/course/format/classes/output/local/content/section/visibility.php @@ -104,7 +104,15 @@ public function export_for_template(\renderer_base $output): ?stdClass { private function get_option_data(string $name, string $action): array { $baseurl = course_get_url($this->section->course, $this->section); $baseurl->param('sesskey', sesskey()); - $baseurl->param($action, $this->section->section); + $baseurl->param($name, $this->section->section); + + // The section page is not yet fully reactive and it needs to use the old non-ajax links. + $pagesectionid = $this->format->get_sectionid(); + if ($this->section->id == $pagesectionid) { + $baseurl->param('sectionid', $pagesectionid); + $action = ''; + } + return [ 'description' => get_string("availability_{$name}_help", 'core_courseformat'), 'icon' => $this->get_icon($name), diff --git a/course/format/tests/behat/section_visibility.feature b/course/format/tests/behat/section_visibility.feature index 316f895d11cfe..5574b975ae833 100644 --- a/course/format/tests/behat/section_visibility.feature +++ b/course/format/tests/behat/section_visibility.feature @@ -81,3 +81,16 @@ Feature: Varify section visibility interface And I log out And I am on the "C2" "Course" page logged in as "teacher1" And I should see "Hidden from students" in the "Section 1" "section" + + @javascript + Scenario: The visibility badge can show a hidden section in a the section page + Given I hide section "1" + When I am on the "C1 > Section 1" "course > section" page + And I click on "Hidden from students" "button" in the "[data-region='sectionbadges']" "css_element" + And I should see "Show on course page" in the "[data-region='sectionbadges']" "css_element" + And I should see "Hide on course page" in the "[data-region='sectionbadges']" "css_element" + And I click on "Show on course page" "link" in the "[data-region='sectionbadges']" "css_element" + Then I should not see "Hidden from students" in the "[data-region='sectionbadges']" "css_element" + And I open the action menu in "page-header" "region" + And I choose "Hide" in the open action menu + And I should see "Hidden from students" in the "[data-region='sectionbadges']" "css_element" From 8e7bd88ce3f9586dfed320cf4cc1d5eea38d6e89 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 23 Apr 2024 10:53:52 +0100 Subject: [PATCH 17/75] MDL-81627 quiz restore: fix restore of grade item for each slot --- .../backup/moodle2/restore_quiz_stepslib.php | 2 +- .../backup/restore_quiz_grade_items_test.php | 45 ++++++++++++------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/mod/quiz/backup/moodle2/restore_quiz_stepslib.php b/mod/quiz/backup/moodle2/restore_quiz_stepslib.php index 21833b7fb14b2..fa22cf4cf5f79 100644 --- a/mod/quiz/backup/moodle2/restore_quiz_stepslib.php +++ b/mod/quiz/backup/moodle2/restore_quiz_stepslib.php @@ -443,7 +443,7 @@ protected function process_quiz_question_instance($data) { } if (isset($data->quizgradeitemid)) { - $data->quizgradeitemid = $this->get_mappingid('quiz_grade_items', $data->quizgradeitemid); + $data->quizgradeitemid = $this->get_mappingid('quiz_grade_item', $data->quizgradeitemid); } $data->quizid = $this->get_new_parentid('quiz'); diff --git a/mod/quiz/tests/backup/restore_quiz_grade_items_test.php b/mod/quiz/tests/backup/restore_quiz_grade_items_test.php index 51d8b9176bee9..f3fdc2a6e8fe6 100644 --- a/mod/quiz/tests/backup/restore_quiz_grade_items_test.php +++ b/mod/quiz/tests/backup/restore_quiz_grade_items_test.php @@ -16,6 +16,7 @@ namespace mod_quiz; +use core_question_generator; use mod_quiz_generator; use restore_date_testcase; @@ -39,39 +40,51 @@ public function test_restore_quiz_grade_items(): void { global $DB; $this->resetAfterTest(); - $course = $this->getDataGenerator()->create_course(); + $generator = $this->getDataGenerator(); /** @var mod_quiz_generator $quizgen */ $quizgen = $this->getDataGenerator()->get_plugin_generator('mod_quiz'); + /** @var core_question_generator $questiongenerator */ + $questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question'); + + // Create a quiz with two grade items. + $course = $generator->create_course(); $quiz = $quizgen->create_instance(['course' => $course->id]); + $listeninggrade = $quizgen->create_grade_item(['quizid' => $quiz->id, 'name' => 'Listening']); + $readinggrade = $quizgen->create_grade_item(['quizid' => $quiz->id, 'name' => 'Reading']); + + // Add two questions to the quiz. + $cat = $questiongenerator->create_question_category(); + $saq1 = $questiongenerator->create_question('shortanswer', null, ['category' => $cat->id]); + $saq2 = $questiongenerator->create_question('shortanswer', null, ['category' => $cat->id]); + quiz_add_quiz_question($saq1->id, $quiz, 0, 1); + quiz_add_quiz_question($saq2->id, $quiz, 0, 1); - $quizgen->create_grade_item(['quizid' => $quiz->id, 'name' => 'Listening']); - $quizgen->create_grade_item(['quizid' => $quiz->id, 'name' => 'Reading']); + // Set one of the question to use a grade item. + $quizobj = quiz_settings::create($quiz->id); + $structure = $quizobj->get_structure(); + $structure->update_slot_grade_item($structure->get_slot_by_number(2), $readinggrade->id); + $quizobj->get_grade_calculator()->recompute_quiz_sumgrades(); - // Back up and restore including group info and user info. + // Back up and restore the course. $newcourseid = $this->backup_and_restore($course); + // Verify the grade items were copied over. $newquiz = $DB->get_record('quiz', ['course' => $newcourseid]); $quizobj = quiz_settings::create($newquiz->id); $structure = $quizobj->get_structure(); $quizgradeitems = array_values($structure->get_grade_items()); - // Strip out the ids, since we don't care what those will be. - $quizgradeitems = array_map( - function ($quizgradeitem) { - unset($quizgradeitem->id); - return $quizgradeitem; - }, - $quizgradeitems - ); - // Check the grade items are right in the restored quiz. $this->assertEquals( [ - (object) ['quizid' => $newquiz->id, 'sortorder' => 1, 'name' => 'Listening'], - (object) ['quizid' => $newquiz->id, 'sortorder' => 2, 'name' => 'Reading'], + (object) ['id' => reset($quizgradeitems)->id, 'quizid' => $newquiz->id, 'sortorder' => 1, 'name' => 'Listening'], + (object) ['id' => end($quizgradeitems)->id, 'quizid' => $newquiz->id, 'sortorder' => 2, 'name' => 'Reading'], ], - $quizgradeitems + array_values($quizgradeitems), ); + // Verify that each slot uses the right grade item. + $this->assertNull($structure->get_slot_by_number(1)->quizgradeitemid); + $this->assertEquals(end($quizgradeitems)->id, $structure->get_slot_by_number(2)->quizgradeitemid); } } From 93bf8539ca6e40d1b1ad194a307ffd3742b9a454 Mon Sep 17 00:00:00 2001 From: Amaia Anabitarte Date: Tue, 23 Apr 2024 16:08:03 +0200 Subject: [PATCH 18/75] MDL-78433 course: Remove duplicated course search form --- course/search.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/course/search.php b/course/search.php index f0d9d62561403..2b45b1d96c5f8 100644 --- a/course/search.php +++ b/course/search.php @@ -94,10 +94,8 @@ if ((can_edit_in_category() || !empty($usercatlist))) { $aurl = new moodle_url('/course/management.php', $searchcriteria); $searchform = $OUTPUT->single_button($aurl, get_string('managecourses'), 'get'); - } else { - $searchform = $courserenderer->course_search_form($search); + $PAGE->set_button($searchform); } - $PAGE->set_button($searchform); // Trigger event, courses searched. $eventparams = array('context' => $PAGE->context, 'other' => array('query' => $search)); From 676d7644526d100e12ef57c807a08c076c763ade Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 23 Apr 2024 18:25:04 +0100 Subject: [PATCH 19/75] MDL-81641 question: fix random question loader draft state tests --- .../tests/random_question_loader_test.php | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/question/tests/random_question_loader_test.php b/question/tests/random_question_loader_test.php index a977bbbae9d08..33b05269690ce 100644 --- a/question/tests/random_question_loader_test.php +++ b/question/tests/random_question_loader_test.php @@ -133,12 +133,10 @@ public function test_draft_questions_not_returned(): void { // Try to a random question from that category - should not be one. $filtercondition = [ - 'filter' => [ - 'category' => [ - 'jointype' => condition::JOINTYPE_DEFAULT, - 'values' => [$category->id], - 'filteroptions' => ['includesubcategories' => false], - ], + 'category' => [ + 'jointype' => condition::JOINTYPE_DEFAULT, + 'values' => [$category->id], + 'filteroptions' => ['includesubcategories' => false], ], ]; $loader = new random_question_loader(new qubaid_list([])); @@ -160,12 +158,10 @@ public function test_questions_with_later_draft_version_is_returned(): void { // Try to a random question from that category - should get V1. $filtercondition = [ - 'filter' => [ - 'category' => [ - 'jointype' => condition::JOINTYPE_DEFAULT, - 'values' => [$category->id], - 'filteroptions' => ['includesubcategories' => false], - ], + 'category' => [ + 'jointype' => condition::JOINTYPE_DEFAULT, + 'values' => [$category->id], + 'filteroptions' => ['includesubcategories' => false], ], ]; $loader = new random_question_loader(new qubaid_list([])); From 029db9dd4c00cf7e8f358c6bfb05735996d5013e Mon Sep 17 00:00:00 2001 From: Laurent David Date: Tue, 16 Apr 2024 14:22:03 +0200 Subject: [PATCH 20/75] MDL-81564 mod_data: Remove duplicate error messages * When a field is missing the error is duplicated for all field subsequently added to the database --- mod/data/field.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/data/field.php b/mod/data/field.php index 171e4aa055b0c..d8c66abc2f104 100644 --- a/mod/data/field.php +++ b/mod/data/field.php @@ -417,9 +417,9 @@ $OUTPUT->render_from_template('core/action_menu', $actionmenutemplate) ]; - if (!empty($missingfieldtypes)) { - echo $OUTPUT->notification(get_string('missingfieldtypes', 'data') . html_writer::alist($missingfieldtypes)); - } + } + if (!empty($missingfieldtypes)) { + echo $OUTPUT->notification(get_string('missingfieldtypes', 'data') . html_writer::alist($missingfieldtypes)); } echo html_writer::table($table); From b99760a3fb2ce17525c6ca3c4d6460fe90bf52c9 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Mon, 25 Mar 2024 17:07:01 +0800 Subject: [PATCH 21/75] MDL-81345 core: Remove unused library --- lib/womenslib.php | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 lib/womenslib.php diff --git a/lib/womenslib.php b/lib/womenslib.php deleted file mode 100644 index e577d94c0bb02..0000000000000 --- a/lib/womenslib.php +++ /dev/null @@ -1,29 +0,0 @@ -. - -/** - * @package moodlecore - * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -/** Include config.pgp */ -include('../config.php'); - -$PAGE->set_url('/lib/womenslib.php'); - -redirect('http://en.wikipedia.org/wiki/Women%27s_liberation'); \ No newline at end of file From eb36f078d817932c95983bf78ef47f803208a5fe Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Fri, 5 May 2023 17:40:27 +0800 Subject: [PATCH 22/75] MDL-77445 Behat: Coverage for activity chooser navigation --- course/tests/behat/activity_chooser.feature | 95 +++++++++++++++++++-- 1 file changed, 88 insertions(+), 7 deletions(-) diff --git a/course/tests/behat/activity_chooser.feature b/course/tests/behat/activity_chooser.feature index d73dcd07c91df..1d099e6fde8ac 100644 --- a/course/tests/behat/activity_chooser.feature +++ b/course/tests/behat/activity_chooser.feature @@ -8,14 +8,14 @@ Feature: Display and choose from the available activities in course Given the following "users" exist: | username | firstname | lastname | email | | teacher | Teacher | 1 | teacher@example.com | - And the following "course" exists: - | fullname | Course | - | shortname | C | - | format | topics | - | numsections | 1 | + And the following "courses" exist: + | fullname | shortname | format | startdate | + | Course | C | topics | | + | Course 2 | C2 | weeks | 95713920 | And the following "course enrolments" exist: - | user | course | role | - | teacher | C | editingteacher | + | user | course | role | + | teacher | C | editingteacher | + | teacher | C2 | editingteacher | And the following config values are set as admin: | enablemoodlenet | 0 | tool_moodlenet | And I log in as "teacher" @@ -46,6 +46,12 @@ Feature: Display and choose from the available activities in course When I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue" Then I should see "Assignment" in the "help" "core_course > Activity chooser screen" And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." + # Confirm show summary also works for weekly format course + And I am on "C2" course homepage with editing mode on + And I click on "Add an activity or resource" "button" in the "13 January - 19 January" "section" + And I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue" + And I should see "Assignment" in the "help" "core_course > Activity chooser screen" + And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." Scenario: Hide summary Given I click on "Add an activity or resource" "button" in the "New section" "section" @@ -57,6 +63,15 @@ Feature: Display and choose from the available activities in course And "help" "core_course > Activity chooser screen" should not be visible And "Back" "button" should not exist in the "modules" "core_course > Activity chooser screen" And I should not see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." in the "Add an activity or resource" "dialogue" + # Confirm hide summary also works for weekly format course + And I am on "C2" course homepage with editing mode on + And I click on "Add an activity or resource" "button" in the "13 January - 19 January" "section" + And I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue" + And I click on "Back" "button" in the "help" "core_course > Activity chooser screen" + And "modules" "core_course > Activity chooser screen" should be visible + And "help" "core_course > Activity chooser screen" should not be visible + And "Back" "button" should not exist in the "modules" "core_course > Activity chooser screen" + And I should not see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." in the "Add an activity or resource" "dialogue" Scenario: View recommended activities When I log out @@ -235,3 +250,69 @@ Feature: Display and choose from the available activities in course And I reload the page And I click on "Add an activity or resource" "button" in the "New section" "section" And "Recommended" "link" should appear before "Activities" "link" in the "Add an activity or resource" "dialogue" + + Scenario: Teacher can navigate through activity chooser in Topics format course + When I click on "Add an activity or resource" "button" in the "New section" "section" + Then I should see "All" in the "Add an activity or resource" "dialogue" + And I press the tab key + And I press the tab key + And I press the tab key + And I press the tab key + # Confirm right key works + And I press the right key + And I press the right key + And the focused element is "Choice" "menuitem" in the "Add an activity or resource" "dialogue" + # Confirm left key works + And I press the left key + And the focused element is "Book" "menuitem" in the "Add an activity or resource" "dialogue" + # Confirm clicking "x" button closes modal + And I click on "Close" "button" in the "Add an activity or resource" "dialogue" + And "Add an activity or resource" "dialogue" should not be visible + And I click on "Add an activity or resource" "button" in the "New section" "section" + # Confirm escape key closes the modal + And I press the escape key + And "Add an activity or resource" "dialogue" should not be visible + + Scenario: Teacher can navigate through activity chooser in Weekly format course + Given I am on "C2" course homepage with editing mode on + When I click on "Add an activity or resource" "button" in the "13 January - 19 January" "section" + Then I should see "All" in the "Add an activity or resource" "dialogue" + And I press the tab key + And I press the tab key + And I press the tab key + And I press the tab key + # Confirm right key works + And I press the right key + And I press the right key + And the focused element is "Choice" "menuitem" in the "Add an activity or resource" "dialogue" + # Confirm left key works + And I press the left key + And the focused element is "Book" "menuitem" in the "Add an activity or resource" "dialogue" + # Confirm clicking "x" button closes modal + And I click on "Close" "button" in the "Add an activity or resource" "dialogue" + And "Add an activity or resource" "dialogue" should not be visible + And I click on "Add an activity or resource" "button" in the "13 January - 19 January" "section" + # Confirm escape key closes the modal + And I press the escape key + And "Add an activity or resource" "dialogue" should not be visible + + Scenario: Teacher can access 'More help' from activity information in activity chooser + Given I click on "Add an activity or resource" "button" in the "New section" "section" + When I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue" + # Confirm more help link exists + Then "More help" "link" should exist + # Confirm that corresponding help icon exist + And ".iconhelp" "css_element" should exist + # Confirm that link opens in new window + And "Opens in new window" "link" should be visible + # Confirm the same behaviour for weekly format course + And I am on "C2" course homepage with editing mode on + And I click on "Add an activity or resource" "button" in the "13 January - 19 January" "section" + And I should see "All" in the "Add an activity or resource" "dialogue" + And I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue" + # Confirm more help link exists + And "More help" "link" should exist + # Confirm that corresponding help icon exist + And ".iconhelp" "css_element" should exist + # Confirm that link opens in new window + And "Opens in new window" "link" should be visible From 7c5cc9f1405b239eb536810037bae126b16854fd Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Thu, 27 Apr 2023 17:39:57 +0800 Subject: [PATCH 23/75] MDL-77998 Behat: Add behat coverage for preferences navigation --- my/tests/behat/preferences_navigation.feature | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 my/tests/behat/preferences_navigation.feature diff --git a/my/tests/behat/preferences_navigation.feature b/my/tests/behat/preferences_navigation.feature new file mode 100644 index 0000000000000..102b8971a9559 --- /dev/null +++ b/my/tests/behat/preferences_navigation.feature @@ -0,0 +1,106 @@ +@core @core_my @javascript +Feature: Navigate and use preferences page + In order to navigate through preferences page + As a user + I need to be able to use preferences page + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | student1 | Sam | Student | s1@example.com | + And the following "courses" exist: + | fullname | shortname | format | + | Course 1 | C1 | topics | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + And I log in as "admin" + + Scenario Outline: Navigating through user menu Preferences + When I follow "Preferences" in the user menu + # Click each link in the 'Preferences' page. + And I click on "" "link" in the "#page-content" "css_element" + # Confirm that each redirected page has 'Preferences' in the breadcrumbs. + And "Users" "link" should not exist in the ".breadcrumb" "css_element" + Then "Preferences" "link" should exist in the ".breadcrumb" "css_element" + # Additional confirmation that breadcrumbs is correct. + And "" "text" should exist in the ".breadcrumb" "css_element" + # Confirm that user name and profile picture are displayed in header section. + And I should see "Admin User" in the ".page-header-headings" "css_element" + And ".page-header-image" "css_element" should exist in the "#page-header" "css_element" + + Examples: + | userprefpage | + | Edit profile | + | Change password | + | Preferred language | + | Forum preferences | + | Editor preferences | + | Calendar preferences | + | Content bank preferences | + | Message preferences | + | Notification preferences | + | Manage badges | + | Badge preferences | + | Backpack settings | + | This user's role assignments | + | Permissions | + | Check permissions | + | Blog preferences | + | External blogs | + | Register an external blog | + + Scenario Outline: Navigating through course participant preferences + Given I am on "Course 1" course homepage + And I navigate to course participants + And I follow "Sam Student" + When I click on "Preferences" "link" in the "#region-main-box" "css_element" + Then I should see "Sam Student" in the ".page-header-headings" "css_element" + And ".page-header-image" "css_element" should exist in the "#page-header" "css_element" + # Click each link in the 'Preferences' page. + And I click on "" "link" in the "#page-content" "css_element" + # Confirm that each redirected page has 'Users/{user}/Preferences' in the breadcrumbs. + Then "Users" "link" should exist in the ".breadcrumb" "css_element" + And "Sam Student" "link" should exist in the ".breadcrumb" "css_element" + And "Preferences" "link" should exist in the ".breadcrumb" "css_element" + # Additional confirmation that breadcrumbs is correct. + And "" "text" should exist in the ".breadcrumb" "css_element" + # Confirm that user name and profile picture are displayed in header section. + And I should see "Sam Student" in the ".page-header-headings" "css_element" + And ".page-header-image" "css_element" should exist in the "#page-header" "css_element" + + Examples: + | courseprefpage | + | Edit profile | + | Preferred language | + | Forum preferences | + | Editor preferences | + | Calendar preferences | + | Content bank preferences | + | Message preferences | + | Notification preferences | + | This user's role assignments | + | Permissions | + | Check permissions | + + Scenario: Navigation with Event monitoring enabled + Given I navigate to "Reports > Event monitoring rules" in site administration + And I click on "Enable" "link" + And I press "Add a new rule" + And I set the following fields to these values: + | Rule name | Testing1 | + | Area to monitor | Subsystem (core) | + | Event | Allow role override | + And I press "Save changes" + When I follow "Preferences" in the user menu + # Confirm that Event monitoring is visible and clickable. + Then I should see "Miscellaneous" + And I follow "Event monitoring" + # Confirm that user can subscribe to new rule. + And "Subscribe to rule \"Testing1\"" "link" should exist + And I am on "Course 1" course homepage + And I navigate to course participants + And I follow "Sam Student" + And I click on "Preferences" "link" in the "#region-main-box" "css_element" + # Confirm that admin cannot change student's event monitor subscription. + And I should not see "Event monitoring" From 0bd601d6ba112f155e924b8858afab14b9ca200e Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 24 Apr 2024 20:52:32 +0100 Subject: [PATCH 24/75] MDL-81632 block_recentlyaccesseditems: deterministic item ordering. Behat tests of this functionality could trigger the unlikely (in real world usage) scenario where a user has an identical "timeaccess" value for multiple course activities. This led to random failures in said tests when the DB ordered items in apparently random order, where the "timeaccess" value was equal. --- blocks/recentlyaccesseditems/classes/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/recentlyaccesseditems/classes/helper.php b/blocks/recentlyaccesseditems/classes/helper.php index d1ac05b74baad..61e215ca261a3 100644 --- a/blocks/recentlyaccesseditems/classes/helper.php +++ b/blocks/recentlyaccesseditems/classes/helper.php @@ -58,7 +58,7 @@ public static function get_recent_items(int $limit = 0) { FROM {block_recentlyaccesseditems} rai JOIN {course} c ON c.id = rai.courseid WHERE userid = :userid - ORDER BY rai.timeaccess DESC"; + ORDER BY rai.timeaccess DESC, rai.id DESC"; $records = $DB->get_records_sql($sql, $paramsql); $order = 0; From 61b40e2eaab03b068b25fe60d8c225134a92e0f6 Mon Sep 17 00:00:00 2001 From: AMOS bot Date: Thu, 25 Apr 2024 00:12:21 +0000 Subject: [PATCH 25/75] Automatically generated installer lang files --- install/lang/pt/install.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/lang/pt/install.php b/install/lang/pt/install.php index 314f4ce8da30e..b551bb4c06261 100644 --- a/install/lang/pt/install.php +++ b/install/lang/pt/install.php @@ -32,7 +32,7 @@ $string['admindirname'] = 'Pasta de administração'; $string['availablelangs'] = 'Pacotes linguísticos disponíveis'; $string['chooselanguagehead'] = 'Selecione um idioma'; -$string['chooselanguagesub'] = 'Selecione o idioma a utilizar durante a instalação. O idioma escolhido será definido como o predefinido mas poderá depois selecionar outro(s) idioma(s) para o site e para os utilizadores.'; +$string['chooselanguagesub'] = 'Selecione o idioma a utilizar durante a instalação. O idioma escolhido será definido como o predefinido, mas poderá depois selecionar outro(s) idioma(s) para o site e para os utilizadores.'; $string['clialreadyconfigured'] = 'O ficheiro config.php já existe. Use \'admin/cli/install_database.php\' para instalar o Moodle para este site.'; $string['clialreadyinstalled'] = 'O ficheiro config.php já existe, use admin/cli/install_database.php para atualizar o Moodle para este site.'; $string['cliinstallheader'] = 'Programa para instalação do Moodle {$a} através da linha de comandos'; @@ -56,9 +56,9 @@ $string['pathsrodataroot'] = 'A pasta dos dados é só de leitura (não permite escrita).'; $string['pathsroparentdataroot'] = 'A pasta ascendente {$a->parent} não tem permissões de escrita. O programa de instalação não conseguiu criar a pasta {$a->dataroot}.'; $string['pathssubadmindir'] = 'Alguns servidores Web utilizam a pasta admin em URLs especiais de acesso a funcionalidades especiais, como é o caso de painéis de controlo. Algumas situações podem criar conflitos com a localização normal das páginas de administração do Moodle. Estes problemas podem ser resolvidos renomeando a pasta admin na instalação do Moodle e indicando aqui o novo nome a utilizar. Exemplo:

moodleadmin

Esta ação resolverá os problemas de acesso das hiperligações para as funcionalidades de administração do Moodle.'; -$string['pathssubdataroot'] = '

Pasta onde o Moodle irá armazenar todo o conteúdo de ficheiros enviados pelos utilizadores.

-

O utilizador do Moodle no servidor web (normalmente nobody, apache ou www-data) deve ter permissão de leitura e escrita nessa pasta. -

Não deve ser acessível diretamente através da web.

+$string['pathssubdataroot'] = '

Pasta onde o Moodle irá armazenar todo o conteúdo dos ficheiros enviados pelos utilizadores.

+

O utilizador do Moodle no servidor web (normalmente nobody, apache ou www-data) deve ter permissão de leitura e de escrita nessa pasta. +

Não pode ser acessível diretamente através da web.

Se a pasta não existir, o processo de instalação tentará criá-la.

'; $string['pathssubdirroot'] = 'Caminho completo para a pasta que contém o código Moodle.'; $string['pathssubwwwroot'] = 'Endereço web completo de acesso ao Moodle. Não é possível aceder ao Moodle usando mais do que um endereço. Se o site tiver mais do que um endereço público, devem ser configurados redirecionamentos permanentes em todos eles, à exceção deste. Se o site pode ser acedido a partir da Internet e de Intranet, use o endereço público aqui. Se o endereço atual não está correto, altere o endereço indicado na barra de endereço do seu navegador e reinicie a instalação.'; From 792698af000c3fb598b15f4d048fa76e02fbef50 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Thu, 25 Apr 2024 15:43:57 +0200 Subject: [PATCH 26/75] weekly on-sync release 4.5dev --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index 58172e3efd1e2..b0cc1eaf1ed0e 100644 --- a/version.php +++ b/version.php @@ -29,9 +29,9 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2024042200.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2024042200.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. -$release = '4.5dev (Build: 20240422)'; // Human-friendly version name +$release = '4.5dev (Build: 20240425)'; // Human-friendly version name $branch = '405'; // This version's branch. $maturity = MATURITY_ALPHA; // This version's maturity level. From 7cc089a4578fad8193fa75603c600e26715fd349 Mon Sep 17 00:00:00 2001 From: Mark Johnson Date: Wed, 24 Apr 2024 10:33:57 +0100 Subject: [PATCH 27/75] MDL-81611 assign: Close session early in gradingpanel fragment --- mod/assign/lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod/assign/lib.php b/mod/assign/lib.php index 7049d8845901c..c0cb2a6e3ef63 100644 --- a/mod/assign/lib.php +++ b/mod/assign/lib.php @@ -1400,6 +1400,8 @@ function assign_pluginfile($course, function mod_assign_output_fragment_gradingpanel($args) { global $CFG; + \core\session\manager::write_close(); // No changes to session in this function. + $context = $args['context']; if ($context->contextlevel != CONTEXT_MODULE) { From c4f840d404e132f31f3a670e0575b729febb0e0c Mon Sep 17 00:00:00 2001 From: SergioComeron Date: Fri, 5 Apr 2024 16:56:28 +0200 Subject: [PATCH 28/75] MDL-77272 report: Enable module level report options --- report/log/lib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/report/log/lib.php b/report/log/lib.php index 4d0fbe4b26290..1c6dcf6966b56 100644 --- a/report/log/lib.php +++ b/report/log/lib.php @@ -126,8 +126,7 @@ function report_log_can_access_user_report($user, $course) { function report_log_extend_navigation_module($navigation, $cm) { if (has_capability('report/log:view', context_course::instance($cm->course))) { $url = new moodle_url('/report/log/index.php', array('chooselog'=>'1','id'=>$cm->course,'modid'=>$cm->id)); - $navigation->add(get_string('logs'), $url, navigation_node::TYPE_SETTING, null, 'logreport', new pix_icon('i/report', '')) - ->set_show_in_secondary_navigation(false); + $navigation->add(get_string('logs'), $url, navigation_node::TYPE_SETTING, null, 'logreport', new pix_icon('i/report', '')); } } From 82a4c991ef702c6bb4015a467e8d1e22073022fe Mon Sep 17 00:00:00 2001 From: Mark Johnson Date: Mon, 22 Apr 2024 16:29:37 +0100 Subject: [PATCH 29/75] MDL-81610 course: Optimise core_courseformat\external\get_state core_courseformat\external\get_state calls export_for_tempalte for each course module, which in turn calls completion_info::is_tracked_user() for the current user on the current course. The result of this call will be the same for every course module, so does not need to be called what may be several hundred times. This change allows the result of is_tracked_user to be passed to the cm state object, then calls it once and passes it to each cm's object. If it is not passed in, it will be computed on demand as before. --- course/format/classes/external/get_state.php | 6 ++- .../format/classes/output/local/state/cm.php | 39 +++++++------------ 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/course/format/classes/external/get_state.php b/course/format/classes/external/get_state.php index 76970e0777f93..7e6a2d512e8ff 100644 --- a/course/format/classes/external/get_state.php +++ b/course/format/classes/external/get_state.php @@ -60,7 +60,7 @@ public static function execute_parameters(): external_function_parameters { * @return string Course state in JSON */ public static function execute(int $courseid): string { - global $PAGE, $CFG; + global $PAGE, $CFG, $USER; require_once($CFG->dirroot.'/course/lib.php'); @@ -73,6 +73,8 @@ public static function execute(int $courseid): string { $courseformat = course_get_format($courseid); $modinfo = $courseformat->get_modinfo(); + $completioninfo = new \completion_info(get_course($courseid)); + $istrackeduser = $completioninfo->is_tracked_user($USER->id); // Get the proper renderer. $renderer = $courseformat->get_renderer($PAGE); @@ -106,7 +108,7 @@ public static function execute(int $courseid): string { if ($cm->is_visible_on_course_page()) { // Only return this course module data if it's visible by current user on the course page. $section = $sections[$cm->sectionnum]; - $cmstate = new $cmclass($courseformat, $section, $cm); + $cmstate = new $cmclass($courseformat, $section, $cm, istrackeduser: $istrackeduser); $result->cm[] = $cmstate->export_for_template($renderer); } } diff --git a/course/format/classes/output/local/state/cm.php b/course/format/classes/output/local/state/cm.php index 2fef3e6870987..84853d4f2adfc 100644 --- a/course/format/classes/output/local/state/cm.php +++ b/course/format/classes/output/local/state/cm.php @@ -33,37 +33,26 @@ /** * Contains the ajax update course module structure. * - * @package core_course + * @package core_courseformat * @copyright 2021 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class cm implements renderable { - - /** @var course_format the course format class */ - protected $format; - - /** @var section_info the course section class */ - protected $section; - - /** @var bool if cmitem HTML content must be exported as well */ - protected $exportcontent; - - /** @var cm_info the course module to display */ - protected $cm; - /** * Constructor. - * - * @param course_format $format the course format - * @param section_info $section the section data - * @param cm_info $cm the course module data - * @param bool $exportcontent = false if pre-rendered cmitem must be exported. */ - public function __construct(course_format $format, section_info $section, cm_info $cm, bool $exportcontent = false) { - $this->format = $format; - $this->section = $section; - $this->cm = $cm; - $this->exportcontent = $exportcontent; + public function __construct( + /** @var course_format $format The course format. */ + protected course_format $format, + /** @var section_info $section The section data. */ + protected section_info $section, + /** @var cm_info $cm The course module data. */ + protected cm_info $cm, + /** @var bool $exportcontent False if pre-rendered cmitem HTML content must be exported. */ + protected bool $exportcontent = false, + /** @var ?bool $istrackeduser If is_tracked_user is pre-computed for this CM's course, it can be provided here. */ + protected ?bool $istrackeduser = null, + ) { } /** @@ -115,7 +104,7 @@ public function export_for_template(renderer_base $output): stdClass { // Completion status. $completioninfo = new completion_info($course); - $data->istrackeduser = $completioninfo->is_tracked_user($USER->id); + $data->istrackeduser = $this->istrackeduser ?? $completioninfo->is_tracked_user($USER->id); if ($data->istrackeduser && $completioninfo->is_enabled($cm)) { $completiondata = $completioninfo->get_data($cm); $data->completionstate = $completiondata->completionstate; From 17237b824da353ba47aa2028b64c1fb986d32eda Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 17 Apr 2024 16:17:27 +0200 Subject: [PATCH 30/75] MDL-81581 phpunit: Move multiple assert_same_xml() to common one --- question/engine/tests/helpers.php | 13 +++++++++++++ question/format/xml/tests/xmlformat_test.php | 5 ----- question/type/ddwtos/tests/question_type_test.php | 5 ----- .../type/gapselect/tests/question_type_test.php | 11 ----------- question/type/ordering/tests/questiontype_test.php | 11 ----------- 5 files changed, 13 insertions(+), 32 deletions(-) diff --git a/question/engine/tests/helpers.php b/question/engine/tests/helpers.php index f83d9697a413e..1e4ec1a38d129 100644 --- a/question/engine/tests/helpers.php +++ b/question/engine/tests/helpers.php @@ -602,6 +602,19 @@ public function assert_select_options($expectation, $html) { } return; } + + /** + * Check that 2 XML strings are the same, ignoring differences in line endings. + * + * @param string $expectedxml The expected XML string + * @param string $xml The XML string to check + */ + public function assert_same_xml($expectedxml, $xml) { + $this->assertEquals( + str_replace("\r\n", "\n", $expectedxml), + str_replace("\r\n", "\n", $xml) + ); + } } diff --git a/question/format/xml/tests/xmlformat_test.php b/question/format/xml/tests/xmlformat_test.php index fd8138819c733..7362a1b2295dc 100644 --- a/question/format/xml/tests/xmlformat_test.php +++ b/question/format/xml/tests/xmlformat_test.php @@ -47,11 +47,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class xmlformat_test extends \question_testcase { - public function assert_same_xml($expectedxml, $xml) { - $this->assertEquals(str_replace("\r\n", "\n", $expectedxml), - str_replace("\r\n", "\n", $xml)); - } - public function make_test_question() { global $USER; $q = new \stdClass(); diff --git a/question/type/ddwtos/tests/question_type_test.php b/question/type/ddwtos/tests/question_type_test.php index 16de9a09e355f..347bc16926030 100644 --- a/question/type/ddwtos/tests/question_type_test.php +++ b/question/type/ddwtos/tests/question_type_test.php @@ -47,11 +47,6 @@ protected function tearDown(): void { $this->qtype = null; } - public function assert_same_xml($expectedxml, $xml) { - $this->assertEquals(str_replace("\r\n", "\n", $expectedxml), - str_replace("\r\n", "\n", $xml)); - } - /** * Get some test question data. * diff --git a/question/type/gapselect/tests/question_type_test.php b/question/type/gapselect/tests/question_type_test.php index 019542fc56f88..0ad8b3b40aff2 100644 --- a/question/type/gapselect/tests/question_type_test.php +++ b/question/type/gapselect/tests/question_type_test.php @@ -46,17 +46,6 @@ protected function tearDown(): void { $this->qtype = null; } - /** - * Asserts that two strings containing XML are the same ignoring the line-endings. - * - * @param string $expectedxml - * @param string $xml - */ - public function assert_same_xml($expectedxml, $xml) { - $this->assertEquals(str_replace("\r\n", "\n", $expectedxml), - str_replace("\r\n", "\n", $xml)); - } - public function test_save_question() { $this->resetAfterTest(); diff --git a/question/type/ordering/tests/questiontype_test.php b/question/type/ordering/tests/questiontype_test.php index e9b98b3795fd9..c82f9ee8066ef 100644 --- a/question/type/ordering/tests/questiontype_test.php +++ b/question/type/ordering/tests/questiontype_test.php @@ -72,17 +72,6 @@ private static function expectedimport(): object { ]; } - /** - * Asserts that two XML strings are the same, ignoring differences in line endings. - * - * @param string $expectedxml - * @param string $xml - */ - public function assert_same_xml(string $expectedxml, string $xml): void { - $this->assertEquals(str_replace("\r\n", "\n", $expectedxml), - str_replace("\r\n", "\n", $xml)); - } - public function test_name(): void { $ordering = new qtype_ordering(); $this->assertEquals('ordering', $ordering->name()); From 71bd82ad6877783e8cf1dcddad6ac817b96b95cd Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 17 Apr 2024 16:25:45 +0200 Subject: [PATCH 31/75] MDL-81581 phpunit: Create the normalise_line_endings() method And apply it to all the obvious places related with the issue. Note that surely there are way more in code base, but it's out of scope for this issue. --- lib/phpunit/classes/util.php | 10 ++++++++++ question/engine/tests/helpers.php | 4 ++-- .../xml/tests/qformat_xml_import_export_test.php | 2 +- question/type/ordering/tests/questiontype_test.php | 6 +++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php index 22454da39f52e..0e0bb2d1cb678 100644 --- a/lib/phpunit/classes/util.php +++ b/lib/phpunit/classes/util.php @@ -990,6 +990,16 @@ protected static function pad(string $string, int $level): string { return str_repeat(" ", $level * 2) . "{$string}\n"; } + /** + * Normalise any text to always use unix line endings (line-feeds). + * + * @param string $text The text to normalize + * @return string + */ + public static function normalise_line_endings(string $text): string { + return str_replace(["\r\n", "\r"], "\n", $text); + } + /** * Get the coverage config for the supplied includelist and excludelist configuration. * diff --git a/question/engine/tests/helpers.php b/question/engine/tests/helpers.php index 1e4ec1a38d129..407374e856245 100644 --- a/question/engine/tests/helpers.php +++ b/question/engine/tests/helpers.php @@ -611,8 +611,8 @@ public function assert_select_options($expectation, $html) { */ public function assert_same_xml($expectedxml, $xml) { $this->assertEquals( - str_replace("\r\n", "\n", $expectedxml), - str_replace("\r\n", "\n", $xml) + phpunit_util::normalise_line_endings($expectedxml), + phpunit_util::normalise_line_endings($xml) ); } } diff --git a/question/format/xml/tests/qformat_xml_import_export_test.php b/question/format/xml/tests/qformat_xml_import_export_test.php index 975770ff4e6cc..11ec1a6a52847 100644 --- a/question/format/xml/tests/qformat_xml_import_export_test.php +++ b/question/format/xml/tests/qformat_xml_import_export_test.php @@ -78,7 +78,7 @@ public function assert_same_xml($expectedxml, $xml) { */ protected function normalise_xml($xml) { // Normalise line endings. - $xml = str_replace("\r\n", "\n", $xml); + $xml = phpunit_util::normalise_line_endings($xml); $xml = preg_replace("~\n$~", "", $xml); // Strip final newline in file. // Replace all numbers in question id comments with 0. diff --git a/question/type/ordering/tests/questiontype_test.php b/question/type/ordering/tests/questiontype_test.php index c82f9ee8066ef..00981c4fe4541 100644 --- a/question/type/ordering/tests/questiontype_test.php +++ b/question/type/ordering/tests/questiontype_test.php @@ -17,6 +17,7 @@ namespace qtype_ordering; use core_question_generator; +use phpunit_util; use qtype_ordering; use qtype_ordering_test_helper; use qtype_ordering_edit_form; @@ -315,6 +316,9 @@ public function test_gift_export(): void { $expectedgift = file_get_contents(__DIR__ . '/fixtures/testexport.gift.txt'); - $this->assertEquals($expectedgift, $gift); + $this->assertEquals( + phpunit_util::normalise_line_endings($expectedgift), + phpunit_util::normalise_line_endings($gift) + ); } } From dadfb6e90cf6f5e2d8bfede8ef174ed9502fa4ac Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 24 Apr 2024 12:00:54 +0200 Subject: [PATCH 32/75] MDL-81581 phpunit: Apply the new method to all remaining cases After discussing it in the issue, we have agreed to apply the new phpunit_util::normalise_line_endings() method to all the remaining cases (within tests!) where the manual replacement was being done. This commits achieves that. Note that I've looked for both str_replace() and preg_replace() cases, but only the former had cases worth converting. All the later ones are different and cannot be replaced by the new utility method. --- backup/util/xml/tests/writer_test.php | 3 +- .../aiken/tests/qformat_aiken_export_test.php | 6 ++-- .../format/gift/tests/giftformat_test.php | 35 ++++++++++--------- .../type/ordering/tests/questiontype_test.php | 2 +- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/backup/util/xml/tests/writer_test.php b/backup/util/xml/tests/writer_test.php index 2e5c4543551bf..109d26ba0058d 100644 --- a/backup/util/xml/tests/writer_test.php +++ b/backup/util/xml/tests/writer_test.php @@ -26,6 +26,7 @@ namespace core_backup; use memory_xml_output; +use phpunit_util; use xml_contenttransformer; use xml_output; use xml_writer; @@ -314,7 +315,7 @@ function test_xml_writer_public_api() { $fcontents = file_get_contents($CFG->dirroot . '/backup/util/xml/tests/fixtures/test1.xml'); // Normalise carriage return characters. - $fcontents = str_replace("\r\n", "\n", $fcontents); + $fcontents = phpunit_util::normalise_line_endings($fcontents); $this->assertEquals(trim($result), trim($fcontents)); } } diff --git a/question/format/aiken/tests/qformat_aiken_export_test.php b/question/format/aiken/tests/qformat_aiken_export_test.php index ac0eb13d84139..4623e521106ec 100644 --- a/question/format/aiken/tests/qformat_aiken_export_test.php +++ b/question/format/aiken/tests/qformat_aiken_export_test.php @@ -44,8 +44,10 @@ class qformat_aiken_export_test extends advanced_testcase { * @param string $text The actual string. */ public function assert_same_aiken($expectedtext, $text) { - $this->assertEquals(str_replace("\r\n", "\n", $expectedtext), - str_replace("\r\n", "\n", $text)); + $this->assertEquals( + phpunit_util::normalise_line_endings($expectedtext), + phpunit_util::normalise_line_endings($text) + ); } public function test_export_questions() { diff --git a/question/format/gift/tests/giftformat_test.php b/question/format/gift/tests/giftformat_test.php index ef0321b2ee7f9..1366e8cc07390 100644 --- a/question/format/gift/tests/giftformat_test.php +++ b/question/format/gift/tests/giftformat_test.php @@ -16,6 +16,7 @@ namespace qformat_gift; +use phpunit_util; use qformat_gift; use question_bank; use question_check_specified_fields_expectation; @@ -37,15 +38,17 @@ */ class giftformat_test extends \question_testcase { public function assert_same_gift($expectedtext, $text) { - $this->assertEquals(str_replace("\r\n", "\n", $expectedtext), - str_replace("\r\n", "\n", $text)); + $this->assertEquals( + phpunit_util::normalise_line_endings($expectedtext), + phpunit_util::normalise_line_endings($text) + ); } public function test_import_essay() { $gift = ' // essay ::Q8:: How are you? {}'; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -114,7 +117,7 @@ public function test_import_match() { =[markdown]A collection of web pages that anyone can add to or edit. -> Wiki = -> Chat }'; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -284,7 +287,7 @@ public function test_import_multichoice($numberingstyle) { ~red # [html]wrong, it's yellow ~[plain]blue # wrong, it's yellow }"; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -387,7 +390,7 @@ public function test_import_multichoice_multi() { ~%50%off-beige # right; good! ~%-100%[plain]blue # wrong }"; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -482,7 +485,7 @@ public function test_import_multichoice_multi_tricky() { ~%-50%red # wrong ~%-50%blue # wrong }"; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -694,7 +697,7 @@ public function test_import_numerical() { $gift = " // math range question ::Q5:: What is a number from 1 to 5? {#3:2~#Completely wrong}"; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -800,7 +803,7 @@ public function test_import_shortanswer() { =%50%Cat#What is it with Moodlers and cats? =%0%*#Completely wrong }"; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -856,7 +859,7 @@ public function test_import_shortanswer_with_general_feedback() { =%0%*#Completely wrong ####[html]Here is some general feedback! }"; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -1029,7 +1032,7 @@ public function test_import_truefalse() { // true/false ::Q1:: 42 is the Absolute Answer to everything.{ FALSE#42 is the Ultimate Answer.#You gave the right answer.}"; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -1063,7 +1066,7 @@ public function test_import_truefalse() { public function test_import_truefalse_true_answer1() { $gift = "// name 0-11 ::2-08 TSL::TSL is blablabla.{T}"; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -1097,7 +1100,7 @@ public function test_import_truefalse_true_answer1() { public function test_import_truefalse_true_answer2() { $gift = "// name 0-11 ::2-08 TSL::TSL is blablabla.{TRUE}"; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -1219,7 +1222,7 @@ public function test_import_backslash() { $gift = ' // essay ::double backslash:: A \\\\ B \\\\\\\\ C{}'; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -1257,7 +1260,7 @@ public function test_import_pre_content() { \} {}'; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); @@ -1296,7 +1299,7 @@ public function test_import_question_with_tags() { // This question is to test importing tags: [tag:tag] [tag:other-tag]. // And an idnumber: [id:myid]. ::Question name:: How are you? {}'; - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $importer = new qformat_gift(); $q = $importer->readquestion($lines); diff --git a/question/type/ordering/tests/questiontype_test.php b/question/type/ordering/tests/questiontype_test.php index 00981c4fe4541..5a390258ba412 100644 --- a/question/type/ordering/tests/questiontype_test.php +++ b/question/type/ordering/tests/questiontype_test.php @@ -293,7 +293,7 @@ public function test_gift_import(): void { // Import a question from GIFT. $gift = file_get_contents(__DIR__ . '/fixtures/testimport.gift.txt'); $format = new qformat_gift(); - $lines = preg_split('/[\\n\\r]/', str_replace("\r\n", "\n", $gift)); + $lines = preg_split('/[\\n\\r]/', phpunit_util::normalise_line_endings($gift)); $imported = $format->readquestion($lines); $this->assert(new question_check_specified_fields_expectation(self::expectedimport()), $imported); From 88b4bc2bebf60be67e6ed9ad867fddcf5d69d748 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Thu, 25 Apr 2024 21:37:30 +0100 Subject: [PATCH 33/75] MDL-81697 qtype_ordering: correctly reference feedback file areas. --- question/type/ordering/question.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/question/type/ordering/question.php b/question/type/ordering/question.php index 8ed6afee37c34..fce4b9b212538 100644 --- a/question/type/ordering/question.php +++ b/question/type/ordering/question.php @@ -385,7 +385,7 @@ public function check_file_access($qa, $options, $component, $filearea, $args, $ $answerid = reset($args); // Value of "itemid" is answer id. return array_key_exists($answerid, $this->answers); } - if (in_array($filearea, $this->qtype->feedbackfields)) { + if (in_array($filearea, ['correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback'])) { return $this->check_combined_feedback_file_access($qa, $options, $filearea, $args); } if ($filearea == 'hint') { From f91dd598efed1b1ce00ed32d2416400cc768c298 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 26 Apr 2024 09:40:51 +0100 Subject: [PATCH 34/75] MDL-80597 mod_quiz: simplify filtering by tags Behat assertions. The initial filtering for category was redundant, as it's applied by default. While present it also caused reproducible failures on CI due to timing issues when trying to apply multiple filters. --- mod/quiz/tests/behat/editing_add_random.feature | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/quiz/tests/behat/editing_add_random.feature b/mod/quiz/tests/behat/editing_add_random.feature index 856db6e3c4c41..76232c4090b54 100644 --- a/mod/quiz/tests/behat/editing_add_random.feature +++ b/mod/quiz/tests/behat/editing_add_random.feature @@ -53,19 +53,20 @@ Feature: Adding random questions to a quiz based on category and tags Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1" When I open the "last" add to quiz menu And I follow "a random question" - And I apply question bank filter "Category" with value "Questions Category 1" And I apply question bank filter "Tag" with value "foo" - And I click on "Apply filters" "button" And I wait until the page is ready And I should see "question 1 name" - And I should not see "question 3 name" + And I should see "\"listen\" & \"answer\"" And I should not see "question 2 name" + And I should not see "question 3 name" And I should not see "question 4 name" + # Ensure tagged questions inside subcategories are also matched. And I set the field "Also show questions from subcategories" to "1" And I click on "Apply filters" "button" And I wait until the page is ready And I should see "question 1 name" And I should see "question 3 name" + And I should see "\"listen\" & \"answer\"" And I should not see "question 2 name" And I should not see "question 4 name" From 5f8b568cbc19a866c2212328230570ce160572fb Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 26 Apr 2024 15:08:33 +0100 Subject: [PATCH 35/75] MDL-79149 report_participation: more resilient activity access test. Use the "Forum" module rather than the "Book" module, because the latter emits two events when a student views it - if these two events happened either side of a single second, then the report would count two distinct views (when it was trying to assert only one). --- .../tests/behat/filter_participation.feature | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/report/participation/tests/behat/filter_participation.feature b/report/participation/tests/behat/filter_participation.feature index 058ba0e3a3c00..c648a85978fb8 100644 --- a/report/participation/tests/behat/filter_participation.feature +++ b/report/participation/tests/behat/filter_participation.feature @@ -20,13 +20,9 @@ Feature: In a participation report, admin can filter student actions | student1 | C1 | student | And the following "activity" exists: | course | C1 | - | activity | book | - | name | Test book name | - | idnumber | book1 | - And the following "mod_book > chapter" exists: - | book | Test book name | - | title | Test chapter | - | content | Test chapter content | + | activity | forum | + | name | Test forum name | + | idnumber | forum1 | @javascript Scenario: Filter participation report when standard log reader is enabled later @@ -35,34 +31,39 @@ Feature: In a participation report, admin can filter student actions And I click on "Disable" "link" in the "Standard log" "table_row" And I log out - And I am on the "Test book name" "book activity" page logged in as student1 + And I am on the "Test forum name" "forum activity" page logged in as student1 And I log out And I log in as "admin" And I navigate to "Plugins > Logging > Manage log stores" in site administration And I click on "Enable" "link" in the "Standard log" "table_row" - And I am on the "Test book name" "book activity" page logged in as student1 + And I am on the "Test forum name" "forum activity" page logged in as student1 And I am on the "Course 1" course page logged in as admin When I navigate to "Reports" in current page administration And I click on "Course participation" "link" - And I set the field "instanceid" to "Test book name" - And I set the field "roleid" to "Student" + And I set the following fields to these values: + | Activity module | Test forum name | + | Show only | Student | And I press "Go" - Then I should see "Yes (1)" + Then the following should exist in the "reporttable" table: + | -1- | All actions | + | Student 1 | Yes (1) | @javascript Scenario: Filter participation report when only standard log reader is enabled by default - Given I am on the "Test book name" "book activity" page logged in as student1 - - And I am on the "Course 1" course page logged in as admin + Given I am on the "Test forum name" "forum activity" page logged in as student1 + When I am on the "Course 1" course page logged in as admin And I navigate to "Reports" in current page administration And I click on "Course participation" "link" - And I set the field "instanceid" to "Test book name" - And I set the field "roleid" to "Student" + And I set the following fields to these values: + | Activity module | Test forum name | + | Show only | Student | And I press "Go" - Then I should see "Yes (1)" + Then the following should exist in the "reporttable" table: + | -1- | All actions | + | Student 1 | Yes (1) | @javascript Scenario Outline: Filter participation report by viewable roles @@ -72,8 +73,8 @@ Feature: In a participation report, admin can filter student actions # Teacher role cannot see Manager by default. Then "Manager" "option" should not exist in the "Show only" "select" And I set the following fields to these values: - | Activity module | Test book name | - | Show only | | + | Activity module | Test forum name | + | Show only | | And I press "Go" And I should see "" in the "reporttable" "table" And I should not see "" in the "reporttable" "table" From 5ced156252d5341efd6738c1dfaf5307f94f499c Mon Sep 17 00:00:00 2001 From: Anupama Sarjoshi Date: Wed, 24 Apr 2024 17:05:47 +0100 Subject: [PATCH 36/75] MDL-81380 qbank_columnsortorder: Add upgrade.php Before Moodle 4.3, config_plugins settings for qbank_columnsortorder (disabledcol, enabledcol) had a value like qbank_statistics\columns\facility_index, qbank_statistics\columns\discriminative_efficiency, ... In Moodle 4.3, the values are stored as qbank_statistics\columns\facility_index-facility_index. So updating the old values to match the new format. --- question/bank/columnsortorder/db/upgrade.php | 74 ++++++++++++++++++++ question/bank/columnsortorder/version.php | 2 +- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 question/bank/columnsortorder/db/upgrade.php diff --git a/question/bank/columnsortorder/db/upgrade.php b/question/bank/columnsortorder/db/upgrade.php new file mode 100644 index 0000000000000..e149e542fc3c9 --- /dev/null +++ b/question/bank/columnsortorder/db/upgrade.php @@ -0,0 +1,74 @@ +. + +/** + * Custom sort order upgrade script. + * + * @package qbank_columnsortorder + * @copyright 2024 The Open University + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +use core_question\local\bank\column_base; + +/** + * Upgrade the plugin. + * + * @param int $oldversion the version of this plugin we are upgrading from. + * @return bool success/failure. + */ +function xmldb_qbank_columnsortorder_upgrade($oldversion) { + global $DB; + + if ($oldversion < 2024042201) { + // Before Moodle 4.3, config_plugins settings for qbank_columnsortorder (disabledcol, enabledcol) had a value like + // qbank_statistics\columns\facility_index,qbank_statistics\columns\discriminative_efficiency, ... + // In Moodle 4.3, the values are stored as qbank_statistics\columns\discriminative_efficiency-discriminative_efficiency. + // So updating the old values to match the new format. + // Update the columns records for qbank_columnsortorder plugin. + $pluginconfigs = $DB->get_records('config_plugins', ['plugin' => 'qbank_columnsortorder'], 'name, value'); + + foreach ($pluginconfigs as $config) { + if ($config->name == 'version') { + continue; + } + $fields = explode(',', $config->value); + $updatedcols = []; + foreach ($fields as $columnclass) { + // Columns config that are already in the correct format, could be ignored. + if (str_contains($columnclass, column_base::ID_SEPARATOR)) { + continue; + } + + $classbits = explode('\\', $columnclass); + $columnname = end($classbits); + + // The custom fields are to be in the format e.g., qbank_customfields\custom_field_column-test. + if (str_contains($columnclass, 'custom_field_column')) { + array_pop($classbits); + } + + $updatedcols[] = implode('\\', $classbits) . column_base::ID_SEPARATOR . $columnname; + } + $updatedconfig = implode(',', $updatedcols); + set_config($config->name, $updatedconfig, 'qbank_columnsortorder'); + } + // Custom sort order savepoint reached. + upgrade_plugin_savepoint(true, 2024042201, 'qbank', 'qbank_columnsortorder'); + } + + return true; +} diff --git a/question/bank/columnsortorder/version.php b/question/bank/columnsortorder/version.php index 75f003f6477c6..3a8eea4f4e37f 100644 --- a/question/bank/columnsortorder/version.php +++ b/question/bank/columnsortorder/version.php @@ -26,6 +26,6 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'qbank_columnsortorder'; -$plugin->version = 2024042200; +$plugin->version = 2024042201; $plugin->requires = 2024041600; $plugin->maturity = MATURITY_STABLE; From 74a6ed82b31d340b62e6bd255f21e8946ffe6db6 Mon Sep 17 00:00:00 2001 From: David Woloszyn Date: Fri, 5 Apr 2024 10:37:59 +1100 Subject: [PATCH 37/75] MDL-80849 communication_matrix: Prevent numeric usernames --- .../provider/matrix/classes/matrix_user_manager.php | 11 +++++++++++ .../matrix/tests/matrix_user_manager_test.php | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/communication/provider/matrix/classes/matrix_user_manager.php b/communication/provider/matrix/classes/matrix_user_manager.php index 38323c70f0a07..2dd4041f8b0c6 100644 --- a/communication/provider/matrix/classes/matrix_user_manager.php +++ b/communication/provider/matrix/classes/matrix_user_manager.php @@ -24,6 +24,12 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class matrix_user_manager { + + /** + * Prefix for Matrix usernames when they are detected as numeric. + */ + const MATRIX_USER_PREFIX = 'user'; + /** * Gets matrix user id from moodle. * @@ -56,6 +62,11 @@ public static function get_formatted_matrix_userid( $username = preg_replace('/[@#$%^&*()+{}|<>?!,]/i', '.', $username); $username = ltrim(rtrim($username, '.'), '.'); + // Matrix/Synapse servers will not allow numeric usernames. + if (is_numeric($username)) { + $username = self::MATRIX_USER_PREFIX . $username; + } + $homeserver = self::get_formatted_matrix_home_server(); return "@{$username}:{$homeserver}"; diff --git a/communication/provider/matrix/tests/matrix_user_manager_test.php b/communication/provider/matrix/tests/matrix_user_manager_test.php index 00877c4b9badb..559e435e4174b 100644 --- a/communication/provider/matrix/tests/matrix_user_manager_test.php +++ b/communication/provider/matrix/tests/matrix_user_manager_test.php @@ -126,6 +126,11 @@ public static function get_formatted_matrix_userid_provider(): array { 'colin.creavey', '@colin.creavey:matrix.example.org', ], + 'numeric username' => [ + 'https://matrix.example.org', + '123456', + '@' . matrix_user_manager::MATRIX_USER_PREFIX . '123456:matrix.example.org', + ], ]; } From 641937a47ec5a8cb3efbed3cca17b25f9eb59da6 Mon Sep 17 00:00:00 2001 From: Ilya Tregubov Date: Mon, 29 Apr 2024 10:46:14 +0800 Subject: [PATCH 38/75] MDL-81380 qbank_columnsortorder: Add type and return value hint --- question/bank/columnsortorder/db/upgrade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/question/bank/columnsortorder/db/upgrade.php b/question/bank/columnsortorder/db/upgrade.php index e149e542fc3c9..cd455a053a330 100644 --- a/question/bank/columnsortorder/db/upgrade.php +++ b/question/bank/columnsortorder/db/upgrade.php @@ -30,7 +30,7 @@ * @param int $oldversion the version of this plugin we are upgrading from. * @return bool success/failure. */ -function xmldb_qbank_columnsortorder_upgrade($oldversion) { +function xmldb_qbank_columnsortorder_upgrade(int $oldversion): bool { global $DB; if ($oldversion < 2024042201) { From 6ca8fde7f578454103614dd8120101bf437abd9c Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Mon, 29 Apr 2024 11:41:22 +0800 Subject: [PATCH 39/75] MDL-48940 core: Final deprecation of search_generate_text_SQL() --- lib/deprecatedlib.php | 8 ++++++++ lib/searchlib.php | 17 ----------------- lib/upgrade.txt | 4 ++++ 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 409a16a418780..5d29835affa3e 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -3216,3 +3216,11 @@ function question_add_context_in_key() { function question_fix_top_names() { throw new coding_exception(__FUNCTION__ . '() has been removed.'); } + +/** + * @deprecated since Moodle 2.9 + */ +#[\core\attribute\deprecated('search_generate_SQL', since: '2.9', mdl: 'MDL-48939', final: true)] +function search_generate_text_SQL() { + \core\deprecation::emit_deprecation_if_present(__FUNCTION__); +} diff --git a/lib/searchlib.php b/lib/searchlib.php index c158c78ecf537..c2caf7ae79fa6 100644 --- a/lib/searchlib.php +++ b/lib/searchlib.php @@ -381,23 +381,6 @@ function plainstring($content){ } } -/** - * Primitive function to generate a SQL string from a parse tree - * using TEXT indexes. If searches aren't suitable to use TEXT - * this function calls the default search_generate_SQL() one. - * - * @deprecated since Moodle 2.9 MDL-48939 - * @todo MDL-48940 This will be deleted in Moodle 3.2 - * @see search_generate_SQL() - */ -function search_generate_text_SQL($parsetree, $datafield, $metafield, $mainidfield, $useridfield, - $userfirstnamefield, $userlastnamefield, $timefield, $instancefield) { - debugging('search_generate_text_SQL() is deprecated, please use search_generate_SQL() instead.', DEBUG_DEVELOPER); - - return search_generate_SQL($parsetree, $datafield, $metafield, $mainidfield, $useridfield, - $userfirstnamefield, $userlastnamefield, $timefield, $instancefield); -} - /** * Primitive function to generate a SQL string from a parse tree. * Parameters: diff --git a/lib/upgrade.txt b/lib/upgrade.txt index 49ec5e12f8e23..7be6031780aff 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -1,6 +1,10 @@ This files describes API changes in core libraries and APIs, information provided here is intended especially for developers. +=== 4.5 === + +* The previously deprecated function `search_generate_text_SQL` has been removed and can no longer be used. + === 4.4 === * New modinfo methods related to delegated sections (sections controlled by a component): From 7721ddb679096ee6076a77629a92329569787721 Mon Sep 17 00:00:00 2001 From: Ilya Tregubov Date: Fri, 26 Apr 2024 10:54:05 +0800 Subject: [PATCH 40/75] MDL-78889 gradereport_user: Fix pass/fail icon for totals When the category has a 'grade to pass' set, the pass/fail icon was displayed even when the category total grade values was hidden. --- grade/report/user/classes/report/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grade/report/user/classes/report/user.php b/grade/report/user/classes/report/user.php index 8ed200e854b78..c9cfc11682fad 100644 --- a/grade/report/user/classes/report/user.php +++ b/grade/report/user/classes/report/user.php @@ -713,7 +713,7 @@ private function fill_table_recursive(array &$element) { $gradestatusclass = ''; $gradepassicon = ''; $ispassinggrade = $gradegrade->is_passed($gradegrade->grade_item); - if (!is_null($ispassinggrade)) { + if (!is_null($gradeval) && !is_null($ispassinggrade)) { $gradestatusclass = $ispassinggrade ? 'gradepass' : 'gradefail'; if ($ispassinggrade) { $gradepassicon = $OUTPUT->pix_icon( From 9c601e5f0b64b63ee5c23031b0f0b76bc6d2f101 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Mon, 22 Apr 2024 08:30:06 +0100 Subject: [PATCH 41/75] MDL-81621 mod_bigbluebuttonbn: remove reflection setAccessible call. See 361dfe8145 for context. --- .../tests/task/base_send_notification_test.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mod/bigbluebuttonbn/tests/task/base_send_notification_test.php b/mod/bigbluebuttonbn/tests/task/base_send_notification_test.php index 5ef3850081a34..c21082a383556 100644 --- a/mod/bigbluebuttonbn/tests/task/base_send_notification_test.php +++ b/mod/bigbluebuttonbn/tests/task/base_send_notification_test.php @@ -53,9 +53,7 @@ private function get_mock(): base_send_notification { */ private function get_instance_reflection(): \ReflectionMethod { $rc = new \ReflectionClass(base_send_notification::class); - $rcm = $rc->getMethod('get_instance'); - $rcm->setAccessible(true); - return $rcm; + return $rc->getMethod('get_instance'); } /** From 1435a5fab6c1ffcdf9654a5af4ed60c89d31ea6f Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 24 Apr 2024 19:23:52 +0100 Subject: [PATCH 42/75] MDL-81656 h5p: correct content editing URL parameter handling. --- h5p/classes/player.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/h5p/classes/player.php b/h5p/classes/player.php index a2f8564cea3f2..c1af5db6e5795 100644 --- a/h5p/classes/player.php +++ b/h5p/classes/player.php @@ -154,7 +154,7 @@ public function __construct(string $url, \stdClass $config, bool $preventredirec * Get the encoded URL for embeding this H5P content. * * @param string $url Local URL of the H5P file to display. - * @param stdClass $config Configuration for H5P buttons. + * @param \stdClass $config Configuration for H5P buttons. * @param bool $preventredirect Set to true in scripts that can not redirect (CLI, RSS feeds, etc.), throws exceptions * @param string $component optional moodle component to sent xAPI tracking * @param bool $displayedit Whether the edit button should be displayed below the H5P content. @@ -163,7 +163,8 @@ public function __construct(string $url, \stdClass $config, bool $preventredirec * @return string The embedable code to display a H5P file. */ public static function display( - string $url, \stdClass $config, + string $url, + \stdClass $config, bool $preventredirect = true, string $component = '', bool $displayedit = false, @@ -193,7 +194,7 @@ public static function display( if ($originalfile) { // Check if the user can edit this content. if (api::can_edit_content($originalfile)) { - $template->editurl = $CFG->wwwroot . '/h5p/edit.php?url=' . $url; + $template->editurl = (new \moodle_url('/h5p/edit.php', ['url' => $url]))->out(false); } } } From e05879814f133e82725e31592737f92b4811c705 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Mon, 29 Apr 2024 09:38:21 +0100 Subject: [PATCH 43/75] MDL-81707 availability_grade: fix alignment of condition checkboxes. --- .../moodle-availability_grade-form-debug.js | 4 ++-- .../moodle-availability_grade-form-min.js | 2 +- .../moodle-availability_grade-form.js | 4 ++-- availability/condition/grade/yui/src/form/js/form.js | 4 ++-- theme/boost/scss/moodle/forms.scss | 9 --------- theme/boost/style/moodle.css | 7 ------- theme/classic/style/moodle.css | 7 ------- 7 files changed, 7 insertions(+), 30 deletions(-) diff --git a/availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form-debug.js b/availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form-debug.js index 518e96f30e738..b09f35eae8fec 100644 --- a/availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form-debug.js +++ b/availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form-debug.js @@ -46,13 +46,13 @@ M.availability_grade.form.getNode = function(json) { html += ''; } html += '
' + - '
' + '' + - '
%
%',t=r.Node.create('
'+e+"
"),a.id!==undefined&&t.one("select[name=id] > option[value="+a.id+"]")&&t.one("select[name=id]").set("value",""+a.id),a.min!==undefined&&(t.one("input[name=min]").set("checked",!0),t.one("input[name=minval]").set("value",a.min)),a.max!==undefined&&(t.one("input[name=max]").set("checked",!0),t.one("input[name=maxval]").set("value",a.max)),n=function(a,e){var i=a.ancestor("label").next("label").one("input"),a=a.get("checked");return i.set("disabled",!a),e&&a&&i.focus(),a},t.all("input[type=checkbox]").each(n),M.availability_grade.form.addedEvents||(M.availability_grade.form.addedEvents=!0,(a=r.one(".availability-field")).delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),a.delegate("click",function(){n(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),a.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")),t},M.availability_grade.form.fillValue=function(a,e){a.id=parseInt(e.one("select[name=id]").get("value"),10),e.one("input[name=min]").get("checked")&&(a.min=this.getValue("minval",e)),e.one("input[name=max]").get("checked")&&(a.max=this.getValue("maxval",e))},M.availability_grade.form.getValue=function(a,e){a=e.one("input[name="+a+"]").get("value");return!/^[0-9]+([.,][0-9]+)?$/.test(a)||(e=parseFloat(a.replace(",",".")))<0||100' + grade.name + ''; } html += '

' + - '
' + '' + - '
' + - '
' + '' + - '