From d041c701d2e24174bd05d2cd65f56d1a66cf7d55 Mon Sep 17 00:00:00 2001 From: danielghost Date: Wed, 4 Dec 2024 17:19:55 +0000 Subject: [PATCH] Excluded SCORM 1.2 from the additional `cmi.interactions` context as it's implementation isn't as well defined or supported by many LMSs (see https://github.com/adaptlearning/adapt-contrib-spoor/issues/281#issuecomment-2508483223). --- js/scorm/wrapper.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/js/scorm/wrapper.js b/js/scorm/wrapper.js index e66565e..0d154d7 100644 --- a/js/scorm/wrapper.js +++ b/js/scorm/wrapper.js @@ -627,7 +627,7 @@ class ScormWrapper { return count === '' ? 0 : count; } - recordInteractionScorm12(id, response, correct, latency, type, correctResponsesPattern, objectiveIds) { + recordInteractionScorm12(id, response, correct, latency, type) { id = id.trim(); const cmiPrefix = `cmi.interactions.${this.getInteractionCount()}`; this.setValue(`${cmiPrefix}.id`, id); @@ -635,16 +635,6 @@ class ScormWrapper { this.setValueIfChildSupported(`${cmiPrefix}.student_response`, response); this.setValueIfChildSupported(`${cmiPrefix}.result`, correct ? 'correct' : 'wrong'); if (latency !== null && latency !== undefined) this.setValueIfChildSupported(`${cmiPrefix}.latency`, this.convertToSCORM12Time(latency)); - if (this.isChildSupported(`${cmiPrefix}.correct_responses`) && correctResponsesPattern?.length) { - correctResponsesPattern.forEach((response, index) => { - this.setValue(`${cmiPrefix}.correct_responses.${index}.pattern`, response); - }); - } - if (this.isChildSupported(`${cmiPrefix}.objectives`) && objectiveIds?.length) { - objectiveIds.forEach((id, index) => { - this.setValue(`${cmiPrefix}.objectives.${index}.id`, id); - }); - } this.setValueIfChildSupported(`${cmiPrefix}.time`, this.getCMITime()); } @@ -680,7 +670,6 @@ class ScormWrapper { } else { response = response.replace(/#/g, ','); response = this.checkResponse(response, 'choice'); - correctResponsesPattern = correctResponsesPattern.map(response => response.replace(/\[,\]/g, ',')); } const scormRecordInteraction = this.isSCORM2004() ? this.recordInteractionScorm2004 : this.recordInteractionScorm12; scormRecordInteraction.call(this, id, response, correct, latency, type, correctResponsesPattern, objectiveIds, description); @@ -692,8 +681,6 @@ class ScormWrapper { response = response.replace(/,/g, '[,]').replace(/\./g, '[.]'); } else { response = this.checkResponse(response, 'matching'); - // @todo: source prefix on target is not allowed in SCORM 1.2 - see https://github.com/adaptlearning/adapt-contrib-matching/issues/199 - correctResponsesPattern = correctResponsesPattern.map(response => response.replace(/\[\.\]/g, '.').replace(/\[,\]/g, ',')); } const scormRecordInteraction = this.isSCORM2004() ? this.recordInteractionScorm2004 : this.recordInteractionScorm12; scormRecordInteraction.call(this, id, response, correct, latency, type, correctResponsesPattern, objectiveIds, description);