diff options
author | Niclas Dobbertin <niclas.dobbertin@mailbox.org> | 2023-08-18 10:23:47 +0200 |
---|---|---|
committer | Niclas Dobbertin <niclas.dobbertin@mailbox.org> | 2023-08-18 10:23:47 +0200 |
commit | 11bab9715e6f68c3d90b4ba04a3b2e54f43c06a3 (patch) | |
tree | e4ea60274b0da227af0f3c6a02688c891764bed6 /master_thesis/frensch_task.py | |
parent | 395c6ea6abd9838c214f90e46b21633ec185dbc6 (diff) |
procedure randomisation
Diffstat (limited to 'master_thesis/frensch_task.py')
-rw-r--r-- | master_thesis/frensch_task.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/master_thesis/frensch_task.py b/master_thesis/frensch_task.py index 309153f..fc4c0ea 100644 --- a/master_thesis/frensch_task.py +++ b/master_thesis/frensch_task.py @@ -4,6 +4,7 @@ from __future__ import annotations from psychopy import constants, core, event, gui, visual from collections import namedtuple import frensch_procedures +import random DisplayVariable = namedtuple("DisplayVariable", ["name", "values"]) @@ -71,7 +72,7 @@ def generate_procedure_display(procedure: DisplayProcedure): return stim_procedure -def run_trial(): +def run_trial(procedure_keys: list): water_sample = frensch_procedures.random_WaterSample() water_sample.print_all() @@ -83,7 +84,8 @@ def run_trial(): stims = generate_variable_display([solid, algae, lime, toxin], x_positions) - p1 = DisplayProcedure(water_sample.index5_str(), water_sample.index1()) + procedures = water_sample.procedure_dict() + p1 = DisplayProcedure(procedures[procedure_keys[0]][1](), procedures[procedure_keys[0]][0]()) p1 = generate_procedure_display(p1) stims.append(p1) @@ -111,9 +113,17 @@ def run_trial(): if "\n" in stim_answer_box.text: not_finished = False - event.waitKeys(keyList=["space"]) return answer -print(f"Answer: {run_trial()}") + +procedure_keys = ["1", "2", "3", "4", "5", "6", "overall"] +train_procedures = procedure_keys[:-1] +random.shuffle(train_procedures) +train_procedures = train_procedures[:-1] +train_procedures.append(procedure_keys[-1]) +print(train_procedures) + + +print(f"Answer: {run_trial(train_procedures)}") |