summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--master_thesis/frensch_procedures.py33
-rw-r--r--master_thesis/frensch_task.py24
2 files changed, 44 insertions, 13 deletions
diff --git a/master_thesis/frensch_procedures.py b/master_thesis/frensch_procedures.py
index 38e8cf3..c2ace41 100644
--- a/master_thesis/frensch_procedures.py
+++ b/master_thesis/frensch_procedures.py
@@ -19,16 +19,33 @@ class WaterSample:
def procedure_dict(self):
procedures = {
- "1": (self.index1, self.index1_str),
- "2": (self.index2, self.index2_str),
- "3": (self.index3, self.index3_str),
- "4": (self.index4, self.index4_str),
- "5": (self.index5, self.index5_str),
- "6": (self.index6, self.index6_str),
- "overall": (self.overall, self.overall_str),
+ "1": (self.index1(), self.index1_str()),
+ "2": (self.index2(), self.index2_str()),
+ "3": (self.index3(), self.index3_str()),
+ "4": (self.index4(), self.index4_str()),
+ "5": (self.index5(), self.index5_str()),
+ "6": (self.index6(), self.index6_str()),
+ "overall": (self.overall(), self.overall_str()),
}
+
return procedures
+ def water_sample_dict(self):
+ sample = {
+ "1": (self.index1(), self.index1_str()),
+ "2": (self.index2(), self.index2_str()),
+ "3": (self.index3(), self.index3_str()),
+ "4": (self.index4(), self.index4_str()),
+ "5": (self.index5(), self.index5_str()),
+ "6": (self.index6(), self.index6_str()),
+ "overall": (self.overall(), self.overall_str()),
+ "solid": self.solid,
+ "algae": self.algae,
+ "lime": self.lime,
+ "toxin": self.toxin,
+ }
+ return sample
+
def select_procedures(self):
procedures = [
(self.index1, self.index1_str),
@@ -112,7 +129,7 @@ def constrained_WaterSample():
resample = False
# check for negative results
for proc in water_sample.procedure_dict().keys():
- if water_sample.procedure_dict()[proc][0]() < 0:
+ if water_sample.procedure_dict()[proc][0] < 0:
resample = True
# check for greater/lesser equality
# procedure 5
diff --git a/master_thesis/frensch_task.py b/master_thesis/frensch_task.py
index 091f351..a3eae00 100644
--- a/master_thesis/frensch_task.py
+++ b/master_thesis/frensch_task.py
@@ -31,10 +31,10 @@ def experiment_shutdown():
WIN = visual.Window((2560, 1440), fullscr=True, units="pix")
MONITOR_FPS = 60
-# TRAIN_TRIALS = 1
-# TEST_TRIALS = 1
TRAIN_TRIALS = 75
TEST_TRIALS = 50
+TRAIN_TRIALS = 1
+TEST_TRIALS = 1
ORDER_CONDITIONS = ["fixed", "random", "blocked"]
PROCEDURE_KEYS = ["1", "2", "3", "4", "5", "6", "overall"]
@@ -121,7 +121,7 @@ def run_trial(water_sample, procedure_keys: list, condition):
answ_y = -100
y_offset = 80
for proc in procedure_keys:
- p = DisplayProcedure(procedures[proc][1](), procedures[proc][0]())
+ p = DisplayProcedure(procedures[proc][1], procedures[proc][0])
p = generate_procedure_display(p, (proc_x, proc_y))
stims.append(p)
proc_y -= y_offset
@@ -130,12 +130,12 @@ def run_trial(water_sample, procedure_keys: list, condition):
WIN,
"=",
letterHeight=50,
- pos=(answ_x-100, answ_y),
+ pos=(answ_x - 100, answ_y),
size=[150, 70],
alignment="center",
)
stims.append(stim_answer_equals)
-
+
stim_answer_box = visual.TextBox2(
WIN,
"",
@@ -204,6 +204,7 @@ for i in range(TRAIN_TRIALS):
)
answer_dict = {}
answer_dict["procedure_order"] = procedure_keys
+ answer_dict["water_sample"] = all_samples[i].water_sample_dict()
for proc, key in zip(answer, procedure_keys):
answer_dict[key] = {"answer": proc[0], "time": proc[1]}
@@ -214,6 +215,18 @@ for i in range(TRAIN_TRIALS):
event.waitKeys(keyList=["space"])
+phase = visual.TextBox2(
+ WIN,
+ """Sie haben den ersten Teil geschafft! Der zweite Teil ist etwas kürzer als der erste
+
+Drücken Sie die Leertaste um anzufangen.""",
+ letterHeight=50,
+ alignment="center",
+)
+phase.draw()
+WIN.flip()
+event.waitKeys(keyList=["space"])
+
train_procedures[2] = transfer_procedure
for i in range(TEST_TRIALS):
print(train_procedures)
@@ -222,6 +235,7 @@ for i in range(TEST_TRIALS):
)
answer_dict = {}
answer_dict["procedure_order"] = procedure_keys
+ answer_dict["water_sample"] = all_samples[TRAIN_TRIALS + i].water_sample_dict()
for proc, key in zip(answer, procedure_keys):
answer_dict[key] = {"answer": proc[0], "time": proc[1]}