@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/cli.js
CHANGED
|
@@ -4570,6 +4570,32 @@ function generateLrsBridgeCode(options) {
|
|
|
4570
4570
|
}, 1000);
|
|
4571
4571
|
}
|
|
4572
4572
|
|
|
4573
|
+
// If actor is still Unknown Learner, poll for SCORM API availability
|
|
4574
|
+
// The SCORM API may not be available during <head> init but appears later
|
|
4575
|
+
// (e.g., scorm-calls.js finds and initializes it after DOM ready)
|
|
4576
|
+
if (!LRS.actor || LRS.actor.name === 'Unknown Learner' || !LRS.actor.account || LRS.actor.account.name === 'unknown') {
|
|
4577
|
+
var actorRetryCount = 0;
|
|
4578
|
+
var actorMaxRetries = 15;
|
|
4579
|
+
var actorRetryInterval = setInterval(function() {
|
|
4580
|
+
actorRetryCount++;
|
|
4581
|
+
// Check if SCORM API has become available (injected by scorm-calls.js or LMS)
|
|
4582
|
+
var hasScormApi = LRS.scormApi ||
|
|
4583
|
+
(typeof window.API !== 'undefined' && window.API) ||
|
|
4584
|
+
(typeof window.API_1484_11 !== 'undefined' && window.API_1484_11);
|
|
4585
|
+
|
|
4586
|
+
if (hasScormApi) {
|
|
4587
|
+
log('SCORM API now available (attempt ' + actorRetryCount + '), refreshing actor...');
|
|
4588
|
+
clearInterval(actorRetryInterval);
|
|
4589
|
+
LRS.refreshActor(function(actor) {
|
|
4590
|
+
log('Actor refreshed after SCORM API detected:', actor ? actor.name : 'none');
|
|
4591
|
+
});
|
|
4592
|
+
} else if (actorRetryCount >= actorMaxRetries) {
|
|
4593
|
+
log('SCORM API not found after ' + actorMaxRetries + ' attempts, actor stays as-is');
|
|
4594
|
+
clearInterval(actorRetryInterval);
|
|
4595
|
+
}
|
|
4596
|
+
}, 1000);
|
|
4597
|
+
}
|
|
4598
|
+
|
|
4573
4599
|
log('LRS bridge setup complete');
|
|
4574
4600
|
}
|
|
4575
4601
|
|