how to change button target based on variable state

My training has 4 sections and a test.  page 2 has 4 buttons which target each of the four sections.  The fifth button targets the test.

Page 2:

  • button 1 - jumps to section 1
  • button 2 - jumps to section 2
  • button 3 - jumps to section 3
  • button 4 - jumps to sections 4
  • button 5 - jumps to test

I do not want button 5 to jump to the test unless 1-4 have been completed.  If clicked before 1-4 are completed i would like a popup to appear saying they must complete 1-4.

I have a variable representing each section (sectionOneComplete, SectionTwoComplete, etc).  I have it set so that the last page of each section changes the that sections variable from false to true. 

I have a state on buttons 1-4 called completed.  Each is set to change to state 'completed' when timeline starts if variableName is equal to true.

 I two triggers set to button 5:

Trigger 1

  • jump to slide 6.1(this is the first slide in test scene)
  • when the user clicks
  • if button1's state is equal to completed
  • if button2's state is equal to completed
  • if button3's state is equal to completed
  • if button4's state is equal to completed

Trigger 2

  • show layer NotYet
  • when user clicks
  • if button1's state is not equal to completed
  • if button2's state is not equal to completed
  • if button3's state is not equal to completed
  • if button4's state is not equal to completed

The voices in my head tell me this should work.  But is is not.  Any idea why?  Anyone have a better way of accomplishing my goal (not letting them access the test till they have completed the first 4 sections?

Thank you in advance for your time and attention!

10 Replies
Sandi Williams

Hello All,

I have created the same basic logic as Philip. The only major difference is that I'm using Storyline 2. Hopefully that has no bearing in this case and that someone can help me get past this issue (and save some of the hair I've been pulling out).

I have a Topics page with seven icons that link out to their respective topics/scenes. At the end of each scene is a button with a trigger to set a T/F variable to TRUE before jumping back to the topics page. Also, I've setup logic that allows the learner to continue (to an Acknowledgement section) only if all variables are TRUE or shows a message if at least one variable is NOT TRUE - which seems to work fine.

Once learner has completed a topic and returns to the topics page, a checkmark indicates the topic complete. This is where I've run into a problem as the states aren't changing based on the variable setting. In my module, I've tried a couple of design methods:

1. The first 3 icons should show the visited state (with red checkmark) when learner returns to the page and the variable is TRUE

2. The last 4 icons should reveal a hidden green checkmark when learner returns to the page and the variable is TRUE

My results:

First 3 - shows the checkmark before the variable gets set on the last page of given topics

Last 4 - does not reveal a checkmark after the variable gets set on the last page of given topics

To help troubleshoot, I've included the variable values on the topics page and a red arrow on the first page of each topic that allows me to return to the topics page prematurely to double-check the value of the topic variable. These all seem to show correctly where each variable remains FALSE only until I've completed the topic and clicked the "Back to Topics" button that triggers the variable change.

I could use a second, third or fourth eye on this and I would appreciate all of your help to get this module working.

Thanks so much!!

Ashley Terwilliger-Pollard

Hi Sandi,

Thanks for sharing your .story file here.

I took a look, and for the last 4 icons, the green checkmark is set to be shown on a layer - but there is no trigger to show those layers? Even if there were, the checkmarks are set to a state of hidden - so you wouldn't see them either to know you were on the layer. I changed that behavior for the "baggage" icon - and then it all worked as expected. You'll also need to set all the layers to be able to show the other layers instead of hiding them - or else if you hover over something else, the checkmark will disappear.

Next, for the first 3 icons, I wouldn't use the built in visited state - as that's going to be shown based on the user clicking on it. What I did was make my own custom state - tie it to the variable as you mentioned, and then adjust the trigger based on that.

Also, since you have all these triggers set up to be executed with the timeline starts, I'd set the slide revisiting properties to "reset to initial state" so that the slide is starting over as you'd like.

I've attached the example I worked on and you'll see I only change the behavior for the baggage icon and the people icon, so you can likly update the others.