◆ __construct()
| core_completion\manager::__construct |
( |
|
$courseid | ) |
|
manager constructor.
- Parameters
-
| int | $courseid | the course id. |
◆ apply_completion()
| core_completion\manager::apply_completion |
( |
|
$data, |
|
|
|
$updateinstances |
|
) |
| |
Applies completion from the bulk edit form to all selected modules.
- Parameters
-
| stdClass | $data | data received from the core_completion_bulkedit_form |
| bool | $updateinstances | if we need to update the instance tables of the module (i.e. 'assign', 'forum', etc.) - if no module-specific completion rules were added to the form, update of the module table is not needed. |
◆ apply_completion_cm()
| core_completion\manager::apply_completion_cm |
( |
\cm_info |
$cm, |
|
|
|
$data, |
|
|
|
$updateinstance |
|
) |
| |
|
protected |
Applies new completion rules to one course module.
- Parameters
-
| cm_info | $cm | |
| array | $data | |
| bool | $updateinstance | if we need to update the instance table of the module (i.e. 'assign', 'forum', etc.) - if no module-specific completion rules were added to the form, update of the module table is not needed. |
- Return values
-
| bool | if module was updated |
◆ apply_default_completion()
| core_completion\manager::apply_default_completion |
( |
|
$data, |
|
|
|
$updatecustomrules |
|
) |
| |
Saves default completion from edit form to all selected module types.
- Parameters
-
| stdClass | $data | data received from the core_completion_bulkedit_form |
| bool | $updatecustomrules | if we need to update the custom rules of the module - if no module-specific completion rules were added to the form, update of the module table is not needed. |
◆ can_edit_bulk_completion()
| static core_completion\manager::can_edit_bulk_completion |
( |
|
$courseorid, |
|
|
|
$cm = null |
|
) |
| |
|
static |
Checks if current user can edit activity completion.
- Parameters
-
| int | stdClass | $courseorid | |
| cm_info | null | $cm | if specified capability for a given coursemodule will be check, if not specified capability to edit at least one activity is checked. |
◆ get_activities()
| core_completion\manager::get_activities |
( |
|
$cmids, |
|
|
|
$withcompletiondetails = false |
|
) |
| |
Gets the data (context) to be used with the activityinstance template.
- Parameters
-
| array | $cmids | list of course module ids |
| bool | $withcompletiondetails | include completion details |
- Return values
-
◆ get_activities_and_headings()
| core_completion\manager::get_activities_and_headings |
( |
| ) |
|
Gets the data (context) to be used with the bulkactivitycompletion template.
- Return values
-
| stdClass | data for use with the bulkactivitycompletion template. |
◆ get_activities_and_resources()
| core_completion\manager::get_activities_and_resources |
( |
| ) |
|
Gets the course modules for the current course.
- Return values
-
| stdClass::$data | containing the modules |
◆ get_available_completion_tabs()
| static core_completion\manager::get_available_completion_tabs |
( |
|
$courseorid | ) |
|
|
static |
Gets the available completion tabs for the current course and user.
- Parameters
-
| stdClass | int | $courseorid | the course object or id. |
- Return values
-
◆ get_completion_active_rule_descriptions()
| core_completion\manager::get_completion_active_rule_descriptions |
( |
|
$moduledata | ) |
|
|
protected |
Get the descriptions for all active conditional completion rules for the current module.
- Parameters
-
| cm_info | stdClass | $moduledata | either instance of cm_info (with 'customcompletionrules' in customdata) or object with fields ->completion, ->completionview, ->completionexpected, ->completionusegrade and ->customdata['customcompletionrules'] |
- Return values
-
| array::$activeruledescriptions | an array of strings describing the active completion rules. |
◆ get_default_completion()
| static core_completion\manager::get_default_completion |
( |
|
$course, |
|
|
|
$module, |
|
|
|
$flatten = true |
|
) |
| |
|
static |
Returns default completion rules for given module type in the given course.
- Parameters
-
| stdClass | $course | |
| stdClass | $module | |
| bool | $flatten | if true all module custom completion rules become properties of the same object, otherwise they can be found as array in ->customdata['customcompletionrules'] |
- Return values
-
The documentation for this class was generated from the following file: