* @return array The settings.
*/
public static function get_core_settings(): array {
- global $CFG;
+ global $CFG, $USER;
$basepath = $CFG->wwwroot . '/';
$systemcontext = context_system::instance();
'saveFreq' => false,
'siteUrl' => $CFG->wwwroot,
'l10n' => array('H5P' => $core->getLocalization()),
- 'user' => [],
+ 'user' => ['name' => $USER->username, 'mail' => $USER->email],
'hubIsEnabled' => true,
'reportingIsEnabled' => false,
'crossorigin' => null,
$settings = helper::get_core_assets();
// Added here because in the helper we don't have the h5p content id.
$settings['moodleLibraryPaths'] = $this->core->get_dependency_roots($this->h5pid);
+ // Add also the Moodle component where the results will be tracked.
+ $settings['moodleComponent'] = $this->component;
$cid = $this->get_cid();
// The filterParameters function should be called before getting the dependencyfiles because it rebuild content