Skip to main content
andrewg76970232
Known Participant
November 24, 2021
Question

Help with conditional advanced action, with more than one decision group

  • November 24, 2021
  • 1 reply
  • 973 views

Hi All


I am having trouble with a conditional action, and no matter what I try - I cannot get it to work.

 

Background: I create custom knowledge checks (multiple choice), so I can have more control over how they look. I do this using variables and advanced actions. This works fine with single answers, and does the following:

 

  • On entering the slide, a variable for the question attempt (they only get 2 attempts) is set to 0.
  • When a learner selects an answer, it assigns a variable for that answer with 1.
  • When clicking submit, the advanced action checks the attempt number (variable), and the answer selected (variable). I have 4 decision groups that go like this:
    • First attempt = correct. Show correct info and next button
    • First attempt = incorrect. Show 'Try Again' info and close button. The close button changes the attempt variable from 0 to 1.
    • Second attempt = correct. Show correct info and next button.
    • Second attempt = incorrect. Show incorrect info and next button.

 

What I am trying to do now, is use the same logic for a question that requires multiple answers to be selected. I have set up the action to check if its the first attempt, and if all answers have been selected. In the conditional part, I am still chekcing for the attempt number, AND all the answers. For example:

 

  • If ans 1 = 0
  • And ans 2 = 1
  • And ans 3 = 1
  • And ans 4 = 0

 

If attempt 1, the action is to display the correct info. In the ELSE section, it is set to display TRY AGAIN. Then if attempt 2, it is set to show correct, ELSE incorrect.

 

This all makes sense to me loigically, and yet when testing, if I select the wrong answers the first time - it jumps straight to incorrect and does not show TRY AGAIN.

 

I can paste screenshots if need be, just hoping this might be an easy answer for someone in the know!

 

 

    This topic has been closed for replies.

    1 reply

    andrewg76970232
    Known Participant
    November 24, 2021

    I should add, in my exmaples where it works - I do not use ELSE. I simply have a script that has 4 decisions, based on attempt number and whether the correct answer is selected or not. But with multiple needing to be selected, I cannot come up with a way that can capture this completely within the conditional part - and therefore am using ELSE in both of the two decision groups, if the correct answers have not been selected.

     

    On further reading, it seems you should not use multiple groups with ELSE - but I cannot work out how else to capture the attempt number and wrong answers without writing a million conditional groups.

    RodWard
    Community Expert
    November 24, 2021

    Issues like this with Conditional Actions usually come down to two causes:

     

    REASON 1: The variables are not being set as you think they are. 

    To get a better handle on what the variable values are at a precise moment you need to have the variables visible on the slide at run-time by inserted them into text captions or Smart Shapes.  Then you can better see what is happening.

     

    REASON 2: Your conditional logic is flawed. 

    One potential problem here is that Captivate developers tend to forget that all decision blocks get executed one after the other.  So, what sometimes happens is that something done in one of the earlier decision blocks to execute then gets undone by a later one.  This means that the ORDER of the decision blocks must be correct for everything to work.

     

    Personally, I would recommend you DO NOT use Else in your decision blocks unless there are only two possible variable states.  Once you have any more than two possible situations to deal with in a Conditional Action, you almost always need to handle them one at a time in separate decision blocks, which then negates the benefits of using Else actions.

    andrewg76970232
    Known Participant
    November 24, 2021

    Ok, so after testing - the attempt variable remains at 0 the first time I select incorrect answers. And yet, my incorrect feedback box appears. 

     

    In the decision group for the incorrect feedback, the conditional action is to check whether the attempt variable is 1 before displaying incorrect. And yet, this is still appearing at attempt variable = 0