Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
The mod_lti\local\ltiservice\service_base class. More...
Public Member Functions | |
__construct () | |
Class constructor. | |
check_tool ($typeid, $body=null, $scopes=null) | |
Check that the request has been properly signed and is permitted. | |
check_tool_proxy ($toolproxyguid, $body=null) | |
Check that the request has been properly signed. | |
check_type ($typeid, $courseid, $body=null) | |
Check that the request has been properly signed. | |
get_component_id () | |
Get the service compoent ID. | |
get_configuration_options (&$mform) | |
Returns the configuration options for this service. | |
get_configuration_parameter_names () | |
Return an array with the names of the parameters that the service will be saving in the configuration. | |
get_id () | |
Get the service ID. | |
get_jwt_claim_mappings () | |
Return an array of key/claim mapping allowing LTI 1.1 custom parameters to be transformed to LTI 1.3 claims. | |
get_launch_parameters ($messagetype, $courseid, $userid, $typeid, $modlti=null) | |
Return an array of key/values to add to the launch parameters. | |
get_name () | |
Get the service name. | |
get_permitted_scopes () | |
Get the scope(s) permitted for this service in the context of a particular tool type. | |
get_resources () | |
Get the resources for this service. | |
get_scopes () | |
Get the scope(s) permitted for this service. | |
get_tool_proxy () | |
Get the tool proxy object. | |
get_type () | |
Get the type object. | |
get_typeconfig () | |
Get the type config array. | |
instance_added (object $lti) | |
Called when a new LTI Instance is added. | |
instance_deleted (int $id) | |
Called when a new LTI Instance is deleted. | |
instance_updated (object $lti) | |
Called when a new LTI Instance is updated. | |
is_allowed_in_context ($typeid, $courseid) | |
Checks if there is a site tool or a course tool for this site. | |
is_unsigned () | |
Get whether the service requests need to be signed. | |
is_used_in_context ($typeid, $courseid) | |
Default implementation will check for the existence of at least one mod_lti entry for that tool and context. | |
override_endpoint (string $messagetype, string $targetlinkuri, ?string $customstr, int $courseid, ?object $lti=null) | |
Called when the launch data is created, offering a possibility to alter the target link URI. | |
parse_value ($value) | |
Parse a string for custom substitution parameter variables supported by this service's resources. | |
set_instance_form_values (object $defaultvalues) | |
Set the form data when displaying the LTI Instance form. | |
stdClass | set_tool_proxy ($toolproxy) |
Set the tool proxy object. | |
stdClass | set_type ($type) |
Set the LTI type object. | |
array | set_typeconfig ($typeconfig) |
Set the LTI type config object. | |
Static Public Member Functions | |
static | get_service_path () |
Get the path for service requests. | |
Public Attributes | |
const | LTI_VERSION2P0 = 'LTI-2p0' |
Label representing an LTI 2 message type. | |
const | SERVICE_ENABLED = 1 |
Service enabled. | |
The mod_lti\local\ltiservice\service_base class.
mod_lti\local\ltiservice\service_base::__construct | ( | ) |
Class constructor.
Reimplemented in ltiservice_basicoutcomes\local\service\basicoutcomes, ltiservice_gradebookservices\local\service\gradebookservices, ltiservice_memberships\local\service\memberships, ltiservice_profile\local\service\profile, ltiservice_toolproxy\local\service\toolproxy, and ltiservice_toolsettings\local\service\toolsettings.
mod_lti\local\ltiservice\service_base::check_tool | ( | $typeid, | |
$body = null, | |||
$scopes = null ) |
Check that the request has been properly signed and is permitted.
string | $typeid | LTI type ID |
string | $body | Request body (null if none) |
string[] | $scopes | Array of required scope(s) for incoming request |
boolean |
mod_lti\local\ltiservice\service_base::check_tool_proxy | ( | $toolproxyguid, | |
$body = null ) |
Check that the request has been properly signed.
string | $toolproxyguid | Tool Proxy GUID |
string | $body | Request body (null if none) |
boolean |
mod_lti\local\ltiservice\service_base::check_type | ( | $typeid, | |
$courseid, | |||
$body = null ) |
Check that the request has been properly signed.
int | $typeid | The tool id |
int | $courseid | The course we are at |
string | $body | Request body (null if none) |
bool |
mod_lti\local\ltiservice\service_base::get_component_id | ( | ) |
Get the service compoent ID.
string |
mod_lti\local\ltiservice\service_base::get_configuration_options | ( | & | $mform | ) |
Returns the configuration options for this service.
MoodleQuickForm | $mform | Moodle quickform object definition |
Reimplemented in ltiservice_gradebookservices\local\service\gradebookservices, ltiservice_memberships\local\service\memberships, and ltiservice_toolsettings\local\service\toolsettings.
mod_lti\local\ltiservice\service_base::get_configuration_parameter_names | ( | ) |
Return an array with the names of the parameters that the service will be saving in the configuration.
array | Names list of the parameters that the service will be saving in the configuration |
mod_lti\local\ltiservice\service_base::get_id | ( | ) |
Get the service ID.
string |
mod_lti\local\ltiservice\service_base::get_jwt_claim_mappings | ( | ) |
Return an array of key/claim mapping allowing LTI 1.1 custom parameters to be transformed to LTI 1.3 claims.
array | Key/value pairs of params to claim mapping. |
Reimplemented in ltiservice_basicoutcomes\local\service\basicoutcomes, ltiservice_gradebookservices\local\service\gradebookservices, and ltiservice_memberships\local\service\memberships.
mod_lti\local\ltiservice\service_base::get_launch_parameters | ( | $messagetype, | |
$courseid, | |||
$userid, | |||
$typeid, | |||
$modlti = null ) |
Return an array of key/values to add to the launch parameters.
string | $messagetype | 'basic-lti-launch-request' or 'ContentItemSelectionRequest'. |
string | $courseid | The course id. |
string | $userid | The user id. |
string | $typeid | The tool lti type id. |
string | $modlti | The id of the lti activity. |
The type is passed to check the configuration and not return parameters for services not used.
array | Key/value pairs to add as launch parameters. |
Reimplemented in ltiservice_gradebookservices\local\service\gradebookservices, ltiservice_memberships\local\service\memberships, and ltiservice_toolsettings\local\service\toolsettings.
mod_lti\local\ltiservice\service_base::get_name | ( | ) |
Get the service name.
string |
mod_lti\local\ltiservice\service_base::get_permitted_scopes | ( | ) |
Get the scope(s) permitted for this service in the context of a particular tool type.
A null value indicates that no scopes are required to access the service.
array|null |
Reimplemented in ltiservice_basicoutcomes\local\service\basicoutcomes, ltiservice_gradebookservices\local\service\gradebookservices, ltiservice_memberships\local\service\memberships, and ltiservice_toolsettings\local\service\toolsettings.
|
abstract |
Get the resources for this service.
resource_base[] |
Reimplemented in ltiservice_basicoutcomes\local\service\basicoutcomes, ltiservice_gradebookservices\local\service\gradebookservices, ltiservice_memberships\local\service\memberships, ltiservice_profile\local\service\profile, ltiservice_toolproxy\local\service\toolproxy, and ltiservice_toolsettings\local\service\toolsettings.
mod_lti\local\ltiservice\service_base::get_scopes | ( | ) |
Get the scope(s) permitted for this service.
A null value indicates that no scopes are required to access the service.
array|null |
Reimplemented in ltiservice_basicoutcomes\local\service\basicoutcomes, ltiservice_gradebookservices\local\service\gradebookservices, ltiservice_memberships\local\service\memberships, and ltiservice_toolsettings\local\service\toolsettings.
|
static |
Get the path for service requests.
string |
mod_lti\local\ltiservice\service_base::get_tool_proxy | ( | ) |
Get the tool proxy object.
stdClass |
mod_lti\local\ltiservice\service_base::get_type | ( | ) |
Get the type object.
stdClass |
mod_lti\local\ltiservice\service_base::get_typeconfig | ( | ) |
Get the type config array.
array|null |
mod_lti\local\ltiservice\service_base::instance_added | ( | object | $lti | ) |
Called when a new LTI Instance is added.
object | $lti | LTI Instance. |
Reimplemented in ltiservice_gradebookservices\local\service\gradebookservices.
mod_lti\local\ltiservice\service_base::instance_deleted | ( | int | $id | ) |
Called when a new LTI Instance is deleted.
int | $id | LTI Instance. |
mod_lti\local\ltiservice\service_base::instance_updated | ( | object | $lti | ) |
Called when a new LTI Instance is updated.
object | $lti | LTI Instance. |
Reimplemented in ltiservice_gradebookservices\local\service\gradebookservices.
mod_lti\local\ltiservice\service_base::is_allowed_in_context | ( | $typeid, | |
$courseid ) |
Checks if there is a site tool or a course tool for this site.
int | $typeid | The tool lti type id. |
int | $courseid | The course id. |
bool | returns True if tool is allowed in context, false otherwise. |
mod_lti\local\ltiservice\service_base::is_unsigned | ( | ) |
Get whether the service requests need to be signed.
boolean |
mod_lti\local\ltiservice\service_base::is_used_in_context | ( | $typeid, | |
$courseid ) |
Default implementation will check for the existence of at least one mod_lti entry for that tool and context.
It may be overridden if other inferences can be done.
Ideally a Site Tool should be explicitly engaged with a course, the check on the presence of a link is a proxy to infer a Site Tool engagement until an explicit Site Tool - Course relationship exists.
int | $typeid | The tool lti type id. |
int | $courseid | The course id. |
bool | returns True if tool is used in context, false otherwise. |
mod_lti\local\ltiservice\service_base::override_endpoint | ( | string | $messagetype, |
string | $targetlinkuri, | ||
?string | $customstr, | ||
int | $courseid, | ||
?object | $lti = null ) |
Called when the launch data is created, offering a possibility to alter the target link URI.
string | $messagetype | message type for this launch |
string | $targetlinkuri | current target link uri |
null | string | $customstr | concatenated list of custom parameters |
int | $courseid | |
null | object | $lti | LTI Instance. |
array | containing the target link URL and the custom params string to use. |
Reimplemented in ltiservice_gradebookservices\local\service\gradebookservices.
mod_lti\local\ltiservice\service_base::parse_value | ( | $value | ) |
Parse a string for custom substitution parameter variables supported by this service's resources.
string | $value | Value to be parsed |
string |
mod_lti\local\ltiservice\service_base::set_instance_form_values | ( | object | $defaultvalues | ) |
Set the form data when displaying the LTI Instance form.
object | $defaultvalues | Default form values. |
Reimplemented in ltiservice_gradebookservices\local\service\gradebookservices.
stdClass mod_lti\local\ltiservice\service_base::set_tool_proxy | ( | $toolproxy | ) |
Set the tool proxy object.
object | $toolproxy | The tool proxy for this service request |
stdClass mod_lti\local\ltiservice\service_base::set_type | ( | $type | ) |
Set the LTI type object.
object | $type | The LTI type for this service request |
array mod_lti\local\ltiservice\service_base::set_typeconfig | ( | $typeconfig | ) |
Set the LTI type config object.
array | $typeconfig | The LTI type config for this service request |