Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
This is the external API for this tool. More...
Static Public Member Functions | |
static | call_external_function ($function, $args, $ajaxonly=false) |
Call an external function validating all params/returns correctly. More... | |
static | clean_returnvalue (external_description $description, $response) |
Clean response If a response attribute is unknown from the description, we just ignore the attribute. More... | |
static | data_for_competencies_manage_page ($competencyframeworkid, $search) |
Loads the data required to render the competencies_manage_page template. More... | |
static | data_for_competencies_manage_page_parameters () |
Returns description of data_for_competencies_manage_page() parameters. More... | |
static | data_for_competencies_manage_page_returns () |
Returns description of data_for_competencies_manage_page() result value. More... | |
static | data_for_competency_frameworks_manage_page ($pagecontext) |
Loads the data required to render the competency_frameworks_manage_page template. More... | |
static | data_for_competency_frameworks_manage_page_parameters () |
Returns description of data_for_competency_frameworks_manage_page() parameters. More... | |
static | data_for_competency_frameworks_manage_page_returns () |
Returns description of data_for_competency_frameworks_manage_page() result value. More... | |
static | data_for_competency_summary ($competencyid, $includerelated=false, $includecourses=false) |
Loads the data required to render the competency_page template. More... | |
static | data_for_competency_summary_parameters () |
Returns description of data_for_competency_summary() parameters. More... | |
static | data_for_competency_summary_returns () |
Returns description of data_for_competency_summary_() result value. More... | |
static | data_for_course_competencies_page ($courseid, $moduleid) |
Loads the data required to render the course_competencies_page template. More... | |
static | data_for_course_competencies_page_parameters () |
Returns description of data_for_course_competenies_page() parameters. More... | |
static | data_for_course_competencies_page_returns () |
Returns description of data_for_course_competencies_page() result value. More... | |
static | data_for_plan_page ($planid) |
Loads the data required to render the plan_page template. More... | |
static | data_for_plan_page_parameters () |
Returns description of data_for_plan_competenies_page() parameters. More... | |
static | data_for_plan_page_returns () |
Returns description of data_for_plan_page() result value. More... | |
static | data_for_plans_page ($userid) |
Loads the data required to render the plans_page template. More... | |
static | data_for_plans_page_parameters () |
Returns description of data_for_plans_page() parameters. More... | |
static | data_for_plans_page_returns () |
Returns description of data_for_plans_page() result value. More... | |
static | data_for_related_competencies_section ($competencyid) |
Data to render in the related competencies section. More... | |
static | data_for_related_competencies_section_parameters () |
Returns the description of the data_for_related_competencies_section_parameters() parameters. More... | |
static | data_for_related_competencies_section_returns () |
Returns description of data_for_related_competencies_section_returns() result value. More... | |
static | data_for_template_competencies_page ($templateid, $pagecontext) |
Loads the data required to render the template_competencies_page template. More... | |
static | data_for_template_competencies_page_parameters () |
Returns description of data_for_template_competenies_page() parameters. More... | |
static | data_for_template_competencies_page_returns () |
Returns description of data_for_template_competencies_page() result value. More... | |
static | data_for_templates_manage_page ($pagecontext) |
Loads the data required to render the templates_manage_page template. More... | |
static | data_for_templates_manage_page_parameters () |
Returns description of data_for_templates_manage_page() parameters. More... | |
static | data_for_templates_manage_page_returns () |
Returns description of data_for_templates_manage_page() result value. More... | |
static | data_for_user_competency_summary ($userid, $competencyid) |
Data for user competency summary. More... | |
static | data_for_user_competency_summary_in_course ($userid, $competencyid, $courseid) |
Read a user competency summary. More... | |
static | data_for_user_competency_summary_in_course_parameters () |
Returns description of data_for_user_competency_summary_in_course() parameters. More... | |
static | data_for_user_competency_summary_in_course_returns () |
Returns description of data_for_user_competency_summary_in_course() result value. More... | |
static | data_for_user_competency_summary_in_plan ($competencyid, $planid) |
Read a user competency summary. More... | |
static | data_for_user_competency_summary_in_plan_parameters () |
Returns description of data_for_user_competency_summary_in_plan() parameters. More... | |
static | data_for_user_competency_summary_in_plan_returns () |
Returns description of data_for_user_competency_summary_in_plan() result value. More... | |
static | data_for_user_competency_summary_parameters () |
Returns description of external function. More... | |
static | data_for_user_competency_summary_returns () |
Returns description of external function. More... | |
static | data_for_user_evidence_list_page ($userid) |
Loads the data required to render the user_evidence_list_page template. More... | |
static | data_for_user_evidence_list_page_parameters () |
Returns description of external function parameters. More... | |
static | data_for_user_evidence_list_page_returns () |
Returns description of external function result value. More... | |
static | data_for_user_evidence_page ($id) |
Loads the data required to render the user_evidence_page template. More... | |
static | data_for_user_evidence_page_parameters () |
Returns description of external function parameters. More... | |
static | data_for_user_evidence_page_returns () |
Returns description of external function result value. More... | |
static | external_function_info ($function, $strictness=MUST_EXIST) |
Returns detailed function information. More... | |
static | list_courses_using_competency ($competencyid) |
Count the courses (visible to this user) that use this competency. More... | |
static | list_courses_using_competency_parameters () |
Returns description of list_courses_using_competency() parameters. More... | |
static | list_courses_using_competency_returns () |
Returns description of list_courses_using_competency() result value. More... | |
static | search_users ($query, $capability='', $limitfrom=0, $limitnum=100) |
Search users. More... | |
static | search_users_parameters () |
Returns the description of external function parameters. More... | |
static | search_users_returns () |
Returns description of external function result value. More... | |
static | set_context_restriction ($context) |
Set context restriction for all following subsequent function calls. More... | |
static | set_timeout ($seconds=360) |
This method has to be called before every operation that takes a longer time to finish! More... | |
static | validate_context ($context) |
Makes sure user may execute functions in this context. More... | |
static | validate_parameters (external_description $description, $params) |
Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown. More... | |
Static Protected Member Functions | |
static | get_context_from_params ($param) |
Get context from passed parameters. More... | |
static | get_context_parameters () |
Returns a prepared structure to use a context parameters. More... | |
This is the external API for this tool.
|
staticinherited |
Call an external function validating all params/returns correctly.
Note that an external function may modify the state of the current page, so this wrapper saves and restores tha PAGE and COURSE global variables before/after calling the external function.
string | $function | A webservice function name. |
array | $args | Params array (named params) |
boolean | $ajaxonly | If true, an extra check will be peformed to see if ajax is required. |
array | containing keys for error (bool), exception and data. |
|
staticinherited |
Clean response If a response attribute is unknown from the description, we just ignore the attribute.
If a response attribute is incorrect, invalid_response_exception is thrown. Note: this function is similar to validate parameters, however it is distinct because parameters validation must be distinct from cleaning return values.
external_description | $description | description of the return values |
mixed | $response | the actual response |
mixed | response with added defaults for optional items, invalid_response_exception thrown if any problem found |
|
static |
Loads the data required to render the competencies_manage_page template.
int | $competencyframeworkid | Framework id. |
string | $search | Text to search. |
boolean |
|
static |
Returns description of data_for_competencies_manage_page() parameters.
external_function_parameters |
|
static |
Returns description of data_for_competencies_manage_page() result value.
external_description |
|
static |
Loads the data required to render the competency_frameworks_manage_page template.
context | $pagecontext | The page context |
stdClass |
|
static |
Returns description of data_for_competency_frameworks_manage_page() parameters.
external_function_parameters |
|
static |
Returns description of data_for_competency_frameworks_manage_page() result value.
external_description |
|
static |
Loads the data required to render the competency_page template.
int | $competencyid | Competency id. |
boolean | $includerelated | Include or not related competencies. |
boolean | $includecourses | Include or not competency courses. |
stdClass |
|
static |
Returns description of data_for_competency_summary() parameters.
external_function_parameters |
|
static |
Returns description of data_for_competency_summary_() result value.
external_description |
|
static |
Loads the data required to render the course_competencies_page template.
int | $courseid | The course id to check. |
int | $moduleid | The module id to check (0 for no filter). |
boolean |
|
static |
Returns description of data_for_course_competenies_page() parameters.
external_function_parameters |
|
static |
Returns description of data_for_course_competencies_page() result value.
external_description |
|
static |
Loads the data required to render the plan_page template.
int | $planid | Learning Plan id. |
boolean |
|
static |
Returns description of data_for_plan_competenies_page() parameters.
external_function_parameters |
|
static |
Returns description of data_for_plan_page() result value.
external_description |
|
static |
Loads the data required to render the plans_page template.
int | $userid | User id. |
boolean |
|
static |
Returns description of data_for_plans_page() parameters.
external_function_parameters |
|
static |
Returns description of data_for_plans_page() result value.
external_description |
|
static |
Data to render in the related competencies section.
int | $competencyid |
array | Related competencies and whether to show delete action button or not. |
|
static |
Returns the description of the data_for_related_competencies_section_parameters() parameters.
external_function_parameters. |
|
static |
Returns description of data_for_related_competencies_section_returns() result value.
external_description |
|
static |
Loads the data required to render the template_competencies_page template.
int | $templateid | Template id. |
array | $pagecontext | The page context info. |
boolean |
|
static |
Returns description of data_for_template_competenies_page() parameters.
external_function_parameters |
|
static |
Returns description of data_for_template_competencies_page() result value.
external_description |
|
static |
Loads the data required to render the templates_manage_page template.
array | $pagecontext | The page context info. |
boolean |
|
static |
Returns description of data_for_templates_manage_page() parameters.
external_function_parameters |
|
static |
Returns description of data_for_templates_manage_page() result value.
external_description |
|
static |
Data for user competency summary.
int | $userid | The user ID |
int | $competencyid | The competency ID |
stdClass |
|
static |
Read a user competency summary.
int | $userid | The user id |
int | $competencyid | The competency id |
int | $courseid | The course id |
stdClass |
|
static |
Returns description of data_for_user_competency_summary_in_course() parameters.
external_function_parameters |
|
static |
Returns description of data_for_user_competency_summary_in_course() result value.
external_description |
|
static |
Read a user competency summary.
int | $competencyid | The competency id |
int | $planid | The plan id |
stdClass |
|
static |
Returns description of data_for_user_competency_summary_in_plan() parameters.
external_function_parameters |
|
static |
Returns description of data_for_user_competency_summary_in_plan() result value.
external_description |
|
static |
Returns description of external function.
external_function_parameters |
|
static |
Returns description of external function.
external_description |
|
static |
Loads the data required to render the user_evidence_list_page template.
int | $userid | User id. |
boolean |
|
static |
Returns description of external function parameters.
external_function_parameters |
|
static |
Returns description of external function result value.
external_description |
|
static |
Loads the data required to render the user_evidence_page template.
int | $id | User id. |
boolean |
|
static |
Returns description of external function parameters.
external_function_parameters |
|
static |
Returns description of external function result value.
external_description |
|
staticinherited |
Returns detailed function information.
string | object | $function | name of external function or record from external_function |
int | $strictness | IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; MUST_EXIST means throw exception if no record or multiple records found |
stdClass | description or false if not found or exception thrown |
|
staticprotectedinherited |
Get context from passed parameters.
The passed array must either contain a contextid or a combination of context level and instance id to fetch the context. For example, the context level can be "course" and instanceid can be courseid.
See context_helper::get_all_levels() for a list of valid context levels.
array | $param |
invalid_parameter_exception |
context |
|
staticprotected |
Returns a prepared structure to use a context parameters.
external_single_structure |
Reimplemented from external_api.
|
static |
Count the courses (visible to this user) that use this competency.
int | $competencyid | Competency id. |
array |
|
static |
Returns description of list_courses_using_competency() parameters.
external_function_parameters |
|
static |
Returns description of list_courses_using_competency() result value.
external_description |
|
static |
Search users.
string | $query | |
string | $capability | |
int | $limitfrom | |
int | $limitnum |
array |
|
static |
Returns the description of external function parameters.
external_function_parameters. |
|
static |
Returns description of external function result value.
external_description |
|
staticinherited |
Set context restriction for all following subsequent function calls.
stdClass | $context | the context restriction |
|
staticinherited |
This method has to be called before every operation that takes a longer time to finish!
int | $seconds | max expected time the next operation needs |
|
staticinherited |
Makes sure user may execute functions in this context.
stdClass | $context |
|
staticinherited |
Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown.
This is a simple recursive method which is intended to be called from each implementation method of external API.
external_description | $description | description of parameters |
mixed | $params | the actual parameters |
mixed | params with added defaults for optional items, invalid_parameters_exception thrown if any problem found |