MDL-69736 core_h5p: enable player reporting
authorFerran Recio <ferran@moodle.com>
Tue, 6 Oct 2020 11:02:45 +0000 (13:02 +0200)
committerFerran Recio <ferran@moodle.com>
Tue, 6 Oct 2020 11:02:45 +0000 (13:02 +0200)
h5p/classes/player.php

index 6647594..7cc30a4 100644 (file)
@@ -353,6 +353,9 @@ class player {
         $settings['moodleLibraryPaths'] = $this->core->get_dependency_roots($this->h5pid);
         // Add also the Moodle component where the results will be tracked.
         $settings['moodleComponent'] = $this->component;
+        if (!empty($settings['moodleComponent'])) {
+            $settings['reportingIsEnabled'] = true;
+        }
 
         $cid = $this->get_cid();
         // The filterParameters function should be called before getting the dependencyfiles because it rebuild content