diff --git a/src/core/features/h5p/assets/moodle/js/params.js b/src/core/features/h5p/assets/moodle/js/params.js index 87722aacd..75c73d6ba 100644 --- a/src/core/features/h5p/assets/moodle/js/params.js +++ b/src/core/features/h5p/assets/moodle/js/params.js @@ -39,6 +39,9 @@ if (window.H5PIntegration && window.H5PIntegration.contents && location.search) } } else if (nameAndValue[0] == 'component') { window.H5PIntegration.moodleComponent = nameAndValue[1]; + if (window.H5PIntegration.moodleComponent) { + window.H5PIntegration.reportingIsEnabled = true; + } } else if (nameAndValue[0] == 'trackingUrl' && contentData) { contentData.url = nameAndValue[1]; } diff --git a/src/core/features/h5p/classes/player.ts b/src/core/features/h5p/classes/player.ts index 0a473aef9..db77e3d0b 100644 --- a/src/core/features/h5p/classes/player.ts +++ b/src/core/features/h5p/classes/player.ts @@ -226,6 +226,8 @@ export class CoreH5PPlayer { settings.moodleLibraryPaths = await this.h5pCore.getDependencyRoots(id); + // The Moodle component is added dynamically using the params.js script instead of doing it here. + /* The filterParameters function should be called before getting the dependency files because it rebuilds content dependency cache. */ settings.contents[contentId].jsonContent = await this.h5pCore.filterParameters(content, siteId);