Variables

I am looking for more information on variables.  The tutorials that I found here: http://community.articulate.com/tutorials/products/articulate-storyline.aspx (including the ones that it links to) just tell you what to enter into the trigger wizard without explaining why or what all the options control. Do you have a tutorial or screenr that explains all the trigger wizard options for variables?

38 Replies
Peter Anderson

Hey guys ,

Is there a specific variable from this tutorial that you'd like to know more about? At the bottom of that tutorial, we've also included more detailed info on the true/false, text, and number variables. Are those the tutorials you mentioned having already seen?

Or are you just looking for a really thorough instructional video? 

Thanks!

Kristen Williams

Hi Peter - thanks for getting back to me. I am looking for an explanation of the trigger wizard options when using variables. The tutorial that I linked to above tells you what to enter into the wizard but I don't understand all the options that are there and thus have had trouble applying variables into my projects.

If that isn't enough information I can explain a specific example of an instance in which I want to use a variable but don't know how to do it.

Thanks, Kristen

alan hurren

I managed to fathom this out and if you get it right first time its easy. If you don't then it is complex there needs to be a tutorial done on how to set variables through the new dialogue boxes.

The main confusion for me was setting the initial variable up...

Set it up initially by using the data entry as for the older system

When that is done select the text box and trigger

Set the action to adjust variable and leave it Unnassigned

On the screen where you want to deposit the variable start a text box and click inside it then go to insert and opt for reference

Select the variable textentry (Note and this is where I found I was wrong... the third column will have a number click on that and you can see a note of everywhere its used)

If ypu add another text entry a new variable will appear called textbox2... and so on

This is quite a different method from the last story board version but it is simple when you know how it works

Chris Wall

alan hurren said:

I managed to fathom this out and if you get it right first time its easy. If you don't then it is complex there needs to be a tutorial done on how to set variables through the new dialogue boxes.

The main confusion for me was setting the initial variable up...

The first part is making sure you've created a variable that's gonna do what you want it to do.

Create variables by clicking on the italicized X in the collection of controls at the bottom of the Triggers window. I'll presume that once you access that, you'll be able to figure it out. By the way, when you create a variable, you can give that variable an initial state (so you might not need to do the initialization thing I talk about below).

Set it up initially by using the data entry as for the older system

You actually have a number of options here. You can:

  • Assign a default value to the variable when you create the variable. The variable will initialize to this state every time the course starts up.
     
  • Or you can initialize your variables on first screen of your course.

    By this, I mean inserting either a blank value in your text fields or a zero (or whatever value you want to use as a base value) for a numeric variable, or setting a True/False variable to whichever state you want it to be in when the learner first encounters an interaction that uses that variable.
     
  • Then create a series of triggers (one for each variable in your course) that all occur when the timeline starts in that opening slide. When the triggers go off, simply have them set the value in their corresponding variables to their desired starting states.

When you're doing data entry pages, you will need to create a variable to hold the value from each field you put on your screen (e.g. FirstName, LastName, Age, Gender (if you're using a checkbox style button, for instance). Each field must have its own variable (and that variable, obviously, must be the appropriate data type for the field (in other words, don't try to use a text variable to hold a person's age).

When that is done select the text box and trigger

Like I said above, since all the variables in the course are present or active or available or persistent or whatever for the duration of the course, they'll either default to the default value you set for each variable when you created it, or you can create triggers that initialize your variables when the timeline starts on the opening slide (or any other slide for that matter). The user doesn't have to do anything to initialize them, and they get set before the user can do anything if they're set to occur when the timeline starts.

Set the action to adjust variable and leave it Unnassigned

Your action is correct (adjust variable), but if you leave the variable unassigned, the course won't adjust any of your variables. It doesn't know which one to adjust.

On the screen where you want to deposit the variable start a text box and click inside it then go to insert and opt for reference

And select the variable from the list of available variables. You can also insert the variable into a string of text in that text box simply by entering the name of the variable between two % symbols (as in, "Hello %FirstName%. I'm so glad you're here."

Select the variable textentry (Note and this is where I found I was wrong... the third column will have a number click on that and you can see a note of everywhere its used)

If ypu add another text entry a new variable will appear called textbox2... and so on

This is quite a different method from the last story board version but it is simple when you know how it works

TOBIAS STEPHENS

Hello Team,

I am attempting to create a checkbox that:

  1. When you hover over the blank checkbox, a grey custom check appears.
  2. When you select the checkbox, a blue custom check is displayed.  
  3. If you hover over the selected checkbox, the blue check turns grey but the checkbox remains selected. 
  4.  For each selected checkbox, I would like to assign a point value.  Based on the total point value, users will receive different results.

Can you please assist?

Chris Wall

TOBIAS STEPHENS said:

Hello Team,

I am attempting to create a checkbox that:

  1. When you hover over the blank checkbox, a grey custom check appears.
  2. When you select the checkbox, a blue custom check is displayed.  
  3. If you hover over the selected checkbox, the blue check turns grey but the checkbox remains selected. 
  4.  For each selected checkbox, I would like to assign a point value.  Based on the total point value, users will receive different results.

Can you please assist?


So you'll need to create a numeric variable to hold the total of all the points you award (based on the checkboxes selected).

if the point total is only for checkboxes on this slide, you'll want to put a trigger on the slide that initializes the variable (sets it equal to zero) when the timeline on the slide starts. 

for each checkbox on the slide, create a trigger that, when the checkbox changes state to "selected", adds the points you want to to award that checkbox to your numeric variable.

you'll also want to create a parallel trigger that subtracts the same number of points from the variable if the learner de-selects the checkbox (checkbox changes state to de-selected (I'm working from memory here so I can't recall what the proper names of selected and de-selected states are).

next, you'll want to create another series of triggers that are attached to the Next button. These triggers will route the learner to the appropriate target slide based on the point value in the numeric variable. You'll need to use conditions in the triggers to make this work.

these triggers will work like this:

jump to Slide X when the user clicks Next. Your condition that you add to the trigger will say "If name_of_your_numeric_variable is equal to (point value you've set to send the learner to that target slide)"

you'll need to create as many triggers for the Next button as you have alternate destination slides.

it starts getting a little bit trickier if the destination you send the learner to is based on a range of potential values. Say, for instance, if you send the learner to Slide 4.1 if the value in your numeric variable is between 0 and 33, Slide 5.1 if it's between 34 and 67, and slide 6.1 if the value is greater than 67, you'll create three triggers for the Next button.

the first trigger will say "Jump to slide 4.1 when the user clicks Next." You'll attach one condition to this trigger that says "If  name_of_your_numeric_variable is less than 34."

the second trigger will say "Jump to slide 5.1 when the user clicks Next." You'll attach two conditions to this trigger that say "If  name_of_your_numeric_variable is greater than or equal to 34" and a second condition that says "AND 

 name_of_your_numeric_variable is less than or equal to 67".
your third trigger will say "Jump to slide 6.1 when the user clicks Next." You'll attach one condition to this trigger that says "If  name_of_your_numeric_variable is greater than 67"
you could also do this same thing by using a custom button on the slide and show layers instead of jumping to slides. In fact that ay be easier.
I really like this functionality in Storyline because it really lets you do fun things that make your courses a lot more immersive. For instance, not only can you change where your learner goes based on the value in a variable, but you can change the state of characters based on the state of a variable (this is a lot easier with the illustrated characters, but you can do it with photographic characters).
if you're unfamiliar with triggers, variables, and the conditional logic, I would highly recommend taking the training that's available. It's great.
Rebecca Fleisch Cordeiro

Hi Tobias,

I saw that you'd pinged me but am replying here in the forum instead of privately.

The attached file is very bare bones, based on what you've written above:

I am attempting to create a checkbox that:

  1. When you hover over the blank checkbox, a grey custom check appears.
  2. When you select the checkbox, a blue custom check is displayed.  
  3. If you hover over the selected checkbox, the blue check turns grey but the checkbox remains selected. 
  4.  For each selected checkbox, I would like to assign a point value.  Based on the total point value, users will receive different results.

I tried first using the Storyline checkboxes but couldn't quite get what I think you're after.

Instead, I

1. Created a blank text box with a think black border.

2. Added a hover state. Edited that state and inserted a checkbox symbo (from the Wingdings font)l. I resized the symbol to 28 point, bolded it, and made it grey. I also added some fill.

3. Added a selected state. Edited that state, inserted the chebkxo symbol, resized, bolded, and made it blue.

I have 2 questions on the slide, so I repeated this for the second question.

I decided Q1 would be worth 1 point and Q2 would be worth 3 points.

I created 2 variables: Q1 and Q2.

I added a trigger add 1 to  variable Q1 when the user clicks the Q1 checkbox if Q1 is equal to 0.

The other trigger adds 3 to variable Q2 when the user clicks the Q2 checkbox if Q2 is equal to 0.

So, that should get you started. And you can post here with any questions or clarifications.

The one thing you may not like: when users click the check box, in order to see that it's turned blue they need to move their mouse off it.

Rebecca Fleisch Cordeiro

Hi Tobias,

Wow. I really want to see what you're doing with this. I like it.

I've attached an updated story: 3 slides, 1 question per slide.

Now there are 4 variables: q1, q2, q3, and total

Question 1 is worth 1 point

Question 2 is worth 3 points

Question 3 is worth 5 points

FIRST SLIDE

The SLIDE trigger sets total variable equal to the value of the q1 variable when q1 variable changes.

The OBJECT trigger add 1.0 to the q1 variable when user clicks the Q1 checkbox if q1 variable equals 0

SECOND SLIDE

The SLIDE trigger adds the q2 variable to the total variable when q2 variable changes.

The OBJECT trigger add 3.0 to the q2 variable when user clicks the Q2 checkbox if q2 variable equals 0

THIRD SLIDE

The SLIDE trigger adds the q3 variable to the total variable when q3 variable changes.

The OBJECT trigger add 5.0 to the q3 variable when user clicks the Q3 checkbox if q3 variable equals 0

TOBIAS STEPHENS

Hello again,

First I want to say thank you for all the input and help.  I really appreciate it.  I was finally able to get everything to work except the subtracting part. I was able to use number variables for each checkbox to add into a totalscore variable over the three slides of questions. My only issue now is that I can not get the point value (1) to be subtracted if the user changes their minds and deselects one of the checkboxes. I am not sure if I need another state for the checkbox like disabled. Also, I tried subtracting the point value from the checkbox variable, which does nothing. Then I tried subtracting the point value from the totalscore variable, but now it only subtracts one and doesn't add the initial point.

Thoughts?

Jay Dharap

Hey there...

So I have a question...I have set a simple numeric variable for my project.I have set the following triggers:

When user clicks on a button on a slide, the variable goes up by one (+1)

And, a button and text box on another slide (which is the menu slide)

I have set these triggers and looked and re looked at them but it simply isnt happening!! WHY?

Ashley Terwilliger

Hi Jay and welcome to Heroes!

I'm a bit confused, and just wanted to clarify - what is supposed to be happening in the menu slide? Is that were the variable changes is directing too? It may be helpful for me (and the community who will likely chime in) if you could share the .story files here for us to look at what you have set up. 

Gail Ollio

Hi- I'm new to variables... 

I have a similar "scenario" project to the Variable Tutorial.  The difference is instead of using new slides for the feedback, I've used new layers.  When a selection is made (via button rather than chat box) a layer with feedback is shown.  So now I'd like to do 2 things:

1) capture that initial selection (that was made via buttons A, B, C, or D) in our LMS, and then

2) give the learner the opportunity to go back and review the choices they didn't make

I think I'll be able to easily get them back to the scenario with a button and will solve #2.  

However, how do I capture the initial selection (via button) in a Results slide so I can capture it in our LMS?  I've assigned Variables to the various Buttons (ex. Button A=1 point, Button B=10 points, Button C=0 points, etc)  and would like to connect the selection to a Results Slide but have not been successful.  So now I'm thinking that Results Slides are reserved for Quiz submits (??).  Thoughts on how to approach this?  Is there an easier way to collect that data via LMS that I'm over looking?  Thank you so much!

Gail Ollio

OK, so I think I'm on the right track.  I decided to change my Layer options to Slides and Converted to FreeForm.  Then in my Edit Pick One window, I selected the proper branching based on the answer.  So all good there, but I'm still trying to figure out how to connect the button selection to the Results Slide.  Since it is a Scenario based "quiz" there are some better answers than others.  Should I be using Variables?  Or is there something else?  I'm still new, so any suggestions are welcome.

Thank you to anyone who responds.