/*! flipper-scorm-score */
this.flipperjs=this.flipperjs||{},function(a){var b=function(){this.thisName="ScormManagerForFlipper"},c=b.prototype;c._scormVersion="1.2",c.init=function(a){this._scormVersion=a;scormInitilaized=jQuery.proxy(this._onInitializedScorm,this),scoInitializeFromScormManager()},c._onInitializedScorm=function(){this.onInitializedScorm()},c.onInitializedScorm=function(){},c.scormCommonSetValue=function(a,b){var c="",d=b;switch(a){case"lesson_location":"1.2"==this._scormVersion?c="cmi.core.lesson_location":"2004"==this._scormVersion&&(c="cmi.location");break;case"suspend_data":c="cmi.suspend_data";break;case"lesson_status":"1.2"==this._scormVersion?c="cmi.core.lesson_status":"2004"==this._scormVersion&&(c="cmi.completion_status","incomplete"==b?this._scormCommandSetValue("cmi.success_status","failed"):"completed"==b&&this._scormCommandSetValue("cmi.success_status","passed"));break;case"cmi.comments":"1.2"==this._scormVersion?c="cmi.comments":"2004"==this._scormVersion&&(c="cmi.comments_from_learner.0.comment");break;default:var e=this._changeScormSetData(a,b);c=e[0],d=e[1]}this._scormCommandSetValue(c,d)},c._changeScormSetData=function(a,b){if(a.match(/^cmi\.interactions\.\d+\.time$/)){if("1.2"==this._scormVersion)return[a,this._getNowTimeString(b)];if("2004"==this._scormVersion){var c=b,d=c.getFullYear()+"-"+this._addZero(c.getMonth()+1)+"-"+this._addZero(c.getDate());d+="T"+this._getNowTimeString(c);var e=a.replace(/\.time$/,".timestamp");return[e,d]}}else if(a.match(/^cmi\.interactions\.\d+\.student_response$/)){if("2004"==this._scormVersion){var e=a.replace(/\.student_response$/,".learner_response");return[e,b]}}else if(a.match(/^cmi\.interactions\.\d+\.latency$/)){if("1.2"==this._scormVersion)return[a,this._millSec2HHMMSS(b)];if("2004"==this._scormVersion)return[a,this._millSec2scoTimeinterval(b)]}else if(a.match(/^cmi\.interactions\.\d+\.result$/)){if("2004"==this._scormVersion&&"wrong"==b)return[a,"incorrect"]}else if(a.match(/^cmi\.objectives\.\d+\.status$/)&&"2004"==this._scormVersion){var f=a.replace(/\.status$/,".completion_status"),g=a.replace(/\.status$/,".success_status");if("passed"==b||"failed"==b){var h=b;b="completed",this._scormCommandSetValue(g,h)}else"incomplete"==b?this._scormCommandSetValue(g,"failed"):"completed"==b&&this._scormCommandSetValue(g,"passed");return[f,b]}return[a,b]},c._getNowTimeString=function(a){(null==a||void 0==a)&&(a=new Date);var b=this._addZero(a.getHours())+":"+this._addZero(a.getMinutes())+":"+this._addZero(a.getSeconds());return b},c._addZero=function(a){var b;return b=10>a?"0"+String(a):String(a)},c._millSec2HHMMSS=function(a){var b,c=Math.floor(a/1e3),d=Math.floor(c/60),e=Math.floor(d/60),f=a%1e3;return f=Math.floor(f/10),c%=60,d%=60,b=this._addZero(e)+":"+this._addZero(d)+":"+this._addZero(c)+"."+this._addZero(f)},c._millSec2scoTimeinterval=function(a){var b=Math.floor(a/10);return b/=100,"PT"+String(b)+"S"},c.scormCommonGetValue=function(a){var b="";switch(a){case"lesson_location":"1.2"==this._scormVersion?b="cmi.core.lesson_location":"2004"==this._scormVersion&&(b="cmi.location");break;case"suspend_data":b="cmi.suspend_data";break;case"lesson_status":"1.2"==this._scormVersion?b="cmi.core.lesson_status":"2004"==this._scormVersion&&(b="cmi.completion_status");break;case"cmi.comments":"1.2"==this._scormVersion?b="cmi.comments":"2004"==this._scormVersion&&(b="cmi.comments_from_learner.0.comment");break;default:b=a}var c;return c=this._scormCommandGetValue(b)},c.scormCommonCommit=function(){this._scormCommandCommit()},c._scormCommandSetValue=function(a,b){scormCommand("LMSSetValue",a+","+b)},c._scormCommandGetValue=function(a){var b;return b=scormCommand("LMSGetValue",a)},c._scormCommandCommit=function(){scormCommand("LMSCommit","")},flipperjs.ScormManagerForFlipper=b}(window),this.flipperjs=this.flipperjs||{},function(a){var b=function(){this.thisName="ScormController"},c=b.prototype;c._scormMng,c._initializedFlg=!1,c._scormVersion,c._lastPageNo,c._suspendData,c._launch_data,c.init=function(a){this._scormVersion=a,this._init()},c._init=function(){this._scormMng=new flipperjs.ScormManagerForFlipper,this._scormMng.onInitializedScorm=jQuery.proxy(this._onInitializedScorm,this),this._scormMng.init(this._scormVersion)},c._onInitializedScorm=function(){this._lastPageNo=this._scormMng.scormCommonGetValue("lesson_location"),this._suspendData=this._scormMng.scormCommonGetValue("suspend_data"),this._launch_data=this._scormMng.scormCommonGetValue("cmi.launch_data"),this.onInitialized(this._lastPageNo,this._suspendData,this._launch_data),this._initializedFlg=!0},c.onInitialized=function(a,b,c){},c.getInitializedFlg=function(){return this._initializedFlg},c.setValue=function(a,b){this._scormMng.scormCommonSetValue(a,b)},c.getValue=function(a){return this._scormMng.scormCommonGetValue(a)},c.commit=function(){this._scormMng.scormCommonCommit()},flipperjs.ScormController=b}(window);