Skip to content

Commit aec7c0f

Browse files
authored
Merge pull request #208 from revisit-studies/jk/displayRule
Add display requirement example code
2 parents 4069c41 + f8e8e4e commit aec7c0f

4 files changed

Lines changed: 28 additions & 4 deletions

File tree

docs/designing-studies/device-restrictions.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ These checks are configured in `studyRules`.
77

88
`studyRules` supports:
99

10-
- `display`: minimum viewport dimensions in pixels
10+
- `display`: allowed display sizes
1111
- `browsers`: allowed browser names and optional minimum versions
1212
- `devices`: allowed device types (`desktop`, `tablet`, `mobile`)
1313
- `inputs`: allowed input types (`mouse`, `touch`)
1414

15-
The following snippet shows how to config device restrictions:
15+
:::note
16+
`minWidth` and `minHeight` are now configured under `studyRules.display` instead of `uiConfig`.
17+
18+
The previous properties `minWidthSize` and `minHeightSize` have been renamed to `minWidth` and `minHeight`. The `minWidthSize` and `minHeightSize` property is now removed and should no longer be used.
19+
:::
20+
21+
The following snippet shows how to configure device restrictions:
1622

1723
```json title="public/study-name/config.json"
1824
"studyRules": {
@@ -51,15 +57,33 @@ The following snippet shows how to config device restrictions:
5157
When a participant starts the study, reVISit validates the participant environment against `studyRules`.
5258
If requirements are not met, a blocking screen is shown with the rule that failed.
5359

60+
## Setting Display Requirements
61+
62+
You can restrict your study to specific screen-size requirements to ensure participants use a supported display.
63+
64+
Configure display restrictions in the `studyRules` section. Use `studyRules.display` to define minimum and optional maximum screen dimensions.
65+
66+
```json title="public/study-name/config.json"
67+
"studyRules": {
68+
"display": {
69+
"minHeight": 600,
70+
"minWidth": 1024,
71+
"maxHeight": 1440,
72+
"maxWidth": 2560,
73+
"blockedMessage": "This study requires a screen between 1024x600 and 2560x1440."
74+
}
75+
}
76+
```
77+
5478
For display-size checks, participants see a warning screen with a one-minute countdown timer showing current and required dimensions.
5579

5680
The participant has one minute to resize their browser window. During this time, reVISit continuously monitors the window size. Once both the width and height meet the requirements, the warning disappears and the study begins.
5781

5882
If the timer runs out and the screen is still too small, the participant will see a training failed page and will not be able to continue the study.
5983

60-
In the participant table, the participant will be listed as rejected with the reason "Screen resolution too small."
84+
In the participant table, the participant will be listed as rejected with the reason "Screen resolution requirements not met."
6185

62-
![Device Size Check Rejected Participant](./img/device-check/screen-resolution-too-small.png)
86+
![Device Size Check Rejected Participant](./img/device-check/screen-resolution-not-met.png)
6387

6488
## Setting Browser Requirements
6589

10.6 KB
Loading
16.5 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)