52 lines
125 KiB
JavaScript
52 lines
125 KiB
JavaScript
!function(){var n={"./node_modules/lodash.debounce/index.js":
|
|
/*!***********************************************!*\
|
|
!*** ./node_modules/lodash.debounce/index.js ***!
|
|
\***********************************************/function(e,s,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(){return f.Date.now()}var r=NaN,i="[object Symbol]",o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt,t="object"==(void 0===t.g?"undefined":n(t.g))&&t.g&&t.g.Object===Object&&t.g,h="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,f=t||h||Function("return this")(),d=Object.prototype.toString,w=Math.max,M=Math.min;function _(e){var t=n(e);return e&&("object"==t||"function"==t)}function m(e){return"symbol"==n(e)||!!(t=e)&&"object"==n(t)&&d.call(e)==i;var t}function b(e){if("number"==typeof e)return e;if(m(e))return r;if("string"!=typeof(e=_(e)?_(t="function"==typeof e.valueOf?e.valueOf():e)?t+"":t:e))return 0===e?e:+e;e=e.replace(o,"");var t=c.test(e);return t||l.test(e)?u(e.slice(2),t?2:8):a.test(e)?r:+e}e.exports=function(h,n,e){var r,i,o,a,s,c,l=0,f=!1,u=!1,t=!0;if("function"!=typeof h)throw new TypeError("Expected a function");function d(e){var t=r,n=i;return r=i=void 0,l=e,a=h.apply(n,t)}function m(e){var t=e-c;return void 0===c||n<=t||t<0||u&&o<=e-l}function p(){var e,t=v();if(m(t))return y(t);s=setTimeout(p,(e=n-((t=t)-c),u?M(e,o-(t-l)):e))}function y(e){return s=void 0,t&&r?d(e):(r=i=void 0,a)}function g(){var e=v(),t=m(e);if(r=arguments,i=this,c=e,t){if(void 0===s)return l=e=c,s=setTimeout(p,n),f?d(e):a;if(u)return s=setTimeout(p,n),d(c)}return void 0===s&&(s=setTimeout(p,n)),a}return n=b(n)||0,_(e)&&(f=!!e.leading,u="maxWait"in e,o=u?w(b(e.maxWait)||0,n):o,t="trailing"in e?!!e.trailing:t),g.cancel=function(){void 0!==s&&clearTimeout(s),r=c=i=s=void(l=0)},g.flush=function(){return void 0===s?a:y(v())},g}},"./src/AICC.js":
|
|
/*!*********************!*\
|
|
!*** ./src/AICC.js ***!
|
|
\*********************/function(r,e,t){"use strict";t.r(e),t.d(e,{default:function(){return d}});var e=t(/*! ./Scorm12API */"./src/Scorm12API.js"),o=t(/*! ./cmi/aicc_cmi */"./src/cmi/aicc_cmi.js"),h=t(/*! ./cmi/scorm12_cmi */"./src/cmi/scorm12_cmi.js");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function a(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?n(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(r)return r=Object.getOwnPropertyDescriptor(r,t),r.get?r.get.call(arguments.length<3?e:n):r.value}).apply(this,arguments)}function l(e,t){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=u(n),t=(e=r?(e=u(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=function(e){var t=i;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e);var n,r=f(i);function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");var e=a(a({},{mastery_override:!1}),e);return(e=r.call(this,e)).cmi=new o.CMI,e.nav=new h.NAV,e}return t=i,(e=[{key:"getChildElement",value:function(e,t,n){t=c(u(i.prototype),"getChildElement",this).call(this,e,t,n);return t||(this.stringMatches(e,"cmi\\.evaluation\\.comments\\.\\d+")?t=new o.CMIEvaluationCommentsObject:this.stringMatches(e,"cmi\\.student_data\\.tries\\.\\d+")?t=new o.CMITriesObject:this.stringMatches(e,"cmi\\.student_data\\.attempt_records\\.\\d+")&&(t=new o.CMIAttemptRecordsObject)),t}},{key:"replaceWithAnotherScormAPI",value:function(e){this.cmi=e.cmi,this.nav=e.nav}}])&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(e.default)},"./src/BaseAPI.js":
|
|
/*!************************!*\
|
|
!*** ./src/BaseAPI.js ***!
|
|
\************************/function(t,n,e){"use strict";e.r(n),e.d(n,{default:function(){return k}});var p=e(/*! ./cmi/common */"./src/cmi/common.js"),l=e(/*! ./exceptions */"./src/exceptions.js"),n=e(/*! ./constants/error_codes */"./src/constants/error_codes.js"),u=e(/*! ./constants/api_constants */"./src/constants/api_constants.js"),h=e(/*! ./utilities */"./src/utilities.js"),y=e(/*! lodash.debounce */"./node_modules/lodash.debounce/index.js"),g=e.n(y);function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e,t,n){return t&&E(e.prototype,t),n&&E(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function f(e,t){t=I(e,t,"get");return t.get?t.get.call(e):t.value}function o(e,t,n){var t=I(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function I(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var d=u.default.global,C=n.default.scorm12,a=new WeakMap,m=new WeakMap,r=new WeakMap,k=function(){function n(e,t){if(M(this,n),i(this,a,{writable:!0,value:void 0}),i(this,m,{writable:!0,value:void 0}),i(this,r,{writable:!0,value:{autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendBeaconCommit:!1,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:d.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){var t;return void 0!==e&&(null!==(t=JSON.parse(e.responseText))&&{}.hasOwnProperty.call(t,"result")||(t={},200===e.status?(t.result=d.SCORM_TRUE,t.errorCode=0):(t.result=d.SCORM_FALSE,t.errorCode=101))),t},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case d.LOG_LEVEL_ERROR:console.error(t);break;case d.LOG_LEVEL_WARNING:console.warn(t);break;case d.LOG_LEVEL_INFO:console.info(t);break;case d.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},fetchKeepalive:function(){return!0}}}),O(this,"cmi",void 0),O(this,"startingData",void 0),(this instanceof n?this.constructor:void 0)===n)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=d.STATE_NOT_INITIALIZED,this.lastErrorCode=0,this.listenerArray=[],o(this,a,null),o(this,m,e),this.settings=t,this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return S(n,[{key:"initialize",value:function(e,t,n){var r=d.SCORM_FALSE;return this.isTerminated()?this.throwSCORMError(f(this,m).TERMINATED,n):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=d.STATE_INITIALIZED,this.lastErrorCode=0,r=d.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,null,"returned: "+r,d.LOG_LEVEL_INFO),this.clearSCORMError(r),r}},{key:"error_codes",get:function(){return f(this,m)}},{key:"settings",get:function(){return f(this,r)},set:function(e){o(this,r,s(s({},f(this,r)),e))}},{key:"terminate",value:function(e,t){var n,r=d.SCORM_FALSE;return this.checkState(t,f(this,m).TERMINATION_BEFORE_INIT,f(this,m).MULTIPLE_TERMINATION)&&(this.currentState=d.STATE_TERMINATED,n=this.storeData(!0),!this.settings.sendBeaconCommit&&!this.settings.asyncCommit&&void 0!==n.errorCode&&0<n.errorCode&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:d.SCORM_FALSE,t&&(this.lastErrorCode=0),r=d.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,null,"returned: "+r,d.LOG_LEVEL_INFO),this.clearSCORMError(r),r}},{key:"getValue",value:function(e,t,n){var r;if(this.checkState(t,f(this,m).RETRIEVE_BEFORE_INIT,f(this,m).RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode=0);try{r=this.getCMIValue(n)}catch(e){e instanceof l.ValidationError?(this.lastErrorCode=e.errorCode,r=d.SCORM_FALSE):(e.message?console.error(e.message):console.error(e),this.throwSCORMError(f(this,m).GENERAL))}this.processListeners(e,n)}return this.apiLog(e,n,": returned: "+r,d.LOG_LEVEL_INFO),this.clearSCORMError(r),r}},{key:"setValue",value:function(e,t,n,r,i){void 0!==i&&(i=String(i));var o=d.SCORM_FALSE;if(this.checkState(n,f(this,m).STORE_BEFORE_INIT,f(this,m).STORE_AFTER_TERM)){n&&(this.lastErrorCode=0);try{o=this.setCMIValue(r,i)}catch(e){e instanceof l.ValidationError?(this.lastErrorCode=e.errorCode,o=d.SCORM_FALSE):(e.message?console.error(e.message):console.error(e),this.throwSCORMError(f(this,m).GENERAL))}this.processListeners(e,r,i)}return void 0===o&&(o=d.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!f(this,a)&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,r,": "+i+": result: "+o,d.LOG_LEVEL_INFO),this.clearSCORMError(o),o}},{key:"commit",value:function(e,t){this.clearScheduledCommit();var n,r=d.SCORM_FALSE;return this.checkState(t,f(this,m).COMMIT_BEFORE_INIT,f(this,m).COMMIT_AFTER_TERM)&&(n=this.storeData(!1),!this.settings.sendBeaconCommit&&!this.settings.asyncCommit&&n.errorCode&&0<n.errorCode&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:d.SCORM_FALSE,this.apiLog(e,"HttpRequest"," Result: "+r,d.LOG_LEVEL_DEBUG),t&&(this.lastErrorCode=0),this.processListeners(e)),this.apiLog(e,null,"returned: "+r,d.LOG_LEVEL_INFO),this.clearSCORMError(r),r}},{key:"getLastError",value:function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,null,"returned: "+t,d.LOG_LEVEL_INFO),t}},{key:"getErrorString",value:function(e,t){var n="";return null!==t&&""!==t&&(n=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,null,"returned: "+n,d.LOG_LEVEL_INFO),n}},{key:"getDiagnostic",value:function(e,t){var n="";return null!==t&&""!==t&&(n=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,null,"returned: "+n,d.LOG_LEVEL_INFO),n}},{key:"checkState",value:function(e,t,n){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(n),!1)}},{key:"apiLog",value:function(e,t,n,r){n=this.formatMessage(e,t,n),r>=this.apiLogLevel&&this.settings.onLogMessage(r,n)}},{key:"formatMessage",value:function(e,t,n){for(var r="",i=20-(r+=e).length,o=0;o<i;o++)r+=" ";if(r+=": ",t)for(var i=70-(r+=t).length,a=0;a<i;a++)r+=" ";return n&&(r+=n),r}},{key:"stringMatches",value:function(e,t){return e&&t&&e.match(t)}},{key:"_checkObjectHasProperty",value:function(e,t){return Object.hasOwnProperty.call(e,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||t in e}},{key:"getLmsErrorMessageDetails",value:function(e,t){throw new Error("The getLmsErrorMessageDetails method has not been implemented")}},{key:"getCMIValue",value:function(e){throw new Error("The getCMIValue method has not been implemented")}},{key:"setCMIValue",value:function(e,t){throw new Error("The setCMIValue method has not been implemented")}},{key:"_commonSetCMIValue",value:function(u,e,t,n){if(!t||""===t)return d.SCORM_FALSE;for(var r=t.split("."),i=this,o=d.SCORM_FALSE,a=!1,s="The data model element passed to ".concat(u," (").concat(t,") is not a valid SCORM data model element."),h=e?f(this,m).UNDEFINED_DATA_MODEL:f(this,m).GENERAL,c=0;c<r.length;c++){var l=r[c];if(c===r.length-1)e&&"{target="===l.substr(0,8)&&"function"==typeof i._isTargetValid?this.throwSCORMError(f(this,m).READ_ONLY_ELEMENT):this._checkObjectHasProperty(i,l)?(this.isInitialized()&&this.stringMatches(t,"\\.correct_responses\\.\\d+")&&this.validateCorrectResponse(t,n),e&&0!==this.lastErrorCode||(i[l]=n,o=d.SCORM_TRUE)):this.throwSCORMError(h,s);else{if(!(i=i[l])){this.throwSCORMError(h,s);break}i instanceof p.CMIArray&&(l=parseInt(r[c+1],10),isNaN(l)||((l=i.childArray[l])?(i=l,a=!0):(l=this.getChildElement(t,n,a),a=!0,l?(i.initialized&&l.initialize(),i.childArray.push(l),i=l):this.throwSCORMError(h,s)),c++))}}return o===d.SCORM_FALSE&&this.apiLog(u,null,"There was an error setting the value for: ".concat(t,", value of: ").concat(n),d.LOG_LEVEL_WARNING),o}},{key:"validateCorrectResponse",value:function(e,t){}},{key:"getChildElement",value:function(e,t,n){throw new Error("The getChildElement method has not been implemented")}},{key:"_commonGetCMIValue",value:function(e,t,n){if(!n||""===n)return"";for(var r=n.split("."),i=this,o=null,u="The data model element passed to ".concat(e," (").concat(n,") has not been initialized."),a="The data model element passed to ".concat(e," (").concat(n,") is not a valid SCORM data model element."),s=t?f(this,m).UNDEFINED_DATA_MODEL:f(this,m).GENERAL,c=0;c<r.length;c++){if(o=r[c],t){if("{target="===String(o).substr(0,8)&&"function"==typeof i._isTargetValid)return l=String(o).substr(8,String(o).length-9),i._isTargetValid(l);if(!this._checkObjectHasProperty(i,o))return void this.throwSCORMError(s,a)}else if(c===r.length-1&&!this._checkObjectHasProperty(i,o))return void this.throwSCORMError(s,a);if(void 0===(i=i[o])){this.throwSCORMError(s,a);break}if(i instanceof p.CMIArray){var l=parseInt(r[c+1],10);if(!isNaN(l)){var h=i.childArray[l];if(!h){this.throwSCORMError(f(this,m).VALUE_NOT_INITIALIZED,u);break}i=h,c++}}}if(null!=i)return i;t||("_children"===o?this.throwSCORMError(C.CHILDREN_ERROR):"_count"===o&&this.throwSCORMError(C.COUNT_ERROR))}},{key:"isInitialized",value:function(){return this.currentState===d.STATE_INITIALIZED}},{key:"isNotInitialized",value:function(){return this.currentState===d.STATE_NOT_INITIALIZED}},{key:"isTerminated",value:function(){return this.currentState===d.STATE_TERMINATED}},{key:"on",value:function(e,t){if(t)for(var n=e.split(" "),r=0;r<n.length;r++){var i=n[r].split(".");if(0===i.length)return;var o=i[0],a=null;1<i.length&&(a=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:a,callback:t}),this.apiLog("on",o,"Added event listener: ".concat(this.listenerArray.length),d.LOG_LEVEL_INFO)}}},{key:"off",value:function(r,i){var o=this;if(i)for(var a=r.split(" "),e=0;e<a.length;e++){var t=function(e){e=a[e].split(".");if(0===e.length)return{v:void 0};var t=e[0],n=null,e=(1<e.length&&(n=r.replace(t+".","")),o.listenerArray.findIndex(function(e){return e.functionName===t&&e.CMIElement===n&&e.callback===i}));-1!==e&&(o.listenerArray.splice(e,1),o.apiLog("off",t,"Removed event listener: ".concat(o.listenerArray.length),d.LOG_LEVEL_INFO))}(e);if("object"===b(t))return t.v}}},{key:"clear",value:function(r){for(var i=this,o=r.split(" "),e=0;e<o.length;e++){var t=function(e){e=o[e].split(".");if(0===e.length)return{v:void 0};var t=e[0],n=null;1<e.length&&(n=r.replace(t+".","")),i.listenerArray=i.listenerArray.filter(function(e){return e.functionName!==t&&e.CMIElement!==n})}(e);if("object"===b(t))return t.v}}},{key:"processListeners",value:function(e,t,n){this.apiLog(e,t,n);for(var r=0;r<this.listenerArray.length;r++){var i=this.listenerArray[r],o=i.functionName===e,a=!!i.CMIElement,s=!1,s=t&&i.CMIElement&&"*"===i.CMIElement.substring(i.CMIElement.length-1)?0===t.indexOf(i.CMIElement.substring(0,i.CMIElement.length-1)):i.CMIElement===t;!o||a&&!s||i.callback(t,n)}}},{key:"throwSCORMError",value:function(e,t){t=t||this.getLmsErrorMessageDetails(e),this.apiLog("throwSCORMError",null,e+": "+t,d.LOG_LEVEL_ERROR),this.lastErrorCode=String(e)}},{key:"clearSCORMError",value:function(e){void 0!==e&&e!==d.SCORM_FALSE&&(this.lastErrorCode=0)}},{key:"storeData",value:function(e){throw new Error("The storeData method has not been implemented")}},{key:"loadFromFlattenedJSON",value:function(t,n){var r,i,e,o,a=this;function s(e,t,n){var r,e=e.match(n);return null!==e&&null!==(r=t.match(n))?(t=Number(e[2]))===(n=Number(r[2]))?"id"!==e[3]&&("type"!==e[3]||"id"===r[3])?1:-1:t-n:null}this.isNotInitialized()?(r=/^(cmi\.interactions\.)(\d+)\.(.*)$/,i=/^(cmi\.objectives\.)(\d+)\.(.*)$/,(e=Object.keys(t).map(function(e){return[String(e),t[e]]})).sort(function(e,t){var e=v(e,2),n=e[0],e=(e[1],v(t,2)),t=e[0];e[1];return null!==(e=s(n,t,r))||null!==(e=s(n,t,i))?e:n<t?-1:t<n?1:0}),e.forEach(function(e){(o={})[e[0]]=e[1],a.loadFromJSON((0,h.unflatten)(o),n)})):console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.")}},{key:"loadFromJSON",value:function(e,t){if(this.isNotInitialized()){for(var n in t=void 0!==t?t:"cmi",this.startingData=e)if({}.hasOwnProperty.call(e,n)&&e[n]){var r=(t?t+".":"")+n,i=e[n];if(i.childArray)for(var o=0;o<i.childArray.length;o++)this.loadFromJSON(i.childArray[o],r+"."+o);else i.constructor===Object?this.loadFromJSON(i,r):this.setCMIValue(r,i)}}else console.error("loadFromJSON can only be called before the call to lmsInitialize.")}},{key:"renderCMIToJSONString",value:function(){var e=this.cmi;return JSON.stringify({cmi:e})}},{key:"renderCMIToJSONObject",value:function(){return JSON.parse(this.renderCMIToJSONString())}},{key:"renderCommitCMI",value:function(e){throw new Error("The storeData method has not been implemented")}},{key:"processHttpRequest",value:function(e,t){function n(e,t,n,r){var i,r={result:d.SCORM_FALSE,errorCode:r.GENERAL};if(n.sendBeaconCommit)try{t=n.requestHandler(t),fetch(e,{method:"POST",body:t instanceof Array?t.join("&"):JSON.stringify(t),headers:s(s({},n.xhrHeaders),{},{"Content-Type":n.commitRequestDataType}),credentials:n.xhrWithCredentials?"include":void 0,keepalive:n.fetchKeepalive()}),(i={}).result=d.SCORM_TRUE,i.errorCode=0}catch(e){return console.error(e),a.processListeners("CommitError"),r}else{var o=new XMLHttpRequest;o.open("POST",e,n.asyncCommit),Object.keys(n.xhrHeaders).length&&Object.keys(n.xhrHeaders).forEach(function(e){o.setRequestHeader(e,n.xhrHeaders[e])}),o.withCredentials=n.xhrWithCredentials,n.asyncCommit&&(o.onload=function(e){i="function"==typeof n.responseHandler?n.responseHandler(o):JSON.parse(o.responseText)});try{if((t=n.requestHandler(t))instanceof Array?(o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(t.join("&"))):(o.setRequestHeader("Content-Type",n.commitRequestDataType),o.send(JSON.stringify(t))),n.asyncCommit)return(i={}).result=d.SCORM_TRUE,i.errorCode=0,a.processListeners("CommitSuccess"),i;i="function"==typeof n.responseHandler?n.responseHandler(o):JSON.parse(o.responseText)}catch(e){return console.error(e),a.processListeners("CommitError"),r}}return void 0===i?(a.processListeners("CommitError"),r):(!0===i.result||i.result===d.SCORM_TRUE?a.processListeners("CommitSuccess"):a.processListeners("CommitError"),i)}var r,i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],a=this;return void 0!==g()?((r=g()(n,500))(e,t,this.settings,this.error_codes),i&&r.flush(),{result:d.SCORM_TRUE,errorCode:0}):n(e,t,this.settings,this.error_codes)}},{key:"scheduleCommit",value:function(e,t){o(this,a,new L(this,e,t)),this.apiLog("scheduleCommit","","scheduled",d.LOG_LEVEL_DEBUG)}},{key:"clearScheduledCommit",value:function(){f(this,a)&&(f(this,a).cancel(),o(this,a,null),this.apiLog("clearScheduledCommit","","cleared",d.LOG_LEVEL_DEBUG))}}]),n}(),T=new WeakMap,j=new WeakMap,c=new WeakMap,R=new WeakMap,L=function(){function r(e,t,n){M(this,r),i(this,T,{writable:!0,value:void 0}),i(this,j,{writable:!0,value:!1}),i(this,c,{writable:!0,value:void 0}),i(this,R,{writable:!0,value:void 0}),o(this,T,e),o(this,c,setTimeout(this.wrapper.bind(this),t)),o(this,R,n)}return S(r,[{key:"cancel",value:function(){o(this,j,!0),f(this,c)&&clearTimeout(f(this,c))}},{key:"wrapper",value:function(){f(this,j)||f(this,T).commit(f(this,R))}}]),r}()},"./src/Scorm12API.js":
|
|
/*!***************************!*\
|
|
!*** ./src/Scorm12API.js ***!
|
|
\***************************/function(r,e,t){"use strict";t.r(e),t.d(e,{default:function(){return y}});var e=t(/*! ./BaseAPI */"./src/BaseAPI.js"),o=t(/*! ./cmi/scorm12_cmi */"./src/cmi/scorm12_cmi.js"),a=t(/*! ./utilities */"./src/utilities.js"),n=t(/*! ./constants/api_constants */"./src/constants/api_constants.js"),t=t(/*! ./constants/error_codes */"./src/constants/error_codes.js");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function h(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=c(n),t=(e=r?(e=c(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var l=n.default.scorm12,u=n.default.global,p=t.default.scorm12,y=function(e){var t=i;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e);var n,r=m(i);function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");var e=h(h({},{mastery_override:!1}),e);return(e=r.call(this,p,e)).cmi=new o.CMI,e.nav=new o.NAV,e.LMSInitialize=e.lmsInitialize,e.LMSFinish=e.lmsFinish,e.LMSGetValue=e.lmsGetValue,e.LMSSetValue=e.lmsSetValue,e.LMSCommit=e.lmsCommit,e.LMSGetLastError=e.lmsGetLastError,e.LMSGetErrorString=e.lmsGetErrorString,e.LMSGetDiagnostic=e.lmsGetDiagnostic,e}return t=i,(e=[{key:"lmsInitialize",value:function(){return this.cmi.initialize(),this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")}},{key:"lmsFinish",value:function(){var e=this.terminate("LMSFinish",!0);return e===u.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),e}},{key:"lmsGetValue",value:function(e){return this.getValue("LMSGetValue",!1,e)}},{key:"lmsSetValue",value:function(e,t){return this.setValue("LMSSetValue","LMSCommit",!1,e,t)}},{key:"lmsCommit",value:function(){return this.commit("LMSCommit",!1)}},{key:"lmsGetLastError",value:function(){return this.getLastError("LMSGetLastError")}},{key:"lmsGetErrorString",value:function(e){return this.getErrorString("LMSGetErrorString",e)}},{key:"lmsGetDiagnostic",value:function(e){return this.getDiagnostic("LMSGetDiagnostic",e)}},{key:"setCMIValue",value:function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)}},{key:"getCMIValue",value:function(e){return this._commonGetCMIValue("getCMIValue",!1,e)}},{key:"getChildElement",value:function(e,t,n){var r;return this.stringMatches(e,"cmi\\.objectives\\.\\d+")?r=new o.CMIObjectivesObject:n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?r=new o.CMIInteractionsCorrectResponsesObject:n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?r=new o.CMIInteractionsObjectivesObject:!n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+")&&(r=new o.CMIInteractionsObject),r}},{key:"validateCorrectResponse",value:function(e,t){return!0}},{key:"getLmsErrorMessageDetails",value:function(e,t){var n="No Error",r="No Error";return e=String(e),l.error_descriptions[e]&&(n=l.error_descriptions[e].basicMessage,r=l.error_descriptions[e].detailMessage),t?r:n}},{key:"replaceWithAnotherScormAPI",value:function(e){this.cmi=e.cmi}},{key:"renderCommitCMI",value:function(e){var t=this.renderCMIToJSONObject(),n=(e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime()),[]),r=a.flatten(t);switch(this.settings.dataCommitFormat){case"flattened":return a.flatten(t);case"params":for(var i in r)!{}.hasOwnProperty.call(r,i)||n.push("".concat(i,"=").concat(r[i]));return n;default:return t}}},{key:"storeData",value:function(e){e&&("not attempted"===(t=this.cmi.core.lesson_status)&&(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?this.cmi.core.lesson_status="passed":this.cmi.core.lesson_status="failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(i=this.startingData)||void 0===i||null===(n=i.cmi)||void 0===n||null===(r=n.core)||void 0===r?void 0:r.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed"));var t,n,r,i=this.renderCommitCMI(e||this.settings.alwaysSendTotalTime);return this.apiLogLevel===u.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),this.settings.lmsCommitUrl?this.processHttpRequest(this.settings.lmsCommitUrl,i,e):u.SCORM_TRUE}}])&&f(t.prototype,e),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(e.default)},"./src/Scorm2004API.js":
|
|
/*!*****************************!*\
|
|
!*** ./src/Scorm2004API.js ***!
|
|
\*****************************/function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return I}});var e=t(/*! ./BaseAPI */"./src/BaseAPI.js"),a=t(/*! ./cmi/scorm2004_cmi */"./src/cmi/scorm2004_cmi.js"),o=t(/*! ./utilities */"./src/utilities.js"),r=t(/*! ./constants/api_constants */"./src/constants/api_constants.js"),f=t(/*! ./constants/error_codes */"./src/constants/error_codes.js"),d=t(/*! ./constants/response_constants */"./src/constants/response_constants.js"),m=t(/*! ./constants/language_constants */"./src/constants/language_constants.js"),t=t(/*! ./constants/regex */"./src/constants/regex.js");function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach(function(e){w(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t){return(_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function b(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=i(n),t=(e=r?(e=i(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function E(e,t){t=function(e,t,n){if(t.has(e))return t.get(e);throw new TypeError("attempted to "+n+" private field on non-instance")}(e,t,"get");return t.get?t.get.call(e):t.value}var c=r.default.scorm2004,l=r.default.global,u=f.default.scorm2004,h=d.default.correct,S=t.default.scorm2004,O=new WeakMap,I=function(e){var t=i;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_(t,e);var n,r=b(i);function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");var e=g(g({},{mastery_override:!1}),e);return M(s(e=r.call(this,u,e)),O,{writable:!0,value:void 0}),w(s(e),"checkDuplicatedPattern",function(e,t,n){for(var r=!1,i=e._count,o=0;o<i&&!r;o++)o!==t&&e.childArray[o]===n&&(r=!0);return r}),e.cmi=new a.CMI,e.adl=new a.ADL,e.Initialize=e.lmsInitialize,e.Terminate=e.lmsTerminate,e.GetValue=e.lmsGetValue,e.SetValue=e.lmsSetValue,e.Commit=e.lmsCommit,e.GetLastError=e.lmsGetLastError,e.GetErrorString=e.lmsGetErrorString,e.GetDiagnostic=e.lmsGetDiagnostic,e}return t=i,(e=[{key:"version",get:function(){return E(this,O)}},{key:"lmsInitialize",value:function(){return this.cmi.initialize(),this.initialize("Initialize")}},{key:"lmsTerminate",value:function(){var e=this.terminate("Terminate",!0);if(e===l.SCORM_TRUE)if("_none_"!==this.adl.nav.request)switch(this.adl.nav.request){case"continue":this.processListeners("SequenceNext");break;case"previous":this.processListeners("SequencePrevious");break;case"choice":this.processListeners("SequenceChoice");break;case"exit":this.processListeners("SequenceExit");break;case"exitAll":this.processListeners("SequenceExitAll");break;case"abandon":this.processListeners("SequenceAbandon");break;case"abandonAll":this.processListeners("SequenceAbandonAll")}else this.settings.autoProgress&&this.processListeners("SequenceNext");return e}},{key:"lmsGetValue",value:function(e){return this.getValue("GetValue",!0,e)}},{key:"lmsSetValue",value:function(e,t){return this.setValue("SetValue","Commit",!0,e,t)}},{key:"lmsCommit",value:function(){return this.commit("Commit")}},{key:"lmsGetLastError",value:function(){return this.getLastError("GetLastError")}},{key:"lmsGetErrorString",value:function(e){return this.getErrorString("GetErrorString",e)}},{key:"lmsGetDiagnostic",value:function(e){return this.getDiagnostic("GetDiagnostic",e)}},{key:"setCMIValue",value:function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)}},{key:"getChildElement",value:function(e,t,n){var r,i,o;return this.stringMatches(e,"cmi\\.objectives\\.\\d+")?r=new a.CMIObjectivesObject:n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?(i=e.split("."),i=Number(i[2]),i=this.cmi.interactions.childArray[i],this.isInitialized()&&(i.type?(this.checkDuplicateChoiceResponse(i,t),(o=h[i.type])?this.checkValidResponseType(o,t,i.type):this.throwSCORMError(u.GENERAL_SET_FAILURE,"Incorrect Response Type: "+i.type)):this.throwSCORMError(u.DEPENDENCY_NOT_ESTABLISHED)),0===this.lastErrorCode&&(r=new a.CMIInteractionsCorrectResponsesObject)):n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?r=new a.CMIInteractionsObjectivesObject:!n&&this.stringMatches(e,"cmi\\.interactions\\.\\d+")?r=new a.CMIInteractionsObject:this.stringMatches(e,"cmi\\.comments_from_learner\\.\\d+")?r=new a.CMICommentsObject:this.stringMatches(e,"cmi\\.comments_from_lms\\.\\d+")&&(r=new a.CMICommentsObject(!0)),r}},{key:"checkValidResponseType",value:function(e,t,n){var r=[];null!=e&&e.delimiter?r=String(t).split(e.delimiter):r[0]=t,0<r.length&&r.length<=e.max?this.checkCorrectResponseValue(n,r,t):r.length>e.max&&this.throwSCORMError(u.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")}},{key:"checkDuplicateChoiceResponse",value:function(e,t){var n=e.correct_responses._count;if("choice"===e.type)for(var r=0;r<n&&0===this.lastErrorCode;r++)e.correct_responses.childArray[r].pattern===t&&this.throwSCORMError(u.GENERAL_SET_FAILURE)}},{key:"validateCorrectResponse",value:function(e,t){var e=e.split("."),n=Number(e[2]),e=Number(e[4]),n=this.cmi.interactions.childArray[n],r=n.correct_responses._count,i=(this.checkDuplicateChoiceResponse(n,t),h[n.type]);void 0===i.limit||r<=i.limit?(this.checkValidResponseType(i,t,n.type),0===this.lastErrorCode&&(!i.duplicate||!this.checkDuplicatedPattern(n.correct_responses,e,t))||0===this.lastErrorCode&&""===t||0===this.lastErrorCode&&this.throwSCORMError(u.GENERAL_SET_FAILURE,"Data Model Element Pattern Already Exists")):this.throwSCORMError(u.GENERAL_SET_FAILURE,"Data Model Element Collection Limit Reached")}},{key:"getCMIValue",value:function(e){return this._commonGetCMIValue("GetValue",!0,e)}},{key:"getLmsErrorMessageDetails",value:function(e,t){var n="",r="";return e=String(e),c.error_descriptions[e]&&(n=c.error_descriptions[e].basicMessage,r=c.error_descriptions[e].detailMessage),t?r:n}},{key:"checkCorrectResponseValue",value:function(e,t,n){for(var r=h[e],i=new RegExp(r.format),o=0;o<t.length&&0===this.lastErrorCode;o++)if(e.match("^(fill-in|long-fill-in|matching|performance|sequencing)$")&&(t[o]=this.removeCorrectResponsePrefixes(t[o])),null!=r&&r.delimiter2){var a=t[o].split(r.delimiter2);2===a.length&&a[0].match(i)&&a[1].match(new RegExp(r.format2))||this.throwSCORMError(u.TYPE_MISMATCH)}else{a=t[o].match(i);if(!a&&""!==n||!a&&"true-false"===e)this.throwSCORMError(u.TYPE_MISMATCH);else if("numeric"===e&&1<t.length)Number(t[0])>Number(t[1])&&this.throwSCORMError(u.TYPE_MISMATCH);else if(""!==t[o]&&r.unique)for(var s=0;s<o&&0===this.lastErrorCode;s++)t[o]===t[s]&&this.throwSCORMError(u.TYPE_MISMATCH)}}},{key:"removeCorrectResponsePrefixes",value:function(e){for(var t,n=!1,r=!1,i=!1,o=new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})"),a=e.match(o);a;){switch(a[2]){case"lang":!(t=e.match(S.CMILangcr))||void 0!==(t=t[3])&&0<t.length&&void 0===m.default[t.toLowerCase()]&&this.throwSCORMError(u.TYPE_MISMATCH),i=!0;break;case"case_matters":i||n||r||"true"!==a[3]&&"false"!==a[3]&&this.throwSCORMError(u.TYPE_MISMATCH),r=!0;break;case"order_matters":r||i||n||"true"!==a[3]&&"false"!==a[3]&&this.throwSCORMError(u.TYPE_MISMATCH),n=!0}a=(e=e.substr(a[1].length)).match(o)}return e}},{key:"replaceWithAnotherScormAPI",value:function(e){this.cmi=e.cmi,this.adl=e.adl}},{key:"renderCommitCMI",value:function(e){var t=this.renderCMIToJSONObject(),n=(e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime()),[]),r=o.flatten(t);switch(this.settings.dataCommitFormat){case"flattened":return o.flatten(t);case"params":for(var i in r)!{}.hasOwnProperty.call(r,i)||n.push("".concat(i,"=").concat(r[i]));return n;default:return t}}},{key:"storeData",value:function(e){e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?(console.debug("Setting Completion Status: Completed"),this.cmi.completion_status="completed"):(console.debug("Setting Completion Status: Incomplete"),this.cmi.completion_status="incomplete")),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?(console.debug("Setting Success Status: Passed"),this.cmi.success_status="passed"):(console.debug("Setting Success Status: Failed"),this.cmi.success_status="failed")));var t,n,r=!1,i=(this.adl.nav.request!==(null===(i=this.startingData)||void 0===i||null===(n=i.adl)||void 0===n||null===(t=n.nav)||void 0===t?void 0:t.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),r=!0),this.renderCommitCMI(e||this.settings.alwaysSendTotalTime));return this.apiLogLevel===l.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),this.settings.lmsCommitUrl?(n=this.processHttpRequest(this.settings.lmsCommitUrl,i,e),r&&void 0!==n.navRequest&&""!==n.navRequest&&Function('"use strict";(() => { '.concat(n.navRequest," })()"))(),n):l.SCORM_TRUE}}])&&v(t.prototype,e),n&&v(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(e.default)},"./src/cmi/aicc_cmi.js":
|
|
/*!*****************************!*\
|
|
!*** ./src/cmi/aicc_cmi.js ***!
|
|
\*****************************/function(t,n,f){"use strict";f.r(n),f.d(n,{CMI:function(){return C},CMIAttemptRecords:function(){return he},CMIAttemptRecordsObject:function(){return de},CMIEvaluationCommentsObject:function(){return ge},CMIPaths:function(){return Q},CMIPathsObject:function(){return ae},CMIStudentDemographics:function(){return X},CMITries:function(){return se},CMITriesObject:function(){return ue}});var d=f(/*! ./scorm12_cmi */"./src/cmi/scorm12_cmi.js"),r=f(/*! ./common */"./src/cmi/common.js"),n=f(/*! ../constants/api_constants */"./src/constants/api_constants.js"),m=f(/*! ../constants/regex */"./src/constants/regex.js"),p=f(/*! ../constants/error_codes */"./src/constants/error_codes.js"),y=f(/*! ../exceptions */"./src/exceptions.js");function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function o(e,t,n){var t=v(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function e(e,t){t=v(e,t,"get");return t.get?t.get.call(e):t.value}function v(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&_(e.prototype,t),n&&_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function b(){return(b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=S(e)););return e}(e,t);if(r)return r=Object.getOwnPropertyDescriptor(r,t),r.get?r.get.call(arguments.length<3?e:n):r.value}).apply(this,arguments)}function w(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function E(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=S(n),t=(e=r?(e=S(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===g(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return c(t)}}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O=n.default.aicc,l=m.default.aicc,I=p.default.scorm12;function u(){throw new y.AICCValidationError(I.READ_ONLY_ELEMENT)}function h(e,t,n){return(0,r.checkValidFormat)(e,t,I.TYPE_MISMATCH,y.AICCValidationError,n)}var C=function(){w(r,d.CMI);var n=E(r);function r(e){var t;return a(this,r),t=n.call(this,O.cmi_children),e&&t.initialize(),t.student_preference=new P,t.student_data=new z,t.student_demographics=new X,t.evaluation=new k,t.paths=new Q,t}return s(r,[{key:"initialize",value:function(){var e;b(S(r.prototype),"initialize",this).call(this),null!==(e=this.student_preference)&&void 0!==e&&e.initialize(),null!==(e=this.student_data)&&void 0!==e&&e.initialize(),null!==(e=this.student_demographics)&&void 0!==e&&e.initialize(),null!==(e=this.evaluation)&&void 0!==e&&e.initialize(),null!==(e=this.paths)&&void 0!==e&&e.initialize()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,student_demographics:this.student_demographics,interactions:this.interactions,evaluation:this.evaluation,paths:this.paths};return delete this.jsonString,e}}]),r}(),k=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),(e=t.call(this)).comments=new T,e}return s(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.comments)&&void 0!==e&&e.initialize()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e}}]),n}(),T=function(){w(t,r.CMIArray);var e=E(t);function t(){return a(this,t),e.call(this,{children:O.comments_children,errorCode:I.INVALID_SET_VALUE,errorClass:y.AICCValidationError})}return s(t)}(),j=new WeakMap,R=new WeakMap,L=new WeakMap,A=new WeakMap,N=new WeakMap,P=function(){w(n,d.CMIStudentPreference);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this,O.student_preference_children)),j,{writable:!0,value:""}),i(c(e),R,{writable:!0,value:""}),i(c(e),L,{writable:!0,value:""}),i(c(e),A,{writable:!0,value:""}),i(c(e),N,{writable:!0,value:""}),e.windows=new r.CMIArray({errorCode:I.INVALID_SET_VALUE,errorClass:y.AICCValidationError,children:""}),e}return s(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.windows)&&void 0!==e&&e.initialize()}},{key:"lesson_type",get:function(){return e(this,j)},set:function(e){h(e,l.CMIString256)&&o(this,j,e)}},{key:"text_color",get:function(){return e(this,R)},set:function(e){h(e,l.CMIString256)&&o(this,R,e)}},{key:"text_location",get:function(){return e(this,L)},set:function(e){h(e,l.CMIString256)&&o(this,L,e)}},{key:"text_size",get:function(){return e(this,A)},set:function(e){h(e,l.CMIString256)&&o(this,A,e)}},{key:"video",get:function(){return e(this,N)},set:function(e){h(e,l.CMIString256)&&o(this,N,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,lesson_type:this.lesson_type,speed:this.speed,text:this.text,text_color:this.text_color,text_location:this.text_location,text_size:this.text_size,video:this.video,windows:this.windows};return delete this.jsonString,e}}]),n}(),D=new WeakMap,z=function(){w(n,d.CMIStudentData);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this,O.student_data_children)),D,{writable:!0,value:""}),e.tries=new se,e}return s(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.tries)&&void 0!==e&&e.initialize()}},{key:"tries_during_lesson",get:function(){return e(this,D)},set:function(e){this.initialized?u():o(this,D,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action,tries:this.tries};return delete this.jsonString,e}}]),n}(),V=new WeakMap,x=new WeakMap,W=new WeakMap,F=new WeakMap,G=new WeakMap,U=new WeakMap,B=new WeakMap,q=new WeakMap,H=new WeakMap,$=new WeakMap,J=new WeakMap,Y=new WeakMap,Z=new WeakMap,K=new WeakMap,X=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),V,{writable:!0,value:O.student_demographics_children}),i(c(e),x,{writable:!0,value:""}),i(c(e),W,{writable:!0,value:""}),i(c(e),F,{writable:!0,value:""}),i(c(e),G,{writable:!0,value:""}),i(c(e),U,{writable:!0,value:""}),i(c(e),B,{writable:!0,value:""}),i(c(e),q,{writable:!0,value:""}),i(c(e),H,{writable:!0,value:""}),i(c(e),$,{writable:!0,value:""}),i(c(e),J,{writable:!0,value:""}),i(c(e),Y,{writable:!0,value:""}),i(c(e),Z,{writable:!0,value:""}),i(c(e),K,{writable:!0,value:""}),e}return s(n,[{key:"_children",get:function(){return e(this,V)}},{key:"city",get:function(){return e(this,x)},set:function(e){this.initialized?u():o(this,x,e)}},{key:"class",get:function(){return e(this,W)},set:function(e){this.initialized?u():o(this,W,e)}},{key:"company",get:function(){return e(this,F)},set:function(e){this.initialized?u():o(this,F,e)}},{key:"country",get:function(){return e(this,G)},set:function(e){this.initialized?u():o(this,G,e)}},{key:"experience",get:function(){return e(this,U)},set:function(e){this.initialized?u():o(this,U,e)}},{key:"familiar_name",get:function(){return e(this,B)},set:function(e){this.initialized?u():o(this,B,e)}},{key:"instructor_name",get:function(){return e(this,q)},set:function(e){this.initialized?u():o(this,q,e)}},{key:"title",get:function(){return e(this,H)},set:function(e){this.initialized?u():o(this,H,e)}},{key:"native_language",get:function(){return e(this,$)},set:function(e){this.initialized?u():o(this,$,e)}},{key:"state",get:function(){return e(this,J)},set:function(e){this.initialized?u():o(this,J,e)}},{key:"street_address",get:function(){return e(this,Y)},set:function(e){this.initialized?u():o(this,Y,e)}},{key:"telephone",get:function(){return e(this,Z)},set:function(e){this.initialized?u():o(this,Z,e)}},{key:"years_experience",get:function(){return e(this,K)},set:function(e){this.initialized?u():o(this,K,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={city:this.city,class:this.class,company:this.company,country:this.country,experience:this.experience,familiar_name:this.familiar_name,instructor_name:this.instructor_name,title:this.title,native_language:this.native_language,state:this.state,street_address:this.street_address,telephone:this.telephone,years_experience:this.years_experience};return delete this.jsonString,e}}]),n}(),Q=function(){w(t,r.CMIArray);var e=E(t);function t(){return a(this,t),e.call(this,{children:O.paths_children})}return s(t)}(),ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,oe=new WeakMap,ae=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),ee,{writable:!0,value:""}),i(c(e),te,{writable:!0,value:""}),i(c(e),ne,{writable:!0,value:""}),i(c(e),re,{writable:!0,value:""}),i(c(e),ie,{writable:!0,value:""}),i(c(e),oe,{writable:!0,value:""}),e}return s(n,[{key:"location_id",get:function(){return e(this,ee)},set:function(e){h(e,l.CMIString256)&&o(this,ee,e)}},{key:"date",get:function(){return e(this,te)},set:function(e){h(e,l.CMIString256)&&o(this,te,e)}},{key:"time",get:function(){return e(this,ne)},set:function(e){h(e,l.CMITime)&&o(this,ne,e)}},{key:"status",get:function(){return e(this,re)},set:function(e){h(e,l.CMIStatus2)&&o(this,re,e)}},{key:"why_left",get:function(){return e(this,ie)},set:function(e){h(e,l.CMIString256)&&o(this,ie,e)}},{key:"time_in_element",get:function(){return e(this,oe)},set:function(e){h(e,l.CMITime)&&o(this,oe,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={location_id:this.location_id,date:this.date,time:this.time,status:this.status,why_left:this.why_left,time_in_element:this.time_in_element};return delete this.jsonString,e}}]),n}(),se=function(){w(t,r.CMIArray);var e=E(t);function t(){return a(this,t),e.call(this,{children:O.tries_children})}return s(t)}(),ce=new WeakMap,le=new WeakMap,ue=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),ce,{writable:!0,value:""}),i(c(e),le,{writable:!0,value:""}),e.score=new r.CMIScore({score_children:O.score_children,score_range:l.score_range,invalidErrorCode:I.INVALID_SET_VALUE,invalidTypeCode:I.TYPE_MISMATCH,invalidRangeCode:I.VALUE_OUT_OF_RANGE,errorClass:y.AICCValidationError}),e}return s(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.score)&&void 0!==e&&e.initialize()}},{key:"status",get:function(){return e(this,ce)},set:function(e){h(e,l.CMIStatus2)&&o(this,ce,e)}},{key:"time",get:function(){return e(this,le)},set:function(e){h(e,l.CMITime)&&o(this,le,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e}}]),n}(),he=function(){w(t,r.CMIArray);var e=E(t);function t(){return a(this,t),e.call(this,{children:O.attempt_records_children})}return s(t)}(),fe=new WeakMap,de=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),fe,{writable:!0,value:""}),e.score=new r.CMIScore({score_children:O.score_children,score_range:l.score_range,invalidErrorCode:I.INVALID_SET_VALUE,invalidTypeCode:I.TYPE_MISMATCH,invalidRangeCode:I.VALUE_OUT_OF_RANGE,errorClass:y.AICCValidationError}),e}return s(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.score)&&void 0!==e&&e.initialize()}},{key:"lesson_status",get:function(){return e(this,fe)},set:function(e){h(e,l.CMIStatus2)&&o(this,fe,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e}}]),n}(),me=new WeakMap,pe=new WeakMap,ye=new WeakMap,ge=function(){w(n,r.BaseCMI);var t=E(n);function n(){var e;return a(this,n),i(c(e=t.call(this)),me,{writable:!0,value:""}),i(c(e),pe,{writable:!0,value:""}),i(c(e),ye,{writable:!0,value:""}),e}return s(n,[{key:"content",get:function(){return e(this,me)},set:function(e){h(e,l.CMIString256)&&o(this,me,e)}},{key:"location",get:function(){return e(this,pe)},set:function(e){h(e,l.CMIString256)&&o(this,pe,e)}},{key:"time",get:function(){return e(this,ye)},set:function(e){h(e,l.CMITime)&&o(this,ye,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e}}]),n}()},"./src/cmi/common.js":
|
|
/*!***************************!*\
|
|
!*** ./src/cmi/common.js ***!
|
|
\***************************/function(n,r,e){"use strict";e.r(r),e.d(r,{BaseCMI:function(){return T},CMIArray:function(){return x},CMIScore:function(){return P},checkValidFormat:function(){return O},checkValidRange:function(){return I}});var r=e(/*! ../constants/api_constants */"./src/constants/api_constants.js"),i=e(/*! ../constants/error_codes */"./src/constants/error_codes.js"),e=e(/*! ../constants/regex */"./src/constants/regex.js");function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function s(e,t){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(n),t=(e=r?(e=l(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function d(e,t,n){var t=w(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function t(e,t){t=w(e,t,"get");return t.get?t.get.call(e):t.value}function w(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var M=r.default.scorm12,E=e.default.scorm12,S=i.default.scorm12;function O(e,t,n,r,i){t=new RegExp(t),t=e.match(t);if(i&&""===e)return!0;if(void 0===e||!t||""===t[0])throw new r.prototype.constructor(n);return!0}function I(e,t,n,r){t=t.split("#");if((e=+e)>=t[0]){if("*"===t[1]||e<=t[1])return!0;throw new r.prototype.constructor(n)}throw new r.prototype.constructor(n)}var C=new WeakMap,k=new WeakMap,T=function(){function r(){var e,t,n;if(_(this,r),n=!(t="jsonString"),t in(e=this)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,f(this,C,{writable:!0,value:!1}),f(this,k,{writable:!0,value:void 0}),(this instanceof r?this.constructor:void 0)===r)throw new TypeError("Cannot construct BaseCMI instances directly")}return b(r,[{key:"initialized",get:function(){return t(this,C)}},{key:"start_time",get:function(){return t(this,k)}},{key:"initialize",value:function(){d(this,C,!0)}},{key:"setStartTime",value:function(){d(this,k,(new Date).getTime())}}]),r}(),j=new WeakMap,m=new WeakMap,R=new WeakMap,p=new WeakMap,y=new WeakMap,g=new WeakMap,v=new WeakMap,L=new WeakMap,A=new WeakMap,N=new WeakMap,P=function(){a(u,T);var l=c(u);function u(e){var t,n=e.score_children,r=e.score_range,i=e.max,o=e.invalidErrorCode,a=e.invalidTypeCode,s=e.invalidRangeCode,c=e.decimalRegex,e=e.errorClass;return _(this,u),f(h(t=l.call(this)),j,{writable:!0,value:void 0}),f(h(t),m,{writable:!0,value:void 0}),f(h(t),R,{writable:!0,value:void 0}),f(h(t),p,{writable:!0,value:void 0}),f(h(t),y,{writable:!0,value:void 0}),f(h(t),g,{writable:!0,value:void 0}),f(h(t),v,{writable:!0,value:void 0}),f(h(t),L,{writable:!0,value:""}),f(h(t),A,{writable:!0,value:""}),f(h(t),N,{writable:!0,value:void 0}),d(h(t),j,n||M.score_children),d(h(t),m,!!r&&E.score_range),d(h(t),N,i||""===i?i:"100"),d(h(t),R,o||S.INVALID_SET_VALUE),d(h(t),p,a||S.TYPE_MISMATCH),d(h(t),y,s||S.VALUE_OUT_OF_RANGE),d(h(t),g,c||E.CMIDecimal),d(h(t),v,e),t}return b(u,[{key:"_children",get:function(){return t(this,j)},set:function(e){throw new(t(this,v).prototype.constructor)(t(this,R))}},{key:"raw",get:function(){return t(this,L)},set:function(e){!O(e,t(this,g),t(this,p),t(this,v))||t(this,m)&&!I(e,t(this,m),t(this,y),t(this,v))||d(this,L,e)}},{key:"min",get:function(){return t(this,A)},set:function(e){!O(e,t(this,g),t(this,p),t(this,v))||t(this,m)&&!I(e,t(this,m),t(this,y),t(this,v))||d(this,A,e)}},{key:"max",get:function(){return t(this,N)},set:function(e){!O(e,t(this,g),t(this,p),t(this,v))||t(this,m)&&!I(e,t(this,m),t(this,y),t(this,v))||d(this,N,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e}}]),u}(),D=new WeakMap,z=new WeakMap,V=new WeakMap,x=function(){a(o,T);var i=c(o);function o(e){var t,n=e.children,r=e.errorCode,e=e.errorClass;return _(this,o),f(h(t=i.call(this)),D,{writable:!0,value:void 0}),f(h(t),z,{writable:!0,value:void 0}),f(h(t),V,{writable:!0,value:void 0}),d(h(t),V,n),d(h(t),D,r),d(h(t),z,e),t.childArray=[],t}return b(o,[{key:"_children",get:function(){return t(this,V)},set:function(e){throw new(t(this,z).prototype.constructor)(t(this,D))}},{key:"_count",get:function(){return this.childArray.length},set:function(e){throw new(t(this,z).prototype.constructor)(t(this,D))}},{key:"toJSON",value:function(){this.jsonString=!0;for(var e={},t=0;t<this.childArray.length;t++)e[t+""]=this.childArray[t];return delete this.jsonString,e}}]),o}()},"./src/cmi/scorm12_cmi.js":
|
|
/*!********************************!*\
|
|
!*** ./src/cmi/scorm12_cmi.js ***!
|
|
\********************************/function(e,t,n){"use strict";n.r(t),n.d(t,{CMI:function(){return P},CMIInteractionsCorrectResponsesObject:function(){return Me},CMIInteractionsObject:function(){return pe},CMIInteractionsObjectivesObject:function(){return be},CMIObjectivesObject:function(){return ve},CMIStudentData:function(){return ee},CMIStudentPreference:function(){return ae},NAV:function(){return Se},check12ValidFormat:function(){return d},check12ValidRange:function(){return T},throwReadOnlyError:function(){return f},throwWriteOnlyError:function(){return C}});var i=n(/*! ./common */"./src/cmi/common.js"),t=n(/*! ../constants/api_constants */"./src/constants/api_constants.js"),c=n(/*! ../constants/error_codes */"./src/constants/error_codes.js"),m=n(/*! ../constants/regex */"./src/constants/regex.js"),r=n(/*! ../exceptions */"./src/exceptions.js"),p=n(/*! ../utilities */"./src/utilities.js");function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function b(){return(b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=S(e)););return e}(e,t);if(r)return r=Object.getOwnPropertyDescriptor(r,t),r.get?r.get.call(arguments.length<3?e:n):r.value}).apply(this,arguments)}function w(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function E(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=S(n),t=(e=r?(e=S(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function o(e,t){t=O(e,t,"get");return t.get?t.get.call(e):t.value}function h(e,t,n){var t=O(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function O(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var I=t.default.scorm12,a=m.default.scorm12,s=c.default.scorm12;function f(){throw new r.Scorm12ValidationError(s.READ_ONLY_ELEMENT)}function C(){throw new r.Scorm12ValidationError(s.WRITE_ONLY_ELEMENT)}function k(){throw new r.Scorm12ValidationError(s.INVALID_SET_VALUE)}function d(e,t,n){return(0,i.checkValidFormat)(e,t,s.TYPE_MISMATCH,r.Scorm12ValidationError,n)}function T(e,t,n){return(0,i.checkValidRange)(e,t,s.VALUE_OUT_OF_RANGE,r.Scorm12ValidationError,n)}var j=new WeakMap,R=new WeakMap,L=new WeakMap,A=new WeakMap,N=new WeakMap,P=function(){w(c,i.BaseCMI);var s=E(c);function c(e,t,n){var r,i,o,a;return g(this,c),u(l(r=s.call(this)),j,{writable:!0,value:""}),u(l(r),R,{writable:!0,value:"3.4"}),u(l(r),L,{writable:!0,value:""}),u(l(r),A,{writable:!0,value:""}),u(l(r),N,{writable:!0,value:""}),i=l(r),a=null,(o="student_data")in i?Object.defineProperty(i,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[o]=a,n&&r.initialize(),h(l(r),j,e||I.cmi_children),r.core=new J,r.objectives=new Y,r.student_data=t||new ee,r.student_preference=new ae,r.interactions=new se,r}return _(c,[{key:"initialize",value:function(){var e;b(S(c.prototype),"initialize",this).call(this),null!==(e=this.core)&&void 0!==e&&e.initialize(),null!==(e=this.objectives)&&void 0!==e&&e.initialize(),null!==(e=this.student_data)&&void 0!==e&&e.initialize(),null!==(e=this.student_preference)&&void 0!==e&&e.initialize(),null!==(e=this.interactions)&&void 0!==e&&e.initialize()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e}},{key:"_version",get:function(){return o(this,R)},set:function(e){k()}},{key:"_children",get:function(){return o(this,j)},set:function(e){k()}},{key:"suspend_data",get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)}},{key:"launch_data",get:function(){return o(this,L)},set:function(e){this.initialized?f():h(this,L,e)}},{key:"comments",get:function(){return o(this,A)},set:function(e){d(e,a.CMIString4096,!0)&&h(this,A,e)}},{key:"comments_from_lms",get:function(){return o(this,N)},set:function(e){this.initialized?f():h(this,N,e)}},{key:"getCurrentTotalTime",value:function(){return this.core.getCurrentTotalTime(this.start_time)}}]),c}(),D=new WeakMap,z=new WeakMap,V=new WeakMap,x=new WeakMap,W=new WeakMap,F=new WeakMap,G=new WeakMap,U=new WeakMap,B=new WeakMap,q=new WeakMap,H=new WeakMap,$=new WeakMap,J=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),D,{writable:!0,value:I.core_children}),u(l(e),z,{writable:!0,value:""}),u(l(e),V,{writable:!0,value:""}),u(l(e),x,{writable:!0,value:""}),u(l(e),W,{writable:!0,value:""}),u(l(e),F,{writable:!0,value:"not attempted"}),u(l(e),G,{writable:!0,value:""}),u(l(e),U,{writable:!0,value:""}),u(l(e),B,{writable:!0,value:"normal"}),u(l(e),q,{writable:!0,value:""}),u(l(e),H,{writable:!0,value:"00:00:00"}),u(l(e),$,{writable:!0,value:""}),e.score=new i.CMIScore({score_children:I.score_children,score_range:a.score_range,invalidErrorCode:s.INVALID_SET_VALUE,invalidTypeCode:s.TYPE_MISMATCH,invalidRangeCode:s.VALUE_OUT_OF_RANGE,errorClass:r.Scorm12ValidationError}),e}return _(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.score)&&void 0!==e&&e.initialize()}},{key:"_children",get:function(){return o(this,D)},set:function(e){k()}},{key:"student_id",get:function(){return o(this,z)},set:function(e){this.initialized?f():h(this,z,e)}},{key:"student_name",get:function(){return o(this,V)},set:function(e){this.initialized?f():h(this,V,e)}},{key:"lesson_location",get:function(){return o(this,x)},set:function(e){d(e,a.CMIString256,!0)&&h(this,x,e)}},{key:"credit",get:function(){return o(this,W)},set:function(e){this.initialized?f():h(this,W,e)}},{key:"lesson_status",get:function(){return o(this,F)},set:function(e){this.initialized?d(e,a.CMIStatus)&&h(this,F,e):d(e,a.CMIStatus2)&&h(this,F,e)}},{key:"entry",get:function(){return o(this,G)},set:function(e){this.initialized?f():h(this,G,e)}},{key:"total_time",get:function(){return o(this,U)},set:function(e){this.initialized?f():h(this,U,e)}},{key:"lesson_mode",get:function(){return o(this,B)},set:function(e){this.initialized?f():h(this,B,e)}},{key:"exit",get:function(){return this.jsonString?o(this,q):C()},set:function(e){d(e,a.CMIExit,!0)&&h(this,q,e)}},{key:"session_time",get:function(){return this.jsonString?o(this,H):C()},set:function(e){d(e,a.CMITimespan)&&h(this,H,e)}},{key:"suspend_data",get:function(){return o(this,$)},set:function(e){d(e,a.CMIString4096,!0)&&h(this,$,e)}},{key:"getCurrentTotalTime",value:function(e){var t=o(this,H);return null!=e&&(e=(new Date).getTime()-e,t=p.getSecondsAsHHMMSS(e/1e3)),p.addHHMMSSTimeStrings(o(this,U),t,new RegExp(a.CMITimespan))}},{key:"toJSON",value:function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e}}]),n}(),Y=function(){w(t,i.CMIArray);var e=E(t);function t(){return g(this,t),e.call(this,{children:I.objectives_children,errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError})}return _(t)}(),Z=new WeakMap,K=new WeakMap,X=new WeakMap,Q=new WeakMap,ee=function(){w(r,i.BaseCMI);var n=E(r);function r(e){var t;return g(this,r),u(l(t=n.call(this)),Z,{writable:!0,value:void 0}),u(l(t),K,{writable:!0,value:""}),u(l(t),X,{writable:!0,value:""}),u(l(t),Q,{writable:!0,value:""}),h(l(t),Z,e||I.student_data_children),t}return _(r,[{key:"_children",get:function(){return o(this,Z)},set:function(e){k()}},{key:"mastery_score",get:function(){return o(this,K)},set:function(e){this.initialized?f():h(this,K,e)}},{key:"max_time_allowed",get:function(){return o(this,X)},set:function(e){this.initialized?f():h(this,X,e)}},{key:"time_limit_action",get:function(){return o(this,Q)},set:function(e){this.initialized?f():h(this,Q,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e}}]),r}(),te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,oe=new WeakMap,ae=function(){w(r,i.BaseCMI);var n=E(r);function r(e){var t;return g(this,r),u(l(t=n.call(this)),te,{writable:!0,value:void 0}),u(l(t),ne,{writable:!0,value:""}),u(l(t),re,{writable:!0,value:""}),u(l(t),ie,{writable:!0,value:""}),u(l(t),oe,{writable:!0,value:""}),h(l(t),te,e||I.student_preference_children),t}return _(r,[{key:"_children",get:function(){return o(this,te)},set:function(e){k()}},{key:"audio",get:function(){return o(this,ne)},set:function(e){d(e,a.CMISInteger)&&T(e,a.audio_range)&&h(this,ne,e)}},{key:"language",get:function(){return o(this,re)},set:function(e){d(e,a.CMIString256)&&h(this,re,e)}},{key:"speed",get:function(){return o(this,ie)},set:function(e){d(e,a.CMISInteger)&&T(e,a.speed_range)&&h(this,ie,e)}},{key:"text",get:function(){return o(this,oe)},set:function(e){d(e,a.CMISInteger)&&T(e,a.text_range)&&h(this,oe,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e}}]),r}(),se=function(){w(t,i.CMIArray);var e=E(t);function t(){return g(this,t),e.call(this,{children:I.interactions_children,errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError})}return _(t)}(),ce=new WeakMap,le=new WeakMap,ue=new WeakMap,he=new WeakMap,fe=new WeakMap,de=new WeakMap,me=new WeakMap,pe=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),ce,{writable:!0,value:""}),u(l(e),le,{writable:!0,value:""}),u(l(e),ue,{writable:!0,value:""}),u(l(e),he,{writable:!0,value:""}),u(l(e),fe,{writable:!0,value:""}),u(l(e),de,{writable:!0,value:""}),u(l(e),me,{writable:!0,value:""}),e.objectives=new i.CMIArray({errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError,children:I.objectives_children}),e.correct_responses=new i.CMIArray({errorCode:s.INVALID_SET_VALUE,errorClass:r.Scorm12ValidationError,children:I.correct_responses_children}),e}return _(n,[{key:"initialize",value:function(){var e;b(S(n.prototype),"initialize",this).call(this),null!==(e=this.objectives)&&void 0!==e&&e.initialize(),null!==(e=this.correct_responses)&&void 0!==e&&e.initialize()}},{key:"id",get:function(){return this.jsonString?o(this,ce):C()},set:function(e){d(e,a.CMIIdentifier)&&h(this,ce,e)}},{key:"time",get:function(){return this.jsonString?o(this,le):C()},set:function(e){d(e,a.CMITime)&&h(this,le,e)}},{key:"type",get:function(){return this.jsonString?o(this,ue):C()},set:function(e){d(e,a.CMIType)&&h(this,ue,e)}},{key:"weighting",get:function(){return this.jsonString?o(this,he):C()},set:function(e){d(e,a.CMIDecimal)&&T(e,a.weighting_range)&&h(this,he,e)}},{key:"student_response",get:function(){return this.jsonString?o(this,fe):C()},set:function(e){d(e,a.CMIFeedback,!0)&&h(this,fe,e)}},{key:"result",get:function(){return this.jsonString?o(this,de):C()},set:function(e){d(e,a.CMIResult)&&h(this,de,e)}},{key:"latency",get:function(){return this.jsonString?o(this,me):C()},set:function(e){d(e,a.CMITimespan)&&h(this,me,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e}}]),n}(),ye=new WeakMap,ge=new WeakMap,ve=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),ye,{writable:!0,value:""}),u(l(e),ge,{writable:!0,value:""}),e.score=new i.CMIScore({score_children:I.score_children,score_range:a.score_range,invalidErrorCode:s.INVALID_SET_VALUE,invalidTypeCode:s.TYPE_MISMATCH,invalidRangeCode:s.VALUE_OUT_OF_RANGE,errorClass:r.Scorm12ValidationError}),e}return _(n,[{key:"id",get:function(){return o(this,ye)},set:function(e){d(e,a.CMIIdentifier)&&h(this,ye,e)}},{key:"status",get:function(){return o(this,ge)},set:function(e){d(e,a.CMIStatus2)&&h(this,ge,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e}}]),n}(),_e=new WeakMap,be=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),_e,{writable:!0,value:""}),e}return _(n,[{key:"id",get:function(){return o(this,_e)},set:function(e){d(e,a.CMIIdentifier)&&h(this,_e,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e}}]),n}(),we=new WeakMap,Me=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),we,{writable:!0,value:""}),e}return _(n,[{key:"pattern",get:function(){return this.jsonString?o(this,we):C()},set:function(e){d(e,a.CMIFeedback,!0)&&h(this,we,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={pattern:this.pattern};return delete this.jsonString,e}}]),n}(),Ee=new WeakMap,Se=function(){w(n,i.BaseCMI);var t=E(n);function n(){var e;return g(this,n),u(l(e=t.call(this)),Ee,{writable:!0,value:""}),e}return _(n,[{key:"event",get:function(){return o(this,Ee)},set:function(e){d(e,a.NAVEvent)&&h(this,Ee,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e}}]),n}()},"./src/cmi/scorm2004_cmi.js":
|
|
/*!**********************************!*\
|
|
!*** ./src/cmi/scorm2004_cmi.js ***!
|
|
\**********************************/function(e,t,n){"use strict";n.r(t),n.d(t,{ADL:function(){return ze},CMI:function(){return ee},CMICommentsObject:function(){return Le},CMIInteractionsCorrectResponsesObject:function(){return De},CMIInteractionsObject:function(){return _e},CMIInteractionsObjectivesObject:function(){return Ne},CMIObjectivesObject:function(){return Oe}});var i=n(/*! ./common */"./src/cmi/common.js"),t=n(/*! ../constants/api_constants */"./src/constants/api_constants.js"),r=n(/*! ../constants/regex */"./src/constants/regex.js"),m=n(/*! ../constants/error_codes */"./src/constants/error_codes.js"),p=n(/*! ../constants/response_constants */"./src/constants/response_constants.js"),y=n(/*! ../exceptions */"./src/exceptions.js"),g=n(/*! ../utilities */"./src/utilities.js");function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&b(e.prototype,t),n&&b(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function w(){return(w="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}(e,t);if(r)return r=Object.getOwnPropertyDescriptor(r,t),r.get?r.get.call(arguments.length<3?e:n):r.value}).apply(this,arguments)}function M(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&E(e,t)}function E(e,t){return(E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function S(n){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=O(n),t=(e=r?(e=O(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function l(e,t,n){var t=I(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function u(e,t){t=I(e,t,"get");return t.get?t.get.call(e):t.value}function I(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var C=t.default.scorm2004,k=m.default.scorm2004,T=p.default.learner,h=r.default.scorm2004;function f(){throw new y.Scorm2004ValidationError(k.READ_ONLY_ELEMENT)}function j(){throw new y.Scorm2004ValidationError(k.WRITE_ONLY_ELEMENT)}function R(){throw new y.Scorm2004ValidationError(k.TYPE_MISMATCH)}function L(){throw new y.Scorm2004ValidationError(k.DEPENDENCY_NOT_ESTABLISHED)}function d(e,t,n){return(0,i.checkValidFormat)(e,t,k.TYPE_MISMATCH,y.Scorm2004ValidationError,n)}function A(e,t){return(0,i.checkValidRange)(e,t,k.VALUE_OUT_OF_RANGE,y.Scorm2004ValidationError)}var N=new WeakMap,P=new WeakMap,D=new WeakMap,z=new WeakMap,V=new WeakMap,x=new WeakMap,W=new WeakMap,F=new WeakMap,G=new WeakMap,U=new WeakMap,B=new WeakMap,q=new WeakMap,H=new WeakMap,$=new WeakMap,J=new WeakMap,Y=new WeakMap,Z=new WeakMap,K=new WeakMap,X=new WeakMap,Q=new WeakMap,ee=function(){M(r,i.BaseCMI);var n=S(r);function r(e){var t;return o(this,r),c(s(t=n.call(this)),N,{writable:!0,value:"1.0"}),c(s(t),P,{writable:!0,value:C.cmi_children}),c(s(t),D,{writable:!0,value:"unknown"}),c(s(t),z,{writable:!0,value:""}),c(s(t),V,{writable:!0,value:"credit"}),c(s(t),x,{writable:!0,value:""}),c(s(t),W,{writable:!0,value:""}),c(s(t),F,{writable:!0,value:""}),c(s(t),G,{writable:!0,value:""}),c(s(t),U,{writable:!0,value:""}),c(s(t),B,{writable:!0,value:""}),c(s(t),q,{writable:!0,value:""}),c(s(t),H,{writable:!0,value:"normal"}),c(s(t),$,{writable:!0,value:""}),c(s(t),J,{writable:!0,value:""}),c(s(t),Y,{writable:!0,value:"PT0H0M0S"}),c(s(t),Z,{writable:!0,value:"unknown"}),c(s(t),K,{writable:!0,value:""}),c(s(t),X,{writable:!0,value:"continue,no message"}),c(s(t),Q,{writable:!0,value:""}),t.learner_preference=new ae,t.score=new Ce,t.comments_from_learner=new ue,t.comments_from_lms=new le,t.interactions=new se,t.objectives=new ce,e&&t.initialize(),t}return a(r,[{key:"initialize",value:function(){var e;w(O(r.prototype),"initialize",this).call(this),null!==(e=this.learner_preference)&&void 0!==e&&e.initialize(),null!==(e=this.score)&&void 0!==e&&e.initialize(),null!==(e=this.comments_from_learner)&&void 0!==e&&e.initialize(),null!==(e=this.comments_from_lms)&&void 0!==e&&e.initialize(),null!==(e=this.interactions)&&void 0!==e&&e.initialize(),null!==(e=this.objectives)&&void 0!==e&&e.initialize()}},{key:"_version",get:function(){return u(this,N)},set:function(e){f()}},{key:"_children",get:function(){return u(this,P)},set:function(e){f()}},{key:"completion_status",get:function(){return u(this,D)},set:function(e){d(e,h.CMICStatus)&&l(this,D,e)}},{key:"completion_threshold",get:function(){return u(this,z)},set:function(e){this.initialized?f():l(this,z,e)}},{key:"credit",get:function(){return u(this,V)},set:function(e){this.initialized?f():l(this,V,e)}},{key:"entry",get:function(){return u(this,x)},set:function(e){this.initialized?f():l(this,x,e)}},{key:"exit",get:function(){return this.jsonString?u(this,W):j()},set:function(e){d(e,h.CMIExit,!0)&&l(this,W,e)}},{key:"launch_data",get:function(){return u(this,F)},set:function(e){this.initialized?f():l(this,F,e)}},{key:"learner_id",get:function(){return u(this,G)},set:function(e){this.initialized?f():l(this,G,e)}},{key:"learner_name",get:function(){return u(this,U)},set:function(e){this.initialized?f():l(this,U,e)}},{key:"location",get:function(){return u(this,B)},set:function(e){d(e,h.CMIString1000)&&l(this,B,e)}},{key:"max_time_allowed",get:function(){return u(this,q)},set:function(e){this.initialized?f():l(this,q,e)}},{key:"mode",get:function(){return u(this,H)},set:function(e){this.initialized?f():l(this,H,e)}},{key:"progress_measure",get:function(){return u(this,$)},set:function(e){d(e,h.CMIDecimal)&&A(e,h.progress_range)&&l(this,$,e)}},{key:"scaled_passing_score",get:function(){return u(this,J)},set:function(e){this.initialized?f():l(this,J,e)}},{key:"session_time",get:function(){return this.jsonString?u(this,Y):j()},set:function(e){d(e,h.CMITimespan)&&l(this,Y,e)}},{key:"success_status",get:function(){return u(this,Z)},set:function(e){d(e,h.CMISStatus)&&l(this,Z,e)}},{key:"suspend_data",get:function(){return u(this,K)},set:function(e){d(e,h.CMIString64000,!0)&&l(this,K,e)}},{key:"time_limit_action",get:function(){return u(this,X)},set:function(e){this.initialized?f():l(this,X,e)}},{key:"total_time",get:function(){return u(this,Q)},set:function(e){this.initialized?f():l(this,Q,e)}},{key:"getCurrentTotalTime",value:function(){var e=u(this,Y),t=this.start_time;return null!=t&&(t=(new Date).getTime()-t,e=g.getSecondsAsISODuration(t/1e3)),g.addTwoDurations(u(this,Q),e,h.CMITimespan)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={comments_from_learner:this.comments_from_learner,comments_from_lms:this.comments_from_lms,completion_status:this.completion_status,completion_threshold:this.completion_threshold,credit:this.credit,entry:this.entry,exit:this.exit,interactions:this.interactions,launch_data:this.launch_data,learner_id:this.learner_id,learner_name:this.learner_name,learner_preference:this.learner_preference,location:this.location,max_time_allowed:this.max_time_allowed,mode:this.mode,objectives:this.objectives,progress_measure:this.progress_measure,scaled_passing_score:this.scaled_passing_score,score:this.score,session_time:this.session_time,success_status:this.success_status,suspend_data:this.suspend_data,time_limit_action:this.time_limit_action};return delete this.jsonString,e}}]),r}(),te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,oe=new WeakMap,ae=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),te,{writable:!0,value:C.student_preference_children}),c(s(e),ne,{writable:!0,value:"1"}),c(s(e),re,{writable:!0,value:""}),c(s(e),ie,{writable:!0,value:"1"}),c(s(e),oe,{writable:!0,value:"0"}),e}return a(n,[{key:"_children",get:function(){return u(this,te)},set:function(e){f()}},{key:"audio_level",get:function(){return u(this,ne)},set:function(e){d(e,h.CMIDecimal)&&A(e,h.audio_range)&&l(this,ne,e)}},{key:"language",get:function(){return u(this,re)},set:function(e){d(e,h.CMILang)&&l(this,re,e)}},{key:"delivery_speed",get:function(){return u(this,ie)},set:function(e){d(e,h.CMIDecimal)&&A(e,h.speed_range)&&l(this,ie,e)}},{key:"audio_captioning",get:function(){return u(this,oe)},set:function(e){d(e,h.CMISInteger)&&A(e,h.text_range)&&l(this,oe,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={audio_level:this.audio_level,language:this.language,delivery_speed:this.delivery_speed,audio_captioning:this.audio_captioning};return delete this.jsonString,e}}]),n}(),se=function(){M(t,i.CMIArray);var e=S(t);function t(){return o(this,t),e.call(this,{children:C.interactions_children,errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError})}return a(t)}(),ce=function(){M(t,i.CMIArray);var e=S(t);function t(){return o(this,t),e.call(this,{children:C.objectives_children,errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError})}return a(t)}(),le=function(){M(t,i.CMIArray);var e=S(t);function t(){return o(this,t),e.call(this,{children:C.comments_children,errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError})}return a(t)}(),ue=function(){M(t,i.CMIArray);var e=S(t);function t(){return o(this,t),e.call(this,{children:C.comments_children,errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError})}return a(t)}(),he=new WeakMap,fe=new WeakMap,de=new WeakMap,me=new WeakMap,pe=new WeakMap,ye=new WeakMap,ge=new WeakMap,ve=new WeakMap,_e=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),he,{writable:!0,value:""}),c(s(e),fe,{writable:!0,value:""}),c(s(e),de,{writable:!0,value:""}),c(s(e),me,{writable:!0,value:""}),c(s(e),pe,{writable:!0,value:""}),c(s(e),ye,{writable:!0,value:""}),c(s(e),ge,{writable:!0,value:""}),c(s(e),ve,{writable:!0,value:""}),e.objectives=new i.CMIArray({errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError,children:C.objectives_children}),e.correct_responses=new i.CMIArray({errorCode:k.READ_ONLY_ELEMENT,errorClass:y.Scorm2004ValidationError,children:C.correct_responses_children}),e}return a(n,[{key:"initialize",value:function(){var e;w(O(n.prototype),"initialize",this).call(this),null!==(e=this.objectives)&&void 0!==e&&e.initialize(),null!==(e=this.correct_responses)&&void 0!==e&&e.initialize()}},{key:"id",get:function(){return u(this,he)},set:function(e){d(e,h.CMILongIdentifier)&&l(this,he,e)}},{key:"type",get:function(){return u(this,fe)},set:function(e){this.initialized&&""===u(this,he)?L():d(e,h.CMIType)&&l(this,fe,e)}},{key:"timestamp",get:function(){return u(this,de)},set:function(e){this.initialized&&""===u(this,he)?L():d(e,h.CMITime)&&l(this,de,e)}},{key:"weighting",get:function(){return u(this,me)},set:function(e){this.initialized&&""===u(this,he)?L():d(e,h.CMIDecimal)&&l(this,me,e)}},{key:"learner_response",get:function(){return u(this,pe)},set:function(e){if(!this.initialized||""!==u(this,fe)&&""!==u(this,he)){var t=[],n=T[this.type];if(n){if(null!=n&&n.delimiter?t=e.split(n.delimiter):t[0]=e,!(0<t.length&&t.length<=n.max))throw new y.Scorm2004ValidationError(k.GENERAL_SET_FAILURE);for(var r=new RegExp(n.format),i=0;i<t.length;i++)if(null!=n&&n.delimiter2){var o=t[i].split(n.delimiter2);2===o.length&&o[0].match(r)&&o[1].match(new RegExp(n.format2))||R()}else if(t[i].match(r)){if(""!==t[i]&&n.unique)for(var a=0;a<i;a++)t[i]===t[a]&&R()}else R();l(this,pe,e)}else R()}else L()}},{key:"result",get:function(){return u(this,ye)},set:function(e){d(e,h.CMIResult)&&l(this,ye,e)}},{key:"latency",get:function(){return u(this,ge)},set:function(e){this.initialized&&""===u(this,he)?L():d(e,h.CMITimespan)&&l(this,ge,e)}},{key:"description",get:function(){return u(this,ve)},set:function(e){this.initialized&&""===u(this,he)?L():d(e,h.CMILangString250,!0)&&l(this,ve,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id,type:this.type,objectives:this.objectives,timestamp:this.timestamp,weighting:this.weighting,learner_response:this.learner_response,result:this.result,latency:this.latency,description:this.description,correct_responses:this.correct_responses};return delete this.jsonString,e}}]),n}(),be=new WeakMap,we=new WeakMap,Me=new WeakMap,Ee=new WeakMap,Se=new WeakMap,Oe=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),be,{writable:!0,value:""}),c(s(e),we,{writable:!0,value:"unknown"}),c(s(e),Me,{writable:!0,value:"unknown"}),c(s(e),Ee,{writable:!0,value:""}),c(s(e),Se,{writable:!0,value:""}),e.score=new Ce,e}return a(n,[{key:"initialize",value:function(){var e;w(O(n.prototype),"initialize",this).call(this),null!==(e=this.score)&&void 0!==e&&e.initialize()}},{key:"id",get:function(){return u(this,be)},set:function(e){d(e,h.CMILongIdentifier)&&l(this,be,e)}},{key:"success_status",get:function(){return u(this,we)},set:function(e){this.initialized&&""===u(this,be)?L():d(e,h.CMISStatus)&&l(this,we,e)}},{key:"completion_status",get:function(){return u(this,Me)},set:function(e){this.initialized&&""===u(this,be)?L():d(e,h.CMICStatus)&&l(this,Me,e)}},{key:"progress_measure",get:function(){return u(this,Ee)},set:function(e){this.initialized&&""===u(this,be)?L():d(e,h.CMIDecimal)&&A(e,h.progress_range)&&l(this,Ee,e)}},{key:"description",get:function(){return u(this,Se)},set:function(e){this.initialized&&""===u(this,be)?L():d(e,h.CMILangString250,!0)&&l(this,Se,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id,success_status:this.success_status,completion_status:this.completion_status,progress_measure:this.progress_measure,description:this.description,score:this.score};return delete this.jsonString,e}}]),n}(),Ie=new WeakMap,Ce=function(){M(n,i.CMIScore);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this,{score_children:C.score_children,max:"",invalidErrorCode:k.READ_ONLY_ELEMENT,invalidTypeCode:k.TYPE_MISMATCH,invalidRangeCode:k.VALUE_OUT_OF_RANGE,decimalRegex:h.CMIDecimal,errorClass:y.Scorm2004ValidationError})),Ie,{writable:!0,value:""}),e}return a(n,[{key:"scaled",get:function(){return u(this,Ie)},set:function(e){d(e,h.CMIDecimal)&&A(e,h.scaled_range)&&l(this,Ie,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={scaled:this.scaled,raw:w(O(n.prototype),"raw",this),min:w(O(n.prototype),"min",this),max:w(O(n.prototype),"max",this)};return delete this.jsonString,e}}]),n}(),ke=new WeakMap,Te=new WeakMap,je=new WeakMap,Re=new WeakMap,Le=function(){M(r,i.BaseCMI);var n=S(r);function r(){var e,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];return o(this,r),c(s(e=n.call(this)),ke,{writable:!0,value:""}),c(s(e),Te,{writable:!0,value:""}),c(s(e),je,{writable:!0,value:""}),c(s(e),Re,{writable:!0,value:void 0}),l(s(e),ke,""),l(s(e),Te,""),l(s(e),je,""),l(s(e),Re,t),e}return a(r,[{key:"comment",get:function(){return u(this,ke)},set:function(e){this.initialized&&u(this,Re)?f():d(e,h.CMILangString4000,!0)&&l(this,ke,e)}},{key:"location",get:function(){return u(this,Te)},set:function(e){this.initialized&&u(this,Re)?f():d(e,h.CMIString250)&&l(this,Te,e)}},{key:"timestamp",get:function(){return u(this,je)},set:function(e){this.initialized&&u(this,Re)?f():d(e,h.CMITime)&&l(this,je,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={comment:this.comment,location:this.location,timestamp:this.timestamp};return delete this.jsonString,e}}]),r}(),Ae=new WeakMap,Ne=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),Ae,{writable:!0,value:""}),e}return a(n,[{key:"id",get:function(){return u(this,Ae)},set:function(e){d(e,h.CMILongIdentifier)&&l(this,Ae,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e}}]),n}(),Pe=new WeakMap,De=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),Pe,{writable:!0,value:""}),e}return a(n,[{key:"pattern",get:function(){return u(this,Pe)},set:function(e){d(e,h.CMIFeedback)&&l(this,Pe,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={pattern:this.pattern};return delete this.jsonString,e}}]),n}(),ze=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),(e=t.call(this)).nav=new xe,e}return a(n,[{key:"initialize",value:function(){var e;w(O(n.prototype),"initialize",this).call(this),null!==(e=this.nav)&&void 0!==e&&e.initialize()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={nav:this.nav};return delete this.jsonString,e}}]),n}(),Ve=new WeakMap,xe=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),Ve,{writable:!0,value:"_none_"}),e.request_valid=new Ge,e}return a(n,[{key:"initialize",value:function(){var e;w(O(n.prototype),"initialize",this).call(this),null!==(e=this.request_valid)&&void 0!==e&&e.initialize()}},{key:"request",get:function(){return u(this,Ve)},set:function(e){d(e,h.NAVEvent)&&l(this,Ve,e)}},{key:"toJSON",value:function(){this.jsonString=!0;var e={request:this.request};return delete this.jsonString,e}}]),n}(),We=new WeakMap,Fe=new WeakMap,Ge=function(){M(n,i.BaseCMI);var t=S(n);function n(){var e;return o(this,n),c(s(e=t.call(this)),We,{writable:!0,value:"unknown"}),c(s(e),Fe,{writable:!0,value:"unknown"}),_(s(e),"choice",function(){return a(function e(){o(this,e),_(this,"_isTargetValid",function(e){return"unknown"})})}()),_(s(e),"jump",function(){return a(function e(){o(this,e),_(this,"_isTargetValid",function(e){return"unknown"})})}()),e}return a(n,[{key:"continue",get:function(){return u(this,We)},set:function(e){f()}},{key:"previous",get:function(){return u(this,Fe)},set:function(e){f()}},{key:"toJSON",value:function(){this.jsonString=!0;var e={previous:this.previous,continue:this.continue};return delete this.jsonString,e}}]),n}()},"./src/constants/api_constants.js":
|
|
/*!****************************************!*\
|
|
!*** ./src/constants/api_constants.js ***!
|
|
\****************************************/function(e,t,n){"use strict";function o(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function r(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}n.r(t);var n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},i=r(r({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"});t.default={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:i,scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}}},"./src/constants/error_codes.js":
|
|
/*!**************************************!*\
|
|
!*** ./src/constants/error_codes.js ***!
|
|
\**************************************/function(e,t,n){"use strict";function o(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function r(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}n.r(t);var n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},i=r(r({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),n=r(r({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408});t.default={scorm12:i,scorm2004:n}},"./src/constants/language_constants.js":
|
|
/*!*********************************************!*\
|
|
!*** ./src/constants/language_constants.js ***!
|
|
\*********************************************/function(e,t,n){"use strict";n.r(t);t.default={aa:"aa",ab:"ab",ae:"ae",af:"af",ak:"ak",am:"am",an:"an",ar:"ar",as:"as",av:"av",ay:"ay",az:"az",ba:"ba",be:"be",bg:"bg",bh:"bh",bi:"bi",bm:"bm",bn:"bn",bo:"bo",br:"br",bs:"bs",ca:"ca",ce:"ce",ch:"ch",co:"co",cr:"cr",cs:"cs",cu:"cu",cv:"cv",cy:"cy",da:"da",de:"de",dv:"dv",dz:"dz",ee:"ee",el:"el",en:"en",eo:"eo",es:"es",et:"et",eu:"eu",fa:"fa",ff:"ff",fi:"fi",fj:"fj",fo:"fo",fr:"fr",fy:"fy",ga:"ga",gd:"gd",gl:"gl",gn:"gn",gu:"gu",gv:"gv",ha:"ha",he:"he",hi:"hi",ho:"ho",hr:"hr",ht:"ht",hu:"hu",hy:"hy",hz:"hz",ia:"ia",id:"id",ie:"ie",ig:"ig",ii:"ii",ik:"ik",io:"io",is:"is",it:"it",iu:"iu",ja:"ja",jv:"jv",ka:"ka",kg:"kg",ki:"ki",kj:"kj",kk:"kk",kl:"kl",km:"km",kn:"kn",ko:"ko",kr:"kr",ks:"ks",ku:"ku",kv:"kv",kw:"kw",ky:"ky",la:"la",lb:"lb",lg:"lg",li:"li",ln:"ln",lo:"lo",lt:"lt",lu:"lu",lv:"lv",mg:"mg",mh:"mh",mi:"mi",mk:"mk",ml:"ml",mn:"mn",mo:"mo",mr:"mr",ms:"ms",mt:"mt",my:"my",na:"na",nb:"nb",nd:"nd",ne:"ne",ng:"ng",nl:"nl",nn:"nn",no:"no",nr:"nr",nv:"nv",ny:"ny",oc:"oc",oj:"oj",om:"om",or:"or",os:"os",pa:"pa",pi:"pi",pl:"pl",ps:"ps",pt:"pt",qu:"qu",rm:"rm",rn:"rn",ro:"ro",ru:"ru",rw:"rw",sa:"sa",sc:"sc",sd:"sd",se:"se",sg:"sg",sh:"sh",si:"si",sk:"sk",sl:"sl",sm:"sm",sn:"sn",so:"so",sq:"sq",sr:"sr",ss:"ss",st:"st",su:"su",sv:"sv",sw:"sw",ta:"ta",te:"te",tg:"tg",th:"th",ti:"ti",tk:"tk",tl:"tl",tn:"tn",to:"to",tr:"tr",ts:"ts",tt:"tt",tw:"tw",ty:"ty",ug:"ug",uk:"uk",ur:"ur",uz:"uz",ve:"ve",vi:"vi",vo:"vo",wa:"wa",wo:"wo",xh:"xh",yi:"yi",yo:"yo",za:"za",zh:"zh",zu:"zu",aar:"aar",abk:"abk",ave:"ave",afr:"afr",aka:"aka",amh:"amh",arg:"arg",ara:"ara",asm:"asm",ava:"ava",aym:"aym",aze:"aze",bak:"bak",bel:"bel",bul:"bul",bih:"bih",bis:"bis",bam:"bam",ben:"ben",tib:"tib",bod:"bod",bre:"bre",bos:"bos",cat:"cat",che:"che",cha:"cha",cos:"cos",cre:"cre",cze:"cze",ces:"ces",chu:"chu",chv:"chv",wel:"wel",cym:"cym",dan:"dan",ger:"ger",deu:"deu",div:"div",dzo:"dzo",ewe:"ewe",gre:"gre",ell:"ell",eng:"eng",epo:"epo",spa:"spa",est:"est",baq:"baq",eus:"eus",per:"per",fas:"fas",ful:"ful",fin:"fin",fij:"fij",fao:"fao",fre:"fre",fra:"fra",fry:"fry",gle:"gle",gla:"gla",glg:"glg",grn:"grn",guj:"guj",glv:"glv",hau:"hau",heb:"heb",hin:"hin",hmo:"hmo",hrv:"hrv",hat:"hat",hun:"hun",arm:"arm",hye:"hye",her:"her",ina:"ina",ind:"ind",ile:"ile",ibo:"ibo",iii:"iii",ipk:"ipk",ido:"ido",ice:"ice",isl:"isl",ita:"ita",iku:"iku",jpn:"jpn",jav:"jav",geo:"geo",kat:"kat",kon:"kon",kik:"kik",kua:"kua",kaz:"kaz",kal:"kal",khm:"khm",kan:"kan",kor:"kor",kau:"kau",kas:"kas",kur:"kur",kom:"kom",cor:"cor",kir:"kir",lat:"lat",ltz:"ltz",lug:"lug",lim:"lim",lin:"lin",lao:"lao",lit:"lit",lub:"lub",lav:"lav",mlg:"mlg",mah:"mah",mao:"mao",mri:"mri",mac:"mac",mkd:"mkd",mal:"mal",mon:"mon",mol:"mol",mar:"mar",may:"may",msa:"msa",mlt:"mlt",bur:"bur",mya:"mya",nau:"nau",nob:"nob",nde:"nde",nep:"nep",ndo:"ndo",dut:"dut",nld:"nld",nno:"nno",nor:"nor",nbl:"nbl",nav:"nav",nya:"nya",oci:"oci",oji:"oji",orm:"orm",ori:"ori",oss:"oss",pan:"pan",pli:"pli",pol:"pol",pus:"pus",por:"por",que:"que",roh:"roh",run:"run",rum:"rum",ron:"ron",rus:"rus",kin:"kin",san:"san",srd:"srd",snd:"snd",sme:"sme",sag:"sag",slo:"slo",sin:"sin",slk:"slk",slv:"slv",smo:"smo",sna:"sna",som:"som",alb:"alb",sqi:"sqi",srp:"srp",ssw:"ssw",sot:"sot",sun:"sun",swe:"swe",swa:"swa",tam:"tam",tel:"tel",tgk:"tgk",tha:"tha",tir:"tir",tuk:"tuk",tgl:"tgl",tsn:"tsn",ton:"ton",tur:"tur",tso:"tso",tat:"tat",twi:"twi",tah:"tah",uig:"uig",ukr:"ukr",urd:"urd",uzb:"uzb",ven:"ven",vie:"vie",vol:"vol",wln:"wln",wol:"wol",xho:"xho",yid:"yid",yor:"yor",zha:"zha",chi:"chi",zho:"zho",zul:"zul"}},"./src/constants/regex.js":
|
|
/*!********************************!*\
|
|
!*** ./src/constants/regex.js ***!
|
|
\********************************/function(e,t,n){"use strict";function o(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function r(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}n.r(t);var n={CMIString256:"^.*$",CMIString4096:"^.*$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^.*$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},i=r(r({},n),{CMIIdentifier:"^\\w{1,255}$"});t.default={aicc:i,scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|{target=\\S{0,200}[a-zA-Z0-9]}choice|jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^(previous|continue|choice.{target=\\S{0,200}[a-zA-Z0-9]})$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}}},"./src/constants/response_constants.js":
|
|
/*!*********************************************!*\
|
|
!*** ./src/constants/response_constants.js ***!
|
|
\*********************************************/function(e,t,n){"use strict";n.r(t);var n=n(/*! ./regex */"./src/constants/regex.js").default.scorm2004,r={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:n.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:n.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:n.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:n.CMIShortIdentifier,format2:n.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+n.CMIShortIdentifier,format2:n.CMIDecimal+"|^$|"+n.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:n.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:n.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:n.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:n.CMIString4000,max:1,delimiter:"",unique:!1}},n={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:n.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:n.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:n.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:n.CMIShortIdentifier,format2:n.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:"^$|"+n.CMIShortIdentifier,format2:n.CMIDecimal+"|^$|"+n.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:n.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:n.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:n.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:n.CMIString4000,limit:1}};t.default={learner:r,correct:n}},"./src/exceptions.js":
|
|
/*!***************************!*\
|
|
!*** ./src/exceptions.js ***!
|
|
\***************************/function(t,e,n){"use strict";n.r(e),n.d(e,{AICCValidationError:function(){return k},Scorm12ValidationError:function(){return C},Scorm2004ValidationError:function(){return T},ValidationError:function(){return I}});e=n(/*! ./constants/api_constants */"./src/constants/api_constants.js");function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function c(n){var r=y();return function(){var e,t=v(n);return i(this,r?(e=v(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function i(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){var n="function"==typeof Map?new Map:void 0;return function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return p(e,arguments,v(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),g(t,e)}(e)}function p(e,t,n){return(p=y()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);t=new(Function.bind.apply(e,r));return n&&g(t,n.prototype),t}).apply(null,arguments)}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function g(e,t){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){var r=e;if(t.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function b(e,t){t=M(e,t,"get");return t.get?t.get.call(e):t.value}function w(e,t,n){var t=M(e,t,"set"),r=n;if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}return n}function M(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var o=e.default.scorm12.error_descriptions,u=e.default.aicc.error_descriptions,h=e.default.scorm2004.error_descriptions,E=new WeakMap,S=new WeakMap,O=new WeakMap,I=function(){s(o,m(Error));var i=c(o);function o(e,t,n){var r;return a(this,o),_(l(r=i.call(this,t)),E,{writable:!0,value:void 0}),_(l(r),S,{writable:!0,value:void 0}),_(l(r),O,{writable:!0,value:void 0}),w(l(r),E,e),w(l(r),S,t),w(l(r),O,n),r}return r(o,[{key:"errorCode",get:function(){return b(this,E)}},{key:"errorMessage",get:function(){return b(this,S)}},{key:"detailedMessage",get:function(){return b(this,O)}}]),o}(),C=function(){s(n,I);var t=c(n);function n(e){return a(this,n),i({}.hasOwnProperty.call(o,String(e))?t.call(this,e,o[String(e)].basicMessage,o[String(e)].detailMessage):t.call(this,101,o[101].basicMessage,o[101].detailMessage))}return r(n)}(),k=function(){s(n,I);var t=c(n);function n(e){return a(this,n),i({}.hasOwnProperty.call(u,String(e))?t.call(this,e,u[String(e)].basicMessage,u[String(e)].detailMessage):t.call(this,101,u[101].basicMessage,u[101].detailMessage))}return r(n)}(),T=function(){s(n,I);var t=c(n);function n(e){return a(this,n),i({}.hasOwnProperty.call(h,String(e))?t.call(this,e,h[String(e)].basicMessage,h[String(e)].detailMessage):t.call(this,101,h[101].basicMessage,h[101].detailMessage))}return r(n)}()},"./src/utilities.js":
|
|
/*!**************************!*\
|
|
!*** ./src/utilities.js ***!
|
|
\**************************/function(u,e,t){"use strict";function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.r(e),t.d(e,{SECONDS_PER_DAY:function(){return h},SECONDS_PER_HOUR:function(){return o},SECONDS_PER_MINUTE:function(){return i},SECONDS_PER_SECOND:function(){return n},addHHMMSSTimeStrings:function(){return y},addTwoDurations:function(){return p},countDecimals:function(){return l},flatten:function(){return g},getDurationAsSeconds:function(){return c},getSecondsAsHHMMSS:function(){return d},getSecondsAsISODuration:function(){return m},getTimeAsSeconds:function(){return s},unflatten:function(){return v}});var n=1,i=60,o=60*i,h=24*o,f=[["D",h],["H",o],["M",i],["S",n]];function d(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/o),n=new Date(1e3*e),r=n.getUTCMinutes(),n=n.getSeconds(),e=e%1,i="";return 0<l(e)&&(i="."+(i=2<l(e)?e.toFixed(2):String(e)).split(".")[1]),(t+":"+r+":"+n).replace(/\b\d\b/g,"0$&")+i}function m(e){if(!e||e<=0)return"PT0S";var r="P",i=e;return f.forEach(function(e){var e=a(e,2),t=e[0],e=e[1],n=Math.floor(i/e);2<l(i%=e)&&(i=Number(Number(i).toFixed(2))),"S"===t&&0<i&&(n+=i),n&&((0<r.indexOf("D")||"H"===t||"M"===t||"S"===t)&&-1===r.indexOf("T")&&(r+="T"),r+="".concat(n).concat(t))}),r}function s(e,t){if(!e||"string"!=typeof e||!e.match(t))return 0;t=e.split(":");return 3600*Number(t[0])+60*Number(t[1])+Number(t[2])}function c(e,t){if(!e||!e.match(t))return 0;var t=a(new RegExp(t).exec(e)||[],8),e=t[1],n=(t[2],t[4]),r=t[5],i=t[6],t=t[7],o=0;return(o+=+Number(t)||0)+(60*Number(i)||0)+(3600*Number(r)||0)+(86400*Number(n)||0)+(31536e3*Number(e)||0)}function p(e,t,n){return m(c(e,n)+c(t,n))}function y(e,t,n){return d(s(e,n)+s(t,n))}function g(e){var s={};return function e(t,n){if(Object(t)!==t)s[n]=t;else if(Array.isArray(t))for(var r=0,i=t.length;r<i;r++)e(t[r],n+"["+r+"]"),0===i&&(s[n]=[]);else{var o,a=!0;for(o in t)!{}.hasOwnProperty.call(t,o)||(a=!1,e(t[o],n?n+"."+o:o));a&&n&&(s[n]={})}}(e,""),s}function v(e){if(Object(e)!==e||Array.isArray(e))return e;var t,n=/\.?([^.[\]]+)|\[(\d+)]/g,r={};for(t in e)if({}.hasOwnProperty.call(e,t)){for(var i=r,o="",a=n.exec(t);a;)i=i[o]||(i[o]=a[2]?[]:{}),o=a[2]||a[1],a=n.exec(t);i[o]=e[t]}return r[""]||r}function l(e){return!(Math.floor(e)===e||String(e).indexOf(".")<0)&&e.toString().split(".")[1].length||0}}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;t=r[e]={exports:{}};return n[e](t,t.exports,i),t.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";
|
|
/*!************************************!*\
|
|
!*** ./src/exports/scorm-again.js ***!
|
|
\************************************/i.r(o);var e=i(/*! ../Scorm2004API */"./src/Scorm2004API.js"),t=i(/*! ../Scorm12API */"./src/Scorm12API.js"),n=i(/*! ../AICC */"./src/AICC.js");window.Scorm12API=t.default,window.Scorm2004API=e.default,window.AICC=n.default}()}(); |