]> _ Git - fluidbook-html5.git/commitdiff
wait #2439 @0:10
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 29 Aug 2019 12:08:19 +0000 (14:08 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 29 Aug 2019 12:08:19 +0000 (14:08 +0200)
js/libs/fluidbook/fluidbook.scorm.js

index 651e162ae0df36545a72766b7e08627239a333eb..5fec188b027c822b890aa12847e1be931ee37654 100644 (file)
@@ -29,6 +29,13 @@ FluidbookScorm.prototype = {
         if (this.fluidbook.datas.scorm_enable && window.initScorm !== undefined) {
             initScorm();
         }
+
+        // Mark complete when the user reaches the last page
+        $(this.fluidbook).on('fluidbook.page.change.end', function () {
+            if ($this.fluidbook.currentPage == $this.fluidbook.datas.pages && $this.fluidbook.datas.scorm_complete_on_last_page) {
+                scormMarkAsComplete();
+            }
+        });
     },
 
     hideScormLinks: function () {