Skip to content

Commit

Permalink
MDL-82457 core_presets: Remove chat and survey from presets
Browse files Browse the repository at this point in the history
* Replace chat by page whenever possible
* Use Wiki when we need a module that is disabled by default.
  • Loading branch information
laurentdavid committed Dec 10, 2024
1 parent f8805b0 commit e9bb3d1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .upgradenotes/MDL-82457-2024111508380503.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
issueNumber: MDL-82457
notes:
core_adminpresets:
- message: Remove chat and survey from Adminpresets.
type: removed
4 changes: 1 addition & 3 deletions admin/presets/classes/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,12 @@ public static function create_default_presets(): void {
// Set Activity chooser tabs to "Starred, Recommended, All".
static::add_item($presetid, 'activitychoosertabmode', '4');

// Modules: Hide chat, database, external tool (lti), IMS content package (imscp), lesson, SCORM, survey, wiki, workshop.
static::add_plugin($presetid, 'mod', 'chat', false);
// Modules: Hide database, external tool (lti), IMS content package (imscp), lesson, SCORM, wiki, workshop.
static::add_plugin($presetid, 'mod', 'data', false);
static::add_plugin($presetid, 'mod', 'lti', false);
static::add_plugin($presetid, 'mod', 'imscp', false);
static::add_plugin($presetid, 'mod', 'lesson', false);
static::add_plugin($presetid, 'mod', 'scorm', false);
static::add_plugin($presetid, 'mod', 'survey', false);
static::add_plugin($presetid, 'mod', 'wiki', false);
static::add_plugin($presetid, 'mod', 'workshop', false);

Expand Down
4 changes: 2 additions & 2 deletions admin/presets/tests/fixtures/import_settings_plugins.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<PRESET>
<NAME>Imported preset</NAME>
<COMMENTS>&lt;p dir="ltr" style="text-align:left;"&gt;Porfolios enabled, Emojipicker enabled, Lesson media width set to 900 and maxanswers set to 2 and disabled advanced. Plugins: disabled block_html, mod_database and mod_chat plugins and enabled atto_html, block_activity_modules and mod_lesson.&lt;/p&gt;</COMMENTS>
<COMMENTS>&lt;p dir="ltr" style="text-align:left;"&gt;Porfolios enabled, Emojipicker enabled, Lesson media width set to 900 and maxanswers set to 2 and disabled advanced. Plugins: disabled block_html, mod_database and mod_page plugins and enabled atto_html, block_activity_modules and mod_lesson.&lt;/p&gt;</COMMENTS>
<PRESET_DATE>1631615985</PRESET_DATE>
<SITE_URL>http://demo.moodle</SITE_URL>
<AUTHOR>Ada Lovelace</AUTHOR>
Expand Down Expand Up @@ -30,7 +30,7 @@
<ACTIVITY_MODULES>1</ACTIVITY_MODULES>
</BLOCK>
<MOD>
<CHAT>0</CHAT>
<PAGE>0</PAGE>
<DATA>0</DATA>
<LESSON>1</LESSON>
</MOD>
Expand Down
4 changes: 2 additions & 2 deletions admin/presets/tests/fixtures/import_starter_name.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<PRESET>
<NAME>Starter</NAME>
<COMMENTS>&lt;p dir="ltr" style="text-align:left;"&gt;Badges disabled, Emojipicker enabled, Lesson media width set to 900 and maxanswers set to 2 and disabled advanced. Plugins: disabled block_html, mod_database and mod_chat plugins and enabled atto_html and block_activity_modules.&lt;/p&gt;</COMMENTS>
<COMMENTS>&lt;p dir="ltr" style="text-align:left;"&gt;Badges disabled, Emojipicker enabled, Lesson media width set to 900 and maxanswers set to 2 and disabled advanced. Plugins: disabled block_html, mod_database and mod_page plugins and enabled atto_html and block_activity_modules.&lt;/p&gt;</COMMENTS>
<PRESET_DATE>1631615985</PRESET_DATE>
<SITE_URL>http://demo.moodle</SITE_URL>
<AUTHOR>Ada Lovelace</AUTHOR>
Expand Down Expand Up @@ -30,7 +30,7 @@
<ACTIVITY_MODULES>1</ACTIVITY_MODULES>
</BLOCK>
<MOD>
<CHAT>0</CHAT>
<PAGE>0</PAGE>
<DATA>0</DATA>
<LESSON>1</LESSON>
</MOD>
Expand Down
4 changes: 2 additions & 2 deletions admin/presets/tests/helper_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public static function change_default_preset_provider(): array {
],
'plugins' => [
'assign' => 1,
'chat' => 0,
'wiki' => 0,
'data' => 0,
'lesson' => 0,
],
Expand Down Expand Up @@ -371,7 +371,7 @@ public static function change_default_preset_provider(): array {
],
'plugins' => [
'assign' => 1,
'chat' => 0,
'page' => 0,
'data' => 0,
'lesson' => 1,
],
Expand Down
2 changes: 1 addition & 1 deletion admin/presets/tests/manager_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public function test_import_preset(string $filecontents, bool $expectedpreset, b
'activity_modules' => 1,
],
'mod' => [
'chat' => 0,
'page' => 0,
'data' => 0,
'lesson' => 1,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function test_import_execute(string $filecontents, bool $expectedpreset,
'activity_modules' => 1,
],
'mod' => [
'chat' => 0,
'page' => 0,
'data' => 0,
'lesson' => 1,
],
Expand Down

0 comments on commit e9bb3d1

Please sign in to comment.