@patch-adams/core 1.5.8 → 1.5.10
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 +38 -4
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +38 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +38 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -958,12 +958,30 @@ function generateLrsBridgeCode(options) {
|
|
|
958
958
|
});
|
|
959
959
|
}
|
|
960
960
|
|
|
961
|
-
//
|
|
961
|
+
// Clean HTML entities from text \u2014 handles both proper (") and broken (quot;) forms
|
|
962
|
+
// Rise strips the & from entities in SCORM interaction IDs, so we need both
|
|
962
963
|
function decodeEntities(str) {
|
|
963
964
|
if (!str || typeof str !== 'string') return str;
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
965
|
+
// 1. Replace known broken entities (without &) that Rise leaves behind
|
|
966
|
+
str = str
|
|
967
|
+
.replace(/quot;/g, '"')
|
|
968
|
+
.replace(/apos;/g, "'")
|
|
969
|
+
.replace(/amp;/g, '&')
|
|
970
|
+
.replace(/lt;/g, '<')
|
|
971
|
+
.replace(/gt;/g, '>')
|
|
972
|
+
.replace(/nbsp;/g, ' ');
|
|
973
|
+
// 2. Replace numeric entities like " ' " etc.
|
|
974
|
+
str = str.replace(/&#(x?[0-9a-fA-F]+);/g, function(match, code) {
|
|
975
|
+
var num = code.charAt(0) === 'x' ? parseInt(code.substring(1), 16) : parseInt(code, 10);
|
|
976
|
+
return isNaN(num) ? match : String.fromCharCode(num);
|
|
977
|
+
});
|
|
978
|
+
// 3. Catch any remaining standard &entities; via textarea decode
|
|
979
|
+
try {
|
|
980
|
+
var txt = document.createElement('textarea');
|
|
981
|
+
txt.innerHTML = str;
|
|
982
|
+
str = txt.value;
|
|
983
|
+
} catch (e) {}
|
|
984
|
+
return str;
|
|
967
985
|
}
|
|
968
986
|
|
|
969
987
|
LRS.sessionId = generateUUID();
|
|
@@ -3702,6 +3720,22 @@ function generateLrsBridgeCode(options) {
|
|
|
3702
3720
|
sendStatement(statement);
|
|
3703
3721
|
};
|
|
3704
3722
|
|
|
3723
|
+
// Send a "launched" statement \u2014 called by skin after email gate / actor setup
|
|
3724
|
+
LRS.sendLaunchStatement = function(data) {
|
|
3725
|
+
data = data || {};
|
|
3726
|
+
var activityDetails = {
|
|
3727
|
+
launchSource: data.source || 'email-gate',
|
|
3728
|
+
employeeEmail: data.email || (LRS.actor && LRS.actor.mbox ? LRS.actor.mbox.replace('mailto:', '') : undefined),
|
|
3729
|
+
employeeId: data.employeeId || LRS.employeeId || undefined
|
|
3730
|
+
};
|
|
3731
|
+
|
|
3732
|
+
if (data.employeeName) activityDetails.employeeName = data.employeeName;
|
|
3733
|
+
|
|
3734
|
+
var statement = buildStatement('launched', ACTIVITY_TYPES.course, activityDetails, null, null);
|
|
3735
|
+
log('Sending launch statement for:', activityDetails.employeeEmail || '(unknown)');
|
|
3736
|
+
sendStatement(statement);
|
|
3737
|
+
};
|
|
3738
|
+
|
|
3705
3739
|
/**
|
|
3706
3740
|
* Re-extract actor from SCORM after LMSInitialize has been called.
|
|
3707
3741
|
* Call this from the SCORM wrapper after scormInit() succeeds,
|