In Speedernet Sphere, it is now possible to use variables. They offer various scenario possibilities, such as setting up a score, inter-scene actions or the assessment learner progress.
A variable can be a name or a shortcut that is used to store any value which can change over time. In Speedernet Sphere, there are currently 4 different types of variables:
- boolean (true/false)
- number (positive or negative, decimal or integer)
- text (unlimited possible values)
- enum (unlimited possible values)
Each variable can have a default value defined.
Using variables is quick and easy.
A VARIABLES section has been added at the bottom of the ELEMENTS column. It contains two buttons.
The first, identical to that of the "Properties" window, allows you to create and edit the project variables. The second, identical to that of the “conditionals” window, opens a similar window, specifically dedicated to variables.
Open the variable editing window:
There you will see the 4 types of variables previously mentioned.
Click on a button to add a variable type.
A variable is defined by its name, its type and one or more default values. It is obviously possible to delete it. Click on “edit variable”.
In this window, you can edit the variable as needed. It is also possible to change the type of a variable after its creation.
Choosing a suitable name for a variable is important, as it will be used in different systems of conditionals. Set the value of the variable according to your intended use before you "Confirm" editing.
Now, we will be able to define interactions, which depend on the value of a variable (a change in appearance, an animation...) or which can modify it (a click, an answer to a quiz...). To do so, we are going to open the “Variable conditionals” window.
Interactions and consequences of changing variables
The “Variable conditionals” window allows you to create conditionals on the values that a variable can take. Conditionals can read the value of variables in a condition and compare them to another value or even another variable (of the same type). The possibilities vary depending on the type of variable. Take the example of the “number” type variable we have just created.
The variable conditionals allow a large number of numerical comparison operations to be performed. For texts and booleans, it will be possible to test for equality, difference and change of values. For enumerations, we can check, for example, whether a particular value is contained in the variable or not.
In addition to the consequences already present in Speedernet Sphere, it will be possible to modify the value of a variable. In the case of a number, standard numeric operations will be available, as shown in the image below:
Regarding the consequences linked to variables, it is obviously possible to trigger them following an action on an element, such as a click on an image for example.
See you soon for the next tutorial!
I also invite you to consult the following tutorials: