Storyline xAPI editing (Variable Actor & Open Text Box Output)

Jan 03, 2023

Hello!

I have a couple of questions regarding xAPI functionality within Storyline.  I have a novice understanding of xAPI, so feel free to correct any of my misconceptions.

I am having difficulties with two things:

1) Set a custom actor based on a variable within my file to output to my LRS

-I have tried various forms of adding the top two lines all over the code to try and trigger my response:

const player = GetPlayer();
const uNamejs = player.GetVar("uName");
"name": uNamejs
referencing the variable from my training directly (uName) in the fields

I either get the training to not load at all, or to not upload to my LRS at all.  Is it possible to use this javascript field to output my variable for name instead of a static Actor definition?  My Actor variable (uName) has a default value so it is never empty and is updated by the leaner in the first slide.

2) Capture and output a text box input to the LRS

Attached are photos of the specific areas I am trying to put these into motion.  Is it possible to edit my object or add a description that will also send the contents of my text box (defined as variable "favFood") to the LRS through the xAPI statement?  Any time I try to edit the xAPI code here, it will error out no matter what I do, even with acceptable syntax.

7 Replies
Jose Tansengco

Hello Michael,

Thanks for reaching out! 

For your first concern, I'll leave this one to the community. Someone who has more experience with Javascript might be able to share some working examples or suggestions with you.

Regarding capturing and outputting a text box input, here's an article what we've prepared on using custom xAPI statements in Storyline 360. 

You'll want to check out the section titled Building Advanced xAPI Statements which includes examples and tips on how to send Storyline 360 variables to your LMS/LRS.

If you continue to have problems with xAPI statements in your course, feel free to open a support case with our team here so we can provide additional assistance. 

Michael Shonk

Hi Joe!

That article was a big help - I am extracting text box output to the LRS no problem!  The major factor missing was the %% around my variables.  Attached is the edit needed to make it work!

My LRS will now output "Advisor - Commented - "Text box input".  I'd like to get a little more advanced with my object definition, perhaps including the box/slide and THEN the output, so if anyone can offer putting two object definitions in my custom statement, I am all ears.  But this is exactly what I needed in its basic form!

I did try to apply the variable %% rule to my first concern, but to no avail, I am still stumped on it, so hoping the community can step in.  My LMS is not xAPI compatible, so we have to rely on whatever we can get out of the javascript.

Michael Shonk

Okay!  Before I close this up for good, I wanted to post one more update, in hopes it might help someone else someday or direct a future solution.

There is a way for an actor variable (in my case, "uName") to display in an LRS, in a very strange way.  Since I was able to get custom input to report to the LRS, I adopted a similar process for the "Object Definition" field in the javascript of the xAPI statement.  Screenshots are below.

In the first, you'll see how it is by default - the object or slide you put in the trigger.  By default, I had it set to the slide, so it output as %Project.SlideTitle%.  You can edit this to have the name in the object instead, in my case (screenshot 2) you'll see "%uName% Quiz Selection".  This will output, in my case, "Mike Quiz Selection" if I were to put it through.  This can be applied a few ways, this is just a case sample.  Say they fail a quiz, you can keep a variable counter on how many times with their name to output "Mike failed the quiz 3 times".  ("%uName% failed the quiz %failCount% times.")  There are many cases this can be useful.

You'll also notice line 15 of the javascript also has an Object ID - I tried to edit this as well to think  it is another variable we can control.  But as you can see in screenshot 3, the output to the LRS is not usable. It does have my custom input, but it's displayed like a URL and can't be meaningfully filtered.

Since "Actor" is static no matter what, it might do well to almost reverse the two in some circumstances.  Make your course name your static "Actor" and define your objects to have your true "Actor" name variables in them.  Again, backwards thinking, but if we're only given so many places to manipulate input, we have to make the most of each field.

My recommendations for Ariculate:

Allow us to utilize a variable in our Actor definitions when we publish the course.  When we want to use xAPI functions and have to use an LRS or an LMS without SSO data available, a static Actor severely limits meaningful data xAPI can give L&D teams.  With all of the foundation laid for xAPI support in Storyline, it is so close to being a powerful tool!

If that were the case, object definitions can instead get more fun with granular detail instead of forcing the variable actor in there.

Luciana Piazza

Hi Michael, 

Thanks again for reaching out! The best way to possibly see a feature added is to submit a feature request. You can submit one here. If the request makes it onto our feature roadmap, we’ll make sure to update you in this conversation!

Thanks for your thoughts on this! Have a great start to 2023!