From 0c2496530532e1f463a0efaa5c4be01ed9765b7a Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 11 Nov 2015 14:13:05 +0100 Subject: [PATCH 1/3] Keep track of the latest H5P release --- h5p.classes.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/h5p.classes.php b/h5p.classes.php index 8ff35f8..9624cd6 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); + } } } From 6773f7aad8f95d21c847e12e6ad781e1f8ff26b9 Mon Sep 17 00:00:00 2001 From: Juho Jaakkola Date: Fri, 27 Nov 2015 12:16:57 +0200 Subject: [PATCH 2/3] Adds minimal composer.json --- composer.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 composer.json 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 From 2bc4dee85a367bcb3559d6d8303f78c66f640de7 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Thu, 10 Dec 2015 14:49:30 +0100 Subject: [PATCH 3/3] Prevent crashing editor for old libraries --- js/h5p-x-api.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/h5p-x-api.js b/js/h5p-x-api.js index 9fc6758..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 (H5PIntegration.contents['cid-' + this.contentId] !== undefined) { + if (H5PIntegration.contents !== undefined && + H5PIntegration.contents['cid-' + this.contentId] !== undefined) { this.triggerXAPI('attempted'); } this.activityStartTime = Date.now(); @@ -114,4 +115,4 @@ H5P.xAPICompletedListener = function (event) { var contentId = event.getVerifiedStatementValue(['object', 'definition', 'extensions', 'http://h5p.org/x-api/h5p-local-content-id']); H5P.setFinished(contentId, score, maxScore); } -}; \ No newline at end of file +};