Forum Discussion
sourish
5 years agoCommunity Member
Storyline custom interaction tracking
Hello!
I have created a Storyline 2 custom interaction with Javascript for tracking in Moodle LMS as a SCORM package. What it does is that if a user clicks on any object in Storyline(here it is a ...
sourish
5 years agoCommunity Member
Found the solution with this code -
var player = GetPlayer();
var score1 = player.GetVar("score1");
var date = new Date();
function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);
}
var lmsAPI = findLMSAPI(this);
//this calls the SCORM API to record a custom interaction
//(strID, strResponse, blnCorrect, strCorrectResponse, strDescription, //intWeighting, intLatency, strLearningObjectiveID, dtmTime, //scormInteractionType)
lmsAPI.SCORM_RecordInteraction("marker1","m1" ,true ,"m1clicked" ,"This is Marker 1" ,score1 ,"" ,"Course1" ,date , "choice");