Forum Discussion
How can I use Storyline 360 variables in custom xAPI statements as Number (not as String)
Hi,
Perhaps somebody knows this and I miss something obvious :-)
I have a few Storyline360 Number variables.
I am modifying the variable with a Web Object (a little game).
In the end, storyline is sending a custom xAPI statement to set the score in the LRS.
But to fill the 'score' in the 'result' node in the xAPI JSON, with 'min', 'max', 'raw' and 'scaled' these values need to be numbers, not strings.
I created a game that sets Storyline Number variables:
- Window.GetPlayer().SetVar(“gameScoreMin”, 0)
- Window.GetPlayer().SetVar(“gameScoreMax”, 1600)
- Window.GetPlayer().SetVar(“gameScoreRaw”, 800)
- Window.GetPlayer().SetVar(“gameScoreScaled”, 0.5)
In storyline I want to send an xAPI statement with a “result” node containing score information:
“result":{
"score":{
"min":0
"max":1600
"scaled":0.5
"raw":800
},
}
But Storyline does not allow (note: no quotes around the vars):
“result":{
"score":{
"min": %gameScoreMin%,
"max": %gameScoreMax%,
"scaled": %gameScoreScaled%,
"raw": %gameScoreRaw%
},
}
I get an error from Storyline "error in path: result.score.scaled" when clicking OK in storyline to save the statement.
Storyline only seems to accept the variables if they are inside a String (quoted):
“result":{
"score":{
"min": “%gameScoreMin%”,
"max": “%gameScoreMax%”,
"scaled": “%gameScoreScaled%”,
"raw": “%gameScoreRaw%”
},
}
Which results in (quoted values / Strings):
“result":{
"score":{
"min": “0”,
"max": “1600”,
"scaled": “0.5”,
"raw": “800”
},
}
But that is not valid xAPI for Learning Locker (LRS) to accept (it sends an 400 error back). It expects Numbers, not Strings.
When I hardcoded all values to numbers (e.g. "raw": 800) all works fine
My question: How do I get a Storyline variable in the xAPI statement as Number in stead of a String?
Thanks!
Hi Everyone,
I have some exciting news to share! We just released another update for Storyline 360. In Update 82, we’ve included important fixes and new features.
One of the fixes we’ve included is:
You no longer need to add quotes to variable values in custom xAPI statements.
To take advantage of this update, launch the Articulate 360 desktop app on your computer and click the Update button next to Storyline 360. You'll find our step-by-step instructions here.
Please let me know if you need additional help!
Hi Everyone,
I have some exciting news to share! We just released another update for Storyline 360. In Update 82, we’ve included important fixes and new features.
One of the fixes we’ve included is:
You no longer need to add quotes to variable values in custom xAPI statements.
To take advantage of this update, launch the Articulate 360 desktop app on your computer and click the Update button next to Storyline 360. You'll find our step-by-step instructions here.
Please let me know if you need additional help!
- ZsoltzoolahamazCommunity Member
Hi Remo! I asked the same question with no response, so I'll file a ticket with support. This is a bug (or by design but than the design is flawed). Raw HAS to be a number. We can't send it as a string, it's non-conformant.
What I'm doing now is after publishing I run a Python script on the published .js files to remove the /" part for the /"variable/" when I DO want this to be a number. They are page-based .js files in html5\data\js\. - MathNotermans-9Community Member
This is worrying... and should be fixed indeed.
- RemcoSchoosCommunity Member
Hi Zsolt,
Even though it is a possibility for sure, I want to avoid changing files or doing extra steps because I am not the one creating courses and I am afraid this might be 'forgotten' to run. Especially since the content goes not into systems I control but into any system of our customers.
I also added this to support and was in contact with them in back and forth to explain.
In the end, Cleo (support engineer) mentioned the following:
The xAPI specs say all that data should be numerical: https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#Score
This looks like it’s an issue on our end. I’ve logged it as a possible software bug.So indeed, non-conformant and a 'bug' in Storyline. I am waiting for follow-ups from their side... please create a support ticket as well. More tickets might speed up the process a bit :-)
- RemcoSchoosCommunity Member
They are still investigating and will give me an update as soon as they are done. I'll report here after I got the update.
- SocratesAnas261Community Member
- Can I just ask, does using xAPI necessarily go through writing your own code?
- When you publish the same course on SCORM 2004, or xAPI is something inherently different?
- How do you instruct the LMS to capture all those special actions that xAPI is advertised to be good at?
Thanks
- MathNotermans-9Community Member
xApi data basically goes to a LRS ( Learning Record Store ) and inthere mostly there is some sort of dashboard to see all your recorded data and get analytics on it. Some offer data to be sent back into the LMS so your users/admins can check any xApi data directly on the LMS without knowing anything about the LRS. At Twente University they succesfully created courses that sent data to Veracity LRS and then teachers could check it out on dashboard in Instructure Canvas LMS. They experimented with Storyline as tool to create xApi compliant courses, but due to things as mentioned in this post Storyline failed.
Main issue now is still how to ensure xApi data is easily sent to the LRS. Storyline still fails at an easy workflow for that. Tools that out-of-the-box create easy xApi generation are for example H5P and Xerte. Both tools create xApi data without any extra coding. But those tools then lack custom interactivity. You can create your own H5P components, but its a lot of coding too.
- RemcoSchoosCommunity Member
1) No not necessarily, but I need to write my own code when I want a custom web object interacting with the score of a course
2) yes, it won't do anything with my web object/player variables if I can't map them to the xAPI output or any number variable for that matter)
3) I was planning to use the default 'score' node in xAPI statements and expect the LMS to handle them as any other course that advertises a score
- ShawnSnyderCommunity Member
We are also having this issue. Following and asking for a fix from Articulate.
Hi Shawn,
Sorry to hear that you ran into a similar issue.
We are currently tracking a known bug that causes Storyline to only accept values of variables if they are inside a String (quoted), instead of a number for courses published in xAPI. We've identified that manually removing the quotation marks (") (and related escape characters) in the published export (html5/data/js/xxxxxx.js) resolves the issue. If you have any questions or clarifications regarding the status of the bug or its workaround, you can open a case with our support team here.
- MathNotermans-9Community Member
Manually removing quotation marks in published content ? I am very sorry, but thats not what users expect ! So Storyline doesnot publish xApi thats the conclusion.
- BenKanspedos-8bCommunity Member
Hi, is there any update on this issue? I need to send scores via xAPI
Hi Ben and Math,
Thanks so much for checking in on this. Currently, I don't have an update on this bug, but we'll be sure to update this discussion once we have news to share!