Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Class for doing things with competency frameworks. More...
Static Public Member Functions | |
static | add_competency_to_course ($courseid, $competencyid) |
Add a competency to this course. More... | |
static | add_competency_to_course_module ($cmorid, $competencyid) |
Add a competency to this course module. More... | |
static | add_competency_to_plan ($planid, $competencyid) |
Add a competency to a plan. More... | |
static | add_competency_to_template ($templateid, $competencyid) |
Add a competency to this template. More... | |
static | add_evidence ($userid, $competencyorid, $contextorid, $action, $descidentifier, $desccomponent, $desca=null, $recommend=false, $url=null, $grade=null, $actionuserid=null, $note=null) |
Create an evidence from a list of parameters. More... | |
static | add_related_competency ($competencyid, $relatedcompetencyid) |
Add a related competency. More... | |
static | approve_plan ($planorid) |
Approve a plan. More... | |
static | check_enabled () |
Restore the checking that competencies are enabled with any api function. | |
static | competency_framework_viewed ($frameworkorid) |
Logg the competency framework viewed event. More... | |
static | competency_viewed ($competencyorid) |
Logg the competency viewed event. More... | |
static | complete_plan ($planorid) |
Complete a plan. More... | |
static | count_competencies ($filters) |
Perform a search based on the provided filters and return a paginated list of records. More... | |
static | count_competencies_in_course ($courseid) |
Count all the competencies in a course. More... | |
static | count_competencies_in_template ($templateorid) |
Count all the competencies in a learning plan template. More... | |
static | count_competencies_in_template_with_no_courses ($templateorid) |
Count all the competencies in a learning plan template with no linked courses. More... | |
static | count_course_module_competencies ($cmorid) |
Count the competencies associated to a course module. More... | |
static | count_courses_using_competency ($competencyid) |
Count all the courses using a competency. More... | |
static | count_frameworks ($context, $includes) |
Perform a search based on the provided filters and return a paginated list of records. More... | |
static | count_plans_for_template ($templateorid, $status=0) |
Count the plans in the template, filtered by status. More... | |
static | count_proficient_competencies_in_course_for_user ($courseid, $userid) |
Count the proficient competencies in a course for one user. More... | |
static | count_templates ($context, $includes) |
Perform a search based on the provided filters and return how many results there are. More... | |
static | count_templates_using_competency ($competencyid) |
Count all the templates using a competency. More... | |
static | count_user_competency_plans_for_template ($templateorid, $proficiency=null) |
Count the user-completency-plans in the template, optionally filtered by proficiency. More... | |
static | create_competency (stdClass $record) |
Create a competency from a record containing all the data for the class. More... | |
static | create_framework (stdClass $record) |
Create a competency framework from a record containing all the data for the class. More... | |
static | create_plan (stdClass $record) |
Creates a learning plan based on the provided data. More... | |
static | create_plan_from_template ($templateorid, $userid) |
Create a learning plan from a template. More... | |
static | create_plans_from_template_cohort ($templateorid, $cohortid, $recreateunlinked=false) |
Create learning plans from a template and cohort. More... | |
static | create_template (stdClass $record) |
Create a learning plan template from a record containing all the data for the class. More... | |
static | create_template_cohort ($templateorid, $cohortorid) |
Create a relation between a template and a cohort. More... | |
static | create_user_evidence ($data, $draftitemid=null) |
Create a new user evidence. More... | |
static | create_user_evidence_competency ($userevidenceorid, $competencyid) |
Link a user evidence with a competency. More... | |
static | delete_competency ($id) |
Delete a competency by id. More... | |
static | delete_evidence ($evidenceorid) |
Delete an evidence. More... | |
static | delete_framework ($id) |
Delete a competency framework by id. More... | |
static | delete_plan ($id) |
Deletes a plan. More... | |
static | delete_template ($id, $deleteplans=true) |
Delete a learning plan template by id. More... | |
static | delete_template_cohort ($templateorid, $cohortorid) |
Remove a relation between a template and a cohort. More... | |
static | delete_user_evidence ($id) |
Delete a user evidence. More... | |
static | delete_user_evidence_competency ($userevidenceorid, $competencyid) |
Delete a relationship between a user evidence and a competency. More... | |
static | duplicate_framework ($id) |
Duplicate a competency framework by id. More... | |
static | duplicate_template ($id) |
Duplicate a learning plan template. More... | |
static | filter_users_with_capability_on_user_context_sql ($capability, $userid=0, $type=SQL_PARAMS_QM, $prefix='param') |
Function used to return a list of users where the given user has a particular capability. More... | |
static | get_least_proficient_competencies_for_course ($courseid, $skip=0, $limit=100) |
Get the most often not completed competency for this course. More... | |
static | get_least_proficient_competencies_for_template ($templateorid, $skip=0, $limit=100) |
Get the most often not completed competency for this template. More... | |
static | get_plan_competency ($planorid, $competencyid) |
Get a single competency from the user plan. More... | |
static | get_related_contexts ($context, $includes, array $hasanycapability=null) |
Fetches all the relevant contexts. More... | |
static | get_user_competency ($userid, $competencyid) |
Get a user competency. More... | |
static | get_user_competency_by_id ($usercompetencyid) |
Get a user competency by ID. More... | |
static | get_user_competency_in_course ($courseid, $userid, $competencyid) |
Get a user competency in a course. More... | |
static | grade_competency ($userid, $competencyid, $grade, $note=null) |
Manually grade a user competency. More... | |
static | grade_competency_in_course ($courseorid, $userid, $competencyid, $grade, $note=null) |
Manually grade a user course competency from the course page. More... | |
static | grade_competency_in_plan ($planorid, $competencyid, $grade, $note=null) |
Manually grade a user competency from the plans page. More... | |
static | hook_cohort_deleted (\stdClass $cohort) |
Action to perform when a cohort is deleted. More... | |
static | hook_course_deleted (stdClass $course) |
Action to perform when a course is deleted. More... | |
static | hook_course_module_deleted (stdClass $cm) |
Action to perform when a course module is deleted. More... | |
static | hook_course_reset_competency_ratings ($courseid) |
Action to perform when a course is being reset. More... | |
static | hook_user_deleted ($userid) |
Action to perform when a user is deleted. More... | |
static | is_enabled () |
Returns whether competencies are enabled. More... | |
static | is_scale_used_anywhere ($scaleid) |
Checks whether a scale is used anywhere in the plugin. More... | |
static | list_competencies ($filters, $sort='', $order='ASC', $skip=0, $limit=0) |
Perform a search based on the provided filters and return a paginated list of records. More... | |
static | list_competencies_in_template ($templateorid) |
List all the competencies in a template. More... | |
static | list_course_competencies ($courseorid) |
List the competencies associated to a course. More... | |
static | list_course_module_competencies ($cmorid) |
List the competencies associated to a course module. More... | |
static | list_course_module_competencies_in_course_module ($cmorid) |
List all the competencies linked to a course module. More... | |
static | list_course_modules_using_competency ($competencyid, $courseid) |
List all the courses modules using a competency in a course. More... | |
static | list_courses_using_competency ($competencyid) |
List all the courses using a competency. More... | |
static | list_evidence ($userid=0, $competencyid=0, $planid=0, $sort='timecreated', $order='DESC', $skip=0, $limit=0) |
List all the evidence for a user competency. More... | |
static | list_evidence_in_course ($userid=0, $courseid=0, $competencyid=0, $sort='timecreated', $order='DESC', $skip=0, $limit=0) |
List all the evidence for a user competency in a course. More... | |
static | list_frameworks ($sort, $order, $skip, $limit, $context, $includes='children', $onlyvisible=false, $query='') |
Perform a search based on the provided filters and return a paginated list of records. More... | |
static | list_plan_competencies ($planorid) |
List the competencies in a user plan. More... | |
static | list_plans_for_template ($templateorid, $status=0, $skip=0, $limit=100) |
List the plans in the template, filtered by status. More... | |
static | list_plans_to_review ($skip=0, $limit=100, $userid=null) |
List the plans to review. More... | |
static | list_plans_with_competency ($userid, $competencyorid) |
List the plans with a competency. More... | |
static | list_related_competencies ($competencyid) |
List all the related competencies. More... | |
static | list_templates ($sort, $order, $skip, $limit, $context, $includes='children', $onlyvisible=false) |
Perform a search based on the provided filters and return a paginated list of records. More... | |
static | list_templates_using_competency ($competencyid) |
List all the learning plan templatesd using a competency. More... | |
static | list_user_competencies_in_course ($courseid, $userid) |
List all the user competencies in a course. More... | |
static | list_user_competencies_to_review ($skip=0, $limit=50, $userid=null) |
List the user competencies to review. More... | |
static | list_user_evidence ($userid) |
List the user evidence of a user. More... | |
static | list_user_plans ($userid) |
Lists user plans. More... | |
static | move_down_competency ($id) |
Reorder this competency. More... | |
static | move_up_competency ($id) |
Reorder this competency. More... | |
static | observe_course_completed (\core\event\course_completed $event) |
Observe when a course is marked as completed. More... | |
static | observe_course_module_completion_updated (\core\event\course_module_completion_updated $event) |
Observe when a course module is marked as completed. More... | |
static | plan_cancel_review_request ($planorid) |
Cancel the review of a plan. More... | |
static | plan_request_review ($planorid) |
Request the review of a plan. More... | |
static | plan_start_review ($planorid) |
Start the review of a plan. More... | |
static | plan_stop_review ($planorid) |
Stop reviewing a plan. More... | |
static | plan_viewed ($planorid) |
Plan event viewed. More... | |
static | read_competency ($id, $includerelated=false) |
Read a the details for a single competency and return a record. More... | |
static | read_course_competency_settings ($courseid) |
Get the competency settings for a course. More... | |
static | read_evidence ($evidenceid) |
Read an evidence. More... | |
static | read_framework ($id) |
Read a the details for a single competency framework and return a record. More... | |
static | read_plan ($id) |
Returns a plan data. More... | |
static | read_template ($id) |
Read a the details for a single learning plan template and return a record. More... | |
static | read_user_evidence ($id) |
Read a user evidence. More... | |
static | remove_competency_from_course ($courseid, $competencyid) |
Remove a competency from this course. More... | |
static | remove_competency_from_course_module ($cmorid, $competencyid) |
Remove a competency from this course module. More... | |
static | remove_competency_from_plan ($planid, $competencyid) |
Remove a competency from a plan. More... | |
static | remove_competency_from_template ($templateid, $competencyid) |
Remove a competency from this template. More... | |
static | remove_related_competency ($competencyid, $relatedcompetencyid) |
Remove a related competency. More... | |
static | reopen_plan ($planorid) |
Reopen a plan. More... | |
static | reorder_course_competency ($courseid, $competencyidfrom, $competencyidto) |
Move the course competency up or down in the display list. More... | |
static | reorder_course_module_competency ($cmorid, $competencyidfrom, $competencyidto) |
Move the course module competency up or down in the display list. More... | |
static | reorder_plan_competency ($planid, $competencyidfrom, $competencyidto) |
Move the plan competency up or down in the display list. More... | |
static | reorder_template_competency ($templateid, $competencyidfrom, $competencyidto) |
Move the template competency up or down in the display list. More... | |
static | request_review_of_user_evidence_linked_competencies ($id) |
Send request review for user evidence competencies. More... | |
static | require_enabled () |
Throws an exception if competencies are not enabled. More... | |
static | search_competencies ($textsearch, $competencyframeworkid) |
Perform a text search based and return all results and their parents. More... | |
static | set_course_competency_ruleoutcome ($coursecompetencyorid, $ruleoutcome) |
Update ruleoutcome value for a course competency. More... | |
static | set_course_module_competency_ruleoutcome ($coursemodulecompetencyorid, $ruleoutcome) |
Update ruleoutcome value for a course module competency. More... | |
static | set_parent_competency ($id, $newparentid) |
Move this competency so it sits in a new parent. More... | |
static | show_links () |
When competencies used to be enabled, we can show the text but do not include links. More... | |
static | skip_enabled () |
Allow calls to competency api functions even if competencies are not currently enabled. | |
static | template_has_related_data ($templateid) |
Check if template has related data. More... | |
static | template_viewed ($templateorid) |
Template event viewed. More... | |
static | unapprove_plan ($planorid) |
Unapprove a plan. More... | |
static | unlink_plan_from_template ($planorid) |
Unlink a plan from its template. More... | |
static | update_competency ($record) |
Update the details for a competency. More... | |
static | update_course_competency_settings ($courseid, $settings) |
Update the competency settings for a course. More... | |
static | update_framework ($record) |
Update the details for a competency framework. More... | |
static | update_plan (stdClass $record) |
Updates a plan. More... | |
static | update_template ($record) |
Update the details for a learning plan template. More... | |
static | update_user_evidence ($data, $draftitemid=null) |
Create a new user evidence. More... | |
static | user_competency_cancel_review_request ($userid, $competencyid) |
Cancel a user competency review request. More... | |
static | user_competency_plan_viewed ($usercompetencyplanorid) |
Log user competency plan viewed event. More... | |
static | user_competency_request_review ($userid, $competencyid) |
Request a user competency review. More... | |
static | user_competency_start_review ($userid, $competencyid) |
Start a user competency review. More... | |
static | user_competency_stop_review ($userid, $competencyid) |
Stop a user competency review. More... | |
static | user_competency_viewed ($usercompetencyorid) |
Log user competency viewed event. More... | |
static | user_competency_viewed_in_course ($usercoursecompetencyorid) |
Log user competency viewed in course event. More... | |
static | user_competency_viewed_in_plan ($usercompetencyorid, $planid) |
Log user competency viewed in plan event. More... | |
Static Protected Member Functions | |
static | apply_competency_rules_from_usercompetency (user_competency $usercompetency, competency $competency=null) |
Apply the competency rules from a user competency. More... | |
static | archive_user_competencies_in_plan ($plan) |
Archive user competencies in a plan. More... | |
static | duplicate_competency_tree ($frameworkid, $tree, $oldparent=0, $newparent=0) |
Recursively duplicate competencies from a tree, we start duplicating from parents to children to have a correct path. More... | |
static | migrate_competency_tree_rules ($tree, $matchids) |
Recursively migrate competency rules. More... | |
static | remove_archived_user_competencies_in_plan ($plan) |
Delete archived user competencies in a plan. More... | |
static | validate_course ($courseorid, $throwexception=true) |
Validate if current user have acces to the course if hidden. More... | |
static | validate_course_module ($cmmixed, $throwexception=true) |
Validate if current user have acces to the course_module if hidden. More... | |
Class for doing things with competency frameworks.
|
static |
Add a competency to this course.
int | $courseid | The id of the course |
int | $competencyid | The id of the competency |
bool |
|
static |
Add a competency to this course module.
mixed | $cmorid | The course module, or id of the course module |
int | $competencyid | The id of the competency |
bool |
|
static |
Add a competency to a plan.
int | $planid | The id of the plan |
int | $competencyid | The id of the competency |
bool |
|
static |
Add a competency to this template.
int | $templateid | The id of the template |
int | $competencyid | The id of the competency |
bool |
|
static |
Create an evidence from a list of parameters.
Requires no capability because evidence can be added in many situations under any user.
int | $userid | The user id for which evidence is added. |
competency | int | $competencyorid | The competency, or its id for which evidence is added. |
context | int | $contextorid | The context in which the evidence took place. |
int | $action | The type of action to take on the competency. core_competency\evidence::ACTION_*. |
string | $descidentifier | The strings identifier. |
string | $desccomponent | The strings component. |
mixed | $desca | Any arguments the string requires. |
bool | $recommend | When true, the user competency will be sent for review. |
string | $url | The url the evidence may link to. |
int | $grade | The grade, or scale ID item. |
int | $actionuserid | The ID of the user who took the action of adding the evidence. Null when system. This should be used when the action was taken by a real person, this will allow to keep track of all the evidence given by a certain person. |
string | $note | A note to attach to the evidence. |
evidence |
|
static |
Add a related competency.
int | $competencyid | The id of the competency |
int | $relatedcompetencyid | The id of the related competency. |
bool | False when create failed, true on success, or if the relation already existed. |
|
staticprotected |
Apply the competency rules from a user competency.
The user competency passed should be one that was recently marked as complete. A user competency is considered 'complete' when it's proficiency value is true.
This method will check if the parent of this usercompetency's competency has any rules and if so will see if they match. When matched it will take the required step to add evidence and trigger completion, etc...
user_competency | $usercompetency | The user competency recently completed. |
competency | null | $competency | The competency of the user competency, useful to avoid unnecessary read. |
void |
|
static |
Approve a plan.
This means making the plan active.
int | plan | $planorid | The plan, or its ID. |
bool |
|
staticprotected |
Archive user competencies in a plan.
int | $plan | The plan object. |
void |
|
static |
Logg the competency framework viewed event.
competency_framework | int | $frameworkorid | The competency_framework object or competency framework id |
bool |
|
static |
Logg the competency viewed event.
competency | int | $competencyorid | The competency object or competency id |
bool |
|
static |
Complete a plan.
int | plan | $planorid | The plan, or its ID. |
bool |
|
static |
Perform a search based on the provided filters and return a paginated list of records.
Requires moodle/competency:competencyview capability at some context.
array | $filters | A list of filters to apply to the list. |
int |
|
static |
Count all the competencies in a course.
int | $courseid | The id of the course to check. |
int |
|
static |
Count all the competencies in a learning plan template.
template | int | $templateorid | The template or its ID. |
int |
|
static |
Count all the competencies in a learning plan template with no linked courses.
template | int | $templateorid | The template or its ID. |
int |
|
static |
Count the competencies associated to a course module.
mixed | $cmorid | The course module, or its ID. |
int |
|
static |
Count all the courses using a competency.
int | $competencyid | The id of the competency to check. |
int |
|
static |
Perform a search based on the provided filters and return a paginated list of records.
Requires moodle/competency:competencyview capability at the system context.
context | $context | The parent context of the frameworks. |
string | $includes | Defines what other contexts to fetch frameworks from. Accepted values are:
|
int |
|
static |
Count the plans in the template, filtered by status.
Requires moodle/competency:templateview capability at the system context.
mixed | $templateorid | The id or the template. |
int | $status | One of the plan status constants (or 0 for all plans). |
int |
|
static |
Count the proficient competencies in a course for one user.
int | $courseid | The id of the course to check. |
int | $userid | The id of the user to check. |
int |
|
static |
Perform a search based on the provided filters and return how many results there are.
Requires moodle/competency:templateview capability at the system context.
context | $context | The parent context of the frameworks. |
string | $includes | Defines what other contexts to fetch frameworks from. Accepted values are:
|
int |
|
static |
Count all the templates using a competency.
int | $competencyid | The id of the competency to check. |
int |
|
static |
Count the user-completency-plans in the template, optionally filtered by proficiency.
Requires moodle/competency:templateview capability at the system context.
mixed | $templateorid | The id or the template. |
mixed | $proficiency | If true, filter by proficiency, if false filter by not proficient, if null - no filter. |
int |
|
static |
Create a competency from a record containing all the data for the class.
Requires moodle/competency:competencymanage capability at the system context.
stdClass | $record | Record containing all the data for an instance of the class. |
competency |
|
static |
Create a competency framework from a record containing all the data for the class.
Requires moodle/competency:competencymanage capability at the system context.
stdClass | $record | Record containing all the data for an instance of the class. |
competency_framework |
|
static |
Creates a learning plan based on the provided data.
stdClass | $record |
core_competency |
|
static |
Create a learning plan from a template.
mixed | $templateorid | The template object or ID. |
int | $userid |
false|core_competency |
|
static |
Create learning plans from a template and cohort.
mixed | $templateorid | The template object or ID. |
int | $cohortid | The cohort ID. |
bool | $recreateunlinked | When true the plans that were unlinked from this template will be re-created. |
int | The number of plans created. |
|
static |
Create a learning plan template from a record containing all the data for the class.
Requires moodle/competency:templatemanage capability.
stdClass | $record | Record containing all the data for an instance of the class. |
template |
|
static |
Create a relation between a template and a cohort.
This silently ignores when the relation already existed.
template | int | $templateorid | The template or its ID. |
stdClass | int | $cohortorid | The cohort ot its ID. |
template_cohort |
|
static |
Create a new user evidence.
object | $data | The data. |
int | $draftitemid | The draft ID in which files have been saved. |
user_evidence |
|
static |
Link a user evidence with a competency.
user_evidence | int | $userevidenceorid | User evidence or its ID. |
int | $competencyid | Competency ID. |
user_evidence_competency |
|
static |
Delete a competency by id.
Requires moodle/competency:competencymanage capability at the system context.
int | $id | The record to delete. This will delete alot of related data - you better be sure. |
boolean |
|
static |
Delete an evidence.
evidence | int | $evidenceorid | The evidence, or its ID. |
bool |
|
static |
Delete a competency framework by id.
Requires moodle/competency:competencymanage capability at the system context.
int | $id | The record to delete. This will delete alot of related data - you better be sure. |
boolean |
|
static |
Deletes a plan.
Plans based on a template can be removed just like any other one.
int | $id |
bool | Success? |
|
static |
Delete a learning plan template by id.
If the learning plan template has associated cohorts they will be deleted.
Requires moodle/competency:templatemanage capability.
int | $id | The record to delete. |
boolean | $deleteplans | True to delete plans associaated to template, false to unlink them. |
boolean |
|
static |
Remove a relation between a template and a cohort.
template | int | $templateorid | The template or its ID. |
stdClass | int | $cohortorid | The cohort ot its ID. |
boolean | True on success or when the relation did not exist. |
|
static |
Delete a user evidence.
int | $id | The user evidence ID. |
bool |
|
static |
Delete a relationship between a user evidence and a competency.
user_evidence | int | $userevidenceorid | User evidence or its ID. |
int | $competencyid | Competency ID. |
bool |
|
staticprotected |
Recursively duplicate competencies from a tree, we start duplicating from parents to children to have a correct path.
This method does not copy the related competencies.
int | $frameworkid | - framework id |
competency[] | $tree | - array of competencies object |
int | $oldparent | - old parent id |
int | $newparent | - new parent id |
competency[]::$matchids | - List of old competencies ids matched with new competencies object. |
|
static |
Duplicate a competency framework by id.
Requires moodle/competency:competencymanage capability at the system context.
int | $id | The record to duplicate. All competencies associated and related will be duplicated. |
competency_framework | the framework duplicated |
|
static |
Duplicate a learning plan template.
Requires moodle/competency:templatemanage capability at the template context.
int | $id | the template id. |
template |
|
static |
Function used to return a list of users where the given user has a particular capability.
This is used e.g. to find all the users where someone is able to manage their learning plans, it also would be useful for mentees etc.
string | $capability | - The capability string we are filtering for. If '' is passed, an always matching filter is returned. |
int | $userid | - The user id we are using for the access checks. Defaults to current user. |
int | $type | - The type of named params to return (passed to $DB->get_in_or_equal). |
string | $prefix | - The type prefix for the db table (passed to $DB->get_in_or_equal). |
list($sql,$params) | Same as $DB->get_in_or_equal(). |
|
static |
Get the most often not completed competency for this course.
Requires moodle/competency:coursecompetencyview capability at the course context.
int | $courseid | The course id |
int | $skip | The number of records to skip |
int | $limit | The max number of records to return |
competency[] |
|
static |
Get the most often not completed competency for this template.
Requires moodle/competency:templateview capability at the system context.
mixed | $templateorid | The id or the template. |
int | $skip | The number of records to skip |
int | $limit | The max number of records to return |
competency[] |
|
static |
Get a single competency from the user plan.
int | $planorid | The plan, or its ID. |
int | $competencyid | The competency id. |
(object) | array( 'competency' => core_competency\competency, 'usercompetency' => core_competency\user_competency 'usercompetencyplan' => core_competency\user_competency_plan ) The values of of keys usercompetency and usercompetencyplan cannot be defined at the same time. |
|
static |
Fetches all the relevant contexts.
Note: This currently only supports system, category and user contexts. However user contexts behave a bit differently and will fallback on the system context. This is what makes the most sense because a user context does not have descendants, and only has system as a parent.
context | $context | The context to start from. |
string | $includes | Defines what other contexts to find. Accepted values are:
|
array | $hasanycapability | Array of capabilities passed to has_any_capability() in each context. |
context[] | An array of contexts where keys are context IDs. |
|
static |
Get a user competency.
int | $userid | The user ID. |
int | $competencyid | The competency ID. |
user_competency |
|
static |
Get a user competency by ID.
int | $usercompetencyid | The user competency ID. |
user_competency |
|
static |
Get a user competency in a course.
int | $courseid | The id of the course to check. |
int | $userid | The id of the course to check. |
int | $competencyid | The id of the competency. |
user_competency_course |
|
static |
Manually grade a user competency.
int | $userid | |
int | $competencyid | |
int | $grade | |
string | $note | A note to attach to the evidence |
array | of core_competency\user_competency |
|
static |
Manually grade a user course competency from the course page.
This may push the rating to the user competency if the course is configured this way.
mixed | $courseorid | |
int | $userid | |
int | $competencyid | |
int | $grade | |
string | $note | A note to attach to the evidence |
array | of core_competency\user_competency |
|
static |
Manually grade a user competency from the plans page.
mixed | $planorid | |
int | $competencyid | |
int | $grade | |
string | $note | A note to attach to the evidence |
array | of core_competency\user_competency |
|
static |
Action to perform when a cohort is deleted.
Do not call this directly, this is reserved for core use.
stdClass | $cohort | The cohort object. |
void |
|
static |
Action to perform when a course is deleted.
Do not call this directly, this is reserved for core use.
stdClass | $course | The course object. |
void |
|
static |
Action to perform when a course module is deleted.
Do not call this directly, this is reserved for core use.
stdClass | $cm | The CM object. |
void |
|
static |
Action to perform when a course is being reset.
Do not call this directly, this is reserved for core use.
int | $courseid | The course ID. |
void |
|
static |
Action to perform when a user is deleted.
int | $userid | The user id. |
|
static |
Returns whether competencies are enabled.
This method should never do more than checking the config setting, the reason being that some other code could be checking the config value directly to avoid having to load this entire file into memory.
boolean | True when enabled. |
|
static |
Checks whether a scale is used anywhere in the plugin.
This public API has two exceptions:
int | $scaleid | The scale ID. |
bool |
|
static |
Perform a search based on the provided filters and return a paginated list of records.
Requires moodle/competency:competencyview capability at some context.
array | $filters | A list of filters to apply to the list. |
string | $sort | The column to sort on |
string | $order | ('ASC' or 'DESC') |
int | $skip | Number of records to skip (pagination) |
int | $limit | Max of records to return (pagination) |
array | of competencies |
|
static |
List all the competencies in a template.
template | int | $templateorid | The template or its ID. |
array | of competencies |
|
static |
List the competencies associated to a course.
mixed | $courseorid | The course, or its ID. |
array( | array( 'competency' => core_competency\competency, 'coursecompetency' => core_competency\course_competency )) |
|
static |
List the competencies associated to a course module.
mixed | $cmorid | The course module, or its ID. |
array( | array( 'competency' => core_competency\competency, 'coursemodulecompetency' => core_competency\course_module_competency )) |
|
static |
List all the competencies linked to a course module.
mixed | $cmorid | The course module, or its ID. |
array[competency] | Array of competency records. |
|
static |
List all the courses modules using a competency in a course.
int | $competencyid | The id of the competency to check. |
int | $courseid | The id of the course to check. |
array[int] | Array of course modules ids. |
|
static |
List all the courses using a competency.
int | $competencyid | The id of the competency to check. |
array[stdClass] | Array of stdClass containing id and shortname. |
|
static |
List all the evidence for a user competency.
int | $userid | The user id - only used if usercompetencyid is 0. |
int | $competencyid | The competency id - only used it usercompetencyid is 0. |
int | $planid | The plan id - not used yet - but can be used to only list archived evidence if a plan is completed. |
string | $sort | The field to sort the evidence by. |
string | $order | The ordering of the sorting. |
int | $skip | Number of records to skip. |
int | $limit | Number of records to return. |
core_competency |
|
static |
List all the evidence for a user competency in a course.
int | $userid | The user ID. |
int | $courseid | The course ID. |
int | $competencyid | The competency ID. |
string | $sort | The field to sort the evidence by. |
string | $order | The ordering of the sorting. |
int | $skip | Number of records to skip. |
int | $limit | Number of records to return. |
core_competency |
|
static |
Perform a search based on the provided filters and return a paginated list of records.
Requires moodle/competency:competencyview capability at the system context.
string | $sort | The column to sort on |
string | $order | ('ASC' or 'DESC') |
int | $skip | Number of records to skip (pagination) |
int | $limit | Max of records to return (pagination) |
context | $context | The parent context of the frameworks. |
string | $includes | Defines what other contexts to fetch frameworks from. Accepted values are:
|
bool | $onlyvisible | If true return only visible frameworks |
string | $query | A string to use to filter down the frameworks. |
array | of competency_framework |
|
static |
List the competencies in a user plan.
int | $planorid | The plan, or its ID. |
array((object) | array( 'competency' => core_competency\competency, 'usercompetency' => core_competency\user_competency 'usercompetencyplan' => core_competency\user_competency_plan )) The values of of keys usercompetency and usercompetencyplan cannot be defined at the same time. |
|
static |
List the plans in the template, filtered by status.
Requires moodle/competency:templateview capability at the system context.
mixed | $templateorid | The id or the template. |
int | $status | One of the plan status constants (or 0 for all plans). |
int | $skip | The number of records to skip |
int | $limit | The max number of records to return |
plan[] |
|
static |
List the plans to review.
The method returns values in this format:
array( 'plans' => array( (stdClass)( 'plan' => (plan), 'template' => (template), 'owner' => (stdClass) ) ), 'count' => (int) )
int | $skip | The number of records to skip. |
int | $limit | The number of results to return. |
int | $userid | The user we're getting the plans to review for. |
array | Containing the keys 'count', and 'plans'. The 'plans' key contains an object which contains 'plan', 'template' and 'owner'. |
|
static |
List the plans with a competency.
int | $userid | The user id we want the plans for. |
int | $competencyorid | The competency, or its ID. |
array[plan] | Array of learning plans. |
|
static |
List all the related competencies.
int | $competencyid | The id of the competency to check. |
competency[] |
|
static |
Perform a search based on the provided filters and return a paginated list of records.
Requires moodle/competency:templateview capability at the system context.
string | $sort | The column to sort on |
string | $order | ('ASC' or 'DESC') |
int | $skip | Number of records to skip (pagination) |
int | $limit | Max of records to return (pagination) |
context | $context | The parent context of the frameworks. |
string | $includes | Defines what other contexts to fetch frameworks from. Accepted values are:
|
bool | $onlyvisible | If should list only visible templates |
array | of competency_framework |
|
static |
List all the learning plan templatesd using a competency.
int | $competencyid | The id of the competency to check. |
array[stdClass] | Array of stdClass containing id and shortname. |
|
static |
List all the user competencies in a course.
int | $courseid | The id of the course to check. |
int | $userid | The id of the course to check. |
array | of user_competency_course objects |
|
static |
List the user competencies to review.
The method returns values in this format:
array( 'competencies' => array( (stdClass)( 'usercompetency' => (user_competency), 'competency' => (competency), 'user' => (user) ) ), 'count' => (int) )
int | $skip | The number of records to skip. |
int | $limit | The number of results to return. |
int | $userid | The user we're getting the competencies to review for. |
array | Containing the keys 'count', and 'competencies'. The 'competencies' key contains an object which contains 'competency', 'usercompetency' and 'user'. |
|
static |
List the user evidence of a user.
int | $userid | The user ID. |
user_evidence[] |
|
static |
|
staticprotected |
Recursively migrate competency rules.
competency[] | $tree | - array of competencies object |
competency[] | $matchids | - List of old competencies ids matched with new competencies object |
|
static |
Reorder this competency.
Requires moodle/competency:competencymanage capability at the system context.
int | $id | The id of the competency to move. |
boolean |
|
static |
Reorder this competency.
Requires moodle/competency:competencymanage capability at the system context.
int | $id | The id of the competency to move. |
boolean |
|
static |
Observe when a course is marked as completed.
Note that the user being logged in while this happens may be anyone. Do not rely on capability checks here!
core\event\course_completed | $event |
void |
|
static |
Observe when a course module is marked as completed.
Note that the user being logged in while this happens may be anyone. Do not rely on capability checks here!
core\event\course_module_completion_updated | $event |
void |
|
static |
Cancel the review of a plan.
int | plan | $planorid | The plan, or its ID. |
bool |
|
static |
Request the review of a plan.
int | plan | $planorid | The plan, or its ID. |
bool |
|
static |
Start the review of a plan.
int | plan | $planorid | The plan, or its ID. |
bool |
|
static |
Stop reviewing a plan.
int | plan | $planorid | The plan, or its ID. |
bool |
|
static |
Plan event viewed.
mixed | $planorid | The id or the plan. |
boolean |
|
static |
Read a the details for a single competency and return a record.
Requires moodle/competency:competencyview capability at the system context.
int | $id | The id of the competency to read. |
bool | $includerelated | Include related tags or not. |
stdClass |
|
static |
Get the competency settings for a course.
Requires moodle/competency:coursecompetencyview capability at the course context.
int | $courseid | The course id |
course_competency_settings |
|
static |
Read an evidence.
int | $evidenceid | The evidence ID. |
evidence |
|
static |
Read a the details for a single competency framework and return a record.
Requires moodle/competency:competencyview capability at the system context.
int | $id | The id of the framework to read. |
competency_framework |
|
static |
|
static |
Read a the details for a single learning plan template and return a record.
Requires moodle/competency:templateview capability at the system context.
int | $id | The id of the template to read. |
template |
|
static |
|
staticprotected |
Delete archived user competencies in a plan.
int | $plan | The plan object. |
void |
|
static |
Remove a competency from this course.
int | $courseid | The id of the course |
int | $competencyid | The id of the competency |
bool |
|
static |
Remove a competency from this course module.
mixed | $cmorid | The course module, or id of the course module |
int | $competencyid | The id of the competency |
bool |
|
static |
Remove a competency from a plan.
int | $planid | The plan id |
int | $competencyid | The id of the competency |
bool |
|
static |
Remove a competency from this template.
int | $templateid | The id of the template |
int | $competencyid | The id of the competency |
bool |
|
static |
Remove a related competency.
int | $competencyid | The id of the competency. |
int | $relatedcompetencyid | The id of the related competency. |
bool | True when it was deleted, false when it wasn't or the relation doesn't exist. |
|
static |
Reopen a plan.
int | plan | $planorid | The plan, or its ID. |
bool |
|
static |
Move the course competency up or down in the display list.
Requires moodle/competency:coursecompetencymanage capability at the course context.
int | $courseid | The course |
int | $competencyidfrom | The id of the competency we are moving. |
int | $competencyidto | The id of the competency we are moving to. |
boolean |
|
static |
Move the course module competency up or down in the display list.
Requires moodle/competency:coursecompetencymanage capability at the course module context.
mixed | $cmorid | The course module, or id of the course module |
int | $competencyidfrom | The id of the competency we are moving. |
int | $competencyidto | The id of the competency we are moving to. |
boolean |
|
static |
Move the plan competency up or down in the display list.
Requires moodle/competency:planmanage capability at the system context.
int | $planid | The plan id |
int | $competencyidfrom | The id of the competency we are moving. |
int | $competencyidto | The id of the competency we are moving to. |
boolean |
|
static |
Move the template competency up or down in the display list.
Requires moodle/competency:templatemanage capability at the system context.
int | $templateid | The template id |
int | $competencyidfrom | The id of the competency we are moving. |
int | $competencyidto | The id of the competency we are moving to. |
boolean |
|
static |
Send request review for user evidence competencies.
int | $id | The user evidence ID. |
bool |
|
static |
|
static |
Perform a text search based and return all results and their parents.
Requires moodle/competency:competencyview capability at the framework context.
string | $textsearch | A string to search for. |
int | $competencyframeworkid | The id of the framework to limit the search. |
array | of competencies |
|
static |
Update ruleoutcome value for a course competency.
int | course_competency | $coursecompetencyorid | The course_competency, or its ID. |
int | $ruleoutcome | The value of ruleoutcome. |
bool | True on success. |
|
static |
Update ruleoutcome value for a course module competency.
int | course_module_competency | $coursemodulecompetencyorid | The course_module_competency, or its ID. |
int | $ruleoutcome | The value of ruleoutcome. |
bool | True on success. |
|
static |
Move this competency so it sits in a new parent.
Requires moodle/competency:competencymanage capability at the system context.
int | $id | The id of the competency to move. |
int | $newparentid | The new parent id for the competency. |
boolean |
|
static |
When competencies used to be enabled, we can show the text but do not include links.
boolean | True means show links. |
|
static |
Check if template has related data.
int | $templateid | The id of the template to check. |
boolean |
|
static |
Template event viewed.
Requires moodle/competency:templateview capability at the system context.
mixed | $templateorid | The id or the template. |
boolean |
|
static |
Unapprove a plan.
This means making the plan draft.
int | plan | $planorid | The plan, or its ID. |
bool |
|
static |
Unlink a plan from its template.
core_competency\plan | int | $planorid | The plan or its ID. |
bool |
|
static |
Update the details for a competency.
Requires moodle/competency:competencymanage capability at the system context.
stdClass | $record | The new details for the competency. Note - must contain an id that points to the competency to update. |
boolean |
|
static |
Update the competency settings for a course.
Requires moodle/competency:coursecompetencyconfigure capability at the course context.
int | $courseid | The course id |
stdClass | $settings | List of settings. The only valid setting ATM is pushratginstouserplans (boolean). |
bool |
|
static |
Update the details for a competency framework.
Requires moodle/competency:competencymanage capability at the system context.
stdClass | $record | The new details for the framework. Note - must contain an id that points to the framework to update. |
boolean |
|
static |
|
static |
Update the details for a learning plan template.
Requires moodle/competency:templatemanage capability.
stdClass | $record | The new details for the template. Note - must contain an id that points to the template to update. |
boolean |
|
static |
Create a new user evidence.
object | $data | The data. |
int | $draftitemid | The draft ID in which files have been saved. |
user_evidence |
|
static |
Cancel a user competency review request.
int | $userid | The user ID. |
int | $competencyid | The competency ID. |
bool |
|
static |
Log user competency plan viewed event.
user_competency_plan | int | $usercompetencyplanorid | The user competency plan object or user competency plan id |
bool |
|
static |
Request a user competency review.
int | $userid | The user ID. |
int | $competencyid | The competency ID. |
bool |
|
static |
Start a user competency review.
int | $userid | The user ID. |
int | $competencyid | The competency ID. |
bool |
|
static |
Stop a user competency review.
int | $userid | The user ID. |
int | $competencyid | The competency ID. |
bool |
|
static |
Log user competency viewed event.
user_competency | int | $usercompetencyorid | The user competency object or user competency id |
bool |
|
static |
Log user competency viewed in course event.
user_competency_course | int | $usercoursecompetencyorid | The user competency course object or its ID. |
int | $courseid | The course ID |
bool |
|
static |
Log user competency viewed in plan event.
user_competency | int | $usercompetencyorid | The user competency object or user competency id |
int | $planid | The plan ID |
bool |
|
staticprotected |
Validate if current user have acces to the course if hidden.
mixed | $courseorid | The course or it ID. |
bool | $throwexception | Throw an exception or not. |
bool |
|
staticprotected |
Validate if current user have acces to the course_module if hidden.
mixed | $cmmixed | The cm_info class, course module record or its ID. |
bool | $throwexception | Throw an exception or not. |
bool |