Skip to content

Commit 3696095

Browse files
author
David Monllao
committed
Merge branch 'MDL-62456_master' of git://github.com/markn86/moodle
2 parents 798f0f1 + ad7f143 commit 3696095

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

mod/lti/classes/privacy/provider.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,25 @@ class provider implements
4949
* @return collection the updated collection of metadata items.
5050
*/
5151
public static function get_metadata(collection $items) : collection {
52+
$items->add_external_location_link(
53+
'lti_provider',
54+
[
55+
'userid' => 'privacy:metadata:userid',
56+
'username' => 'privacy:metadata:username',
57+
'useridnumber' => 'privacy:metadata:useridnumber',
58+
'firstname' => 'privacy:metadata:firstname',
59+
'lastname' => 'privacy:metadata:lastname',
60+
'fullname' => 'privacy:metadata:fullname',
61+
'email' => 'privacy:metadata:email',
62+
'role' => 'privacy:metadata:role',
63+
'courseid' => 'privacy:metadata:courseid',
64+
'courseidnumber' => 'privacy:metadata:courseidnumber',
65+
'courseshortname' => 'privacy:metadata:courseshortname',
66+
'coursefullname' => 'privacy:metadata:coursefullname',
67+
],
68+
'privacy:metadata:externalpurpose'
69+
);
70+
5271
$items->add_database_table(
5372
'lti_submission',
5473
[

mod/lti/lang/en/lti.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,16 @@
356356
$string['preferwidth'] = 'Preferred width';
357357
$string['press_to_submit'] = 'Press to launch this activity';
358358
$string['privacy'] = 'Privacy';
359+
$string['privacy:metadata:courseid'] = 'The ID of the course the user is accessing the LTI Consumer from';
360+
$string['privacy:metadata:courseidnumber'] = 'The ID number of the course the user is accessing the LTI Consumer from';
361+
$string['privacy:metadata:coursefullname'] = 'The fullname of the course the user is accessing the LTI Consumer from';
362+
$string['privacy:metadata:courseshortname'] = 'The shortname of the course the user is accessing the LTI Consumer from';
359363
$string['privacy:metadata:createdby'] = 'The user who created the record';
364+
$string['privacy:metadata:email'] = 'The email address of the user accessing the LTI Consumer';
365+
$string['privacy:metadata:externalpurpose'] = 'The LTI Consumer provides user information and context to the LTI Tool Provider.';
366+
$string['privacy:metadata:firstname'] = 'The firstname of the user accessing the LTI Consumer';
367+
$string['privacy:metadata:fullname'] = 'The fullname of the user accessing the LTI Consumer';
368+
$string['privacy:metadata:lastname'] = 'The lastname of the user accessing the LTI Consumer';
360369
$string['privacy:metadata:lti_submission'] = 'LTI submission';
361370
$string['privacy:metadata:lti_submission:datesubmitted'] = 'The timestamp indicating when the submission was made';
362371
$string['privacy:metadata:lti_submission:dateupdated'] = 'The timestamp indicating when the submission was modified';
@@ -367,8 +376,12 @@
367376
$string['privacy:metadata:lti_tool_proxies:name'] = 'LTI proxy name';
368377
$string['privacy:metadata:lti_types'] = 'LTI types';
369378
$string['privacy:metadata:lti_types:name'] = 'LTI type name';
379+
$string['privacy:metadata:role'] = 'The role in the course for the user accessing the LTI Consumer';
370380
$string['privacy:metadata:timecreated'] = 'The date at which the record was created';
371381
$string['privacy:metadata:timemodified'] = 'The date at which the record was modified';
382+
$string['privacy:metadata:userid'] = 'The ID of the user accessing the LTI Consumer';
383+
$string['privacy:metadata:useridnumber'] = 'The ID number of the user accessing the LTI Consumer';
384+
$string['privacy:metadata:username'] = 'The username of the user accessing the LTI Consumer';
372385
$string['quickgrade'] = 'Allow quick grading';
373386
$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.';
374387
$string['redirect'] = 'You will be redirected in few seconds. If you are not, press the button.';

mod/lti/tests/privacy_provider_test.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ public function test_get_metadata() {
4343
$collection = new collection('mod_lti');
4444
$newcollection = provider::get_metadata($collection);
4545
$itemcollection = $newcollection->get_collection();
46-
$this->assertCount(3, $itemcollection);
46+
$this->assertCount(4, $itemcollection);
47+
48+
$ltiproviderexternal = array_shift($itemcollection);
49+
$this->assertEquals('lti_provider', $ltiproviderexternal->get_name());
4750

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

0 commit comments

Comments
 (0)