The definition of variable, according to Google is, "an element, feature, or factor that is liable to vary or change." This makes sense, but what does it really mean in terms of e-learning?
It helps to think of variables as empty clipboards—a place for holding information. The information can change based on the learner's input, or how they interact with the course.
Imagine Tim has started a new job at a restaurant. In addition to his practical training he must complete e-learning. The course prompts Tim to choose his role at the restaurant from a list. The user's selection is our variable—in this case the value equals "dishwasher". For another user it might equal "manager" or "server" because the value is dynamic.
The course can now use this information to tailor the content the user experiences so that it is specific to his role as a dishwasher.
How do I use variables?
Now that we know what variables are, we can begin to understand how we may use them.
In the example above we customized the e-learning based on the learner's role as a dishwasher. Again, how we customize the e-learning will depend on our needs, but for the sake of this example let's say that on some of our pages we have tips for each role within the company that we only want to be visible to the corresponding role (ex: dishwashers can only see dishwasher tips and not the tips of other roles and vice versa).
Here is an example of one way we may choose to accomplish this:
- On one of the first pages of the course ask the learner to select their role from the buttons below.
- Below the question, insert a button: Insert tab>Buttons.
- From the Button Properties right-panel, label the first button: Dishwasher.
- Click the Actions button.
- Select Set Variable from the list of Action Types. The Element Interactions panel will open.
- Set the Trigger to: When clicked, and name the variable: Dishwasher.
- Under Type, select: True/False (Boolean), and set the Value to True.
- Click Apply.
Repeat this process to create buttons for the roles of Server and Manager.
You've now created the three custom variables needed to show your learner-specific tips on all subsequent pages.
How to use these variables to show the correct tips:
- Create your tips as separate text elements on your subsequent pages. One text element for the dishwasher's tip, another for the server's tip, and a third for the manager's tip. Insert tab>Text.
- Select the dishwasher's tip, go to the Animate tab and select Timing.
- Click Show Elements. The Page Action Timings right-panel will open.
- Change the Trigger to When Variable Is and choose the variable Dishwasher that you created earlier.
- Ensure that "Set Hidden On Load for targets" is checked.
- Click Apply.
- Click Done.
Note: Single page Preview will not work for variables because the action may be depended upon other actions that have yet to take place. Please use Full Course Preview for variables: View tab>Full Course.
Repeat this process to create page timings for your server and manager tips.
When complete, you can preview your course as each of the different roles.
For more discussion on how to use variables, check out community post: Variables - a quick overview.