Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Namespaces | |
namespace | mod_lti |
| |
namespace | mod_lti\analytics\indicator |
| |
namespace | mod_lti\event |
| |
namespace | mod_lti\external |
| |
namespace | mod_lti\local |
| |
namespace | mod_lti\local\ltiopenid |
| |
namespace | mod_lti\local\ltiservice |
| |
namespace | mod_lti\output |
| |
namespace | mod_lti\plugininfo |
| |
namespace | mod_lti\privacy |
| |
namespace | mod_lti\reportbuilder\local\entities |
| |
namespace | mod_lti\reportbuilder\local\systemreports |
| |
namespace | mod_lti\search |
| |
namespace | mod_lti\task |
| |
namespace | moodle\mod\lti |
| |
Functions | |
content_item_to_form (object $tool, object $typeconfig, object $item) | |
Converts LTI 1.1 Content Item for LTI Link to Form data. | |
get_course_history ($course) | |
Build the history chain for this course using the course originalcourseid. | |
get_tag ($tagname, $xpath, $attribute=null) | |
Search for a tag within an XML DOMDocument. | |
get_tool_proxy_edit_url (stdClass $proxy) | |
Returns the edit url for the given tool proxy. | |
get_tool_proxy_urls (stdClass $proxy) | |
Returns the icon and edit urls for the tool proxy. | |
get_tool_type_capability_groups ($type) | |
Returns a summary of each LTI capability this tool type requires in plain language. | |
get_tool_type_config ($type) | |
Returns information on the configuration of the tool type. | |
get_tool_type_course_url (stdClass $type) | |
Returns the course url for the given tool type. | |
get_tool_type_edit_url (stdClass $type) | |
Returns the edit url for the given tool type. | |
get_tool_type_icon_url (stdClass $type) | |
Returns the icon for the given tool type. | |
get_tool_type_instance_ids ($type) | |
Returns the ids of each instance of this tool type. | |
get_tool_type_state_info (stdClass $type) | |
Returns information on the current state of the tool type. | |
get_tool_type_urls (stdClass $type) | |
Returns the icon and edit urls for the tool type and the course url if it is a course type. | |
lti_accepts_grades ($ltiinstance) | |
lti_add_config ($config) | |
Add a tool configuration in the database. | |
lti_add_instance ($lti, $mform) | |
Given an object containing all the necessary data, (defined by the form in mod.html) this function will create a new instance and return the id number of the new instance. | |
lti_add_tool_proxy ($config) | |
Update the database with a tool proxy instance. | |
lti_add_type ($type, $config) | |
lti_build_content_item_selection_request ($id, $course, moodle_url $returnurl, $title='', $text='', $mediatypes=[], $presentationtargets=[], $autocreate=false, $multiple=true, $unsigned=false, $canconfirm=false, $copyadvice=false, $nonce='') | |
Builds a standard LTI Content-Item selection request. | |
lti_build_custom_parameters ($toolproxy, $tool, $instance, $params, $customstr, $instructorcustomstr, $islti2) | |
This function builds the custom parameters. | |
lti_build_login_request ($courseid, $cmid, $instance, $config, $messagetype, $foruserid=0, $title='', $text='') | |
Prepares an LTI 1.3 login request. | |
lti_build_registration_request ($toolproxy) | |
Gets the parameters for the regirstration request. | |
lti_build_request ($instance, $typeconfig, $course, $typeid=null, $islti2=false, $messagetype='basic-lti-launch-request', $foruserid=0) | |
This function builds the request that must be sent to the tool producer. | |
lti_build_request_lti2 ($tool, $params) | |
This function builds the request that must be sent to an LTI 2 tool provider. | |
lti_build_sourcedid ($instanceid, $userid, $servicesalt, $typeid=null, $launchid=null) | |
Build source ID. | |
lti_build_standard_message ($instance, $orgid, $ltiversion, $messagetype='basic-lti-launch-request') | |
This function builds the standard parameters for an LTI message that must be sent to the tool producer. | |
lti_build_standard_request ($instance, $orgid, $islti2, $messagetype='basic-lti-launch-request') | |
This function builds the standard parameters for an LTI 1 or 2 request that must be sent to the tool producer. | |
lti_calculate_custom_parameter ($value) | |
Calculates the value of a custom parameter that has not been specified earlier. | |
lti_check_updates_since (cm_info $cm, $from, $filter=array()) | |
Check if the module has any update that affects the current user since a given time. | |
lti_convert_content_items ($param) | |
Converts the new Deep-Linking format for Content-Items to the old format. | |
lti_convert_from_jwt ($typeid, $jwtparam) | |
Verfies the JWT and converts its claims to their equivalent message parameter. | |
lti_cron () | |
Function to be run periodically according to the moodle cron This function searches for things that need to be done, such as sending out mail, toggling flags etc ... | |
lti_delete_grade ($ltiinstance, $userid) | |
lti_delete_instance ($id) | |
Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it. | |
lti_delete_tool_proxy ($id) | |
Delete a Tool Proxy. | |
lti_delete_type ($id) | |
Delete a Basic LTI configuration. | |
lti_ensure_url_is_https ($url) | |
lti_extend_lti_services ($data) | |
Extend the LTI services through the ltisource plugins. | |
lti_filter_get_types ($course) | |
Returns all basicLTI tools configured by the administrator. | |
lti_filter_tool_proxy_types (array $toolproxies, $state) | |
Given an array of tool proxies, filter them based on their state. | |
lti_filter_tool_types (array $tools, $state) | |
Given an array of tools, filter them based on their state. | |
lti_force_type_config_settings ($instance, array $typeconfig) | |
Enforce type config settings onto the LTI instance. | |
lti_get_best_tool_by_url ($url, $tools, $courseid=null) | |
lti_get_capabilities () | |
Initializes an array with the capabilities supported by the LTI module. | |
lti_get_config ($ltiobject) | |
Transforms a basic LTI object to an array. | |
lti_get_configured_types ($courseid, $sectionreturn=0) | |
Returns a list of configured types in the given course. | |
lti_get_contexts ($json) | |
Extracts the named contexts from a tool proxy. | |
lti_get_course_content_items (\core_course\local\entity\content_item $defaultmodulecontentitem, stdClass $user, stdClass $course) | |
Return the preconfigured tools which are configured for inclusion in the activity picker. | |
lti_get_coursemodule_info ($coursemodule) | |
Given a coursemodule object, this function returns the extra information needed to print this activity in various places. | |
lti_get_custom_parameters ($toolproxy, $tool, $params, $parameters) | |
Adds the custom parameters to an array. | |
lti_get_domain_from_url ($url) | |
lti_get_enabled_capabilities ($tool) | |
Extracts the enabled capabilities into an array, including those implicitly declared in a parameter. | |
lti_get_fqid ($contexts, $id) | |
Converts an ID to a fully-qualified ID. | |
lti_get_ims_role ($user, $cmid, $courseid, $islti2) | |
Gets the IMS role string for the specified user and LTI course module. | |
lti_get_instance_type (object $instance) | |
Return the type of the instance, using domain matching if no explicit type is set. | |
lti_get_jwt_claim_mapping () | |
Return the mapping for standard message parameters to JWT claim. | |
lti_get_jwt_message_type_mapping () | |
Return the mapping for standard message types to JWT message_type claim. | |
lti_get_launch_container ($lti, $toolconfig) | |
lti_get_launch_data ($instance, $nonce='', $messagetype='basic-lti-launch-request', $foruserid=0) | |
Return the launch data required for opening the external tool. | |
lti_get_lti_types () | |
Returns available Basic LTI types. | |
lti_get_lti_types_and_proxies (int $limit=0, int $offset=0, bool $orphanedonly=false, int $toolproxyid=0) | |
Get both LTI tool proxies and tool types. | |
lti_get_lti_types_and_proxies_count (bool $orphanedonly=false, int $toolproxyid=0) | |
Get the total number of LTI tool types and tool proxies. | |
lti_get_lti_types_by_course ($courseid, $coursevisible=null) | |
Returns all lti types visible in this course. | |
lti_get_lti_types_from_proxy_id ($toolproxyid) | |
Returns available Basic LTI types that match the given tool proxy id. | |
lti_get_organizationid ($typeconfig) | |
get Organization ID using default if no value provided | |
lti_get_permitted_service_scopes ($type, $typeconfig) | |
Initializes an array with the scopes for services supported by the LTI module and authorized for this particular tool instance. | |
lti_get_post_actions () | |
Log post actions. | |
lti_get_response_xml ($codemajor, $description, $messageref, $messagetype) | |
lti_get_service_by_name ($servicename) | |
Initializes an instance of the named service. | |
lti_get_service_by_resource_id ($services, $resourceid) | |
Finds a service by id. | |
lti_get_services () | |
Initializes an array with the services supported by the LTI module. | |
lti_get_shared_secrets_by_key ($key) | |
lti_get_shortcuts () | |
lti_get_tool_by_url_match ($url, $courseid=null, $state=LTI_TOOL_STATE_CONFIGURED) | |
lti_get_tool_proxies ($orphanedonly) | |
Returns lti tool proxies. | |
lti_get_tool_proxies_from_registration_url ($regurl) | |
Get the tool proxy instance given its registration URL. | |
lti_get_tool_proxy ($id) | |
Generates some of the tool proxy configuration based on the admin configuration details. | |
lti_get_tool_proxy_config ($id) | |
Generates some of the tool proxy configuration based on the admin configuration details. | |
lti_get_tool_proxy_from_guid ($toolproxyguid) | |
Get the tool proxy instance given its GUID. | |
lti_get_tool_proxy_table ($toolproxies, $id) | |
This function builds the tab for a category of tool proxies. | |
lti_get_tool_settings ($toolproxyid, $courseid=null, $instanceid=null) | |
Gets the tool settings. | |
lti_get_tool_table ($tools, $id) | |
lti_get_tools_by_domain ($domain, $state=null, $courseid=null) | |
lti_get_tools_by_url ($url, $state, $courseid=null) | |
lti_get_type ($typeid) | |
lti_get_type_config ($typeid) | |
Returns configuration details for the tool. | |
lti_get_type_config_by_instance ($instance) | |
Fetches LTI type configuration for an LTI instance. | |
lti_get_type_config_from_instance ($id) | |
Generates some of the tool configuration based on the instance details. | |
lti_get_type_type_config ($id) | |
Generates some of the tool configuration based on the admin configuration details. | |
lti_get_types_for_add_instance () | |
Returns tool types for lti add instance and edit page. | |
lti_get_url_thumbprint ($url) | |
lti_get_view_actions () | |
Log view actions. | |
lti_grade_item_delete ($basiclti) | |
Delete grade item for given basiclti. | |
lti_grade_item_update ($basiclti, $grades=null) | |
Create grade item for given basiclti. | |
lti_grades ($basicltiid) | |
Must return an array of grades for a given instance of this module, indexed by user. | |
lti_initiate_login ($courseid, $cmid, $instance, $config, $messagetype='basic-lti-launch-request', $title='', $text='', $foruserid=0) | |
Generate the form for initiating a login request for an LTI 1.3 message. | |
lti_install () | |
Execute post-install custom actions for the module This function was added in 1.9. | |
lti_is_cartridge ($url) | |
Determines if the given url is for a IMS basic cartridge. | |
lti_launch_tool ($instance, $foruserid=0) | |
Launch an external tool activity. | |
lti_libxml_disable_entity_loader (bool $value) | |
Wrapper for function libxml_disable_entity_loader() deprecated in PHP 8. | |
lti_load_cartridge ($url, $map, $propertiesmap=array()) | |
Search for a tag within an XML DOMDocument. | |
lti_load_tool_from_cartridge ($url, $lti) | |
Allows you to load in the configuration for an external tool from an IMS cartridge. | |
lti_load_tool_if_cartridge ($lti) | |
Loads the cartridge information into the new tool, if the launch url is for a cartridge file. | |
lti_load_type_from_cartridge ($url, $type) | |
Allows you to load settings for an external tool type from an IMS cartridge. | |
lti_load_type_if_cartridge ($type) | |
Loads the cartridge information into the tool type, if the launch url is for a cartridge file. | |
lti_log_request ($rawbody) | |
Logs the request to a file in temp dir. | |
lti_log_response ($responsexml, $e=null) | |
Log an LTI response. | |
lti_map_keyname ($key, $tolower=true) | |
Used for building the names of the different custom parameters. | |
lti_new_access_token ($typeid, $scopes) | |
Create a new access token. | |
lti_parse_custom_parameter ($toolproxy, $tool, $params, $value, $islti2) | |
Parse a custom parameter to replace any substitution variables. | |
lti_parse_grade_delete_message ($xml) | |
lti_parse_grade_read_message ($xml) | |
lti_parse_grade_replace_message ($xml) | |
lti_parse_message_id ($xml) | |
lti_post_launch_html ($newparms, $endpoint, $debug=false) | |
Posts the launch petition HTML. | |
lti_prepare_type_for_save ($type, $config) | |
lti_print_recent_activity ($course, $isteacher, $timestart) | |
Given a course and a time, this module should find recent activity that has occurred in basiclti activities and print it out. | |
lti_read_grade ($ltiinstance, $userid) | |
lti_register ($toolproxy) | |
Prepares an LTI registration request message. | |
lti_request_is_using_ssl () | |
lti_scale_used () | |
lti_scale_used_anywhere ($scaleid) | |
Checks if scale is being used by any instance of basiclti. | |
lti_set_session_user ($userid) | |
Set the passed user ID to the session user. | |
lti_set_state_for_type ($id, $state) | |
lti_set_tool_settings ($settings, $toolproxyid, $courseid=null, $instanceid=null) | |
Sets the tool settings (. | |
lti_should_log_request ($rawbody) | |
Determines if we should try to log the request. | |
lti_sign_jwt ($parms, $endpoint, $oauthconsumerkey, $typeid=0, $nonce='') | |
Converts the message paramters to their equivalent JWT claim and signs the payload to launch the external tool using JWT. | |
lti_sign_parameters ($oldparms, $endpoint, $method, $oauthconsumerkey, $oauthconsumersecret) | |
Signs the petition to launch the external tool using OAuth. | |
lti_split_custom_parameters ($toolproxy, $tool, $params, $customstr, $islti2=false) | |
Splits the custom parameters field to the various parameters. | |
lti_split_parameters ($customstr) | |
Splits the custom parameters. | |
lti_supports ($feature) | |
List of features supported in URL module. | |
lti_tool_configuration_from_content_item ($typeid, $messagetype, $ltiversion, $consumerkey, $contentitemsjson) | |
Processes the tool provider's response to the ContentItemSelectionRequest and builds the configuration data from the selected content item. | |
lti_type_add_categories (int $typeid, string $lticoursecategories='') | |
Add LTI Type course category. | |
lti_uninstall () | |
Execute post-uninstall custom actions for the module This function was added in 1.9. | |
lti_update_config ($config) | |
Updates a tool configuration in the database. | |
lti_update_grade ($ltiinstance, $userid, $launchid, $gradeval) | |
lti_update_grades ($basiclti, $userid=0, $nullifnone=true) | |
Update activity grades. | |
lti_update_instance ($lti, $mform) | |
Given an object containing all the necessary data, (defined by the form in mod.html) this function will update an existing instance with new data. | |
lti_update_tool_proxy ($toolproxy) | |
Updates a tool proxy in the database. | |
lti_update_type ($type, $config) | |
lti_user_complete ($course, $user, $mod, $basiclti) | |
Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports. | |
lti_user_outline ($course, $user, $mod, $basiclti) | |
Return a small object with summary information about what a user has done with a given particular instance of this module Used for user activity reports. | |
lti_verify_jwt_signature ($typeid, $consumerkey, $jwtparam) | |
Verifies the JWT signature of an incoming message. | |
lti_verify_message ($key, $sharedsecrets, $body, $headers=null) | |
lti_verify_oauth_signature ($typeid, $consumerkey) | |
Verifies the OAuth signature of an incoming message. | |
lti_verify_sourcedid ($ltiinstance, $parsed) | |
Validate source ID from external request. | |
lti_verify_with_keyset ($jwtparam, $keyseturl, $clientid) | |
Verifies the JWT signature using a JWK keyset. | |
lti_view ($lti, $course, $cm, $context) | |
Mark the activity completed (if required) and trigger the course_module_viewed event. | |
mod_lti_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, int $userid=0) | |
This function receives a calendar event and returns the action associated with it, or null if there is none. | |
mod_lti_extend_navigation_course ($navigation, $course, $context) | |
Extend the course navigation with an "LTI External tools" link which redirects to a list of all tools available for course use. | |
mod_lti_get_all_content_items (\core_course\local\entity\content_item $defaultmodulecontentitem) | |
Return all content items which can be added to any course. | |
mod_lti_get_fontawesome_icon_map () | |
Get icon mapping for font-awesome. | |
mod_lti_verify_private_key () | |
This function checks if a private key has been generated for this site. | |
params_to_string (object $params) | |
Converts an array of custom parameters to a new line separated string. | |
serialise_tool_type (stdClass $type) | |
Serialises this tool type. | |
xmldb_lti_install () | |
Stub for database installation. | |
xmldb_lti_upgrade ($oldversion) | |
xmldb_lti_upgrade is the function that upgrades the lti module database when is needed | |
Variables | |
$capabilities | |
global | $CFG |
global | $CFG |
global | $CFG |
global | $CFG |
global | mod_lti\external::$CFG |
global | mod_lti\local\ltiservice::$CFG |
$definitions | |
$deprecatedcapabilities | |
$functions | |
moodle\mod\lti::$lastcomputedsignature = false | |
$logs | |
admin_settingpage | $modltifolder = new admin_category('modltifolder', new lang_string('pluginname', 'mod_lti'), $module->is_enabled() === false) |
$plugin = 2024041600 | |
$proxieslink | |
if($ADMIN->fulltree) | $settings = null |
$tasks | |
foreach(core_plugin_manager::instance() ->get_plugins_of_type('ltisource') as $plugin) | $toolproxiesurl = new moodle_url('/mod/lti/toolproxies.php') |
$plugin | component = 'mod_lti' |
$plugin | cron = 0 |
$settings | hidden = true |
const | LTI_ACCESS_TOKEN_LIFE 3600 |
const | LTI_COURSEVISIBLE_ACTIVITYCHOOSER 2 |
const | LTI_COURSEVISIBLE_NO 0 |
const | LTI_COURSEVISIBLE_PRECONFIGURED 1 |
const | LTI_DEFAULT_ORGID_SITEHOST 'SITEHOST' |
const | LTI_DEFAULT_ORGID_SITEID 'SITEID' |
const | LTI_ITEM_MODULE 'lti' |
const | LTI_ITEM_TYPE 'mod' |
const | LTI_JWK_KEYSET 'JWK_KEYSET' |
const | LTI_JWT_CLAIM_PREFIX 'https://purl.imsglobal.org/spec/lti' |
const | LTI_LAUNCH_CONTAINER_DEFAULT 1 |
const | LTI_LAUNCH_CONTAINER_EMBED 2 |
const | LTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS 3 |
const | LTI_LAUNCH_CONTAINER_REPLACE_MOODLE_WINDOW 5 |
const | LTI_LAUNCH_CONTAINER_WINDOW 4 |
const | LTI_RSA_KEY 'RSA_KEY' |
const | LTI_SETTING_ALWAYS 1 |
const | LTI_SETTING_DELEGATE 2 |
const | LTI_SETTING_NEVER 0 |
const | LTI_SOURCE 'mod/lti' |
const | LTI_TOOL_PROXY_STATE_ACCEPTED 3 |
const | LTI_TOOL_PROXY_STATE_CONFIGURED 1 |
const | LTI_TOOL_PROXY_STATE_PENDING 2 |
const | LTI_TOOL_PROXY_STATE_REJECTED 4 |
const | LTI_TOOL_PROXY_TAB 4 |
const | LTI_TOOL_STATE_ANY 0 |
const | LTI_TOOL_STATE_CONFIGURED 1 |
const | LTI_TOOL_STATE_PENDING 2 |
const | LTI_TOOL_STATE_REJECTED 3 |
const | LTI_URL_DOMAIN_REGEX '/(?:https?:\/\/)?(?:www\.)?([^\/]+)(?:\/|$)/i' |
const | LTI_VERSION_1 'LTI-1p0' |
const | LTI_VERSION_1P3 '1.3.0' |
const | LTI_VERSION_2 'LTI-2p0' |
$plugin | version = 2024042200 |
$settings | visiblename = new lang_string('manage_tools', 'mod_lti') |
content_item_to_form | ( | object | $tool, |
object | $typeconfig, | ||
object | $item ) |
get_course_history | ( | $course | ) |
Build the history chain for this course using the course originalcourseid.
object | $course | course for which the history is returned. |
array | ids of the source course in ancestry order, immediate parent 1st. |
get_tag | ( | $tagname, | |
$xpath, | |||
$attribute = null ) |
Search for a tag within an XML DOMDocument.
stdClass | $tagname | The name of the tag to search for |
XPath | $xpath | The XML to find the tag in |
XPath | $attribute | The attribute to search for (if we should search for a child node with the given value for the name attribute |
get_tool_proxy_edit_url | ( | stdClass | $proxy | ) |
Returns the edit url for the given tool proxy.
stdClass | $proxy | The tool proxy |
string | The url to edit the tool type |
get_tool_proxy_urls | ( | stdClass | $proxy | ) |
Returns the icon and edit urls for the tool proxy.
stdClass | $proxy | The tool proxy |
array | The urls of the tool proxy |
get_tool_type_capability_groups | ( | $type | ) |
Returns a summary of each LTI capability this tool type requires in plain language.
stdClass | $type | The tool type |
array | An array of text descriptions of each of the capabilities this tool type requires |
get_tool_type_config | ( | $type | ) |
Returns information on the configuration of the tool type.
stdClass | $type | The tool type |
array | An array with configuration details |
get_tool_type_course_url | ( | stdClass | $type | ) |
Returns the course url for the given tool type.
stdClass | $type | The tool type |
string | The url to the course of the tool type, void if it is a site wide type |
get_tool_type_edit_url | ( | stdClass | $type | ) |
Returns the edit url for the given tool type.
stdClass | $type | The tool type |
string | The url to edit the tool type |
get_tool_type_icon_url | ( | stdClass | $type | ) |
Returns the icon for the given tool type.
stdClass | $type | The tool type |
string | The url to the tool type's corresponding icon |
get_tool_type_instance_ids | ( | $type | ) |
Returns the ids of each instance of this tool type.
stdClass | $type | The tool type |
array | An array of ids of the instances of this tool type |
get_tool_type_state_info | ( | stdClass | $type | ) |
Returns information on the current state of the tool type.
stdClass | $type | The tool type |
array | An array with a text description of the state, and boolean for whether it is in each state: pending, configured, rejected, unknown |
get_tool_type_urls | ( | stdClass | $type | ) |
Returns the icon and edit urls for the tool type and the course url if it is a course type.
stdClass | $type | The tool type |
array | The urls of the tool type |
lti_add_config | ( | $config | ) |
Add a tool configuration in the database.
object | $config | Tool configuration |
int | Record id number |
lti_add_instance | ( | $lti, | |
$mform ) |
Given an object containing all the necessary data, (defined by the form in mod.html) this function will create a new instance and return the id number of the new instance.
object | $instance | An object from the form in mod.html |
int | The id of the newly inserted basiclti record |
lti_add_tool_proxy | ( | $config | ) |
Update the database with a tool proxy instance.
object | $config | Tool proxy definition |
int | Record id number |
lti_build_content_item_selection_request | ( | $id, | |
$course, | |||
moodle_url | $returnurl, | ||
$title = '', | |||
$text = '', | |||
$mediatypes = [], | |||
$presentationtargets = [], | |||
$autocreate = false, | |||
$multiple = true, | |||
$unsigned = false, | |||
$canconfirm = false, | |||
$copyadvice = false, | |||
$nonce = '' ) |
Builds a standard LTI Content-Item selection request.
int | $id | The tool type ID. |
stdClass | $course | The course object. |
moodle_url | $returnurl | The return URL in the tool consumer (TC) that the tool provider (TP) will use to return the Content-Item message. |
string | $title | The tool's title, if available. |
string | $text | The text to display to represent the content item. This value may be a long description of the content item. |
array | $mediatypes | Array of MIME types types supported by the TC. If empty, the TC will support ltilink by default. |
array | $presentationtargets | Array of ways in which the selected content item(s) can be requested to be opened (via the presentationDocumentTarget element for a returned content item). If empty, "frame", "iframe", and "window" will be supported by default. |
bool | $autocreate | Indicates whether any content items returned by the TP would be automatically persisted without |
bool | $multiple | Indicates whether the user should be permitted to select more than one item. False by default. any option for the user to cancel the operation. False by default. |
bool | $unsigned | Indicates whether the TC is willing to accept an unsigned return message, or not. A signed message should always be required when the content item is being created automatically in the TC without further interaction from the user. False by default. |
bool | $canconfirm | Flag for can_confirm parameter. False by default. |
bool | $copyadvice | Indicates whether the TC is able and willing to make a local copy of a content item. False by default. |
string | $nonce |
stdClass | The object containing the signed request parameters and the URL to the TP's Content-Item selection interface. |
moodle_exception | When the LTI tool type does not exist.` |
coding_exception | For invalid media type and presentation target parameters. |
lti_build_custom_parameters | ( | $toolproxy, | |
$tool, | |||
$instance, | |||
$params, | |||
$customstr, | |||
$instructorcustomstr, | |||
$islti2 ) |
This function builds the custom parameters.
object | $toolproxy | Tool proxy instance object |
object | $tool | Tool instance object |
object | $instance | Tool placement instance object |
array | $params | LTI launch parameters |
string | $customstr | Custom parameters defined for tool |
string | $instructorcustomstr | Custom parameters defined for this placement |
boolean | $islti2 | True if an LTI 2 tool is being launched |
array | Custom parameters |
lti_build_login_request | ( | $courseid, | |
$cmid, | |||
$instance, | |||
$config, | |||
$messagetype, | |||
$foruserid = 0, | |||
$title = '', | |||
$text = '' ) |
Prepares an LTI 1.3 login request.
int | $courseid | Course ID |
int | $cmid | Course Module instance ID |
stdClass | null | $instance | LTI instance |
stdClass | $config | Tool type configuration |
string | $messagetype | LTI message type |
int | $foruserid | Id of the user targeted by the launch |
string | $title | Title of content item |
string | $text | Description of content item |
array | Login request parameters |
lti_build_registration_request | ( | $toolproxy | ) |
Gets the parameters for the regirstration request.
object | $toolproxy | Tool Proxy instance object |
array | Registration request parameters |
lti_build_request | ( | $instance, | |
$typeconfig, | |||
$course, | |||
$typeid = null, | |||
$islti2 = false, | |||
$messagetype = 'basic-lti-launch-request', | |||
$foruserid = 0 ) |
This function builds the request that must be sent to the tool producer.
object | $instance | Basic LTI instance object |
array | $typeconfig | Basic LTI tool configuration |
object | $course | Course object |
int | null | $typeid | Basic LTI tool ID |
boolean | $islti2 | True if an LTI 2 tool is being launched |
string | $messagetype | LTI Message Type for this launch |
int | $foruserid | User targeted by this launch |
array | Request details |
lti_build_request_lti2 | ( | $tool, | |
$params ) |
This function builds the request that must be sent to an LTI 2 tool provider.
object | $tool | Basic LTI tool object |
array | $params | Custom launch parameters |
array | Request details |
lti_build_sourcedid | ( | $instanceid, | |
$userid, | |||
$servicesalt, | |||
$typeid = null, | |||
$launchid = null ) |
Build source ID.
int | $instanceid | |
int | $userid | |
string | $servicesalt | |
null | int | $typeid | |
null | int | $launchid |
stdClass |
lti_build_standard_message | ( | $instance, | |
$orgid, | |||
$ltiversion, | |||
$messagetype = 'basic-lti-launch-request' ) |
This function builds the standard parameters for an LTI message that must be sent to the tool producer.
stdClass | $instance | Basic LTI instance object |
string | $orgid | Organisation ID |
boolean | $ltiversion | LTI version to be used for tool messages |
string | $messagetype | The request message type. Defaults to basic-lti-launch-request if empty. |
array | Message parameters |
lti_build_standard_request | ( | $instance, | |
$orgid, | |||
$islti2, | |||
$messagetype = 'basic-lti-launch-request' ) |
This function builds the standard parameters for an LTI 1 or 2 request that must be sent to the tool producer.
stdClass | $instance | Basic LTI instance object |
string | $orgid | Organisation ID |
boolean | $islti2 | True if an LTI 2 tool is being launched |
string | $messagetype | The request message type. Defaults to basic-lti-launch-request if empty. |
array | Request details |
lti_calculate_custom_parameter | ( | $value | ) |
Calculates the value of a custom parameter that has not been specified earlier.
string | $value | Custom parameter value |
string | Calculated value of custom parameter |
lti_check_updates_since | ( | cm_info | $cm, |
$from, | |||
$filter = array() ) |
Check if the module has any update that affects the current user since a given time.
cm_info | $cm | course module data |
int | $from | the time to check updates from |
array | $filter | if we need to check only specific updates |
stdClass | an object with the different type of areas indicating if they were updated or not |
lti_convert_content_items | ( | $param | ) |
Converts the new Deep-Linking format for Content-Items to the old format.
string | $param | JSON string representing new Deep-Linking format |
string | JSON representation of content-items |
lti_convert_from_jwt | ( | $typeid, | |
$jwtparam ) |
Verfies the JWT and converts its claims to their equivalent message parameter.
int | $typeid | |
string | $jwtparam | JWT parameter |
array | message parameters |
moodle_exception |
lti_cron | ( | ) |
Function to be run periodically according to the moodle cron This function searches for things that need to be done, such as sending out mail, toggling flags etc ...
@uses $CFG
boolean |
lti_delete_instance | ( | $id | ) |
Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.
int | $id | Id of the module instance |
boolean | Success/Failure |
lti_delete_tool_proxy | ( | $id | ) |
Delete a Tool Proxy.
int | $id | Tool Proxy id |
lti_delete_type | ( | $id | ) |
Delete a Basic LTI configuration.
int | $id | Configuration id |
lti_extend_lti_services | ( | $data | ) |
Extend the LTI services through the ltisource plugins.
stdClass | $data | LTI request data |
bool |
coding_exception |
lti_filter_get_types | ( | $course | ) |
Returns all basicLTI tools configured by the administrator.
int | $course |
array |
lti_filter_tool_proxy_types | ( | array | $toolproxies, |
$state ) |
Given an array of tool proxies, filter them based on their state.
array | $toolproxies | An array of lti_tool_proxies records |
int | $state | One of the LTI_TOOL_PROXY_STATE_* constants |
array |
lti_filter_tool_types | ( | array | $tools, |
$state ) |
Given an array of tools, filter them based on their state.
array | $tools | An array of lti_types records |
int | $state | One of the LTI_TOOL_STATE_* constants |
array |
lti_force_type_config_settings | ( | $instance, | |
array | $typeconfig ) |
Enforce type config settings onto the LTI instance.
stdClass | $instance | |
array | $typeconfig |
lti_get_capabilities | ( | ) |
Initializes an array with the capabilities supported by the LTI module.
array | List of capability names (without a dollar sign prefix) |
lti_get_config | ( | $ltiobject | ) |
Transforms a basic LTI object to an array.
object | $ltiobject | Basic LTI object |
array | Basic LTI configuration details |
lti_get_configured_types | ( | $courseid, | |
$sectionreturn = 0 ) |
Returns a list of configured types in the given course.
int | $courseid | The id of the course to retieve types for |
int | $sectionreturn | section to return to for forming the URLs |
array | Array of lti types. Each element is object with properties: name, title, icon, help, helplink, link |
lti_get_contexts | ( | $json | ) |
Extracts the named contexts from a tool proxy.
object | $json |
array | Contexts |
lti_get_course_content_items | ( | \core_course\local\entity\content_item | $defaultmodulecontentitem, |
stdClass | $user, | ||
stdClass | $course ) |
Return the preconfigured tools which are configured for inclusion in the activity picker.
core_course\local\entity\content_item | $defaultmodulecontentitem | reference to the content item for the LTI module. |
stdClass | $user | the user object, to use for cap checks if desired. |
stdClass | $course | the course to scope items to. |
array | the array of content items. |
lti_get_coursemodule_info | ( | $coursemodule | ) |
Given a coursemodule object, this function returns the extra information needed to print this activity in various places.
For this module we just need to support external urls as activity icons
stdClass | $coursemodule |
cached_cm_info | info |
lti_get_custom_parameters | ( | $toolproxy, | |
$tool, | |||
$params, | |||
$parameters ) |
Adds the custom parameters to an array.
object | $toolproxy | Tool proxy instance object |
object | $tool | Tool instance object |
array | $params | LTI launch parameters |
array | $parameters | Array containing the parameters |
array | Array of custom parameters |
lti_get_enabled_capabilities | ( | $tool | ) |
Extracts the enabled capabilities into an array, including those implicitly declared in a parameter.
object | $tool | Tool instance object |
array | List of enabled capabilities |
lti_get_fqid | ( | $contexts, | |
$id ) |
Converts an ID to a fully-qualified ID.
array | $contexts | |
string | $id |
string | Fully-qualified ID |
lti_get_ims_role | ( | $user, | |
$cmid, | |||
$courseid, | |||
$islti2 ) |
Gets the IMS role string for the specified user and LTI course module.
mixed | $user | User object or user id |
int | $cmid | The course module id of the LTI activity |
int | $courseid | The course id of the LTI activity |
boolean | $islti2 | True if an LTI 2 tool is being launched |
string | A role string suitable for passing with an LTI launch |
lti_get_instance_type | ( | object | $instance | ) |
Return the type of the instance, using domain matching if no explicit type is set.
object | $instance | the external tool activity settings |
object|null |
lti_get_jwt_claim_mapping | ( | ) |
Return the mapping for standard message parameters to JWT claim.
array |
lti_get_jwt_message_type_mapping | ( | ) |
Return the mapping for standard message types to JWT message_type claim.
array |
lti_get_launch_data | ( | $instance, | |
$nonce = '', | |||
$messagetype = 'basic-lti-launch-request', | |||
$foruserid = 0 ) |
Return the launch data required for opening the external tool.
stdClass | $instance | the external tool activity settings |
string | $nonce | the nonce value to use (applies to LTI 1.3 only) |
array | the endpoint URL and parameters (including the signature) |
lti_get_lti_types | ( | ) |
Returns available Basic LTI types.
array | of basicLTI types |
lti_get_lti_types_and_proxies | ( | int | $limit = 0, |
int | $offset = 0, | ||
bool | $orphanedonly = false, | ||
int | $toolproxyid = 0 ) |
Get both LTI tool proxies and tool types.
If limit and offset are not zero, a subset of the tools will be returned. Tool proxies will be counted before tool types. For example: If 10 tool proxies and 10 tool types exist, and the limit is set to 15, then 10 proxies and 5 types will be returned.
int | $limit | Maximum number of tools returned. |
int | $offset | Do not return tools before offset index. |
bool | $orphanedonly | If true, only return orphaned proxies. |
int | $toolproxyid | If not 0, only return tool types that have this tool proxy id. |
array | list(proxies[], types[]) List containing array of tool proxies and array of tool types. |
lti_get_lti_types_and_proxies_count | ( | bool | $orphanedonly = false, |
int | $toolproxyid = 0 ) |
Get the total number of LTI tool types and tool proxies.
bool | $orphanedonly | If true, only count orphaned proxies. |
int | $toolproxyid | If not 0, only count tool types that have this tool proxy id. |
int | Count of tools. |
lti_get_lti_types_by_course | ( | $courseid, | |
$coursevisible = null ) |
Returns all lti types visible in this course.
int | $courseid | The id of the course to retieve types for |
array | $coursevisible | options for 'coursevisible' field, default [LTI_COURSEVISIBLE_PRECONFIGURED, LTI_COURSEVISIBLE_ACTIVITYCHOOSER] |
stdClass[] | All the lti types visible in the given course |
lti_get_lti_types_from_proxy_id | ( | $toolproxyid | ) |
Returns available Basic LTI types that match the given tool proxy id.
int | $toolproxyid | Tool proxy id |
array | of basicLTI types |
lti_get_organizationid | ( | $typeconfig | ) |
get Organization ID using default if no value provided
object | $typeconfig |
string |
lti_get_permitted_service_scopes | ( | $type, | |
$typeconfig ) |
Initializes an array with the scopes for services supported by the LTI module and authorized for this particular tool instance.
object | $type | LTI tool type |
array | $typeconfig | LTI tool type configuration |
array | List of scopes |
lti_get_post_actions | ( | ) |
Log post actions.
array |
lti_get_service_by_name | ( | $servicename | ) |
Initializes an instance of the named service.
string | $servicename | Name of service |
bool|mod_lti\local\ltiservice\service_base | Service |
lti_get_service_by_resource_id | ( | $services, | |
$resourceid ) |
Finds a service by id.
mod_lti\local\ltiservice\service_base[] | $services | Array of services |
string | $resourceid | ID of resource |
mod_lti\local\ltiservice\service_base | Service |
lti_get_services | ( | ) |
Initializes an array with the services supported by the LTI module.
array | List of services |
lti_get_shortcuts | ( | ) |
lti_get_tool_proxies | ( | $orphanedonly | ) |
Returns lti tool proxies.
bool | $orphanedonly | Only retrieves tool proxies that have no type associated with them |
array | of basicLTI types |
lti_get_tool_proxies_from_registration_url | ( | $regurl | ) |
Get the tool proxy instance given its registration URL.
string | $regurl | Tool proxy registration URL |
array | The record of the tool proxy with this url |
lti_get_tool_proxy | ( | $id | ) |
Generates some of the tool proxy configuration based on the admin configuration details.
int | $id |
mixed | Tool Proxy details |
lti_get_tool_proxy_config | ( | $id | ) |
Generates some of the tool proxy configuration based on the admin configuration details.
int | $id |
mixed | Tool Proxy details |
lti_get_tool_proxy_from_guid | ( | $toolproxyguid | ) |
Get the tool proxy instance given its GUID.
string | $toolproxyguid | Tool proxy GUID value |
object |
lti_get_tool_proxy_table | ( | $toolproxies, | |
$id ) |
This function builds the tab for a category of tool proxies.
object | $toolproxies | Tool proxy instance objects |
string | $id | Category ID |
string | HTML for tab |
lti_get_tool_settings | ( | $toolproxyid, | |
$courseid = null, | |||
$instanceid = null ) |
Gets the tool settings.
int | $toolproxyid | Id of tool proxy record (or tool ID if negative) |
int | $courseid | Id of course (null if system settings) |
int | $instanceid | Id of course module (null if system or context settings) |
array | Array settings |
lti_get_type_config | ( | $typeid | ) |
Returns configuration details for the tool.
int | $typeid | Basic LTI tool typeid |
array | Tool Configuration |
lti_get_type_config_by_instance | ( | $instance | ) |
Fetches LTI type configuration for an LTI instance.
stdClass | $instance |
array | Can be empty if no type is found |
lti_get_type_config_from_instance | ( | $id | ) |
Generates some of the tool configuration based on the instance details.
int | $id |
object | configuration |
lti_get_type_type_config | ( | $id | ) |
Generates some of the tool configuration based on the admin configuration details.
int | $id |
stdClass | Configuration details |
lti_get_types_for_add_instance | ( | ) |
Returns tool types for lti add instance and edit page.
array | Array of lti types |
lti_get_view_actions | ( | ) |
Log view actions.
array |
lti_grade_item_delete | ( | $basiclti | ) |
Delete grade item for given basiclti.
object | $basiclti | object |
object | basiclti |
lti_grade_item_update | ( | $basiclti, | |
$grades = null ) |
Create grade item for given basiclti.
object | $basiclti | object with extra cmidnumber |
mixed | optional array/object of grade(s); 'reset' means reset grades in gradebook |
int | 0 if ok, error code otherwise |
lti_grades | ( | $basicltiid | ) |
Must return an array of grades for a given instance of this module, indexed by user.
It also returns a maximum allowed grade.
Example: $return->grades = array of grades; $return->maxgrade = maximum allowed grade;
return $return;
int | $basicltiid | ID of an instance of this module |
mixed | Null or object with an array of grades and with the maximum grade |
@TODO: implement this moodle function (if needed)
lti_initiate_login | ( | $courseid, | |
$cmid, | |||
$instance, | |||
$config, | |||
$messagetype = 'basic-lti-launch-request', | |||
$title = '', | |||
$text = '', | |||
$foruserid = 0 ) |
Generate the form for initiating a login request for an LTI 1.3 message.
int | $courseid | Course ID |
int | $cmid | LTI instance ID |
stdClass | null | $instance | LTI instance |
stdClass | $config | Tool type configuration |
string | $messagetype | LTI message type |
string | $title | Title of content item |
string | $text | Description of content item |
int | $foruserid | Id of the user targeted by the launch |
string |
lti_install | ( | ) |
Execute post-install custom actions for the module This function was added in 1.9.
boolean | true if success, false on error |
lti_is_cartridge | ( | $url | ) |
Determines if the given url is for a IMS basic cartridge.
string | $url | The url to be checked |
True | if the url is for a cartridge |
lti_launch_tool | ( | $instance, | |
$foruserid = 0 ) |
Launch an external tool activity.
stdClass | $instance | the external tool activity settings |
int | $foruserid | for user param, optional |
string | The HTML code containing the javascript code for the launch |
lti_libxml_disable_entity_loader | ( | bool | $value | ) |
Wrapper for function libxml_disable_entity_loader() deprecated in PHP 8.
Method was deprecated in PHP 8 and it shows deprecation message. However it is still required in the previous versions on PHP. While Moodle supports both PHP 7 and 8 we need to keep it.
bool | $value |
bool |
lti_load_cartridge | ( | $url, | |
$map, | |||
$propertiesmap = array() ) |
Search for a tag within an XML DOMDocument.
string | $url | The url of the cartridge to be loaded |
array | $map | The map of tags to keys in the return array |
array | $propertiesmap | The map of properties to keys in the return array |
array | An associative array with the given keys and their values from the cartridge |
moodle_exception | if the cartridge could not be loaded correctly |
lti_load_tool_from_cartridge | ( | $url, | |
$lti ) |
Allows you to load in the configuration for an external tool from an IMS cartridge.
string | $url | The URL to the cartridge |
stdClass | $lti | LTI object |
moodle_exception | if the cartridge could not be loaded correctly |
lti_load_tool_if_cartridge | ( | $lti | ) |
Loads the cartridge information into the new tool, if the launch url is for a cartridge file.
stdClass | $lti | The tools config |
lti_load_type_from_cartridge | ( | $url, | |
$type ) |
Allows you to load settings for an external tool type from an IMS cartridge.
string | $url | The URL to the cartridge |
stdClass | $type | The tool type object to be filled in |
moodle_exception | if the cartridge could not be loaded correctly |
lti_load_type_if_cartridge | ( | $type | ) |
Loads the cartridge information into the tool type, if the launch url is for a cartridge file.
stdClass | $type | The tool type object to be filled in |
lti_log_request | ( | $rawbody | ) |
Logs the request to a file in temp dir.
string | $rawbody |
lti_log_response | ( | $responsexml, | |
$e = null ) |
Log an LTI response.
string | $responsexml | The response XML |
Exception | $e | If there was an exception, pass that too |
lti_map_keyname | ( | $key, | |
$tolower = true ) |
Used for building the names of the different custom parameters.
string | $key | Parameter name |
bool | $tolower | Do we want to convert the key into lower case? |
string | Processed name |
lti_new_access_token | ( | $typeid, | |
$scopes ) |
Create a new access token.
int | $typeid | Tool type ID |
string[] | $scopes | Scopes permitted for new token |
stdClass | Access token |
lti_parse_custom_parameter | ( | $toolproxy, | |
$tool, | |||
$params, | |||
$value, | |||
$islti2 ) |
Parse a custom parameter to replace any substitution variables.
object | $toolproxy | Tool proxy instance object |
object | $tool | Tool instance object |
array | $params | LTI launch parameters |
string | $value | Custom parameter value |
boolean | $islti2 | True if an LTI 2 tool is being launched |
string | Parsed value of custom parameter |
lti_post_launch_html | ( | $newparms, | |
$endpoint, | |||
$debug = false ) |
Posts the launch petition HTML.
array | $newparms | Signed parameters |
string | $endpoint | URL of the external tool |
bool | $debug | Debug (true/false) |
string |
lti_print_recent_activity | ( | $course, | |
$isteacher, | |||
$timestart ) |
Given a course and a time, this module should find recent activity that has occurred in basiclti activities and print it out.
Return true if there was output, or false is there was none.
@uses $CFG
boolean | @TODO: implement this moodle function |
lti_register | ( | $toolproxy | ) |
Prepares an LTI registration request message.
object | $toolproxy | Tool Proxy instance object |
lti_scale_used | ( | ) |
lti_scale_used_anywhere | ( | $scaleid | ) |
Checks if scale is being used by any instance of basiclti.
This function was added in 1.9
This is used to find out if scale used anywhere
$scaleid | int |
boolean | True if the scale is used by any basiclti |
lti_set_session_user | ( | $userid | ) |
Set the passed user ID to the session user.
int | $userid |
lti_set_tool_settings | ( | $settings, | |
$toolproxyid, | |||
$courseid = null, | |||
$instanceid = null ) |
Sets the tool settings (.
array | $settings | Array of settings |
int | $toolproxyid | Id of tool proxy record (or tool ID if negative) |
int | $courseid | Id of course (null if system settings) |
int | $instanceid | Id of course module (null if system or context settings) |
lti_should_log_request | ( | $rawbody | ) |
Determines if we should try to log the request.
string | $rawbody |
bool |
lti_sign_jwt | ( | $parms, | |
$endpoint, | |||
$oauthconsumerkey, | |||
$typeid = 0, | |||
$nonce = '' ) |
Converts the message paramters to their equivalent JWT claim and signs the payload to launch the external tool using JWT.
array | $parms | Parameters to be passed for signing |
string | $endpoint | url of the external tool |
string | $oauthconsumerkey | |
string | $typeid | ID of LTI tool type |
string | $nonce | Nonce value to use |
array|null |
lti_sign_parameters | ( | $oldparms, | |
$endpoint, | |||
$method, | |||
$oauthconsumerkey, | |||
$oauthconsumersecret ) |
Signs the petition to launch the external tool using OAuth.
array | $oldparms | Parameters to be passed for signing |
string | $endpoint | url of the external tool |
string | $method | Method for sending the parameters (e.g. POST) |
string | $oauthconsumerkey | |
string | $oauthconsumersecret |
array|null |
lti_split_custom_parameters | ( | $toolproxy, | |
$tool, | |||
$params, | |||
$customstr, | |||
$islti2 = false ) |
Splits the custom parameters field to the various parameters.
object | $toolproxy | Tool proxy instance object |
object | $tool | Tool instance object |
array | $params | LTI launch parameters |
string | $customstr | String containing the parameters |
boolean | $islti2 | True if an LTI 2 tool is being launched |
array | of custom parameters |
lti_split_parameters | ( | $customstr | ) |
Splits the custom parameters.
string | $customstr | String containing the parameters |
array | of custom parameters |
lti_supports | ( | $feature | ) |
List of features supported in URL module.
string | $feature | FEATURE_xx constant for requested feature |
mixed | True if module supports feature, false if not, null if doesn't know or string for the module purpose. |
lti_tool_configuration_from_content_item | ( | $typeid, | |
$messagetype, | |||
$ltiversion, | |||
$consumerkey, | |||
$contentitemsjson ) |
Processes the tool provider's response to the ContentItemSelectionRequest and builds the configuration data from the selected content item.
This configuration data can be then used when adding a tool into the course.
int | $typeid | The tool type ID. |
string | $messagetype | The value for the lti_message_type parameter. |
string | $ltiversion | The value for the lti_version parameter. |
string | $consumerkey | The consumer key. |
string | $contentitemsjson | The JSON string for the content_items parameter. |
stdClass | The array of module information objects. |
moodle_exception | |
lti\OAuthException |
lti_type_add_categories | ( | int | $typeid, |
string | $lticoursecategories = '' ) |
Add LTI Type course category.
int | $typeid | |
string | $lticoursecategories | Comma separated list of course categories. |
void |
lti_uninstall | ( | ) |
Execute post-uninstall custom actions for the module This function was added in 1.9.
boolean | true if success, false on error |
lti_update_config | ( | $config | ) |
Updates a tool configuration in the database.
object | $config | Tool configuration |
mixed | Record id number |
lti_update_grades | ( | $basiclti, | |
$userid = 0, | |||
$nullifnone = true ) |
Update activity grades.
stdClass | $basiclti | The LTI instance |
int | $userid | Specific user only, 0 means all. |
bool | $nullifnone | Not used |
lti_update_instance | ( | $lti, | |
$mform ) |
Given an object containing all the necessary data, (defined by the form in mod.html) this function will update an existing instance with new data.
object | $instance | An object from the form in mod.html |
boolean | Success/Fail |
lti_update_tool_proxy | ( | $toolproxy | ) |
Updates a tool proxy in the database.
object | $toolproxy | Tool proxy |
int | Record id number |
lti_user_complete | ( | $course, | |
$user, | |||
$mod, | |||
$basiclti ) |
Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports.
boolean | @TODO: implement this moodle function (if needed) |
lti_user_outline | ( | $course, | |
$user, | |||
$mod, | |||
$basiclti ) |
Return a small object with summary information about what a user has done with a given particular instance of this module Used for user activity reports.
$return->time = the time they did it $return->info = a short text description
null | @TODO: implement this moodle function (if needed) |
lti_verify_jwt_signature | ( | $typeid, | |
$consumerkey, | |||
$jwtparam ) |
Verifies the JWT signature of an incoming message.
int | $typeid | The tool type ID. |
string | $consumerkey | The consumer key. |
string | $jwtparam | JWT parameter value |
stdClass | Tool type |
moodle_exception | |
UnexpectedValueException | Provided JWT was invalid |
SignatureInvalidException | Provided JWT was invalid because the signature verification failed |
BeforeValidException | Provided JWT is trying to be used before it's eligible as defined by 'nbf' |
BeforeValidException | Provided JWT is trying to be used before it's been created as defined by 'iat' |
ExpiredException | Provided JWT has since expired, as defined by the 'exp' claim |
lti_verify_oauth_signature | ( | $typeid, | |
$consumerkey ) |
Verifies the OAuth signature of an incoming message.
int | $typeid | The tool type ID. |
string | $consumerkey | The consumer key. |
stdClass | Tool type |
moodle_exception | |
lti\OAuthException |
lti_verify_sourcedid | ( | $ltiinstance, | |
$parsed ) |
Validate source ID from external request.
object | $ltiinstance | |
object | $parsed |
Exception |
lti_verify_with_keyset | ( | $jwtparam, | |
$keyseturl, | |||
$clientid ) |
Verifies the JWT signature using a JWK keyset.
string | $jwtparam | JWT parameter value. |
string | $keyseturl | The tool keyseturl. |
string | $clientid | The tool client id. |
object | The JWT's payload as a PHP object |
moodle_exception | |
UnexpectedValueException | Provided JWT was invalid |
SignatureInvalidException | Provided JWT was invalid because the signature verification failed |
BeforeValidException | Provided JWT is trying to be used before it's eligible as defined by 'nbf' |
BeforeValidException | Provided JWT is trying to be used before it's been created as defined by 'iat' |
ExpiredException | Provided JWT has since expired, as defined by the 'exp' claim |
lti_view | ( | $lti, | |
$course, | |||
$cm, | |||
$context ) |
Mark the activity completed (if required) and trigger the course_module_viewed event.
stdClass | $lti | lti object |
stdClass | $course | course object |
stdClass | $cm | course module object |
stdClass | $context | context object |
mod_lti_core_calendar_provide_event_action | ( | calendar_event | $event, |
core_calendar\action_factory | $factory, | ||
int | $userid = 0 ) |
This function receives a calendar event and returns the action associated with it, or null if there is none.
This is used by block_myoverview in order to display the event appropriately. If null is returned then the event is not displayed on the block.
calendar_event | $event | |
core_calendar\action_factory | $factory | |
int | $userid | User id to use for all capability checks, etc. Set to 0 for current user (default). |
core_calendar\local\event\entities\action_interface|null |
mod_lti_extend_navigation_course | ( | $navigation, | |
$course, | |||
$context ) |
Extend the course navigation with an "LTI External tools" link which redirects to a list of all tools available for course use.
settings_navigation | $navigation | The settings navigation object |
stdClass | $course | The course |
stdclass | $context | Course context |
void |
mod_lti_get_all_content_items | ( | \core_course\local\entity\content_item | $defaultmodulecontentitem | ) |
Return all content items which can be added to any course.
core_course\local\entity\content_item | $defaultmodulecontentitem |
array | the array of content items. |
mod_lti_verify_private_key | ( | ) |
This function checks if a private key has been generated for this site.
If the key does not exist it generates a new one. If the openssl extension is not installed or configured properly it returns a warning message.
string | A warning message if a private key does not exist and cannot be generated. |
params_to_string | ( | object | $params | ) |
Converts an array of custom parameters to a new line separated string.
object | $params | list of params to concatenate |
string |
serialise_tool_type | ( | stdClass | $type | ) |
Serialises this tool type.
stdClass | $type | The tool type |
array | An array of values representing this type |
xmldb_lti_upgrade | ( | $oldversion | ) |
xmldb_lti_upgrade is the function that upgrades the lti module database when is needed
This function is automaticly called when version number in version.php changes.
int | $oldversion | New old version number. |
boolean |
$definitions |
$deprecatedcapabilities |
$logs |
$proxieslink |
$tasks |