Storyline Interactions
Aug 28, 2016
I have developed a test quiz to find out how to send interaction results to Moodle LMS. It is a totally custom quiz from blank slides without any Storyline's inbuilt quiz formats or result slide.
It will be in SCORM 1.2 format with tracking by number of slides, LMS reporting : Passed / Failed or Incomplete / Passed.
I have a JS trigger at the end of course to send the total score and status to the LMS which is working fine.
Only thing i want is :
Whenever a user selects an option (like a radio button in multiple choice) and submits the answer, i want to send the each interaction / quiz result (like score, user response, correct response, id) to Moodle just like it does with default quiz formats.
Is it possible through any Javascript trigger utilising existing Stroyline SCORM functions to manually send interaction data for each question ?
https://www.articulate.com/support/storyline/quiz-data-sent-to-an-lms-in-articulate-storyline
I have also attached the quiz which i have developed as a test.
i don't want to use SCORM 2004 because Moodle only allows 1 attempt in case of SCORM 2004 packages.
18 Replies
Hi
i think SCORM 2004 sends all details
i have found this code in the lms.js file in the lms output folder :
function RecordInteraction(arrArgs)
{
var bResult = true;
var strQuizId = arrArgs[0];
var strId = arrArgs[1];
// var strId = arrArgs[2]; // Quiz id
var strType = arrArgs[3];
var strCorrectResponse = arrArgs[4];
var strStudentResponse = arrArgs[5];
var nLatency = arrArgs[6];
var strResult = arrArgs[7];
var nPoints = arrArgs[8];
var strTime = arrArgs[9];
var strWeight = arrArgs[10];
var nQuestionNumber = arrArgs[11];
var strDescription = arrArgs[12];
var strLearningObjectiveId = arrArgs[13];
var bTracked = (arrArgs[14] == "true");
var bSurvey = (strResult.toLowerCase() == "neutral");
if (bTracked)
{
strLearningObjectiveId = strLearningObjectiveId.replace(/[ \t\r\n\v\f]/g, "_");
strResult = normalizeResult(strResult);
var strTemp = "";
strTemp += "Description: " + strDescription + "\n";
strTemp += "Time: " + strTime + "\n";
strTemp += "Id: " + strId + "\n";
strTemp += "Learning Objective Id: " + strLearningObjectiveId + "\n";
strTemp += "Type: " + strType + "\n";
strTemp += "Correct Response: " + strCorrectResponse + "\n";
strTemp += "Student Response: " + strStudentResponse + "\n";
strTemp += "Result: " + strResult + "\n";
strTemp += "Weight: " + strWeight + "\n";
strTemp += "Latency: " + parseInt(nLatency) + "\n";
strTemp += "Survey: " + bSurvey;
This post was removed by the author
and this one is more specifically for multiple choice :
bResult = lmsAPI.RecordMultipleChoiceInteraction(strId,
arrUserResult,
strResult,
arrCorrectResult,
strDescription,
parseInt(strWeight),
parseInt(nLatency),
strLearningObjectiveId);
break;
This post was removed by the author
This post was removed by the author
i don't want to use SCORM 2004 because Moodle only allows 1 attempt in case of SCORM 2004 packages.
and this one is found in the SCORMFunctions.js file :
function SCORM_RecordInteraction(strID, strResponse, blnCorrect, strCorrectResponse, strDescription,
intWeighting, intLatency, strLearningObjectiveID, dtmTime, scormInteractionType,
strAlternateResponse, strAlternateCorrectResponse){
and this one is found in the LMSAPI.js file :
eval ("this.RecordMultipleChoiceInteraction = " + strStandard + "_RecordMultipleChoiceInteraction");
eval ("this.SetObjectiveScore = " + strStandard + "_SetObjectiveScore");
eval ("this.SetObjectiveStatus = " + strStandard + "_SetObjectiveStatus");
eval ("this.SetObjectiveDescription = " + strStandard + "_SetObjectiveDescription");
eval ("this.GetInteractionType = " + strStandard + "_GetInteractionType");
eval ("this.GetInteractionTimestamp = " + strStandard + "_GetInteractionTimestamp");
eval ("this.GetInteractionCorrectResponses = " + strStandard + "_GetInteractionCorrectResponses");
eval ("this.GetInteractionWeighting = " + strStandard + "_GetInteractionWeighting");
eval ("this.GetInteractionLearnerResponses = " + strStandard + "_GetInteractionLearnerResponses");
eval ("this.GetInteractionResult = " + strStandard + "_GetInteractionResult");
eval ("this.GetInteractionLatency = " + strStandard + "_GetInteractionLatency");
eval ("this.GetInteractionDescription = " + strStandard + "_GetInteractionDescription");
how can i utilise these functions to manually send my own interaction results ?
Scorm 2004 should be avoided in Moodle it is not really compliant and I think development is not ongoing for this.
The problem you have is that Scorm 1.2 spec does not have a data model element for describing an interaction, you may be able to set the interactions.id using javascript
If you enable LMS Debug Mode in a standard quiz file, you can watch the quiz data flowing from the content to the LMS in real time, and this may help you to identify how those IDs are being established.
This may help https://community.articulate.com/discussions/articulate-storyline/scorm-1-2-cmi-interactions-idbut this is for a standard quiz slide, for a custom quiz you will need to write the function yourself and ensure Storyline does not overwrite it.
Thanks Phil. Much appreciated.
Till now i am able to send objective status for each slide / interaction / quiz through a JS trigger.
var player = GetPlayer();
lmsAPI=parent;
lmsAPI.SetObjectiveScore(1, player.GetVar("score1"), 100, 0);
lmsAPI.SetObjectiveStatus(1, 1);
where 1 = passed, 2 = completed, 3 = failed for the Status
It passes these status to Moodle well.
But i need to send the interaction data also. atleast user response, correct response.
Is there any JS code for SL2 to pass the data manually to Moodle 3.0.2 ?
Yes, i have enabled API Activity Log in Moodle. In default SL quiz, a bunch of interaction data are sent to LMS as son as the user submits the quiz.
But how can i convert those data elements to a JS code wihich will work in SL ?
Not sure I have never tried to do it.
The interactions.id is a sequential array, you will need to query the LMS to find the next available slot, and then use javascript to insert your question. That is about as much as I know. Looking at the debug data you can see how storyline would send the data, then really you need to look at the scorm model and craft your javascript.
I want to send and store a number (through a numeric variable) to Moodle in a slide. The next time a user attempts the same course, i want to fetch that number from Moodle in Storyline. How can i do that ?
I have seen LMSSetValue and GetValue.
But i don't know how to do in a Javascript code in SL2 ?
You cannot send a number to Moodle outside of an interaction the scorm model does not allow this
Ok. May be some question text, number or any objective score which i can later fetch from Moodle in SL2 ?
Currently i am sending some objective score for each slide through a JS trigger. Can i fetch those score / number in SL through a js TRIGGER ?
i have been able to send interactions perfectly to Moodle.
The only problem is that it creates a new interaction in every attempt for the same question.
I have attached a story file with custom quiz and js triggers to send custom interactions.
also, how can i send a score objective score to Moodle and then later fetch it in Storyline ?
Is it possible through SET AND GET method ?
I don't know the js trigger.
I tried to do th same thing and it worked for radio questions. otherwise, if my course contains drag and drop, and multiple choices, or it's a suvrey of 30-questions. how can I do in order to have the same result?
Hi Wafa,
If you're looking to use the same type of Javascript shared earlier, I'll leave you in the hands of our community experts as it's not something I'm equipped to help with!
If you need any other assistance, please let us know!
Hi Ashley,
Thx for your feedback.
In fact, the problem was for free-format questions, SCORM did not return the results, but returned the selected button types, so I had to name the buttons by their answers to have a readable report. On the other hand, the answers of the noted questions, were produced by SCORM correctly, So i just needed to display the text of questions. for this, i used the JS function on trigger "SCORM_RecordInteraction" but it does'nt replace the ID : "Scene2_Slide10_MultiChoice_0_0"
This discussion is closed. You can start a new discussion or contact Articulate Support.