mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-44902: Several additions to External Tool (LTI)
* LTI service related changes: ** Fixing exceptions in OAuth library. ** Added new launch option, Existing window: replaces entire page with the LTI object. ** The LTI tool ID used to perform the launch is now sent with the LTI launch parameters. This is sent back to Moodle on subsequent requests. ** Added $CFG->mod_lti_forcessl to force SSL on all LTI launches. ** Added new LTI launch parameter: tool_consumer_instance_name. Default value is site full name, but can be customized with $CFG->mod_lti_institution_name. ** The LTI grade service endpoints now set the affected user to the session. This was required for event listeners. ** Fix the grade deletion service. Was deleting the grade item instead of just the grade. ** Send error response when LTI instance does not accept grades and grades are being sent. ** Added a method for writing incoming LTI requests to disk for debugging. Disabled by default. * Changes for ltisource plugins: ** Can now to plug into backup/restore. ** Can now have settings.php files. ** Can now hook into the LTI launch and edit parameters. * Several grade changes: ** Added standard_grading_coursemodule_elements to LTI instance edit form. This means LTI instances can be configured with a grade. ** No longer assumes that grade is out of 100. ** Replaced modl/lti:grade capability with mod/lti:view. * JS on mod/lti/view.php for resizing the content object has been converted to YUI3. * Fixed misspellings in language file. * Added hooks for log post and view actions. * Bug fix for lti_get_url_thumbprint() when the URL is missing a schema.
This commit is contained in:
parent
f500ff4e52
commit
8fa50fdd34
23 changed files with 759 additions and 74 deletions
|
@ -99,6 +99,9 @@ class backup_lti_activity_structure_step extends backup_activity_structure_step
|
|||
// Define file annotations
|
||||
$lti->annotate_files('mod_lti', 'intro', null); // This file areas haven't itemid
|
||||
|
||||
// Add support for subplugin structure.
|
||||
$this->add_subplugin_structure('ltisource', $lti, true);
|
||||
|
||||
// Return the root element (lti), wrapped into standard activity structure
|
||||
return $this->prepare_activity_structure($lti);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
require_once($CFG->dirroot . '/mod/lti/backup/moodle2/restore_lti_stepslib.php'); // Because it exists (must)
|
||||
require_once($CFG->dirroot . '/mod/lti/backup/moodle2/restore_lti_stepslib.php');
|
||||
|
||||
/**
|
||||
* basiclti restore task that provides all the settings and steps to perform one
|
||||
|
@ -59,14 +59,14 @@ class restore_lti_activity_task extends restore_activity_task {
|
|||
* Define (add) particular settings this activity can have
|
||||
*/
|
||||
protected function define_my_settings() {
|
||||
// No particular settings for this activity
|
||||
// No particular settings for this activity.
|
||||
}
|
||||
|
||||
/**
|
||||
* Define (add) particular steps this activity can have
|
||||
*/
|
||||
protected function define_my_steps() {
|
||||
// label only has one structure step
|
||||
// Label only has one structure step.
|
||||
$this->add_step(new restore_lti_activity_structure_step('lti_structure', 'lti.xml'));
|
||||
}
|
||||
|
||||
|
@ -129,4 +129,13 @@ class restore_lti_activity_task extends restore_activity_task {
|
|||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for ltisource plugins.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function get_old_moduleid() {
|
||||
return $this->oldmoduleid;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,9 +56,13 @@ class restore_lti_activity_structure_step extends restore_activity_structure_ste
|
|||
protected function define_structure() {
|
||||
|
||||
$paths = array();
|
||||
$paths[] = new restore_path_element('lti', '/activity/lti');
|
||||
$lti = new restore_path_element('lti', '/activity/lti');
|
||||
$paths[] = $lti;
|
||||
|
||||
// Return the paths wrapped into standard activity structure
|
||||
// Add support for subplugin structure.
|
||||
$this->add_subplugin_structure('ltisource', $lti);
|
||||
|
||||
// Return the paths wrapped into standard activity structure.
|
||||
return $this->prepare_activity_structure($paths);
|
||||
}
|
||||
|
||||
|
@ -78,12 +82,12 @@ class restore_lti_activity_structure_step extends restore_activity_structure_ste
|
|||
|
||||
$newitemid = $DB->insert_record('lti', $data);
|
||||
|
||||
// immediately after inserting "activity" record, call this
|
||||
// Immediately after inserting "activity" record, call this.
|
||||
$this->apply_activity_instance($newitemid);
|
||||
}
|
||||
|
||||
protected function after_execute() {
|
||||
// Add lti related files, no need to match by itemname (just internally handled context)
|
||||
// Add lti related files, no need to match by itemname (just internally handled context).
|
||||
$this->add_related_files('mod_lti', 'intro', null);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue