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",