This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.py
222 lines (209 loc) · 7.1 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
from os import environ
SESSION_CONFIGS = [
dict(
name="generic",
display_name="generic stimuli recognition task",
num_demo_participants=1,
app_sequence=["generic"],
categories={'foo': 'emojis_positive', 'bar': 'emojis_negative'},
labels={'foo': 'Positive', 'bar': 'Negative', 'baz': "None"},
),
dict(
name="ldt_yesno",
display_name="LDT with yes/no responses",
num_demo_participants=1,
app_sequence=["ldt_yesno"],
labels={'word': 'word', 'nonword': "non-word"},
),
dict(
name="ldt_gonogo",
display_name="LDT with go/nogo",
num_demo_participants=1,
app_sequence=["ldt_gonogo"],
labels={'word': 'word', 'nonword': "non-word"},
),
dict(
name="ldt_priming",
display_name="LDT with semantic priming",
num_demo_participants=1,
app_sequence=["ldt_priming"],
labels={'word': 'word', 'nonword': "non-word"},
),
dict(
name="sliders",
display_name="RET Slider task",
num_demo_participants=1,
app_sequence=["sliders"],
),
dict(
name="decoding",
display_name="RET Decoding numbers to words",
num_demo_participants=1,
app_sequence=["real_effort"],
task='decoding',
attempts_per_puzzle=1,
),
dict(
name="transcription",
display_name="RET Transcription of text from an image",
num_demo_participants=1,
app_sequence=["real_effort"],
task='transcription',
attempts_per_puzzle=2,
retry_delay=3.0,
),
dict(
name="matrices",
display_name="RET Counting symbols in a matrix",
num_demo_participants=1,
app_sequence=["real_effort"],
task='matrix',
attempts_per_puzzle=1,
),
dict(
name="iat_words",
display_name="IAT using words, from CSV",
num_demo_participants=1,
app_sequence=["iat"],
primary=['male', 'female'],
secondary=['career', 'family'],
num_iterations={1: 5, 2: 5, 3: 10, 4: 20, 5: 5, 6: 10, 7: 20},
),
dict(
name="iat_images",
display_name="IAT using images",
num_demo_participants=1,
app_sequence=["iat"],
primary_images=True,
primary=['images:felidae', 'images:canidae'],
secondary_images=True,
secondary=['emojis:positive', 'emojis:negative'],
num_iterations={1: 5, 2: 5, 3: 10, 4: 20, 5: 5, 6: 10, 7: 20},
),
dict(
name="iat_mixed",
display_name="IAT using images and words",
num_demo_participants=1,
app_sequence=["iat"],
primary_images=True,
primary=['images:felidae', 'images:canidae'],
secondary=['male', 'female'],
num_iterations={1: 5, 2: 5, 3: 10, 4: 20, 5: 5, 6: 10, 7: 20},
),
]
# if you set a property in SESSION_CONFIG_DEFAULTS, it will be inherited by all configs
# in SESSION_CONFIGS, except those that explicitly override it.
# the session config can be accessed from methods in your apps as self.session.config,
# e.g. self.session.config['participation_fee']
SESSION_CONFIG_DEFAULTS = dict(
real_world_currency_per_point=1.00, participation_fee=0.00, doc=""
)
PARTICIPANT_FIELDS = ['is_dropout']
SESSION_FIELDS = ['params']
# ISO-639 code
# for example: de, fr, ja, ko, zh-hans
LANGUAGE_CODE = "en"
# e.g. EUR, GBP, CNY, JPY
REAL_WORLD_CURRENCY_CODE = "USD"
USE_POINTS = True
ADMIN_USERNAME = "admin"
# for security, best to set admin password in an environment variable
ADMIN_PASSWORD = environ.get("OTREE_ADMIN_PASSWORD")
DEMO_PAGE_TITLE = "Real-effort tasks"
DEMO_PAGE_INTRO_HTML = """
Real-effort tasks with multiple configuration options.
"""
SECRET_KEY = "2015765205890"
# adjustments for testing
# generating session configs for all varieties of features
import sys
if sys.argv[1] == 'test':
MAX_ITERATIONS = 5
FREEZE_TIME = 100
TRIAL_PAUSE = 200
TRIAL_TIMEOUT = 300
SESSION_CONFIGS = [
dict(
name=f"testing_generic",
num_demo_participants=1,
app_sequence=['generic'],
auto_response_time=None,
input_freezing_time=FREEZE_TIME,
inter_trial_time=TRIAL_PAUSE,
num_iterations=MAX_ITERATIONS,
attempts_per_trial=1,
categories={'foo': 'positive', 'bar': 'negative'},
labels={'foo': 'Positive', 'bar': 'Negative'},
),
dict(
name=f"testing_generic_retries",
num_demo_participants=1,
app_sequence=['generic'],
auto_response_time=None,
input_freezing_time=FREEZE_TIME,
inter_trial_time=TRIAL_PAUSE,
num_iterations=MAX_ITERATIONS,
attempts_per_trial=3,
categories={'foo': 'positive', 'bar': 'negative'},
labels={'foo': 'Positive', 'bar': 'Negative'},
),
dict(
name=f"testing_generic_gonogo",
num_demo_participants=1,
app_sequence=['generic'],
auto_response_time=TRIAL_TIMEOUT,
input_freezing_time=FREEZE_TIME,
inter_trial_time=TRIAL_PAUSE,
num_iterations=MAX_ITERATIONS,
attempts_per_trial=1,
categories={'foo': 'positive', 'bar': 'negative'},
labels={'foo': 'Positive', 'bar': 'Negative'},
),
dict(
name=f"testing_iat",
num_demo_participants=1,
app_sequence=['iat'],
trial_delay=TRIAL_PAUSE / 1000.0,
retry_delay=FREEZE_TIME / 1000.0,
primary=['canidae', 'felidae'],
secondary=['positive', 'negative'],
num_iterations={1: 2, 2: 2, 3: 3, 4: 3, 5: 2, 6: 3, 7: 3},
),
dict(
name=f"testing_sliders",
num_demo_participants=1,
app_sequence=['sliders'],
trial_delay=TRIAL_PAUSE / 1000.0,
retry_delay=FREEZE_TIME / 1000.0,
num_sliders=3,
attempts_per_slider=3,
),
]
for task in ['decoding', 'matrix', 'transcription']:
SESSION_CONFIGS.extend(
[
dict(
name=f"testing_{task}_defaults",
num_demo_participants=1,
app_sequence=['real_effort'],
puzzle_delay=TRIAL_PAUSE / 1000.0,
retry_delay=FREEZE_TIME / 1000.0,
),
dict(
name=f"testing_{task}_retrying",
num_demo_participants=1,
app_sequence=['real_effort'],
puzzle_delay=TRIAL_PAUSE / 1000.0,
retry_delay=FREEZE_TIME / 1000.0,
attempts_per_puzzle=5,
),
dict(
name=f"testing_{task}_limited",
num_demo_participants=1,
app_sequence=['real_effort'],
puzzle_delay=TRIAL_PAUSE / 1000.0,
retry_delay=FREEZE_TIME / 1000.0,
max_iterations=MAX_ITERATIONS,
),
]
)