Storyline - Change Interaction ID

Mar 06, 2013

I've created a very simple survey in storyline using multiple choice and "essay" questions.  I've published this a SCORM package and if works through our LMS (and SCORM cloud) pushing out the answers the users are supplying.

However, the actual question text doesn't come through making it difficult to report on the data.  By default Storyline seems to set the interaction id to a combination of the slide number and the question type, Slide_0_0_Essay_1,  what I'd really like is to be able to edit the interaction ids to contain the question text so that our LMS can provide some useful reports to the end user.

Thanks in advance

Chris

33 Replies
Alchemist Learning Transformed

Sam,

You are indeed a gentleman and a scholar - your fix worked like a charm. Freeform interactions in the course are now identified by the pageID, which is a lot more meaningful than the gobbledigook previously appearing in the report!

This is particularly important for a couple of the interactions in the course as confirmation of a correct response is required for Health & Safety compliance purposes.

Thanks again!

I have also tried adding your bit of code to the SCORMFunctions.js script to see if it would work for SCORM 1.2 and it looks like it does.

At line 694 I added the code:

if(typeof GetPlayer == "function"){
var player = GetPlayer();
var idCheck = player.GetVar("pageID");
strID = idCheck.replace(/[ \t\r\n\v\f]/g, "_");
}

...so after the function SCORM_RecordInteraction and the first instance of strID appears.

It seems to work fine on SCORM Cloud and in our own LMS (with the HTML5 output).

Angela Kim

Hi Sam,

I had a post several months ago in this string. Your solution for custom IDs via the pageID variable worked successfully for the scored questions in the course, Since then, I have added a survey (with non scored questions such as likert scale, select one, multi-select) and the report in SCORM cloud seems to only identify each of them by the very last question custom ID that I set as the pageID in the survey. So, if the pageID of the last question I named is "abc", then the custom id for each question in the survey is identified as "abc" in the report in SCORM Cloud, even though I named the pageID for each of them uniquely. I have a feeling it has to do with the fact that for the survey questions, the interactions are all being submitted at the end, and not one by one as they are in the scored question portion. Can you confirm? The survey is set up so that the learner could go back and change answers, so there is a Submit button at the end of the survey that submits all the results. If that is the case, do you know of a way to work around it so that the custom IDs work for each question? Any help appreciated!

Thanks,

Angela

Sam Hammond

Hi Angela! Sorry for the delay in getting back to you. You know, our assessments have had the same type of behavior happen towards the end, and now I'm wondering if it's the same issue. I always thought it was a glitch but there are some "questions" in the test that were developed as interactions but don't count toward the total quiz score, so I imagine they're being processed in the same way as your survey questions. 

Do you have a copy of the file that you're using that you can share with me? I'd be interested in monitoring the SCORM API calls as you take the survey. 

Alternatively, you could always include the survey questions as scored questions inside the quiz and just adjust the passing rates accordingly. Give all survey responses the same point value and ignore correct/incorrect distinctions. It might be a pain to do this, but if it's important to capture the IDs and responses in the same way, it might be worth trying. And if you want to give people the option to "skip" survey questions without harm done, perhaps you could weight the survey questions to be something like 1 point and all other questions to be 100 points, so if users don't answer the questions the impact on their score is negligible. 

Jo Lamontagne

Hi Richard

 

I downloaded your SCORM2004Functions.js and used this in my published html5 only assessment.  Really happy that it works!  However, I'm not getting the learner response to record in the LMS. 

 

I am a js novice so excuse my ignorance or naivete.  In your version, there is function that requires the responseidentifier...but I couldn't find a responseidentifier in the script.  So, again I apologise for my lack of js understanding, I attempted to craft a createresponseidentifier in the same vein as your createvalididentifier.

 

Please can you take a look and let me know if this coding is correct:

 

 

function SCORM2004_ProcessResponseArray(strInteractionType, aryResponses)

{

strResponse = CreateResponseIdentifier(strResponse);

blnResult = SCORM2004_CallSetValue("cmi.interactions." + intInteractionIndex + ".learner_response", strInteractionID,  strResponse) && blnResult;

 

                //process them (into ResponseIdentifiers, etc?)

                //only include the right amount of stuff

               

                WriteToDebug("Processing Response Array with " + aryResponses.length + " pieces");

               

               

                for(var i=0; i<aryResponses.length; i++)

                {

                                if (strInteractionType == SCORM2004_INTERACTION_TYPE_MATCHING)

                                {

                                                WriteToDebug("processing matching type, i=" + i);

                                                aryResponses[i] = CreateMatchingResponse(aryResponses[i]);

                                }

                }

               

                return aryResponses;

 

}

 

//public

 

 

MANY THANKS IN ADVANCE!!!

 

xxx

LeAnn Graves

Is there a more current response/solution to this in another thread?  I would also like to change the ID to actually be what the question is, and when I try to open the SCORM2004Functions.js file, I cannot open it.  Is there a program that I need to open and edit the .js file?  I noticed someone also said a setting could be changed in Storyline too, but I don't see where and how.

Daniel Gavriliuc
James Birks

Pam, it's been a while since i worked in these files - but i believe the bulk of the change takes place in this block of code (lines 708-732)

/*-----------------------------------------------------------------------------------*/

//alert("SCORM RECORD INTERACTION - ID : " + intInteractionIndex + " : strID : " + strID);

strDescription = CreateValidIdentifier(strDescription);

// Replace all ' and " with blank

strDescription = strDescription.replace(/'/g, '');

strDescription = strDescription.replace(/"/g, '');

//alert("SCORM RECORD INTERACTION - ID : " + intInteractionIndex + " : strDescription : " + strDescription);

/*-----------------------------------------------------------------------------------*/

//need to leave support for blnCorrect=t/f for legacy implementations of RSECA

if (blnCorrect == true || blnCorrect == INTERACTION_RESULT_CORRECT){

strResult = SCORM_RESULT_CORRECT;

}

else if (blnCorrect == "" || blnCorrect == "false" || blnCorrect == INTERACTION_RESULT_WRONG){//compare against the string "false" because ("" == false) evaluates to true

strResult = SCORM_RESULT_WRONG;

}

else if (blnCorrect == INTERACTION_RESULT_UNANTICIPATED){

strResult = SCORM_RESULT_UNANTICIPATED;

}

else if (blnCorrect == INTERACTION_RESULT_NEUTRAL){

strResult = SCORM_RESULT_NEUTRAL;

}

WriteToDebug("strResult=" + strResult);

//blnResult = SCORM_CallLMSSetValue("cmi.interactions." + intInteractionIndex + ".id", strID);

blnResult = SCORM_CallLMSSetValue("cmi.interactions." + intInteractionIndex + ".id", strDescription);

blnResult = SCORM_CallLMSSetValue("cmi.interactions." + intInteractionIndex + ".type", scormInteractionType) && blnResult;

All i am doing is reformating the question string a little and using it as the id rather than the actual question number. You will probably have to change any questions to a likert value also.

Hope this helps you.

Love you so much, after 4 days of work on this thing i found your post and still work! 

This discussion is closed. You can start a new discussion or contact Articulate Support.