[solved] correct variable is "undefined" and acc variable is "0"
Hello,
I just created a new OpenSesame experiment which calls only four different JPEGs and has two correct response keys. I created a loop with a sequence for it so it can call every trial randomly. The order in the sequence is:
fixation dot, JPEG, keyboard response, logger, and tone. (The tone should only occur when the subject presses the incorrect key, so I have it set as "run if [correct]=0")
When I run the experiment, everything seems to run smoothly except for the fact that the tone isn't occurring. But then I pull up the CSV file to look at the data, and the [correct] variable is marked as "undefined" for every trial and the [accuracy] variable is marked as "0" for every trial. Because it's not collecting the [correct] variable, the tone cannot sound. It does record which response (key) you are making and which one is the correct response for the trial. It also seems to be collecting response time correctly.
I looked at the logger, and the source for the [correct] variable, the [acc] variable, and the [response_time] variable is the keyboard response.
I'm not really sure why it is saying the [correct] variable is "undefined" and [acc] is "0" every time.
If you could help us, that would be great. Thanks!
Comments
Hi,
Could you make sure that there is one (and only one!) correct response listed in the keyboard_response item?
If you require multiple responses to be correct, please use the following code in the Run phase of an inline_script placed directly after the keyboard_response:
This inline_script assumes that you have defined the correct responses in two variables in your loop:
corresp1
andcorresp2
.Good luck!
Thanks! That worked for correct, but the acc variable is still saying "0" every time. Is there any way to fix that too?
Yes, there is. This will require some manual bookkeeping, but we will rely on some variables OpenSesame creates and updates behind the screens:
Good luck!
It worked thanks for all your help, Edwin!