From c22b94aea7f467d95b720ea5339154a3ca431a5d Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Thu, 27 Jul 2023 13:01:53 +0100 Subject: [PATCH] MDL-78820 h5p: use fullname of current user as the xAPI actor name. --- h5p/classes/helper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/h5p/classes/helper.php b/h5p/classes/helper.php index d8651d2e6e8..b06dcd8dd51 100644 --- a/h5p/classes/helper.php +++ b/h5p/classes/helper.php @@ -343,7 +343,11 @@ class helper { $core = $factory->get_core(); // When there is a logged in user, her information will be passed to the player. It will be used for tracking. - $usersettings = isloggedin() ? ['name' => $USER->username, 'mail' => $USER->email] : []; + $usersettings = []; + if (isloggedin()) { + $usersettings['name'] = fullname($USER, has_capability('moodle/site:viewfullnames', $systemcontext)); + $usersettings['mail'] = $USER->email; + } $settings = array( 'baseUrl' => $basepath, 'url' => "{$basepath}pluginfile.php/{$systemcontext->instanceid}/core_h5p",