]> _ Git - fluidbook-html5.git/commitdiff
wait #3677 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 9 Jun 2020 07:00:31 +0000 (09:00 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 9 Jun 2020 07:00:31 +0000 (09:00 +0200)
js/libs/fluidbook/fluidbook.scorm.js
js/libs/fluidbook/fluidbook.splash.js
js/libs/scorm/scorm.js

index 5e3329bc7b4b1b4d8dd6ee94c95781a5bdb70c37..d3d2628e2dd5215389b35ac24f45216e84fa9380 100644 (file)
@@ -34,11 +34,13 @@ FluidbookScorm.prototype = {
 
 
         // Mark complete when the user reaches the last page
-        $(this.fluidbook).on('fluidbook.page.change.end', function () {
-            if ($this.fluidbook.settings.scorm_complete_on_last_page && $this.fluidbook.currentPage === $this.fluidbook.settings.pages) {
-                scormMarkAsComplete();
-            }
-        });
+        if (this.fluidbook.settings.scorm_complete_on_last_page) {
+            $(this.fluidbook).on('fluidbook.page.change.end', function () {
+                if ($this.fluidbook.currentPage === $this.fluidbook.settings.pages) {
+                    scormMarkAsComplete();
+                }
+            });
+        }
     },
 
     hideScormLinks: function () {
index 7d97f4bd577362b91455d357fc1be56ab06ff866..f970349e14140f98558a3df9ac15595b7fd1436d 100644 (file)
@@ -42,9 +42,6 @@ FluidbookSplash.prototype = {
                 this.fluidbook.pagetransitions.flip3d.performancesTest(function () {
                     $this.fluidbook.networkControl.resume();
                     var timeout = $this.hideSplashTimeout;
-                    if (window.SCORM_OK !== undefined && window.SCORM_OK === true) {
-                        timeout += 5;
-                    }
                     setTimeout(function () {
                         $this.hideIfPossible();
                     }, timeout * 1000);
index f559492c686237a8db7c35f0f6bb423b4aceaaa8..a4adc34b835dd47310a6bf421002661f29a1221d 100644 (file)
@@ -43,6 +43,14 @@ function initScorm() {
 
     }
 
+    try {
+        if (FORCE_SCORM) {
+            SCORM_OK = true;
+        }
+    }catch (e) {
+        
+    }
+
     if (SCORM_OK) {
         $(document).on('fluidbook.ready', function () {
             scormExit();
@@ -50,7 +58,7 @@ function initScorm() {
             initScormEvents();
             initScormInteractions();
         });
-    }else{
+    } else {
         console.log('SCORM nok');
     }
     return SCORM_OK;
@@ -90,30 +98,30 @@ function initScormEvents() {
     }
     SCORM_LOCATION_INITED = true;
     var currentLocation = getScormValue('location');
-    try {
-        var changePage = false;
-        if (currentLocation.indexOf('page_') === 0) {
-            var e = currentPage.split('_');
-            if (e.length === 2 && e[0] === 'page') {
-                fluidbook.setCurrentPage(e[1]);
-                changePage = true;
-            }
-        } else if (currentLocation.indexOf('{') === 0) {
-            var location = JSON.parse(currentLocation);
-            if (location.maxPage) {
-                fluidbook.contentlock.setMaxPage(location.maxPage, true);
+    console.log(currentLocation, 'null');
+    if (currentLocation !== 'null') {
+        try {
+            var changePage = false;
+            if (currentLocation.indexOf('page_') === 0) {
+                var e = currentPage.split('_');
+                if (e.length === 2 && e[0] === 'page') {
+                    fluidbook.setCurrentPage(e[1]);
+                    changePage = true;
+                }
+            } else if (currentLocation.indexOf('{') === 0) {
+                var location = JSON.parse(currentLocation);
+                if (location.maxPage) {
+                    fluidbook.contentlock.setMaxPage(location.maxPage, true);
+                }
+                if (location.page) {
+                    fluidbook.setCurrentPage(location.page);
+                    changePage = true;
+                }
             }
-            if (location.page) {
-                fluidbook.setCurrentPage(location.page);
-                changePage = true;
-            }
-        }
 
-        if (changePage) {
-            fluidbook.splash.hideSplashTimeout = 6;
+        } catch (err) {
+            console.log(err);
         }
-    } catch (err) {
-        console.log(err);
     }