diff --git a/mod/lti/classes/privacy/provider.php b/mod/lti/classes/privacy/provider.php index 022e4c046f4b4..b5c7d41d75f7d 100644 --- a/mod/lti/classes/privacy/provider.php +++ b/mod/lti/classes/privacy/provider.php @@ -49,6 +49,25 @@ class provider implements * @return collection the updated collection of metadata items. */ public static function get_metadata(collection $items) : collection { + $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', [ diff --git a/mod/lti/lang/en/lti.php b/mod/lti/lang/en/lti.php index eda118811a46f..609dcba965690 100644 --- a/mod/lti/lang/en/lti.php +++ b/mod/lti/lang/en/lti.php @@ -356,7 +356,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'; @@ -367,8 +376,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.'; diff --git a/mod/lti/tests/privacy_provider_test.php b/mod/lti/tests/privacy_provider_test.php index e888927a71f7b..15061606be3b7 100644 --- a/mod/lti/tests/privacy_provider_test.php +++ b/mod/lti/tests/privacy_provider_test.php @@ -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());