Howdy, Stranger!

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

Supported by

Define correct response with condition

edited December 2023 in OpenSesame

Hi everyone,

I am trying to design an experiment that goes as such:

Three images are presented sequentially (stimulus1, stimulus2, stimulus3). Then, another image appears (I named it "var.question") that might or might have not appeared before , and the participant must answer if they saw it before, by pressing 'z' for yes and 'm' for no.

So long, I have written the code for the stimuli presentation, but I just can not get it right with the keyboard response. I placed a keyboard item, and after that an inline script to set the conditions for the correct_response but I am not sure what my mistakes are.

To define the correct_response I wrote this:

if (var.question == var.stimulus1 or var.question == var.stimulus2 or var.question == var.stimulus3) and var.response == 'z': correct_response = '1'

elif (var.question != var.stimulus1 and var.question != var.stimulus2 and var.question != var.stimulus3) and var.response == 'm': correct_response = '1'

else: correct_response = '0'

Could someone guide me to a solution or a part of the documentation that explains this part? I also attach the full experiment in case it helps.

Thank you!


Comments

Sign In or Register to comment.