If this template helps then use it. If not then just delete and start from scratch.
OS Win 7:
PsychoPy version 1.90.1:
**Standard Standalone? ** yes
What are you trying to achieve?:
I try to save data depending that depends on what image is presented and what participant chose.
What did you try to make it work?:
I have a code component (code_77) at the beginning of the routine that defines the outcome as “risky” or “safe” depending on what image is shown to participants and what they choose.
The code is as follows:
What specifically went wrong when you tried that?:
I try to safe the response using code component (code_78) in the end of the routine:
#save data d_lot2.addData('Descr_Choice', choice2) d_lot2.addData('ResponseKey',key_resp_21.keys) d_lot2.addData('RT', key_resp_21.rt) d_lot2.addData('DoorLeft', doorList) d_lot2.addData('DoorRight', doorList)
However I get the follwoing error message:
Traceback (most recent call last): File "C:\Users\u1664328\Dropbox\1. Projects\Projects\1. Learning from Social & Personal Experience\Experiment 5a and 5b Descriptions - basic and motives\Descr_1_no_motive.py", line 8840, in <module> d_lot2.addData('Descr_Choice', choice2) NameError: name 'choice2' is not defined
I have experienced some timing issues before and this time I tried to move the code that defines “choice2” in the routine before the one that saves the outcomes and also moved code_77 “up” at the beginning of the routine’s view, but it didn’t work.
I stuck with this error for a while now, don’t know how to get around this. Maybe it’s something trivial that I’ve overlooked. What can cause the error in this case?