Using Variables to Control Slide Advancement
Oct 02, 2019
Hello!
Still figuring out all of the cool things that Storyline can do and I am not sure if I am using variables correctly.
I have four buttons that I want the learner to click on before they can advance to the next slide. The button states are set to change when selected to display some additional content. However, because of this I can't get them to stay as "visited" and use that to control slide advancement.
I thought I could use a variable. I have added a variable to count the number of clicks. In the trigger wizard I have a condition to advance to the next slide if the "CountClick" variable is greater than or equal to 4 clicks (4 buttons I want them to click on). When I test it doesn't seem to be working. Am I thinking about this the wrong way or missing a step someplace?
Thanks!
26 Replies
Hi Marisa
when they click the four buttons are they navigating away from that slide to other slides then coming back?
If so, your trigger should be change state of Next button to normal when timeline starts (slide with the buttons) on condition that button1=visited and button2=visited and button3=visited and button4=visited and have the slide property revisit option set to 'resume saved state'.
If that is not your setup, perhaps you can share the story file or even just the few slides you're having the issue with by using the grey 'add attachment' button at the bottom of the post to upload. From email, select the View button not Reply, as Reply doesn't allow attachments to display in the forum.
Hope this helps or gets you a step closer :-)
Hi Wendy,
When they select the buttons they are remaining on the same slide with additional content being displayed by each button's "selected" state. Let me get the attachment uploaded!
No worries I'll take a look.
For your information the built in SL states have default behaviour and do not need triggers to show these states SL does it automatically and to use triggers sometimes causes issues because it's a conflicting instruction to SL.
Selected - object will stay in this state until another object is clicked - then it is no longer selected
Visited - object will be in this state when user clicks
Hover - object will show hover state when mouse hovered over.
Here is the KB article for more info.
Got it.
Sorry I'm running into trouble saving my work and the SL crashed. I will have to take some time to get back to my project--then I will upload the attachment as soon as I can.
No rush - if I'm not around I'm sure someone else will chime in to help you - we're a pretty friendly bunch :-)
Hi Marisa
I could never get the built-in states to work properly for me to control objects on a slide so I create a custom state called "Done" for each button. I also change the color of the button when the state is "Done" so the learner knows which buttons have been selected.
I then create a trigger that changes the state of the button to "Done" when the button is clicked. You can also create a trigger to display your content when each button is clicked or selected.
The Next button is hidden when the slide's timeline begins.
I create a trigger to change the state of the Next button to "Normal" when the state of all four buttons changes to "Done."
Does that make sense?
Let me know if you have any questions.
Maureen
Hi Maureen,
That makes sense.
The issue that I am having is that I am using the state "selected" to show some additional content with each button. But I don't want this content to show when the other buttons are clicked on otherwise it would all overlap. Therefore, I am trying to get the content to display (through the selected state) when the button is selected, and then go back to a normal state so that when other buttons are selected content doesn't overlap. But then I need to still get it to record that the button was visited so that I can use that to control whether or not the learner can advance the slide. Is that possible?
Use a button set, you can add the content inside the selected state so it is only visible when the button is selected.
Hi Phil,
Thanks! That's what I have done with the selected state. However, I am trying to control the slide advancement and don't want the learner to be able to advance without having seen each of the button's and the additional content. How can I control the slide advancement (next button being active) if each of my buttons returns to "normal" state when the next button is selected so that the screen isn't full of content.
If you add a visited state that looks like normal a button can be visited and selected at the same time, using a button set you will not need to set them to normal they will automatically switch but will be visited.
Hi Marisa
You can do that by using four (4) different states per button.
Normal
Hover (if you want a hover state)
Selected (Shows the content)
Done (hides the content and marks the state as done)
The Next button is hidden until all button are the state of Done.
I can post an example if you need one.
Maureen
I don't think a custom state will work here without a number of triggers, using selected, visited and a button set will not need any triggers apart from a trigger to unlock the next button
Thank you both for all of the information!
I think I understand what I should do. Is there anything special that needs to be done in order for the button to be able to be visited and selected at the same time?
Nothing at all, as long as the states are there it can be visited and selected
Marisa, I think I am following this thread correctly. What you are wanting to do is have a true false variable for each of the buttons. When the user clicks the button it changes the variable to true. Your forward navigation can then be set to be available when variable 1 AND variable 2 AND variable 3 and so on are true. Hope this helps.
Hi Marisa
Here is an example of what I described above.
https://360.articulate.com/review/content/65d25e65-e26b-4251-a971-03dd13e7fe61/review
If your layers overlap, you can add a trigger to close the layer when another button is selected.
If your layers cover the buttons on the base layer, add a close button to each layer. When I have the close button, I add a fourth state that lets the learner know which buttons they have already selected.
Let me know if you have any questions or if I am missing what you need.
This is the easiest way I know how to do this. If someone has an easier way, I would love to learn how to do it.
Maureen, I think Marisa's issue was that she is not having the buttons stay in the visited state but for some reason returning them to normal. If she wants them to stay normal then a true false variable per button will be the best way to go.
Hi Randy,
Thanks for your feedback. Yes, I understand that. That's why I created a custom state. I mentioned in my first post that built-in-states don't control things on a slide the way I want them to. I could never get the visited or selected states to stay applied to a button or object.
Sorry Maureen, I must have missed that. That is odd, I use built in states all the time and have never had any issues with them doing what I want. I do know some people add in extra triggers that are not needed can interfere with the built in states but out side of that I would have to see the story file to diagnose.
Hi Randy, no worries. I have the same problem that Marisa mentioned above. If I try to control something on my slide using the visited or selected built-in states, and the learner clicks on something else, it returns the state to normal and can mess up my slide restrictions. That is why I started using custom states. Maybe it is a bug that I should report?
Thanks again for your feedback. I always learn something from everyone here in the community!
That is odd. Might you have a sample course that shows the button states not working for you? My interest is piqued.
The visited and selected state should work and shouldn’t need a custom state. Often it is because as Randy states the use of a trigger to return to normal.
I will pull a sample together over the weekend to show what I suggested. I use it all the time so shouldn’t be buggy.
Sent from my iPhone
That is odd. Might you have a sample course that shows the button states not working for you Maureen? My interest is piqued.
Hi everyone! I really appreciate all of the feedback--very helpful!
I ended up using a True/False Variable as Randy suggested and was able to get everything to work properly! I am guessing there is more than one way to do this but this route worked fine for me and I am happy to be able to continue working on the other parts of my course now!
I'm doing something similar and I'm stuck.
I have the Next button set to Hidden when the timeline starts.
The base layer contains three speech balloons (callouts) numbered 1, 2, and 3.
When the learner clicks any one of the three, a layer appears that has one balloon containing text and two buttons (right/wrong).
When the learner clicks a button, a feedback layer appears.
The learner must click the Continue button to be returned to the base layer, where they can choose another possible response balloon (1, 2, or 3).
I want them to visit all three balloons before the Next button appears. I set this up with a Visited state for the balloons plus variables (described earlier in this thread) and it works - sort of. When I click the third balloon (it doesn't matter in which order I click them), the Next button appears. It stays there after I click right or wrong, and it stays there while the feedback layer appears.
Then I click the Continue button. I go back to the base layer - and the Next button disappears.
This discussion is closed. You can start a new discussion or contact Articulate Support.