diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..5f423f9 --- /dev/null +++ b/composer.json @@ -0,0 +1,10 @@ +{ + "name": "h5p/h5p-php-library", + "license": "GPL-3.0", + "autoload": { + "files": [ + "h5p-development.class.php", + "h5p.classes.php" + ] + } +} \ No newline at end of file diff --git a/h5p.classes.php b/h5p.classes.php index e87bc79..d91b794 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -2391,6 +2391,10 @@ class H5PCore { if($platformInfo['uuid'] === '' && isset($json->uuid)) { $this->h5pF->setOption('site_uuid', $json->uuid); } + if (isset($json->latest) && !empty($json->latest)) { + $this->h5pF->setOption('update_available', $json->latest->releasedAt); + $this->h5pF->setOption('update_available_path', $json->latest->path); + } } } diff --git a/js/h5p-x-api.js b/js/h5p-x-api.js index 272c058..6becdad 100644 --- a/js/h5p-x-api.js +++ b/js/h5p-x-api.js @@ -95,7 +95,8 @@ H5P.EventDispatcher.prototype.triggerXAPIScored = function (score, maxScore, ver H5P.EventDispatcher.prototype.setActivityStarted = function() { if (this.activityStartTime === undefined) { // Don't trigger xAPI events in the editor - if (this.contentId !== undefined && H5PIntegration.contents !== undefined && H5PIntegration.contents['cid-' + this.contentId] !== undefined) { + if (H5PIntegration.contents !== undefined && + H5PIntegration.contents['cid-' + this.contentId] !== undefined) { this.triggerXAPI('attempted'); } this.activityStartTime = Date.now();