Explaining Conditional Actions

The If, Else and Select actions are examples of Conditional actions.

Think of a Conditional action like asking a question which can only have a yes (i.e. true) or no (i.e. false) answer, for example, ‘Is the name of the user John?’ or ‘Is the user’s score above 50%?’ In Opus, you can ask these types of questions and then (based on the answer) you can run one group of actions or another depending on whether the answer was true or false. Therefore, using Conditional actions allows you to control when certain actions happen, which is an important part of building a publication.

Below is an example of how you can use Conditional actions to control your publication.

Example: Showing Feedback in a Quiz publication

When a user answers a question correctly a Congratulations image is displayed. When the answer is incorrect they are taken to a review page:

image\Conditional_Actions_Example.jpg

In this illustration, the Check Answer Button object uses an If and an Else action to control what the user sees depending on whether they answered the question correctly or incorrectly.

 

 

A Conditional action is made up of the following:

1. All conditional actions use the contents of a variable and compare it with another bit of information. In the following example we will use a variable named my_Score, this currently has the value 60.

Note:
For the If action this is set in the Name of variable to compare box.

2. Next you set how you are going to compare the variable with another bit of information. In this example, we will use the comparison Is Greater than. That means that my_Score must be greater than the other bit of information if the answer is going to be true e.g. 60 is greater than 50 but not greater than 70.

Note:
For the If action this is set in the Comparison box

3. Now we need something to compare the variable in point 1 with. In the If action, this can be text, a number or the contents of another variable. In this example, lets use another variable named passmark, which currently has the value 50.

Note:
For the If action this set in the Compare with panel.

4. Finally, we have to state whether we want the group of actions to play if the answer is correct (i.e. true) or incorrect (i.e. false). In this example, the Conditional action will return the value true because the value of my_Score is greater than the value of passmark. However, the group of actions will only play if you

Note:
For the If action this is set in the Test box.

Related Topics:

the IF action

Adding Actions to an IF...Else Action