Problem sending custom interaction data via JavaScript
May 08, 2017
I have an custom interaction that I have setup because none of the inbuilt quizzing templates quite did what I wanted. I have set up a trigger to report the interaction data to my LMS. The JS trigger I'm using to send the data is as follows with most of the values coming from other variables:
lmsAPI.SCORM2004_RecordInteraction(question, userAnswer, status, correctAnswer, description, 1, latency, "Assessment", timeStamp, "choice");
This works and records the data successfully to my LMS (CSOD) - my issue is that when I report on the quiz I get duplicate blank values if a user has attempted the quiz more than once.
Example - if I have a question "Which these is an animal?" and the user took the test 3 times - the report would look like:
Attempt1_Question2_MC / Elephant
Attempt1_Question2_MC / Blank
Attempt1_Question2_MC / Blank
The LMS is creating a duplicate, blank value, every time the user repeats the test.
All subsequent attempts will have the answer recorded correctly but again with blank duplicates:
Attempt2_Question2_MC / Elephant
Attempt2_Question2_MC / Blank
Attempt2_Question2_MC / Blank
This doesn't happen if I recreate the question using a quizzing slide for a multi choice question so I'm wondering what I'm missing?
Any ideas would be fantastic.
5 Replies
Answered my own question. Actually fairly obvious when I think about it. The interactions are recorded in an array starting at position [0]. So if I repeat a 5 question quiz the data for the latest attempt will be added at the end of the array - in positions [5],[6],[7] etc. The LMS then creates a blank value for array positions 0-4 for that quiz attempt. Easy to filter out the blank space when reporting.
This doesn't happen when using a quizzing template as Storyline takes care of the 'sequencing' and obviously checks for previous responses. Because I'm using a custom JS trigger to send my interaction data this 'sequencing' step is obviously missed out as I'm bypassing a lot of the communication.
Hi Steve, I have a similar problem I am working on, would you be willing to share the full js that you used in the trigger? I am trying to push a long essay interaction out of a Storyline slide, embedded in Rise. Any help is appreciated.
Thank you.
What problem are you trying to solve? To be honest the JS I used is pretty much the call I have listed above with 'question', 'userAnswer', 'status', 'correctAnswer', 'description' and 'timeStamp' being values passed into JS by storyline. This is a copy of the same function which appears in the LMS.js folder of a packaged course but I've replicated it in my custom JS file to pull in different values from my custom questions.
I never really solved the 'blank' values issue - I just decided to filter them in my reports.
Thanks for replying Steve, I was just trying to figure out how to force Storyline to send an interaction, a long essay survey question, out of a Rise module. I have to launch on Monday, so I'm pursuing a different solution, but it makes for a better UX if they can answer all the questions in one module. Right now my plan is to send them to a 2nd module that is part of the LMS.
Hey, I used to work with a Steve G in Denver. You're not that Steve G are you?
This discussion is closed. You can start a new discussion or contact Articulate Support.