Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Public Member Functions | |
__construct (cm_info $cm, int $userid, ?array $completionstate=null) | |
activity_custom_completion constructor. | |
get_available_custom_rules () | |
Fetches the list of custom completion rules that are being used by this activity module instance. | |
get_custom_rule_description (string $rule) | |
Fetches the description for a given custom completion rule. | |
get_custom_rule_descriptions () | |
Returns an associative array of the descriptions of custom completion rules. | |
get_overall_completion_state () | |
Fetches the overall completion status of this activity instance for a user based on its available custom completion rules. | |
get_sort_order () | |
Returns an array of all completion rules, in the order they should be displayed to users. | |
get_state (string $rule) | |
Fetches the completion state for a given completion rule. | |
is_available (string $rule) | |
Checks whether the custom completion rule is being used by the activity module instance. | |
is_defined (string $rule) | |
Whether this module defines this custom rule. | |
manual_completion_always_shown () | |
Show the manual completion or not regardless of the course's showcompletionconditions setting. | |
validate_rule (string $rule) | |
Validates that the custom rule is defined by this plugin and is enabled for this activity instance. | |
Static Public Member Functions | |
static | get_cm_completion_class (string $modname) |
Fetches the module's custom completion class implementation if it's available. | |
static | get_defined_custom_rules () |
Fetch the list of custom completion rules that this module defines. | |
Protected Attributes | |
cm_info | $cm |
The course module information object. | |
array | $completionstate |
The current state of core completion. | |
int | $userid |
The user's ID. | |
core_completion\activity_custom_completion::__construct | ( | cm_info | $cm, |
int | $userid, | ||
?array | $completionstate = null ) |
activity_custom_completion constructor.
cm_info | $cm | |
int | $userid | |
array | null | $completionstate | The current state of the core completion criteria |
core_completion\activity_custom_completion::get_available_custom_rules | ( | ) |
Fetches the list of custom completion rules that are being used by this activity module instance.
array |
|
static |
Fetches the module's custom completion class implementation if it's available.
string | $modname | The activity module name. Usually from cm_info\modname. |
string|null |
core_completion\activity_custom_completion::get_custom_rule_description | ( | string | $rule | ) |
Fetches the description for a given custom completion rule.
string | $rule | The custom completion rule. |
string |
|
abstract |
Returns an associative array of the descriptions of custom completion rules.
array |
Reimplemented in mod_assign\completion\custom_completion, mod_bigbluebuttonbn\completion\custom_completion, mod_choice\completion\custom_completion, mod_data\completion\custom_completion, mod_feedback\completion\custom_completion, mod_folder\completion\custom_completion, mod_forum\completion\custom_completion, mod_glossary\completion\custom_completion, mod_label\completion\custom_completion, mod_lesson\completion\custom_completion, mod_quiz\completion\custom_completion, mod_resource\completion\custom_completion, mod_scorm\completion\custom_completion, mod_survey\completion\custom_completion, and mod_url\completion\custom_completion.
|
staticabstract |
Fetch the list of custom completion rules that this module defines.
array |
Reimplemented in mod_assign\completion\custom_completion, mod_bigbluebuttonbn\completion\custom_completion, mod_choice\completion\custom_completion, mod_data\completion\custom_completion, mod_feedback\completion\custom_completion, mod_folder\completion\custom_completion, mod_forum\completion\custom_completion, mod_glossary\completion\custom_completion, mod_label\completion\custom_completion, mod_lesson\completion\custom_completion, mod_quiz\completion\custom_completion, mod_resource\completion\custom_completion, mod_scorm\completion\custom_completion, mod_survey\completion\custom_completion, and mod_url\completion\custom_completion.
core_completion\activity_custom_completion::get_overall_completion_state | ( | ) |
Fetches the overall completion status of this activity instance for a user based on its available custom completion rules.
int | The completion state (e.g. COMPLETION_COMPLETE, COMPLETION_INCOMPLETE). |
|
abstract |
Returns an array of all completion rules, in the order they should be displayed to users.
array |
Reimplemented in mod_assign\completion\custom_completion, mod_bigbluebuttonbn\completion\custom_completion, mod_choice\completion\custom_completion, mod_data\completion\custom_completion, mod_feedback\completion\custom_completion, mod_folder\completion\custom_completion, mod_forum\completion\custom_completion, mod_glossary\completion\custom_completion, mod_label\completion\custom_completion, mod_lesson\completion\custom_completion, mod_quiz\completion\custom_completion, mod_resource\completion\custom_completion, mod_scorm\completion\custom_completion, mod_survey\completion\custom_completion, and mod_url\completion\custom_completion.
|
abstract |
Fetches the completion state for a given completion rule.
string | $rule | The completion rule. |
int | The completion state. |
Reimplemented in mod_assign\completion\custom_completion, mod_bigbluebuttonbn\completion\custom_completion, mod_choice\completion\custom_completion, mod_data\completion\custom_completion, mod_feedback\completion\custom_completion, mod_folder\completion\custom_completion, mod_forum\completion\custom_completion, mod_glossary\completion\custom_completion, mod_label\completion\custom_completion, mod_lesson\completion\custom_completion, mod_quiz\completion\custom_completion, mod_resource\completion\custom_completion, mod_scorm\completion\custom_completion, mod_survey\completion\custom_completion, and mod_url\completion\custom_completion.
core_completion\activity_custom_completion::is_available | ( | string | $rule | ) |
Checks whether the custom completion rule is being used by the activity module instance.
string | $rule | The custom completion rule. |
bool |
core_completion\activity_custom_completion::is_defined | ( | string | $rule | ) |
Whether this module defines this custom rule.
string | $rule | The custom completion rule. |
bool |
core_completion\activity_custom_completion::manual_completion_always_shown | ( | ) |
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.
bool |
Reimplemented in mod_folder\completion\custom_completion, mod_label\completion\custom_completion, mod_resource\completion\custom_completion, and mod_url\completion\custom_completion.
core_completion\activity_custom_completion::validate_rule | ( | string | $rule | ) |
Validates that the custom rule is defined by this plugin and is enabled for this activity instance.
string | $rule | The custom completion rule. |