Group: Forum Members
Posts: 8,
Visits: 159
|
Hi all!
I am creating a simple experiment where participants see a picture of an object, followed by a sound, and must respond with two simultaneous key presses. When participants respond, it should immediately go on to the next trial. The following code does that, which is great. However, I would like it so that pressing just ONE key (either 34 or 38) is recorded as an incorrect response. Currently, pressing just one key does nothing and Inquisit waits for a second key press before moving onto the next trial.
I am assuming the problem lies somewhere in the <trial> element (see below). Anyone have any ideas?
Thank you all in advance :-)
<trial power_low> / inputdevice = keyboard / ontrialbegin = [list.bigstims.nextvalue] / ontrialbegin = [values.Grip = "WHG"; values.Tone = "low"] / ontrialbegin = [values.first_key=0; values.first_key_latency=0; values.second_key=0; values.second_key_latency = 0; values.correctkeys = "34, 38"; ] / stimulustimes = [1 = big_objects; 2000 = sound.low] / validresponse = (34, 38) / isvalidresponse = [if(values.first_key==0) { values.first_key=trial.power_low.response; values.first_key_latency=trial.power_low.latency; false; }; if (values.first_key != 0 && trial.power_low.latency>values.first_key_latency) { values.second_key=trial.power_low.response; values.second_key_latency = trial.power_low.latency; false; }; values.first_key != 0 && values.second_key != 0] / iscorrectresponse = [contains(values.correctkeys, values.first_key) && contains(values.correctkeys, values.second_key) && (values.first_key != values.second_key)] / beginresponsetime = 2000 / responseinterrupt = immediate / recorddata = true / timeout = (7000) / branch = [if (trial.power_low.error) trial.errorfb] / branch = [if (trial.power_low.correct) trial.correctfb] </trial>
|