this.loader = new FluidbookLoader(this);
this.search = new FluidbookSearch(this);
this.pad = new FluidbookPad(this);
- if (this.datas.scorm_enable) {
- this.scorm = new FluidbookScorm(this);
- }
+ this.scorm = new FluidbookScorm(this);
this.links = new FluidbookLinks(this);
this.waiters = [];
this.viewport = new FluidbookViewport(this);
}
return true;
});
+
+ console.log('init scorm');
+
+ $(this.fluidbook).on('fluidbook.links.ready', function () {
+ $this.hideScormLinks();
+ });
+ },
+
+ hideScormLinks: function () {
+ console.log('hide scorm links');
+ if (this.isActive()) {
+ console.log('scorm is active');
+ return;
+ }
+
+ $('.link[data-scorm="1"]').hide();
},
completeLink: function (id) {
return (this.linksToComplete.length == 0);
},
+ isActive: function () {
+ if (!this.fluidbook.datas.scorm_enable) {
+ console.log('scorm not enabled (settings)');
+ return false;
+ }
+ if (undefined !== window.FORCE_SCORM
+ && window.FORCE_SCORM) {
+ console.log('scorm forced');
+ return true;
+ }
+ console.log('scorm api : ', pipwerks.SCORM.API.isFound);
+ return pipwerks.SCORM.API.isFound;
+ },
+
openLinkIfCompleteOrDisplayImage: function (openLink, openImage) {
var $this = this;
var id = this.linksCompleted() ? openLink : openImage;
$.each(id, function (k, v) {
$this.fluidbook.links.triggerLinkById(v);
});
-
},
+
+
};
\ No newline at end of file
finishScorm();
});
- $(fluidbook).on('fluidbook.splash.hide',function(){
+ $(fluidbook).on('fluidbook.splash.hide', function () {
console.log('init scorm events');
var currentLocation = getScormValue('location');
try {
});
-
// Commit data once a minute
setInterval(function () {
pipwerks.SCORM.save();
resize();
}, 1000);
- fluidbook.onReady(function() {
+ fluidbook.onReady(function () {
if (!startAfterLoading) {
fluidbook.changeAddress();
}
});
//console.log('fluidbook.ready');
- setTimeout(function(){
- fluidbook.ready();
- }, 3000);
+ setTimeout(function () {
+ fluidbook.ready();
+ }, 3000);
}
} catch (err) {
console.log(err);