I'm not familiar with SCORM programming, but I'm trying to figure out how to add a way to record answers from quiz that learners choose.
I'm using a bundle of html,css,javascript with vue and bootstrap packages. The scorm that I'm using is pipwerks wrapper: https://github.com/pipwerks/scorm-api-wrapper
The only thing that I'm recording is if the user completed the lesson after the quiz:
var API = scorm.API.getHandle(),
errorCode = 0;
if (API) {
switch (scorm.version) {
case "1.2": success = makeBoolean(API.LMSSetValue(parameter, value)); break;
case "2004": success = makeBoolean(API.SetValue(parameter, value)); break;
}
if (success) {
if (parameter === "cmi.core.lesson_status" || parameter === "cmi.completion_status") {
scorm.data.completionStatus = value;
}
//Maybe add something here to record data from quiz answer
//cmi.core.entry
} else {
errorCode = debug.getCode();
trace(traceMsgPrefix + "failed. \nError code: " + errorCode + ". \nError info: " + debug.getInfo(errorCode));
}
} else {
trace(traceMsgPrefix + "failed: API is null.");
}
}
I have no idea how to write a function that will connect to each of my quiz, but I'm guessing it would be located where I've commented.
The LMS that I'm using is SabaCloud and I'm using SCORM 1.2 with imsmanifest.xml and other .xsd files.
Any help would be greatly appreciated.
In this situation you want to use cmi.interactions.
I cover this at https://github.com/cybercussion/SCOBot/wiki/SCORM-SCOBot-Documentation#set-interaction
If you don't want to use the full library the code is open source so you can harvest what you need too.