Flow Control

In Ethica, a survey consist of one or more pages which are displayed in sequence to the participant. By default, these pages are shown one after another up to the last page, and then the survey session is completed. There are multiple ways to modify this flow based on participants' responses:

  1. When a given answer to a single choice or multiple choice question is selected, it can override the default flow of the survey.
  2. Each page can have a criteria which has to be met before it's shown to the participant.
  3. A page may be set to be a loop page. In that case, it will iterate based on the response to another question.
  4. A given question can be shown or hidden based on the response to another question within the same page.

Below we explain each of these approaches in more details.

Changing the Next Page

If a given survey page contains any single choice or multiple choice question, each of their potential answers can optionally change the next page. For example, assume you are working on a survey on smoking, and you have three pages of questions as follow:

Page 1:
    At the present time, do you smoke cigarettes?
        - Yes
        - No

Page 2:
    On the days that you smoke, how many cigarettes do you usually smoke?

Page 3:
    In the past 30 days, did you use chewing tobacco?
        - Yes
        - No

The default behaviour is that participant is first presented with Page 1, followed by Page 2 and Page 3. But if they select No in Page 1, this will change the next page from Page 2 to Page 3. Hence pressing Next will take them to the Page 3.

Any potential answer to a single choice or multiple choice question can optionally define the index of the page which should be shown following the current page.

Note that if in a multiple choice question multiple answers define different indexes for next page, the last option selected by the participant will override the previous options. This leads to a nondeterministic behavior and is not suggested. You need to make sure in a multiple choice question, if answers are expected to change the index of the next page, they all point to the same page.

Page Criteria

Criteria allow you to define a condition to determine when a survey page should be shown or it should be skipped, based on the participant's previous responses.

If a criteria is added to a survey page, Ethica evaluates the criteria immediately before showing that survey page. Depending on the responses provided by participants up to that point, the criteria is either evaluated to True or False. This evaluation result determines whether the survey page shown be shown or not. If True, Ethica presents the survey page. Otherwise, if the criteria is evaluated to False, Ethica navigates to the next page following it. If the page with the criteria is the last page, and the criteria is evaluated to False. Ethica will finish the survey.

Loop Pages

You can configure a given page to be a loop page, and associate it to another question. In this case, Ethica will iterate through the loop page zero or more times, based on the response to the referenced question.

As an example, consider the following survey:

Page 1:
    Q1-Number: How many siblings do you have:

Page 2:
    Q2-Single Choice: What is the gender of your {{loop_value}} sibling?
        Male
        Female
        Other
    Q3-Number: How old is your {{loop_value}} sibling?

Here, you can set Page 2 as a loop page and set the reference question to the Question ID 1. In this case, Ethica will ask the questions in page 2 as many times as the number of siblings the participant has. For example, the following shows the questions the participant will be asked if she reports she has 2 siblings:

Page 1:
    Q1-Number: How many siblings do you have:
        2

Page 2 - Iteration 1:
    Q2-Single Choice: What is the gender of your 1st sibling?
        Female
    Q3-Number: How old is your 1st sibling?
        35

Page 2 - Iteration 2:
    Q2-Single Choice: What is the gender of your 2nd sibling?
        Female
    Q3-Number: How old is your 2nd sibling?
        30

Notice that the {{loop_value}} is a placeholder that is replaced by the proper value based on the current iteration and the response to the reference question.

Reference questions must be either a number question or a multiple-choice question. If the reference question is a number question, the loop page will iterate as many times as the number the participant has chosen. If the participant enters 0, the loop page will be skipped completely. If the reference question is a multiple choise question, the loop page will iterate once for each selected answer. In this case, the {{loop_value}} in each iteration will be the text of the chosen answer.

Note that the reference question should be in the same survey as the loop page, and it should appear in one of the pages prior to the loop page. This is to ensure the question is responded before the loop page is expected to be displayed.

Also, Ethica does not support multiple consecutive loop pages. Each loop page must be followed by a normal survey page.

Enabling/Disabling Questions

Ethica allows you to show and hide the questions within a given page, based on the response provided for another question. Any potential answer for a single choice or multiple choice question has a property called Enable question, which receives a list of comma-separated question IDs to be enabled if the participant selects this answer. All questions being enabled are expected to be on the same page as the single choice or multiple choice question containing the potential answer.

For example, assume you want to know if participants have experienced coughing during the last week and if yes, do they think that was due to low air quality. You can create a survey as follow:

Page 1:
    Q1: Did you experience coughing or wheezing the last week?
        - Yes
            [Enable questions: 2]
        - No
    Q2: Do you believe that it is likely that these symptoms were related to poor air quality?
            [Disabled: True]
        - Yes
        - No

You can set Q2 to be disabled by default, therefore it will be hidden and the participant cannot see it. If the participant chooses Yes as the response to the Q1, Ethica will enable Q2 and show it to the participant.