update task assignment
Browse files
__pycache__/live_preview_helpers.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/live_preview_helpers.cpython-310.pyc and b/__pycache__/live_preview_helpers.cpython-310.pyc differ
|
|
|
__pycache__/optim_utils.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/optim_utils.cpython-310.pyc and b/__pycache__/optim_utils.cpython-310.pyc differ
|
|
|
__pycache__/utils.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/utils.cpython-310.pyc and b/__pycache__/utils.cpython-310.pyc differ
|
|
|
app.py
CHANGED
|
@@ -176,6 +176,7 @@ def select_image(like_radio, images_method):
|
|
| 176 |
|
| 177 |
def set_user(participant):
|
| 178 |
global responses_memory, assigned_scenarios
|
|
|
|
| 179 |
responses_memory[participant] = {METHODS[0]:{}, METHODS[1]:{}}
|
| 180 |
|
| 181 |
# id = re.findall(r'\d+', participant)
|
|
@@ -185,6 +186,13 @@ def set_user(participant):
|
|
| 185 |
# assigned_scenarios = list(SCENARIOS.keys())[2:]
|
| 186 |
# return assigned_scenarios[0]
|
| 187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
def display_scenario(participant, choice):
|
| 189 |
# reset intermittent storage when scenario change
|
| 190 |
global counter1, counter2, responses_memory, current_task1, current_task2, task1_success, task2_success, enable_submit1, enable_submit2
|
|
@@ -195,8 +203,10 @@ def display_scenario(participant, choice):
|
|
| 195 |
|
| 196 |
if check_participant(participant):
|
| 197 |
responses_memory[participant] = {METHODS[0]:{}, METHODS[1]:{}}
|
| 198 |
-
|
| 199 |
-
[current_task1, current_task2] = random.sample(METHODS, 2)
|
|
|
|
|
|
|
| 200 |
if current_task1 == METHODS[0]:
|
| 201 |
initial_images1 = IMAGES[choice]["baseline"]
|
| 202 |
initial_images2 = IMAGES[choice]["ours"]
|
|
|
|
| 176 |
|
| 177 |
def set_user(participant):
|
| 178 |
global responses_memory, assigned_scenarios
|
| 179 |
+
|
| 180 |
responses_memory[participant] = {METHODS[0]:{}, METHODS[1]:{}}
|
| 181 |
|
| 182 |
# id = re.findall(r'\d+', participant)
|
|
|
|
| 186 |
# assigned_scenarios = list(SCENARIOS.keys())[2:]
|
| 187 |
# return assigned_scenarios[0]
|
| 188 |
|
| 189 |
+
def assign_tasks(participant):
|
| 190 |
+
id = re.findall(r'\d+', participant)
|
| 191 |
+
if len(id) == 0 or int(id[0]) % 4 == 1 or int(id[0]) % 4 == 2:
|
| 192 |
+
return METHODS[1], METHODS[0]
|
| 193 |
+
else:
|
| 194 |
+
return METHODS[0], METHODS[1]
|
| 195 |
+
|
| 196 |
def display_scenario(participant, choice):
|
| 197 |
# reset intermittent storage when scenario change
|
| 198 |
global counter1, counter2, responses_memory, current_task1, current_task2, task1_success, task2_success, enable_submit1, enable_submit2
|
|
|
|
| 203 |
|
| 204 |
if check_participant(participant):
|
| 205 |
responses_memory[participant] = {METHODS[0]:{}, METHODS[1]:{}}
|
| 206 |
+
|
| 207 |
+
# [current_task1, current_task2] = random.sample(METHODS, 2)
|
| 208 |
+
current_task1, current_task2 = assign_tasks(participant)
|
| 209 |
+
|
| 210 |
if current_task1 == METHODS[0]:
|
| 211 |
initial_images1 = IMAGES[choice]["baseline"]
|
| 212 |
initial_images2 = IMAGES[choice]["ours"]
|