From 89b74e7839c0238292306d5b5b0d11dcf5de10e2 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Thu, 4 Jul 2013 13:27:28 +0200 Subject: [PATCH] E-MAIL: Added core fix to all libraries who need it. Updated patch levels. --- js/questionset.js | 19 +++++++++++++++++++ library.json | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/js/questionset.js b/js/questionset.js index 07bd238..17e09c0 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -1,5 +1,24 @@ var H5P = H5P || {}; +if (H5P.getPath === undefined) { + /** + * Find the path to the content files based on the id of the content + * + * Also identifies and returns absolute paths + * + * @param {String} path Absolute path to a file, or relative path to a file in the content folder + * @param {Number} contentId Identifier of the content requesting the path + * @returns {String} The path to use. + */ + H5P.getPath = function (path, contentId) { + if (path.substr(0, 7) === 'http://' || path.substr(0, 8) === 'https://') { + return path; + } + + return H5PIntegration.getContentPath(contentId) + path; + }; +} + /** * Will render a Question with multiple choices for answers. * diff --git a/library.json b/library.json index 123aba5..cbafc0a 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 0, - "patchVersion": 18, + "patchVersion": 19, "runnable": 1, "machineName": "H5P.QuestionSet", "author": "Amendor AS",