Specify the response
Hi Flaad, Hi all
I have some issue in go-nogo task paradigm. Since there is an instruction not to press the key, I am little bit confused how to specify the correct response. If I not specify the “not press” as a correct result, the data will fill with none string whereas never meet the criteria. What I tried to achieve is the accuracy when subject not to press the key but the result is correct. I just outline the problem maybe something like this:
if response == "random key” and gonogo_stimulus == "yellow square":
correct_answer = "true" # press the key
if response != "random key" and gonogo_stimulus == "yellow square":
correct_answer = "false" # not press the key or miss
if response == "random key" and gonogo_stimulus == "blue square":
correct_answer = "false" # press the key that shouldnt
if response != "random key" and gonogo_stimulus == "blue square":
response_type = "true" # not press the key
I hope any further advice and comment from anyone who is ever work with go-nogo paradigm task.
Thanks a lot
Tanto

Comments
Hi Tanto,
I am not sure I understand the problem.
Where correct is coding: -2=missed reject, -1=false hit, 1=hit, 2=reject
Hi Flaad,
Thanks for the quick response. Yes!, that's right what I really meant. I think go/nogo task have very different structure from flanker or stroop task. My understanding is that I don't need to specify the response with "trial.set_factor("corr_res",corr_res)" but just specify directly after block has started. Correct me if I'm wrong. I have been working on it. Thanks for the code, very helpful for me who is still struggling to understand Python.
Hi Flaad really sorry to bother you again. I have stumble upon in other error. The code give me :
AttributeError: 'NoneType' object has no attribute 'add'
Exception TypeError: "'NoneType' object is not callable" in > ignored
As far as I understand this error, maybe caused by the key with 'none' response, when I try combined the data. I tried to covert the nonType with 0 :
int(0 if key is None else None)
But no works and raise similar error. Here my full code.
Thanks
You get this error because you never start the experiment. The
dataattribute is only available after a call toexpyriment.control.start. See also http://docs.expyriment.org/expyriment.control.html#expyriment.control.start.I get the same result whatever I modify the condition. Any suggest would be great n thanks a lot

I make my stimuli more simple to test the correct answer. I hope this help and I am very grateful for your answer.
That is because
fast_stimuli == "cruel"andfast_stimuli == "love"can never be true, sincefast_stimuliis a list, and "cruel" and "love" are strings.Hello Flaad,
After several trials, I got this code work exactly just what I want. I just simply change :
if key is None:
if trial.stimuli[0].text == 'cruel':
correct = 'true miss'
else:
correct = 'false miss'
else:
if trial.stimuli[0].text == 'cruel' and expyriment.misc.constants.K_SPACE:
correct = 'false hit'
else:
correct = 'true hit'
and this is also work if I set the reaction times (rt) to None. Yes the fast_stimuli will never meet the criteria because I got the comparison logic wrong in the beginning. I attached my final code. Hope this help and many thanks for the advice.