Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

External tool module external API

Copyright: 2015 Juan Leyva <juan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1007 lines (39 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: mod_lti_external  - X-Ref

External tool module external functions

tool_type_return_structure()   X-Ref
Returns structure be used for returning a tool type from a web service.

return: external_function_parameters

tool_proxy_return_structure()   X-Ref
Returns description of a tool proxy

return: external_function_parameters

get_tool_proxies_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_tool_proxies($orphanedonly)   X-Ref
Returns the tool types.

return: array of tool types
param: bool $orphanedonly Retrieve only tool proxies that do not have a corresponding tool type

get_tool_proxies_returns()   X-Ref
Returns description of method result value.

return: external_description

get_tool_launch_data_parameters()   X-Ref
Returns description of method parameters.

return: external_function_parameters

get_tool_launch_data($toolid)   X-Ref
Return the launch data for a given external tool.

return: array of warnings and launch data
param: int $toolid the external tool instance id

get_tool_launch_data_returns()   X-Ref
Returns description of method result value

return: external_description

get_ltis_by_courses_parameters()   X-Ref
Describes the parameters for get_ltis_by_courses.

return: external_function_parameters

get_ltis_by_courses($courseids = array()   X-Ref
Returns a list of external tools in a provided list of courses,
if no list is provided all external tools that the user can view will be returned.

return: array the lti details
param: array $courseids the course ids

get_ltis_by_courses_returns()   X-Ref
Describes the get_ltis_by_courses return value.

return: external_single_structure

view_lti_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

view_lti($ltiid)   X-Ref
Trigger the course module viewed event and update the module completion status.

return: array of warnings and status result
param: int $ltiid the lti instance id

view_lti_returns()   X-Ref
Returns description of method result value

return: external_description

create_tool_proxy_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

create_tool_proxy($name, $registrationurl, $capabilityoffered, $serviceoffered)   X-Ref
Creates a new tool proxy

return: object The new tool proxy
param: string $name Tool proxy name
param: string $registrationurl Registration url
param: string[] $capabilityoffered List of capabilities this tool proxy should be offered
param: string[] $serviceoffered List of services this tool proxy should be offered

create_tool_proxy_returns()   X-Ref
Returns description of method result value

return: external_description

delete_tool_proxy_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

delete_tool_proxy($id)   X-Ref
Trigger the course module viewed event and update the module completion status.

return: object The tool proxy
param: int $id the lti instance id

delete_tool_proxy_returns()   X-Ref
Returns description of method result value

return: external_description

get_tool_proxy_registration_request_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_tool_proxy_registration_request($id)   X-Ref
Returns the registration request for a tool proxy.

return: array of registration parameters
param: int $id the lti instance id

get_tool_proxy_registration_request_returns()   X-Ref
Returns description of method result value

return: external_description

get_tool_types_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

get_tool_types($toolproxyid)   X-Ref
Returns the tool types.

return: array of tool types
param: int $toolproxyid The tool proxy id

get_tool_types_returns()   X-Ref
Returns description of method result value

return: external_description

create_tool_type_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

create_tool_type($cartridgeurl, $key, $secret)   X-Ref
Creates a tool type.

return: array created tool type
param: string $cartridgeurl Url of the xml cartridge representing the LTI tool
param: string $key The consumer key to identify this consumer
param: string $secret The secret

create_tool_type_returns()   X-Ref
Returns description of method result value

return: external_description

update_tool_type_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

update_tool_type($id, $name, $description, $state)   X-Ref
Update a tool type.

return: array updated tool type
param: int $id The id of the tool type to update
param: string $name The name of the tool type
param: string $description The name of the tool type
param: int $state The state of the tool type

update_tool_type_returns()   X-Ref
Returns description of method result value

return: external_description

delete_tool_type_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

delete_tool_type($id)   X-Ref
Delete a tool type.

return: array deleted tool type
param: int $id The id of the tool type to be deleted

delete_tool_type_returns()   X-Ref
Returns description of method result value

return: external_description

is_cartridge_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

is_cartridge($url)   X-Ref
Determine if the url to a tool is for a cartridge.

return: bool True if the url is for a cartridge.
param: string $url Url that may or may not be an xml cartridge

is_cartridge_returns()   X-Ref
Returns description of method result value

return: external_description