What are variables?
Variables are ways to change content, so it updates with how the user interacts with a lesson. For instance, you can create a variable for a learner’s name. When a learner answers “What’s your name?” with “Betty”, then “Betty” can be recorded as the expression for the name variable, which can be used throughout the lesson. The main steps to using variables inclue…
- Making the variable (and adding a default expression): Like variable “Name” with default expression “Bob.”
- Mutating the variable: This populates the expression to new content. So when the learner types in their name, the default expression “Bob” will switch to “Betty.”
- Reference the variable: This is using the variable as a placeholder text, but what will actually populate is the expression.
- So in the author, you may use “Hi,
{variables.name}
!”
- But in the lesson, the learner will see “Hi, Betty!”
Using Variables
1. Making a Variable
- Add a variables on the "Lesson" tab in the right column
- "" for strings
- Nothing for numbers
- CASE SENSITIVE, DON'T USE SPACES

- Then when you are in your lesson, the default of those variables will be set and can be seen in the inspector.

2. Mutating a variable
- On the left use
variables.[name of the variable]
- One the right, find what you want the variable updated to. Like:
stage.{source of new text}
- Example:
{stage.inputText.text}
- {} are critical for the string!
3. Referencing a variable in the lesson
More variable situations