Skip to content

Commit 1767493

Browse files
authored
Merge pull request #20 from case-framework/study-counters
Study counters
2 parents e95ed43 + 4c1631f commit 1767493

4 files changed

Lines changed: 51 additions & 11 deletions

File tree

2.19 MB
Loading
-994 KB
Loading
-1.61 MB
Loading

content/docs/study-configurator/study-variables.mdx

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
---
2-
title: Study Variables
3-
description: For study-wide dynamic configuration
2+
title: Study Variables and Counters
3+
description: Configuring study-wide variables, viewing and editing counter values
44
---
55

66
import { ImageZoom } from 'fumadocs-ui/components/image-zoom';
77
import { Step, Steps } from 'fumadocs-ui/components/steps';
8+
import { TypeTable } from 'fumadocs-ui/components/type-table';
89

910
import studyVariablesConfig1Img from './images/variable-config-1.png';
1011
import studyVariablesConfig2Img from './images/variable-config-2.png';
1112

12-
## Introduction
13+
<div className='block mx-auto w-fit'>
14+
![Study variables empty](./images/study-variables-empty.png)
15+
</div>
16+
1317

18+
## Introduction
1419

20+
### Study Variables
1521
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.
1622
While "participant flags" provide a way for individualized logic, study variables provide a simple way to control dynamic “global” (study specific) behavior.
1723

1824
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`
2426

2527
Each study can have its own set of study variables. The study administrator can manage them (create, edit value or configuration, delete).
2628
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
3234
- **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.)
3335
</ExampleBox>
3436

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+
<ExampleBox title="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+
3565
## Managing Study Variables
3666

3767
The management of study variables is available in the **"Study Configurator"** module, under the **"Variables"** tab.
3868

39-
<div className='block mx-auto w-fit'>
40-
![Study variables empty](./images/study-variables-empty.png)
41-
</div>
4269

4370
### Creating a Study Variable
4471

@@ -121,3 +148,16 @@ Values of the study variables can be used in the following places:
121148
- available survey expressions: (todo: link)
122149

123150
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.
160+
161+
<div className='block mx-auto w-fit'>
162+
![Study counters view](./images/study-counters.png)
163+
</div>

0 commit comments

Comments
 (0)