(Last Updated On: April 23, 2020)

Variables are a great way to store and retrieve dynamic information. They are also useful in creating conditional actions to make your course more interactive and personalized. In this tutorial, you’ll learn how to add variables and work with them in eLearning courses.

This tutorial covers:

  1. Adding Variables
  2. Creating References
  3. Using Actions to Adjust Variable Values
  4. Creating Conditional Actions
  5. Editing Variables
  6. Deleting Variables

Add Variables to eLearning Courses

Take the following steps to add variables to your eLearning course:

Step 1: In the Home tab, click Variables to open the Variables dialog.

Step 2: In the User tab of the dialog, you first need to click Add in the bottom toolbar. Then, specify a name, type, initial value, and description (if any) in the pop-up dialog.

Add variables
  • Name: Specify a unique name for the variable. The name should be descriptive, intuitive, and associated with the data stored. For example, use a learnerName variable to store learners’ names.
  • Type: Represent what kind of data is stored with the variable, namely true/false, text, and number.
  • Value: Specify the initial value for the variable. If you don’t assign initial values, the default values for true/false, text, and number variables are true, empty string, and zero (0), respectively.
  • Description: Optionally, provide a description for the variable to state its use or purpose.

Step 3: Click Add&Close to save the new variable and close the pop-up dialog. Otherwise, click Add&Continue to save the new variable and continue creating other variables.

Note: ActivePresenter lets you assign a text or number variable to a text box to store and track learner input. To do so, click the Properties pane > Interactivity > Score & Reporting > Variable. Later on, you can create references to display the data anywhere in your course.

Find Variables

It’s easy to find where you use a variable by using the Usage Count column in the Variables dialog.

Finding variables

Double-click the hyperlinked number for the variable you want to find. Each time it is referenced by slide text or involved in the action will be counted.

Variable Usage

Create References

While variables store data, references retrieve and display the data anywhere in your eLearning course. For example, you can use a variable to get the learner name, then use the name throughout the course to personalize your training.

create references

To do so, on the welcome slide, just ask learners to type their names in a field (text box) and store the learner’s input in a variable. Then, add references to that variable to display the learner name in multiple slides in your course. You can add references to any text caption, shape, button, or other text-based objects. Do the following:

Step 1: Click the text area of the text-based object to open the inline text editor.

Step 2: Then, click the Home tab > Reference > select a variable. Both system and user variables are available to add references.

Reference button

Step 3: Click OK to finish. Then, a reference appears in your text as a placeholder that contains the variable name getting enclosed within two percent signs (%). When you preview or publish the project to HTML5, the variable name will be replaced with the actual value of the variable it references.

Reference

Step 4: Optionally, adjust the formatting of the reference.

Note: If you remember exactly a variable name, you can type the name and put it between the % signs to reference that variable.

Use Actions to Adjust Variable Values

Variable values can change depending on user input. For example, in the above example of the learnerName variable, each time a learner types his name, the value will update with the new entry. Alternatively, you can use the Adjust Variable action to adjust variable values. Before discussing this action, you’re recommended to take a look at the tutorial about events and actions to gain the basic and overall understanding of events and actions.

Now is the time for the Adjust Variable action. After you add this action to an event, click Click to edit to open a pop-up dialog letting you change the variable value.

Add event-action

Perform the following:

Step 1: Click the Variable combo box to choose a variable or click the Add Variable (+) button to create a new variable.

Step 2: Click the Operator combo box to choose an operator.

  • True/false variables: assignment, toggle.
  • Text variables: assignment.
  • Number variables: assignment, add, subtract, multiply, divide.

Step 3: Specify the value by which the operation is to be done. It can be a specific value (you yourself specify it) or a value stored by another variable.

Then, the Adjust Variable action that counts the number of times users click a button will look something like this:

Adjust variable action

Create Conditional Actions

Variables are a good way to make conditional actions. For example, a true/false variable can help you set up conditional navigation for your eLearning course. Only when users finish a drag-n-drop exercise can they jump to another slide.

Add conditions

Edit User Variables

To update a user variable, in the Variables dialog, double-click it. You can also select a variable and click Edit in the bottom toolbar. Both ways open the pop-up dialog that allows you to edit the variable. When you’re done editing, click Update to save the changes.

Note: When you rename a variable, all the references to it and actions that involve it will be updated automatically.

Delete User Variables

In the Variables dialog, select a user variable, then press DELETE or click Remove in the bottom toolbar. If the variable is being in use, there will appear a confirmation dialog asking you to confirm that you want to delete it.

Note: When you delete a variable, all the references to it and actions that involve it will remain. You will need to edit or delete those references and actions manually.

So that’s all about how to work with variables in eLearning courses with ActivePresenter. Stay tuned for upcoming tutorials about each variable type.

See Also:

A Complete Overview of Variables
Use True/False Variables
Use Text Variables
Work with Number Variables
Set Pass/Fail Conditions for Lessons
Define Score and Report for Interactive Questions