|
Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
A service implementing Memberships. 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. More... | |
| check_tool_proxy ($toolproxyguid, $body=null) | |
| Check that the request has been properly signed. More... | |
| check_type ($typeid, $courseid, $body=null) | |
| Check that the request has been properly signed. More... | |
| get_component_id () | |
| Get the service compoent ID. More... | |
| get_configuration_options (&$mform) | |
| Adds form elements for membership add/edit page. More... | |
| get_configuration_parameter_names () | |
| Return an array with the names of the parameters that the service will be saving in the configuration. More... | |
| get_id () | |
| Get the service ID. More... | |
| get_launch_parameters ($messagetype, $courseid, $user, $typeid, $modlti=null) | |
| Return an array of key/values to add to the launch parameters. More... | |
| get_members_json ($resource, $context, $course, $role, $limitfrom, $limitnum, $lti, $info, $response) | |
| Get the JSON for members. More... | |
| get_name () | |
| Get the service name. More... | |
| get_permitted_scopes () | |
| Get the scope(s) permitted for the tool relevant to this service. More... | |
| get_resources () | |
| Get the resources for this service. More... | |
| get_tool_proxy () | |
| Get the tool proxy object. More... | |
| get_type () | |
| Get the type object. More... | |
| get_typeconfig () | |
| Get the type config array. More... | |
| is_allowed_in_context ($typeid, $courseid) | |
| Checks if there is a site tool or a course tool for this site. More... | |
| is_unsigned () | |
| Get whether the service requests need to be signed. More... | |
| 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. More... | |
| parse_value ($value) | |
| Parse a string for custom substitution parameter variables supported by this service's resources. More... | |
| stdClass | set_tool_proxy ($toolproxy) |
| Set the tool proxy object. More... | |
| stdClass | set_type ($type) |
| Set the LTI type object. More... | |
| array | set_typeconfig ($typeconfig) |
| Set the LTI type config object. More... | |
Static Public Member Functions | |
| static | get_service_path () |
| Get the path for service requests. More... | |
| static | get_users_json ($resource, $context, $contextid, $tool, $role, $limitfrom, $limitnum, $lti, $info) |
| Get the JSON for members. More... | |
Public Attributes | |
| const | ALWAYS_INCLUDE_FIELD = 1 |
| Always include field. | |
| const | CONTEXT_ROLE_INSTRUCTOR = 'http://purl.imsglobal.org/vocab/lis/v2/membership#Instructor' |
| Context-level role for Instructor. | |
| const | CONTEXT_ROLE_LEARNER = 'http://purl.imsglobal.org/vocab/lis/v2/membership#Learner' |
| Context-level role for Learner. | |
| const | CONTEXT_ROLE_PREFIX = 'http://purl.imsglobal.org/vocab/lis/v2/membership#' |
| Default prefix for context-level roles. | |
| const | DELEGATE_TO_INSTRUCTOR = 2 |
| Allow the instructor to decide if included. | |
| const | INSTRUCTOR_CAPABILITY = 'moodle/course:manageactivities' |
| Capability used to identify Instructors. | |
| const | INSTRUCTOR_DELEGATE_INCLUDED = array(self::DELEGATE_TO_INSTRUCTOR && self::INSTRUCTOR_INCLUDED) |
| Instructor delegated and approved for include. | |
| const | INSTRUCTOR_INCLUDED = 1 |
| Instructor chose to include field. | |
| const | LTI_VERSION2P0 = 'LTI-2p0' |
| Label representing an LTI 2 message type. | |
| const | SCOPE_MEMBERSHIPS_READ = 'https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly' |
| Scope for reading membership data. | |
| const | SERVICE_ENABLED = 1 |
| Service enabled. | |
Protected Attributes | |
| string | $id |
| ID for the service. | |
| string | $name |
| Human readable name for the service. | |
| array | $resources |
| Instances of the resources associated with this service. | |
| boolean | $unsigned |
true if requests for this service do not need to be signed. | |
A service implementing Memberships.
|
inherited |
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 |
|
inherited |
Check that the request has been properly signed.
| string | $toolproxyguid | Tool Proxy GUID |
| string | $body | Request body (null if none) |
| boolean |
|
inherited |
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 |
|
inherited |
Get the service compoent ID.
| string |
| ltiservice_memberships\local\service\memberships::get_configuration_options | ( | & | $mform | ) |
Adds form elements for membership add/edit page.
| MoodleQuickForm | $mform |
Reimplemented from mod_lti\local\ltiservice\service_base.
|
inherited |
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 |
|
inherited |
Get the service ID.
| string |
| ltiservice_memberships\local\service\memberships::get_launch_parameters | ( | $messagetype, | |
| $courseid, | |||
| $user, | |||
| $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 | $user | 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 | of key/value pairs to add as launch parameters. |
Reimplemented from mod_lti\local\ltiservice\service_base.
| ltiservice_memberships\local\service\memberships::get_members_json | ( | $resource, | |
| $context, | |||
| $course, | |||
| $role, | |||
| $limitfrom, | |||
| $limitnum, | |||
| $lti, | |||
| $info, | |||
| $response | |||
| ) |
Get the JSON for members.
| mod_lti\local\ltiservice\resource_base | $resource | Resource handling the request |
| context_course | $context | Course context |
| course | $course | Course |
| string | $role | User role requested (empty if none) |
| int | $limitfrom | Position of first record to be returned |
| int | $limitnum | Maximum number of records to be returned |
| object | $lti | LTI instance record |
| core_availability\info_module | $info | Conditional availability information for LTI instance (null if context-level request) |
| mod_lti\local\ltiservice\response | $response | Response object for the request |
| string |
|
inherited |
Get the service name.
| string |
| ltiservice_memberships\local\service\memberships::get_permitted_scopes | ( | ) |
Get the scope(s) permitted for the tool relevant to this service.
| array |
Reimplemented from mod_lti\local\ltiservice\service_base.
| ltiservice_memberships\local\service\memberships::get_resources | ( | ) |
Get the resources for this service.
| array |
Reimplemented from mod_lti\local\ltiservice\service_base.
|
staticinherited |
Get the path for service requests.
| string |
|
inherited |
Get the tool proxy object.
| stdClass |
|
inherited |
Get the type object.
| stdClass |
|
inherited |
Get the type config array.
| array|null |
|
static |
Get the JSON for members.
| mod_lti\local\ltiservice\resource_base | $resource | Resource handling the request |
| context_course | $context | Course context |
| string | $contextid | Course ID |
| object | $tool | Tool instance object |
| string | $role | User role requested (empty if none) |
| int | $limitfrom | Position of first record to be returned |
| int | $limitnum | Maximum number of records to be returned |
| object | $lti | LTI instance record |
| core_availability\info_module | $info | Conditional availability information for LTI instance (null if context-level request) |
| string |
|
inherited |
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. |
|
inherited |
Get whether the service requests need to be signed.
| boolean |
|
inherited |
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. |
|
inherited |
Parse a string for custom substitution parameter variables supported by this service's resources.
| string | $value | Value to be parsed |
| string |
|
inherited |
Set the tool proxy object.
| object | $toolproxy | The tool proxy for this service request |
|
inherited |
Set the LTI type object.
| object | $type | The LTI type for this service request |
|
inherited |
Set the LTI type config object.
| array | $typeconfig | The LTI type config for this service request |