-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
-
4.0
-
MOODLE_400_STABLE
-
master_
MDL-71769-module_control_feature -
Add missing features that can be controlled when adding a new module to core here: https://github.com/moodle/moodle/blob/master/course/moodleform_mod.php#L200
Module plugins can define which core features they support. However, not every feature can be disabled/enabled. This patch provides greater definition to which features a module plugin supports.
Current defaults are unchanged.
Feature control added for:
- Completion
- Availability
- Access restriction
- Competencies
Steps to test:
- Install the attached mod_test plugin in your test environment.
- Create a test course.
- Add the new activity test.
- In the /course/modedit.php view you will not be able to see the availability, completion, restriction and competencies options.
- You can enable or disable features to test this plugin here: mod/test/lib.php test_supports function:
function test_supports($feature) { |
switch ($feature) { |
case FEATURE_MOD_INTRO: |
return true; |
case FEATURE_AVAILABILITY: |
case FEATURE_COMPLETION: |
case FEATURE_RESTRICTIONS: |
case FEATURE_COMPETENCIES: |
return false; |
default: |
return null; |
}
|
}
|
Also, Update features in existing module. (to do this update the function modulename_supports($feature) { in the lib.php file)