SCORM 2004 cmi.interactions.n.learner_response was never being set

This commit is contained in:
Jonathan Putney
2020-08-14 15:22:01 -04:00
parent 2f72c17d3a
commit e9fee3c258
5 changed files with 16 additions and 3 deletions

4
dist/scorm-again.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -936,6 +936,8 @@ export class CMIInteractionsObject extends BaseCMI {
} else { } else {
throw new ValidationError(scorm2004_error_codes.GENERAL_SET_FAILURE); throw new ValidationError(scorm2004_error_codes.GENERAL_SET_FAILURE);
} }
this.#learner_response = learner_response;
} else { } else {
throw new ValidationError(scorm2004_error_codes.TYPE_MISMATCH); throw new ValidationError(scorm2004_error_codes.TYPE_MISMATCH);
} }

View File

@@ -341,6 +341,15 @@ describe('SCORM 2004 API Tests', () => {
expect( expect(
String(scorm2004API.lmsGetLastError()) String(scorm2004API.lmsGetLastError())
).to.equal(String(0)); ).to.equal(String(0));
expect(
scorm2004API.getCMIValue('cmi.interactions.0.id')
).to.equal('Scene1_Slide3_MultiChoice_0_0');
expect(
scorm2004API.getCMIValue('cmi.interactions.0.type')
).to.equal('choice');
expect(
scorm2004API.getCMIValue('cmi.interactions.0.learner_response')
).to.equal('VP_on-call_or_President');
}); });
}); });