+
{{{icon}}}
{{title}}
diff --git a/course/tests/content_item_test.php b/course/tests/content_item_test.php
index 172d7c1a879..6742c4f151a 100644
--- a/course/tests/content_item_test.php
+++ b/course/tests/content_item_test.php
@@ -47,7 +47,8 @@ class content_item_test extends \advanced_testcase {
$this->resetAfterTest();
$contentitem = new content_item(22, 'Item name', new lang_string_title('modulename', 'mod_assign'),
- new \moodle_url('mod_edit.php'), '

', 'Description of the module', MOD_ARCHETYPE_RESOURCE, 'mod_page');
+ new \moodle_url('mod_edit.php'), '

', 'Description of the module', MOD_ARCHETYPE_RESOURCE, 'mod_page',
+ MOD_PURPOSE_CONTENT);
$this->assertEquals(22, $contentitem->get_id());
$this->assertEquals('Item name', $contentitem->get_name());
@@ -57,6 +58,7 @@ class content_item_test extends \advanced_testcase {
$this->assertEquals('Description of the module', $contentitem->get_help());
$this->assertEquals(MOD_ARCHETYPE_RESOURCE, $contentitem->get_archetype());
$this->assertEquals('mod_page', $contentitem->get_component_name());
+ $this->assertEquals('content', $contentitem->get_purpose());
}
/**
@@ -66,7 +68,8 @@ class content_item_test extends \advanced_testcase {
$this->resetAfterTest();
$contentitem = new content_item(22, 'Item name', new string_title('My custom string'),
- new \moodle_url('mod_edit.php'), '

', 'Description of the module', MOD_ARCHETYPE_RESOURCE, 'mod_page');
+ new \moodle_url('mod_edit.php'), '

', 'Description of the module', MOD_ARCHETYPE_RESOURCE, 'mod_page',
+ MOD_PURPOSE_CONTENT);
$this->assertEquals('My custom string', $contentitem->get_title()->get_value());
}
diff --git a/course/tests/exporters_content_item_test.php b/course/tests/exporters_content_item_test.php
index 5b239c09b9c..1c957c7016d 100644
--- a/course/tests/exporters_content_item_test.php
+++ b/course/tests/exporters_content_item_test.php
@@ -92,7 +92,8 @@ class exporters_content_item_test extends \advanced_testcase {
'* First point
* Another point',
MOD_ARCHETYPE_OTHER,
- 'core_test'
+ 'core_test',
+ MOD_PURPOSE_CONTENT
);
$ciexporter = new course_content_item_exporter($contentitem, ['context' => \context_course::instance($course->id)]);
diff --git a/course/upgrade.txt b/course/upgrade.txt
index 3cfe32b8caf..0c5ec586afe 100644
--- a/course/upgrade.txt
+++ b/course/upgrade.txt
@@ -2,7 +2,17 @@ This files describes API changes in /course/*,
information provided here is intended especially for developers.
=== 4.0 ===
-
+* All activity icons have been replaced with black monochrome icons. The background
+colour for these icons is defined using a new 'FEATURE_MOD_PURPOSE' support variable in the module lib.php file
+Available purpose types are:
+ - MOD_PURPOSE_COMMUNICATION
+ - MOD_PURPOSE_ASSESSMENT
+ - MOD_PURPOSE_COLLABORATION
+ - MOD_PURPOSE_CONTENT
+ - MOD_PURPOSE_ADMINISTRATION
+ - MOD_PURPOSE_INTERFACE
+ - MOD_PURPOSE_OTHER
+The colours for these types are defined in theme/boost/scss/moodle/variables.scss
* The format_base is now deprecated. Use core_courseformat\base instead.
* The new course output components deprecate many renderer methods from course
renderer and course format renderer:
diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index d092b924f08..23a632ef040 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -460,6 +460,23 @@ define('MOD_ARCHETYPE_ASSIGNMENT', 2);
/** System (not user-addable) module archetype */
define('MOD_ARCHETYPE_SYSTEM', 3);
+/** Type of module */
+define('FEATURE_MOD_PURPOSE', 'mod_purpose');
+/** Module purpose administration */
+define('MOD_PURPOSE_ADMINISTRATION', 'administration');
+/** Module purpose assessment */
+define('MOD_PURPOSE_ASSESSMENT', 'assessment');
+/** Module purpose communication */
+define('MOD_PURPOSE_COLLABORATION', 'collaboration');
+/** Module purpose communication */
+define('MOD_PURPOSE_COMMUNICATION', 'communication');
+/** Module purpose content */
+define('MOD_PURPOSE_CONTENT', 'content');
+/** Module purpose interface */
+define('MOD_PURPOSE_INTERFACE', 'interface');
+/** Module purpose other */
+define('MOD_PURPOSE_OTHER', 'other');
+
/**
* Security token used for allowing access
* from external application such as web services.
diff --git a/mod/assign/lib.php b/mod/assign/lib.php
index bdbcda7928e..d1f9c785f96 100644
--- a/mod/assign/lib.php
+++ b/mod/assign/lib.php
@@ -364,7 +364,7 @@ function assign_update_events($assign, $override = null) {
* Return the list if Moodle features this module supports
*
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function assign_supports($feature) {
switch($feature) {
@@ -392,6 +392,8 @@ function assign_supports($feature) {
return true;
case FEATURE_COMMENT:
return true;
+ case FEATURE_MOD_PURPOSE:
+ return MOD_PURPOSE_ASSESSMENT;
default:
return null;
diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php
index 40917e88372..684f71cdd20 100644
--- a/mod/assignment/lib.php
+++ b/mod/assignment/lib.php
@@ -83,11 +83,12 @@ function assignment_delete_instance($id){
/**
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function assignment_supports($feature) {
switch($feature) {
case FEATURE_BACKUP_MOODLE2: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_ASSESSMENT;
default: return null;
}
diff --git a/mod/book/lib.php b/mod/book/lib.php
index d5f3cf2ac66..c5b23cdc34e 100644
--- a/mod/book/lib.php
+++ b/mod/book/lib.php
@@ -301,7 +301,7 @@ function book_get_post_actions() {
* Supported features
*
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function book_supports($feature) {
switch($feature) {
@@ -314,6 +314,7 @@ function book_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_CONTENT;
default: return null;
}
diff --git a/mod/chat/lib.php b/mod/chat/lib.php
index 06abf29fc9f..89a44050562 100644
--- a/mod/chat/lib.php
+++ b/mod/chat/lib.php
@@ -1244,7 +1244,7 @@ function chat_reset_userdata($data) {
/**
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function chat_supports($feature) {
switch($feature) {
@@ -1264,6 +1264,8 @@ function chat_supports($feature) {
return true;
case FEATURE_SHOW_DESCRIPTION:
return true;
+ case FEATURE_MOD_PURPOSE:
+ return MOD_PURPOSE_COMMUNICATION;
default:
return null;
}
diff --git a/mod/choice/lib.php b/mod/choice/lib.php
index bd8031a549c..7af0f917758 100644
--- a/mod/choice/lib.php
+++ b/mod/choice/lib.php
@@ -836,7 +836,7 @@ function choice_get_response_data($choice, $cm, $groupmode, $onlyactive) {
* @uses FEATURE_GRADE_HAS_GRADE
* @uses FEATURE_GRADE_OUTCOMES
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function choice_supports($feature) {
switch($feature) {
@@ -849,6 +849,7 @@ function choice_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_COMMUNICATION;
default: return null;
}
diff --git a/mod/data/lib.php b/mod/data/lib.php
index d7506510aa6..34ba3d45d13 100644
--- a/mod/data/lib.php
+++ b/mod/data/lib.php
@@ -3029,7 +3029,7 @@ function data_get_extra_capabilities() {
/**
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function data_supports($feature) {
switch($feature) {
@@ -3044,6 +3044,7 @@ function data_supports($feature) {
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
case FEATURE_COMMENT: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_COLLABORATION;
default: return null;
}
diff --git a/mod/feedback/lib.php b/mod/feedback/lib.php
index 0e5995f6f64..cfc943c4dd4 100644
--- a/mod/feedback/lib.php
+++ b/mod/feedback/lib.php
@@ -52,7 +52,7 @@ require_once(__DIR__ . '/deprecatedlib.php');
* @uses FEATURE_GRADE_HAS_GRADE
* @uses FEATURE_GRADE_OUTCOMES
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function feedback_supports($feature) {
switch($feature) {
@@ -65,6 +65,7 @@ function feedback_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_COMMUNICATION;
default: return null;
}
diff --git a/mod/folder/lib.php b/mod/folder/lib.php
index 2fe3f23e0f6..fa7aec38e03 100644
--- a/mod/folder/lib.php
+++ b/mod/folder/lib.php
@@ -33,7 +33,7 @@ define('FOLDER_DISPLAY_INLINE', 1);
/**
* List of features supported in Folder module
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function folder_supports($feature) {
switch($feature) {
@@ -46,6 +46,7 @@ function folder_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_CONTENT;
default: return null;
}
diff --git a/mod/forum/lib.php b/mod/forum/lib.php
index 56c5f608324..6d31765f437 100644
--- a/mod/forum/lib.php
+++ b/mod/forum/lib.php
@@ -354,7 +354,7 @@ function forum_delete_instance($id) {
* @uses FEATURE_GRADE_HAS_GRADE
* @uses FEATURE_GRADE_OUTCOMES
* @param string $feature
- * @return mixed True if yes (some features may use other values)
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function forum_supports($feature) {
switch($feature) {
@@ -370,6 +370,7 @@ function forum_supports($feature) {
case FEATURE_SHOW_DESCRIPTION: return true;
case FEATURE_PLAGIARISM: return true;
case FEATURE_ADVANCED_GRADING: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_COLLABORATION;
default: return null;
}
diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php
index e5c7bdcdf43..0c2244752a8 100644
--- a/mod/glossary/lib.php
+++ b/mod/glossary/lib.php
@@ -3079,7 +3079,7 @@ function glossary_get_extra_capabilities() {
/**
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function glossary_supports($feature) {
switch($feature) {
@@ -3094,6 +3094,7 @@ function glossary_supports($feature) {
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
case FEATURE_COMMENT: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_COLLABORATION;
default: return null;
}
diff --git a/mod/h5pactivity/lib.php b/mod/h5pactivity/lib.php
index 70312c1482a..13fb26e0e16 100644
--- a/mod/h5pactivity/lib.php
+++ b/mod/h5pactivity/lib.php
@@ -41,9 +41,9 @@ use mod_h5pactivity\local\grader;
* @uses FEATURE_GRADE_OUTCOMES
* @uses FEATURE_BACKUP_MOODLE2
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
-function h5pactivity_supports(string $feature): ?bool {
+function h5pactivity_supports(string $feature) {
switch($feature) {
case FEATURE_GROUPS:
return true;
@@ -63,6 +63,8 @@ function h5pactivity_supports(string $feature): ?bool {
return true;
case FEATURE_BACKUP_MOODLE2:
return true;
+ case FEATURE_MOD_PURPOSE:
+ return MOD_PURPOSE_CONTENT;
default:
return null;
}
diff --git a/mod/imscp/lib.php b/mod/imscp/lib.php
index 0599ae6635f..ad8b4efa260 100644
--- a/mod/imscp/lib.php
+++ b/mod/imscp/lib.php
@@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die();
/**
* List of features supported in IMS CP module
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function imscp_supports($feature) {
switch($feature) {
@@ -40,6 +40,7 @@ function imscp_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_CONTENT;
default: return null;
}
diff --git a/mod/label/lib.php b/mod/label/lib.php
index 3cf3224f5f1..c435b7a43ce 100644
--- a/mod/label/lib.php
+++ b/mod/label/lib.php
@@ -172,7 +172,7 @@ function label_reset_userdata($data) {
* @uses FEATURE_GRADE_HAS_GRADE
* @uses FEATURE_GRADE_OUTCOMES
* @param string $feature FEATURE_xx constant for requested feature
- * @return bool|null True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function label_supports($feature) {
switch($feature) {
@@ -186,6 +186,7 @@ function label_supports($feature) {
case FEATURE_MOD_ARCHETYPE: return MOD_ARCHETYPE_RESOURCE;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_NO_VIEW_LINK: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_CONTENT;
default: return null;
}
diff --git a/mod/lesson/lib.php b/mod/lesson/lib.php
index 4dd1ff68592..928030b9232 100644
--- a/mod/lesson/lib.php
+++ b/mod/lesson/lib.php
@@ -981,7 +981,7 @@ function lesson_reset_userdata($data) {
* @uses FEATURE_GRADE_HAS_GRADE
* @uses FEATURE_GRADE_OUTCOMES
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function lesson_supports($feature) {
switch($feature) {
@@ -1003,6 +1003,8 @@ function lesson_supports($feature) {
return true;
case FEATURE_SHOW_DESCRIPTION:
return true;
+ case FEATURE_MOD_PURPOSE:
+ return MOD_PURPOSE_CONTENT;
default:
return null;
}
diff --git a/mod/lti/lib.php b/mod/lti/lib.php
index 8bc6c6e5818..3c324c2f0fd 100644
--- a/mod/lti/lib.php
+++ b/mod/lti/lib.php
@@ -51,7 +51,7 @@ defined('MOODLE_INTERNAL') || die;
/**
* List of features supported in URL module
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function lti_supports($feature) {
switch ($feature) {
@@ -65,6 +65,8 @@ function lti_supports($feature) {
case FEATURE_BACKUP_MOODLE2:
case FEATURE_SHOW_DESCRIPTION:
return true;
+ case FEATURE_MOD_PURPOSE:
+ return MOD_PURPOSE_CONTENT;
default:
return null;
@@ -281,7 +283,8 @@ function lti_get_course_content_items(\core_course\local\entity\content_item $de
$defaultmodulecontentitem->get_icon(),
$defaultmodulecontentitem->get_help(),
$defaultmodulecontentitem->get_archetype(),
- $defaultmodulecontentitem->get_component_name()
+ $defaultmodulecontentitem->get_component_name(),
+ $defaultmodulecontentitem->get_purpose()
)];
}
@@ -308,7 +311,8 @@ function lti_get_course_content_items(\core_course\local\entity\content_item $de
$preconfiguredtool->icon,
$preconfiguredtool->help,
$defaultmodulecontentitem->get_archetype(),
- $defaultmodulecontentitem->get_component_name()
+ $defaultmodulecontentitem->get_component_name(),
+ $defaultmodulecontentitem->get_purpose()
);
}
return $types;
@@ -333,7 +337,8 @@ function mod_lti_get_all_content_items(\core_course\local\entity\content_item $d
$defaultmodulecontentitem->get_icon(),
$defaultmodulecontentitem->get_help(),
$defaultmodulecontentitem->get_archetype(),
- $defaultmodulecontentitem->get_component_name()
+ $defaultmodulecontentitem->get_component_name(),
+ $defaultmodulecontentitem->get_purpose()
)];
foreach (lti_get_lti_types() as $ltitype) {
@@ -368,7 +373,8 @@ function mod_lti_get_all_content_items(\core_course\local\entity\content_item $d
$type->icon,
$type->help,
$defaultmodulecontentitem->get_archetype(),
- $defaultmodulecontentitem->get_component_name()
+ $defaultmodulecontentitem->get_component_name(),
+ $defaultmodulecontentitem->get_purpose()
);
}
diff --git a/mod/lti/tests/lib_test.php b/mod/lti/tests/lib_test.php
index 71d1e23fed0..b0a281b9728 100644
--- a/mod/lti/tests/lib_test.php
+++ b/mod/lti/tests/lib_test.php
@@ -404,7 +404,8 @@ class mod_lti_lib_testcase extends advanced_testcase {
'icon',
'Description of the module',
MOD_ARCHETYPE_OTHER,
- 'mod_lti'
+ 'mod_lti',
+ MOD_PURPOSE_CONTENT
);
// The lti_get_lti_types_by_course method (used by the callbacks) assumes the global user.
diff --git a/mod/page/lib.php b/mod/page/lib.php
index d6fec761819..dc4426abad8 100644
--- a/mod/page/lib.php
+++ b/mod/page/lib.php
@@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die;
/**
* List of features supported in Page module
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function page_supports($feature) {
switch($feature) {
@@ -39,6 +39,7 @@ function page_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_CONTENT;
default: return null;
}
diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php
index 77046b460fe..4e6f623f305 100644
--- a/mod/quiz/lib.php
+++ b/mod/quiz/lib.php
@@ -1672,7 +1672,7 @@ function quiz_attempt_summary_link_to_reports($quiz, $cm, $context, $returnzero
/**
* @param string $feature FEATURE_xx constant for requested feature
- * @return bool True if quiz supports feature
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function quiz_supports($feature) {
switch($feature) {
@@ -1688,6 +1688,7 @@ function quiz_supports($feature) {
case FEATURE_CONTROLS_GRADE_VISIBILITY: return true;
case FEATURE_USES_QUESTIONS: return true;
case FEATURE_PLAGIARISM: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_ASSESSMENT;
default: return null;
}
diff --git a/mod/resource/lib.php b/mod/resource/lib.php
index 6da4d0f0915..726fd47ca4d 100644
--- a/mod/resource/lib.php
+++ b/mod/resource/lib.php
@@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die;
/**
* List of features supported in Resource module
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function resource_supports($feature) {
switch($feature) {
@@ -39,6 +39,7 @@ function resource_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_CONTENT;
default: return null;
}
@@ -217,7 +218,6 @@ function resource_get_coursemodule_info($coursemodule) {
}
if ($resource->tobemigrated) {
- $info->icon ='i/invalid';
return $info;
}
@@ -226,7 +226,6 @@ function resource_get_coursemodule_info($coursemodule) {
$files = $fs->get_area_files($context->id, 'mod_resource', 'content', 0, 'sortorder DESC, id ASC', false, 0, 0, 1);
if (count($files) >= 1) {
$mainfile = reset($files);
- $info->icon = file_file_icon($mainfile, 24);
$resource->mainfile = $mainfile->get_filename();
}
diff --git a/mod/resource/tests/lib_test.php b/mod/resource/tests/lib_test.php
index d1de43cfca6..99ba8b91b6d 100644
--- a/mod/resource/tests/lib_test.php
+++ b/mod/resource/tests/lib_test.php
@@ -143,13 +143,11 @@ class mod_resource_lib_testcase extends advanced_testcase {
$info = resource_get_coursemodule_info(
$DB->get_record('course_modules', array('id' => $resource2->cmid)));
$this->assertEquals('R2', $info->name);
- $this->assertEquals('f/text-24', $info->icon);
// For third one, it should use the highest sortorder icon.
$info = resource_get_coursemodule_info(
$DB->get_record('course_modules', array('id' => $resource3->cmid)));
$this->assertEquals('R3', $info->name);
- $this->assertEquals('f/document-24', $info->icon);
}
public function test_resource_core_calendar_provide_event_action() {
diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php
index b04179c83c7..b211bc5a42c 100644
--- a/mod/scorm/lib.php
+++ b/mod/scorm/lib.php
@@ -1027,7 +1027,7 @@ function scorm_pluginfile($course, $cm, $context, $filearea, $args, $forcedownlo
* @uses FEATURE_GRADE_HAS_GRADE
* @uses FEATURE_GRADE_OUTCOMES
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function scorm_supports($feature) {
switch($feature) {
@@ -1040,6 +1040,7 @@ function scorm_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return true;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_CONTENT;
default: return null;
}
diff --git a/mod/survey/lib.php b/mod/survey/lib.php
index a6fe8ff4504..5eaa547ace3 100644
--- a/mod/survey/lib.php
+++ b/mod/survey/lib.php
@@ -782,7 +782,7 @@ function survey_reset_userdata($data) {
* @uses FEATURE_GRADE_HAS_GRADE
* @uses FEATURE_GRADE_OUTCOMES
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function survey_supports($feature) {
switch($feature) {
@@ -795,6 +795,7 @@ function survey_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_COMMUNICATION;
default: return null;
}
diff --git a/mod/url/lib.php b/mod/url/lib.php
index fa654073697..169c8a6784d 100644
--- a/mod/url/lib.php
+++ b/mod/url/lib.php
@@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die;
/**
* List of features supported in URL module
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed True if module supports feature, false if not, null if doesn't know
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function url_supports($feature) {
switch($feature) {
@@ -41,6 +41,7 @@ function url_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_CONTENT;
default: return null;
}
diff --git a/mod/wiki/lib.php b/mod/wiki/lib.php
index 809aaadcf6e..c851baef576 100644
--- a/mod/wiki/lib.php
+++ b/mod/wiki/lib.php
@@ -258,7 +258,7 @@ function wiki_reset_course_form_definition(&$mform) {
* @uses FEATURE_GRADE_HAS_GRADE
* @uses FEATURE_GRADE_OUTCOMES
* @param string $feature
- * @return mixed True if yes (some features may use other values)
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function wiki_supports($feature) {
switch ($feature) {
@@ -282,6 +282,8 @@ function wiki_supports($feature) {
return true;
case FEATURE_COMMENT:
return true;
+ case FEATURE_MOD_PURPOSE:
+ return MOD_PURPOSE_COLLABORATION;
default:
return null;
diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php
index d2ae8829711..2012e396ebb 100644
--- a/mod/workshop/lib.php
+++ b/mod/workshop/lib.php
@@ -47,7 +47,7 @@ define('WORKSHOP_SUBMISSION_TYPE_REQUIRED', 2);
*
* @see plugin_supports() in lib/moodlelib.php
* @param string $feature FEATURE_xx constant for requested feature
- * @return mixed true if the feature is supported, null if unknown
+ * @return mixed True if module supports feature, false if not, null if doesn't know or string for the module purpose.
*/
function workshop_supports($feature) {
switch($feature) {
@@ -60,6 +60,7 @@ function workshop_supports($feature) {
return true;
case FEATURE_SHOW_DESCRIPTION: return true;
case FEATURE_PLAGIARISM: return true;
+ case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_ASSESSMENT;
default: return null;
}
}
diff --git a/theme/boost/classes/output/core_renderer.php b/theme/boost/classes/output/core_renderer.php
index 35cca65887b..e7a4e8ce5f4 100644
--- a/theme/boost/classes/output/core_renderer.php
+++ b/theme/boost/classes/output/core_renderer.php
@@ -187,7 +187,7 @@ class core_renderer extends \core_renderer {
// Image data.
if (isset($contextheader->imagedata)) {
// Header specific image.
- $html .= html_writer::div($contextheader->imagedata, 'page-header-image icon-size-6');
+ $html .= html_writer::div($contextheader->imagedata, 'page-header-image mr-2');
}
// Headings.
diff --git a/theme/boost/scss/moodle/core.scss b/theme/boost/scss/moodle/core.scss
index d777a6ecd57..605d7abb87b 100644
--- a/theme/boost/scss/moodle/core.scss
+++ b/theme/boost/scss/moodle/core.scss
@@ -2059,9 +2059,6 @@ nav.navbar .logo img {
}
.page-header-image {
- margin-right: 1em;
- margin-bottom: 0.5em;
- margin-top: 0.7em;
& > a {
display: inline-block;
}
diff --git a/theme/boost/scss/moodle/course.scss b/theme/boost/scss/moodle/course.scss
index 328766d3210..978fe8ff5cc 100644
--- a/theme/boost/scss/moodle/course.scss
+++ b/theme/boost/scss/moodle/course.scss
@@ -85,14 +85,10 @@ body:not(.editing) .sitetopic ul.section {
.contentwithoutlink,
.activityinstance {
min-width: 40%;
- display: table-cell;
- padding-right: 4px;
- min-height: 2em;
> a {
- display: inline-block;
- text-indent: -31px;
- padding-left: 31px;
+ display: inline-flex;
+ align-items: center;
}
.dimmed {
@@ -154,14 +150,10 @@ body:not(.editing) .sitetopic ul.section {
}
}
-.activity img.activityicon {
- margin-right: 6px;
- vertical-align: text-bottom;
-}
-
-.section .activity .activityinstance,
-.section .activity .activityinstance div {
- display: inline-block;
+.section .activity .activityinstance {
+ display: inline-flex;
+ align-items: center;
+ margin-bottom: 1rem;
}
.editing {
@@ -1333,26 +1325,6 @@ $activity-add-hover: theme-color-level('primary', -10) !default;
}
}
-$activity-iconcontainer-width: 50px;
-$activity-iconcontainer-height: 50px;
-
-.activity-item .activityiconcontainer {
- width: $activity-iconcontainer-width;
- height: $activity-iconcontainer-height;
- display: inline-flex;
- justify-content: center;
- align-items: center;
- background-color: $gray-100;
- border-radius: $border-radius;
- padding: 0.7rem;
-
- .activityicon {
- margin: 0;
- height: 24px;
- width: 24px;
- }
-}
-
.description .course-description-item {
background-color: $gray-100;
padding-left: map-get($spacers, 3);
diff --git a/theme/boost/scss/moodle/icons.scss b/theme/boost/scss/moodle/icons.scss
index 68ea0c899f9..d8fe7585f27 100644
--- a/theme/boost/scss/moodle/icons.scss
+++ b/theme/boost/scss/moodle/icons.scss
@@ -124,3 +124,36 @@ $iconsizes: map-merge((
}
}
}
+
+
+.activityiconcontainer {
+ width: $activity-iconcontainer-width;
+ height: $activity-iconcontainer-height;
+ display: inline-flex;
+ justify-content: center;
+ align-items: center;
+ background-color: $gray-100;
+ border-radius: 4px;
+ padding: 0.7rem;
+ .activityicon {
+ margin: 0;
+ height: 24px;
+ width: 24px;
+ }
+}
+
+@each $type, $value in $activity-icon-colors {
+ .activityiconcontainer.#{$type} {
+ background-color: $value;
+ .activityicon {
+ filter: brightness(0) invert(1);
+ }
+ }
+}
+
+// Make activtity colours available for custom modules.
+:root {
+ @each $type, $value in $activity-icon-colors {
+ --activity#{$type}: #{$value};
+ }
+}
diff --git a/theme/boost/scss/moodle/variables.scss b/theme/boost/scss/moodle/variables.scss
index d752d2447da..e21ff6c829c 100644
--- a/theme/boost/scss/moodle/variables.scss
+++ b/theme/boost/scss/moodle/variables.scss
@@ -34,3 +34,18 @@ $primary-light-background: theme-color-level('primary', -12) !default;
$primary-light-border: theme-color-level('primary', -2) !default;
$primary-light-color: $body-color;
$primary-light-hover: theme-color-level('primary', -10) !default;
+$activity-iconcontainer-height: 50px;
+$activity-iconcontainer-width: 50px;
+
+$activity-icon-colors: () !default;
+$activity-icon-colors: map-merge(
+ (
+ "administration": #5d63f6,
+ "assessment": #eb66a2,
+ "collaboration": #f7634d,
+ "communication": #11a676,
+ "content": #399be2,
+ "interface": #a378ff
+ ),
+ $activity-icon-colors
+);
diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css
index cab0ec2081c..7a3843959b9 100644
--- a/theme/boost/style/moodle.css
+++ b/theme/boost/style/moodle.css
@@ -11552,12 +11552,8 @@ nav.navbar .logo img {
float: left;
display: block;
position: relative; }
- .page-context-header .page-header-image {
- margin-right: 1em;
- margin-bottom: 0.5em;
- margin-top: 0.7em; }
- .page-context-header .page-header-image > a {
- display: inline-block; }
+ .page-context-header .page-header-image > a {
+ display: inline-block; }
.page-context-header .page-header-headings,
.page-context-header .header-button-group {
position: relative;
@@ -12344,6 +12340,58 @@ body.dragging .dragging {
display: flex;
align-items: center; }
+.activityiconcontainer {
+ width: 50px;
+ height: 50px;
+ display: inline-flex;
+ justify-content: center;
+ align-items: center;
+ background-color: #f8f9fa;
+ border-radius: 4px;
+ padding: 0.7rem; }
+ .activityiconcontainer .activityicon {
+ margin: 0;
+ height: 24px;
+ width: 24px; }
+
+.activityiconcontainer.administration {
+ background-color: #5d63f6; }
+ .activityiconcontainer.administration .activityicon {
+ filter: brightness(0) invert(1); }
+
+.activityiconcontainer.assessment {
+ background-color: #eb66a2; }
+ .activityiconcontainer.assessment .activityicon {
+ filter: brightness(0) invert(1); }
+
+.activityiconcontainer.collaboration {
+ background-color: #f7634d; }
+ .activityiconcontainer.collaboration .activityicon {
+ filter: brightness(0) invert(1); }
+
+.activityiconcontainer.communication {
+ background-color: #11a676; }
+ .activityiconcontainer.communication .activityicon {
+ filter: brightness(0) invert(1); }
+
+.activityiconcontainer.content {
+ background-color: #399be2; }
+ .activityiconcontainer.content .activityicon {
+ filter: brightness(0) invert(1); }
+
+.activityiconcontainer.interface {
+ background-color: #a378ff; }
+ .activityiconcontainer.interface .activityicon {
+ filter: brightness(0) invert(1); }
+
+:root {
+ --activityadministration: #5d63f6;
+ --activityassessment: #eb66a2;
+ --activitycollaboration: #f7634d;
+ --activitycommunication: #11a676;
+ --activitycontent: #399be2;
+ --activityinterface: #a378ff; }
+
/* admin.less */
.formtable tbody th {
font-weight: normal;
@@ -13682,15 +13730,11 @@ body:not(.editing) .sitetopic ul.section {
display: flex; }
.section .activity .contentwithoutlink,
.section .activity .activityinstance {
- min-width: 40%;
- display: table-cell;
- padding-right: 4px;
- min-height: 2em; }
+ min-width: 40%; }
.section .activity .contentwithoutlink > a,
.section .activity .activityinstance > a {
- display: inline-block;
- text-indent: -31px;
- padding-left: 31px; }
+ display: inline-flex;
+ align-items: center; }
.section .activity .contentwithoutlink .dimmed .activityicon,
.section .activity .activityinstance .dimmed .activityicon {
opacity: .5; }
@@ -13731,13 +13775,10 @@ body:not(.editing) .sitetopic ul.section {
padding-bottom: initial;
vertical-align: text-bottom; }
-.activity img.activityicon {
- margin-right: 6px;
- vertical-align: text-bottom; }
-
-.section .activity .activityinstance,
-.section .activity .activityinstance div {
- display: inline-block; }
+.section .activity .activityinstance {
+ display: inline-flex;
+ align-items: center;
+ margin-bottom: 1rem; }
.editing .section .activity .contentwithoutlink,
.editing .section .activity .activityinstance {
@@ -14596,20 +14637,6 @@ span.editinstructions {
white-space: nowrap;
display: inline-block; }
-.activity-item .activityiconcontainer {
- width: 50px;
- height: 50px;
- display: inline-flex;
- justify-content: center;
- align-items: center;
- background-color: #f8f9fa;
- border-radius: 0.25rem;
- padding: 0.7rem; }
- .activity-item .activityiconcontainer .activityicon {
- margin: 0;
- height: 24px;
- width: 24px; }
-
.description .course-description-item {
background-color: #f8f9fa;
padding-left: 1rem;
diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css
index d0daf88be93..1599c28b797 100644
--- a/theme/classic/style/moodle.css
+++ b/theme/classic/style/moodle.css
@@ -11552,12 +11552,8 @@ nav.navbar .logo img {
float: left;
display: block;
position: relative; }
- .page-context-header .page-header-image {
- margin-right: 1em;
- margin-bottom: 0.5em;
- margin-top: 0.7em; }
- .page-context-header .page-header-image > a {
- display: inline-block; }
+ .page-context-header .page-header-image > a {
+ display: inline-block; }
.page-context-header .page-header-headings,
.page-context-header .header-button-group {
position: relative;
@@ -12344,6 +12340,58 @@ body.dragging .dragging {
display: flex;
align-items: center; }
+.activityiconcontainer {
+ width: 50px;
+ height: 50px;
+ display: inline-flex;
+ justify-content: center;
+ align-items: center;
+ background-color: #f8f9fa;
+ border-radius: 4px;
+ padding: 0.7rem; }
+ .activityiconcontainer .activityicon {
+ margin: 0;
+ height: 24px;
+ width: 24px; }
+
+.activityiconcontainer.administration {
+ background-color: #5d63f6; }
+ .activityiconcontainer.administration .activityicon {
+ filter: brightness(0) invert(1); }
+
+.activityiconcontainer.assessment {
+ background-color: #eb66a2; }
+ .activityiconcontainer.assessment .activityicon {
+ filter: brightness(0) invert(1); }
+
+.activityiconcontainer.collaboration {
+ background-color: #f7634d; }
+ .activityiconcontainer.collaboration .activityicon {
+ filter: brightness(0) invert(1); }
+
+.activityiconcontainer.communication {
+ background-color: #11a676; }
+ .activityiconcontainer.communication .activityicon {
+ filter: brightness(0) invert(1); }
+
+.activityiconcontainer.content {
+ background-color: #399be2; }
+ .activityiconcontainer.content .activityicon {
+ filter: brightness(0) invert(1); }
+
+.activityiconcontainer.interface {
+ background-color: #a378ff; }
+ .activityiconcontainer.interface .activityicon {
+ filter: brightness(0) invert(1); }
+
+:root {
+ --activityadministration: #5d63f6;
+ --activityassessment: #eb66a2;
+ --activitycollaboration: #f7634d;
+ --activitycommunication: #11a676;
+ --activitycontent: #399be2;
+ --activityinterface: #a378ff; }
+
/* admin.less */
.formtable tbody th {
font-weight: normal;
@@ -13682,15 +13730,11 @@ body:not(.editing) .sitetopic ul.section {
display: flex; }
.section .activity .contentwithoutlink,
.section .activity .activityinstance {
- min-width: 40%;
- display: table-cell;
- padding-right: 4px;
- min-height: 2em; }
+ min-width: 40%; }
.section .activity .contentwithoutlink > a,
.section .activity .activityinstance > a {
- display: inline-block;
- text-indent: -31px;
- padding-left: 31px; }
+ display: inline-flex;
+ align-items: center; }
.section .activity .contentwithoutlink .dimmed .activityicon,
.section .activity .activityinstance .dimmed .activityicon {
opacity: .5; }
@@ -13731,13 +13775,10 @@ body:not(.editing) .sitetopic ul.section {
padding-bottom: initial;
vertical-align: text-bottom; }
-.activity img.activityicon {
- margin-right: 6px;
- vertical-align: text-bottom; }
-
-.section .activity .activityinstance,
-.section .activity .activityinstance div {
- display: inline-block; }
+.section .activity .activityinstance {
+ display: inline-flex;
+ align-items: center;
+ margin-bottom: 1rem; }
.editing .section .activity .contentwithoutlink,
.editing .section .activity .activityinstance {
@@ -14596,20 +14637,6 @@ span.editinstructions {
white-space: nowrap;
display: inline-block; }
-.activity-item .activityiconcontainer {
- width: 50px;
- height: 50px;
- display: inline-flex;
- justify-content: center;
- align-items: center;
- background-color: #f8f9fa;
- border-radius: 0.25rem;
- padding: 0.7rem; }
- .activity-item .activityiconcontainer .activityicon {
- margin: 0;
- height: 24px;
- width: 24px; }
-
.description .course-description-item {
background-color: #f8f9fa;
padding-left: 1rem;