Skip to content

Commit

Permalink
Updating this since enough changed to 4.1.0. This includes new option…
Browse files Browse the repository at this point in the history
…s for not scoring until finish, some start boolean vs. string fix which will now throw an exception if it cannot initialize.
  • Loading branch information
cybercussion committed May 23, 2015
1 parent 9a3cc88 commit 1562dc1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
6 changes: 3 additions & 3 deletions QUnit-Tests/js/scorm.bot.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion QUnit-Tests/js/scorm.bot.pack.js

Large diffs are not rendered by default.

47 changes: 24 additions & 23 deletions QUnit-Tests/js/scorm/SCOBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @license Copyright (c) 2009-2015, Cybercussion Interactive LLC
* As of 3.0.0 this code is under a Creative Commons Attribution-ShareAlike 4.0 International License.
* @requires SCOBotBase, SCOBotUtil
* @version 4.0.9
* @version 4.1.0
* @param options {Object} override default values
* @constructor
*/
Expand All @@ -52,9 +52,9 @@ function SCOBot(options) {
/** @default version, createDate, modifiedDate, prefix, launch_data, interaction_mode, success_status, location, completion_status, suspend_data, mode, scaled_passing_score, totalInteractions, totalObjectives, startTime */
var Utl = SCOBotUtil, // Hook for jQuery 'like' functionality
defaults = {
version: "4.0.10",
version: "4.1.0",
createDate: "04/07/2011 09:33AM",
modifiedDate: "05/22/2015 03:26PM",
modifiedDate: "05/22/2015 05:17PM",
prefix: "SCOBot",
// SCOBot default parameters
launch_data: {},
Expand Down Expand Up @@ -105,6 +105,24 @@ function SCOBot(options) {
// End Constructor ////////
///////////////////////////
// Private ////////////////
/**
* Trigger Warning (internal to this API)
* Throws a console log when a SCORM API Error occurs
* @returns {Boolean}
*/
function triggerWarning(n) {
scorm.debug(error[n], 2);
return true;
}

/**
* Trigger Exception
* Throws an event the player can listen to in order to handle an exception.
* This would be common to a non-compliance in an LMS and loss of student data.
*/
function triggerException(msg) {
Utl.triggerEvent(self, 'exception', {error: msg});
}
/**
* Initialize SCO
* This is commonly done on load of the web page.
Expand All @@ -119,7 +137,9 @@ function SCOBot(options) {
self.start(); // Things you'd do like getting mode, suspend data
Utl.triggerEvent(self, "load");
} else {
scorm.debug(settings.prefix + "Sorry, I could not locate an LMS Runtime API.");
var msg = "Sorry, unable to initialize the SCORM Runtime API. Returned: " + lmsconnected;
scorm.debug(settings.prefix + msg);
triggerException(msg);
}
return lmsconnected;
}
Expand Down Expand Up @@ -154,25 +174,6 @@ function SCOBot(options) {
return true;
}

/**
* Trigger Warning (internal to this API)
* Throws a console log when a SCORM API Error occurs
* @returns {Boolean}
*/
function triggerWarning(n) {
scorm.debug(error[n], 2);
return true;
}

/**
* Trigger Exception
* Throws an event the player can listen to in order to handle an exception.
* This would be common to a non-compliance in an LMS and loss of student data.
*/
function triggerException(msg) {
Utl.triggerEvent(self, 'exception', {error: msg});
}

/**
* Is Bad Value
* We get a variety of responses from an LMS
Expand Down

0 comments on commit 1562dc1

Please sign in to comment.