Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

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

  • edited December 7

    Hi Tanto,

    I am not sure I understand the problem.

    key, rt = exp.keyboard.wait(duration=1500)
    if key is None:  #  Not responded
        if gonogo_stimulus == "blue square":
            correct = 1
        else:
            correct = -1
    else:
        if gonogo_stimulus == "yellow_square" and key = "random key":
            correct = 2
        else:
            correct = -2
    

    Where correct is coding: -2=missed reject, -1=false hit, 1=hit, 2=reject

    Florian Krause (Developer)
    http://www.expyriment.org

  • 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 data attribute is only available after a call to expyriment.control.start. See also http://docs.expyriment.org/expyriment.control.html#expyriment.control.start.

    Florian Krause (Developer)
    http://www.expyriment.org

Sign In or Register to comment.