Skip to content

Commit

Permalink
MDL-78820 h5p: use fullname of current user as the xAPI actor name.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden authored and Jenkins committed Oct 4, 2023
1 parent ead9baf commit c22b94a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion h5p/classes/helper.php
Expand Up @@ -343,7 +343,11 @@ public static function get_core_settings(): array {
$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",
Expand Down

0 comments on commit c22b94a

Please sign in to comment.