Branching based on a variable
May 15, 2012
Is it possible to conduct hyperlink branching based on a previous 'decision' or access to a previous slide using 'variables'?
What I mean is I want to do a scenario where the learner must select from a number of 'tools' they will carry with them in an emergency situation. The will choose 3 tools from a list of 6-8.
If they arrive at a 'slide' and are carrying the correct 'tool' to do the task, they can proceed on one branch, but not having the tool leads them to another branch. Their initial selection of tools and decisions they make within the scenario gives an outcome.
Any ideas on how to do this 'if <variable tool> = <tool unique number> then goto slide X else goto slide Y" type of branching...it might even have to be an array if there are more than one tool used!
21 Replies
Hi Gareth, I am just doing some basic branching on a project with variables I am working on, but I think you can apply the same logic with variables and triggers. To achieve the if/then/goto/else branching, you can setup triggers as follows:
trigger 1: jump to slide X (in the conditions just say IF variable tool = unique number)
trigger 2: jump to slide Y (in the conditions just say IF variable tool = unique number)
trigger 3: jump to slide Z (in the conditions just say IF variable tool = unique number)
Hope that is of some help, although someone can jump in if there is an easier/cleaner way...
Vispi.
Thanks Vispi, will try out some ideas I have and see what happens... I was working along those lines but was hoping there would be an elegant javascript solution....at the moment getting the concept to work is great for me... just testing out to see how workflow etc might work for us in our operations...
Gareth, the triggers that Vispi is referring to are handled by clicking on "Show Conditions" in the trigger wizard. Here's a sample:
You can have multiple conditions which gives a whole load of scope to dynamic branching etc. It also means you sometimes end up frying your brain trying to work it all out!
I would do it as Vispi, but use T/F variables
Great everyone - thanks...looks like it might be a late night exploring option!!!
One quick question - I asked another question about linking a random slide (in a group of 6), is it possible to do 'mathematics' in the conditionals?
Not via the above method. You can execute javascript via the triggers so maybe that's worth investigating. I've yet to play with js in SL (next on the list!)..
Hello there
I may have the same issue. I need an idea about how to create some variables.
I'm trying to create a module where people has to response some questions. If they don't have the correct answers they have to take the test back and answer it right. When I post on the results slide I play the tigger "failure" and it goes back to the slide I said, but I can't restart the test and it just let me see the slide as I saw it before. I can't give another answer.
I would appreciate any kind of help, I'm quitte new on this
Thank you!
I have something similar. My users are divided into 2 categories; Employees and Leaders. Employees view slides 1-20 and then jump (from slide 20) to slide 30 to close the course. Leaders also view slides 1-20 but then move on to slides 21-30. Slide 1 has 2 radio buttons to select from (Employees or Leaders) and then click the submit button. At slide 20, I want the information collected in the variable on slide 1 to branch the user appropriately. I don't know how to do this. I couldn't find a screencast explaining this. Can you guys help me?
Hi Greg
create a T/F variable 'employees' default to false.
On slide 1 have this trigger:
On slide 20 add the following triggers to the Next button:
Hope that helps
I think this is it. The only question I have is on your instructions, you
say: 1. Jump to slide 21 when user clicks Next button on condition that
'employees' is not = true.
That should be IS true, correct? Thanks so much!
gregsigblue
Hi Greg
Leaders also view slides 1-20 but then move on to slides 21-30.
No...is not true as you want your leaders to view slide 21-30.
The is true is for the employees to go to slide 30
I see. This is exactly what I want to have happen. Thank you so much! I’m really trying to become expert in variables and triggers. Sometimes, I know it can be done., but not sure how to ask Storyline to do it.
No problem - happy to help - variables can be tricky when you start working with them but so powerful for helping control behaviour.
Good luck with your project Greg!
H, Greg -- I see that Wendy has been able to get you sorted out! :)
As you mentioned that you would like to increase your knowledge of all-things related to Variables and Triggers, I thought I might add the following resources, as well:
Variables
Triggers
Hope that helps, and please let us know if you need anything further! :)
Wow, this is incredible. Thank you so much!
Certainly, Greg, and please don't hesitate to let us know if you should need anything further! :)
I have a very similar course but the course is not graded. To ensure both roles receive the completion credit, I will need to create a completion page for each role?
Hi Sharon,
What version of Storyline are you using? If you're on Storyline 360 and only need to register completion, you could look at adding a final slide that both roles visit and using the completion trigger to send results to your Learning Management System (LMS).
Let me know if that helps!
I have Storyline 3.
Hey Sharon,
Thanks for letting us know that you are working with Storyline 3.
The course completion trigger is exclusive to Storyline 360, but you should be able to submit course completion when the users reach a particular slide. Check out the instructions here.
Welcome to E-Learning Heroes by the way :)
Hi Leslie, thank you very much for your prompt responses. the instructions you provided to me was very helpful!!! I know our team is in the process of upgrading to Storyline 360. Hope it will happen sooner. Thanks again!
This discussion is closed. You can start a new discussion or contact Articulate Support.