Skip to content

Commit 1562dc1

Browse files
committed
Updating this since enough changed to 4.1.0. This includes new options for not scoring until finish, some start boolean vs. string fix which will now throw an exception if it cannot initialize.
1 parent 9a3cc88 commit 1562dc1

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

QUnit-Tests/js/scorm.bot.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

QUnit-Tests/js/scorm.bot.pack.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

QUnit-Tests/js/scorm/SCOBot.js

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* @license Copyright (c) 2009-2015, Cybercussion Interactive LLC
3838
* As of 3.0.0 this code is under a Creative Commons Attribution-ShareAlike 4.0 International License.
3939
* @requires SCOBotBase, SCOBotUtil
40-
* @version 4.0.9
40+
* @version 4.1.0
4141
* @param options {Object} override default values
4242
* @constructor
4343
*/
@@ -52,9 +52,9 @@ function SCOBot(options) {
5252
/** @default version, createDate, modifiedDate, prefix, launch_data, interaction_mode, success_status, location, completion_status, suspend_data, mode, scaled_passing_score, totalInteractions, totalObjectives, startTime */
5353
var Utl = SCOBotUtil, // Hook for jQuery 'like' functionality
5454
defaults = {
55-
version: "4.0.10",
55+
version: "4.1.0",
5656
createDate: "04/07/2011 09:33AM",
57-
modifiedDate: "05/22/2015 03:26PM",
57+
modifiedDate: "05/22/2015 05:17PM",
5858
prefix: "SCOBot",
5959
// SCOBot default parameters
6060
launch_data: {},
@@ -105,6 +105,24 @@ function SCOBot(options) {
105105
// End Constructor ////////
106106
///////////////////////////
107107
// Private ////////////////
108+
/**
109+
* Trigger Warning (internal to this API)
110+
* Throws a console log when a SCORM API Error occurs
111+
* @returns {Boolean}
112+
*/
113+
function triggerWarning(n) {
114+
scorm.debug(error[n], 2);
115+
return true;
116+
}
117+
118+
/**
119+
* Trigger Exception
120+
* Throws an event the player can listen to in order to handle an exception.
121+
* This would be common to a non-compliance in an LMS and loss of student data.
122+
*/
123+
function triggerException(msg) {
124+
Utl.triggerEvent(self, 'exception', {error: msg});
125+
}
108126
/**
109127
* Initialize SCO
110128
* This is commonly done on load of the web page.
@@ -119,7 +137,9 @@ function SCOBot(options) {
119137
self.start(); // Things you'd do like getting mode, suspend data
120138
Utl.triggerEvent(self, "load");
121139
} else {
122-
scorm.debug(settings.prefix + "Sorry, I could not locate an LMS Runtime API.");
140+
var msg = "Sorry, unable to initialize the SCORM Runtime API. Returned: " + lmsconnected;
141+
scorm.debug(settings.prefix + msg);
142+
triggerException(msg);
123143
}
124144
return lmsconnected;
125145
}
@@ -154,25 +174,6 @@ function SCOBot(options) {
154174
return true;
155175
}
156176

157-
/**
158-
* Trigger Warning (internal to this API)
159-
* Throws a console log when a SCORM API Error occurs
160-
* @returns {Boolean}
161-
*/
162-
function triggerWarning(n) {
163-
scorm.debug(error[n], 2);
164-
return true;
165-
}
166-
167-
/**
168-
* Trigger Exception
169-
* Throws an event the player can listen to in order to handle an exception.
170-
* This would be common to a non-compliance in an LMS and loss of student data.
171-
*/
172-
function triggerException(msg) {
173-
Utl.triggerEvent(self, 'exception', {error: msg});
174-
}
175-
176177
/**
177178
* Is Bad Value
178179
* We get a variety of responses from an LMS

0 commit comments

Comments
 (0)