Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
|
Topics | |
completion | |
external | |
test | |
Namespaces | |
namespace | core_completion |
| |
namespace | core_completion\external |
| |
namespace | core_completion\form |
| |
namespace | core_completion\privacy |
Privacy class for requesting user data. | |
Classes | |
class | behat_core_completion_generator |
Completion test generator for Behat. More... | |
class | core_completion\activity_custom_completion |
Base class for defining an activity module's custom completion rules. More... | |
class | core_completion\api |
Class containing completion API. More... | |
class | core_completion\cm_completion_details |
Class for building the user's activity completion details. More... | |
class | core_completion\external\completion_info_exporter |
Completion info exporter. More... | |
class | core_completion\privacy\provider |
Privacy class for requesting user data. More... | |
class | core_completion\progress |
Class used to return completion progress information. More... | |
class | core_completion_bulkedit_form |
Bulk edit activity completion form. More... | |
class | core_completion_defaultedit_form |
Default activity completion form. More... | |
class | core_completion_edit_base_form |
Base form for changing completion rules. More... | |
class | core_completion_generator |
Completion test generator. More... | |
Functions | |
core_completion\form::add_completion_elements (string $modname=null, bool $supportviews=false, bool $supportgrades=false, bool $rating=false, ?int $courseid=null) | |
Add completion elements to the form. | |
core_completion\form::add_completion_rules () | |
Add completion elements to the form and return the list of element ids. | |
core_completion\form::add_completiongrade_elements (string $modname, bool $rating=false) | |
Add completion grade elements to the form. | |
core_completion\form::add_completiongrade_rules () | |
Add completion grading elements to the form and return the list of element ids. | |
core_completion\form::completion_rule_enabled ($data) | |
Called during validation. | |
core_completion\form::definition_after_data_completion (?cm_info $cm=null) | |
It should be called from the definition_after_data() to setup the completion settings in the form. | |
core_completion\form::get_form () | |
Get the form associated to this class, where the completion elements will be added. | |
core_completion\form::get_suffix () | |
Get the suffix to be added to the completion elements when creating them (for example, 'completion_assign'). | |
core_completion\form::set_suffix (string $suffix) | |
Set the suffix to be added to the completion elements when creating them (for example, 'completion_assign'). | |
core_completion\form::validate_completion (array $data) | |
Perform some extra validation for completion settings. | |
Variables | |
trait | core_completion\form::form_trait |
Completion trait helper, with methods to add completion elements and validate them. | |
|
protected |
Add completion elements to the form.
string | null | $modname | The module name (for example, 'assign'). If null and form is moodleform_mod, the parameters are overriden with the expected values from the form. |
bool | $supportviews | True if the module supports views and false otherwise. |
bool | $supportgrades | True if the module supports grades and false otherwise. |
bool | $rating | True if the rating feature is enabled and false otherwise. |
int | null | $courseid | Course where to add completion elements. |
coding_exception | If the form is not moodleform_mod and $modname is null. |
|
abstractprotected |
Add completion elements to the form and return the list of element ids.
array | Array of string IDs of added items, empty array if none |
|
protected |
Add completion grade elements to the form.
string | $modname | The name of the module (for example, 'assign'). |
bool | $rating | True if the rating feature is enabled and false otherwise. |
|
abstract |
Add completion grading elements to the form and return the list of element ids.
array | Array of string IDs of added items, empty array if none |
|
abstractprotected |
Called during validation.
Override this method to indicate, based on the data, whether a custom completion rule is selected or not.
array | $data | Input data (not yet validated) |
bool | True if one or more rules are enabled; false if none are. |
|
protected |
It should be called from the definition_after_data() to setup the completion settings in the form.
cm_info | null | $cm | The course module associated to this form. |
|
protected |
Get the form associated to this class, where the completion elements will be added.
This method must be overriden by the class using this trait if it doesn't include a _form property.
MoodleQuickForm |
coding_exception | If the class does not have a _form property. |
core_completion\form\get_suffix | ( | ) |
Get the suffix to be added to the completion elements when creating them (for example, 'completion_assign').
string | The suffix |
core_completion\form\set_suffix | ( | string | $suffix | ) |
Set the suffix to be added to the completion elements when creating them (for example, 'completion_assign').
string | $suffix |
|
protected |
Perform some extra validation for completion settings.
array | $data | Array of ["fieldname" => value] of submitted data. |
array | List of ["element_name" => "error_description"] if there are errors or an empty array if everything is OK. |
trait core_completion::form\form_trait |
Completion trait helper, with methods to add completion elements and validate them.