Compound Condition

An overview of the Compound Condition

For an Overview of Conditions, click here.

A Compound Condition is a set of sub-conditions joined by operators.  

Compound Conditions joined by an AND operator must satisfy all of the sub-conditions to evaluate to true. Whereas Compound Conditions joined by an OR operator must satisfy any of the sub-conditions in order to evaluate to true.

2021-05-04_10-12-24

Required Fields

Field Name Description
Operator

The operator joins the sub-conditions together.  

AND = all of the sub-conditions must be satisfied to be true.

OR = any of the sub-conditions satisfied to be true.

Conditions Two or more sub-conditions added together to create the Compound Condition.

Optional Fields

Field Name Description
Negate Result

If selected, the truth value will be the opposite for this condition. That is, when it would be normally true it will be false, and when it would normally be false it will be true. 

For a detailed explanation of evaluating Compound Conditions with Negate Results, click here.

Create a Compound Condition

The quickest way to create a Compound Condition is to simply drag and drop two or more Conditions into the Conditions frame and then make all of your selections:

2021-05-04_10-01-15 (1)

Example of a Compound Condition 

You could create a Compound Condition with a Timer Condition and World Object Proximity Condition.  If you used the AND operator, it could be defined as "The timer must have run for 3 seconds AND the user is within 10 meters of a particular location".  Both must be true for a Compound Condition to be true:

2021-05-04_09-41-09-1

If you used the OR operator, it would be "The timer must have run for 3 seconds OR the user is within 10 meters of a particular location".  Either could be true for the Compound Condition to be true:

2021-05-04_09-47-27

 

Evaluating Compound Conditions with Negate Result

Step 1:  Add Sub-Conditions (Author)

Add two or more sub-conditions and determine which ones require the Negate Result option checked.  Some conditions don't have a Negate Result option because it doesn't make sense for the condition or the condition itself allows for a negative result.  

In this example, I've chosen to Negate Results for Sub-Condition 2, but not 1.  Sub-Condition 3 does not have this option available:

Screen Shot 2021-05-05 at 12.36.32 PM

Step 2:  Sub-Conditions Evaluated (Story Flow)

Based on the activity in the VR Scenario, Story Flow will determine if each sub-condition evaluates to True or False and moves those results up to the Compound Condition level:

Screen Shot 2021-05-05 at 12.44.20 PM

Step 3:  Compound Condition Evaluated (Story Flow)

The Compound Condition will then be evaluated to True or False based on selections made to the Compound Condition (operator, negate result) and the results from the sub-conditions (described in Step 2):

Screen Shot 2021-05-05 at 12.49.20 PM

Example in Action

I've set up an example of this using the article How to use Timer Conditions to Prompt the User.

In this scenario, the learner has to click on the "ok" button of the welcome message to proceed.  

My script has a Compound Condition with two sub-conditions:  Timer and Object Event.  I've set it up to say that "If the learner has not clicked the "ok" button of the Welcome Message AND 10 seconds have passed, then play the timed hint".  Note that the Negate Result box is checked for the Object Event Condition because the button wasn't clicked therefore it wasn't closed.

Screen Shot 2021-05-05 at 1.31.32 PM

If this Compound Condition evaluates as true, then my timed hint (an audio recording) will play:

Screen Shot 2021-05-05 at 1.35.15 PM

This is what the learner would experience in the headset if the "ok" button was not clicked:

If the learner does click on the "ok" button, we would not want this timed hint to play.  So, I've added a Close Frame resource as this article suggests and it will remain unplayed.