revisit 0.0.20__py3-none-any.whl → 0.0.21__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2130 +0,0 @@
1
- {
2
- "$ref": "#/definitions/StudyConfig",
3
- "$schema": "http://json-schema.org/draft-07/schema#",
4
- "definitions": {
5
- "Answer": {
6
- "additionalProperties": false,
7
- "description": "The Answer interface is used to define the properties of an answer. Answers are used to define the correct answer for a task. These are generally used in training tasks or if skip logic is required based on the answer.\n\nAnswers are used to defined correct answers for a task. These are generally used in training tasks or if skip logic is required based on the answer. The answer field is used to define the correct answer to the question. The acceptableLow and acceptableHigh fields are used to define a range of acceptable answers (these are currently only used for training). For example, if the correct answer is 5, and the acceptableLow is 4 and the acceptableHigh is 6, then any answer between 4 and 6 will be considered correct.\n\nHere's an example of how to use the Answer interface to define the correct answer to a question:\n\n```js { \"type\": \"markdown\", \"path\": \"<study-name>/assets/question.md\", \"response\": [ { \"id\": \"response1\", \"prompt\": \"What is 2 + 2?\", \"required\": true, \"location\": \"belowStimulus\", \"type\": \"numerical\" } ] \"correctAnswer\": [{ \"id\": \"response1\", \"answer\": 4 }] } ```\n\nIn this example, the correct answer to the question \"What is 2 + 2?\" is 4. If the participant answers 4, they will be considered correct. If they answer anything other than 4, they will be considered incorrect.",
8
- "properties": {
9
- "acceptableHigh": {
10
- "description": "The acceptable high value for the answer. This is used to define a range of acceptable answers.",
11
- "type": "number"
12
- },
13
- "acceptableLow": {
14
- "description": "The acceptable low value for the answer. This is used to define a range of acceptable answers.",
15
- "type": "number"
16
- },
17
- "answer": {
18
- "description": "The correct answer to the question."
19
- },
20
- "id": {
21
- "description": "The id of the answer. This is used to identify the answer in the data file.",
22
- "type": "string"
23
- }
24
- },
25
- "required": [
26
- "id",
27
- "answer"
28
- ],
29
- "type": "object"
30
- },
31
- "BaseComponents": {
32
- "additionalProperties": {
33
- "additionalProperties": false,
34
- "properties": {
35
- "allowFailedTraining": {
36
- "description": "Controls whether the component should allow failed training. If not provided, the default is true.",
37
- "type": "boolean"
38
- },
39
- "config": {
40
- "description": "The vega-lite configuration.",
41
- "type": "object"
42
- },
43
- "correctAnswer": {
44
- "description": "The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",
45
- "items": {
46
- "$ref": "#/definitions/Answer"
47
- },
48
- "type": "array"
49
- },
50
- "description": {
51
- "description": "The description of the component. This is used to identify and provide additional information for the component in the admin panel.",
52
- "type": "string"
53
- },
54
- "instruction": {
55
- "description": "The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",
56
- "type": "string"
57
- },
58
- "instructionLocation": {
59
- "$ref": "#/definitions/ResponseBlockLocation",
60
- "description": "The location of the instructions."
61
- },
62
- "meta": {
63
- "additionalProperties": {},
64
- "description": "The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",
65
- "type": "object"
66
- },
67
- "nextButtonDisableTime": {
68
- "description": "A timeout (in ms) after which the next button will be disabled.",
69
- "type": "number"
70
- },
71
- "nextButtonEnableTime": {
72
- "description": "A timer (in ms) after which the next button will be enabled.",
73
- "type": "number"
74
- },
75
- "nextButtonLocation": {
76
- "$ref": "#/definitions/ResponseBlockLocation",
77
- "description": "The location of the next button."
78
- },
79
- "nextButtonText": {
80
- "description": "The text that is displayed on the next button.",
81
- "type": "string"
82
- },
83
- "parameters": {
84
- "anyOf": [
85
- {
86
- "additionalProperties": {},
87
- "description": "The parameters that are passed to the react component. These can be used within your react component to render different things.",
88
- "type": "object"
89
- },
90
- {
91
- "additionalProperties": {},
92
- "description": "The parameters that are passed to the website (iframe). These can be used within your website to render different things.",
93
- "type": "object"
94
- }
95
- ],
96
- "description": "The parameters that are passed to the react component. These can be used within your react component to render different things."
97
- },
98
- "path": {
99
- "anyOf": [
100
- {
101
- "description": "The path to the markdown file. This should be a relative path from the public folder.",
102
- "type": "string"
103
- },
104
- {
105
- "description": "The path to the react component. This should be a relative path from the src/public folder.",
106
- "type": "string"
107
- },
108
- {
109
- "description": "The path to the image. This should be a relative path from the public folder.",
110
- "type": "string"
111
- },
112
- {
113
- "description": "The path to the website. This should be a relative path from the public folder or could be an external website.",
114
- "type": "string"
115
- },
116
- {
117
- "description": "The path to the vega file. This should be a relative path from the public folder.",
118
- "type": "string"
119
- }
120
- ],
121
- "description": "The path to the markdown file. This should be a relative path from the public folder."
122
- },
123
- "provideFeedback": {
124
- "description": "Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.",
125
- "type": "boolean"
126
- },
127
- "recordAudio": {
128
- "description": "Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.",
129
- "type": "boolean"
130
- },
131
- "response": {
132
- "description": "The responses to the component",
133
- "items": {
134
- "$ref": "#/definitions/Response"
135
- },
136
- "type": "array"
137
- },
138
- "style": {
139
- "additionalProperties": {
140
- "type": "string"
141
- },
142
- "description": "The style of the image. This is an object with css properties as keys and css values as values.",
143
- "type": "object"
144
- },
145
- "trainingAttempts": {
146
- "description": "The number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.",
147
- "type": "number"
148
- },
149
- "type": {
150
- "enum": [
151
- "markdown",
152
- "react-component",
153
- "image",
154
- "website",
155
- "questionnaire",
156
- "vega"
157
- ],
158
- "type": "string"
159
- }
160
- },
161
- "type": "object"
162
- },
163
- "description": "The baseComponents is an optional set of components which can help template other components. For example, suppose you have a single HTML file that you want to display to the user several times. Instead of having the same component twice in the `components` list, you can have a single baseComponent with all the information that the two HTML components will share. A great example is showing the same HTML component but with two different questions;\n\n Using baseComponents:\n\n```js \"baseComponents\": { \"my-image-component\": { \"instructionLocation\": \"sidebar\", \"nextButtonLocation\": \"sidebar\", \"path\": \"<study-name>/assets/my-image.jpg\", \"response\": [ { \"id\": \"my-image-id\", \"options\": [\"Europe\", \"Japan\", \"USA\"], \"prompt\": \"Your Selected Answer:\", \"type\": \"dropdown\" } ], \"type\": \"image\" } } ``` In the above code snippet, we have a single base component which holds the information about the type of component, the path to the image, and the response (which is a dropdown containing three choices). Any component which contains the `\"baseComponent\":\"my-image-component\"` key-value pair will inherit each of these properties. Thus, if we have three different questions which have the same choices and are concerning the same image, we can define our components like below: ```js \"components\": { \"q1\": { \"baseComponent\": \"my-image-component\", \"description\": \"Choosing section with largest GDP\", \"instruction\": \"Which region has the largest GDP?\" }, \"q2\": { \"baseComponent\": \"my-image-component\", \"description\": \"Choosing section with lowest GDP\", \"instruction\": \"Which region has the lowest GDP?\" }, \"q3\": { \"baseComponent\": \"my-image-component\", \"description\": \"Choosing section with highest exports of Wheat\", \"instruction\": \"Which region had the most Wheat exported in 2022?\" } } ```",
164
- "type": "object"
165
- },
166
- "CheckboxResponse": {
167
- "additionalProperties": false,
168
- "description": "The CheckboxResponse interface is used to define the properties of a checkbox response. CheckboxResponses render as a checkbox input with user specified options.\n\n```js { \"id\": \"q7\", \"prompt\": \"Checkbox example (not required)\", \"required\": false, \"location\": \"aboveStimulus\", \"type\": \"checkbox\", \"options\": [\"Option 1\", \"Option 2\", \"Option 3\"] } ```",
169
- "properties": {
170
- "hidden": {
171
- "description": "Controls whether the response is hidden.",
172
- "type": "boolean"
173
- },
174
- "id": {
175
- "description": "The id of the response. This is used to identify the response in the data file.",
176
- "type": "string"
177
- },
178
- "location": {
179
- "$ref": "#/definitions/ResponseBlockLocation",
180
- "description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
181
- },
182
- "maxSelections": {
183
- "description": "The maximum number of selections that are required.",
184
- "type": "number"
185
- },
186
- "minSelections": {
187
- "description": "The minimum number of selections that are required.",
188
- "type": "number"
189
- },
190
- "options": {
191
- "description": "The options that are displayed as checkboxes, provided as an array of objects, with label and value fields.",
192
- "items": {
193
- "anyOf": [
194
- {
195
- "$ref": "#/definitions/StringOption"
196
- },
197
- {
198
- "type": "string"
199
- }
200
- ]
201
- },
202
- "type": "array"
203
- },
204
- "paramCapture": {
205
- "description": "Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",
206
- "type": "string"
207
- },
208
- "prompt": {
209
- "description": "The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",
210
- "type": "string"
211
- },
212
- "required": {
213
- "description": "Controls whether the response is required to be answered.",
214
- "type": "boolean"
215
- },
216
- "requiredLabel": {
217
- "description": "You can provide a required label, which makes it so a participant has to answer with a response that matches label.",
218
- "type": "string"
219
- },
220
- "requiredValue": {
221
- "description": "You can provide a required value, which makes it so a participant has to answer with that value."
222
- },
223
- "secondaryText": {
224
- "description": "The secondary text that is displayed to the participant under the prompt. This does not accept markdown.",
225
- "type": "string"
226
- },
227
- "type": {
228
- "const": "checkbox",
229
- "type": "string"
230
- }
231
- },
232
- "required": [
233
- "id",
234
- "options",
235
- "prompt",
236
- "required",
237
- "type"
238
- ],
239
- "type": "object"
240
- },
241
- "ComponentBlock": {
242
- "additionalProperties": false,
243
- "description": "The ComponentBlock interface is used to define order properties within the sequence. This is used to define the order of components in a study and the skip logic. It supports random assignment of trials using a pure random assignment and a [latin square](https://en.wikipedia.org/wiki/Latin_square).\n\nThe pure random assignment is a random assignment with no guarantees. For example, one component _could_ show up in the first position 10 times in a row. However, this situation is unlikely.\n\nHere's a snippet that shows how to use the random order:\n\n```js { \"order\": \"random\", \"components\": [ \"component1\", \"component2\", \"component3\" ] } ``` This snippet would produce a random order of the components in the sequence array. For example, the resulting sequence array could be :\n\n```js [ [\"component2\", \"component3\", \"component1\"], [\"component1\", \"component3\", \"component2\"], [\"component3\", \"component1\", \"component2\"], ... ] ```\n\nThe latin square assignment is a random assignment with some guarantees. It ensures that each component is shown an equal number of times in each position. Here's a snippet that shows how to use the latin square order:\n\n```js { \"order\": \"latinSquare\", \"components\": [ \"component1\", \"component2\", \"component3\" ] } ```\n\nThis snippet would produce a latin square order of the components in the sequence array. Since the latin square guarantees that each component is shown an equal number of times in each position, the resulting sequence array could be:\n\n```js [ [\"component1\", \"component2\", \"component3\"], [\"component2\", \"component3\", \"component1\"], [\"component3\", \"component1\", \"component2\"], ... ] ```\n\nThe fixed assignment is a fixed assignment of components. This is used when you want to show the components in a specific order. Here's a snippet that shows how to use the fixed order:\n\n```js { \"order\": \"fixed\", \"components\": [ \"component1\", \"component2\", \"component3\" ] } ```\n\nThis snippet would produce a fixed order of the components in the sequence array. The resulting sequence array would be:\n\n```js [ [\"component1\", \"component2\", \"component3\"], [\"component1\", \"component2\", \"component3\"], [\"component1\", \"component2\", \"component3\"], ... ] ```\n\nIn addition to the order property, the ComponentBlock interface also includes the `\"numSamples\"` property. This is used to reduce the number of components shown to a participant. This property respects the order property and the guarantees provided by the order property. For example, if you have three components in the components array and you set `\"numSamples\"` to 2, you would randomize across the three components while only showing a participant two of them. Here's a snippet that shows how to use the numSamples property:\n\n```js { \"order\": \"latinSquare\", \"components\": [ \"component1\", \"component2\", \"component3\" ], \"numSamples\": 2 } ```\n\nThis snippet would produce a latin square order of the components in the sequence array. Since the latin square guarantees that each component is shown an equal number of times in each position, the resulting sequence array could be:\n\n```js [ [\"component1\", \"component2\"], [\"component2\", \"component3\"], [\"component3\", \"component1\"], ... ] ```\n\nThe interruptions property specifies an array of interruptions. These can be used for breaks or attention checks. Interruptions can be deterministic or random. Please see [InterruptionBlock](../../type-aliases/InterruptionBlock) for more specific information.\n\nThe skip property is used to define skip conditions. This is used to skip to a different component or block based on the response to a component or the number of correct or incorrect responses in a block. Please see [SkipConditions](../../type-aliases/SkipConditions) for more specific information.",
244
- "properties": {
245
- "components": {
246
- "description": "The components that are included in the order.",
247
- "items": {
248
- "anyOf": [
249
- {
250
- "type": "string"
251
- },
252
- {
253
- "$ref": "#/definitions/ComponentBlock"
254
- }
255
- ]
256
- },
257
- "type": "array"
258
- },
259
- "id": {
260
- "description": "The id of the block. This is used to identify the block in the SkipConditions and is only required if you want to refer to the whole block in the condition.to property.",
261
- "type": "string"
262
- },
263
- "interruptions": {
264
- "description": "The interruptions property specifies an array of interruptions. These can be used for breaks or attention checks.",
265
- "items": {
266
- "$ref": "#/definitions/InterruptionBlock"
267
- },
268
- "type": "array"
269
- },
270
- "numSamples": {
271
- "description": "The number of samples to use for the random assignments. This means you can randomize across 3 components while only showing a participant 2 at a time.",
272
- "type": "number"
273
- },
274
- "order": {
275
- "description": "The type of order. This can be random (pure random), latinSquare (random with some guarantees), or fixed.",
276
- "enum": [
277
- "random",
278
- "latinSquare",
279
- "fixed"
280
- ],
281
- "type": "string"
282
- },
283
- "skip": {
284
- "$ref": "#/definitions/SkipConditions",
285
- "description": "The skip conditions for the block."
286
- }
287
- },
288
- "required": [
289
- "order",
290
- "components"
291
- ],
292
- "type": "object"
293
- },
294
- "ComponentBlockCondition": {
295
- "additionalProperties": false,
296
- "description": "The ComponentBlockCondition interface is used to define a SkipCondition based on the number of correct or incorrect components in a block. All answers on all components in the block are checked.\n\nAnswers are checked against the correct answers defined in the IndividualComponent's [CorrectAnswer](../Answer). If no correct answers are defined, the component is considered correct by default.\n\nYou might use this if a participant answers two questions in a block incorrectly. Here's an example of how to use the ComponentBlockCondition:\n\n```js { ... \"skip\": [ { \"check\": \"block\", \"condition\": \"numIncorrect\", \"value\": 2, \"to\": \"end\" } ] ... } ```\n\nIn this example, when the number of components with incorrect responses in the block is two, the participant will be redirected to the end of the study. If the number of incorrect responses is less than two, the participant will continue to the next component in the sequence.\n\nWhen the condition is met, the participant will immediately be redirected to the component or block specified in the `\"to\"` property. If no conditions are met, the participant will continue to the next component in the sequence.",
297
- "properties": {
298
- "check": {
299
- "const": "block",
300
- "description": "The check we'll perform.",
301
- "type": "string"
302
- },
303
- "condition": {
304
- "description": "The condition to check.",
305
- "enum": [
306
- "numCorrect",
307
- "numIncorrect"
308
- ],
309
- "type": "string"
310
- },
311
- "to": {
312
- "description": "The id of the component or block to skip to",
313
- "type": "string"
314
- },
315
- "value": {
316
- "description": "The number of correct or incorrect responses to check for.",
317
- "type": "number"
318
- }
319
- },
320
- "required": [
321
- "check",
322
- "condition",
323
- "value",
324
- "to"
325
- ],
326
- "type": "object"
327
- },
328
- "DeterministicInterruption": {
329
- "additionalProperties": false,
330
- "description": "The DeterministicInterruption interface is used to define an interruption that will be shown at a specific location in the block.\n\nFor example, if you want to show an interruption after the second component in the block, you would set firstLocation to 2. If you want to show an interruption after every 3 components, you would set spacing to 3. If you want to show an interruption after the second component and then every 3 components, you would set firstLocation to 2 and spacing to 3.\n\nThe components property is an array of the components that will be inserted at the location specified by firstLocation and spacing. These components should reference components in the StudyConfig.components section of the config.\n\nHere's an example of how to use the DeterministicInterruption:\n\n```js { \"order\": \"fixed\", \"components\": [ \"component1\", \"component2\", \"component3\", \"component4\", \"component5\", \"component6\" ], \"interruptions\": [ { \"firstLocation\": 2, \"spacing\": 3, \"components\": [ \"interruption1\", \"interruption2\" ] } ] } ```\n\nThe resulting sequence array could be:\n\n```js [ [\"component1\", \"component2\", \"interruption1\", \"component3\", \"component4\", \"component5\", \"interruption2\", \"component6\"], [\"component1\", \"component2\", \"interruption1\", \"component3\", \"component4\", \"component5\", \"interruption2\", \"component6\"], [\"component1\", \"component2\", \"interruption1\", \"component3\", \"component4\", \"component5\", \"interruption2\", \"component6\"], ... ] ```",
331
- "properties": {
332
- "components": {
333
- "description": "The components that are included in the interruption. These reference components in the StudyConfig.components section of the config.",
334
- "items": {
335
- "type": "string"
336
- },
337
- "type": "array"
338
- },
339
- "firstLocation": {
340
- "description": "The Location of the first instance of the interruption. If this is set to 2, the interruption will be shown after the second component (inserted at index 2).",
341
- "type": "number"
342
- },
343
- "spacing": {
344
- "description": "The number of components between breaks.",
345
- "type": "number"
346
- }
347
- },
348
- "required": [
349
- "firstLocation",
350
- "spacing",
351
- "components"
352
- ],
353
- "type": "object"
354
- },
355
- "DropdownResponse": {
356
- "additionalProperties": false,
357
- "description": "The DropdownResponse interface is used to define the properties of a dropdown response. DropdownResponses render as a select input with user specified options.\n\nExample: ```js { \"id\": \"q-color\", \"prompt\": \"What is your favorite color?\", \"required\": true, \"location\": \"aboveStimulus\", \"type\": \"dropdown\", \"placeholder\": \"Please choose your favorite color\", \"options\": [\"Red\", \"Blue\"] } ```",
358
- "properties": {
359
- "hidden": {
360
- "description": "Controls whether the response is hidden.",
361
- "type": "boolean"
362
- },
363
- "id": {
364
- "description": "The id of the response. This is used to identify the response in the data file.",
365
- "type": "string"
366
- },
367
- "location": {
368
- "$ref": "#/definitions/ResponseBlockLocation",
369
- "description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
370
- },
371
- "options": {
372
- "description": "The options that are displayed in the dropdown.",
373
- "items": {
374
- "anyOf": [
375
- {
376
- "$ref": "#/definitions/StringOption"
377
- },
378
- {
379
- "type": "string"
380
- }
381
- ]
382
- },
383
- "type": "array"
384
- },
385
- "paramCapture": {
386
- "description": "Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",
387
- "type": "string"
388
- },
389
- "placeholder": {
390
- "description": "The placeholder text that is displayed in the input.",
391
- "type": "string"
392
- },
393
- "prompt": {
394
- "description": "The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",
395
- "type": "string"
396
- },
397
- "required": {
398
- "description": "Controls whether the response is required to be answered.",
399
- "type": "boolean"
400
- },
401
- "requiredLabel": {
402
- "description": "You can provide a required label, which makes it so a participant has to answer with a response that matches label.",
403
- "type": "string"
404
- },
405
- "requiredValue": {
406
- "description": "You can provide a required value, which makes it so a participant has to answer with that value."
407
- },
408
- "secondaryText": {
409
- "description": "The secondary text that is displayed to the participant under the prompt. This does not accept markdown.",
410
- "type": "string"
411
- },
412
- "type": {
413
- "const": "dropdown",
414
- "type": "string"
415
- }
416
- },
417
- "required": [
418
- "id",
419
- "options",
420
- "prompt",
421
- "required",
422
- "type"
423
- ],
424
- "type": "object"
425
- },
426
- "IFrameResponse": {
427
- "additionalProperties": false,
428
- "description": "The IFrameResponse interface is used to define the properties of an iframe response. IFrameResponses render as a list, that is connected to a WebsiteComponent. When data is sent from the WebsiteComponent, it is displayed in the list.",
429
- "properties": {
430
- "hidden": {
431
- "description": "Controls whether the response is hidden.",
432
- "type": "boolean"
433
- },
434
- "id": {
435
- "description": "The id of the response. This is used to identify the response in the data file.",
436
- "type": "string"
437
- },
438
- "location": {
439
- "$ref": "#/definitions/ResponseBlockLocation",
440
- "description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
441
- },
442
- "paramCapture": {
443
- "description": "Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",
444
- "type": "string"
445
- },
446
- "prompt": {
447
- "description": "The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",
448
- "type": "string"
449
- },
450
- "required": {
451
- "description": "Controls whether the response is required to be answered.",
452
- "type": "boolean"
453
- },
454
- "requiredLabel": {
455
- "description": "You can provide a required label, which makes it so a participant has to answer with a response that matches label.",
456
- "type": "string"
457
- },
458
- "requiredValue": {
459
- "description": "You can provide a required value, which makes it so a participant has to answer with that value."
460
- },
461
- "secondaryText": {
462
- "description": "The secondary text that is displayed to the participant under the prompt. This does not accept markdown.",
463
- "type": "string"
464
- },
465
- "type": {
466
- "const": "iframe",
467
- "type": "string"
468
- }
469
- },
470
- "required": [
471
- "id",
472
- "prompt",
473
- "required",
474
- "type"
475
- ],
476
- "type": "object"
477
- },
478
- "ImageComponent": {
479
- "additionalProperties": false,
480
- "description": "The ImageComponent interface is used to define the properties of an image component. This component is used to render an image with optional styling.\n\nFor example, to render an image with a path of `path/to/study/assets/image.jpg` and a max width of 50%, you would use the following snippet: ```js { \"type\": \"image\", \"path\": \"<study-name>/assets/image.jpg\", \"style\": { \"maxWidth\": \"50%\" } } ```",
481
- "properties": {
482
- "allowFailedTraining": {
483
- "description": "Controls whether the component should allow failed training. If not provided, the default is true.",
484
- "type": "boolean"
485
- },
486
- "correctAnswer": {
487
- "description": "The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",
488
- "items": {
489
- "$ref": "#/definitions/Answer"
490
- },
491
- "type": "array"
492
- },
493
- "description": {
494
- "description": "The description of the component. This is used to identify and provide additional information for the component in the admin panel.",
495
- "type": "string"
496
- },
497
- "instruction": {
498
- "description": "The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",
499
- "type": "string"
500
- },
501
- "instructionLocation": {
502
- "$ref": "#/definitions/ResponseBlockLocation",
503
- "description": "The location of the instructions."
504
- },
505
- "meta": {
506
- "additionalProperties": {},
507
- "description": "The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",
508
- "type": "object"
509
- },
510
- "nextButtonDisableTime": {
511
- "description": "A timeout (in ms) after which the next button will be disabled.",
512
- "type": "number"
513
- },
514
- "nextButtonEnableTime": {
515
- "description": "A timer (in ms) after which the next button will be enabled.",
516
- "type": "number"
517
- },
518
- "nextButtonLocation": {
519
- "$ref": "#/definitions/ResponseBlockLocation",
520
- "description": "The location of the next button."
521
- },
522
- "nextButtonText": {
523
- "description": "The text that is displayed on the next button.",
524
- "type": "string"
525
- },
526
- "path": {
527
- "description": "The path to the image. This should be a relative path from the public folder.",
528
- "type": "string"
529
- },
530
- "provideFeedback": {
531
- "description": "Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.",
532
- "type": "boolean"
533
- },
534
- "recordAudio": {
535
- "description": "Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.",
536
- "type": "boolean"
537
- },
538
- "response": {
539
- "description": "The responses to the component",
540
- "items": {
541
- "$ref": "#/definitions/Response"
542
- },
543
- "type": "array"
544
- },
545
- "style": {
546
- "additionalProperties": {
547
- "type": "string"
548
- },
549
- "description": "The style of the image. This is an object with css properties as keys and css values as values.",
550
- "type": "object"
551
- },
552
- "trainingAttempts": {
553
- "description": "The number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.",
554
- "type": "number"
555
- },
556
- "type": {
557
- "const": "image",
558
- "type": "string"
559
- }
560
- },
561
- "required": [
562
- "path",
563
- "response",
564
- "type"
565
- ],
566
- "type": "object"
567
- },
568
- "IndividualComponent": {
569
- "anyOf": [
570
- {
571
- "$ref": "#/definitions/MarkdownComponent"
572
- },
573
- {
574
- "$ref": "#/definitions/ReactComponent"
575
- },
576
- {
577
- "$ref": "#/definitions/ImageComponent"
578
- },
579
- {
580
- "$ref": "#/definitions/WebsiteComponent"
581
- },
582
- {
583
- "$ref": "#/definitions/QuestionnaireComponent"
584
- },
585
- {
586
- "$ref": "#/definitions/VegaComponent"
587
- }
588
- ]
589
- },
590
- "IndividualComponentAllResponsesCondition": {
591
- "additionalProperties": false,
592
- "description": "The IndividualComponentAllResponsesCondition interface is used to define a SkipCondition based on all answers to a specific component. The skip logic will be checked for every component in the block that has the specified name.\n\n:::info\n\nIf you need to check all instances of a repeated component, you should use the RepeatedComponentBlockCondition.\n\n:::\n\n\nHere's an example of how to use the IndividualComponentAllResponsesCondition:\n\n```js { ... \"skip\": [ { \"name\": \"attentionCheck\", \"check\": \"responses\", \"to\": \"end\" } ] ... } ```\n\nIn this example, if all responses to the component with the ID \"attentionCheck\" are correct, the participant will be redirected to the end of the study. If any response is incorrect, the participant will continue to the next component in the sequence.",
593
- "properties": {
594
- "check": {
595
- "const": "responses",
596
- "description": "The check we'll perform.",
597
- "type": "string"
598
- },
599
- "name": {
600
- "description": "The name of the component to check.",
601
- "type": "string"
602
- },
603
- "to": {
604
- "description": "The id of the component or block to skip to",
605
- "type": "string"
606
- }
607
- },
608
- "required": [
609
- "name",
610
- "check",
611
- "to"
612
- ],
613
- "type": "object"
614
- },
615
- "IndividualComponentSingleResponseCondition": {
616
- "additionalProperties": false,
617
- "description": "The IndividualComponentSingleResponseCondition interface is used to define a SkipCondition based on a single answer to a specific component. The skip logic will be checked for every component in the block that has the specified name.\n\n:::info\n\nIf you need to check all instances of a repeated component, you should use the RepeatedComponentBlockCondition.\n\n:::\n\nFor example, if you want to skip to a different component based on a response to a specific component, you would use the IndividualComponentSingleResponseCondition. Here's an example of how to use the IndividualComponentSingleResponseCondition:\n\n```js { ... \"skip\": [ { \"name\": \"attentionCheck\", \"check\": \"response\", \"responseId\": \"attentionCheckResponse\", \"value\": \"the right answer\", \"comparison\": \"equal\", \"to\": \"end\" } ] ... } ```\n\nIn this example, we assign our skip logic to the component whose ID is \"attentionCheck\". If the answer given to the response \"attentionCheckResponse\" is equal to \"the right answer\", then the user will be redirected to the end of the study. If the response is _not_ equal to \"the right answer\", then the participant will continue to the next component in the sequence.",
618
- "properties": {
619
- "check": {
620
- "const": "response",
621
- "description": "The check we'll perform.",
622
- "type": "string"
623
- },
624
- "comparison": {
625
- "description": "The comparison to use.",
626
- "enum": [
627
- "equal",
628
- "notEqual"
629
- ],
630
- "type": "string"
631
- },
632
- "name": {
633
- "description": "The name of the component to check.",
634
- "type": "string"
635
- },
636
- "responseId": {
637
- "description": "The response id to check.",
638
- "type": "string"
639
- },
640
- "to": {
641
- "description": "The id of the component or block to skip to",
642
- "type": "string"
643
- },
644
- "value": {
645
- "description": "The value to check.",
646
- "type": [
647
- "string",
648
- "number"
649
- ]
650
- }
651
- },
652
- "required": [
653
- "name",
654
- "check",
655
- "responseId",
656
- "value",
657
- "comparison",
658
- "to"
659
- ],
660
- "type": "object"
661
- },
662
- "InheritedComponent": {
663
- "additionalProperties": false,
664
- "description": "An InheritedComponent is a component that inherits properties from a baseComponent. This is used to avoid repeating properties in components. This also means that components in the baseComponents object can be partially defined, while components in the components object can inherit from them and must be fully defined and include all properties (after potentially merging with a base component).",
665
- "properties": {
666
- "allowFailedTraining": {
667
- "description": "Controls whether the component should allow failed training. If not provided, the default is true.",
668
- "type": "boolean"
669
- },
670
- "baseComponent": {
671
- "type": "string"
672
- },
673
- "config": {
674
- "description": "The vega-lite configuration.",
675
- "type": "object"
676
- },
677
- "correctAnswer": {
678
- "description": "The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",
679
- "items": {
680
- "$ref": "#/definitions/Answer"
681
- },
682
- "type": "array"
683
- },
684
- "description": {
685
- "description": "The description of the component. This is used to identify and provide additional information for the component in the admin panel.",
686
- "type": "string"
687
- },
688
- "instruction": {
689
- "description": "The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",
690
- "type": "string"
691
- },
692
- "instructionLocation": {
693
- "$ref": "#/definitions/ResponseBlockLocation",
694
- "description": "The location of the instructions."
695
- },
696
- "meta": {
697
- "additionalProperties": {},
698
- "description": "The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",
699
- "type": "object"
700
- },
701
- "nextButtonDisableTime": {
702
- "description": "A timeout (in ms) after which the next button will be disabled.",
703
- "type": "number"
704
- },
705
- "nextButtonEnableTime": {
706
- "description": "A timer (in ms) after which the next button will be enabled.",
707
- "type": "number"
708
- },
709
- "nextButtonLocation": {
710
- "$ref": "#/definitions/ResponseBlockLocation",
711
- "description": "The location of the next button."
712
- },
713
- "nextButtonText": {
714
- "description": "The text that is displayed on the next button.",
715
- "type": "string"
716
- },
717
- "parameters": {
718
- "anyOf": [
719
- {
720
- "additionalProperties": {},
721
- "description": "The parameters that are passed to the react component. These can be used within your react component to render different things.",
722
- "type": "object"
723
- },
724
- {
725
- "additionalProperties": {},
726
- "description": "The parameters that are passed to the website (iframe). These can be used within your website to render different things.",
727
- "type": "object"
728
- }
729
- ],
730
- "description": "The parameters that are passed to the react component. These can be used within your react component to render different things."
731
- },
732
- "path": {
733
- "anyOf": [
734
- {
735
- "description": "The path to the markdown file. This should be a relative path from the public folder.",
736
- "type": "string"
737
- },
738
- {
739
- "description": "The path to the react component. This should be a relative path from the src/public folder.",
740
- "type": "string"
741
- },
742
- {
743
- "description": "The path to the image. This should be a relative path from the public folder.",
744
- "type": "string"
745
- },
746
- {
747
- "description": "The path to the website. This should be a relative path from the public folder or could be an external website.",
748
- "type": "string"
749
- },
750
- {
751
- "description": "The path to the vega file. This should be a relative path from the public folder.",
752
- "type": "string"
753
- }
754
- ],
755
- "description": "The path to the markdown file. This should be a relative path from the public folder."
756
- },
757
- "provideFeedback": {
758
- "description": "Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.",
759
- "type": "boolean"
760
- },
761
- "recordAudio": {
762
- "description": "Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.",
763
- "type": "boolean"
764
- },
765
- "response": {
766
- "description": "The responses to the component",
767
- "items": {
768
- "$ref": "#/definitions/Response"
769
- },
770
- "type": "array"
771
- },
772
- "style": {
773
- "additionalProperties": {
774
- "type": "string"
775
- },
776
- "description": "The style of the image. This is an object with css properties as keys and css values as values.",
777
- "type": "object"
778
- },
779
- "trainingAttempts": {
780
- "description": "The number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.",
781
- "type": "number"
782
- },
783
- "type": {
784
- "enum": [
785
- "markdown",
786
- "react-component",
787
- "image",
788
- "website",
789
- "questionnaire",
790
- "vega"
791
- ],
792
- "type": "string"
793
- }
794
- },
795
- "required": [
796
- "baseComponent"
797
- ],
798
- "type": "object"
799
- },
800
- "InterruptionBlock": {
801
- "anyOf": [
802
- {
803
- "$ref": "#/definitions/DeterministicInterruption"
804
- },
805
- {
806
- "$ref": "#/definitions/RandomInterruption"
807
- }
808
- ],
809
- "description": "The InterruptionBlock interface is used to define interruptions in a block. These can be used for breaks or attention checks. Interruptions can be deterministic or random."
810
- },
811
- "LikertResponse": {
812
- "additionalProperties": false,
813
- "description": "The LikertResponse interface is used to define the properties of a likert response. LikertResponses render as radio buttons with a user specified number of options, which can be controlled through the numItems. For example, numItems: 5 will render 5 radio buttons, and numItems: 7 will render 7 radio buttons. LikertResponses can also have a description, and left and right labels. The left and right labels are used to label the left and right ends of the likert scale with values such as 'Strongly Disagree' and 'Strongly Agree'.\n\nExample for a five-point Likert Scale:\n\n```js { \"id\": \"q-satisfaction\", \"prompt\": \"Rate your satisfaction from 1 (not enjoyable) to 5 (very enjoyable).\", \"required\": true, \"location\": \"aboveStimulus\", \"type\": \"likert\", \"leftLabel\": \"Not Enjoyable\", \"rightLabel\": \"Very Enjoyable\", \"numItems\": 5 } ```",
814
- "properties": {
815
- "hidden": {
816
- "description": "Controls whether the response is hidden.",
817
- "type": "boolean"
818
- },
819
- "id": {
820
- "description": "The id of the response. This is used to identify the response in the data file.",
821
- "type": "string"
822
- },
823
- "leftLabel": {
824
- "description": "The left label of the likert scale. E.g Strongly Disagree",
825
- "type": "string"
826
- },
827
- "location": {
828
- "$ref": "#/definitions/ResponseBlockLocation",
829
- "description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
830
- },
831
- "numItems": {
832
- "description": "The number of options to render.",
833
- "type": "number"
834
- },
835
- "paramCapture": {
836
- "description": "Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",
837
- "type": "string"
838
- },
839
- "prompt": {
840
- "description": "The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",
841
- "type": "string"
842
- },
843
- "required": {
844
- "description": "Controls whether the response is required to be answered.",
845
- "type": "boolean"
846
- },
847
- "requiredLabel": {
848
- "description": "You can provide a required label, which makes it so a participant has to answer with a response that matches label.",
849
- "type": "string"
850
- },
851
- "requiredValue": {
852
- "description": "You can provide a required value, which makes it so a participant has to answer with that value."
853
- },
854
- "rightLabel": {
855
- "description": "The right label of the likert scale. E.g Strongly Agree",
856
- "type": "string"
857
- },
858
- "secondaryText": {
859
- "description": "The secondary text that is displayed to the participant under the prompt. This does not accept markdown.",
860
- "type": "string"
861
- },
862
- "type": {
863
- "const": "likert",
864
- "type": "string"
865
- }
866
- },
867
- "required": [
868
- "id",
869
- "numItems",
870
- "prompt",
871
- "required",
872
- "type"
873
- ],
874
- "type": "object"
875
- },
876
- "LongTextResponse": {
877
- "additionalProperties": false,
878
- "description": "The LongTextResponse interface is used to define the properties of a long text response. LongTextResponses render as a text area that accepts any text and can optionally have a placeholder. ```js { \"id\": \"q-name\", \"prompt\": \"What is your first name?\", \"required\": true, \"location\": \"aboveStimulus\", \"type\": \"longText\", \"placeholder\": \"Please enter your first name\" } ```",
879
- "properties": {
880
- "hidden": {
881
- "description": "Controls whether the response is hidden.",
882
- "type": "boolean"
883
- },
884
- "id": {
885
- "description": "The id of the response. This is used to identify the response in the data file.",
886
- "type": "string"
887
- },
888
- "location": {
889
- "$ref": "#/definitions/ResponseBlockLocation",
890
- "description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
891
- },
892
- "paramCapture": {
893
- "description": "Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",
894
- "type": "string"
895
- },
896
- "placeholder": {
897
- "description": "The placeholder text that is displayed in the input.",
898
- "type": "string"
899
- },
900
- "prompt": {
901
- "description": "The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",
902
- "type": "string"
903
- },
904
- "required": {
905
- "description": "Controls whether the response is required to be answered.",
906
- "type": "boolean"
907
- },
908
- "requiredLabel": {
909
- "description": "You can provide a required label, which makes it so a participant has to answer with a response that matches label.",
910
- "type": "string"
911
- },
912
- "requiredValue": {
913
- "description": "You can provide a required value, which makes it so a participant has to answer with that value."
914
- },
915
- "secondaryText": {
916
- "description": "The secondary text that is displayed to the participant under the prompt. This does not accept markdown.",
917
- "type": "string"
918
- },
919
- "type": {
920
- "const": "longText",
921
- "type": "string"
922
- }
923
- },
924
- "required": [
925
- "id",
926
- "prompt",
927
- "required",
928
- "type"
929
- ],
930
- "type": "object"
931
- },
932
- "MarkdownComponent": {
933
- "additionalProperties": false,
934
- "description": "The MarkdownComponent interface is used to define the properties of a markdown component. The components can be used to render many different things, such as consent forms, instructions, and debriefs. Additionally, you can use the markdown component to render images, videos, and other media, with supporting text. Markdown components can have responses (e.g. in a consent form), or no responses (e.g. in a help text file). Here's an example with no responses for a simple help text file:\n\n```js { \"type\": \"markdown\", \"path\": \"<study-name>/assets/help.md\", \"response\": [] } ```",
935
- "properties": {
936
- "allowFailedTraining": {
937
- "description": "Controls whether the component should allow failed training. If not provided, the default is true.",
938
- "type": "boolean"
939
- },
940
- "correctAnswer": {
941
- "description": "The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",
942
- "items": {
943
- "$ref": "#/definitions/Answer"
944
- },
945
- "type": "array"
946
- },
947
- "description": {
948
- "description": "The description of the component. This is used to identify and provide additional information for the component in the admin panel.",
949
- "type": "string"
950
- },
951
- "instruction": {
952
- "description": "The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",
953
- "type": "string"
954
- },
955
- "instructionLocation": {
956
- "$ref": "#/definitions/ResponseBlockLocation",
957
- "description": "The location of the instructions."
958
- },
959
- "meta": {
960
- "additionalProperties": {},
961
- "description": "The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",
962
- "type": "object"
963
- },
964
- "nextButtonDisableTime": {
965
- "description": "A timeout (in ms) after which the next button will be disabled.",
966
- "type": "number"
967
- },
968
- "nextButtonEnableTime": {
969
- "description": "A timer (in ms) after which the next button will be enabled.",
970
- "type": "number"
971
- },
972
- "nextButtonLocation": {
973
- "$ref": "#/definitions/ResponseBlockLocation",
974
- "description": "The location of the next button."
975
- },
976
- "nextButtonText": {
977
- "description": "The text that is displayed on the next button.",
978
- "type": "string"
979
- },
980
- "path": {
981
- "description": "The path to the markdown file. This should be a relative path from the public folder.",
982
- "type": "string"
983
- },
984
- "provideFeedback": {
985
- "description": "Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.",
986
- "type": "boolean"
987
- },
988
- "recordAudio": {
989
- "description": "Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.",
990
- "type": "boolean"
991
- },
992
- "response": {
993
- "description": "The responses to the component",
994
- "items": {
995
- "$ref": "#/definitions/Response"
996
- },
997
- "type": "array"
998
- },
999
- "trainingAttempts": {
1000
- "description": "The number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.",
1001
- "type": "number"
1002
- },
1003
- "type": {
1004
- "const": "markdown",
1005
- "type": "string"
1006
- }
1007
- },
1008
- "required": [
1009
- "path",
1010
- "response",
1011
- "type"
1012
- ],
1013
- "type": "object"
1014
- },
1015
- "MatrixResponse": {
1016
- "additionalProperties": false,
1017
- "description": "The MatrixResponse interface is used to define the properties of a matrix radio or matrix checkbox response. Question options are rendered as rows of the matrix, each row containing its own radio/checkbox group. Answer options are rendered as column headers of the matrix. These can be customized by passing in the custom strings into the answer options. Alternatively, `answerOptions` can be set to one of the following custom strings: 'satisfaction5','satisfaction7', 'likely5', 'likely7'. This will automatically generate the appropriate headers for the matrix.\n\nExample for a 5-scale satisfaction matrix with three questions:\n\n```js { \"id\": \"multi-satisfaction\", \"prompt\": \"Rate your satisfaction from 1 (not enjoyable) to 5 (very enjoyable) for the following items.\", \"required\": true, \"location\": \"aboveStimulus\", \"type\": \"matrix-radio\", \"answerOptions\": \"satisfaction5\", \"questionOptions\": [ \"The tool we created\", \"The technique we developed\", \"The authors of the tools\" ] } ```\n\nHere's an example using custom columns (answerOptions):\n\n```js { \"id\": \"multi-custom\", \"prompt\": \"Which categories do the following items belong to?\", \"required\": true, \"location\": \"aboveStimulus\", \"type\": \"matrix-checkbox\", \"answerOptions\": [ \"Has Legs\", \"Has Wings\", \"Can Swim\" ], \"questionOptions\": [ \"Dog\", \"Snake\", \"Eagle\", \"Salmon\", \"Platypus\" ]\n\n} ```",
1018
- "properties": {
1019
- "answerOptions": {
1020
- "anyOf": [
1021
- {
1022
- "items": {
1023
- "type": "string"
1024
- },
1025
- "type": "array"
1026
- },
1027
- {
1028
- "const": "likely5",
1029
- "type": "string"
1030
- },
1031
- {
1032
- "const": "likely7",
1033
- "type": "string"
1034
- },
1035
- {
1036
- "const": "satisfaction5",
1037
- "type": "string"
1038
- },
1039
- {
1040
- "const": "satisfaction7",
1041
- "type": "string"
1042
- }
1043
- ],
1044
- "description": "The answer options (columns). We provide some shortcuts for a likelihood scale (ranging from highly unlikely to highly likely) and a satisfaction scale (ranging from highly unsatisfied to highly satisfied) with either 5 or 7 options to choose from."
1045
- },
1046
- "hidden": {
1047
- "description": "Controls whether the response is hidden.",
1048
- "type": "boolean"
1049
- },
1050
- "id": {
1051
- "description": "The id of the response. This is used to identify the response in the data file.",
1052
- "type": "string"
1053
- },
1054
- "location": {
1055
- "$ref": "#/definitions/ResponseBlockLocation",
1056
- "description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
1057
- },
1058
- "paramCapture": {
1059
- "description": "Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",
1060
- "type": "string"
1061
- },
1062
- "prompt": {
1063
- "description": "The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",
1064
- "type": "string"
1065
- },
1066
- "questionOptions": {
1067
- "description": "The question options (rows) are the prompts for each response you'd like to record.",
1068
- "items": {
1069
- "type": "string"
1070
- },
1071
- "type": "array"
1072
- },
1073
- "required": {
1074
- "description": "Controls whether the response is required to be answered.",
1075
- "type": "boolean"
1076
- },
1077
- "requiredLabel": {
1078
- "description": "You can provide a required label, which makes it so a participant has to answer with a response that matches label.",
1079
- "type": "string"
1080
- },
1081
- "requiredValue": {
1082
- "description": "You can provide a required value, which makes it so a participant has to answer with that value."
1083
- },
1084
- "secondaryText": {
1085
- "description": "The secondary text that is displayed to the participant under the prompt. This does not accept markdown.",
1086
- "type": "string"
1087
- },
1088
- "type": {
1089
- "enum": [
1090
- "matrix-radio",
1091
- "matrix-checkbox"
1092
- ],
1093
- "type": "string"
1094
- }
1095
- },
1096
- "required": [
1097
- "answerOptions",
1098
- "id",
1099
- "prompt",
1100
- "questionOptions",
1101
- "required",
1102
- "type"
1103
- ],
1104
- "type": "object"
1105
- },
1106
- "NumberOption": {
1107
- "additionalProperties": false,
1108
- "description": "The NumberOption interface is used to define the options for a slider response. The label is the text that is displayed to the user, and the value is the value that is stored in the data file.",
1109
- "properties": {
1110
- "label": {
1111
- "description": "The label displayed to participants.",
1112
- "type": "string"
1113
- },
1114
- "value": {
1115
- "description": "The value stored in the participant's data.",
1116
- "type": "number"
1117
- }
1118
- },
1119
- "required": [
1120
- "label",
1121
- "value"
1122
- ],
1123
- "type": "object"
1124
- },
1125
- "NumericalResponse": {
1126
- "additionalProperties": false,
1127
- "description": "The NumericalResponse interface is used to define the properties of a numerical response. NumericalResponses render as a text input that only accepts numbers, and can optionally have a min and max value, or a placeholder.\n\nExample: ```js { \"id\": \"q-numerical\", \"prompt\": \"Numerical example\", \"required\": true, \"location\": \"aboveStimulus\", \"type\": \"numerical\", \"placeholder\": \"Enter your age, range from 0 - 120\", \"max\": 120, \"min\": 0 } ```",
1128
- "properties": {
1129
- "hidden": {
1130
- "description": "Controls whether the response is hidden.",
1131
- "type": "boolean"
1132
- },
1133
- "id": {
1134
- "description": "The id of the response. This is used to identify the response in the data file.",
1135
- "type": "string"
1136
- },
1137
- "location": {
1138
- "$ref": "#/definitions/ResponseBlockLocation",
1139
- "description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
1140
- },
1141
- "max": {
1142
- "description": "The maximum value that is accepted in the input.",
1143
- "type": "number"
1144
- },
1145
- "min": {
1146
- "description": "The minimum value that is accepted in the input.",
1147
- "type": "number"
1148
- },
1149
- "paramCapture": {
1150
- "description": "Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",
1151
- "type": "string"
1152
- },
1153
- "placeholder": {
1154
- "description": "The placeholder text that is displayed in the input.",
1155
- "type": "string"
1156
- },
1157
- "prompt": {
1158
- "description": "The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",
1159
- "type": "string"
1160
- },
1161
- "required": {
1162
- "description": "Controls whether the response is required to be answered.",
1163
- "type": "boolean"
1164
- },
1165
- "requiredLabel": {
1166
- "description": "You can provide a required label, which makes it so a participant has to answer with a response that matches label.",
1167
- "type": "string"
1168
- },
1169
- "requiredValue": {
1170
- "description": "You can provide a required value, which makes it so a participant has to answer with that value."
1171
- },
1172
- "secondaryText": {
1173
- "description": "The secondary text that is displayed to the participant under the prompt. This does not accept markdown.",
1174
- "type": "string"
1175
- },
1176
- "type": {
1177
- "const": "numerical",
1178
- "type": "string"
1179
- }
1180
- },
1181
- "required": [
1182
- "id",
1183
- "prompt",
1184
- "required",
1185
- "type"
1186
- ],
1187
- "type": "object"
1188
- },
1189
- "QuestionnaireComponent": {
1190
- "additionalProperties": false,
1191
- "description": "A QuestionnaireComponent is used to render simple questions that require a response. The main use case of this component type is to ask participants questions when you don't need to render a stimulus. Please note, that even though we're not using a stimulus, the responses still require a `location`. For example this could be used to collect demographic information from a participant using the following snippet:\n\n```js { \"type\": \"questionnaire\", \"response\": [ { \"id\": \"gender\", \"prompt\": \"Gender:\", \"required\": true, \"location\": \"belowStimulus\", \"type\": \"checkbox\", \"options\": [\"Man\", \"Woman\", \"Genderqueer\", \"Third-gender\", ...] } ] } ```",
1192
- "properties": {
1193
- "allowFailedTraining": {
1194
- "description": "Controls whether the component should allow failed training. If not provided, the default is true.",
1195
- "type": "boolean"
1196
- },
1197
- "correctAnswer": {
1198
- "description": "The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",
1199
- "items": {
1200
- "$ref": "#/definitions/Answer"
1201
- },
1202
- "type": "array"
1203
- },
1204
- "description": {
1205
- "description": "The description of the component. This is used to identify and provide additional information for the component in the admin panel.",
1206
- "type": "string"
1207
- },
1208
- "instruction": {
1209
- "description": "The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",
1210
- "type": "string"
1211
- },
1212
- "instructionLocation": {
1213
- "$ref": "#/definitions/ResponseBlockLocation",
1214
- "description": "The location of the instructions."
1215
- },
1216
- "meta": {
1217
- "additionalProperties": {},
1218
- "description": "The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",
1219
- "type": "object"
1220
- },
1221
- "nextButtonDisableTime": {
1222
- "description": "A timeout (in ms) after which the next button will be disabled.",
1223
- "type": "number"
1224
- },
1225
- "nextButtonEnableTime": {
1226
- "description": "A timer (in ms) after which the next button will be enabled.",
1227
- "type": "number"
1228
- },
1229
- "nextButtonLocation": {
1230
- "$ref": "#/definitions/ResponseBlockLocation",
1231
- "description": "The location of the next button."
1232
- },
1233
- "nextButtonText": {
1234
- "description": "The text that is displayed on the next button.",
1235
- "type": "string"
1236
- },
1237
- "provideFeedback": {
1238
- "description": "Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.",
1239
- "type": "boolean"
1240
- },
1241
- "recordAudio": {
1242
- "description": "Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.",
1243
- "type": "boolean"
1244
- },
1245
- "response": {
1246
- "description": "The responses to the component",
1247
- "items": {
1248
- "$ref": "#/definitions/Response"
1249
- },
1250
- "type": "array"
1251
- },
1252
- "trainingAttempts": {
1253
- "description": "The number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.",
1254
- "type": "number"
1255
- },
1256
- "type": {
1257
- "const": "questionnaire",
1258
- "type": "string"
1259
- }
1260
- },
1261
- "required": [
1262
- "response",
1263
- "type"
1264
- ],
1265
- "type": "object"
1266
- },
1267
- "RadioResponse": {
1268
- "additionalProperties": false,
1269
- "description": "The RadioResponse interface is used to define the properties of a radio response. Radios have only one allowable selection. RadioResponses render as a radio input with user specified options, and optionally left and right labels.\n\nExample: ```js { \"id\": \"q-radio\", \"prompt\": \"Radio button example\", \"required\": true, \"location\": \"aboveStimulus\", \"type\": \"radio\", \"options\": [\"Option 1\", \"Option 2\"] } ```",
1270
- "properties": {
1271
- "hidden": {
1272
- "description": "Controls whether the response is hidden.",
1273
- "type": "boolean"
1274
- },
1275
- "id": {
1276
- "description": "The id of the response. This is used to identify the response in the data file.",
1277
- "type": "string"
1278
- },
1279
- "leftLabel": {
1280
- "description": "The left label of the radio group. Used in Likert scales for example",
1281
- "type": "string"
1282
- },
1283
- "location": {
1284
- "$ref": "#/definitions/ResponseBlockLocation",
1285
- "description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
1286
- },
1287
- "options": {
1288
- "description": "The options that are displayed as checkboxes, provided as an array of objects, with label and value fields.",
1289
- "items": {
1290
- "anyOf": [
1291
- {
1292
- "$ref": "#/definitions/StringOption"
1293
- },
1294
- {
1295
- "type": "string"
1296
- }
1297
- ]
1298
- },
1299
- "type": "array"
1300
- },
1301
- "paramCapture": {
1302
- "description": "Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",
1303
- "type": "string"
1304
- },
1305
- "prompt": {
1306
- "description": "The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",
1307
- "type": "string"
1308
- },
1309
- "required": {
1310
- "description": "Controls whether the response is required to be answered.",
1311
- "type": "boolean"
1312
- },
1313
- "requiredLabel": {
1314
- "description": "You can provide a required label, which makes it so a participant has to answer with a response that matches label.",
1315
- "type": "string"
1316
- },
1317
- "requiredValue": {
1318
- "description": "You can provide a required value, which makes it so a participant has to answer with that value."
1319
- },
1320
- "rightLabel": {
1321
- "description": "The right label of the radio group. Used in Likert scales for example",
1322
- "type": "string"
1323
- },
1324
- "secondaryText": {
1325
- "description": "The secondary text that is displayed to the participant under the prompt. This does not accept markdown.",
1326
- "type": "string"
1327
- },
1328
- "type": {
1329
- "const": "radio",
1330
- "type": "string"
1331
- }
1332
- },
1333
- "required": [
1334
- "id",
1335
- "options",
1336
- "prompt",
1337
- "required",
1338
- "type"
1339
- ],
1340
- "type": "object"
1341
- },
1342
- "RandomInterruption": {
1343
- "additionalProperties": false,
1344
- "description": "The RandomInterruption interface is used to define an interruption that will be shown randomly in the block.\n\nFor example, if you want to show a single interruption randomly in the block, you would set `\"spacing\"` to \"random\" and `\"numInterruptions\"` to 1. If you want to show 3 interruptions randomly in the block, you would set `\"spacing\"` to \"random\" and `\"numInterruptions\"` to 3.\n\nThe components property is an array of the components that will be inserted randomly in the block. These components should reference components in the StudyConfig.components section of the config.\n\nHere's an example of how to use the RandomInterruption:\n\n```js { \"order\": \"fixed\", \"components\": [ \"component1\", \"component2\", \"component3\", \"component4\", \"component5\", \"component6\" ], \"interruptions\": [ { \"spacing\": \"random\", \"numInterruptions\": 3, \"components\": [ \"interruption1\", \"interruption2\" ] } ] } ```\n\nThe resulting sequence array could be:\n\n```js [ [\"component1\", \"interruption1\", \"interruption2\", \"component2\", \"interruption1\", \"interruption2\", \"component3\", \"component4\", \"component5\", \"interruption1\", \"interruption2\", \"component6], [\"component1\", \"interruption1\", \"interruption2\", \"component2\", \"interruption1\", \"interruption2\", \"component3\", \"component4\", \"interruption1\", \"interruption2\", \"component5\", \"component6], [\"component1\", \"component2\" \"interruption1\", \"interruption2\", \"component3\", \"interruption1\", \"interruption2\", \"component4\", \"component5\", \"interruption1\", \"interruption2\", \"component6], ... ] ```",
1345
- "properties": {
1346
- "components": {
1347
- "description": "The components that are included in the interruption. These reference components in the StudyConfig.components section of the config.",
1348
- "items": {
1349
- "type": "string"
1350
- },
1351
- "type": "array"
1352
- },
1353
- "numInterruptions": {
1354
- "description": "The number of times the interruption will be randomly added",
1355
- "type": "number"
1356
- },
1357
- "spacing": {
1358
- "const": "random",
1359
- "description": "If spacing is set to random, reVISit will add interruptions randomly. These interruptions will not ever be displayed as the first component in the block.",
1360
- "type": "string"
1361
- }
1362
- },
1363
- "required": [
1364
- "spacing",
1365
- "numInterruptions",
1366
- "components"
1367
- ],
1368
- "type": "object"
1369
- },
1370
- "ReactComponent": {
1371
- "additionalProperties": false,
1372
- "description": "The ReactComponent interface is used to define the properties of a react component. This component is used to render react code with certain parameters. These parameters can be used within your react code to render different things.\n\nUnlike other types of components, the path for a React component is relative to the `src/public/` folder. Similar to our standard assets, we suggest creating a folder named `src/public/{studyName}/assets` to house all of the React component assets for a particular study. Your React component which you link to in the path must be default exported from its file.\n\nReact components created this way have a generic prop type passed to the component on render, `<StimulusParams<T>>`, which has the following types.\n\n```ts { parameters: T; setAnswer: ({ status, provenanceGraph, answers }: { status: boolean, provenanceGraph?: TrrackedProvenance, answers: Record<string, any> }) => void } ```\n\nparameters is the same object passed in from the ReactComponent type below, allowing you to pass options in from the config to your component. setAnswer is a callback function allowing the creator of the ReactComponent to programmatically set the answer, as well as the provenance graph. This can be useful if you don't use the default answer interface, and instead have something more unique.\n\nSo, for example, if I had the following ReactComponent in my config ```js { type: 'react-component'; path: 'my_study/CoolComponent.tsx'; parameters: { name: 'Zach'; age: 26; } } ```\n\nMy react component, CoolComponent.tsx, would exist in src/public/my_study/assets, and look something like this\n\n```ts export default function CoolComponent({ parameters, setAnswer }: StimulusParams<{name: string, age: number}>) { // render something } ```\n\nFor in depth examples, see the following studies, and their associated codebases. https://revisit.dev/study/demo-click-accuracy-test (https://github.com/revisit-studies/study/tree/v1.0.6/src/public/demo-click-accuracy-test/assets) https://revisit.dev/study/example-brush-interactions (https://github.com/revisit-studies/study/tree/v1.0.6/src/public/example-brush-interactions/assets)",
1373
- "properties": {
1374
- "allowFailedTraining": {
1375
- "description": "Controls whether the component should allow failed training. If not provided, the default is true.",
1376
- "type": "boolean"
1377
- },
1378
- "correctAnswer": {
1379
- "description": "The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",
1380
- "items": {
1381
- "$ref": "#/definitions/Answer"
1382
- },
1383
- "type": "array"
1384
- },
1385
- "description": {
1386
- "description": "The description of the component. This is used to identify and provide additional information for the component in the admin panel.",
1387
- "type": "string"
1388
- },
1389
- "instruction": {
1390
- "description": "The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",
1391
- "type": "string"
1392
- },
1393
- "instructionLocation": {
1394
- "$ref": "#/definitions/ResponseBlockLocation",
1395
- "description": "The location of the instructions."
1396
- },
1397
- "meta": {
1398
- "additionalProperties": {},
1399
- "description": "The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",
1400
- "type": "object"
1401
- },
1402
- "nextButtonDisableTime": {
1403
- "description": "A timeout (in ms) after which the next button will be disabled.",
1404
- "type": "number"
1405
- },
1406
- "nextButtonEnableTime": {
1407
- "description": "A timer (in ms) after which the next button will be enabled.",
1408
- "type": "number"
1409
- },
1410
- "nextButtonLocation": {
1411
- "$ref": "#/definitions/ResponseBlockLocation",
1412
- "description": "The location of the next button."
1413
- },
1414
- "nextButtonText": {
1415
- "description": "The text that is displayed on the next button.",
1416
- "type": "string"
1417
- },
1418
- "parameters": {
1419
- "additionalProperties": {},
1420
- "description": "The parameters that are passed to the react component. These can be used within your react component to render different things.",
1421
- "type": "object"
1422
- },
1423
- "path": {
1424
- "description": "The path to the react component. This should be a relative path from the src/public folder.",
1425
- "type": "string"
1426
- },
1427
- "provideFeedback": {
1428
- "description": "Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.",
1429
- "type": "boolean"
1430
- },
1431
- "recordAudio": {
1432
- "description": "Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.",
1433
- "type": "boolean"
1434
- },
1435
- "response": {
1436
- "description": "The responses to the component",
1437
- "items": {
1438
- "$ref": "#/definitions/Response"
1439
- },
1440
- "type": "array"
1441
- },
1442
- "trainingAttempts": {
1443
- "description": "The number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.",
1444
- "type": "number"
1445
- },
1446
- "type": {
1447
- "const": "react-component",
1448
- "type": "string"
1449
- }
1450
- },
1451
- "required": [
1452
- "path",
1453
- "response",
1454
- "type"
1455
- ],
1456
- "type": "object"
1457
- },
1458
- "RepeatedComponentBlockCondition": {
1459
- "additionalProperties": false,
1460
- "description": "The RepeatedComponentBlockCondition interface is used to define a SkipCondition based on the number of correct or incorrect repeated components. You might use this if you need to check if an attention check was failed multiple times. This is similar to the [ComponentBlockCondition](../ComponentBlockCondition), but it only checks a specific repeated component.\n\nHere's an example of how to use the RepeatedComponentBlockCondition:\n\n```js { ... \"skip\": [ { \"name\": \"attentionCheck\", \"check\": \"repeatedComponent\", \"condition\": \"numIncorrect\", \"value\": 2, \"to\": \"end\" } ] ... } ```\n\nIn this example, when the number of incorrect responses to the repeated component with the name \"attentionCheck\" is two, the participant will be redirected to the end of the study. If the number of incorrect responses is less than two, the participant will continue to the next component in the sequence.",
1461
- "properties": {
1462
- "check": {
1463
- "const": "repeatedComponent",
1464
- "description": "The check we'll perform.",
1465
- "type": "string"
1466
- },
1467
- "condition": {
1468
- "description": "The condition to check.",
1469
- "enum": [
1470
- "numCorrect",
1471
- "numIncorrect"
1472
- ],
1473
- "type": "string"
1474
- },
1475
- "name": {
1476
- "description": "The name of the repeated component to check (e.g. attentionCheck).",
1477
- "type": "string"
1478
- },
1479
- "to": {
1480
- "description": "The id of the component or block to skip to",
1481
- "type": "string"
1482
- },
1483
- "value": {
1484
- "description": "The number of correct or incorrect responses to check for.",
1485
- "type": "number"
1486
- }
1487
- },
1488
- "required": [
1489
- "name",
1490
- "check",
1491
- "condition",
1492
- "value",
1493
- "to"
1494
- ],
1495
- "type": "object"
1496
- },
1497
- "Response": {
1498
- "anyOf": [
1499
- {
1500
- "$ref": "#/definitions/NumericalResponse"
1501
- },
1502
- {
1503
- "$ref": "#/definitions/ShortTextResponse"
1504
- },
1505
- {
1506
- "$ref": "#/definitions/LongTextResponse"
1507
- },
1508
- {
1509
- "$ref": "#/definitions/LikertResponse"
1510
- },
1511
- {
1512
- "$ref": "#/definitions/DropdownResponse"
1513
- },
1514
- {
1515
- "$ref": "#/definitions/SliderResponse"
1516
- },
1517
- {
1518
- "$ref": "#/definitions/RadioResponse"
1519
- },
1520
- {
1521
- "$ref": "#/definitions/CheckboxResponse"
1522
- },
1523
- {
1524
- "$ref": "#/definitions/IFrameResponse"
1525
- },
1526
- {
1527
- "$ref": "#/definitions/MatrixResponse"
1528
- }
1529
- ]
1530
- },
1531
- "ResponseBlockLocation": {
1532
- "enum": [
1533
- "sidebar",
1534
- "aboveStimulus",
1535
- "belowStimulus"
1536
- ],
1537
- "type": "string"
1538
- },
1539
- "ShortTextResponse": {
1540
- "additionalProperties": false,
1541
- "description": "The ShortTextResponse interface is used to define the properties of a short text response. ShortTextResponses render as a text input that accepts any text and can optionally have a placeholder.\n\n```js { \"id\": \"q-short-text\", \"prompt\": \"Short text example\", \"required\": true, \"location\": \"aboveStimulus\", \"type\": \"shortText\", \"placeholder\": \"Enter your answer here\" } ```",
1542
- "properties": {
1543
- "hidden": {
1544
- "description": "Controls whether the response is hidden.",
1545
- "type": "boolean"
1546
- },
1547
- "id": {
1548
- "description": "The id of the response. This is used to identify the response in the data file.",
1549
- "type": "string"
1550
- },
1551
- "location": {
1552
- "$ref": "#/definitions/ResponseBlockLocation",
1553
- "description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
1554
- },
1555
- "paramCapture": {
1556
- "description": "Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",
1557
- "type": "string"
1558
- },
1559
- "placeholder": {
1560
- "description": "The placeholder text that is displayed in the input.",
1561
- "type": "string"
1562
- },
1563
- "prompt": {
1564
- "description": "The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",
1565
- "type": "string"
1566
- },
1567
- "required": {
1568
- "description": "Controls whether the response is required to be answered.",
1569
- "type": "boolean"
1570
- },
1571
- "requiredLabel": {
1572
- "description": "You can provide a required label, which makes it so a participant has to answer with a response that matches label.",
1573
- "type": "string"
1574
- },
1575
- "requiredValue": {
1576
- "description": "You can provide a required value, which makes it so a participant has to answer with that value."
1577
- },
1578
- "secondaryText": {
1579
- "description": "The secondary text that is displayed to the participant under the prompt. This does not accept markdown.",
1580
- "type": "string"
1581
- },
1582
- "type": {
1583
- "const": "shortText",
1584
- "type": "string"
1585
- }
1586
- },
1587
- "required": [
1588
- "id",
1589
- "prompt",
1590
- "required",
1591
- "type"
1592
- ],
1593
- "type": "object"
1594
- },
1595
- "SkipConditions": {
1596
- "description": "The SkipConditions interface is used to define skip conditions. This is used to skip to a different component/block based on the response to a component or based on the number of correct/incorrect responses in a block. Skip conditions work recursively: if you have a nested block, the parent blocks' skip conditions will be considered when computing the skip logic.\n\nSkip conditions are evaluated in the order they are defined in the array. If a condition is met, the participant will be redirected to the component or block specified in the `\"to\"` property. If no conditions are met, the participant will continue to the next component in the sequence.\n\nSkip conditions allow you to jump to a different component or block. If you intend to skip to a block, you should specify a block id in the sequence. If you intend to skip to a component, you should specify a component id. Skipping backwards is not supported. Skipping to a repeated component will skip to the first instance of the component after the component that triggered the skip.\n\nPlease see the interface definitions for more specific information on the different types of skip conditions.",
1597
- "items": {
1598
- "anyOf": [
1599
- {
1600
- "$ref": "#/definitions/IndividualComponentSingleResponseCondition"
1601
- },
1602
- {
1603
- "$ref": "#/definitions/IndividualComponentAllResponsesCondition"
1604
- },
1605
- {
1606
- "$ref": "#/definitions/ComponentBlockCondition"
1607
- },
1608
- {
1609
- "$ref": "#/definitions/RepeatedComponentBlockCondition"
1610
- }
1611
- ]
1612
- },
1613
- "type": "array"
1614
- },
1615
- "SliderResponse": {
1616
- "additionalProperties": false,
1617
- "description": "The SliderResponse interface is used to define the properties of a slider response. SliderResponses render as a slider input with user specified steps. For example, you could have steps of 0, 50, and 100.\n\nExample: ```js { \"id\": \"q-slider\", \"prompt\": \"How are you feeling?\", \"location\": \"aboveStimulus\", \"required\": true, \"type\": \"slider\", \"options\": [ { \"label\": \"Bad\", \"value\": 0 }, { \"label\": \"OK\", \"value\": 50 }, { \"label\": \"Good\", \"value\": 100 } ] } ```",
1618
- "properties": {
1619
- "hidden": {
1620
- "description": "Controls whether the response is hidden.",
1621
- "type": "boolean"
1622
- },
1623
- "id": {
1624
- "description": "The id of the response. This is used to identify the response in the data file.",
1625
- "type": "string"
1626
- },
1627
- "location": {
1628
- "$ref": "#/definitions/ResponseBlockLocation",
1629
- "description": "Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`"
1630
- },
1631
- "options": {
1632
- "description": "This defines the steps in the slider and the extent of the slider as an array of objects that have a label and a value.",
1633
- "items": {
1634
- "$ref": "#/definitions/NumberOption"
1635
- },
1636
- "type": "array"
1637
- },
1638
- "paramCapture": {
1639
- "description": "Use to capture querystring parameters in answers such as participant_name. See the examples for how this is used, but prefer uiConfig.urlParticipantIdParam if you are capturing a participant ID.",
1640
- "type": "string"
1641
- },
1642
- "prompt": {
1643
- "description": "The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.",
1644
- "type": "string"
1645
- },
1646
- "required": {
1647
- "description": "Controls whether the response is required to be answered.",
1648
- "type": "boolean"
1649
- },
1650
- "requiredLabel": {
1651
- "description": "You can provide a required label, which makes it so a participant has to answer with a response that matches label.",
1652
- "type": "string"
1653
- },
1654
- "requiredValue": {
1655
- "description": "You can provide a required value, which makes it so a participant has to answer with that value."
1656
- },
1657
- "secondaryText": {
1658
- "description": "The secondary text that is displayed to the participant under the prompt. This does not accept markdown.",
1659
- "type": "string"
1660
- },
1661
- "type": {
1662
- "const": "slider",
1663
- "type": "string"
1664
- }
1665
- },
1666
- "required": [
1667
- "id",
1668
- "options",
1669
- "prompt",
1670
- "required",
1671
- "type"
1672
- ],
1673
- "type": "object"
1674
- },
1675
- "StringOption": {
1676
- "additionalProperties": false,
1677
- "description": "The StringOption interface is used to define the options for a dropdown, radio, or checkbox response. The label is the text that is displayed to the user, and the value is the value that is stored in the data file.",
1678
- "properties": {
1679
- "label": {
1680
- "description": "The label displayed to participants.",
1681
- "type": "string"
1682
- },
1683
- "value": {
1684
- "description": "The value stored in the participant's data.",
1685
- "type": "string"
1686
- }
1687
- },
1688
- "required": [
1689
- "label",
1690
- "value"
1691
- ],
1692
- "type": "object"
1693
- },
1694
- "StudyConfig": {
1695
- "additionalProperties": false,
1696
- "description": "The StudyConfig interface is used to define the properties of a study configuration. This is a JSON object with four main components: the StudyMetadata, the UIConfig, the Components, and the Sequence. Below is the general template that should be followed when constructing a Study configuration file.\n\n```js { \"$schema\": \"https://raw.githubusercontent.com/revisit-studies/study/v1.0.6/src/parser/StudyConfigSchema.json\", \"studyMetadata\": { ... }, \"uiConfig\": { ... }, \"components\": { ... }, \"sequence\": { ... } } ```\n\n:::info For information about each of the individual pieces of the study configuration file, you can visit the documentation for each one individually. ::: <br/>\n\nThe `$schema` line is used to verify the schema. If you're using VSCode (or other similar IDEs), including this line will allow for autocomplete and helpful suggestions when writing the study configuration.",
1697
- "properties": {
1698
- "$schema": {
1699
- "description": "A required json schema property. This should point to the github link for the version of the schema you would like. The `$schema` line is used to verify the schema. If you're using VSCode (or other similar IDEs), including this line will allow for autocomplete and helpful suggestions when writing the study configuration. See examples for more information",
1700
- "type": "string"
1701
- },
1702
- "baseComponents": {
1703
- "$ref": "#/definitions/BaseComponents",
1704
- "description": "The base components that are used in the study. These components can be used to template other components. See [BaseComponents](../../type-aliases/BaseComponents) for more information."
1705
- },
1706
- "components": {
1707
- "additionalProperties": {
1708
- "anyOf": [
1709
- {
1710
- "$ref": "#/definitions/IndividualComponent"
1711
- },
1712
- {
1713
- "$ref": "#/definitions/InheritedComponent"
1714
- }
1715
- ]
1716
- },
1717
- "description": "The components that are used in the study. They must be fully defined here with all properties. Some properties may be inherited from baseComponents.",
1718
- "type": "object"
1719
- },
1720
- "importedLibraries": {
1721
- "description": "A list of libraries that are used in the study. This is used to import external libraries into the study. Library names are valid namespaces to be used later.",
1722
- "items": {
1723
- "type": "string"
1724
- },
1725
- "type": "array"
1726
- },
1727
- "recordStudyAudio": {
1728
- "description": "Whether or not we want to utilize think-aloud features. If true, will record audio on all components unless deactivated on individual components. Defaults to false.",
1729
- "type": "boolean"
1730
- },
1731
- "sequence": {
1732
- "$ref": "#/definitions/ComponentBlock",
1733
- "description": "The order of the components in the study. This might include some randomness."
1734
- },
1735
- "studyMetadata": {
1736
- "$ref": "#/definitions/StudyMetadata",
1737
- "description": "The metadata for the study. This is used to identify the study and version in the data file."
1738
- },
1739
- "uiConfig": {
1740
- "$ref": "#/definitions/UIConfig",
1741
- "description": "The UI configuration for the study. This is used to configure the UI of the app."
1742
- }
1743
- },
1744
- "required": [
1745
- "$schema",
1746
- "studyMetadata",
1747
- "uiConfig",
1748
- "components",
1749
- "sequence"
1750
- ],
1751
- "type": "object"
1752
- },
1753
- "StudyMetadata": {
1754
- "additionalProperties": false,
1755
- "description": "The StudyMetadata is used to describe certain properties of a study. Some of this data is displayed on the landing page when running the app, such as the title and description. Below is an example of a StudyMetadata entry in your study configuration file:\n\n```js \"studyMetadata\" : { \"title\": \"My New Study\", \"version\": \"pilot\", \"authors\": [ \"Jane Doe\", \"John Doe\" ], \"date\": \"2024-04-01\", \"description\": \"This study is meant to test your ability.\", \"organizations\": [ \"The reVISit Team\", \"The Other Team\" ] } ```",
1756
- "properties": {
1757
- "authors": {
1758
- "description": "The authors of your study.",
1759
- "items": {
1760
- "type": "string"
1761
- },
1762
- "type": "array"
1763
- },
1764
- "date": {
1765
- "description": "The date of your study, may be useful for the researcher.",
1766
- "type": "string"
1767
- },
1768
- "description": {
1769
- "description": "The description of your study, shown on the landing page.",
1770
- "type": "string"
1771
- },
1772
- "organizations": {
1773
- "description": "The organizations that are associated with your study.",
1774
- "items": {
1775
- "type": "string"
1776
- },
1777
- "type": "array"
1778
- },
1779
- "title": {
1780
- "description": "The title of your study, shown on the landing page.",
1781
- "type": "string"
1782
- },
1783
- "version": {
1784
- "description": "The version of your study. When you change a configuration file after a study has already been distributed to participants, you can change the version number so that the participants who see this new configuration file can be identified.",
1785
- "type": "string"
1786
- }
1787
- },
1788
- "required": [
1789
- "title",
1790
- "version",
1791
- "authors",
1792
- "date",
1793
- "description",
1794
- "organizations"
1795
- ],
1796
- "type": "object"
1797
- },
1798
- "UIConfig": {
1799
- "additionalProperties": false,
1800
- "description": "The UIConfig is used to configure the UI of the app. This includes the logo, contact email, and whether to show a progress bar. The UIConfig is also used to configure the sidebar, which can be used to display the task instructions and capture responses. Below is an example of how the UI Config would look in your study configuration (note, there are optional fields that are not shown here): ```js uiConfig:{ \"contactEmail\": \"contact@revisit.dev\", \"helpTextPath\": \"<study-name>/assets/help.md\", \"logoPath\": \"<study-name>/assets/logo.jpg\", \"withProgressBar\": true, \"autoDownloadStudy\": true \"autoDownloadTime\": 5000, \"studyEndMsg\": \"Thank you for completing this study. You're the best!\", \"sidebar\": true, \"windowEventDebounceTime\": 500, \"urlParticipantIdParam\": \"PROLIFIC_ID\", \"numSequences\": 500 } ``` In the above, the `path/to/assets/` path is referring to the path to your individual study assets. It is common practice to have your study directory contain an `assets` directory where all components and images relevant to your study reside. Note that this path is relative to the `public` folder of the repository - as is all other paths you define in reVISit (aside from React components whose paths are relative to `src/public`.)",
1801
- "properties": {
1802
- "autoDownloadStudy": {
1803
- "description": "Controls whether the study data is automatically downloaded at the end of the study.",
1804
- "type": "boolean"
1805
- },
1806
- "autoDownloadTime": {
1807
- "description": "The time in milliseconds to wait before automatically downloading the study data.",
1808
- "type": "number"
1809
- },
1810
- "contactEmail": {
1811
- "description": "The email address that used during the study if a participant clicks contact.",
1812
- "type": "string"
1813
- },
1814
- "enumerateQuestions": {
1815
- "description": "Whether to prepend questions with their index (+ 1). This should only be used when all questions are in the same location, e.g. all are in the side bar.",
1816
- "type": "boolean"
1817
- },
1818
- "helpTextPath": {
1819
- "description": "The path to the help text file. This is displayed when a participant clicks help. Markdown is supported.",
1820
- "type": "string"
1821
- },
1822
- "logoPath": {
1823
- "description": "The path to the logo image. This is displayed on the landing page and the header.",
1824
- "type": "string"
1825
- },
1826
- "numSequences": {
1827
- "description": "The number of sequences to generate for the study. This is used to generate the random sequences for the study. The default is 1000.",
1828
- "type": "number"
1829
- },
1830
- "sidebar": {
1831
- "description": "Controls whether the left sidebar is rendered at all. Required to be true if your response's location is set to sidebar for any question.",
1832
- "type": "boolean"
1833
- },
1834
- "sidebarWidth": {
1835
- "description": "The width of the left sidebar. Defaults to 300.",
1836
- "type": "number"
1837
- },
1838
- "studyEndMsg": {
1839
- "description": "The message to display when the study ends.",
1840
- "type": "string"
1841
- },
1842
- "timeoutReject": {
1843
- "description": "Whether to redirect a timed out participant to a rejection page. This only works for components where the `nextButtonDisableTime` field is set.",
1844
- "type": "boolean"
1845
- },
1846
- "urlParticipantIdParam": {
1847
- "description": "If the participant ID is passed in the URL, this is the name of the querystring parameter that is used to capture the participant ID (e.g. PROLIFIC_ID). This will allow a user to continue a study on different devices and browsers.",
1848
- "type": "string"
1849
- },
1850
- "windowEventDebounceTime": {
1851
- "description": "Debounce time in milliseconds for automatically tracked window events. Defaults to 100. E.g 100 here means 1000ms / 100ms = 10 times a second, 200 here means 1000ms / 200ms = 5 times per second",
1852
- "type": "number"
1853
- },
1854
- "withProgressBar": {
1855
- "description": "Controls whether the progress bar is rendered in the study.",
1856
- "type": "boolean"
1857
- }
1858
- },
1859
- "required": [
1860
- "contactEmail",
1861
- "logoPath",
1862
- "withProgressBar",
1863
- "sidebar"
1864
- ],
1865
- "type": "object"
1866
- },
1867
- "VegaComponent": {
1868
- "anyOf": [
1869
- {
1870
- "$ref": "#/definitions/VegaComponentPath"
1871
- },
1872
- {
1873
- "$ref": "#/definitions/VegaComponentConfig"
1874
- }
1875
- ]
1876
- },
1877
- "VegaComponentConfig": {
1878
- "additionalProperties": false,
1879
- "properties": {
1880
- "allowFailedTraining": {
1881
- "description": "Controls whether the component should allow failed training. If not provided, the default is true.",
1882
- "type": "boolean"
1883
- },
1884
- "config": {
1885
- "description": "The vega-lite configuration.",
1886
- "type": "object"
1887
- },
1888
- "correctAnswer": {
1889
- "description": "The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",
1890
- "items": {
1891
- "$ref": "#/definitions/Answer"
1892
- },
1893
- "type": "array"
1894
- },
1895
- "description": {
1896
- "description": "The description of the component. This is used to identify and provide additional information for the component in the admin panel.",
1897
- "type": "string"
1898
- },
1899
- "instruction": {
1900
- "description": "The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",
1901
- "type": "string"
1902
- },
1903
- "instructionLocation": {
1904
- "$ref": "#/definitions/ResponseBlockLocation",
1905
- "description": "The location of the instructions."
1906
- },
1907
- "meta": {
1908
- "additionalProperties": {},
1909
- "description": "The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",
1910
- "type": "object"
1911
- },
1912
- "nextButtonDisableTime": {
1913
- "description": "A timeout (in ms) after which the next button will be disabled.",
1914
- "type": "number"
1915
- },
1916
- "nextButtonEnableTime": {
1917
- "description": "A timer (in ms) after which the next button will be enabled.",
1918
- "type": "number"
1919
- },
1920
- "nextButtonLocation": {
1921
- "$ref": "#/definitions/ResponseBlockLocation",
1922
- "description": "The location of the next button."
1923
- },
1924
- "nextButtonText": {
1925
- "description": "The text that is displayed on the next button.",
1926
- "type": "string"
1927
- },
1928
- "provideFeedback": {
1929
- "description": "Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.",
1930
- "type": "boolean"
1931
- },
1932
- "recordAudio": {
1933
- "description": "Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.",
1934
- "type": "boolean"
1935
- },
1936
- "response": {
1937
- "description": "The responses to the component",
1938
- "items": {
1939
- "$ref": "#/definitions/Response"
1940
- },
1941
- "type": "array"
1942
- },
1943
- "trainingAttempts": {
1944
- "description": "The number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.",
1945
- "type": "number"
1946
- },
1947
- "type": {
1948
- "const": "vega",
1949
- "type": "string"
1950
- }
1951
- },
1952
- "required": [
1953
- "config",
1954
- "response",
1955
- "type"
1956
- ],
1957
- "type": "object"
1958
- },
1959
- "VegaComponentPath": {
1960
- "additionalProperties": false,
1961
- "properties": {
1962
- "allowFailedTraining": {
1963
- "description": "Controls whether the component should allow failed training. If not provided, the default is true.",
1964
- "type": "boolean"
1965
- },
1966
- "correctAnswer": {
1967
- "description": "The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",
1968
- "items": {
1969
- "$ref": "#/definitions/Answer"
1970
- },
1971
- "type": "array"
1972
- },
1973
- "description": {
1974
- "description": "The description of the component. This is used to identify and provide additional information for the component in the admin panel.",
1975
- "type": "string"
1976
- },
1977
- "instruction": {
1978
- "description": "The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",
1979
- "type": "string"
1980
- },
1981
- "instructionLocation": {
1982
- "$ref": "#/definitions/ResponseBlockLocation",
1983
- "description": "The location of the instructions."
1984
- },
1985
- "meta": {
1986
- "additionalProperties": {},
1987
- "description": "The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",
1988
- "type": "object"
1989
- },
1990
- "nextButtonDisableTime": {
1991
- "description": "A timeout (in ms) after which the next button will be disabled.",
1992
- "type": "number"
1993
- },
1994
- "nextButtonEnableTime": {
1995
- "description": "A timer (in ms) after which the next button will be enabled.",
1996
- "type": "number"
1997
- },
1998
- "nextButtonLocation": {
1999
- "$ref": "#/definitions/ResponseBlockLocation",
2000
- "description": "The location of the next button."
2001
- },
2002
- "nextButtonText": {
2003
- "description": "The text that is displayed on the next button.",
2004
- "type": "string"
2005
- },
2006
- "path": {
2007
- "description": "The path to the vega file. This should be a relative path from the public folder.",
2008
- "type": "string"
2009
- },
2010
- "provideFeedback": {
2011
- "description": "Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.",
2012
- "type": "boolean"
2013
- },
2014
- "recordAudio": {
2015
- "description": "Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.",
2016
- "type": "boolean"
2017
- },
2018
- "response": {
2019
- "description": "The responses to the component",
2020
- "items": {
2021
- "$ref": "#/definitions/Response"
2022
- },
2023
- "type": "array"
2024
- },
2025
- "trainingAttempts": {
2026
- "description": "The number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.",
2027
- "type": "number"
2028
- },
2029
- "type": {
2030
- "const": "vega",
2031
- "type": "string"
2032
- }
2033
- },
2034
- "required": [
2035
- "path",
2036
- "response",
2037
- "type"
2038
- ],
2039
- "type": "object"
2040
- },
2041
- "WebsiteComponent": {
2042
- "additionalProperties": false,
2043
- "description": "The WebsiteComponent interface is used to define the properties of a website component. A WebsiteComponent is used to render an iframe with a website inside of it. This can be used to display an external website or an html file that is located in the public folder.\n\n```js { \"type\": \"website\", \"path\": \"<study-name>/assets/website.html\", } ```\n\nTo pass a data from the config to the website, you can use the `parameters` field as below:\n\n```js { \"type\": \"website\", \"path\": \"<study-name>/website.html\", \"parameters\": { \"barData\": [0.32, 0.01, 1.2, 1.3, 0.82, 0.4, 0.3] } \"response\": [ { \"id\": \"barChart\", \"prompt\": \"Your selected answer:\", \"required\": true, \"location\": \"belowStimulus\", \"type\": \"iframe\" } ], } ``` In the `website.html` file, by including `revisit-communicate.js`, you can use the `Revisit.onDataReceive` method to retrieve the data, and `Revisit.postAnswers` to send the user's responses back to the reVISit as shown in the example below:\n\n```html <script src=\"../../revisitUtilities/revisit-communicate.js\"></script> <script> Revisit.onDataReceive((data) => { const barData = data['barData']; ... });\n\n// Call out that 'barChart' needs to match ID in 'response' object Revisit.postAnswers({ barChart: userAnswer }); </script> ```\n\n If the html website implements Trrack library for provenance tracking, you can send the provenance graph back to reVISit by calling `Revisit.postProvenanceGraph` as shown in the example below. You need to call this each time the Trrack state is updated so that reVISit is kept aware of the changes in the provenance graph.\n\n```js const trrack = initializeTrrack({ initialState, registry });\n\n... Revisit.postProvenance(trrack.graph.backend); ```",
2044
- "properties": {
2045
- "allowFailedTraining": {
2046
- "description": "Controls whether the component should allow failed training. If not provided, the default is true.",
2047
- "type": "boolean"
2048
- },
2049
- "correctAnswer": {
2050
- "description": "The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.",
2051
- "items": {
2052
- "$ref": "#/definitions/Answer"
2053
- },
2054
- "type": "array"
2055
- },
2056
- "description": {
2057
- "description": "The description of the component. This is used to identify and provide additional information for the component in the admin panel.",
2058
- "type": "string"
2059
- },
2060
- "instruction": {
2061
- "description": "The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.",
2062
- "type": "string"
2063
- },
2064
- "instructionLocation": {
2065
- "$ref": "#/definitions/ResponseBlockLocation",
2066
- "description": "The location of the instructions."
2067
- },
2068
- "meta": {
2069
- "additionalProperties": {},
2070
- "description": "The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.",
2071
- "type": "object"
2072
- },
2073
- "nextButtonDisableTime": {
2074
- "description": "A timeout (in ms) after which the next button will be disabled.",
2075
- "type": "number"
2076
- },
2077
- "nextButtonEnableTime": {
2078
- "description": "A timer (in ms) after which the next button will be enabled.",
2079
- "type": "number"
2080
- },
2081
- "nextButtonLocation": {
2082
- "$ref": "#/definitions/ResponseBlockLocation",
2083
- "description": "The location of the next button."
2084
- },
2085
- "nextButtonText": {
2086
- "description": "The text that is displayed on the next button.",
2087
- "type": "string"
2088
- },
2089
- "parameters": {
2090
- "additionalProperties": {},
2091
- "description": "The parameters that are passed to the website (iframe). These can be used within your website to render different things.",
2092
- "type": "object"
2093
- },
2094
- "path": {
2095
- "description": "The path to the website. This should be a relative path from the public folder or could be an external website.",
2096
- "type": "string"
2097
- },
2098
- "provideFeedback": {
2099
- "description": "Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.",
2100
- "type": "boolean"
2101
- },
2102
- "recordAudio": {
2103
- "description": "Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.",
2104
- "type": "boolean"
2105
- },
2106
- "response": {
2107
- "description": "The responses to the component",
2108
- "items": {
2109
- "$ref": "#/definitions/Response"
2110
- },
2111
- "type": "array"
2112
- },
2113
- "trainingAttempts": {
2114
- "description": "The number of training attempts allowed for the component. The next button will be disabled until either the correct answer is given or the number of attempts is reached. When the number of attempts is reached, if the answer is incorrect still, the correct value will be shown to the participant. The default value is 2. Providing a value of -1 will allow infinite attempts and the participant must enter the correct answer to continue, and reVISit will not show the correct answer to the user.",
2115
- "type": "number"
2116
- },
2117
- "type": {
2118
- "const": "website",
2119
- "type": "string"
2120
- }
2121
- },
2122
- "required": [
2123
- "path",
2124
- "response",
2125
- "type"
2126
- ],
2127
- "type": "object"
2128
- }
2129
- }
2130
- }