|
Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Files | |
| file | access.php |
| This file contains the capabilities used by the lti module. | |
| file | activity.php |
| Search area for mod_lti activities. | |
| file | activity_base.php |
| Activity base class. | |
| file | backup_lti_activity_task.class.php |
| Defines backup_lti_activity_task class. | |
| file | backup_lti_stepslib.php |
| This file contains all the backup steps that will be used by the backup_lti_activity_task. | |
| file | clean_access_tokens.php |
| A scheduled task for lti module. | |
| file | cognitive_depth.php |
| Cognitive depth indicator - lti. | |
| file | course_module_instance_list_viewed.php |
| The mod_lti instance list viewed event. | |
| file | course_module_viewed.php |
| The mod_lti course module viewed event. | |
| file | edit_form.php |
| This file defines de main basiclti configuration form. | |
| file | external.php |
| External tool module external API. | |
| file | external_registration_return_page.php |
| Class containing data for external registration return page. | |
| file | install.php |
| Post installation and migration code. | |
| file | lib.php |
| mod_lti data generator | |
| file | lib.php |
| This file contains a library of functions and constants for the lti module. | |
| file | lib.php |
| 1.9 to 2.0 backup format converter. | |
| file | locallib.php |
| This file contains the library of functions and constants for the lti module. | |
| file | log.php |
| LTI web service endpoints. | |
| file | ltiservice.php |
| LTI service plugin info. | |
| file | ltisource.php |
| LTI source plugin info. | |
| file | mod_form.php |
| This file defines the main lti configuration form. | |
| file | provider.php |
| Privacy Subsystem implementation for mod_lti. | |
| file | register_form.php |
| This file defines the main tool registration configuration form. | |
| file | renamedclasses.php |
| Lists renamed classes so that the autoloader can make the old names still work. | |
| file | renamedclasses.php |
| Lists renamed classes so that the autoloader can make the old names still work. | |
| file | renamedclasses.php |
| Lists renamed classes so that the autoloader can make the old names still work. | |
| file | renamedclasses.php |
| Lists renamed classes so that the autoloader can make the old names still work. | |
| file | renderer.php |
| Renderer class for template library. | |
| file | resource_base.php |
| This file contains an abstract definition of an LTI resource. | |
| file | response.php |
| This file contains an abstract definition of an LTI service. | |
| file | restore_lti_activity_task.class.php |
| This file contains the lti module restore class. | |
| file | restore_lti_stepslib.php |
| This file contains all the restore steps that will be used by the restore_lti_activity_task. | |
| file | service_base.php |
| This file contains an abstract definition of an LTI service. | |
| file | service_exception_handler.php |
| Exception handler for LTI services. | |
| file | servicelib.php |
| Utility code for LTI service handling. | |
| file | services.php |
| External tool external functions and service definitions. | |
| file | settings.php |
| This file defines the global lti administration form. | |
| file | social_breadth.php |
| Social breadth indicator - lti. | |
| file | tasks.php |
| This file defines tasks performed by the plugin. | |
| file | tool_configure_page.php |
| Class containing data for tool_configure page. | |
| file | TrivialStore.php |
| This file contains a Trivial memory-based store - no support for tokens. | |
| file | unknown_service_api_called.php |
| The mod_lti unknown service api called event. | |
| file | upgrade.php |
| This file keeps track of upgrades to the lti module. | |
| file | upgradelib.php |
| This file contains functions used by upgrade and install. | |
| file | version.php |
| This file defines the version of lti. | |
Namespaces | |
| mod_lti | |
| | |
| mod_lti\analytics\indicator | |
| | |
| mod_lti\event | |
| | |
| mod_lti\local\ltiservice | |
| | |
| mod_lti\output | |
| | |
| mod_lti\plugininfo | |
| | |
| mod_lti\privacy | |
| | |
| mod_lti\search | |
| | |
| mod_lti\task | |
| | |
| moodle\mod\lti | |
| | |
Classes | |
| class | backup_lti_activity_structure_step |
| Define the complete assignment structure for backup, with file and id annotations. More... | |
| class | backup_lti_activity_task |
| Provides the steps to perform one complete backup of the LTI instance. More... | |
| class | mod_lti\analytics\indicator\activity_base |
| Activity base class. More... | |
| class | mod_lti\analytics\indicator\cognitive_depth |
| Cognitive depth indicator - lti. More... | |
| class | mod_lti\analytics\indicator\social_breadth |
| Social breadth indicator - lti. More... | |
| class | mod_lti\event\course_module_instance_list_viewed |
| The mod_lti instance list viewed event class. More... | |
| class | mod_lti\event\course_module_viewed |
| The mod_lti course module viewed event class. More... | |
| class | mod_lti\event\unknown_service_api_called |
| The mod_lti unknown service api called event class. More... | |
| class | mod_lti\local\ltiservice\resource_base |
| The mod_lti\local\ltiservice\resource_base class. More... | |
| class | mod_lti\local\ltiservice\response |
| The mod_lti\local\ltiservice\response class. More... | |
| class | mod_lti\local\ltiservice\service_base |
| The mod_lti\local\ltiservice\service_base class. More... | |
| class | mod_lti\output\external_registration_return_page |
| Class containing data for tool_configure page. More... | |
| class | mod_lti\output\renderer |
| Renderer class for template library. More... | |
| class | mod_lti\output\tool_configure_page |
| Class containing data for tool_configure page. More... | |
| class | mod_lti\plugininfo\ltiservice |
| The mod_lti\plugininfo\ltiservice class. More... | |
| class | mod_lti\plugininfo\ltisource |
| class | mod_lti\privacy\provider |
| Privacy Subsystem implementation for mod_lti. More... | |
| class | mod_lti\search\activity |
| Search area for mod_lti activities. More... | |
| class | mod_lti\service_exception_handler |
| Handles exceptions when handling incoming LTI messages. More... | |
| class | mod_lti\task\clean_access_tokens |
| Class containing the scheduled task for lti module. More... | |
| class | mod_lti_edit_types_form |
| LTI Edit Form. More... | |
| class | mod_lti_external |
| class | mod_lti_generator |
| class | mod_lti_mod_form |
| class | mod_lti_register_types_form |
| The mod_lti_register_types_form class. More... | |
| class | moodle1_mod_lti_handler |
| class | moodle\mod\lti\TrivialOAuthDataStore |
| A Trivial memory-based store - no support for tokens. More... | |
| class | restore_lti_activity_structure_step |
| Structure step to restore one lti activity. More... | |
| class | restore_lti_activity_task |
| basiclti restore task that provides all the settings and steps to perform one complete restore of the activity More... | |
Functions | |
| get_tag ($tagname, $xpath, $attribute=null) | |
| Search for a tag within an XML DOMDocument. More... | |
| get_tool_proxy_edit_url (stdClass $proxy) | |
| Returns the edit url for the given tool proxy. More... | |
| get_tool_proxy_urls (stdClass $proxy) | |
| Returns the icon and edit urls for the tool proxy. More... | |
| get_tool_type_capability_groups ($type) | |
| Returns a summary of each LTI capability this tool type requires in plain language. More... | |
| get_tool_type_config ($type) | |
| Returns information on the configuration of the tool type. More... | |
| get_tool_type_course_url (stdClass $type) | |
| Returns the course url for the given tool type. More... | |
| get_tool_type_edit_url (stdClass $type) | |
| Returns the edit url for the given tool type. More... | |
| get_tool_type_icon_url (stdClass $type) | |
| Returns the icon for the given tool type. More... | |
| get_tool_type_instance_ids ($type) | |
| Returns the ids of each instance of this tool type. More... | |
| get_tool_type_state_info (stdClass $type) | |
| Returns information on the current state of the tool type. More... | |
| 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. More... | |
| lti_accepts_grades ($ltiinstance) | |
| lti_add_config ($config) | |
| Add a tool configuration in the database. More... | |
| 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. More... | |
| lti_add_tool_proxy ($config) | |
| Update the database with a tool proxy instance. More... | |
| lti_add_type ($type, $config) | |
| lti_build_content_item_selection_request ($id, $course, moodle_url $returnurl, $title='', $text='', $mediatypes=[], $presentationtargets=[], $autocreate=false, $multiple=false, $unsigned=false, $canconfirm=false, $copyadvice=false, $nonce='') | |
| Builds a standard LTI Content-Item selection request. More... | |
| lti_build_custom_parameters ($toolproxy, $tool, $instance, $params, $customstr, $instructorcustomstr, $islti2) | |
| This function builds the custom parameters. More... | |
| lti_build_registration_request ($toolproxy) | |
| Gets the parameters for the regirstration request. More... | |
| lti_build_request ($instance, $typeconfig, $course, $typeid=null, $islti2=false) | |
| This function builds the request that must be sent to the tool producer. More... | |
| lti_build_request_lti2 ($tool, $params) | |
| This function builds the request that must be sent to an LTI 2 tool provider. More... | |
| lti_build_sourcedid ($instanceid, $userid, $servicesalt, $typeid=null, $launchid=null) | |
| Build source ID. More... | |
| 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. More... | |
| 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. More... | |
| lti_calculate_custom_parameter ($value) | |
| Calculates the value of a custom parameter that has not been specified earlier. More... | |
| 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. More... | |
| lti_convert_content_items ($param) | |
| Converts the new Deep-Linking format for Content-Items to the old format. More... | |
| lti_convert_from_jwt ($typeid, $jwtparam) | |
| Verfies the JWT and converts its claims to their equivalent message parameter. More... | |
| 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 ... More... | |
| 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. More... | |
| lti_delete_tool_proxy ($id) | |
| Delete a Tool Proxy. More... | |
| lti_delete_type ($id) | |
| Delete a Basic LTI configuration. More... | |
| lti_ensure_url_is_https ($url) | |
| lti_extend_lti_services ($data) | |
| Extend the LTI services through the ltisource plugins. More... | |
| lti_filter_get_types ($course) | |
| Returns all basicLTI tools configured by the administrator. More... | |
| lti_filter_tool_proxy_types (array $toolproxies, $state) | |
| Given an array of tool proxies, filter them based on their state. More... | |
| lti_filter_tool_types (array $tools, $state) | |
| Given an array of tools, filter them based on their state. More... | |
| lti_force_type_config_settings ($instance, array $typeconfig) | |
| Enforce type config settings onto the LTI instance. More... | |
| lti_get_best_tool_by_url ($url, $tools, $courseid=null) | |
| lti_get_capabilities () | |
| Initializes an array with the capabilities supported by the LTI module. More... | |
| lti_get_config ($ltiobject) | |
| Transforms a basic LTI object to an array. More... | |
| lti_get_configured_types ($courseid, $sectionreturn=0) | |
| Returns a list of configured types in the given course. More... | |
| lti_get_contexts ($json) | |
| Extracts the named contexts from a tool proxy. More... | |
| lti_get_coursemodule_info ($coursemodule) | |
| Given a coursemodule object, this function returns the extra information needed to print this activity in various places. More... | |
| lti_get_custom_parameters ($toolproxy, $tool, $params, $parameters) | |
| Adds the custom parameters to an array. More... | |
| 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. More... | |
| lti_get_fqid ($contexts, $id) | |
| Converts an ID to a fully-qualified ID. More... | |
| lti_get_ims_role ($user, $cmid, $courseid, $islti2) | |
| Gets the IMS role string for the specified user and LTI course module. More... | |
| lti_get_jwt_claim_mapping () | |
| Return the mapping for standard message parameters to JWT claim. More... | |
| lti_get_jwt_message_type_mapping () | |
| Return the mapping for standard message types to JWT message_type claim. More... | |
| lti_get_launch_container ($lti, $toolconfig) | |
| lti_get_launch_data ($instance, $nonce='') | |
| Return the launch data required for opening the external tool. More... | |
| lti_get_lti_types () | |
| Returns available Basic LTI types. More... | |
| lti_get_lti_types_by_course ($courseid, $coursevisible=null) | |
| Returns all lti types visible in this course. More... | |
| lti_get_lti_types_from_proxy_id ($toolproxyid) | |
| Returns available Basic LTI types that match the given tool proxy id. More... | |
| lti_get_permitted_service_scopes ($type, $typeconfig) | |
| Initializes an array with the scopes for services supported by the LTI module. More... | |
| lti_get_post_actions () | |
| Log post actions. More... | |
| lti_get_response_xml ($codemajor, $description, $messageref, $messagetype) | |
| lti_get_service_by_name ($servicename) | |
| Initializes an instance of the named service. More... | |
| lti_get_service_by_resource_id ($services, $resourceid) | |
| Finds a service by id. More... | |
| lti_get_services () | |
| Initializes an array with the services supported by the LTI module. More... | |
| lti_get_shared_secrets_by_key ($key) | |
| lti_get_shortcuts ($defaultitem) | |
| Return aliases of this activity. More... | |
| lti_get_tool_by_url_match ($url, $courseid=null, $state=LTI_TOOL_STATE_CONFIGURED) | |
| lti_get_tool_proxies ($orphanedonly) | |
| Returns lti tool proxies. More... | |
| lti_get_tool_proxies_from_registration_url ($regurl) | |
| Get the tool proxy instance given its registration URL. More... | |
| lti_get_tool_proxy ($id) | |
| Generates some of the tool proxy configuration based on the admin configuration details. More... | |
| lti_get_tool_proxy_config ($id) | |
| Generates some of the tool proxy configuration based on the admin configuration details. More... | |
| lti_get_tool_proxy_from_guid ($toolproxyguid) | |
| Get the tool proxy instance given its GUID. More... | |
| lti_get_tool_proxy_table ($toolproxies, $id) | |
| This function builds the tab for a category of tool proxies. More... | |
| lti_get_tool_settings ($toolproxyid, $courseid=null, $instanceid=null) | |
| Gets the tool settings. More... | |
| 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. More... | |
| lti_get_type_config_by_instance ($instance) | |
| Fetches LTI type configuration for an LTI instance. More... | |
| lti_get_type_config_from_instance ($id) | |
| Generates some of the tool configuration based on the instance details. More... | |
| lti_get_type_type_config ($id) | |
| Generates some of the tool configuration based on the admin configuration details. More... | |
| lti_get_types_for_add_instance () | |
| Returns tool types for lti add instance and edit page. More... | |
| lti_get_url_thumbprint ($url) | |
| lti_get_view_actions () | |
| Log view actions. More... | |
| lti_grade_item_delete ($basiclti) | |
| lti_grade_item_update ($basiclti, $grades=null) | |
| lti_grades ($basicltiid) | |
| Must return an array of grades for a given instance of this module, indexed by user. More... | |
| lti_initiate_login ($courseid, $id, $instance, $config, $messagetype='basic-lti-launch-request', $title='', $text='') | |
| Generate the form for initiating a login request for an LTI 1.3 message. More... | |
| lti_install () | |
| Execute post-install custom actions for the module This function was added in 1.9. More... | |
| lti_is_cartridge ($url) | |
| Determines if the given url is for a IMS basic cartridge. More... | |
| lti_launch_tool ($instance) | |
| Launch an external tool activity. More... | |
| lti_load_cartridge ($url, $map, $propertiesmap=array()) | |
| Search for a tag within an XML DOMDocument. More... | |
| lti_load_tool_from_cartridge ($url, $lti) | |
| Allows you to load in the configuration for an external tool from an IMS cartridge. More... | |
| lti_load_tool_if_cartridge ($lti) | |
| Loads the cartridge information into the new tool, if the launch url is for a cartridge file. More... | |
| lti_load_type_from_cartridge ($url, $type) | |
| Allows you to load settings for an external tool type from an IMS cartridge. More... | |
| lti_load_type_if_cartridge ($type) | |
| Loads the cartridge information into the tool type, if the launch url is for a cartridge file. More... | |
| lti_log_request ($rawbody) | |
| Logs the request to a file in temp dir. More... | |
| lti_log_response ($responsexml, $e=null) | |
| Log an LTI response. More... | |
| lti_map_keyname ($key, $tolower=true) | |
| Used for building the names of the different custom parameters. More... | |
| lti_new_access_token ($typeid, $scopes) | |
| Create a new access token. More... | |
| lti_parse_custom_parameter ($toolproxy, $tool, $params, $value, $islti2) | |
| Parse a custom parameter to replace any substitution variables. More... | |
| 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. More... | |
| 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. More... | |
| lti_read_grade ($ltiinstance, $userid) | |
| lti_register ($toolproxy) | |
| Prepares an LTI registration request message. More... | |
| lti_request_is_using_ssl () | |
| lti_scale_used () | |
| lti_scale_used_anywhere ($scaleid) | |
| Checks if scale is being used by any instance of basiclti. More... | |
| lti_set_session_user ($userid) | |
| Set the passed user ID to the session user. More... | |
| lti_set_state_for_type ($id, $state) | |
| lti_set_tool_settings ($settings, $toolproxyid, $courseid=null, $instanceid=null) | |
| Sets the tool settings (. More... | |
| lti_should_log_request ($rawbody) | |
| Determines if we should try to log the request. More... | |
| 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. More... | |
| lti_sign_parameters ($oldparms, $endpoint, $method, $oauthconsumerkey, $oauthconsumersecret) | |
| Signs the petition to launch the external tool using OAuth. More... | |
| lti_split_custom_parameters ($toolproxy, $tool, $params, $customstr, $islti2=false) | |
| Splits the custom parameters field to the various parameters. More... | |
| lti_supports ($feature) | |
| List of features supported in URL module. More... | |
| 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. More... | |
| lti_uninstall () | |
| Execute post-uninstall custom actions for the module This function was added in 1.9. More... | |
| lti_update_config ($config) | |
| Updates a tool configuration in the database. More... | |
| lti_update_grade ($ltiinstance, $userid, $launchid, $gradeval) | |
| lti_update_grades ($basiclti, $userid=0, $nullifnone=true) | |
| Update activity grades. More... | |
| 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. More... | |
| lti_update_tool_proxy ($toolproxy) | |
| Updates a tool proxy in the database. More... | |
| 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. More... | |
| 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. More... | |
| lti_verify_jwt_signature ($typeid, $consumerkey, $jwtparam) | |
| Verifies the JWT signature of an incoming message. More... | |
| lti_verify_message ($key, $sharedsecrets, $body, $headers=null) | |
| lti_verify_oauth_signature ($typeid, $consumerkey) | |
| Verifies the OAuth signature of an incoming message. More... | |
| lti_verify_sourcedid ($ltiinstance, $parsed) | |
| Validate source ID from external request. More... | |
| lti_view ($lti, $course, $cm, $context) | |
| Mark the activity completed (if required) and trigger the course_module_viewed event. More... | |
| 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. More... | |
| 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. More... | |
| serialise_tool_proxy (stdClass $proxy) | |
| Serialises this tool proxy. More... | |
| serialise_tool_type (stdClass $type) | |
| Serialises this tool type. More... | |
| 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 More... | |
Variables | |
| $capabilities | |
| global | mod_lti\local\ltiservice::$CFG |
| global | $CFG |
| global | $CFG |
| $functions | |
| $logs | |
| admin_settingpage | $modltifolder = new admin_category('modltifolder', new lang_string('pluginname', 'mod_lti'), $module->is_enabled() === false) |
| $proxieslink | |
| $renamedclasses | |
| $renamedclasses | |
| $renamedclasses | |
| $renamedclasses | |
| 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_ITEM_MODULE 'lti' |
| const | LTI_ITEM_TYPE 'mod' |
| 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_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 | requires = 2019111200 |
| $plugin | version = 2019111801 |
| $settings | visiblename = new lang_string('manage_tools', 'mod_lti') |
| 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 = false, |
|||
$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_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 |
|||
| ) |
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 |
| 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_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_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 = '' |
|||
| ) |
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_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_permitted_service_scopes | ( | $type, | |
| $typeconfig | |||
| ) |
Initializes an array with the scopes for services supported by the LTI module.
| 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 |
| 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 |
| lti_get_services | ( | ) |
Initializes an array with the services supported by the LTI module.
| array | List of services |
| lti_get_shortcuts | ( | $defaultitem | ) |
Return aliases of this activity.
LTI should have an alias for each configured tool type This is so you can add an external tool types directly to the activity chooser
| stdClass | $defaultitem | default item that would be added to the activity chooser if this callback was not present. It has properties: archetype, name, title, help, icon, link |
| array | An array of aliases for this activity. Each element is an object with same list of properties as $defaultitem, plus an additional property, helplink. Properties title and link are required |
| 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_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, | |
| $id, | |||
| $instance, | |||
| $config, | |||
$messagetype = 'basic-lti-launch-request', |
|||
$title = '', |
|||
$text = '' |
|||
| ) |
Generate the form for initiating a login request for an LTI 1.3 message.
| int | $courseid | Course ID |
| int | $id | 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 |
| 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 | ) |
Launch an external tool activity.
| stdClass | $instance | the external tool activity settings |
| string | The HTML code containing the javascript code for the launch |
| 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_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 |
| 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 |
| 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 |
| lti_verify_sourcedid | ( | $ltiinstance, | |
| $parsed | |||
| ) |
Validate source ID from external request.
| object | $ltiinstance | |
| object | $parsed |
| Exception |
| 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 |
| 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. |
| serialise_tool_proxy | ( | stdClass | $proxy | ) |
Serialises this tool proxy.
| stdClass | $proxy | The tool proxy |
| array | An array of values representing this type |
| 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 |
| $logs |
| $proxieslink |
| $renamedclasses |
| $renamedclasses |
| $renamedclasses |
| $renamedclasses |
| $tasks |