Hi Dave,
My apologies for the confusion! Here is a revised description.
The main problem we have is in the test phase, where participants have to indicate whether the picture they see on the screen is an old, similar, or new picture compared to the exposure phase, where they only judge whether the picture shows an indoor or outdoor item. There are three stimulus triggers and three response triggers in total in the test phase.
Stimulus triggers (called target, lure, and foil, respectively) are as follows.
<port targetsignal>
/ port = LPT1
/ subport = data
/ items = ("00010100")
</port>
<port luresignal>
/ port = LPT1
/ subport = data
/ items = ("00011110")
</port>
<port foilsignal>
/ port = LPT1
/ subport = data
/ items = ("00101000")
</port>
Response triggers (called old, similar, and new, respectively) are as follows.
<port oldsignal>
/ port = LPT1
/ subport = data
/ items = ("00110111")
</port>
<port similarsignal>
/ port = LPT1
/ subport = data
/ items = ("01000010")
</port>
<port newsignal>
/ port = LPT1
/ subport = data
/ items = ("01001101")
</port>
Each trial lasts 2500 ms. When a picture shows up on the screen, Inquisit sends out a stimulus trigger that corresponds to the type of picture (i.e. target, lure, or foil). When a participant makes a response, Inquisit sends out a response trigger that corresponds to the type of response people make (i.e. old, similar, or new). When participants make a response by 2500 ms, all triggers work well as we can see one stimulus trigger and one response trigger in each trial. However, when the responses were made right at 2500 ms, we saw two issues.
1. When the RT of one trial is right at 2500 ms, the behavioural data we extracted showed "no response" for that particular trial, which is correct. But in the bdf (which is an EEG data file), we saw that in addition to no response trigger for that particular trial, the response trigger seemed to overlap with the following stimulus trigger of the next trial. So the order is: stimulus trigger A -> no response trigger -> A trigger that combines response trigger A and stimulus trigger B -> response trigger B.
2. We also saw some trials have a RT of 50 ms, which is not a probable RT people could have. We suspect these could due to the slow RT, where a response triggers was sent out so late that it was counted into the next trial. For this case, we would like to disregard the <50 ms response trigger from the previous trial and record the actual response for the current trial.
We wonder:
1. Is there a way to disregard a 2500 ms response trigger and make sure there is always a stimulus trigger sent out when there is an overlap between stimulus and response trigger?
2. Is there a 50 ms buffer we can add to our code that can prevent any response that is <50 ms from being recorded in both behaviour and EEG data?
The following are the three trials in which stimulus and response triggers were added.
<trial target>/ontrialbegin = [
values.stimulusselect = list.targets.nextvalue;
trial.target.insertstimulusframe(picture.target, 1);
trial.target.insertstimulustime(clearscreen, parameters.stimulusduration);
trial.target.insertstimulustime(port.targetsignal, 50)
]
/stimulusframes = [1 = responsekeys_part2, targetsignal]
/validresponse = (values.responsekey_old, values.responsekey_similar, values.responsekey_new)
/ correctresponse = (values.responsekey_old)
/ responsemessage = (values.responsekey_old, oldsignal, 0)
/ responsemessage = (values.responsekey_similar, similarsignal, 0)
/ responsemessage = (values.responsekey_new, newsignal, 0)
/beginresponseframe = 1
/responseinterrupt = frames
/ontrialend = [
trial.target.resetstimulusframes();
if (trial.target.responsetext == values.responsekey_old) {
values.responseCategory = "old";
} else if (trial.target.responsetext == values.responsekey_new) {
values.responseCategory = "new";
} else if (trial.target.responsetext == values.responsekey_similar) {
values.responseCategory = "similar";
} else if (trial.target.response == 0) {
values.responseCategory = "";
values.count_noresponses += 1;
};
values.stimulus = picture.target.currentitem;
values.count_targets += 1;
if (trial.target.response != 0) {
values.count_targets_corr += 1;
if (trial.target.correct) {
values.count_oldtargets += 1;
} else if (trial.target.responsetext == values.responsekey_similar) {
values.count_simtargets += 1;
} else if (trial.target.responsetext == values.responsekey_new) {
values.count_newtargets += 1
};
};
]
/trialduration = (parameters.stimulusduration + parameters.ISI)
/recorddata = true
/branch = [return trial.part2;]
</trial>
Note:
* presents a foil for parameters.stimulusduration
* collects response during that time
* updates summary variables
* calls trial.part2
<trial foil>/ontrialbegin = [
values.stimulusselect = list.foils.nextvalue;
trial.foil.insertstimulusframe(picture.foil, 1);
trial.foil.insertstimulustime(clearscreen, parameters.stimulusduration);
trial.target.insertstimulustime(port.foilsignal, 50)
]
/stimulusframes = [1 = responsekeys_part2, foilsignal]
/validresponse = (values.responsekey_old, values.responsekey_similar, values.responsekey_new)
/ correctresponse = (values.responsekey_new)
/ responsemessage = (values.responsekey_old, oldsignal, 0)
/ responsemessage = (values.responsekey_similar, similarsignal, 0)
/ responsemessage = (values.responsekey_new, newsignal, 0)
/beginresponseframe = 1
/responseinterrupt = frames
/ontrialend = [
trial.foil.resetstimulusframes();
if (trial.foil.responsetext == values.responsekey_old) {
values.responseCategory = "old";
} else if (trial.foil.responsetext == values.responsekey_new) {
values.responseCategory = "new";
} else if (trial.foil.responsetext == values.responsekey_similar) {
values.responseCategory = "similar";
} else if (trial.foil.response == 0) {
values.responseCategory = "";
values.count_noresponses += 1;
};
values.stimulus = picture.foil.currentitem;
values.count_foils += 1;
if (trial.foil.response != 0) {
values.count_foils_corr += 1;
if (trial.foil.correct) {
values.count_newfoils += 1;
} else if (trial.foil.responsetext == values.responsekey_old) {
values.count_oldfoils += 1
} else if (trial.foil.responsetext == values.responsekey_similar) {
values.count_simfoils += 1;
};
};
]
/trialduration = (parameters.stimulusduration + parameters.ISI)
/recorddata = true
/branch = [return trial.part2;]
</trial>
Note:
* presents a lure for parameters.stimulusduration
* collects response during that time
* updates summary variables
* calls trial.part2
<trial lure>/ontrialbegin = [
values.stimulusselect = list.lures.nextvalue;
values.lurebin = item.lurebins.item(values.stimulusselect);
if (values.lurebin == 1) {
values.L1 += 1;
} else if (values.lurebin == 2) {
values.L2 += 1;
} else if (values.lurebin == 3) {
values.L3 += 1;
} else if (values.lurebin == 4) {
values.L4 += 1;
} else if (values.lurebin == 5) {
values.L5 += 1;
} else {
values.lurebin = "NA";
};
trial.lure.insertstimulusframe(picture.lure, 1);
trial.lure.insertstimulustime(clearscreen, parameters.stimulusduration);
trial.target.insertstimulustime(port.luresignal, 50)
]
/stimulusframes = [1 = responsekeys_part2, luresignal]
/validresponse = (values.responsekey_old, values.responsekey_similar, values.responsekey_new)
/beginresponseframe = 1
/ correctresponse = (values.responsekey_similar)
/ responsemessage = (values.responsekey_similar, similarsignal, 0)
/ responsemessage = (values.responsekey_old, oldsignal, 0)
/ responsemessage = (values.responsekey_new, newsignal, 0)
/responseinterrupt = frames
/ontrialend = [
trial.lure.resetstimulusframes();
if (trial.lure.responsetext == values.responsekey_old) {
values.responseCategory = "old";
} else if (trial.lure.responsetext == values.responsekey_new) {
values.responseCategory = "new";
} if (trial.lure.responsetext == values.responsekey_similar) {
values.responseCategory = "similar";
} else if (trial.lure.response == 0) {
values.responseCategory = "";
values.count_noresponses += 1;
};
values.stimulus = picture.lure.currentitem;
values.count_lures += 1;
if (trial.lure.response != 0) {
values.count_lures_corr += 1;
if (trial.lure.correct) {
values.count_simlures += 1;
} else if (trial.lure.responsetext == values.responsekey_old) {
values.count_oldlures += 1;
} else if (trial.lure.responsetext == values.responsekey_new) {
values.count_newlures += 1;
};
};
if (values.lurebin == "1"){
if (trial.lure.responsetext == values.responsekey_old){
values.L1O +=1;
} else if (trial.lure.responsetext == values.responsekey_similar){
values.L1S +=1;
} else if (trial.lure.responsetext == values.responsekey_new){
values.L1N +=1;
} else if ( trial.lure.response == 0){
values.L1_NR += 1;
};
} else if (values.lurebin == "2"){
if (trial.lure.responsetext == values.responsekey_old){
values.L2O +=1;
} else if (trial.lure.responsetext == values.responsekey_similar){
values.L2S +=1;
} else if (trial.lure.responsetext == values.responsekey_new){
values.L2N +=1;
} else if ( trial.lure.response == 0){
values.L2_NR += 1;
};
} else if (values.lurebin == "3"){
if (trial.lure.responsetext == values.responsekey_old){
values.L3O +=1;
} else if (trial.lure.responsetext == values.responsekey_similar){
values.L3S +=1;
} else if (trial.lure.responsetext == values.responsekey_new){
values.L3N +=1;
} else if ( trial.lure.response == 0){
values.L3_NR += 1;
};
} else if (values.lurebin == "4"){
if (trial.lure.responsetext == values.responsekey_old){
values.L4O +=1;
} else if (trial.lure.responsetext == values.responsekey_similar){
values.L4S +=1;
} else if (trial.lure.responsetext == values.responsekey_new){
values.L4N +=1;
} else if ( trial.lure.response == 0){
values.L4_NR += 1;
};
} else if (values.lurebin == "5"){
if (trial.lure.responsetext == values.responsekey_old){
values.L5O +=1;
} else if (trial.lure.responsetext == values.responsekey_similar){
values.L5S +=1;
} else if (trial.lure.responsetext == values.responsekey_new){
values.L5N +=1;
} else if ( trial.lure.response == 0){
values.L5_NR += 1;
};
};
]
/trialduration = (parameters.stimulusduration + parameters.ISI)
/recorddata = true
/branch = [return trial.part2;]
</trial>
Thanks for the help!