Sampling

Sampling Graph

The sampling defines in a visual language when an action will be performed. With this visual language several sampling blocks can be combined to design a sampling scheme that fits nearly every study.

You can drag the blocks from the left side to the white sampling document on the right side. You can rearrange the blocks by dragging them around. You can adjust the view of the sampling document by dragging the white background.

After placing the blocks you can configure them. You can do so by double-clicking the block or clicking on the edit pen in the right top corner of the block. In the appearing window you need to configure the block. As soon as you saved the block configuration the block shows its configuration in an abbreviated version. The "Form" block only shows the internal id of the form. With the root block Sampling Running you can configure the study like the pin code or the lockout mode.

The sampling blocks can be combined in a specific order (the grammar of the visual language). This order is represented through the colors of a traffic light (red, yellow, green).

  1. One or more red conditions. These conditions narrow down the range of the sampling.
  2. One yellow trigger. This trigger defines when the actions below start.
  3. One or more green actions. These actions execute as soon as the trigger applies.

As soon as you have placed some blocks in the sampling document you can connect them. Do this by dragging the handle on the bottom of the block to the top of the subsequent block. The handle of the block (square or circle) assures that you only place one trigger in each path.

You can save your sampling by pressing the save button in the top right corner.

WARNING

If you leave the sampling page without saving, your changes will be lost!

Alarm Configuration

The alarm block triggers the participant to e.g. fill out a form. In the default configuration the alarm reminds the participant over five minutes.

By changing the Sound/Vibration duration, the Display duration and the Number of alarms, you can configure how often and how long the participant will be reminded. You can also allow the participant to delay or dismiss the alarm if he is currently busy.

Random Time Trigger

The random time trigger follows a stratified randomization instead of allowing random prompts at any possible time. It takes the set time frame and divides it equally to accommodate the number of required prompts. It’s within these smaller chunks that the random prompt appears, only governed by the minimum time between prompts.

For Example, you set the Start Time to 8:00 and the End Time to 20:00, the Number of Prompts to 6 and the Minimum Time Between Prompts to 0:30 (30 minutes). The random time trigger will now divide the 12 hour time frame between start time and end time into 6 chunks of 2 hours. So the 6 prompts appear randomly in the following time frames:

Note: If a prompt occurs near the end of its time frame, the next prompt actually falls in a smaller time frame due to the minimum time between prompts. E.g. in the example above, if the first prompt occurs at 09:50 and the minimum time between prompts is set to 0:30, the second prompt triggers sometime between 10:20 and 12:00.

WARNING

There are 2 different messages which could be displayed by the smartphone after starting a study with the random time trigger:

  1. Configuration warning in 'Random Time': 'Minimum Time Between Prompts' is too high to get a good random distribution.
    This message will be displayed, when two times the Minimum Time Between Prompts is higher than the potential time frame. This may lead to a bad randomization.
  2. Configuration error in 'Random Time': 'Number of Prompts' do not fit into day because of 'Minimum Time Between Prompts'.
    This message will be displayed when the configured Minimum Time Between Prompts is higher than the potential time frame. This will lead to a non-functional randomization.

Best practice

Simple Scheme

Sampling every day between 08:00 and 20:00, 8 alarms with one form. If you have a SIM-Card and mobile data contract installed in your smartphone you can instantly upload the collected forms by adding an upload block. For simplicity we only added this block to this example.

Simple Scheme + Participant Can Start the Form

The same scheme as before, but now the participant starts a form himself by pressing the button Start form. An alarm is not necessary if the participant triggered the form himself.

Weekday/Weekend Sampling Scheme

In this scheme we added two weekday blocks and two fixed time blocks. From Monday to Friday, the random sampling is active. At the weekend only at the fixed time 14:00 and 18:00 o’clock an alarm comes up.

Different Forms at Different Days

If you want to have different forms to appear at different days of the study you can use the Sampling Day blocks. In the example below the first path is only executed at day one, the second path is executed at day two.

Different Forms at Different Times

If you want to have different forms to appear at different times you can have a different path (with an alarm block and a form block) for each time.

Mixed Scheme

Of course you can also mix all the examples above, but we recommend keeping it as simple as possible.

Different Start Dates for Each Participant

It is very common, that you run a study with multiple participants that start at different days. Please try to keep your sampling scheme as date independent as possible and try not to use the Date Range block. Instead just define a start and end date for each participant in the Participants tab of your study.

In the example below the sampling for the first participant starts at 2013-03-12 and ends at 2013-03-19 (both days included). The sampling for the second participant starts one day later but does not end until you stop it on the smartphone. The sampling for the third participant starts as soon as you start the sampling on the device and will only stop if you stop it on the smartphone.

Mutable Values (a.k.a. Variables)

With mutable values the sampling scheme can be even more flexible. It is very powerful, but can also introduce errors, if the sampling scheme is not correctly designed. This feature is currently in beta, please contact us, if you want to test this feature!

  1. Make sure you use the movisensXS Android app version 0.6.3412 or newer.
  2. Go into the preferences of your study (wrench icon), select movisensXS Library v3357 or newer and save the changes.
  3. Go into the sampling, there are now new sampling blocks available in the Advanced tab (Check Mutable Value and Change Mutable Value).

With these two blocks it is possible to activate/deactivate different parts of your sampling in dependency of previous actions.

The following example demonstrates on how to activate a random triggering only, if a participant filled out an "Out of bed" questionnaire.

The following example demonstrates on how to activate a random triggering only, if a participant is not asleep.

The following example demonstrates on how to show a button only, if the participant has not yet completed this form today.

The following example demonstrates on how to implement a Do not Disturb button, that the participant can use if he does not want any alarms in the next hour.

Sampling Blocks Library version 6510

Study Running

This node is active if the study is running.

Label Description Type Default-Value
Enable Messaging Allow participant to write/receive messages to/from the study supervisor. Boolean true
Full Screen movisensXS runs in fullscreen during the study. Boolean false
Lock other Applications If you activate this other applications are not accessible for the participant. Boolean false
Allowed Apps Beta Specify apps that are allowed to run (e.g. 'com.yourApp'). This is required if you are using your own apps in the forms. This functionality may not work on Android 5.0 or higher. String com.yourApp
Not Allowed Apps Beta Specify apps that are not allowed to run (e.g. 'com.yourApp'). String
PIN code This pin code allows the supervisor to control the study. The pin code '0' enables accessing the study control without pin. Integer 2486
Log Node Status and Variables Beta Logging of node status changes into the unisens file format under /sdcard/movisensXS/logs/ Boolean false
Mutable Value Editor Developer Enables mutable value editor which is accessible via study management screen. Boolean false
Form Starter Developer Enables form starter which is accessible via study management screen. Boolean false
Disable home screen Beta Disables the home screen from showing. Only necessary if movisensXS is used to trigger actions in the background. Boolean false

Advanced

Change Mutable Value Beta

This action can change a mutable value.

Label Description Type Default-Value
Mutable Value Beta Name of the mutable value String Counter
Operation Beta Operation to perform (set, increment, decrement) String increment
Value Beta Value of the operation (If operation='set' the mutable value is changed to this value. If operation='increment/decrement' the variable is changed by this amount). String 1

Check Mutable Value Action Beta

This action can check a mutable value and blocks following nodes if defined condition not applies.

Label Description Type Default-Value
Mutable Value Beta Name of the Mutable Value. [Predefined Mutable Values are SamplingDay, SamplingNumber] String Counter
Comparison Operator Beta Comparison operators between Mutable Value and Compare Value, e.g. is true if Mutable Value is 'greater' than Compare Value (equal, unequal, greater, less) String equal
Compare Value Beta Value to compare the mutable value to (Not case sensitive). String 1

Check Mutable Value Beta

This condition is true if the mutable value is equal to the compare value.

Label Description Type Default-Value
Mutable Value Beta Name of the Mutable Value. [Predefined Mutable Values are SamplingDay, SamplingNumber] String Counter
Comparison Operator Beta Comparison operators between Mutable Value and Compare Value, e.g. is true if Mutable Value is 'greater' than Compare Value (equal, unequal, greater, less) String equal
Compare Value Beta Value to compare the mutable value to (Not case sensitive). String 1

Delay

This event delays the previous event for the specified time and then triggers the successor nodes.

Label Description Type Default-Value
Delay Time to delay the source signal in seconds Integer 10

Frequency Limit Beta

This action prevents too much triggers.

Label Description Type Default-Value
Time between triggers Beta Minimal time between triggers in seconds Integer 3600

Context

App Used Beta

This trigger fires if the specified app or activity is opened/closed. This functionality may not work on Android 5.0 or higher.

Label Description Type Default-Value
Type Beta Defines if triggers on open or close of the application (AppOpened, AppClosed). String AppClosed
Package or activity identifier Beta The identifier of an app (e.g. com.android.settings) or of an activity (e.g. com.android.settings/.Settings) to trigger on. String com.android.settings/.Settings

Geofence Trigger Beta

This event fires if a given geofence was entered, left or the participant is staying in it over some time.

Label Description Type Default-Value
Latitude Beta Latitude of the geofence. Double 0
Longitude Beta Longitude of the geofence. Double 0
Radius Beta Radius of the given geofence in meter. Integer 100
Geofence Type Beta Specifies if the trigger will be triggered by entering, leaving or staying in the bounds of the geofence. Options [Enter, Stay, Exit]. String Enter
Duration of Stay Beta Specifies how long the participant must stay in the geofence in seconds to trigger it. Only needed if the geofence type is 'Stay'. Integer 300
Initial Trigger Beta Specifies if the geofence should trigger the initial location of the participant dependent on the geofence. Boolean false

GIS Trigger Beta

This trigger fires if the GIS returns a trigger.

Label Description Type Default-Value
GIS url Beta GIS url String
Distance Beta Distance the device must travel to check the GIS. Distance in meters. Integer 100

Location Changed Beta

This trigger fires if the location changed.

Label Description Type Default-Value
Distance Beta Distance the device must travel to trigger a location change. Distance in meters. Accuracy varies between 10 and 1000 meters. Integer 1000

Location Accuracy Beta

This action changes the location accuracy.

Label Description Type Default-Value
Accuracy Beta Requested Accuracy (Auto, High, Passive) String Auto

Deprecated

SensorTrigger: Sensor Disconnected Beta

Triggers when the coupled sensor of the 'Sensor Trigger' was disconnected from the smartphone.

SensorTrigger: Sensor Stopped Beta

Triggers when the coupled sensor of the 'Sensor Trigger' was stopped.

SensorTrigger: Stop Sensor Beta

This action stops the coupled sensor of the 'Sensor Trigger'

SensorTrigger: Trigger Beta

Triggers when the 'Sensor Trigger' triggers.

Development

Send Intent Beta

This action executes an android intent operation. An Android intent is an abstract description of an operation to be performed.

Label Description Type Default-Value
Action Beta The general action to be performed, such as 'android.intent.action.VIEW'. String com.yourApp.YourReceiverName
Data Beta The data to operate on, such as a web url. String
Type Beta The type of intent [App, Activity, Broadcast, StartSerice or StopService]. String Broadcast

Intent Received Beta

This condition listens to an android broadcast intent operation.

Label Description Type Default-Value
Intent Beta An Android broadcast intent is an abstract description of an operation to listen on. String com.yourApp.YourBroadcastName

Forms

Alarm

This notifies the participant about a task he has to perform e.g. fill out a form.

Label Description Type Default-Value
Title Title text of the alarm. String Alarm
Sound/Vibration duration How long the sound and vibration lasts per alarm in seconds. Integer 10
Display duration How long one alarm will be shown after sound and vibration in seconds. Integer 50
Number of alarms How often a alarm shows. Integer 5
Maximum delay time How long the participant can delay the alarm in minutes (0=disabled). Integer 20
Dismissable The participant can dismiss the alarm. Boolean true

Form

This action runs the specified form. Place an alarm before to notifiy the participant about the form!

More information about randomization and page indicators can be found here

Label Description Type Default-Value
Form ID Id of the form to run String
Timeout Interval After how many seconds of inactivity a timeout warning will be shown. (0 = disable) Integer 60
Timeout Length Length of the timeout alarm in seconds. Integer 20
Display back button Allows the user to go back to the previous question. Boolean true
Show Page Indicator Shows a small page indicator at the top of the form. Boolean true
Screen orientation Locks the screen orientation [Free, Portrait, Landscape]. String Free
Randomized Beta If marked, the questions are displayed in a random order. Boolean false
Include Form to Gamification Developer If marked, the the completions or incompletions will be used in gamification score calculation. Boolean true
Count of random items Beta Shows only the given count of all items in a stratified randomized order (if randomized is activated). If 0 all items will be randomized. Integer 0

Upload Results

This action uploads the collected results to the server.

Label Description Type Default-Value
Automatic upload retry Retry upload automatically if no internet connection was available. Options [None, Wlan, Any] String Wlan

Logging

Notification Trigger Beta

Trigger when a notification arrives. Please note: Notifications arrive very often, keep in mind to not bother your participants to often.

Label Description Type Default-Value
Filter Beta Only react to the given packages (Separated with ';') String com.whatsapp

Record Audio Beta

This action records the audio of the microphone for the specified duration. Files are stored on the sdcard in the folder 'movisensXS/EAR'. Please Note: If you use this, you shouldn't use other item formats which connect to the microphone (video, audio).

Label Description Type Default-Value
Duration Beta Time to record audio in seconds Integer 45
Uncompressed Beta The files are saved as uncompressed .wav foles Boolean false

Smartphone

Battery Low Beta

This condition is true if the battery level is below the configured level.

Label Description Type Default-Value
Level Beta The low battery level. Integer 20

Study

Number of Responses Beta

This condition is true if the number of responses are in the defined range (Response number starts with 0 and increments if a form is completed).

Label Description Type Default-Value
Minimum responses Minimum responses to be true Integer 0
Maximum responses Maximum responses to be true Integer 50

Button pressed

This event fires if the participant presses a presented button and triggers the successor nodes. A.k.a. Event-contingent.

Label Description Type Default-Value
Button label Label of the button that is shown in the home screen String Start form
Button order The order of the buttons on the home screen. The higher the order/weight, the deeper it sinks. Integer 1
One time button If you activate this the button is only once clickable. Boolean false
Button Group Developer Button will be added to the defined button group and can be minimized. String

Time

Date Range

This condition is true if the current date is in the selected range. Start and end date is included.

Label Description Type Default-Value
Start date Start date of the condition. Dates must be formatted as yyyy-MM-dd Date
End date End date of the condition. Dates must be formatted as yyyy-MM-dd Date

Fixed Time

This event fires if the specified time is reached and triggers the successor nodes. A.k.a. Interval-contingent.

Label Description Type Default-Value
Time Time in the format HH:mm Date 14:00

Immediately

This event fires as soon as the previous node is true.

Initial

This event fires only once after the previous node is true.

Participant Time Trigger Beta

This event fires if the time of the mutable value is reached and triggers the successor nodes. The mutable value can be set by the participant with the time item format in a form.

Label Description Type Default-Value
Mutable Value Beta Name of the Mutable Value. String Time_1
Repeated Beta Trigger should be repeated every day. Boolean true

Random Time

This event fires randomly a specified number of prompts in the specified time period and triggers the successor nodes. A.k.a. Signal-contingent.

Label Description Type Default-Value
Start Time Time in the format HH:mm Date 08:00
End Time Time in the format HH:mm Date 20:00
Mutable Value Name for Start Time Beta Name of mutable value which defines the start time. String
Mutable Value Name for End Time Beta Name of mutable value which defines the end time. String
Number of Prompts Number of Prompts between start and end time Integer 8
Minimum Time Between Prompts Time in the format HH:mm Date 00:30

Repeated

This trigger fires in the configured interval as long as the previous condition stays true.

Label Description Type Default-Value
Repeat interval Interval to trigger in seconds. 3600 = 1 hour. Integer 3600
Reset time, when other triggers happen Beta When enabled, the interval time is reset, if another trigger happened during the interval time. Boolean false
Randomization time Beta Time to randomize the repeat interval in seconds. e.g. 600 = ±10 minutes. Integer 0

Sampling Day

This condition is true if the sampling day is in the defined range (Sampling day starts with day 1 and increments at midnight if sampling is running).

Label Description Type Default-Value
Start day Start day as number Integer 1
End day End day as number Integer 2

Time Range

This condition is true if the current time is between the specified time range.

Label Description Type Default-Value
Start Time Time in the format HH:mm Date 08:00
End Time Time in the format HH:mm Date 20:00
Mutable Value Name for Start Time Beta Name of mutable value which defines the start time. String
Mutable Value Name for End Time Beta Name of mutable value which defines the end time. String

Weekday

This condition is true if the enabled weekday is reached.

Label Description Type Default-Value
Weekdays Comma-seperated list of enabled weekdays. [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday] String Monday, Tuesday
Last Updated: 8/27/2019, 5:06:02 PM