Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 401] [Versions 39 and 402] [Versions 39 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.

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

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.

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

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.

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

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.

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

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

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
return: object The new tool proxy

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.

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

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.

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

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.

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

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.

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
return: array created tool type

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.

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
return: array updated 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.

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

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.

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

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

return: external_description