revisit 0.0.20__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- revisit/StudyConfigSchema.json +2130 -0
- revisit/__init__.py +12 -0
- revisit/models.py +2827 -0
- revisit/revisit.py +768 -0
- revisit/static/widget.css +1 -0
- revisit/static/widget.js +55 -0
- revisit/widget.py +27 -0
- revisit-0.0.20.dist-info/METADATA +290 -0
- revisit-0.0.20.dist-info/RECORD +10 -0
- revisit-0.0.20.dist-info/WHEEL +5 -0
revisit/models.py
ADDED
@@ -0,0 +1,2827 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: StudyConfigSchema.json
|
3
|
+
# timestamp: 2025-01-11T22:20:26+00:00
|
4
|
+
|
5
|
+
from __future__ import annotations
|
6
|
+
|
7
|
+
import warnings
|
8
|
+
from enum import Enum
|
9
|
+
from typing import Any, Dict, List, Literal, Optional, TypedDict, Union
|
10
|
+
|
11
|
+
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
12
|
+
|
13
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
14
|
+
|
15
|
+
|
16
|
+
class Answer(BaseModel):
|
17
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
18
|
+
acceptableHigh: Optional[float] = Field(
|
19
|
+
None,
|
20
|
+
description='The acceptable high value for the answer. This is used to define a range of acceptable answers.',
|
21
|
+
)
|
22
|
+
acceptableLow: Optional[float] = Field(
|
23
|
+
None,
|
24
|
+
description='The acceptable low value for the answer. This is used to define a range of acceptable answers.',
|
25
|
+
)
|
26
|
+
answer: Any = Field(..., description='The correct answer to the question.')
|
27
|
+
id: str = Field(
|
28
|
+
...,
|
29
|
+
description='The id of the answer. This is used to identify the answer in the data file.',
|
30
|
+
) # End of class
|
31
|
+
|
32
|
+
|
33
|
+
class AnswerType(TypedDict):
|
34
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
35
|
+
acceptableHigh: Optional[float] = Field(
|
36
|
+
None,
|
37
|
+
description='The acceptable high value for the answer. This is used to define a range of acceptable answers.',
|
38
|
+
)
|
39
|
+
acceptableLow: Optional[float] = Field(
|
40
|
+
None,
|
41
|
+
description='The acceptable low value for the answer. This is used to define a range of acceptable answers.',
|
42
|
+
)
|
43
|
+
answer: Any = Field(..., description='The correct answer to the question.')
|
44
|
+
id: str = Field(
|
45
|
+
...,
|
46
|
+
description='The id of the answer. This is used to identify the answer in the data file.',
|
47
|
+
)
|
48
|
+
|
49
|
+
|
50
|
+
class Type(Enum):
|
51
|
+
markdown = 'markdown'
|
52
|
+
react_component = 'react-component'
|
53
|
+
image = 'image'
|
54
|
+
website = 'website'
|
55
|
+
questionnaire = 'questionnaire'
|
56
|
+
vega = 'vega'
|
57
|
+
|
58
|
+
|
59
|
+
class Order(Enum):
|
60
|
+
random = 'random'
|
61
|
+
latinSquare = 'latinSquare'
|
62
|
+
fixed = 'fixed'
|
63
|
+
|
64
|
+
|
65
|
+
class Condition(Enum):
|
66
|
+
numCorrect = 'numCorrect'
|
67
|
+
numIncorrect = 'numIncorrect'
|
68
|
+
|
69
|
+
|
70
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
71
|
+
|
72
|
+
|
73
|
+
class ComponentBlockCondition(BaseModel):
|
74
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
75
|
+
check: Literal['block'] = Field(..., description="The check we'll perform.")
|
76
|
+
condition: Condition = Field(..., description='The condition to check.')
|
77
|
+
to: str = Field(..., description='The id of the component or block to skip to')
|
78
|
+
value: float = Field(
|
79
|
+
..., description='The number of correct or incorrect responses to check for.'
|
80
|
+
) # End of class
|
81
|
+
|
82
|
+
|
83
|
+
class ComponentBlockConditionType(TypedDict):
|
84
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
85
|
+
check: Literal['block'] = Field(..., description="The check we'll perform.")
|
86
|
+
condition: Condition = Field(..., description='The condition to check.')
|
87
|
+
to: str = Field(..., description='The id of the component or block to skip to')
|
88
|
+
value: float = Field(
|
89
|
+
..., description='The number of correct or incorrect responses to check for.'
|
90
|
+
)
|
91
|
+
|
92
|
+
|
93
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
94
|
+
|
95
|
+
|
96
|
+
class DeterministicInterruption(BaseModel):
|
97
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
98
|
+
components: List[str] = Field(
|
99
|
+
...,
|
100
|
+
description='The components that are included in the interruption. These reference components in the StudyConfig.components section of the config.',
|
101
|
+
)
|
102
|
+
firstLocation: float = Field(
|
103
|
+
...,
|
104
|
+
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).',
|
105
|
+
)
|
106
|
+
spacing: float = Field(
|
107
|
+
..., description='The number of components between breaks.'
|
108
|
+
) # End of class
|
109
|
+
|
110
|
+
|
111
|
+
class DeterministicInterruptionType(TypedDict):
|
112
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
113
|
+
components: List[str] = Field(
|
114
|
+
...,
|
115
|
+
description='The components that are included in the interruption. These reference components in the StudyConfig.components section of the config.',
|
116
|
+
)
|
117
|
+
firstLocation: float = Field(
|
118
|
+
...,
|
119
|
+
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).',
|
120
|
+
)
|
121
|
+
spacing: float = Field(..., description='The number of components between breaks.')
|
122
|
+
|
123
|
+
|
124
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
125
|
+
|
126
|
+
|
127
|
+
class IndividualComponentAllResponsesCondition(BaseModel):
|
128
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
129
|
+
check: Literal['responses'] = Field(..., description="The check we'll perform.")
|
130
|
+
name: str = Field(..., description='The name of the component to check.')
|
131
|
+
to: str = Field(
|
132
|
+
..., description='The id of the component or block to skip to'
|
133
|
+
) # End of class
|
134
|
+
|
135
|
+
|
136
|
+
class IndividualComponentAllResponsesConditionType(TypedDict):
|
137
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
138
|
+
check: Literal['responses'] = Field(..., description="The check we'll perform.")
|
139
|
+
name: str = Field(..., description='The name of the component to check.')
|
140
|
+
to: str = Field(..., description='The id of the component or block to skip to')
|
141
|
+
|
142
|
+
|
143
|
+
class Comparison(Enum):
|
144
|
+
equal = 'equal'
|
145
|
+
notEqual = 'notEqual'
|
146
|
+
|
147
|
+
|
148
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
149
|
+
|
150
|
+
|
151
|
+
class IndividualComponentSingleResponseCondition(BaseModel):
|
152
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
153
|
+
check: Literal['response'] = Field(..., description="The check we'll perform.")
|
154
|
+
comparison: Comparison = Field(..., description='The comparison to use.')
|
155
|
+
name: str = Field(..., description='The name of the component to check.')
|
156
|
+
responseId: str = Field(..., description='The response id to check.')
|
157
|
+
to: str = Field(..., description='The id of the component or block to skip to')
|
158
|
+
value: Union[str, float] = Field(
|
159
|
+
..., description='The value to check.'
|
160
|
+
) # End of class
|
161
|
+
|
162
|
+
|
163
|
+
class IndividualComponentSingleResponseConditionType(TypedDict):
|
164
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
165
|
+
check: Literal['response'] = Field(..., description="The check we'll perform.")
|
166
|
+
comparison: Comparison = Field(..., description='The comparison to use.')
|
167
|
+
name: str = Field(..., description='The name of the component to check.')
|
168
|
+
responseId: str = Field(..., description='The response id to check.')
|
169
|
+
to: str = Field(..., description='The id of the component or block to skip to')
|
170
|
+
value: Union[str, float] = Field(..., description='The value to check.')
|
171
|
+
|
172
|
+
|
173
|
+
class Type2(Enum):
|
174
|
+
matrix_radio = 'matrix-radio'
|
175
|
+
matrix_checkbox = 'matrix-checkbox'
|
176
|
+
|
177
|
+
|
178
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
179
|
+
|
180
|
+
|
181
|
+
class NumberOption(BaseModel):
|
182
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
183
|
+
label: str = Field(..., description='The label displayed to participants.')
|
184
|
+
value: float = Field(
|
185
|
+
..., description="The value stored in the participant's data."
|
186
|
+
) # End of class
|
187
|
+
|
188
|
+
|
189
|
+
class NumberOptionType(TypedDict):
|
190
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
191
|
+
label: str = Field(..., description='The label displayed to participants.')
|
192
|
+
value: float = Field(..., description="The value stored in the participant's data.")
|
193
|
+
|
194
|
+
|
195
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
196
|
+
|
197
|
+
|
198
|
+
class RandomInterruption(BaseModel):
|
199
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
200
|
+
components: List[str] = Field(
|
201
|
+
...,
|
202
|
+
description='The components that are included in the interruption. These reference components in the StudyConfig.components section of the config.',
|
203
|
+
)
|
204
|
+
numInterruptions: float = Field(
|
205
|
+
..., description='The number of times the interruption will be randomly added'
|
206
|
+
)
|
207
|
+
spacing: Literal['random'] = Field(
|
208
|
+
...,
|
209
|
+
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.',
|
210
|
+
) # End of class
|
211
|
+
|
212
|
+
|
213
|
+
class RandomInterruptionType(TypedDict):
|
214
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
215
|
+
components: List[str] = Field(
|
216
|
+
...,
|
217
|
+
description='The components that are included in the interruption. These reference components in the StudyConfig.components section of the config.',
|
218
|
+
)
|
219
|
+
numInterruptions: float = Field(
|
220
|
+
..., description='The number of times the interruption will be randomly added'
|
221
|
+
)
|
222
|
+
spacing: Literal['random'] = Field(
|
223
|
+
...,
|
224
|
+
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.',
|
225
|
+
)
|
226
|
+
|
227
|
+
|
228
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
229
|
+
|
230
|
+
|
231
|
+
class RepeatedComponentBlockCondition(BaseModel):
|
232
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
233
|
+
check: Literal['repeatedComponent'] = Field(
|
234
|
+
..., description="The check we'll perform."
|
235
|
+
)
|
236
|
+
condition: Condition = Field(..., description='The condition to check.')
|
237
|
+
name: str = Field(
|
238
|
+
...,
|
239
|
+
description='The name of the repeated component to check (e.g. attentionCheck).',
|
240
|
+
)
|
241
|
+
to: str = Field(..., description='The id of the component or block to skip to')
|
242
|
+
value: float = Field(
|
243
|
+
..., description='The number of correct or incorrect responses to check for.'
|
244
|
+
) # End of class
|
245
|
+
|
246
|
+
|
247
|
+
class RepeatedComponentBlockConditionType(TypedDict):
|
248
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
249
|
+
check: Literal['repeatedComponent'] = Field(
|
250
|
+
..., description="The check we'll perform."
|
251
|
+
)
|
252
|
+
condition: Condition = Field(..., description='The condition to check.')
|
253
|
+
name: str = Field(
|
254
|
+
...,
|
255
|
+
description='The name of the repeated component to check (e.g. attentionCheck).',
|
256
|
+
)
|
257
|
+
to: str = Field(..., description='The id of the component or block to skip to')
|
258
|
+
value: float = Field(
|
259
|
+
..., description='The number of correct or incorrect responses to check for.'
|
260
|
+
)
|
261
|
+
|
262
|
+
|
263
|
+
class ResponseBlockLocation(Enum):
|
264
|
+
sidebar = 'sidebar'
|
265
|
+
aboveStimulus = 'aboveStimulus'
|
266
|
+
belowStimulus = 'belowStimulus'
|
267
|
+
|
268
|
+
|
269
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
270
|
+
|
271
|
+
|
272
|
+
class ShortTextResponse(BaseModel):
|
273
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
274
|
+
hidden: Optional[bool] = Field(
|
275
|
+
None, description='Controls whether the response is hidden.'
|
276
|
+
)
|
277
|
+
id: str = Field(
|
278
|
+
...,
|
279
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
280
|
+
)
|
281
|
+
location: Optional[ResponseBlockLocation] = Field(
|
282
|
+
None,
|
283
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
284
|
+
)
|
285
|
+
paramCapture: Optional[str] = Field(
|
286
|
+
None,
|
287
|
+
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.',
|
288
|
+
)
|
289
|
+
placeholder: Optional[str] = Field(
|
290
|
+
None, description='The placeholder text that is displayed in the input.'
|
291
|
+
)
|
292
|
+
prompt: str = Field(
|
293
|
+
...,
|
294
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
295
|
+
)
|
296
|
+
required: bool = Field(
|
297
|
+
..., description='Controls whether the response is required to be answered.'
|
298
|
+
)
|
299
|
+
requiredLabel: Optional[str] = Field(
|
300
|
+
None,
|
301
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
302
|
+
)
|
303
|
+
requiredValue: Optional[Any] = Field(
|
304
|
+
None,
|
305
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
306
|
+
)
|
307
|
+
secondaryText: Optional[str] = Field(
|
308
|
+
None,
|
309
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
310
|
+
)
|
311
|
+
type: Literal['shortText'] # End of class
|
312
|
+
|
313
|
+
|
314
|
+
class ShortTextResponseType(TypedDict):
|
315
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
316
|
+
hidden: Optional[bool] = Field(
|
317
|
+
None, description='Controls whether the response is hidden.'
|
318
|
+
)
|
319
|
+
id: str = Field(
|
320
|
+
...,
|
321
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
322
|
+
)
|
323
|
+
location: Optional[ResponseBlockLocation] = Field(
|
324
|
+
None,
|
325
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
326
|
+
)
|
327
|
+
paramCapture: Optional[str] = Field(
|
328
|
+
None,
|
329
|
+
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.',
|
330
|
+
)
|
331
|
+
placeholder: Optional[str] = Field(
|
332
|
+
None, description='The placeholder text that is displayed in the input.'
|
333
|
+
)
|
334
|
+
prompt: str = Field(
|
335
|
+
...,
|
336
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
337
|
+
)
|
338
|
+
required: bool = Field(
|
339
|
+
..., description='Controls whether the response is required to be answered.'
|
340
|
+
)
|
341
|
+
requiredLabel: Optional[str] = Field(
|
342
|
+
None,
|
343
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
344
|
+
)
|
345
|
+
requiredValue: Optional[Any] = Field(
|
346
|
+
None,
|
347
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
348
|
+
)
|
349
|
+
secondaryText: Optional[str] = Field(
|
350
|
+
None,
|
351
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
352
|
+
)
|
353
|
+
type: Literal['shortText']
|
354
|
+
|
355
|
+
|
356
|
+
class SkipConditions(
|
357
|
+
RootModel[
|
358
|
+
List[
|
359
|
+
Union[
|
360
|
+
IndividualComponentSingleResponseCondition,
|
361
|
+
IndividualComponentAllResponsesCondition,
|
362
|
+
ComponentBlockCondition,
|
363
|
+
RepeatedComponentBlockCondition,
|
364
|
+
]
|
365
|
+
]
|
366
|
+
]
|
367
|
+
):
|
368
|
+
root: List[
|
369
|
+
Union[
|
370
|
+
IndividualComponentSingleResponseCondition,
|
371
|
+
IndividualComponentAllResponsesCondition,
|
372
|
+
ComponentBlockCondition,
|
373
|
+
RepeatedComponentBlockCondition,
|
374
|
+
]
|
375
|
+
] = Field(
|
376
|
+
...,
|
377
|
+
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.',
|
378
|
+
)
|
379
|
+
|
380
|
+
|
381
|
+
# End of class
|
382
|
+
|
383
|
+
|
384
|
+
class SkipConditionsType(TypedDict):
|
385
|
+
root: List[
|
386
|
+
Union[
|
387
|
+
IndividualComponentSingleResponseCondition,
|
388
|
+
IndividualComponentAllResponsesCondition,
|
389
|
+
ComponentBlockCondition,
|
390
|
+
RepeatedComponentBlockCondition,
|
391
|
+
]
|
392
|
+
] = Field(
|
393
|
+
...,
|
394
|
+
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.',
|
395
|
+
)
|
396
|
+
|
397
|
+
|
398
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
399
|
+
|
400
|
+
|
401
|
+
class SliderResponse(BaseModel):
|
402
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
403
|
+
hidden: Optional[bool] = Field(
|
404
|
+
None, description='Controls whether the response is hidden.'
|
405
|
+
)
|
406
|
+
id: str = Field(
|
407
|
+
...,
|
408
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
409
|
+
)
|
410
|
+
location: Optional[ResponseBlockLocation] = Field(
|
411
|
+
None,
|
412
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
413
|
+
)
|
414
|
+
options: List[NumberOption] = Field(
|
415
|
+
...,
|
416
|
+
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.',
|
417
|
+
)
|
418
|
+
paramCapture: Optional[str] = Field(
|
419
|
+
None,
|
420
|
+
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.',
|
421
|
+
)
|
422
|
+
prompt: str = Field(
|
423
|
+
...,
|
424
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
425
|
+
)
|
426
|
+
required: bool = Field(
|
427
|
+
..., description='Controls whether the response is required to be answered.'
|
428
|
+
)
|
429
|
+
requiredLabel: Optional[str] = Field(
|
430
|
+
None,
|
431
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
432
|
+
)
|
433
|
+
requiredValue: Optional[Any] = Field(
|
434
|
+
None,
|
435
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
436
|
+
)
|
437
|
+
secondaryText: Optional[str] = Field(
|
438
|
+
None,
|
439
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
440
|
+
)
|
441
|
+
type: Literal['slider'] # End of class
|
442
|
+
|
443
|
+
|
444
|
+
class SliderResponseType(TypedDict):
|
445
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
446
|
+
hidden: Optional[bool] = Field(
|
447
|
+
None, description='Controls whether the response is hidden.'
|
448
|
+
)
|
449
|
+
id: str = Field(
|
450
|
+
...,
|
451
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
452
|
+
)
|
453
|
+
location: Optional[ResponseBlockLocation] = Field(
|
454
|
+
None,
|
455
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
456
|
+
)
|
457
|
+
options: List[NumberOption] = Field(
|
458
|
+
...,
|
459
|
+
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.',
|
460
|
+
)
|
461
|
+
paramCapture: Optional[str] = Field(
|
462
|
+
None,
|
463
|
+
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.',
|
464
|
+
)
|
465
|
+
prompt: str = Field(
|
466
|
+
...,
|
467
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
468
|
+
)
|
469
|
+
required: bool = Field(
|
470
|
+
..., description='Controls whether the response is required to be answered.'
|
471
|
+
)
|
472
|
+
requiredLabel: Optional[str] = Field(
|
473
|
+
None,
|
474
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
475
|
+
)
|
476
|
+
requiredValue: Optional[Any] = Field(
|
477
|
+
None,
|
478
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
479
|
+
)
|
480
|
+
secondaryText: Optional[str] = Field(
|
481
|
+
None,
|
482
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
483
|
+
)
|
484
|
+
type: Literal['slider']
|
485
|
+
|
486
|
+
|
487
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
488
|
+
|
489
|
+
|
490
|
+
class StringOption(BaseModel):
|
491
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
492
|
+
label: str = Field(..., description='The label displayed to participants.')
|
493
|
+
value: str = Field(
|
494
|
+
..., description="The value stored in the participant's data."
|
495
|
+
) # End of class
|
496
|
+
|
497
|
+
|
498
|
+
class StringOptionType(TypedDict):
|
499
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
500
|
+
label: str = Field(..., description='The label displayed to participants.')
|
501
|
+
value: str = Field(..., description="The value stored in the participant's data.")
|
502
|
+
|
503
|
+
|
504
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
505
|
+
|
506
|
+
|
507
|
+
class StudyMetadata(BaseModel):
|
508
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
509
|
+
authors: List[str] = Field(..., description='The authors of your study.')
|
510
|
+
date: str = Field(
|
511
|
+
..., description='The date of your study, may be useful for the researcher.'
|
512
|
+
)
|
513
|
+
description: str = Field(
|
514
|
+
..., description='The description of your study, shown on the landing page.'
|
515
|
+
)
|
516
|
+
organizations: List[str] = Field(
|
517
|
+
..., description='The organizations that are associated with your study.'
|
518
|
+
)
|
519
|
+
title: str = Field(
|
520
|
+
..., description='The title of your study, shown on the landing page.'
|
521
|
+
)
|
522
|
+
version: str = Field(
|
523
|
+
...,
|
524
|
+
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.',
|
525
|
+
) # End of class
|
526
|
+
|
527
|
+
|
528
|
+
class StudyMetadataType(TypedDict):
|
529
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
530
|
+
authors: List[str] = Field(..., description='The authors of your study.')
|
531
|
+
date: str = Field(
|
532
|
+
..., description='The date of your study, may be useful for the researcher.'
|
533
|
+
)
|
534
|
+
description: str = Field(
|
535
|
+
..., description='The description of your study, shown on the landing page.'
|
536
|
+
)
|
537
|
+
organizations: List[str] = Field(
|
538
|
+
..., description='The organizations that are associated with your study.'
|
539
|
+
)
|
540
|
+
title: str = Field(
|
541
|
+
..., description='The title of your study, shown on the landing page.'
|
542
|
+
)
|
543
|
+
version: str = Field(
|
544
|
+
...,
|
545
|
+
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.',
|
546
|
+
)
|
547
|
+
|
548
|
+
|
549
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
550
|
+
|
551
|
+
|
552
|
+
class UIConfig(BaseModel):
|
553
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
554
|
+
autoDownloadStudy: Optional[bool] = Field(
|
555
|
+
None,
|
556
|
+
description='Controls whether the study data is automatically downloaded at the end of the study.',
|
557
|
+
)
|
558
|
+
autoDownloadTime: Optional[float] = Field(
|
559
|
+
None,
|
560
|
+
description='The time in milliseconds to wait before automatically downloading the study data.',
|
561
|
+
)
|
562
|
+
contactEmail: str = Field(
|
563
|
+
...,
|
564
|
+
description='The email address that used during the study if a participant clicks contact.',
|
565
|
+
)
|
566
|
+
enumerateQuestions: Optional[bool] = Field(
|
567
|
+
None,
|
568
|
+
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.',
|
569
|
+
)
|
570
|
+
helpTextPath: Optional[str] = Field(
|
571
|
+
None,
|
572
|
+
description='The path to the help text file. This is displayed when a participant clicks help. Markdown is supported.',
|
573
|
+
)
|
574
|
+
logoPath: str = Field(
|
575
|
+
...,
|
576
|
+
description='The path to the logo image. This is displayed on the landing page and the header.',
|
577
|
+
)
|
578
|
+
numSequences: Optional[float] = Field(
|
579
|
+
None,
|
580
|
+
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.',
|
581
|
+
)
|
582
|
+
sidebar: bool = Field(
|
583
|
+
...,
|
584
|
+
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.",
|
585
|
+
)
|
586
|
+
sidebarWidth: Optional[float] = Field(
|
587
|
+
None, description='The width of the left sidebar. Defaults to 300.'
|
588
|
+
)
|
589
|
+
studyEndMsg: Optional[str] = Field(
|
590
|
+
None, description='The message to display when the study ends.'
|
591
|
+
)
|
592
|
+
timeoutReject: Optional[bool] = Field(
|
593
|
+
None,
|
594
|
+
description='Whether to redirect a timed out participant to a rejection page. This only works for components where the `nextButtonDisableTime` field is set.',
|
595
|
+
)
|
596
|
+
urlParticipantIdParam: Optional[str] = Field(
|
597
|
+
None,
|
598
|
+
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.',
|
599
|
+
)
|
600
|
+
windowEventDebounceTime: Optional[float] = Field(
|
601
|
+
None,
|
602
|
+
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',
|
603
|
+
)
|
604
|
+
withProgressBar: bool = Field(
|
605
|
+
..., description='Controls whether the progress bar is rendered in the study.'
|
606
|
+
) # End of class
|
607
|
+
|
608
|
+
|
609
|
+
class UIConfigType(TypedDict):
|
610
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
611
|
+
autoDownloadStudy: Optional[bool] = Field(
|
612
|
+
None,
|
613
|
+
description='Controls whether the study data is automatically downloaded at the end of the study.',
|
614
|
+
)
|
615
|
+
autoDownloadTime: Optional[float] = Field(
|
616
|
+
None,
|
617
|
+
description='The time in milliseconds to wait before automatically downloading the study data.',
|
618
|
+
)
|
619
|
+
contactEmail: str = Field(
|
620
|
+
...,
|
621
|
+
description='The email address that used during the study if a participant clicks contact.',
|
622
|
+
)
|
623
|
+
enumerateQuestions: Optional[bool] = Field(
|
624
|
+
None,
|
625
|
+
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.',
|
626
|
+
)
|
627
|
+
helpTextPath: Optional[str] = Field(
|
628
|
+
None,
|
629
|
+
description='The path to the help text file. This is displayed when a participant clicks help. Markdown is supported.',
|
630
|
+
)
|
631
|
+
logoPath: str = Field(
|
632
|
+
...,
|
633
|
+
description='The path to the logo image. This is displayed on the landing page and the header.',
|
634
|
+
)
|
635
|
+
numSequences: Optional[float] = Field(
|
636
|
+
None,
|
637
|
+
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.',
|
638
|
+
)
|
639
|
+
sidebar: bool = Field(
|
640
|
+
...,
|
641
|
+
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.",
|
642
|
+
)
|
643
|
+
sidebarWidth: Optional[float] = Field(
|
644
|
+
None, description='The width of the left sidebar. Defaults to 300.'
|
645
|
+
)
|
646
|
+
studyEndMsg: Optional[str] = Field(
|
647
|
+
None, description='The message to display when the study ends.'
|
648
|
+
)
|
649
|
+
timeoutReject: Optional[bool] = Field(
|
650
|
+
None,
|
651
|
+
description='Whether to redirect a timed out participant to a rejection page. This only works for components where the `nextButtonDisableTime` field is set.',
|
652
|
+
)
|
653
|
+
urlParticipantIdParam: Optional[str] = Field(
|
654
|
+
None,
|
655
|
+
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.',
|
656
|
+
)
|
657
|
+
windowEventDebounceTime: Optional[float] = Field(
|
658
|
+
None,
|
659
|
+
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',
|
660
|
+
)
|
661
|
+
withProgressBar: bool = Field(
|
662
|
+
..., description='Controls whether the progress bar is rendered in the study.'
|
663
|
+
)
|
664
|
+
|
665
|
+
|
666
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
667
|
+
|
668
|
+
|
669
|
+
class CheckboxResponse(BaseModel):
|
670
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
671
|
+
hidden: Optional[bool] = Field(
|
672
|
+
None, description='Controls whether the response is hidden.'
|
673
|
+
)
|
674
|
+
id: str = Field(
|
675
|
+
...,
|
676
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
677
|
+
)
|
678
|
+
location: Optional[ResponseBlockLocation] = Field(
|
679
|
+
None,
|
680
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
681
|
+
)
|
682
|
+
maxSelections: Optional[float] = Field(
|
683
|
+
None, description='The maximum number of selections that are required.'
|
684
|
+
)
|
685
|
+
minSelections: Optional[float] = Field(
|
686
|
+
None, description='The minimum number of selections that are required.'
|
687
|
+
)
|
688
|
+
options: List[Union[StringOption, str]] = Field(
|
689
|
+
...,
|
690
|
+
description='The options that are displayed as checkboxes, provided as an array of objects, with label and value fields.',
|
691
|
+
)
|
692
|
+
paramCapture: Optional[str] = Field(
|
693
|
+
None,
|
694
|
+
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.',
|
695
|
+
)
|
696
|
+
prompt: str = Field(
|
697
|
+
...,
|
698
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
699
|
+
)
|
700
|
+
required: bool = Field(
|
701
|
+
..., description='Controls whether the response is required to be answered.'
|
702
|
+
)
|
703
|
+
requiredLabel: Optional[str] = Field(
|
704
|
+
None,
|
705
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
706
|
+
)
|
707
|
+
requiredValue: Optional[Any] = Field(
|
708
|
+
None,
|
709
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
710
|
+
)
|
711
|
+
secondaryText: Optional[str] = Field(
|
712
|
+
None,
|
713
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
714
|
+
)
|
715
|
+
type: Literal['checkbox'] # End of class
|
716
|
+
|
717
|
+
|
718
|
+
class CheckboxResponseType(TypedDict):
|
719
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
720
|
+
hidden: Optional[bool] = Field(
|
721
|
+
None, description='Controls whether the response is hidden.'
|
722
|
+
)
|
723
|
+
id: str = Field(
|
724
|
+
...,
|
725
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
726
|
+
)
|
727
|
+
location: Optional[ResponseBlockLocation] = Field(
|
728
|
+
None,
|
729
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
730
|
+
)
|
731
|
+
maxSelections: Optional[float] = Field(
|
732
|
+
None, description='The maximum number of selections that are required.'
|
733
|
+
)
|
734
|
+
minSelections: Optional[float] = Field(
|
735
|
+
None, description='The minimum number of selections that are required.'
|
736
|
+
)
|
737
|
+
options: List[Union[StringOption, str]] = Field(
|
738
|
+
...,
|
739
|
+
description='The options that are displayed as checkboxes, provided as an array of objects, with label and value fields.',
|
740
|
+
)
|
741
|
+
paramCapture: Optional[str] = Field(
|
742
|
+
None,
|
743
|
+
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.',
|
744
|
+
)
|
745
|
+
prompt: str = Field(
|
746
|
+
...,
|
747
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
748
|
+
)
|
749
|
+
required: bool = Field(
|
750
|
+
..., description='Controls whether the response is required to be answered.'
|
751
|
+
)
|
752
|
+
requiredLabel: Optional[str] = Field(
|
753
|
+
None,
|
754
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
755
|
+
)
|
756
|
+
requiredValue: Optional[Any] = Field(
|
757
|
+
None,
|
758
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
759
|
+
)
|
760
|
+
secondaryText: Optional[str] = Field(
|
761
|
+
None,
|
762
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
763
|
+
)
|
764
|
+
type: Literal['checkbox']
|
765
|
+
|
766
|
+
|
767
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
768
|
+
|
769
|
+
|
770
|
+
class DropdownResponse(BaseModel):
|
771
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
772
|
+
hidden: Optional[bool] = Field(
|
773
|
+
None, description='Controls whether the response is hidden.'
|
774
|
+
)
|
775
|
+
id: str = Field(
|
776
|
+
...,
|
777
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
778
|
+
)
|
779
|
+
location: Optional[ResponseBlockLocation] = Field(
|
780
|
+
None,
|
781
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
782
|
+
)
|
783
|
+
options: List[Union[StringOption, str]] = Field(
|
784
|
+
..., description='The options that are displayed in the dropdown.'
|
785
|
+
)
|
786
|
+
paramCapture: Optional[str] = Field(
|
787
|
+
None,
|
788
|
+
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.',
|
789
|
+
)
|
790
|
+
placeholder: Optional[str] = Field(
|
791
|
+
None, description='The placeholder text that is displayed in the input.'
|
792
|
+
)
|
793
|
+
prompt: str = Field(
|
794
|
+
...,
|
795
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
796
|
+
)
|
797
|
+
required: bool = Field(
|
798
|
+
..., description='Controls whether the response is required to be answered.'
|
799
|
+
)
|
800
|
+
requiredLabel: Optional[str] = Field(
|
801
|
+
None,
|
802
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
803
|
+
)
|
804
|
+
requiredValue: Optional[Any] = Field(
|
805
|
+
None,
|
806
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
807
|
+
)
|
808
|
+
secondaryText: Optional[str] = Field(
|
809
|
+
None,
|
810
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
811
|
+
)
|
812
|
+
type: Literal['dropdown'] # End of class
|
813
|
+
|
814
|
+
|
815
|
+
class DropdownResponseType(TypedDict):
|
816
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
817
|
+
hidden: Optional[bool] = Field(
|
818
|
+
None, description='Controls whether the response is hidden.'
|
819
|
+
)
|
820
|
+
id: str = Field(
|
821
|
+
...,
|
822
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
823
|
+
)
|
824
|
+
location: Optional[ResponseBlockLocation] = Field(
|
825
|
+
None,
|
826
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
827
|
+
)
|
828
|
+
options: List[Union[StringOption, str]] = Field(
|
829
|
+
..., description='The options that are displayed in the dropdown.'
|
830
|
+
)
|
831
|
+
paramCapture: Optional[str] = Field(
|
832
|
+
None,
|
833
|
+
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.',
|
834
|
+
)
|
835
|
+
placeholder: Optional[str] = Field(
|
836
|
+
None, description='The placeholder text that is displayed in the input.'
|
837
|
+
)
|
838
|
+
prompt: str = Field(
|
839
|
+
...,
|
840
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
841
|
+
)
|
842
|
+
required: bool = Field(
|
843
|
+
..., description='Controls whether the response is required to be answered.'
|
844
|
+
)
|
845
|
+
requiredLabel: Optional[str] = Field(
|
846
|
+
None,
|
847
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
848
|
+
)
|
849
|
+
requiredValue: Optional[Any] = Field(
|
850
|
+
None,
|
851
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
852
|
+
)
|
853
|
+
secondaryText: Optional[str] = Field(
|
854
|
+
None,
|
855
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
856
|
+
)
|
857
|
+
type: Literal['dropdown']
|
858
|
+
|
859
|
+
|
860
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
861
|
+
|
862
|
+
|
863
|
+
class IFrameResponse(BaseModel):
|
864
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
865
|
+
hidden: Optional[bool] = Field(
|
866
|
+
None, description='Controls whether the response is hidden.'
|
867
|
+
)
|
868
|
+
id: str = Field(
|
869
|
+
...,
|
870
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
871
|
+
)
|
872
|
+
location: Optional[ResponseBlockLocation] = Field(
|
873
|
+
None,
|
874
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
875
|
+
)
|
876
|
+
paramCapture: Optional[str] = Field(
|
877
|
+
None,
|
878
|
+
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.',
|
879
|
+
)
|
880
|
+
prompt: str = Field(
|
881
|
+
...,
|
882
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
883
|
+
)
|
884
|
+
required: bool = Field(
|
885
|
+
..., description='Controls whether the response is required to be answered.'
|
886
|
+
)
|
887
|
+
requiredLabel: Optional[str] = Field(
|
888
|
+
None,
|
889
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
890
|
+
)
|
891
|
+
requiredValue: Optional[Any] = Field(
|
892
|
+
None,
|
893
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
894
|
+
)
|
895
|
+
secondaryText: Optional[str] = Field(
|
896
|
+
None,
|
897
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
898
|
+
)
|
899
|
+
type: Literal['iframe'] # End of class
|
900
|
+
|
901
|
+
|
902
|
+
class IFrameResponseType(TypedDict):
|
903
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
904
|
+
hidden: Optional[bool] = Field(
|
905
|
+
None, description='Controls whether the response is hidden.'
|
906
|
+
)
|
907
|
+
id: str = Field(
|
908
|
+
...,
|
909
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
910
|
+
)
|
911
|
+
location: Optional[ResponseBlockLocation] = Field(
|
912
|
+
None,
|
913
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
914
|
+
)
|
915
|
+
paramCapture: Optional[str] = Field(
|
916
|
+
None,
|
917
|
+
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.',
|
918
|
+
)
|
919
|
+
prompt: str = Field(
|
920
|
+
...,
|
921
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
922
|
+
)
|
923
|
+
required: bool = Field(
|
924
|
+
..., description='Controls whether the response is required to be answered.'
|
925
|
+
)
|
926
|
+
requiredLabel: Optional[str] = Field(
|
927
|
+
None,
|
928
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
929
|
+
)
|
930
|
+
requiredValue: Optional[Any] = Field(
|
931
|
+
None,
|
932
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
933
|
+
)
|
934
|
+
secondaryText: Optional[str] = Field(
|
935
|
+
None,
|
936
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
937
|
+
)
|
938
|
+
type: Literal['iframe']
|
939
|
+
|
940
|
+
|
941
|
+
class InterruptionBlock(
|
942
|
+
RootModel[Union[DeterministicInterruption, RandomInterruption]]
|
943
|
+
):
|
944
|
+
root: Union[DeterministicInterruption, RandomInterruption] = Field(
|
945
|
+
...,
|
946
|
+
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.',
|
947
|
+
)
|
948
|
+
|
949
|
+
|
950
|
+
# End of class
|
951
|
+
|
952
|
+
|
953
|
+
class InterruptionBlockType(TypedDict):
|
954
|
+
root: Union[DeterministicInterruption, RandomInterruption] = Field(
|
955
|
+
...,
|
956
|
+
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.',
|
957
|
+
)
|
958
|
+
|
959
|
+
|
960
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
961
|
+
|
962
|
+
|
963
|
+
class LikertResponse(BaseModel):
|
964
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
965
|
+
hidden: Optional[bool] = Field(
|
966
|
+
None, description='Controls whether the response is hidden.'
|
967
|
+
)
|
968
|
+
id: str = Field(
|
969
|
+
...,
|
970
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
971
|
+
)
|
972
|
+
leftLabel: Optional[str] = Field(
|
973
|
+
None, description='The left label of the likert scale. E.g Strongly Disagree'
|
974
|
+
)
|
975
|
+
location: Optional[ResponseBlockLocation] = Field(
|
976
|
+
None,
|
977
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
978
|
+
)
|
979
|
+
numItems: float = Field(..., description='The number of options to render.')
|
980
|
+
paramCapture: Optional[str] = Field(
|
981
|
+
None,
|
982
|
+
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.',
|
983
|
+
)
|
984
|
+
prompt: str = Field(
|
985
|
+
...,
|
986
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
987
|
+
)
|
988
|
+
required: bool = Field(
|
989
|
+
..., description='Controls whether the response is required to be answered.'
|
990
|
+
)
|
991
|
+
requiredLabel: Optional[str] = Field(
|
992
|
+
None,
|
993
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
994
|
+
)
|
995
|
+
requiredValue: Optional[Any] = Field(
|
996
|
+
None,
|
997
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
998
|
+
)
|
999
|
+
rightLabel: Optional[str] = Field(
|
1000
|
+
None, description='The right label of the likert scale. E.g Strongly Agree'
|
1001
|
+
)
|
1002
|
+
secondaryText: Optional[str] = Field(
|
1003
|
+
None,
|
1004
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
1005
|
+
)
|
1006
|
+
type: Literal['likert'] # End of class
|
1007
|
+
|
1008
|
+
|
1009
|
+
class LikertResponseType(TypedDict):
|
1010
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1011
|
+
hidden: Optional[bool] = Field(
|
1012
|
+
None, description='Controls whether the response is hidden.'
|
1013
|
+
)
|
1014
|
+
id: str = Field(
|
1015
|
+
...,
|
1016
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
1017
|
+
)
|
1018
|
+
leftLabel: Optional[str] = Field(
|
1019
|
+
None, description='The left label of the likert scale. E.g Strongly Disagree'
|
1020
|
+
)
|
1021
|
+
location: Optional[ResponseBlockLocation] = Field(
|
1022
|
+
None,
|
1023
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
1024
|
+
)
|
1025
|
+
numItems: float = Field(..., description='The number of options to render.')
|
1026
|
+
paramCapture: Optional[str] = Field(
|
1027
|
+
None,
|
1028
|
+
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.',
|
1029
|
+
)
|
1030
|
+
prompt: str = Field(
|
1031
|
+
...,
|
1032
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
1033
|
+
)
|
1034
|
+
required: bool = Field(
|
1035
|
+
..., description='Controls whether the response is required to be answered.'
|
1036
|
+
)
|
1037
|
+
requiredLabel: Optional[str] = Field(
|
1038
|
+
None,
|
1039
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
1040
|
+
)
|
1041
|
+
requiredValue: Optional[Any] = Field(
|
1042
|
+
None,
|
1043
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
1044
|
+
)
|
1045
|
+
rightLabel: Optional[str] = Field(
|
1046
|
+
None, description='The right label of the likert scale. E.g Strongly Agree'
|
1047
|
+
)
|
1048
|
+
secondaryText: Optional[str] = Field(
|
1049
|
+
None,
|
1050
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
1051
|
+
)
|
1052
|
+
type: Literal['likert']
|
1053
|
+
|
1054
|
+
|
1055
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
1056
|
+
|
1057
|
+
|
1058
|
+
class LongTextResponse(BaseModel):
|
1059
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1060
|
+
hidden: Optional[bool] = Field(
|
1061
|
+
None, description='Controls whether the response is hidden.'
|
1062
|
+
)
|
1063
|
+
id: str = Field(
|
1064
|
+
...,
|
1065
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
1066
|
+
)
|
1067
|
+
location: Optional[ResponseBlockLocation] = Field(
|
1068
|
+
None,
|
1069
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
1070
|
+
)
|
1071
|
+
paramCapture: Optional[str] = Field(
|
1072
|
+
None,
|
1073
|
+
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.',
|
1074
|
+
)
|
1075
|
+
placeholder: Optional[str] = Field(
|
1076
|
+
None, description='The placeholder text that is displayed in the input.'
|
1077
|
+
)
|
1078
|
+
prompt: str = Field(
|
1079
|
+
...,
|
1080
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
1081
|
+
)
|
1082
|
+
required: bool = Field(
|
1083
|
+
..., description='Controls whether the response is required to be answered.'
|
1084
|
+
)
|
1085
|
+
requiredLabel: Optional[str] = Field(
|
1086
|
+
None,
|
1087
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
1088
|
+
)
|
1089
|
+
requiredValue: Optional[Any] = Field(
|
1090
|
+
None,
|
1091
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
1092
|
+
)
|
1093
|
+
secondaryText: Optional[str] = Field(
|
1094
|
+
None,
|
1095
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
1096
|
+
)
|
1097
|
+
type: Literal['longText'] # End of class
|
1098
|
+
|
1099
|
+
|
1100
|
+
class LongTextResponseType(TypedDict):
|
1101
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1102
|
+
hidden: Optional[bool] = Field(
|
1103
|
+
None, description='Controls whether the response is hidden.'
|
1104
|
+
)
|
1105
|
+
id: str = Field(
|
1106
|
+
...,
|
1107
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
1108
|
+
)
|
1109
|
+
location: Optional[ResponseBlockLocation] = Field(
|
1110
|
+
None,
|
1111
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
1112
|
+
)
|
1113
|
+
paramCapture: Optional[str] = Field(
|
1114
|
+
None,
|
1115
|
+
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.',
|
1116
|
+
)
|
1117
|
+
placeholder: Optional[str] = Field(
|
1118
|
+
None, description='The placeholder text that is displayed in the input.'
|
1119
|
+
)
|
1120
|
+
prompt: str = Field(
|
1121
|
+
...,
|
1122
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
1123
|
+
)
|
1124
|
+
required: bool = Field(
|
1125
|
+
..., description='Controls whether the response is required to be answered.'
|
1126
|
+
)
|
1127
|
+
requiredLabel: Optional[str] = Field(
|
1128
|
+
None,
|
1129
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
1130
|
+
)
|
1131
|
+
requiredValue: Optional[Any] = Field(
|
1132
|
+
None,
|
1133
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
1134
|
+
)
|
1135
|
+
secondaryText: Optional[str] = Field(
|
1136
|
+
None,
|
1137
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
1138
|
+
)
|
1139
|
+
type: Literal['longText']
|
1140
|
+
|
1141
|
+
|
1142
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
1143
|
+
|
1144
|
+
|
1145
|
+
class MatrixResponse(BaseModel):
|
1146
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1147
|
+
answerOptions: Union[List[str], str] = Field(
|
1148
|
+
...,
|
1149
|
+
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.',
|
1150
|
+
)
|
1151
|
+
hidden: Optional[bool] = Field(
|
1152
|
+
None, description='Controls whether the response is hidden.'
|
1153
|
+
)
|
1154
|
+
id: str = Field(
|
1155
|
+
...,
|
1156
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
1157
|
+
)
|
1158
|
+
location: Optional[ResponseBlockLocation] = Field(
|
1159
|
+
None,
|
1160
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
1161
|
+
)
|
1162
|
+
paramCapture: Optional[str] = Field(
|
1163
|
+
None,
|
1164
|
+
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.',
|
1165
|
+
)
|
1166
|
+
prompt: str = Field(
|
1167
|
+
...,
|
1168
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
1169
|
+
)
|
1170
|
+
questionOptions: List[str] = Field(
|
1171
|
+
...,
|
1172
|
+
description="The question options (rows) are the prompts for each response you'd like to record.",
|
1173
|
+
)
|
1174
|
+
required: bool = Field(
|
1175
|
+
..., description='Controls whether the response is required to be answered.'
|
1176
|
+
)
|
1177
|
+
requiredLabel: Optional[str] = Field(
|
1178
|
+
None,
|
1179
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
1180
|
+
)
|
1181
|
+
requiredValue: Optional[Any] = Field(
|
1182
|
+
None,
|
1183
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
1184
|
+
)
|
1185
|
+
secondaryText: Optional[str] = Field(
|
1186
|
+
None,
|
1187
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
1188
|
+
)
|
1189
|
+
type: Type2 # End of class
|
1190
|
+
|
1191
|
+
|
1192
|
+
class MatrixResponseType(TypedDict):
|
1193
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1194
|
+
answerOptions: Union[List[str], str] = Field(
|
1195
|
+
...,
|
1196
|
+
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.',
|
1197
|
+
)
|
1198
|
+
hidden: Optional[bool] = Field(
|
1199
|
+
None, description='Controls whether the response is hidden.'
|
1200
|
+
)
|
1201
|
+
id: str = Field(
|
1202
|
+
...,
|
1203
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
1204
|
+
)
|
1205
|
+
location: Optional[ResponseBlockLocation] = Field(
|
1206
|
+
None,
|
1207
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
1208
|
+
)
|
1209
|
+
paramCapture: Optional[str] = Field(
|
1210
|
+
None,
|
1211
|
+
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.',
|
1212
|
+
)
|
1213
|
+
prompt: str = Field(
|
1214
|
+
...,
|
1215
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
1216
|
+
)
|
1217
|
+
questionOptions: List[str] = Field(
|
1218
|
+
...,
|
1219
|
+
description="The question options (rows) are the prompts for each response you'd like to record.",
|
1220
|
+
)
|
1221
|
+
required: bool = Field(
|
1222
|
+
..., description='Controls whether the response is required to be answered.'
|
1223
|
+
)
|
1224
|
+
requiredLabel: Optional[str] = Field(
|
1225
|
+
None,
|
1226
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
1227
|
+
)
|
1228
|
+
requiredValue: Optional[Any] = Field(
|
1229
|
+
None,
|
1230
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
1231
|
+
)
|
1232
|
+
secondaryText: Optional[str] = Field(
|
1233
|
+
None,
|
1234
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
1235
|
+
)
|
1236
|
+
type: Type2
|
1237
|
+
|
1238
|
+
|
1239
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
1240
|
+
|
1241
|
+
|
1242
|
+
class NumericalResponse(BaseModel):
|
1243
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1244
|
+
hidden: Optional[bool] = Field(
|
1245
|
+
None, description='Controls whether the response is hidden.'
|
1246
|
+
)
|
1247
|
+
id: str = Field(
|
1248
|
+
...,
|
1249
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
1250
|
+
)
|
1251
|
+
location: Optional[ResponseBlockLocation] = Field(
|
1252
|
+
None,
|
1253
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
1254
|
+
)
|
1255
|
+
max: Optional[float] = Field(
|
1256
|
+
None, description='The maximum value that is accepted in the input.'
|
1257
|
+
)
|
1258
|
+
min: Optional[float] = Field(
|
1259
|
+
None, description='The minimum value that is accepted in the input.'
|
1260
|
+
)
|
1261
|
+
paramCapture: Optional[str] = Field(
|
1262
|
+
None,
|
1263
|
+
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.',
|
1264
|
+
)
|
1265
|
+
placeholder: Optional[str] = Field(
|
1266
|
+
None, description='The placeholder text that is displayed in the input.'
|
1267
|
+
)
|
1268
|
+
prompt: str = Field(
|
1269
|
+
...,
|
1270
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
1271
|
+
)
|
1272
|
+
required: bool = Field(
|
1273
|
+
..., description='Controls whether the response is required to be answered.'
|
1274
|
+
)
|
1275
|
+
requiredLabel: Optional[str] = Field(
|
1276
|
+
None,
|
1277
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
1278
|
+
)
|
1279
|
+
requiredValue: Optional[Any] = Field(
|
1280
|
+
None,
|
1281
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
1282
|
+
)
|
1283
|
+
secondaryText: Optional[str] = Field(
|
1284
|
+
None,
|
1285
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
1286
|
+
)
|
1287
|
+
type: Literal['numerical'] # End of class
|
1288
|
+
|
1289
|
+
|
1290
|
+
class NumericalResponseType(TypedDict):
|
1291
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1292
|
+
hidden: Optional[bool] = Field(
|
1293
|
+
None, description='Controls whether the response is hidden.'
|
1294
|
+
)
|
1295
|
+
id: str = Field(
|
1296
|
+
...,
|
1297
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
1298
|
+
)
|
1299
|
+
location: Optional[ResponseBlockLocation] = Field(
|
1300
|
+
None,
|
1301
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
1302
|
+
)
|
1303
|
+
max: Optional[float] = Field(
|
1304
|
+
None, description='The maximum value that is accepted in the input.'
|
1305
|
+
)
|
1306
|
+
min: Optional[float] = Field(
|
1307
|
+
None, description='The minimum value that is accepted in the input.'
|
1308
|
+
)
|
1309
|
+
paramCapture: Optional[str] = Field(
|
1310
|
+
None,
|
1311
|
+
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.',
|
1312
|
+
)
|
1313
|
+
placeholder: Optional[str] = Field(
|
1314
|
+
None, description='The placeholder text that is displayed in the input.'
|
1315
|
+
)
|
1316
|
+
prompt: str = Field(
|
1317
|
+
...,
|
1318
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
1319
|
+
)
|
1320
|
+
required: bool = Field(
|
1321
|
+
..., description='Controls whether the response is required to be answered.'
|
1322
|
+
)
|
1323
|
+
requiredLabel: Optional[str] = Field(
|
1324
|
+
None,
|
1325
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
1326
|
+
)
|
1327
|
+
requiredValue: Optional[Any] = Field(
|
1328
|
+
None,
|
1329
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
1330
|
+
)
|
1331
|
+
secondaryText: Optional[str] = Field(
|
1332
|
+
None,
|
1333
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
1334
|
+
)
|
1335
|
+
type: Literal['numerical']
|
1336
|
+
|
1337
|
+
|
1338
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
1339
|
+
|
1340
|
+
|
1341
|
+
class RadioResponse(BaseModel):
|
1342
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1343
|
+
hidden: Optional[bool] = Field(
|
1344
|
+
None, description='Controls whether the response is hidden.'
|
1345
|
+
)
|
1346
|
+
id: str = Field(
|
1347
|
+
...,
|
1348
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
1349
|
+
)
|
1350
|
+
leftLabel: Optional[str] = Field(
|
1351
|
+
None,
|
1352
|
+
description='The left label of the radio group. Used in Likert scales for example',
|
1353
|
+
)
|
1354
|
+
location: Optional[ResponseBlockLocation] = Field(
|
1355
|
+
None,
|
1356
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
1357
|
+
)
|
1358
|
+
options: List[Union[StringOption, str]] = Field(
|
1359
|
+
...,
|
1360
|
+
description='The options that are displayed as checkboxes, provided as an array of objects, with label and value fields.',
|
1361
|
+
)
|
1362
|
+
paramCapture: Optional[str] = Field(
|
1363
|
+
None,
|
1364
|
+
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.',
|
1365
|
+
)
|
1366
|
+
prompt: str = Field(
|
1367
|
+
...,
|
1368
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
1369
|
+
)
|
1370
|
+
required: bool = Field(
|
1371
|
+
..., description='Controls whether the response is required to be answered.'
|
1372
|
+
)
|
1373
|
+
requiredLabel: Optional[str] = Field(
|
1374
|
+
None,
|
1375
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
1376
|
+
)
|
1377
|
+
requiredValue: Optional[Any] = Field(
|
1378
|
+
None,
|
1379
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
1380
|
+
)
|
1381
|
+
rightLabel: Optional[str] = Field(
|
1382
|
+
None,
|
1383
|
+
description='The right label of the radio group. Used in Likert scales for example',
|
1384
|
+
)
|
1385
|
+
secondaryText: Optional[str] = Field(
|
1386
|
+
None,
|
1387
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
1388
|
+
)
|
1389
|
+
type: Literal['radio'] # End of class
|
1390
|
+
|
1391
|
+
|
1392
|
+
class RadioResponseType(TypedDict):
|
1393
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1394
|
+
hidden: Optional[bool] = Field(
|
1395
|
+
None, description='Controls whether the response is hidden.'
|
1396
|
+
)
|
1397
|
+
id: str = Field(
|
1398
|
+
...,
|
1399
|
+
description='The id of the response. This is used to identify the response in the data file.',
|
1400
|
+
)
|
1401
|
+
leftLabel: Optional[str] = Field(
|
1402
|
+
None,
|
1403
|
+
description='The left label of the radio group. Used in Likert scales for example',
|
1404
|
+
)
|
1405
|
+
location: Optional[ResponseBlockLocation] = Field(
|
1406
|
+
None,
|
1407
|
+
description='Controls the response location. These might be the same for all responses, or differ across responses. Defaults to `belowStimulus`',
|
1408
|
+
)
|
1409
|
+
options: List[Union[StringOption, str]] = Field(
|
1410
|
+
...,
|
1411
|
+
description='The options that are displayed as checkboxes, provided as an array of objects, with label and value fields.',
|
1412
|
+
)
|
1413
|
+
paramCapture: Optional[str] = Field(
|
1414
|
+
None,
|
1415
|
+
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.',
|
1416
|
+
)
|
1417
|
+
prompt: str = Field(
|
1418
|
+
...,
|
1419
|
+
description='The prompt that is displayed to the participant. You can use markdown here to render images, links, etc.',
|
1420
|
+
)
|
1421
|
+
required: bool = Field(
|
1422
|
+
..., description='Controls whether the response is required to be answered.'
|
1423
|
+
)
|
1424
|
+
requiredLabel: Optional[str] = Field(
|
1425
|
+
None,
|
1426
|
+
description='You can provide a required label, which makes it so a participant has to answer with a response that matches label.',
|
1427
|
+
)
|
1428
|
+
requiredValue: Optional[Any] = Field(
|
1429
|
+
None,
|
1430
|
+
description='You can provide a required value, which makes it so a participant has to answer with that value.',
|
1431
|
+
)
|
1432
|
+
rightLabel: Optional[str] = Field(
|
1433
|
+
None,
|
1434
|
+
description='The right label of the radio group. Used in Likert scales for example',
|
1435
|
+
)
|
1436
|
+
secondaryText: Optional[str] = Field(
|
1437
|
+
None,
|
1438
|
+
description='The secondary text that is displayed to the participant under the prompt. This does not accept markdown.',
|
1439
|
+
)
|
1440
|
+
type: Literal['radio']
|
1441
|
+
|
1442
|
+
|
1443
|
+
class Response(
|
1444
|
+
RootModel[
|
1445
|
+
Union[
|
1446
|
+
NumericalResponse,
|
1447
|
+
ShortTextResponse,
|
1448
|
+
LongTextResponse,
|
1449
|
+
LikertResponse,
|
1450
|
+
DropdownResponse,
|
1451
|
+
SliderResponse,
|
1452
|
+
RadioResponse,
|
1453
|
+
CheckboxResponse,
|
1454
|
+
IFrameResponse,
|
1455
|
+
MatrixResponse,
|
1456
|
+
]
|
1457
|
+
]
|
1458
|
+
):
|
1459
|
+
root: Union[
|
1460
|
+
NumericalResponse,
|
1461
|
+
ShortTextResponse,
|
1462
|
+
LongTextResponse,
|
1463
|
+
LikertResponse,
|
1464
|
+
DropdownResponse,
|
1465
|
+
SliderResponse,
|
1466
|
+
RadioResponse,
|
1467
|
+
CheckboxResponse,
|
1468
|
+
IFrameResponse,
|
1469
|
+
MatrixResponse,
|
1470
|
+
]
|
1471
|
+
|
1472
|
+
|
1473
|
+
# End of class
|
1474
|
+
|
1475
|
+
|
1476
|
+
class ResponseType(TypedDict):
|
1477
|
+
root: Union[
|
1478
|
+
NumericalResponse,
|
1479
|
+
ShortTextResponse,
|
1480
|
+
LongTextResponse,
|
1481
|
+
LikertResponse,
|
1482
|
+
DropdownResponse,
|
1483
|
+
SliderResponse,
|
1484
|
+
RadioResponse,
|
1485
|
+
CheckboxResponse,
|
1486
|
+
IFrameResponse,
|
1487
|
+
MatrixResponse,
|
1488
|
+
]
|
1489
|
+
|
1490
|
+
|
1491
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
1492
|
+
|
1493
|
+
|
1494
|
+
class VegaComponentConfig(BaseModel):
|
1495
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1496
|
+
allowFailedTraining: Optional[bool] = Field(
|
1497
|
+
None,
|
1498
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
1499
|
+
)
|
1500
|
+
config: Dict[str, Any] = Field(..., description='The vega-lite configuration.')
|
1501
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
1502
|
+
None,
|
1503
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
1504
|
+
)
|
1505
|
+
description: Optional[str] = Field(
|
1506
|
+
None,
|
1507
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1508
|
+
)
|
1509
|
+
instruction: Optional[str] = Field(
|
1510
|
+
None,
|
1511
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1512
|
+
)
|
1513
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
1514
|
+
None, description='The location of the instructions.'
|
1515
|
+
)
|
1516
|
+
meta: Optional[Dict[str, Any]] = Field(
|
1517
|
+
None,
|
1518
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1519
|
+
)
|
1520
|
+
nextButtonDisableTime: Optional[float] = Field(
|
1521
|
+
None,
|
1522
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
1523
|
+
)
|
1524
|
+
nextButtonEnableTime: Optional[float] = Field(
|
1525
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
1526
|
+
)
|
1527
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
1528
|
+
None, description='The location of the next button.'
|
1529
|
+
)
|
1530
|
+
nextButtonText: Optional[str] = Field(
|
1531
|
+
None, description='The text that is displayed on the next button.'
|
1532
|
+
)
|
1533
|
+
provideFeedback: Optional[bool] = Field(
|
1534
|
+
None,
|
1535
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
1536
|
+
)
|
1537
|
+
recordAudio: Optional[bool] = Field(
|
1538
|
+
None,
|
1539
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
1540
|
+
)
|
1541
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
1542
|
+
trainingAttempts: Optional[float] = Field(
|
1543
|
+
None,
|
1544
|
+
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.',
|
1545
|
+
)
|
1546
|
+
type: Literal['vega'] # End of class
|
1547
|
+
|
1548
|
+
|
1549
|
+
class VegaComponentConfigType(TypedDict):
|
1550
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1551
|
+
allowFailedTraining: Optional[bool] = Field(
|
1552
|
+
None,
|
1553
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
1554
|
+
)
|
1555
|
+
config: Dict[str, Any] = Field(..., description='The vega-lite configuration.')
|
1556
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
1557
|
+
None,
|
1558
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
1559
|
+
)
|
1560
|
+
description: Optional[str] = Field(
|
1561
|
+
None,
|
1562
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1563
|
+
)
|
1564
|
+
instruction: Optional[str] = Field(
|
1565
|
+
None,
|
1566
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1567
|
+
)
|
1568
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
1569
|
+
None, description='The location of the instructions.'
|
1570
|
+
)
|
1571
|
+
meta: Optional[Dict[str, Any]] = Field(
|
1572
|
+
None,
|
1573
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1574
|
+
)
|
1575
|
+
nextButtonDisableTime: Optional[float] = Field(
|
1576
|
+
None,
|
1577
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
1578
|
+
)
|
1579
|
+
nextButtonEnableTime: Optional[float] = Field(
|
1580
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
1581
|
+
)
|
1582
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
1583
|
+
None, description='The location of the next button.'
|
1584
|
+
)
|
1585
|
+
nextButtonText: Optional[str] = Field(
|
1586
|
+
None, description='The text that is displayed on the next button.'
|
1587
|
+
)
|
1588
|
+
provideFeedback: Optional[bool] = Field(
|
1589
|
+
None,
|
1590
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
1591
|
+
)
|
1592
|
+
recordAudio: Optional[bool] = Field(
|
1593
|
+
None,
|
1594
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
1595
|
+
)
|
1596
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
1597
|
+
trainingAttempts: Optional[float] = Field(
|
1598
|
+
None,
|
1599
|
+
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.',
|
1600
|
+
)
|
1601
|
+
type: Literal['vega']
|
1602
|
+
|
1603
|
+
|
1604
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
1605
|
+
|
1606
|
+
|
1607
|
+
class VegaComponentPath(BaseModel):
|
1608
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1609
|
+
allowFailedTraining: Optional[bool] = Field(
|
1610
|
+
None,
|
1611
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
1612
|
+
)
|
1613
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
1614
|
+
None,
|
1615
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
1616
|
+
)
|
1617
|
+
description: Optional[str] = Field(
|
1618
|
+
None,
|
1619
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1620
|
+
)
|
1621
|
+
instruction: Optional[str] = Field(
|
1622
|
+
None,
|
1623
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1624
|
+
)
|
1625
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
1626
|
+
None, description='The location of the instructions.'
|
1627
|
+
)
|
1628
|
+
meta: Optional[Dict[str, Any]] = Field(
|
1629
|
+
None,
|
1630
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1631
|
+
)
|
1632
|
+
nextButtonDisableTime: Optional[float] = Field(
|
1633
|
+
None,
|
1634
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
1635
|
+
)
|
1636
|
+
nextButtonEnableTime: Optional[float] = Field(
|
1637
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
1638
|
+
)
|
1639
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
1640
|
+
None, description='The location of the next button.'
|
1641
|
+
)
|
1642
|
+
nextButtonText: Optional[str] = Field(
|
1643
|
+
None, description='The text that is displayed on the next button.'
|
1644
|
+
)
|
1645
|
+
path: str = Field(
|
1646
|
+
...,
|
1647
|
+
description='The path to the vega file. This should be a relative path from the public folder.',
|
1648
|
+
)
|
1649
|
+
provideFeedback: Optional[bool] = Field(
|
1650
|
+
None,
|
1651
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
1652
|
+
)
|
1653
|
+
recordAudio: Optional[bool] = Field(
|
1654
|
+
None,
|
1655
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
1656
|
+
)
|
1657
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
1658
|
+
trainingAttempts: Optional[float] = Field(
|
1659
|
+
None,
|
1660
|
+
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.',
|
1661
|
+
)
|
1662
|
+
type: Literal['vega'] # End of class
|
1663
|
+
|
1664
|
+
|
1665
|
+
class VegaComponentPathType(TypedDict):
|
1666
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1667
|
+
allowFailedTraining: Optional[bool] = Field(
|
1668
|
+
None,
|
1669
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
1670
|
+
)
|
1671
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
1672
|
+
None,
|
1673
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
1674
|
+
)
|
1675
|
+
description: Optional[str] = Field(
|
1676
|
+
None,
|
1677
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1678
|
+
)
|
1679
|
+
instruction: Optional[str] = Field(
|
1680
|
+
None,
|
1681
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1682
|
+
)
|
1683
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
1684
|
+
None, description='The location of the instructions.'
|
1685
|
+
)
|
1686
|
+
meta: Optional[Dict[str, Any]] = Field(
|
1687
|
+
None,
|
1688
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1689
|
+
)
|
1690
|
+
nextButtonDisableTime: Optional[float] = Field(
|
1691
|
+
None,
|
1692
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
1693
|
+
)
|
1694
|
+
nextButtonEnableTime: Optional[float] = Field(
|
1695
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
1696
|
+
)
|
1697
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
1698
|
+
None, description='The location of the next button.'
|
1699
|
+
)
|
1700
|
+
nextButtonText: Optional[str] = Field(
|
1701
|
+
None, description='The text that is displayed on the next button.'
|
1702
|
+
)
|
1703
|
+
path: str = Field(
|
1704
|
+
...,
|
1705
|
+
description='The path to the vega file. This should be a relative path from the public folder.',
|
1706
|
+
)
|
1707
|
+
provideFeedback: Optional[bool] = Field(
|
1708
|
+
None,
|
1709
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
1710
|
+
)
|
1711
|
+
recordAudio: Optional[bool] = Field(
|
1712
|
+
None,
|
1713
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
1714
|
+
)
|
1715
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
1716
|
+
trainingAttempts: Optional[float] = Field(
|
1717
|
+
None,
|
1718
|
+
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.',
|
1719
|
+
)
|
1720
|
+
type: Literal['vega']
|
1721
|
+
|
1722
|
+
|
1723
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
1724
|
+
|
1725
|
+
|
1726
|
+
class WebsiteComponent(BaseModel):
|
1727
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1728
|
+
allowFailedTraining: Optional[bool] = Field(
|
1729
|
+
None,
|
1730
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
1731
|
+
)
|
1732
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
1733
|
+
None,
|
1734
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
1735
|
+
)
|
1736
|
+
description: Optional[str] = Field(
|
1737
|
+
None,
|
1738
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1739
|
+
)
|
1740
|
+
instruction: Optional[str] = Field(
|
1741
|
+
None,
|
1742
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1743
|
+
)
|
1744
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
1745
|
+
None, description='The location of the instructions.'
|
1746
|
+
)
|
1747
|
+
meta: Optional[Dict[str, Any]] = Field(
|
1748
|
+
None,
|
1749
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1750
|
+
)
|
1751
|
+
nextButtonDisableTime: Optional[float] = Field(
|
1752
|
+
None,
|
1753
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
1754
|
+
)
|
1755
|
+
nextButtonEnableTime: Optional[float] = Field(
|
1756
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
1757
|
+
)
|
1758
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
1759
|
+
None, description='The location of the next button.'
|
1760
|
+
)
|
1761
|
+
nextButtonText: Optional[str] = Field(
|
1762
|
+
None, description='The text that is displayed on the next button.'
|
1763
|
+
)
|
1764
|
+
parameters: Optional[Dict[str, Any]] = Field(
|
1765
|
+
None,
|
1766
|
+
description='The parameters that are passed to the website (iframe). These can be used within your website to render different things.',
|
1767
|
+
)
|
1768
|
+
path: str = Field(
|
1769
|
+
...,
|
1770
|
+
description='The path to the website. This should be a relative path from the public folder or could be an external website.',
|
1771
|
+
)
|
1772
|
+
provideFeedback: Optional[bool] = Field(
|
1773
|
+
None,
|
1774
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
1775
|
+
)
|
1776
|
+
recordAudio: Optional[bool] = Field(
|
1777
|
+
None,
|
1778
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
1779
|
+
)
|
1780
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
1781
|
+
trainingAttempts: Optional[float] = Field(
|
1782
|
+
None,
|
1783
|
+
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.',
|
1784
|
+
)
|
1785
|
+
type: Literal['website'] # End of class
|
1786
|
+
|
1787
|
+
|
1788
|
+
class WebsiteComponentType(TypedDict):
|
1789
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1790
|
+
allowFailedTraining: Optional[bool] = Field(
|
1791
|
+
None,
|
1792
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
1793
|
+
)
|
1794
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
1795
|
+
None,
|
1796
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
1797
|
+
)
|
1798
|
+
description: Optional[str] = Field(
|
1799
|
+
None,
|
1800
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1801
|
+
)
|
1802
|
+
instruction: Optional[str] = Field(
|
1803
|
+
None,
|
1804
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1805
|
+
)
|
1806
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
1807
|
+
None, description='The location of the instructions.'
|
1808
|
+
)
|
1809
|
+
meta: Optional[Dict[str, Any]] = Field(
|
1810
|
+
None,
|
1811
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1812
|
+
)
|
1813
|
+
nextButtonDisableTime: Optional[float] = Field(
|
1814
|
+
None,
|
1815
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
1816
|
+
)
|
1817
|
+
nextButtonEnableTime: Optional[float] = Field(
|
1818
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
1819
|
+
)
|
1820
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
1821
|
+
None, description='The location of the next button.'
|
1822
|
+
)
|
1823
|
+
nextButtonText: Optional[str] = Field(
|
1824
|
+
None, description='The text that is displayed on the next button.'
|
1825
|
+
)
|
1826
|
+
parameters: Optional[Dict[str, Any]] = Field(
|
1827
|
+
None,
|
1828
|
+
description='The parameters that are passed to the website (iframe). These can be used within your website to render different things.',
|
1829
|
+
)
|
1830
|
+
path: str = Field(
|
1831
|
+
...,
|
1832
|
+
description='The path to the website. This should be a relative path from the public folder or could be an external website.',
|
1833
|
+
)
|
1834
|
+
provideFeedback: Optional[bool] = Field(
|
1835
|
+
None,
|
1836
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
1837
|
+
)
|
1838
|
+
recordAudio: Optional[bool] = Field(
|
1839
|
+
None,
|
1840
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
1841
|
+
)
|
1842
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
1843
|
+
trainingAttempts: Optional[float] = Field(
|
1844
|
+
None,
|
1845
|
+
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.',
|
1846
|
+
)
|
1847
|
+
type: Literal['website']
|
1848
|
+
|
1849
|
+
|
1850
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
1851
|
+
|
1852
|
+
|
1853
|
+
class BaseComponents1(BaseModel):
|
1854
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1855
|
+
allowFailedTraining: Optional[bool] = Field(
|
1856
|
+
None,
|
1857
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
1858
|
+
)
|
1859
|
+
config: Optional[Dict[str, Any]] = Field(
|
1860
|
+
None, description='The vega-lite configuration.'
|
1861
|
+
)
|
1862
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
1863
|
+
None,
|
1864
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
1865
|
+
)
|
1866
|
+
description: Optional[str] = Field(
|
1867
|
+
None,
|
1868
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1869
|
+
)
|
1870
|
+
instruction: Optional[str] = Field(
|
1871
|
+
None,
|
1872
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1873
|
+
)
|
1874
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
1875
|
+
None, description='The location of the instructions.'
|
1876
|
+
)
|
1877
|
+
meta: Optional[Dict[str, Any]] = Field(
|
1878
|
+
None,
|
1879
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1880
|
+
)
|
1881
|
+
nextButtonDisableTime: Optional[float] = Field(
|
1882
|
+
None,
|
1883
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
1884
|
+
)
|
1885
|
+
nextButtonEnableTime: Optional[float] = Field(
|
1886
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
1887
|
+
)
|
1888
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
1889
|
+
None, description='The location of the next button.'
|
1890
|
+
)
|
1891
|
+
nextButtonText: Optional[str] = Field(
|
1892
|
+
None, description='The text that is displayed on the next button.'
|
1893
|
+
)
|
1894
|
+
parameters: Optional[Dict[str, Any]] = Field(
|
1895
|
+
None,
|
1896
|
+
description='The parameters that are passed to the react component. These can be used within your react component to render different things.',
|
1897
|
+
)
|
1898
|
+
path: Optional[str] = Field(
|
1899
|
+
None,
|
1900
|
+
description='The path to the markdown file. This should be a relative path from the public folder.',
|
1901
|
+
)
|
1902
|
+
provideFeedback: Optional[bool] = Field(
|
1903
|
+
None,
|
1904
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
1905
|
+
)
|
1906
|
+
recordAudio: Optional[bool] = Field(
|
1907
|
+
None,
|
1908
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
1909
|
+
)
|
1910
|
+
response: Optional[List[Response]] = Field(
|
1911
|
+
None, description='The responses to the component'
|
1912
|
+
)
|
1913
|
+
style: Optional[Dict[str, str]] = Field(
|
1914
|
+
None,
|
1915
|
+
description='The style of the image. This is an object with css properties as keys and css values as values.',
|
1916
|
+
)
|
1917
|
+
trainingAttempts: Optional[float] = Field(
|
1918
|
+
None,
|
1919
|
+
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.',
|
1920
|
+
)
|
1921
|
+
type: Optional[Type] = None # End of class
|
1922
|
+
|
1923
|
+
|
1924
|
+
class BaseComponents1Type(TypedDict):
|
1925
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
1926
|
+
allowFailedTraining: Optional[bool] = Field(
|
1927
|
+
None,
|
1928
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
1929
|
+
)
|
1930
|
+
config: Optional[Dict[str, Any]] = Field(
|
1931
|
+
None, description='The vega-lite configuration.'
|
1932
|
+
)
|
1933
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
1934
|
+
None,
|
1935
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
1936
|
+
)
|
1937
|
+
description: Optional[str] = Field(
|
1938
|
+
None,
|
1939
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1940
|
+
)
|
1941
|
+
instruction: Optional[str] = Field(
|
1942
|
+
None,
|
1943
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1944
|
+
)
|
1945
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
1946
|
+
None, description='The location of the instructions.'
|
1947
|
+
)
|
1948
|
+
meta: Optional[Dict[str, Any]] = Field(
|
1949
|
+
None,
|
1950
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
1951
|
+
)
|
1952
|
+
nextButtonDisableTime: Optional[float] = Field(
|
1953
|
+
None,
|
1954
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
1955
|
+
)
|
1956
|
+
nextButtonEnableTime: Optional[float] = Field(
|
1957
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
1958
|
+
)
|
1959
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
1960
|
+
None, description='The location of the next button.'
|
1961
|
+
)
|
1962
|
+
nextButtonText: Optional[str] = Field(
|
1963
|
+
None, description='The text that is displayed on the next button.'
|
1964
|
+
)
|
1965
|
+
parameters: Optional[Dict[str, Any]] = Field(
|
1966
|
+
None,
|
1967
|
+
description='The parameters that are passed to the react component. These can be used within your react component to render different things.',
|
1968
|
+
)
|
1969
|
+
path: Optional[str] = Field(
|
1970
|
+
None,
|
1971
|
+
description='The path to the markdown file. This should be a relative path from the public folder.',
|
1972
|
+
)
|
1973
|
+
provideFeedback: Optional[bool] = Field(
|
1974
|
+
None,
|
1975
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
1976
|
+
)
|
1977
|
+
recordAudio: Optional[bool] = Field(
|
1978
|
+
None,
|
1979
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
1980
|
+
)
|
1981
|
+
response: Optional[List[Response]] = Field(
|
1982
|
+
None, description='The responses to the component'
|
1983
|
+
)
|
1984
|
+
style: Optional[Dict[str, str]] = Field(
|
1985
|
+
None,
|
1986
|
+
description='The style of the image. This is an object with css properties as keys and css values as values.',
|
1987
|
+
)
|
1988
|
+
trainingAttempts: Optional[float] = Field(
|
1989
|
+
None,
|
1990
|
+
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.',
|
1991
|
+
)
|
1992
|
+
type: Optional[Type] = None
|
1993
|
+
|
1994
|
+
|
1995
|
+
class BaseComponents(RootModel[Optional[Dict[str, BaseComponents1]]]):
|
1996
|
+
root: Optional[Dict[str, BaseComponents1]] = None
|
1997
|
+
|
1998
|
+
|
1999
|
+
# End of class
|
2000
|
+
|
2001
|
+
|
2002
|
+
class BaseComponentsType(TypedDict):
|
2003
|
+
root: Optional[Dict[str, BaseComponents1]] = None
|
2004
|
+
|
2005
|
+
|
2006
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
2007
|
+
|
2008
|
+
|
2009
|
+
class ComponentBlock(BaseModel):
|
2010
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2011
|
+
components: List[Union[str, ComponentBlock]] = Field(
|
2012
|
+
..., description='The components that are included in the order.'
|
2013
|
+
)
|
2014
|
+
id: Optional[str] = Field(
|
2015
|
+
None,
|
2016
|
+
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.',
|
2017
|
+
)
|
2018
|
+
interruptions: Optional[List[InterruptionBlock]] = Field(
|
2019
|
+
None,
|
2020
|
+
description='The interruptions property specifies an array of interruptions. These can be used for breaks or attention checks.',
|
2021
|
+
)
|
2022
|
+
numSamples: Optional[float] = Field(
|
2023
|
+
None,
|
2024
|
+
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.',
|
2025
|
+
)
|
2026
|
+
order: Order = Field(
|
2027
|
+
...,
|
2028
|
+
description='The type of order. This can be random (pure random), latinSquare (random with some guarantees), or fixed.',
|
2029
|
+
)
|
2030
|
+
skip: Optional[SkipConditions] = Field(
|
2031
|
+
None, description='The skip conditions for the block.'
|
2032
|
+
) # End of class
|
2033
|
+
|
2034
|
+
|
2035
|
+
class ComponentBlockType(TypedDict):
|
2036
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2037
|
+
components: List[Union[str, ComponentBlock]] = Field(
|
2038
|
+
..., description='The components that are included in the order.'
|
2039
|
+
)
|
2040
|
+
id: Optional[str] = Field(
|
2041
|
+
None,
|
2042
|
+
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.',
|
2043
|
+
)
|
2044
|
+
interruptions: Optional[List[InterruptionBlock]] = Field(
|
2045
|
+
None,
|
2046
|
+
description='The interruptions property specifies an array of interruptions. These can be used for breaks or attention checks.',
|
2047
|
+
)
|
2048
|
+
numSamples: Optional[float] = Field(
|
2049
|
+
None,
|
2050
|
+
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.',
|
2051
|
+
)
|
2052
|
+
order: Order = Field(
|
2053
|
+
...,
|
2054
|
+
description='The type of order. This can be random (pure random), latinSquare (random with some guarantees), or fixed.',
|
2055
|
+
)
|
2056
|
+
skip: Optional[SkipConditions] = Field(
|
2057
|
+
None, description='The skip conditions for the block.'
|
2058
|
+
)
|
2059
|
+
|
2060
|
+
|
2061
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
2062
|
+
|
2063
|
+
|
2064
|
+
class ImageComponent(BaseModel):
|
2065
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2066
|
+
allowFailedTraining: Optional[bool] = Field(
|
2067
|
+
None,
|
2068
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
2069
|
+
)
|
2070
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
2071
|
+
None,
|
2072
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
2073
|
+
)
|
2074
|
+
description: Optional[str] = Field(
|
2075
|
+
None,
|
2076
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2077
|
+
)
|
2078
|
+
instruction: Optional[str] = Field(
|
2079
|
+
None,
|
2080
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2081
|
+
)
|
2082
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
2083
|
+
None, description='The location of the instructions.'
|
2084
|
+
)
|
2085
|
+
meta: Optional[Dict[str, Any]] = Field(
|
2086
|
+
None,
|
2087
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2088
|
+
)
|
2089
|
+
nextButtonDisableTime: Optional[float] = Field(
|
2090
|
+
None,
|
2091
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
2092
|
+
)
|
2093
|
+
nextButtonEnableTime: Optional[float] = Field(
|
2094
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
2095
|
+
)
|
2096
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
2097
|
+
None, description='The location of the next button.'
|
2098
|
+
)
|
2099
|
+
nextButtonText: Optional[str] = Field(
|
2100
|
+
None, description='The text that is displayed on the next button.'
|
2101
|
+
)
|
2102
|
+
path: str = Field(
|
2103
|
+
...,
|
2104
|
+
description='The path to the image. This should be a relative path from the public folder.',
|
2105
|
+
)
|
2106
|
+
provideFeedback: Optional[bool] = Field(
|
2107
|
+
None,
|
2108
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
2109
|
+
)
|
2110
|
+
recordAudio: Optional[bool] = Field(
|
2111
|
+
None,
|
2112
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
2113
|
+
)
|
2114
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
2115
|
+
style: Optional[Dict[str, str]] = Field(
|
2116
|
+
None,
|
2117
|
+
description='The style of the image. This is an object with css properties as keys and css values as values.',
|
2118
|
+
)
|
2119
|
+
trainingAttempts: Optional[float] = Field(
|
2120
|
+
None,
|
2121
|
+
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.',
|
2122
|
+
)
|
2123
|
+
type: Literal['image'] # End of class
|
2124
|
+
|
2125
|
+
|
2126
|
+
class ImageComponentType(TypedDict):
|
2127
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2128
|
+
allowFailedTraining: Optional[bool] = Field(
|
2129
|
+
None,
|
2130
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
2131
|
+
)
|
2132
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
2133
|
+
None,
|
2134
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
2135
|
+
)
|
2136
|
+
description: Optional[str] = Field(
|
2137
|
+
None,
|
2138
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2139
|
+
)
|
2140
|
+
instruction: Optional[str] = Field(
|
2141
|
+
None,
|
2142
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2143
|
+
)
|
2144
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
2145
|
+
None, description='The location of the instructions.'
|
2146
|
+
)
|
2147
|
+
meta: Optional[Dict[str, Any]] = Field(
|
2148
|
+
None,
|
2149
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2150
|
+
)
|
2151
|
+
nextButtonDisableTime: Optional[float] = Field(
|
2152
|
+
None,
|
2153
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
2154
|
+
)
|
2155
|
+
nextButtonEnableTime: Optional[float] = Field(
|
2156
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
2157
|
+
)
|
2158
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
2159
|
+
None, description='The location of the next button.'
|
2160
|
+
)
|
2161
|
+
nextButtonText: Optional[str] = Field(
|
2162
|
+
None, description='The text that is displayed on the next button.'
|
2163
|
+
)
|
2164
|
+
path: str = Field(
|
2165
|
+
...,
|
2166
|
+
description='The path to the image. This should be a relative path from the public folder.',
|
2167
|
+
)
|
2168
|
+
provideFeedback: Optional[bool] = Field(
|
2169
|
+
None,
|
2170
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
2171
|
+
)
|
2172
|
+
recordAudio: Optional[bool] = Field(
|
2173
|
+
None,
|
2174
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
2175
|
+
)
|
2176
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
2177
|
+
style: Optional[Dict[str, str]] = Field(
|
2178
|
+
None,
|
2179
|
+
description='The style of the image. This is an object with css properties as keys and css values as values.',
|
2180
|
+
)
|
2181
|
+
trainingAttempts: Optional[float] = Field(
|
2182
|
+
None,
|
2183
|
+
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.',
|
2184
|
+
)
|
2185
|
+
type: Literal['image']
|
2186
|
+
|
2187
|
+
|
2188
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
2189
|
+
|
2190
|
+
|
2191
|
+
class InheritedComponent(BaseModel):
|
2192
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2193
|
+
allowFailedTraining: Optional[bool] = Field(
|
2194
|
+
None,
|
2195
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
2196
|
+
)
|
2197
|
+
baseComponent: str
|
2198
|
+
config: Optional[Dict[str, Any]] = Field(
|
2199
|
+
None, description='The vega-lite configuration.'
|
2200
|
+
)
|
2201
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
2202
|
+
None,
|
2203
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
2204
|
+
)
|
2205
|
+
description: Optional[str] = Field(
|
2206
|
+
None,
|
2207
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2208
|
+
)
|
2209
|
+
instruction: Optional[str] = Field(
|
2210
|
+
None,
|
2211
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2212
|
+
)
|
2213
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
2214
|
+
None, description='The location of the instructions.'
|
2215
|
+
)
|
2216
|
+
meta: Optional[Dict[str, Any]] = Field(
|
2217
|
+
None,
|
2218
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2219
|
+
)
|
2220
|
+
nextButtonDisableTime: Optional[float] = Field(
|
2221
|
+
None,
|
2222
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
2223
|
+
)
|
2224
|
+
nextButtonEnableTime: Optional[float] = Field(
|
2225
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
2226
|
+
)
|
2227
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
2228
|
+
None, description='The location of the next button.'
|
2229
|
+
)
|
2230
|
+
nextButtonText: Optional[str] = Field(
|
2231
|
+
None, description='The text that is displayed on the next button.'
|
2232
|
+
)
|
2233
|
+
parameters: Optional[Dict[str, Any]] = Field(
|
2234
|
+
None,
|
2235
|
+
description='The parameters that are passed to the react component. These can be used within your react component to render different things.',
|
2236
|
+
)
|
2237
|
+
path: Optional[str] = Field(
|
2238
|
+
None,
|
2239
|
+
description='The path to the markdown file. This should be a relative path from the public folder.',
|
2240
|
+
)
|
2241
|
+
provideFeedback: Optional[bool] = Field(
|
2242
|
+
None,
|
2243
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
2244
|
+
)
|
2245
|
+
recordAudio: Optional[bool] = Field(
|
2246
|
+
None,
|
2247
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
2248
|
+
)
|
2249
|
+
response: Optional[List[Response]] = Field(
|
2250
|
+
None, description='The responses to the component'
|
2251
|
+
)
|
2252
|
+
style: Optional[Dict[str, str]] = Field(
|
2253
|
+
None,
|
2254
|
+
description='The style of the image. This is an object with css properties as keys and css values as values.',
|
2255
|
+
)
|
2256
|
+
trainingAttempts: Optional[float] = Field(
|
2257
|
+
None,
|
2258
|
+
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.',
|
2259
|
+
)
|
2260
|
+
type: Optional[Type] = None # End of class
|
2261
|
+
|
2262
|
+
|
2263
|
+
class InheritedComponentType(TypedDict):
|
2264
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2265
|
+
allowFailedTraining: Optional[bool] = Field(
|
2266
|
+
None,
|
2267
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
2268
|
+
)
|
2269
|
+
baseComponent: str
|
2270
|
+
config: Optional[Dict[str, Any]] = Field(
|
2271
|
+
None, description='The vega-lite configuration.'
|
2272
|
+
)
|
2273
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
2274
|
+
None,
|
2275
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
2276
|
+
)
|
2277
|
+
description: Optional[str] = Field(
|
2278
|
+
None,
|
2279
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2280
|
+
)
|
2281
|
+
instruction: Optional[str] = Field(
|
2282
|
+
None,
|
2283
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2284
|
+
)
|
2285
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
2286
|
+
None, description='The location of the instructions.'
|
2287
|
+
)
|
2288
|
+
meta: Optional[Dict[str, Any]] = Field(
|
2289
|
+
None,
|
2290
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2291
|
+
)
|
2292
|
+
nextButtonDisableTime: Optional[float] = Field(
|
2293
|
+
None,
|
2294
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
2295
|
+
)
|
2296
|
+
nextButtonEnableTime: Optional[float] = Field(
|
2297
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
2298
|
+
)
|
2299
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
2300
|
+
None, description='The location of the next button.'
|
2301
|
+
)
|
2302
|
+
nextButtonText: Optional[str] = Field(
|
2303
|
+
None, description='The text that is displayed on the next button.'
|
2304
|
+
)
|
2305
|
+
parameters: Optional[Dict[str, Any]] = Field(
|
2306
|
+
None,
|
2307
|
+
description='The parameters that are passed to the react component. These can be used within your react component to render different things.',
|
2308
|
+
)
|
2309
|
+
path: Optional[str] = Field(
|
2310
|
+
None,
|
2311
|
+
description='The path to the markdown file. This should be a relative path from the public folder.',
|
2312
|
+
)
|
2313
|
+
provideFeedback: Optional[bool] = Field(
|
2314
|
+
None,
|
2315
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
2316
|
+
)
|
2317
|
+
recordAudio: Optional[bool] = Field(
|
2318
|
+
None,
|
2319
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
2320
|
+
)
|
2321
|
+
response: Optional[List[Response]] = Field(
|
2322
|
+
None, description='The responses to the component'
|
2323
|
+
)
|
2324
|
+
style: Optional[Dict[str, str]] = Field(
|
2325
|
+
None,
|
2326
|
+
description='The style of the image. This is an object with css properties as keys and css values as values.',
|
2327
|
+
)
|
2328
|
+
trainingAttempts: Optional[float] = Field(
|
2329
|
+
None,
|
2330
|
+
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.',
|
2331
|
+
)
|
2332
|
+
type: Optional[Type] = None
|
2333
|
+
|
2334
|
+
|
2335
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
2336
|
+
|
2337
|
+
|
2338
|
+
class MarkdownComponent(BaseModel):
|
2339
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2340
|
+
allowFailedTraining: Optional[bool] = Field(
|
2341
|
+
None,
|
2342
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
2343
|
+
)
|
2344
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
2345
|
+
None,
|
2346
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
2347
|
+
)
|
2348
|
+
description: Optional[str] = Field(
|
2349
|
+
None,
|
2350
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2351
|
+
)
|
2352
|
+
instruction: Optional[str] = Field(
|
2353
|
+
None,
|
2354
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2355
|
+
)
|
2356
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
2357
|
+
None, description='The location of the instructions.'
|
2358
|
+
)
|
2359
|
+
meta: Optional[Dict[str, Any]] = Field(
|
2360
|
+
None,
|
2361
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2362
|
+
)
|
2363
|
+
nextButtonDisableTime: Optional[float] = Field(
|
2364
|
+
None,
|
2365
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
2366
|
+
)
|
2367
|
+
nextButtonEnableTime: Optional[float] = Field(
|
2368
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
2369
|
+
)
|
2370
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
2371
|
+
None, description='The location of the next button.'
|
2372
|
+
)
|
2373
|
+
nextButtonText: Optional[str] = Field(
|
2374
|
+
None, description='The text that is displayed on the next button.'
|
2375
|
+
)
|
2376
|
+
path: str = Field(
|
2377
|
+
...,
|
2378
|
+
description='The path to the markdown file. This should be a relative path from the public folder.',
|
2379
|
+
)
|
2380
|
+
provideFeedback: Optional[bool] = Field(
|
2381
|
+
None,
|
2382
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
2383
|
+
)
|
2384
|
+
recordAudio: Optional[bool] = Field(
|
2385
|
+
None,
|
2386
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
2387
|
+
)
|
2388
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
2389
|
+
trainingAttempts: Optional[float] = Field(
|
2390
|
+
None,
|
2391
|
+
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.',
|
2392
|
+
)
|
2393
|
+
type: Literal['markdown'] # End of class
|
2394
|
+
|
2395
|
+
|
2396
|
+
class MarkdownComponentType(TypedDict):
|
2397
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2398
|
+
allowFailedTraining: Optional[bool] = Field(
|
2399
|
+
None,
|
2400
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
2401
|
+
)
|
2402
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
2403
|
+
None,
|
2404
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
2405
|
+
)
|
2406
|
+
description: Optional[str] = Field(
|
2407
|
+
None,
|
2408
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2409
|
+
)
|
2410
|
+
instruction: Optional[str] = Field(
|
2411
|
+
None,
|
2412
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2413
|
+
)
|
2414
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
2415
|
+
None, description='The location of the instructions.'
|
2416
|
+
)
|
2417
|
+
meta: Optional[Dict[str, Any]] = Field(
|
2418
|
+
None,
|
2419
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2420
|
+
)
|
2421
|
+
nextButtonDisableTime: Optional[float] = Field(
|
2422
|
+
None,
|
2423
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
2424
|
+
)
|
2425
|
+
nextButtonEnableTime: Optional[float] = Field(
|
2426
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
2427
|
+
)
|
2428
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
2429
|
+
None, description='The location of the next button.'
|
2430
|
+
)
|
2431
|
+
nextButtonText: Optional[str] = Field(
|
2432
|
+
None, description='The text that is displayed on the next button.'
|
2433
|
+
)
|
2434
|
+
path: str = Field(
|
2435
|
+
...,
|
2436
|
+
description='The path to the markdown file. This should be a relative path from the public folder.',
|
2437
|
+
)
|
2438
|
+
provideFeedback: Optional[bool] = Field(
|
2439
|
+
None,
|
2440
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
2441
|
+
)
|
2442
|
+
recordAudio: Optional[bool] = Field(
|
2443
|
+
None,
|
2444
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
2445
|
+
)
|
2446
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
2447
|
+
trainingAttempts: Optional[float] = Field(
|
2448
|
+
None,
|
2449
|
+
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.',
|
2450
|
+
)
|
2451
|
+
type: Literal['markdown']
|
2452
|
+
|
2453
|
+
|
2454
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
2455
|
+
|
2456
|
+
|
2457
|
+
class QuestionnaireComponent(BaseModel):
|
2458
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2459
|
+
allowFailedTraining: Optional[bool] = Field(
|
2460
|
+
None,
|
2461
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
2462
|
+
)
|
2463
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
2464
|
+
None,
|
2465
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
2466
|
+
)
|
2467
|
+
description: Optional[str] = Field(
|
2468
|
+
None,
|
2469
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2470
|
+
)
|
2471
|
+
instruction: Optional[str] = Field(
|
2472
|
+
None,
|
2473
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2474
|
+
)
|
2475
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
2476
|
+
None, description='The location of the instructions.'
|
2477
|
+
)
|
2478
|
+
meta: Optional[Dict[str, Any]] = Field(
|
2479
|
+
None,
|
2480
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2481
|
+
)
|
2482
|
+
nextButtonDisableTime: Optional[float] = Field(
|
2483
|
+
None,
|
2484
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
2485
|
+
)
|
2486
|
+
nextButtonEnableTime: Optional[float] = Field(
|
2487
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
2488
|
+
)
|
2489
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
2490
|
+
None, description='The location of the next button.'
|
2491
|
+
)
|
2492
|
+
nextButtonText: Optional[str] = Field(
|
2493
|
+
None, description='The text that is displayed on the next button.'
|
2494
|
+
)
|
2495
|
+
provideFeedback: Optional[bool] = Field(
|
2496
|
+
None,
|
2497
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
2498
|
+
)
|
2499
|
+
recordAudio: Optional[bool] = Field(
|
2500
|
+
None,
|
2501
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
2502
|
+
)
|
2503
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
2504
|
+
trainingAttempts: Optional[float] = Field(
|
2505
|
+
None,
|
2506
|
+
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.',
|
2507
|
+
)
|
2508
|
+
type: Literal['questionnaire'] # End of class
|
2509
|
+
|
2510
|
+
|
2511
|
+
class QuestionnaireComponentType(TypedDict):
|
2512
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2513
|
+
allowFailedTraining: Optional[bool] = Field(
|
2514
|
+
None,
|
2515
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
2516
|
+
)
|
2517
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
2518
|
+
None,
|
2519
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
2520
|
+
)
|
2521
|
+
description: Optional[str] = Field(
|
2522
|
+
None,
|
2523
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2524
|
+
)
|
2525
|
+
instruction: Optional[str] = Field(
|
2526
|
+
None,
|
2527
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2528
|
+
)
|
2529
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
2530
|
+
None, description='The location of the instructions.'
|
2531
|
+
)
|
2532
|
+
meta: Optional[Dict[str, Any]] = Field(
|
2533
|
+
None,
|
2534
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2535
|
+
)
|
2536
|
+
nextButtonDisableTime: Optional[float] = Field(
|
2537
|
+
None,
|
2538
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
2539
|
+
)
|
2540
|
+
nextButtonEnableTime: Optional[float] = Field(
|
2541
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
2542
|
+
)
|
2543
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
2544
|
+
None, description='The location of the next button.'
|
2545
|
+
)
|
2546
|
+
nextButtonText: Optional[str] = Field(
|
2547
|
+
None, description='The text that is displayed on the next button.'
|
2548
|
+
)
|
2549
|
+
provideFeedback: Optional[bool] = Field(
|
2550
|
+
None,
|
2551
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
2552
|
+
)
|
2553
|
+
recordAudio: Optional[bool] = Field(
|
2554
|
+
None,
|
2555
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
2556
|
+
)
|
2557
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
2558
|
+
trainingAttempts: Optional[float] = Field(
|
2559
|
+
None,
|
2560
|
+
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.',
|
2561
|
+
)
|
2562
|
+
type: Literal['questionnaire']
|
2563
|
+
|
2564
|
+
|
2565
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
2566
|
+
|
2567
|
+
|
2568
|
+
class ReactComponent(BaseModel):
|
2569
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2570
|
+
allowFailedTraining: Optional[bool] = Field(
|
2571
|
+
None,
|
2572
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
2573
|
+
)
|
2574
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
2575
|
+
None,
|
2576
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
2577
|
+
)
|
2578
|
+
description: Optional[str] = Field(
|
2579
|
+
None,
|
2580
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2581
|
+
)
|
2582
|
+
instruction: Optional[str] = Field(
|
2583
|
+
None,
|
2584
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2585
|
+
)
|
2586
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
2587
|
+
None, description='The location of the instructions.'
|
2588
|
+
)
|
2589
|
+
meta: Optional[Dict[str, Any]] = Field(
|
2590
|
+
None,
|
2591
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2592
|
+
)
|
2593
|
+
nextButtonDisableTime: Optional[float] = Field(
|
2594
|
+
None,
|
2595
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
2596
|
+
)
|
2597
|
+
nextButtonEnableTime: Optional[float] = Field(
|
2598
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
2599
|
+
)
|
2600
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
2601
|
+
None, description='The location of the next button.'
|
2602
|
+
)
|
2603
|
+
nextButtonText: Optional[str] = Field(
|
2604
|
+
None, description='The text that is displayed on the next button.'
|
2605
|
+
)
|
2606
|
+
parameters: Optional[Dict[str, Any]] = Field(
|
2607
|
+
None,
|
2608
|
+
description='The parameters that are passed to the react component. These can be used within your react component to render different things.',
|
2609
|
+
)
|
2610
|
+
path: str = Field(
|
2611
|
+
...,
|
2612
|
+
description='The path to the react component. This should be a relative path from the src/public folder.',
|
2613
|
+
)
|
2614
|
+
provideFeedback: Optional[bool] = Field(
|
2615
|
+
None,
|
2616
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
2617
|
+
)
|
2618
|
+
recordAudio: Optional[bool] = Field(
|
2619
|
+
None,
|
2620
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
2621
|
+
)
|
2622
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
2623
|
+
trainingAttempts: Optional[float] = Field(
|
2624
|
+
None,
|
2625
|
+
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.',
|
2626
|
+
)
|
2627
|
+
type: Literal['react-component'] # End of class
|
2628
|
+
|
2629
|
+
|
2630
|
+
class ReactComponentType(TypedDict):
|
2631
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2632
|
+
allowFailedTraining: Optional[bool] = Field(
|
2633
|
+
None,
|
2634
|
+
description='Controls whether the component should allow failed training. If not provided, the default is true.',
|
2635
|
+
)
|
2636
|
+
correctAnswer: Optional[List[Answer]] = Field(
|
2637
|
+
None,
|
2638
|
+
description='The correct answer to the component. This is used for training trials where the user is shown the correct answer after a guess.',
|
2639
|
+
)
|
2640
|
+
description: Optional[str] = Field(
|
2641
|
+
None,
|
2642
|
+
description='The description of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2643
|
+
)
|
2644
|
+
instruction: Optional[str] = Field(
|
2645
|
+
None,
|
2646
|
+
description='The instruction of the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2647
|
+
)
|
2648
|
+
instructionLocation: Optional[ResponseBlockLocation] = Field(
|
2649
|
+
None, description='The location of the instructions.'
|
2650
|
+
)
|
2651
|
+
meta: Optional[Dict[str, Any]] = Field(
|
2652
|
+
None,
|
2653
|
+
description='The meta data for the component. This is used to identify and provide additional information for the component in the admin panel.',
|
2654
|
+
)
|
2655
|
+
nextButtonDisableTime: Optional[float] = Field(
|
2656
|
+
None,
|
2657
|
+
description='A timeout (in ms) after which the next button will be disabled.',
|
2658
|
+
)
|
2659
|
+
nextButtonEnableTime: Optional[float] = Field(
|
2660
|
+
None, description='A timer (in ms) after which the next button will be enabled.'
|
2661
|
+
)
|
2662
|
+
nextButtonLocation: Optional[ResponseBlockLocation] = Field(
|
2663
|
+
None, description='The location of the next button.'
|
2664
|
+
)
|
2665
|
+
nextButtonText: Optional[str] = Field(
|
2666
|
+
None, description='The text that is displayed on the next button.'
|
2667
|
+
)
|
2668
|
+
parameters: Optional[Dict[str, Any]] = Field(
|
2669
|
+
None,
|
2670
|
+
description='The parameters that are passed to the react component. These can be used within your react component to render different things.',
|
2671
|
+
)
|
2672
|
+
path: str = Field(
|
2673
|
+
...,
|
2674
|
+
description='The path to the react component. This should be a relative path from the src/public folder.',
|
2675
|
+
)
|
2676
|
+
provideFeedback: Optional[bool] = Field(
|
2677
|
+
None,
|
2678
|
+
description='Controls whether the component should provide feedback to the participant, such as in a training trial. If not provided, the default is false.',
|
2679
|
+
)
|
2680
|
+
recordAudio: Optional[bool] = Field(
|
2681
|
+
None,
|
2682
|
+
description='Whether or not to record audio for a component. Only relevant if StudyConfig.recordStudyAudio is true. Defaults to true.',
|
2683
|
+
)
|
2684
|
+
response: List[Response] = Field(..., description='The responses to the component')
|
2685
|
+
trainingAttempts: Optional[float] = Field(
|
2686
|
+
None,
|
2687
|
+
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.',
|
2688
|
+
)
|
2689
|
+
type: Literal['react-component']
|
2690
|
+
|
2691
|
+
|
2692
|
+
class VegaComponent(RootModel[Union[VegaComponentPath, VegaComponentConfig]]):
|
2693
|
+
root: Union[VegaComponentPath, VegaComponentConfig]
|
2694
|
+
|
2695
|
+
|
2696
|
+
# End of class
|
2697
|
+
|
2698
|
+
|
2699
|
+
class VegaComponentType(TypedDict):
|
2700
|
+
root: Union[VegaComponentPath, VegaComponentConfig]
|
2701
|
+
|
2702
|
+
|
2703
|
+
class IndividualComponent(
|
2704
|
+
RootModel[
|
2705
|
+
Union[
|
2706
|
+
MarkdownComponent,
|
2707
|
+
ReactComponent,
|
2708
|
+
ImageComponent,
|
2709
|
+
WebsiteComponent,
|
2710
|
+
QuestionnaireComponent,
|
2711
|
+
VegaComponent,
|
2712
|
+
]
|
2713
|
+
]
|
2714
|
+
):
|
2715
|
+
root: Union[
|
2716
|
+
MarkdownComponent,
|
2717
|
+
ReactComponent,
|
2718
|
+
ImageComponent,
|
2719
|
+
WebsiteComponent,
|
2720
|
+
QuestionnaireComponent,
|
2721
|
+
VegaComponent,
|
2722
|
+
]
|
2723
|
+
|
2724
|
+
|
2725
|
+
# End of class
|
2726
|
+
|
2727
|
+
|
2728
|
+
class IndividualComponentType(TypedDict):
|
2729
|
+
root: Union[
|
2730
|
+
MarkdownComponent,
|
2731
|
+
ReactComponent,
|
2732
|
+
ImageComponent,
|
2733
|
+
WebsiteComponent,
|
2734
|
+
QuestionnaireComponent,
|
2735
|
+
VegaComponent,
|
2736
|
+
]
|
2737
|
+
|
2738
|
+
|
2739
|
+
warnings.filterwarnings("ignore", module="pydantic")
|
2740
|
+
|
2741
|
+
|
2742
|
+
class StudyConfig(BaseModel):
|
2743
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2744
|
+
schema: str = Field(
|
2745
|
+
...,
|
2746
|
+
alias='$schema',
|
2747
|
+
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",
|
2748
|
+
)
|
2749
|
+
baseComponents: Optional[BaseComponents] = Field(
|
2750
|
+
None,
|
2751
|
+
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.',
|
2752
|
+
)
|
2753
|
+
components: Dict[str, Union[IndividualComponent, InheritedComponent]] = Field(
|
2754
|
+
...,
|
2755
|
+
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.',
|
2756
|
+
)
|
2757
|
+
importedLibraries: Optional[List[str]] = Field(
|
2758
|
+
None,
|
2759
|
+
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.',
|
2760
|
+
)
|
2761
|
+
recordStudyAudio: Optional[bool] = Field(
|
2762
|
+
None,
|
2763
|
+
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.',
|
2764
|
+
)
|
2765
|
+
sequence: ComponentBlock = Field(
|
2766
|
+
...,
|
2767
|
+
description='The order of the components in the study. This might include some randomness.',
|
2768
|
+
)
|
2769
|
+
studyMetadata: StudyMetadata = Field(
|
2770
|
+
...,
|
2771
|
+
description='The metadata for the study. This is used to identify the study and version in the data file.',
|
2772
|
+
)
|
2773
|
+
uiConfig: UIConfig = Field(
|
2774
|
+
...,
|
2775
|
+
description='The UI configuration for the study. This is used to configure the UI of the app.',
|
2776
|
+
) # End of class
|
2777
|
+
|
2778
|
+
|
2779
|
+
class StudyConfigType(TypedDict):
|
2780
|
+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
|
2781
|
+
schema: str = Field(
|
2782
|
+
...,
|
2783
|
+
alias='$schema',
|
2784
|
+
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",
|
2785
|
+
)
|
2786
|
+
baseComponents: Optional[BaseComponents] = Field(
|
2787
|
+
None,
|
2788
|
+
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.',
|
2789
|
+
)
|
2790
|
+
components: Dict[str, Union[IndividualComponent, InheritedComponent]] = Field(
|
2791
|
+
...,
|
2792
|
+
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.',
|
2793
|
+
)
|
2794
|
+
importedLibraries: Optional[List[str]] = Field(
|
2795
|
+
None,
|
2796
|
+
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.',
|
2797
|
+
)
|
2798
|
+
recordStudyAudio: Optional[bool] = Field(
|
2799
|
+
None,
|
2800
|
+
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.',
|
2801
|
+
)
|
2802
|
+
sequence: ComponentBlock = Field(
|
2803
|
+
...,
|
2804
|
+
description='The order of the components in the study. This might include some randomness.',
|
2805
|
+
)
|
2806
|
+
studyMetadata: StudyMetadata = Field(
|
2807
|
+
...,
|
2808
|
+
description='The metadata for the study. This is used to identify the study and version in the data file.',
|
2809
|
+
)
|
2810
|
+
uiConfig: UIConfig = Field(
|
2811
|
+
...,
|
2812
|
+
description='The UI configuration for the study. This is used to configure the UI of the app.',
|
2813
|
+
)
|
2814
|
+
|
2815
|
+
|
2816
|
+
class Model(RootModel[StudyConfig]):
|
2817
|
+
root: StudyConfig
|
2818
|
+
|
2819
|
+
|
2820
|
+
# End of class
|
2821
|
+
|
2822
|
+
|
2823
|
+
class ModelType(TypedDict):
|
2824
|
+
root: StudyConfig
|
2825
|
+
|
2826
|
+
|
2827
|
+
ComponentBlock.model_rebuild()
|