In the previous section, we added one activity to our study. Participants could tap on the button for that activity from the home screen of their app and respond to it. They could do it as many times as they wanted, and any time they wanted.
In some cases, this is ideal, for example, if we are asking participants to report anything that motivates them to exercise. But in many cases, we may have certain conditions on when the activity should be presented to the participants, how often it should be presented, and how much time participants have to complete the activity. The logic that defines these is called Triggering Logic.
Our previous activity,
Exercise Motivations, used a User-Triggered Triggering Logic. It means participants decide when and how many times to trigger the activity. That's why the button for the activity is always on the home screen of the app.
Ethica supports other types of triggering logics as well. For example, a Time-Triggered Triggering Logic prompts the activity based on a certain timetable. Another example is the Proximity-Triggered Triggering Logic which prompts the survey based on Bluetooth-based sensor data. Or Geo-fence Triggering Logic which uses GPS data for prompting a given activity.
You can read more about this in the Study Activity documentation. Here we continue our example study by adding a survey activity to it which is prompted once a day at 7 pm and asks about their general health.
To do this, we again go to the Activities page of the Researcher Dashboard and click on
New Activityto create a new survey. We call the survey
Quality of Life. In the Activity Editor, I remove the content in the description and delete the default User-Triggered Triggering Logic.
Triggering Logics tab in the Activity Editor
Then, in the Triggering Logic section, click on
Timeto add a new Time Triggering Logic.
This dialog has many settings and we don't plan to go through all of them here. But we encourage you to read the details in the Triggering Logic section.
For our use case here, we set the
Study Registration Date. This way, all the calculations will be based on the midnight before the participant joined the study. For example, whether the participant joins at 10 am or 5 pm on Nov. 11th, the calculations will be based on Nov. 11th at 00:00.
We also set the
First Triggerto be on Day 1 at 19:00:00. We further set it to repeat once a day for 14 days. The image below shows the settings of our Triggering Logic.
Configuring the Time-Triggered Triggering Logic
Now if you click on the
Test The Schedulebutton, you can try out how Ethica will calculate the activity prompt time based on this setting. You can choose a date and time to represent a participation start time of a hypothetical participant, and Ethica shows what time our survey will be presented.
For example below you can see that based on our settings, if a participant joins on Feb., 26th, at 9:15, they will receive surveys on Feb., 27th at 19:00, Feb., 28th at 19:00, and so on.
Example schedule of Time-Triggered Triggering Logic
Now if you click anywhere outside of the Triggering Logic box, the new triggering logic is saved in our survey.
Ethica by default does not prompt any notification when an activity is prompted. You need to create your Notification Template and link it to your activity as well. This can be done simply in the
Notification Templatessection of the Activity Editor.
If you are unfamiliar with these terms, please refer to the Notification article as it will teach you how to create a Notification Template and link it to your activity.
After linking the Notification Template to your activity, we also want to give 1 hour to participants to complete each session of the survey. If they don't complete a session within this 1 hour, we want it to be expired. To do so, go back to the Contents section and open the
Settingstab on the lower right side of the screen. At the bottom of the Settings find the
Expiry Timeoption, and set it to After 60 minutes.
Setting the Expiry Time for the survey
In the last step, we add questions to our survey. As this is about quality of health, we use a vertical visual analog scale as shown below:
Adding questions in the Activity Editor
Then we finish by publishing the survey. When the survey is published, Ethica reloads the device for our current participant and schedules the survey sessions for him or her every day at 7 pm.
Unlike User-Triggered Triggering Logic, if you check the app as a participant, you will not see any survey waiting for your response. This is because the first survey is supposed to be prompted at 7 pm, and be available for 1 hour. You will receive a notification at 7 pm when the survey is available.
But you can check the schedule Ethica has for this participant via the Sessions page. So let's go back to the Researcher Dashboard and click on Sessions from the left panel. Then choose our participant from the list, and from the list of activities, choose the survey we just created. For the date range, we choose relative dates from 0 to 45. Pressing
Gowill show all scheduled surveys for this participant.
Scheduled surveys shown in Sessions page
As you can see above, the participant starts receiving the survey every day at 7 pm, starting from Day 1, and none of those surveys are responded to yet. As the participant completes these surveys, the status of these sessions is updated here.
Note that in some cases, the first prompt for the participants might start from day 2. This happens when participants join the study before a survey is added to the study, i.e. if by the time that you add a survey to your study, the participant is already on his or her second day of the study, Ethica will prompt the survey from the second day.