Storyline 1: Evaluating Text Variables
Article Last Updated
This article applies to:
Storyline makes it easy to present dynamic content based on a learner's choices. In this example, we'll work with timeline triggers to branch learners to specific slides based on their earlier choices. Take a look at what we're going to build:
View the published example | Download the source file
When you first look at it, you might think that the button triggers are showing the layers. While that's certainly possible, that's not how this example works. The button triggers are actually adjusting a variable to "true" or "false" while a timeline trigger listens for that variable to change. Based on the variable, the course will branch to one of two slides. It's really cool.
If you're following along, I'm working in EvaluateVariable_START.story.
Step 1: Create the Project Variable
- In the triggers panel, click the Manage project variables icon
- Create a new variable
- Name: Agree
- Type: Text
- Value: (blank)
- Click OK
Step 2: Insert a Variable Reference on the Slide
- Go to Insert > Text > Text box and click once on the slide to create an active text box
- Go back to Insert > Text > Reference to bring up the project variables
- Select the variable you created and click OK
Step 3: Add Button Triggers to Adjust the Variable
- Select the green button and add a new trigger
- Action: Adjust variable
- Variable: Agree
- Operator: = Assignment
- Value: Value, Agree
- When: User clicks
- Object: Agree button
- Click OK
Duplicate the button trigger
- In the Triggers panel, copy and paste the trigger to duplicate it
- Change the value to: Disagree
- Change the Object to: Disagree button
- Click OK
Step 4: Add a Timeline Trigger to Evaluate Which Button Is Clicked
Here's where things come together. The button triggers adjusted the variable so now we can evaluate which button is clicked and give our learners the appropriate content.
Create a new trigger
- Action: Jump to slide
- Slide: 1.2 Agree
- When: User clicks
- Object: Continue button
Show conditions:
Agree == Equal to Agree
Duplicate the trigger and update for a disagree value.
- Select the trigger you just created and copy paste it
- Change the targeted slide to 1.3 Disagree
- Change the Agree value to Disagree
- Preview your project
Because Storyline's variables are persistent, you can evaluate variables at any time during a project.