Differences Between: [Versions 311 and 402]
(no description)
File Size: | 199 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
activity_custom_completion:: (9 methods):
__construct()
validate_rule()
is_defined()
is_available()
get_available_custom_rules()
get_overall_completion_state()
get_custom_rule_description()
manual_completion_always_shown()
get_cm_completion_class()
Class: activity_custom_completion - X-Ref
Base class for defining an activity module's custom completion rules.__construct(cm_info $cm, int $userid, ?array $completionstate = null) X-Ref |
activity_custom_completion constructor. param: cm_info $cm param: int $userid param: array|null $completionstate The current state of the core completion criteria |
validate_rule(string $rule) X-Ref |
Validates that the custom rule is defined by this plugin and is enabled for this activity instance. param: string $rule The custom completion rule. |
is_defined(string $rule) X-Ref |
Whether this module defines this custom rule. param: string $rule The custom completion rule. return: bool |
is_available(string $rule) X-Ref |
Checks whether the custom completion rule is being used by the activity module instance. param: string $rule The custom completion rule. return: bool |
get_available_custom_rules() X-Ref |
Fetches the list of custom completion rules that are being used by this activity module instance. return: array |
get_overall_completion_state() X-Ref |
Fetches the overall completion status of this activity instance for a user based on its available custom completion rules. return: int The completion state (e.g. COMPLETION_COMPLETE, COMPLETION_INCOMPLETE). |
get_custom_rule_description(string $rule) X-Ref |
Fetches the description for a given custom completion rule. param: string $rule The custom completion rule. return: string |
manual_completion_always_shown() X-Ref |
Show the manual completion or not regardless of the course's showcompletionconditions setting. Returns false by default for plugins that don't need to override the course's showcompletionconditions setting. Activity plugins that need to always show manual completion need to override this function. return: bool |
get_cm_completion_class(string $modname) X-Ref |
Fetches the module's custom completion class implementation if it's available. param: string $modname The activity module name. Usually from cm_info::modname. return: string|null |