@@ -156,36 +156,6 @@ function SCOBotBase(options) {
156
156
return true ; // altered Jan 3rd, 2015 - this conflicted with debugging off on setObjective for QUnit test
157
157
}
158
158
159
- /**
160
- * Find API
161
- * API_1484_11 or API for SCORM 2004 or 1.2
162
- * @param win {object} Window level
163
- */
164
- function findAPI ( win ) {
165
- if ( settings . preferred_API === "findAPI" ) {
166
- var attempts = 0 , limit = 500 ;
167
- while ( ( ! win . API && ! win . API_1484_11 ) && ( win . parent ) && ( win . parent !== win ) && ( attempts <= limit ) ) {
168
- attempts += 1 ;
169
- win = win . parent ;
170
- }
171
- if ( win . API_1484_11 ) { //SCORM 2004-specific API.
172
- API . version = "2004" ;
173
- //Set version
174
- API . path = win . API_1484_11 ;
175
- } else if ( win . API ) { //SCORM 1.2-specific API
176
- API . version = "1.2" ;
177
- //Set version
178
- API . path = win . API ;
179
- } else {
180
- return false ;
181
- }
182
- return true ;
183
- } else if ( settings . preferred_API === "findSCORM12" ) {
184
- return findSCORM12 ( win ) ;
185
- }
186
- return findSCORM2004 ( win ) ;
187
- }
188
-
189
159
/**
190
160
* Find SCORM 2004
191
161
* API_1484_11
@@ -230,6 +200,37 @@ function SCOBotBase(options) {
230
200
return true ;
231
201
}
232
202
203
+ /**
204
+ * Find API
205
+ * API_1484_11 or API for SCORM 2004 or 1.2
206
+ * @param win {object} Window level
207
+ */
208
+ function findAPI ( win ) {
209
+ if ( settings . preferred_API === "findAPI" ) { // search SCORM2004, then 1.2
210
+ var attempts = 0 , limit = 500 ;
211
+ while ( ( ! win . API && ! win . API_1484_11 ) && ( win . parent ) && ( win . parent !== win ) && ( attempts <= limit ) ) {
212
+ attempts += 1 ;
213
+ win = win . parent ;
214
+ }
215
+ if ( win . API_1484_11 ) { //SCORM 2004-specific API.
216
+ API . version = "2004" ;
217
+ //Set version
218
+ API . path = win . API_1484_11 ;
219
+ } else if ( win . API ) { //SCORM 1.2-specific API
220
+ API . version = "1.2" ;
221
+ //Set version
222
+ API . path = win . API ;
223
+ } else {
224
+ return false ;
225
+ }
226
+ return true ;
227
+ }
228
+ if ( settings . preferred_API === "findSCORM12" ) { // Specifically 1.2
229
+ return findSCORM12 ( win ) ;
230
+ }
231
+ return findSCORM2004 ( win ) ; // 2004
232
+ }
233
+
233
234
// SCORM Time centric to SCORM 2004 and 1.2 Compatibility
234
235
/**
235
236
* Centiseconds To ISO Duration
0 commit comments