Skip to content

Commit

Permalink
MDL-62456 mod_lti: add missing add_external_location_link call
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed May 16, 2018
1 parent ac897ae commit 5255e8f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
19 changes: 19 additions & 0 deletions mod/lti/classes/privacy/provider.php
Expand Up @@ -49,6 +49,25 @@ class provider implements
* @return collection the updated collection of metadata items.
*/
public static function get_metadata(collection $items) {
$items->add_external_location_link(
'lti_provider',
[
'userid' => 'privacy:metadata:userid',
'username' => 'privacy:metadata:username',
'useridnumber' => 'privacy:metadata:useridnumber',
'firstname' => 'privacy:metadata:firstname',
'lastname' => 'privacy:metadata:lastname',
'fullname' => 'privacy:metadata:fullname',
'email' => 'privacy:metadata:email',
'role' => 'privacy:metadata:role',
'courseid' => 'privacy:metadata:courseid',
'courseidnumber' => 'privacy:metadata:courseidnumber',
'courseshortname' => 'privacy:metadata:courseshortname',
'coursefullname' => 'privacy:metadata:coursefullname',
],
'privacy:metadata:externalpurpose'
);

$items->add_database_table(
'lti_submission',
[
Expand Down
13 changes: 13 additions & 0 deletions mod/lti/lang/en/lti.php
Expand Up @@ -351,7 +351,16 @@
$string['preferwidth'] = 'Preferred width';
$string['press_to_submit'] = 'Press to launch this activity';
$string['privacy'] = 'Privacy';
$string['privacy:metadata:courseid'] = 'The ID of the course the user is accessing the LTI Consumer from';
$string['privacy:metadata:courseidnumber'] = 'The ID number of the course the user is accessing the LTI Consumer from';
$string['privacy:metadata:coursefullname'] = 'The fullname of the course the user is accessing the LTI Consumer from';
$string['privacy:metadata:courseshortname'] = 'The shortname of the course the user is accessing the LTI Consumer from';
$string['privacy:metadata:createdby'] = 'The user who created the record';
$string['privacy:metadata:email'] = 'The email address of the user accessing the LTI Consumer';
$string['privacy:metadata:externalpurpose'] = 'The LTI Consumer provides user information and context to the LTI Tool Provider.';
$string['privacy:metadata:firstname'] = 'The firstname of the user accessing the LTI Consumer';
$string['privacy:metadata:fullname'] = 'The fullname of the user accessing the LTI Consumer';
$string['privacy:metadata:lastname'] = 'The lastname of the user accessing the LTI Consumer';
$string['privacy:metadata:lti_submission'] = 'LTI submission';
$string['privacy:metadata:lti_submission:datesubmitted'] = 'The timestamp indicating when the submission was made';
$string['privacy:metadata:lti_submission:dateupdated'] = 'The timestamp indicating when the submission was modified';
Expand All @@ -362,8 +371,12 @@
$string['privacy:metadata:lti_tool_proxies:name'] = 'LTI proxy name';
$string['privacy:metadata:lti_types'] = 'LTI types';
$string['privacy:metadata:lti_types:name'] = 'LTI type name';
$string['privacy:metadata:role'] = 'The role in the course for the user accessing the LTI Consumer';
$string['privacy:metadata:timecreated'] = 'The date at which the record was created';
$string['privacy:metadata:timemodified'] = 'The date at which the record was modified';
$string['privacy:metadata:userid'] = 'The ID of the user accessing the LTI Consumer';
$string['privacy:metadata:useridnumber'] = 'The ID number of the user accessing the LTI Consumer';
$string['privacy:metadata:username'] = 'The username of the user accessing the LTI Consumer';
$string['quickgrade'] = 'Allow quick grading';
$string['quickgrade_help'] = 'If enabled, multiple tools can be graded on one page. Add grades and comments then click the "Save all my feedback" button to save all changes for that page.';
$string['redirect'] = 'You will be redirected in few seconds. If you are not, press the button.';
Expand Down
5 changes: 4 additions & 1 deletion mod/lti/tests/privacy_provider_test.php
Expand Up @@ -43,7 +43,10 @@ public function test_get_metadata() {
$collection = new collection('mod_lti');
$newcollection = provider::get_metadata($collection);
$itemcollection = $newcollection->get_collection();
$this->assertCount(3, $itemcollection);
$this->assertCount(4, $itemcollection);

$ltiproviderexternal = array_shift($itemcollection);
$this->assertEquals('lti_provider', $ltiproviderexternal->get_name());

$ltisubmissiontable = array_shift($itemcollection);
$this->assertEquals('lti_submission', $ltisubmissiontable->get_name());
Expand Down

0 comments on commit 5255e8f

Please sign in to comment.