Class for building the user's activity completion details.
More...
|
| __construct (completion_info $completioninfo, cm_info $cminfo, int $userid, bool $returndetails=true) |
| Constructor.
|
|
| get_details () |
| Fetches the completion details for a user.
|
|
| get_overall_completion () |
| Fetches the overall completion state of this course module.
|
|
| get_timemodified () |
| Completion state timemodified.
|
|
| has_completion () |
| Whether this activity module has completion enabled.
|
|
| is_automatic () |
| Whether this activity module instance tracks completion automatically.
|
|
| is_manual () |
| Whether this activity module instance tracks completion manually.
|
|
| is_overall_complete () |
| Returns whether the overall completion state of this course module should be marked as complete or not.
|
|
| is_tracked_user () |
| Checks whether completion is being tracked for this user.
|
|
| overridden_by () |
| Fetches the user ID that has overridden the completion state of this activity for the user.
|
|
| show_manual_completion () |
| Determine whether to show the manual completion or not.
|
|
|
static | get_instance (cm_info $cminfo, int $userid, bool $returndetails=true) |
| Generates an instance of this class.
|
|
|
| sort_completion_details (array $details) |
| Sort completion details in the order specified by the activity's custom completion implementation.
|
|
|
activity_custom_completion | $cmcompletion = null |
| Activity custom completion object.
|
|
cm_info | $cminfo = null |
| The course module information.
|
|
object | $completiondata = null |
| The completion data.
|
|
completion_info | $completioninfo = null |
| The completion info instance for this cm's course.
|
|
bool | $returndetails = true |
| Whether to return automatic completion details.
|
|
int | $userid = 0 |
| The user ID.
|
|
Class for building the user's activity completion details.
- Copyright
- 2021 Jun Pataleta jun@m.nosp@m.oodl.nosp@m.e.com
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_completion\cm_completion_details::__construct |
( |
completion_info | $completioninfo, |
|
|
cm_info | $cminfo, |
|
|
int | $userid, |
|
|
bool | $returndetails = true ) |
Constructor.
- Parameters
-
completion_info | $completioninfo | The completion info instance for this cm's course. |
cm_info | $cminfo | The course module information. |
int | $userid | The user ID. |
bool | $returndetails | Whether to return completion details or not. |
◆ get_details()
core_completion\cm_completion_details::get_details |
( |
| ) |
|
Fetches the completion details for a user.
- Return values
-
array | An array of completion details for a user containing the completion requirement's description and status. |
- Exceptions
-
◆ get_instance()
static core_completion\cm_completion_details::get_instance |
( |
cm_info | $cminfo, |
|
|
int | $userid, |
|
|
bool | $returndetails = true ) |
|
static |
Generates an instance of this class.
- Parameters
-
cm_info | $cminfo | The course module info instance. |
int | $userid | The user ID that we're fetching completion details for. |
bool | $returndetails | Whether to return completion details or not. |
- Return values
-
◆ get_overall_completion()
core_completion\cm_completion_details::get_overall_completion |
( |
| ) |
|
Fetches the overall completion state of this course module.
- Return values
-
int | The overall completion state for this course module. |
◆ get_timemodified()
core_completion\cm_completion_details::get_timemodified |
( |
| ) |
|
Completion state timemodified.
- Return values
-
◆ has_completion()
core_completion\cm_completion_details::has_completion |
( |
| ) |
|
Whether this activity module has completion enabled.
- Return values
-
◆ is_automatic()
core_completion\cm_completion_details::is_automatic |
( |
| ) |
|
Whether this activity module instance tracks completion automatically.
- Return values
-
◆ is_manual()
core_completion\cm_completion_details::is_manual |
( |
| ) |
|
Whether this activity module instance tracks completion manually.
- Return values
-
◆ is_overall_complete()
core_completion\cm_completion_details::is_overall_complete |
( |
| ) |
|
Returns whether the overall completion state of this course module should be marked as complete or not.
This is based on the completion settings of the course module, so when the course module requires a passing grade, it will only be marked as complete when the user has passed the course module. Otherwise, it will be marked as complete even when the user has failed the course module.
- Return values
-
bool | True when the module can be marked as completed. |
◆ is_tracked_user()
core_completion\cm_completion_details::is_tracked_user |
( |
| ) |
|
Checks whether completion is being tracked for this user.
- Return values
-
◆ overridden_by()
core_completion\cm_completion_details::overridden_by |
( |
| ) |
|
Fetches the user ID that has overridden the completion state of this activity for the user.
- Return values
-
◆ show_manual_completion()
core_completion\cm_completion_details::show_manual_completion |
( |
| ) |
|
Determine whether to show the manual completion or not.
- Return values
-
◆ sort_completion_details()
core_completion\cm_completion_details::sort_completion_details |
( |
array | $details | ) |
|
|
protected |
Sort completion details in the order specified by the activity's custom completion implementation.
- Parameters
-
array | $details | The completion details to be sorted. |
- Return values
-
- Exceptions
-
The documentation for this class was generated from the following file:
- completion/classes/cm_completion_details.php