From 80d00f48c32965b65c4a5bcb89b7589eb72a95a2 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 13 Sep 2023 15:35:02 +0200 Subject: [PATCH] wait #6335 @1 --- resources/quiz/js/app.js | 8 +++++++- resources/scorm/scorm.js | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/resources/quiz/js/app.js b/resources/quiz/js/app.js index 9ce6480ea..9544ab99f 100644 --- a/resources/quiz/js/app.js +++ b/resources/quiz/js/app.js @@ -18,7 +18,13 @@ window.$ = window.jQuery = $; if (cubeSCORM.SCORM_INITED) { return; } - cubeSCORM.initScorm(); + + let disable = false; + if (window.parent !== undefined && window.parent.fluidbook !== undefined) { + disable = true; + } + + cubeSCORM.initScorm(disable); init(cubeSCORM.getScormLocation({q: 1})); } diff --git a/resources/scorm/scorm.js b/resources/scorm/scorm.js index aa7c32d6c..296820268 100644 --- a/resources/scorm/scorm.js +++ b/resources/scorm/scorm.js @@ -41,12 +41,17 @@ CubeSCORM.prototype = { return this.SCORM.version; }, - initScorm: function () { + initScorm: function (disable) { + if (this.SCORM_INITED) { return; } this.SCORM_INITED = true; + if(disable===true){ + this.SCORM_OK=false; + return false; + } try { if (this.SCORM.init()) { console.info('SCORM OK'); -- 2.39.5