@patch-adams/core 1.4.27 → 1.4.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +26 -0
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +26 -0
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +26 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4247,6 +4247,32 @@ function generateLrsBridgeCode(options) {
|
|
|
4247
4247
|
}, 1000);
|
|
4248
4248
|
}
|
|
4249
4249
|
|
|
4250
|
+
// If actor is still Unknown Learner, poll for SCORM API availability
|
|
4251
|
+
// The SCORM API may not be available during <head> init but appears later
|
|
4252
|
+
// (e.g., scorm-calls.js finds and initializes it after DOM ready)
|
|
4253
|
+
if (!LRS.actor || LRS.actor.name === 'Unknown Learner' || !LRS.actor.account || LRS.actor.account.name === 'unknown') {
|
|
4254
|
+
var actorRetryCount = 0;
|
|
4255
|
+
var actorMaxRetries = 15;
|
|
4256
|
+
var actorRetryInterval = setInterval(function() {
|
|
4257
|
+
actorRetryCount++;
|
|
4258
|
+
// Check if SCORM API has become available (injected by scorm-calls.js or LMS)
|
|
4259
|
+
var hasScormApi = LRS.scormApi ||
|
|
4260
|
+
(typeof window.API !== 'undefined' && window.API) ||
|
|
4261
|
+
(typeof window.API_1484_11 !== 'undefined' && window.API_1484_11);
|
|
4262
|
+
|
|
4263
|
+
if (hasScormApi) {
|
|
4264
|
+
log('SCORM API now available (attempt ' + actorRetryCount + '), refreshing actor...');
|
|
4265
|
+
clearInterval(actorRetryInterval);
|
|
4266
|
+
LRS.refreshActor(function(actor) {
|
|
4267
|
+
log('Actor refreshed after SCORM API detected:', actor ? actor.name : 'none');
|
|
4268
|
+
});
|
|
4269
|
+
} else if (actorRetryCount >= actorMaxRetries) {
|
|
4270
|
+
log('SCORM API not found after ' + actorMaxRetries + ' attempts, actor stays as-is');
|
|
4271
|
+
clearInterval(actorRetryInterval);
|
|
4272
|
+
}
|
|
4273
|
+
}, 1000);
|
|
4274
|
+
}
|
|
4275
|
+
|
|
4250
4276
|
log('LRS bridge setup complete');
|
|
4251
4277
|
}
|
|
4252
4278
|
|