37
37
* @license Copyright (c) 2009-2015, Cybercussion Interactive LLC
38
38
* As of 3.0.0 this code is under a Creative Commons Attribution-ShareAlike 4.0 International License.
39
39
* @requires SCOBotBase, SCOBotUtil
40
- * @version 4.0.9
40
+ * @version 4.1.0
41
41
* @param options {Object} override default values
42
42
* @constructor
43
43
*/
@@ -52,9 +52,9 @@ function SCOBot(options) {
52
52
/** @default version, createDate, modifiedDate, prefix, launch_data, interaction_mode, success_status, location, completion_status, suspend_data, mode, scaled_passing_score, totalInteractions, totalObjectives, startTime */
53
53
var Utl = SCOBotUtil , // Hook for jQuery 'like' functionality
54
54
defaults = {
55
- version : "4.0.10 " ,
55
+ version : "4.1.0 " ,
56
56
createDate : "04/07/2011 09:33AM" ,
57
- modifiedDate : "05/22/2015 03:26PM " ,
57
+ modifiedDate : "05/22/2015 05:17PM " ,
58
58
prefix : "SCOBot" ,
59
59
// SCOBot default parameters
60
60
launch_data : { } ,
@@ -105,6 +105,24 @@ function SCOBot(options) {
105
105
// End Constructor ////////
106
106
///////////////////////////
107
107
// 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
+ }
108
126
/**
109
127
* Initialize SCO
110
128
* This is commonly done on load of the web page.
@@ -119,7 +137,9 @@ function SCOBot(options) {
119
137
self . start ( ) ; // Things you'd do like getting mode, suspend data
120
138
Utl . triggerEvent ( self , "load" ) ;
121
139
} 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 ) ;
123
143
}
124
144
return lmsconnected ;
125
145
}
@@ -154,25 +174,6 @@ function SCOBot(options) {
154
174
return true ;
155
175
}
156
176
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
-
176
177
/**
177
178
* Is Bad Value
178
179
* We get a variety of responses from an LMS
0 commit comments