Skip to content

Commit

Permalink
Merge pull request #224 from lucaboesch/purpose
Browse files Browse the repository at this point in the history
Support Moodle ≥ 4.0 activity chooser purpose color.
  • Loading branch information
hgeorgsch authored Aug 7, 2023
2 parents c00260d + 49fe8c0 commit a297885
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,20 @@ function capquiz_reset_gradebook($courseid, $type = '') {
}
}


// Ugly hack to make 3.11 and 4.0 work seamlessly.
if (!defined('FEATURE_MOD_PURPOSE')) {
define('FEATURE_MOD_PURPOSE', 'mod_purpose');
}
if (!defined('MOD_PURPOSE_ASSESSMENT')) {
define('MOD_PURPOSE_ASSESSMENT', 'assessment');
}

/**
* Checks if $feature is supported
*
* @param string $feature
* @return bool
* @return mixed
*/
function capquiz_supports($feature) {
switch ($feature) {
Expand All @@ -252,7 +261,10 @@ function capquiz_supports($feature) {
case FEATURE_USES_QUESTIONS:
case FEATURE_GRADE_HAS_GRADE:
return true;
case FEATURE_MOD_PURPOSE:
return MOD_PURPOSE_ASSESSMENT;
default:
return false;
}
}

0 comments on commit a297885

Please sign in to comment.