Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

The order in which conditional action tabs are fired

Participant ,
Oct 22, 2016 Oct 22, 2016

Hi I recently created a conditional action and for some reason the logic failed... mainly down to the 'else' logic.

The user would start with a score of 6 held in a variable Var_Score.

The user would visit 6 different slides and complete an interaction that would either deduct '1' from the Var_Score if they completed the interaction correctly or not deduct anything Var_Score if they completed it correctly. So the highest score would be 6 and the lowest 0.

Each slide would have it's own variable e.g Var_Slide1, Var_Slide2... etc that would be assigned a '1' when the user completed the interaction on each slide. This is to keep a record of when the user had completed each interaction across all 6 slides.

Each slide would contain a home button. The home button then contained logic to check whether each interaction across all 6 slides had been completed, along with the score contained in Var_Score. Depending on the score it would then jump to a different slide. If not all of the interactions had been completed by the user it would jump them to a home slide.

This is an example of the logic...

There's 3 decisions: Low score, med score, high score (in that order).

The first decision would go as follows:

if Var_Score is equal or less than 0 And

Var_Slide 1-6 (there was a separate line for each of these variables) is equal to 1

Jump to slide 11

Else

Jump to slide 4 (the home slide)

The second decision would be almost identical however it would check if Var_Score is greater than 0 and less then 6 (plus all the slides variables were equal to 1) and if it was jump to slide 12 else jump to slide 4

Again the final decision would check if Var_Score was equal to 6 and all the Var_Slides were equal to 1 and jump to slide 13 if it was. Else jump to slide 4.

Now when I tested it if I got a score of 0, or a score between 1 and 5 it was jumping to slide 4. Despite me completing all the interactions across 6 slides. But it worked when I got a score of 6.

So I took out the else line in each decision which was 'else jump to slide 4'.

Instead I made the user go back to the home slide (slide 4) and put in some logic to show a button if all interactions had been completed. The button would then fire the original logic minus the 'else' part and it worked fine.


So it was the 'else jump to slide 4' on each decision that was stopping it from working, except in the case of the last decision.

I'm trying to figure out why it wasn't working though and I think it's to do with the order in which the decisions are triggered.

Any thoughts ?

TOPICS
Advanced
584
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 02, 2016 Nov 02, 2016

Only the last ELSE will ever be done, not the ones in the first decisions. If none of the conditions is met, the user will be navigated to the slide indicated in the Bottom decision. This is due to the fact that Captivate never jumps out of a action but evaluates everything in sequence. Take out the ELSE parts, except eventually for the last decision. It is logical, will try to explain:

  • If Top condition is OK, user gets to slide 13
  • If this condition is not met you think that user will get to slide
...
Translate
Community Expert ,
Oct 22, 2016 Oct 22, 2016

Could you please post a screenshot of the full action? Use the first button (looks like a Play button) on the top right control panel of the Advanced Actions dialog box. That will show the complete action with all decisions, ELSE included.


The logic of advanced actions in Captivate is: all commands are executed, you cannot jump out of the action like in most programming languages. The conditions in the different decisions are evaluated from left to right, the commands from top to bottom, all at once (except when using the Delay Actions command which will create a time lag between actions).

When using more than one decision, in most use cases it is much better never to use the ELSE part (except sometimes for the last decision). Make as many decisions as necessary to cover all possible situations.

I suspect a logical bug indeed, and it would be easier to detect when I can see the total action. In this blog post I explained such a conditional action with a logical bug which I fixed. Scroll down immediately to the part 'ClickClick':

Blog after Posterous? - ClickClick - Captivate blog

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 02, 2016 Nov 02, 2016

Hey here is the preview of it...

I've not collapsed the final decision... so it all fits in one screen shot. But it's identical to the last two other than it jumps to slide 11 if all the conditions are true...

Sorry for the delay I had to go back in and re-create it as I found a different way of achieving what I wanted to achieve.

Interestingly, I've never looked at the preview before and I've noticed that the symbols used to represent 'equals' and 'AND' are the same as those used in Javascript (just learning it at the moment).

Anyway would love to hear your thoughts around why the 'ELSE' was breaking it.

ThanksScreen Shot 2016-11-02 at 15.59.53.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2016 Nov 02, 2016

Only the last ELSE will ever be done, not the ones in the first decisions. If none of the conditions is met, the user will be navigated to the slide indicated in the Bottom decision. This is due to the fact that Captivate never jumps out of a action but evaluates everything in sequence. Take out the ELSE parts, except eventually for the last decision. It is logical, will try to explain:

  • If Top condition is OK, user gets to slide 13
  • If this condition is not met you think that user will get to slide 4, but that is not the case, because CP continues and
  • goes to the Middle condition which could be true if Top is not true, if it is true user goes to slide 12
  • if Middle is not true, you think it would go to slide 4, but CP continues
  • it could be that Bottom condition is met if neither Top nor Middle is OK, then it goes to?
  • if also the third condition is not OK, it goes to?

My proposition was to add a 4th decision which will be when none of the 3 others are met, or put that i the ELSE part of the Bottom decision. ELSE in first two decisions makes no sense. You also have to be very sure that all conditions are mutually exclusive, this is the case for Top and Middle, don't know for Bottom.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 02, 2016 Nov 02, 2016
LATEST

That makes sense!

Thanks for clarifying for me.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources