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…

  1. Making the variable (and adding a default expression): Like variable “Name” with default expression “Bob.”
  2. 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.”
  3. Reference the variable: This is using the variable as a placeholder text, but what will actually populate is the expression.
    1. So in the author, you may use “Hi, {variables.name} !”
    2. But in the lesson, the learner will see “Hi, Betty!”

Using Variables

1. Making a Variable

image.png

image.png

2. Mutating a variable

3. Referencing a variable in the lesson

More variable situations