Force Criteria to Use Only the Answers from the Current Session

In experience sampling or longitudinal studies, researchers often want to show or hide questions based on how a participant answered earlier in the same session. By default, however, Avicenna looks at all corresponding sessions (including the current one) for finding the last existing response submitted by a participant, not just the current session. This behavior is part of the criteria system and might cause some unwanted flows.

In this article, we’ll show you how you can make sure your criteria references the answers from the current session only.

[!note] General Idea
When evaluating a criteria, Avicenna won’t consider a question’s response in a session if the question was not shown. This can happen if the question is disabled, its criteria is not met, its section is not shown for any reason, etc. Dependent questions may then behave as if the question still holds an old response (from previous sessions) unless your logic explicitly blocks this.

The Situation

You’re running a daily mood check-in. If a participant specifies that they are emotionally overwhelmed, you want to ask the follow-up questions in the same session without affecting the future sessions of the same survey. And some of those follow-up questions depend on each other too.

What to Do?

  1. Identify your current logic setup. For example:

    Q1 [Single answer: Yes(1) / No(2)]  
    Q2 [Number], shown if Q1 == 1  
    Q5 [Text], shown if Q2 > 1  
    

    The problem: If Q1 is not answered ever or the last response to it is 2 (so Q2 doesn’t show up), but Q2 was answered in a previous session, Q5 might still appear.

  2. Update dependent question criteria to include the full condition chain. Change Q5’s criteria from:

    Q2 > 1
    

    to:

    Q1 == 1 AND Q2 > 1
    

    This ensures Q5 only appears if Q2 was shown in the current session.

  3. Make Q1 mandatory and make sure it’s always shown to the participant. This is essential because Avicenna needs to know if Q1 was answered in the current session to determine whether to show Q2.

  4. Apply the same pattern to all dependent questions. For example:

    Q6 → Q1 == 1 AND Q2 > 1
    Q7 → Q1 == 1 AND Q2 > 2
    Q8 → Q1 == 1 AND Q2 > 2
    

    You can also move all these dependent questions into a section and set that section’s criteria to Q1 == 1. This way, you won’t need to include that condition in all those questions’ criteria.

  5. (Optional) Use parentheses for clarity. For example:

    (Q1 == 1) AND (Q2 > 2)
    
  6. Preview and test your flow. Answer Q1 with both possible options and verify that:

    • Q2 only shows up if Q1 == 1.
    • Q5-Q8 only appear if Q2 is visible and has a matching value.
    • No questions appear based on answers from previous sessions.