Variables - another question

Dec 09, 2016

I'm (still) challenged by creating variables (using from one slide to another within a scene). I tried to create a variable so that the first tab (entitled "Importance of Cyber Law") would change its state to 'Finished' when the last slide in the scene for that tab had been viewed. First I added a 'Finished' state connected to the 'Importance' tab. Then I added created a variable called 'Tab1visitedImportance', and then I added a trigger to the last slide, 2.4 'Why Should I Care', that says: "Set Tab1visitedImportance equal to the value of Tab1visited when he user clicks the next button or wipes next button IF Tab1visited is equal to True."

Can anyone tell me what am I doing wrong or neglected to do?  I've attached the file. (I only tried this for the first tab...). Thanks, much appreciated!! (Using 360)

6 Replies
Kevin Thorn

Hi Lucy,

Fixed. You had everything in place, but your trigger order was a bit off.

Issue1: on slide 1.1 your trigger to change the state of the 'Importance' button was set when the Timeline starts. Yet, that trigger was tied to the Next button. Remember, the slide itself is an object so there was a conflict with a trigger tied to a button object yet wanting to execute based on the timeline (slide object). 

Solution: Moved the trigger from the Next button (Object trigger) so that it's truly based on the timeline starting (Slide trigger)

Issue2: The trigger on Slide 2.4 is set to adjust the variable to the value of itself, and IF that same variable is True. Again, conflict of interest. 

Solution: Edited the trigger to adjust the variable to simply set its value to True when the timeline starts (Slide trigger). It's a variable and at this point there really is no need for user action. The user arrived at that slide so when they click the Next button back to Slide 1.1, the variable is set. An alternate way is if you want the learner to perform so activity, watching a video, listening to narration, etc., you could adjust the variable to the Next button. VERY important though that the trigger to adjust the variable is *before* the trigger that jumps to another slide.

Fix attached. Hope this helps!

Lucy Diamond

Hi Kevin,

Thank you so much for your clear explanation of the issues. I think the fog is starting to clear(!) BUT...

Questions re: Issue 1:  

When you said "that trigger was tied to the Next button" is that because on slide 2.4 I had the trigger variable set to the user clicking the Next button? Or is it because of the "Jump to 2.1 from the tab"?

On slide 1.1 - How did you get the "Change state of..." trigger to adjust the variable to appear in the panel at the top above the "Evidence" slide? In v2, I tried using the up arrow but can't get it to move up to the top. From what you said, the "Jump to" triggers have to come after the trigger to adjust the variable (makes sense now!)  I noticed that you had everything in the right order. How did you do that? (I know - very basic Qs)

From your explanation, I understand the change you made on Slide 2.4 to the trigger to adjust the variable from "variable" (itself) to the "value" of true (and I get why the "if" condition needed to be deleted - yay!).

Again, many many thanks!!

Kevin Thorn

Hi Lucy,

The question re: issue 1 is kind of a combination of things. First, the trigger was set to "Change the state of [object] when timeline starts" - however, it was connected to the same object (the tab button itself). Meaning, an object on the slide does not have a timeline. The timeline is part of the *slide* which is also an object. 

That's why in the trigger panel you'll see triggers just under object names - those are object triggers. Others are Player triggers - Next/Prev button triggers. And others are Slide or Layer triggers which are associated to the timeline. Clear as mud!

Moving triggers up and down in the trigger panel using the arrow buttons only moves triggers within their stack. For instance, if I had 2 Slide triggers (timeline adjustments), I can move one above the other and vice versa, but I can't move it into an object's trigger stack (change the state of...) because an object doesn't have a timeline.

As you grow in your skills, trigger management and troubleshooting your own work is half the battle. Keep in mind that Storyline is doing exactly what you tell it to do. The best thing I've learned is to talk it out loud - "when the learner does this action, I want this other thing to change its state, but at the same time I want this variable to adjust."

Also remember that a trigger can only do one thing at a time, so just walk/talk yourself through your design and figure out where each trigger needs to be.

Last tip: Triggers with conditions read backward. Meaning, Storyline will "read" the condition first. IF that condition is true, then execute the trigger action. IF the condition is not true, ignore and move to the next trigger in that stack.

Hope this helps clarify the fog for you a bit more.

Lucy Diamond

Kevin, Thanks so much for taking the time to explain. I'm afraid I didn't
follow all of it, but its good information to have.

If you have a moment, could you please look at the tutorial in the Adding
Content series (David Fair, author) #13, Introduction to variables? This is
the URL:

https://community.articulate.com/series/getting-started-with-articulate-storyline-2/articles/adding-content-to-your-slides

I've attached a screenshot of the slide in question from the tutorial
(6:40)... this is what I used as a guide. The approach seems to contradict
some of what you were telling me, so I'm unclear about that.

I completed the next two tabs of the sample, and after many false starts,
it worked!!! I ended up using the tutorial instructions (they seemed
logical to me, but as a newbie, my understanding is surface level, at
best)...

Again, I'm grateful for your help. You truly are a eLearning "hero" and
much appreciated!

Kevin Thorn

Hi Lucy,

In that tutorial, Tom Kuhlmann explained it the same way...actually, he explained an easier to understand way than I tried here.

Essentially, he's saying in that video that you need three things when working with variables: 1) the variable itself, 2) a trigger to change the value of the variable, and 3) a trigger to evaluate the value of that variable to do something else.

In your project:

  1. variable: Tab1VisitedImportance - initial value = False
  2. trigger to adjust the variable to True on Slide 2.4
  3. trigger on 1.1 to evaluate the value (True or False) and IF True, change the state of your Tab button to Visited.

You had those triggers, but your actions and the "when" to execute the triggers were a bit off.

The three pieces listed above are synonymous, however "when" you want those triggers to execute are based on your design. Such as "when" a timeline starts, user clicks and object, showing/hiding a layer, media completes, etc. 

Hoping all this is helping. Just keep practicing and it'll all come together for you soon enough!

This discussion is closed. You can start a new discussion or contact Articulate Support.