Saving data with triggers in Articulate Storyline examples

Can you provide examples of saving data with triggers in Articulate Storyline?

July 22, 2019, 6:18 pm

Click for thumbs down.0Click for thumbs up.1#1

Example 1.

I set up a field called “status” and want to set it to either “pass” or “fail” depending on the situation.

I will create a JavaScript trigger with the following code to set the status to “pass”:

CloudSet('status', 'pass');

And the following JavaScript trigger to set the status to “fail”:

CloudSet('status', 'fail');

I will use conditional triggers in Storyline to run the script:

Example 2.

I want to track whether the learner answered the question correctly.

I set up a field called “quiz” and want to use values “correct” or “incorrect” depending on the answer provided.

I will add this JavaScript trigger to execute when the timeline of the Correct layer starts:

CloudSet('quiz', 'correct');

And this JavaScript trigger on the Incorrect layer:

CloudSet('quiz', 'incorrect');

Example 3.

I want to save the response entered by the learner in the module.

I set up a field called “reflection” in the data table.

In Storyline, I will add a text entry box for the learner to type their response:

Then I will add the following trigger when the Submit button is clicked:

var player = GetPlayer();

var entry = player.GetVar("TextEntry1");

CloudSet('reflection', entry);

 

 

July 22, 2019, 6:25 pm

Click for thumbs down.0Click for thumbs up.3#2

Great looking set of widgets! I am new to this but getting there.

A question about Example 3 where the content of a text entry variable is saved; can I also use this method to save the content of a numeric variable?

John.a.

March 6, 2020, 6:15 pm

Click for thumbs down.0Click for thumbs up.0#3

Hi John. You should be able to, I don't see why not.

March 6, 2020, 9:06 pm

Click for thumbs down.0Click for thumbs up.0#4

Is there a way to record multiple text entry fields with a single submit button?

April 2, 2020, 12:47 pm

Click for thumbs down.0Click for thumbs up.0#5

I have successfully saved some data from storyline variables following example 3 above.
Saving numeric variables works some of the time - for example the content of a variable that holds a storyline slider or dial value - Just for information I have found that if you set a slider or dial to set the variable value w'hen the user releases' it works but if you set it to adjust the variable 'whilst the slider is being dragged' it doesn't work.

However I would like to store the value of a storyline built-in variable: 'Menu.SlidesViewed'. This is numeric I believe.
At present I have a JavaScript trigger to store this from the master slide (all slides in the project use the same master). What is being returned at the moment is the value of zero. I wonder if I can do this or I'm going about it the right way?

Thanks
John.a.

May 28, 2020, 10:53 am

Click for thumbs down.0Click for thumbs up.0#6

John, according to this page: https://articulate.com/support/article/accessing-system-variables-in-articulate-storyline-javascript-triggers "Storyline isn't currently designed to expose system variables for user interaction."

May 28, 2020, 12:13 pm

Click for thumbs down.0Click for thumbs up.0#7