Variables are a great way to store and retrieve dynamic information throughout the course. They also come in useful in creating conditional interactivity to make your course more interactive and personalized. In this article, you’ll learn how to add variables and work with them in ActivePresenter 7.
This tutorial covers:
- Add variables
- Display variable values
- Use actions to adjust variable values
- Update variables
- Delete variables
Take the following steps to add variables:
Step 1: In the Home tab, click Variables to open the Variables dialog.
Step 2: In the User tab, specify the variable name, type, initial value, and description (if any).
- Name: Specify a unique name for the variable. The name should be descriptive and intuitive enough and associated with the data stored. For example, use a learnerName variable to store learner names.
- Type: Represent what kind of data is stored with the variable. Select from three types: true/false, text, and number.
- Value: The data stored within a variable is called a value, and it can be one of multiple types as mentioned above. Normally, when you add variables, you define the variable names and types. For values, 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 Save to create the variable. The new variable will appear in the variable list at the bottom of the dialog.
- ActivePresenter lets you assign a text variable to a text box (Interactions tab > Text Box) to store and track learner input. To do that, select a text box and go to the Properties pane > Interactivity > Score & Reporting > Variable. Then, select a text variable from the list or create a new text variable by clicking the Plus button.
After that, you can create variable references to display the data anywhere in your course. The latter part of this tutorial will show details about this task.
- When you create a report slide (Slide tab > Report Slide), ActivePresenter automatically adds variable references to display relevant information about your course and learner result.
ActivePresenter makes it easy to find where you use a variable. Notice the Usage Count column in the Variable dialog.
Double-click the hyperlinked number for the variable you want to find. Each time it is referenced by slide text or involved in an action will be counted.
Displaying Variable Values
Variables store data. Variable references retrieve and display the data anywhere in your course.
For example, you can use a variable to get the learner name, then use the name throughout the course to personalize your training. On the welcome slide, just ask learners to type their names in a field (text box) and store the learner input in a variable. After that, add references to that variable to display the learner name in multiple slides in your course.
You can add variable references to any text caption, shape, button, or other text-based objects in ActivePresenter. Do the following:
Step 1: Click the text area of the text-based object to open the inline text editor.
Step 2: Go to the Home tab > Reference to open the Variables dialog. The dialog lists out all system and user variables in a project.
Step 3: Select a variable. Both system and user variables are available to add references.
Step 4: Click OK to finish. Then, a variable 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, ActivePresenter replaces the variable names with the actual values of the variables they reference.
Step 5: 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.
Using 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 variable 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. This tutorial gives you the basic and overall understanding of events and actions, plus the common steps to work with both of them.
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.
Perform the following:
Step 1: Click the Variable field and choose a variable from the list.
Or, click the Plus button to open the Variables dialog. From here, update existing variables or create new ones, but in brief, select a variable so as to adjust it.
Step 2: Choose a desired operator from the Operator list. For example, the Assignment operator assigns a value to the target variable. Meanwhile, the Add operator adds a value to the target variable.
You can perform different operators on different types of variables.
- True/false variables: Assignment, Toggle.
- Text variables: Assignment.
- Number variables: Assignment, Add, Subtract, Multiply, Divide. That means you can do math with these variables.
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, your Adjust Variable action will look something like this. It counts the number of times users click the button.
Using Variables in Conditional Actions
Variables are a good way to make conditional actions which occur only when certain conditions are met. See Working with Events – Actions to learn how to add conditions to actions.
For example, use a true/false variable to set up conditional navigation for your course. Only when users finish a drag-n-drop exercise can they jump to another slide.
Do the following steps to update your user variables at any time you want:
Step 1: Click Home > Variables to open the Variables dialog. In the User tab, select a variable from the variable list.
Step 2: Change the variable information. Remember that you cannot change the type of a variable.
Step 3: Click Update to save the changes.
Note: When you rename a variable, all references to the variable and actions that involve it will be updated automatically.
To delete a user variable:
Step 1: Click Home > Variables to open the Variables dialog.
Step 2: In the User tab, select a variable from the variable list, then click Remove.
Note: When you delete a variable, any references to the variable and actions that involve it will remain. You will need to edit or delete those references and actions manually.
So that’s all about the steps to add variables and work with them in ActivePresenter 7. Stay tuned for upcoming tutorials about each variable type. In the meantime, let’s give variables a go.