Combining 'And' with 'Or' Conditions Within a Single Trigger

Feb 15, 2022

As the title indicates, I'm trying to create a trigger that combines 'and' with 'or' conditions.  What appears to be happening is that the 'and' isn't effecting the trigger. 

And image of the trigger is attached.

 The 'topic' variables (1, 2, 3 etc.) are all set to True, but the TakeTestOut variable is set to 'False', so this trigger shouldn't execute.  But, the trigger is still changing the state of the target object as if all the conditions were True.  I've tried putting the 'and' at either end of the trigger (i.e., as the first or last condition), but I got the same results.  

I plan to use this in conjunction with other triggers to change the state of the target object (a shape w/ text) to indicate progress as the learner enters, and comes back to, a branching slide.

I'm sure it's something simple that I'm missing.  Any help would be greatly appreciated.

 

7 Replies
Walt Hamilton

The way the OR's are in the trigger, the state will be changed if ANY of Topic 1, 2, 3, or 4 is true, or if BOTH Topic 5 and TakeOutTest are true.  Only one of the six needs to be true to cause execution.

If you want the state changed only when ALL six variables are true, you don't want an OR, just separate everything by AND's. If you want something else, describe it here.

OR executes the action if either one or both the items on either side of it is true.

And executes the action only if both items on either side of it are true.

Jay Cooper

Walt,

What I need is for the trigger to execute only if the variable TakeOutTest=True and any of the TopicX_comp=True. 

What's happening now is that while all of the varialbes TopicX_comp=True, the variable TakeOutTest=False, but the trigger still changes the state of the target audience.

It's as if it's ignoring the 'and' condition and changing the state if any of the variables=true.

Walt Hamilton

Jay,

The AND is working. You can test it by making all the Topic variables false, and it won't change the state. 

The reason it isn't working like you want is because SL doesn't have parenthesis. If it did, you could use them to group all the Topics together, and separate them from TakeOutTest with an AND. That way, if one Topic is true, AND TOT is true, the state is changed.

As it is, to get what you want, you need to write:

If Topic1 is true AND TOT is true OR Topic2 is true AND TOT is true OR, etc.

The ANDs group each topic (individually) with TOT. If that group is true, state is changed.

Then the ORs separate each group, so that if only one (group) is true, state is changed

Complex statements like this are evaluated by taking out the ANDs and ORs one at a time, until it has a score for the entire construction - either true or false. Two objects divided by OR evaluate to true if one (or both) are true. Two objects divided by AND must both be true to evaluate to true. In your original trigger, Topic5 and TOT are united by AND, but all the other objects are divided by OR. If any one of them is true, state is changed. Only Topic5 is joined to TOT.

Jay Cooper

Walt,

Thanks much for the insight.  I used to do this all the time in Captivate, but it's my first shot at doing it in Storyline.  I'll put in your fix above and see what happens.

To anyone from Articulate who's listen...this situation is the only reason my team still has Captivate on the shelf.  When we need to do something kinda complicated, the more straightforward setup of a Captivate Advanced action and the ability to use an 'Else' statement still wins.  If you could tweak your triggers just a bit, I'd be all in.