@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.js
CHANGED
|
@@ -4239,6 +4239,32 @@ function generateLrsBridgeCode(options) {
|
|
|
4239
4239
|
}, 1000);
|
|
4240
4240
|
}
|
|
4241
4241
|
|
|
4242
|
+
// If actor is still Unknown Learner, poll for SCORM API availability
|
|
4243
|
+
// The SCORM API may not be available during <head> init but appears later
|
|
4244
|
+
// (e.g., scorm-calls.js finds and initializes it after DOM ready)
|
|
4245
|
+
if (!LRS.actor || LRS.actor.name === 'Unknown Learner' || !LRS.actor.account || LRS.actor.account.name === 'unknown') {
|
|
4246
|
+
var actorRetryCount = 0;
|
|
4247
|
+
var actorMaxRetries = 15;
|
|
4248
|
+
var actorRetryInterval = setInterval(function() {
|
|
4249
|
+
actorRetryCount++;
|
|
4250
|
+
// Check if SCORM API has become available (injected by scorm-calls.js or LMS)
|
|
4251
|
+
var hasScormApi = LRS.scormApi ||
|
|
4252
|
+
(typeof window.API !== 'undefined' && window.API) ||
|
|
4253
|
+
(typeof window.API_1484_11 !== 'undefined' && window.API_1484_11);
|
|
4254
|
+
|
|
4255
|
+
if (hasScormApi) {
|
|
4256
|
+
log('SCORM API now available (attempt ' + actorRetryCount + '), refreshing actor...');
|
|
4257
|
+
clearInterval(actorRetryInterval);
|
|
4258
|
+
LRS.refreshActor(function(actor) {
|
|
4259
|
+
log('Actor refreshed after SCORM API detected:', actor ? actor.name : 'none');
|
|
4260
|
+
});
|
|
4261
|
+
} else if (actorRetryCount >= actorMaxRetries) {
|
|
4262
|
+
log('SCORM API not found after ' + actorMaxRetries + ' attempts, actor stays as-is');
|
|
4263
|
+
clearInterval(actorRetryInterval);
|
|
4264
|
+
}
|
|
4265
|
+
}, 1000);
|
|
4266
|
+
}
|
|
4267
|
+
|
|
4242
4268
|
log('LRS bridge setup complete');
|
|
4243
4269
|
}
|
|
4244
4270
|
|