You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Study variables add the capability for study administrators to dynamically steer the behavior of the study system, without the need to change the study rules or questionnaires.
16
22
While "participant flags" provide a way for individualized logic, study variables provide a simple way to control dynamic “global” (study specific) behavior.
17
23
18
24
A study variable has a reference key (unique within the study), a value and a value type.
19
-
The value type can be one of the following:
20
-
- String
21
-
- Number (integer or float)
22
-
- Boolean
23
-
- Date
25
+
The value type can be one of the following: `string`, `integer`, `float`, `boolean`, `date`
24
26
25
27
Each study can have its own set of study variables. The study administrator can manage them (create, edit value or configuration, delete).
26
28
For improved readability, the study administrator can also assign a human-readable label and description to each study variable.
@@ -32,13 +34,38 @@ For improved readability, the study administrator can also assign a human-readab
32
34
-**Threshold:** Set a threshold for a numeric value to trigger a specific action (e.g., if study-counter reaches the threshold, send a researcher notification.)
33
35
</ExampleBox>
34
36
37
+
### Counters
38
+
39
+
A study counter is always an integer number and can be incremented by study rules or study actions [(see also)](/docs/study-rules-editor/basics/study-rules/#4-increment-and-get-study-counter-value). Each counter has a scope key, which is used to identify the counter within the study.
40
+
41
+
42
+
<TypeTable
43
+
type={{
44
+
scope: {
45
+
description: 'Scope of the counter within the study',
46
+
type: 'string',
47
+
required: true,
48
+
},
49
+
value: {
50
+
description: 'Current value of the counter',
51
+
type: 'integer',
52
+
default: '0',
53
+
},
54
+
}}
55
+
/>
56
+
57
+
58
+
Counters can be used to track different aspects of the study, and their values can be accessed by study expressions in the study engine [(see also)](/docs/study-rules-editor/basics/study-rules/#3-get-current-study-counter-value).
59
+
60
+
<ExampleBoxtitle="Use Cases">
61
+
-**Event count:** Track the number of events that have occurred in the study. E.g., if a participant sends in a specific combination of answers, increment the counter.
62
+
-**Participant counter:** Track the number of participants in the study. Count all or eligible participants. This was used for example to assign a unique study code to each participant.
63
+
</ExampleBox>
64
+
35
65
## Managing Study Variables
36
66
37
67
The management of study variables is available in the **"Study Configurator"** module, under the **"Variables"** tab.
@@ -121,3 +148,16 @@ Values of the study variables can be used in the following places:
121
148
- available survey expressions: (todo: link)
122
149
123
150
Other applications specific usage might be available if the application supports it.
151
+
152
+
## Managing Counters
153
+
154
+
The view to manage study counters is available in the **"Study Configurator"** module, under the **"Variables"** tab, next to the study variables.
155
+
Currently supported are the following features:
156
+
- View all counters with their scope key and value
157
+
- Initialize a new counter for a scope with a specific starting value
158
+
- Change the value of a counter to a specific value: use this action carefully, considering the impact on the study flow and the study rules. (E.g., if you are using a counter to generate a sequential ID for a participant, changing the value of the counter will affect the ID assignment.)
159
+
- Delete a counter: this will remove the counter from the study, until it is initialized again. Initialisation might happen through a study rule or study action, so the counter value for the scope might appear again automatically.
0 commit comments