]> _ Git - fluidbook-html5.git/commitdiff
wait #4949 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 9 Dec 2021 12:50:37 +0000 (13:50 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 9 Dec 2021 12:50:52 +0000 (13:50 +0100)
js/libs/scorm/apiwrapper.js
js/libs/scorm/scorm.js

index b7f34e288d8c0f3f3d7cae916cdfcc008d499f30..c2e02b296969f9d40ea138ba1a2c31250fb2431b 100644 (file)
@@ -219,19 +219,23 @@ pipwerks.SCORM.connection.initialize = function () {
             errorCode = 0;\r
 \r
         if (API) {\r
-            switch (scorm.version) {\r
-                case "1.2" :\r
-                    success = makeBoolean(API.LMSInitialize(""));\r
-                    break;\r
-                case "2004":\r
-                    success = makeBoolean(API.Initialize(""));\r
-                    break;\r
+            if (API.Initialized !== true) {\r
+                switch (scorm.version) {\r
+                    case "1.2" :\r
+                        success = makeBoolean(API.LMSInitialize(""));\r
+                        break;\r
+                    case "2004":\r
+                        success = makeBoolean(API.Initialize(""));\r
+                        break;\r
+                }\r
+            } else {\r
+                success = true;\r
             }\r
 \r
             if (success) {\r
                 //Double-check that connection is active and working before returning 'true' boolean\r
                 errorCode = debug.getCode();\r
-                if (errorCode !== null && errorCode === 0) {\r
+                if (API.Initialized===true || (errorCode !== null && errorCode === 0)) {\r
                     scorm.connection.isActive = true;\r
                     if (scorm.handleCompletionStatus) {\r
                         //Automatically set new launches to incomplete\r
index 79065d3c5ef02eaab281297e22103bad96363782..0944fdae6824d32ebd28b58c6aef87562b3f7110 100644 (file)
@@ -178,7 +178,9 @@ function finishScorm() {
     }
     setSessionTime();
     pipwerks.SCORM.save();
-    pipwerks.SCORM.quit();
+    if (fluidbook.settings.multilang === '') {
+        pipwerks.SCORM.quit();
+    }
 }
 
 function scormMarkAsComplete() {