Criteria

So far we have created a new study in Ethica and added a few data sources to it to collect sensor data. We also added a few surveys and configured them both to be triggered by the participant at any time, or to be triggered at a certain time.

Here we want to discuss another powerful feature in Ethica: criteria. Criteria is a condition that you assign to part of your study, and they enable or disable that part depending on whether they are evaluated to True or False. Ethica continuously evaluates the criteria set in your study for each participant using their most recent responses and prompts each participant with the components that are evaluated as True. This way, you can create a personalized experience for your participants.

You can assign a criteria to an activity, to a triggering logic, or a section of your survey, or a single question. Here we should know how criteria can be used in our demo study. So far, we added a survey with a User-Triggered triggering logic that asked participants to share their motivation for exercise. We will add another survey and ask for their nutrition habits. Then we add a third survey which asks participants whether they want to participate in the exercise motivation part of the study, the nutrition habits part of the study, or both.

So let's go back to the Researcher Dashboard and click on Activities. Then create a new survey by clicking on the New Activity button. We assume you are already comfortable with creating a survey in Ethica. So we just go ahead and create one survey with the following configurations:

  • User-Triggered triggering logic with the button caption set to Food Diary.
  • Starts with an information block telling participants: "We want to know more about your dietary habits."
  • Add an image question that asks "Please share a picture of the food or snack you are having."

Now go back to the Activities page, and add a new survey, with the following settings:

  • User-Triggered triggering logic with the button caption set to Select Your Survey.
  • Add just one Multiple-Choice question asking: "Which part of the study you prefer to participate in?"
  • Add the following three choices to your question:
- Exercise
- Nutrition

So your survey's question flow should look like the following:

Question to ask participants to choose their survey

Take note of the ID of the question. Here the ID of the question is 1 (Q1). Also, note the ID of the choices you added. In the above example, Exercise is answer ID 1 (A1), and Nutrition is answer ID 2 (A2). Publish the survey and go back to the Activities page. Your Activities page should now look like the following:

Activities list

Pay attention to the ID of each survey. You need these to set up your criteria. Your survey IDs definitely will be different than the ones we see in this example. For our example here, the IDs are as follow:

  • ID 7950: Exercise Motivations
  • ID 7955: Quality of Life
  • ID 7958: Nutrition Habits
  • ID 7959: Survey Selector

Now we want to change the Exercise Motivations such that it's only shown if the participant chooses Exercise as their answer to Question ID 1 of Survey ID 7959 (we write Q1 of #7959 for brevity). We also want the Nutrition Habits to be shown only if the participant chooses Nutrition as their answer to Q1 of #7959.

To do so, open the Exercise Motivations survey, find the triggering logic for it, and click on the edit icon on the right side of the triggering logic. In the Edit User Triggering Logic dialog that opens, set the criteria to Q7959_1 == 1 (note that the IDs will be different for your example):

Criteria for the Exercise Motivation survey

This means the triggering logic should be enabled only if the participant chooses Answer ID 1 (i.e. Exercise) as part of their response to Question ID 1 of Survey Activity ID 7959.

Save the change to the triggering logic, then save and publish the survey, and navigate back to the Activities list. Then follow the same steps for the Nutrition Habits survey, and set the criteria for its triggering logic to Q7959_1 == 2.

Save the changes to the Nutrition Habits survey. Now we are done with the changes, and we can check out the changes to our study.

Try As a Participant

Let's check the participant's experience of the changes we made above. Switch back to the app where you had logged in as a participant. You should see that the button for Exercise Motivation is removed and a new button is added that is called Select Your Survey:

Ethica app shows the Select Your Survey button

If you do not see these, it might be because the study settings are not reloaded on your phone just yet. To force-reload the settings, open the app, go to Settings -> My Studies, and tap on Reload Studies from Server.

Here you can see that none of the buttons for the Exercise or Nutrition surveys are shown. That's because so far, as a participant, we have not answered the Survey Selector question. Therefore, Ethica finds no answer to Question ID 1 of Survey ID 7959 and evaluates the criteria to False.

Click on the "Select Your Survey" button, and choose one or both of the presented options. Here we are choosing both "Exercise" and "Nutrition". Press Submit to save the survey and come back to the home screen of the app. Depending on your response, you can see different surveys are shown on the home screen:

Ethica app shows both the Exercise and the Nutrition button

That's because we chose both options, and therefore both Q7959_1 == 1 and Q7959_1 == 2 were evaluated to True. You can click on the Select Your Survey button as many times as you like, and change your options. Your option is immediately applied to the home screen of the app.

Other Uses of Criteria

In the above example, we used the criteria on a triggering logic of type User. This helped us to see immediately how the criteria work in action. You can use criteria on many other components. For example, if you put a criteria on a survey section, Ethica evaluates the criteria immediately before presenting that section to the participant, and depending on the result of the evaluation, it either skips the whole section or shows the section to the participant. Similarly, you can put a criteria on a single question to present or skip that question.

Another useful use of the criteria is on Time Triggering Logic. This defines if Ethica should present a survey or not and if yes when the survey should be presented.