+x+xHi!
I've set up a popup so if a participant responds in less than 300ms to a given trial, they see a message that tells them to slow down. Is there a way to make this only show up if they respond in less than 300ms to 3 trials in a row? I thought of setting a parameter that basically says if the last 2 trials were less than 300ms, then show the message. However I'm not sure how to reference the previous 2 trials.
Any help is appreciated! Thanks!
Create a variable (a <values> entry). Whenever a trial's latency is below 300ms, increase the variable by one /ontrialend. If the latency is above 300ms, set the variable to zero /ontrialend. If the variable is equal to 3, branch to your reminder trial and reset the variable to zero.
Thanks so much! I've added the new variable and the following to each trial, but for some reason when I test it out, I still get the slow down message each time I respond in less than 300ms. Perhaps I used the reset function wrong?
<values>
...
/ toofast = 0...
</values>
<trial targetAleft>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = targetA]
/ posttrialpause = parameters.ISI
/ ontrialend = [
if(trial.targetAleft.latency < 300 && script.currenttrial != "toofast") {values.toofast +=1;
} else {values.toofast = 0; };
]
/ branch = [
if ((parameters.showtoofast == true) && (trial.targetAleft.latency < parameters.toofastlatency) && (values.toofast = 3)) {
return trial.toofast; reset(values.toofast) }]
</trial>
I also have this in each block:
<block compatiblepractice_AFArts_WMMath>
/ bgstim = (targetBleftmixed, attributeBleft, targetArightmixed, attributeAright)
/ trials = [
1,3,5,7,9,11,13,15,17,19= random(targetBleft, targetAright);
2,4,6,8,10,12,14,16,18,20 = random(attributeBL, attributeAR)]
/ errormessage = true(error,200)
/ responsemode = correct
/ onblockbegin = [
parameters.showtoofast = true;
]
/ ontrialend = [values.n1a += 1;
if(block.compatiblepractice_AFArts_WMMath.latency <= 10000 && block.compatiblepractice_AFArts_WMMath.currenttrialnumber != 1 && script.currenttrial != "toofast") {
values.sum1a += block.compatiblepractice_AFArts_WMMath.latency;
values.ss1a += (block.compatiblepractice_AFArts_WMMath.latency * block.compatiblepractice_AFArts_WMMath.latency);
values.n_correct += block.compatiblepractice_AFArts_WMMath.correct;
};
if(block.compatiblepractice_AFArts_WMMath.latency < 300 && script.currenttrial != "toofast") {values.toofast +=1;
} else {values.toofast = 0;
}; if(block.compatiblepractice_AFArts_WMMath.latency < 300 && script.currenttrial != "toofast") {
list.RT300.appenditem(1);
} else {
list.RT300.appenditem(0);
};
]
</block>