+x+x+x+xHi all,
As emotional Go/Nogo task is originally not a task with eyetracker but I would like to link it with eyetracker (Tobii Pro X3-120) to collect gaze data. However, I found some script problem on porting marker for practice block and test block. I would like to seek your help for event marker set-up for emotional Go/Nogo task. As I tried to add eyetracker and port marker coding but I couldn't identify the marker for each emotional block from the gaze file.
Would anyone please tell me what's wrong with my script in this inqusit task? and Could you also teach me how to show the marker values in the gaze file?
Attached please find my task script. thank you all so much!
The <port> element behaves like any other stimulus in Inquisit. I.e. you need to actually "display" the stimulus just like you would a <text> element to send the marker out, i.e. include it in the <trial>s' /stimulustimes or -frames. Moreover, your port needs to actually send some non-zero value, and yours doesn't do that. It is simply set to nothing.
I cannot give you any concrete code example, since you did not explain at all when you wish to send the marker or markers, what marker values you wish to send, etc. These are all things you need to decide first.
Thank you so much for your kind help! I'm sorry for my rough description. I would like to port some makers to identify for each emotional block (i.e. Marker 1 for block AN, marker 2 for block FN etc.). I don't know how to edit the trial content to port those markers and showing them in the gaze file. Attached please find a pic for what problem I'm facing now. Really appreciate for your help on my task! Thank you so much!
The marker just showed "Zero" values so I would like to set it as an identical value then I could know and identity the eyetracker data in which block.
You can create a global variable for the marker valiue you wish to send
<values>
/ marker = 0
</values>
set that marker value based on the current block / condition and display the port stimulus as I explained previously:
<trial go>
/ ontrialbegin = [
if (values.condition == "NF"){
trial.go.insertstimulustime(picture.neutral, 0);
values.marker = 1;} else if (values.condition == "FN"){
trial.go.insertstimulustime(picture.fear, 0);
values.marker = 2;} else if (values.condition == "HN"){
trial.go.insertstimulustime(picture.happy, 0);
values.marker = 3;} else if (values.condition == "NH"){
trial.go.insertstimulustime(picture.neutral, 0);
values.marker = 4;} else if (values.condition == "NA"){
trial.go.insertstimulustime(picture.neutral, 0);
values.marker = 5;} else if (values.condition == "AN"){
trial.go.insertstimulustime(picture.angry, 0);
values.marker = 6;} else if (values.condition == "SN"){
trial.go.insertstimulustime(picture.sad, 0);
values.marker = 7;} else if (values.condition == "NS"){
trial.go.insertstimulustime(picture.neutral, 0);
values.marker = 8;
};
port.marker.setitem(values.marker, 1);trial.go.insertstimulustime(port.marker, 0);trial.go.insertstimulustime(clearscreen, parameters.picDuration);
trial.go.insertstimulustime(text.fixation, parameters.picDuration);
trial.go.insertstimulustime(text.fixation, parameters.responseDuration);
values.iti = list.iti.nextvalue;
]
/ validresponse = (parameters.goKey, 0)
/ correctresponse = (parameters.goKey)
/ beginresponsetime = 0
/ responseinterrupt = frames
/ timeout = parameters.responseDuration
/ ontrialend = [
trial.go.resetstimulusframes();
values.response_time = trial.go.latency;
list.Hits.appenditem(trial.go.correct);
if (trial.go.correct){
list.hitRT.appenditem(trial.go.latency);
};
if (values.condition == "NF"){
values.image = picture.neutral.currentitem;
list.Hits_NF.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_NF.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
} else if (values.condition == "FN"){
values.image = picture.fear.currentitem;
list.Hits_FN.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_FN.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
} else if (values.condition == "HN"){
values.image = picture.happy.currentitem;
list.Hits_HN.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_HN.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
} else if (values.condition == "NH"){
values.image = picture.neutral.currentitem;
list.Hits_NH.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_NH.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
} else if (values.condition == "NS"){
values.image = picture.neutral.currentitem;
list.Hits_NS.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_NS.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";};
} else if (values.condition == "SN"){
values.image = picture.sad.currentitem;
list.Hits_SN.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_SN.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
} else if (values.condition == "NA"){
values.image = picture.neutral.currentitem;
list.Hits_NA.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_NA.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";};
} else if (values.condition == "AN"){
values.image = picture.angry.currentitem;
list.Hits_AN.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_AN.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
};
]
/ posttrialpause = values.iti
</trial>
<trial nogo> needs to be changed analogously.
Thank you so much Dave! Finally the markers are showed up in my gaze data file. Attached please see my updated script below. Please advise me if you find any wrong script inside the task.
May I ask one more question is how to set a value.marker for the fixation cross in this task? As the fixation cross will be showed up before each emotional pic but I don't know how to separate it and set a marker for it.
Thank you so much for your kind help!
<eyetracker>
/ plugin = "tobii"
/ aoidurationthreshold = 500
/ ipaddress = "127.0.0.1"
</eyetracker>
<parameters>
/fixationSize = 10%
/picSize = 50%
/runPractice = true
/practiceFeedbackDuration = 1000
/getReadyDuration = 5000
/startFixation = 2500
/endFixation = 2000
/picDuration = 500
/responseDuration = 1500
/goKey = 57
</parameters>
<port practiceGoFaceMarker>
/ items = (10)
/ port = eyetracker
/ erase = false
</port>
<port practiceNogoFaceMarker>
/ items = (20)
/ port = eyetracker
/ erase = false
</port>
<port traiGoFaceMarker>
/ items = (1000)
/ port = eyetracker
/ erase = false
</port>
<port trialNogoFaceMarker>
/ items = (2000)
/ port = eyetracker
/ erase = false
</port>
<values>
/ marker = (0)
</values>
********************************************************************************************************
<trial go_practice>
/ ontrialbegin = [
port.practiceGoFaceMarker.setitem(10,1);
trial.go_practice.insertstimulustime(clearscreen, parameters.picDuration);
trial.go_practice.insertstimulustime(text.fixation, parameters.picDuration);
trial.go_practice.insertstimulustime(text.fixation, parameters.responseDuration);
values.iti = list.iti.nextvalue;
]
/ stimulustimes = [0 = practice, practiceGoFaceMarker]
/ validresponse = (parameters.goKey, 0)
/ correctresponse = (parameters.goKey)
/ beginresponsetime = 0
/ responseinterrupt = frames
/ timeout = parameters.responseDuration
/ ontrialend = [
trial.go_practice.resetstimulusframes();
values.response_time = trial.go_practice.latency;
values.image = picture.practice.currentitem;
if (trial.go_practice.correct){
values.response_outcome = "HIT";
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
]
/ branch = [
trial.feedback;
]
</trial>
<trial nogo_practice>
/ ontrialbegin = [
port.practiceNogoFaceMarker.setitem(20,1);
trial.nogo_practice.insertstimulustime(clearscreen, parameters.picDuration);
trial.nogo_practice.insertstimulustime(text.fixation, parameters.picDuration);
trial.nogo_practice.insertstimulustime(text.fixation, parameters.responseDuration);
values.iti = list.iti.nextvalue;
]
/ stimulustimes = [0 = practice_neutral, practiceNogoFaceMarker]
/ validresponse = (parameters.goKey, 0)
/ correctresponse = (0)
/ beginresponsetime = 0
/ responseinterrupt = frames
/ timeout = parameters.responseDuration
/ ontrialend = [
trial.nogo_practice.resetstimulusframes();
values.response_time = trial.nogo_practice.latency;
values.image = picture.neutral.currentitem;
if (trial.nogo_practice.correct){
values.response_outcome = "CR";
values.response_time = "";
} else {
values.response_outcome = "FA";
};
]
/ branch = [
trial.feedback;
]
</trial>
<trial feedback>
/ ontrialbegin = [
if (values.response_outcome == "HIT" || values.response_outcome == "CR"){
text.errorFeedback.skip= true;
text.correctFeedback.skip = false;
} else {
text.errorFeedback.skip= false;
text.correctFeedback.skip = true;
};
]
/ stimulusframes = [1 = correctFeedback, errorFeedback]
/ timeout = parameters.practiceFeedbackDuration
/ posttrialpause = values.iti
/ recorddata = false
</trial>
**************************************************************************************************************
**************************************************************************************************************
TRIALS
**************************************************************************************************************
**************************************************************************************************************
<trial start>
/ ontrialbegin = [
text.fixation.textcolor = white;
]
/ stimulusframes = [1 = fixation]
/ trialduration = parameters.startFixation
/ recorddata = false
</trial>
<trial end>
/ ontrialbegin = [
text.fixation.textcolor = red;
]
/ stimulusframes = [1 = fixation]
/ trialduration = parameters.endFixation
/ recorddata = false
</trial>
<trial go>
/ ontrialbegin = [
if (values.condition == "NF"){
trial.go.insertstimulustime(picture.neutral, 0);
values.marker = (31);
} else if (values.condition == "FN"){
trial.go.insertstimulustime(picture.fear, 0);
values.marker = (32);
} else if (values.condition == "HN"){
trial.go.insertstimulustime(picture.happy, 0);
values.marker = (33);
} else if (values.condition == "NH"){
trial.go.insertstimulustime(picture.neutral, 0);
values.marker = (34);
} else if (values.condition == "NA"){
trial.go.insertstimulustime(picture.neutral, 0);
values.marker = (35);
} else if (values.condition == "AN"){
trial.go.insertstimulustime(picture.angry, 0);
values.marker = (36);
} else if (values.condition == "SN"){
trial.go.insertstimulustime(picture.sad, 0);
values.marker = (37);
} else if (values.condition == "NS"){
trial.go.insertstimulustime(picture.neutral, 0);
values.marker = (38);
};
port.traiGoFaceMarker.setitem(values.marker, 1);
trial.go.insertstimulustime(port.traiGoFaceMarker, 0);
trial.go.insertstimulustime(clearscreen, parameters.picDuration);
trial.go.insertstimulustime(text.fixation, parameters.picDuration);
trial.go.insertstimulustime(text.fixation, parameters.responseDuration);
values.iti = list.iti.nextvalue;
]
/ validresponse = (parameters.goKey, 0)
/ correctresponse = (parameters.goKey)
/ beginresponsetime = 0
/ responseinterrupt = frames
/ timeout = parameters.responseDuration
/ ontrialend = [
trial.go.resetstimulusframes();
values.response_time = trial.go.latency;
list.Hits.appenditem(trial.go.correct);
if (trial.go.correct){
list.hitRT.appenditem(trial.go.latency);
};
if (values.condition == "NF"){
values.image = picture.neutral.currentitem;
list.Hits_NF.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_NF.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
} else if (values.condition == "FN"){
values.image = picture.fear.currentitem;
list.Hits_FN.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_FN.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
} else if (values.condition == "HN"){
values.image = picture.happy.currentitem;
list.Hits_HN.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_HN.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
} else if (values.condition == "NH"){
values.image = picture.neutral.currentitem;
list.Hits_NH.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_NH.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
} else if (values.condition == "NS"){
values.image = picture.neutral.currentitem;
list.Hits_NS.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_NS.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";};
} else if (values.condition == "SN"){
values.image = picture.sad.currentitem;
list.Hits_SN.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_SN.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
} else if (values.condition == "NA"){
values.image = picture.neutral.currentitem;
list.Hits_NA.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_NA.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";};
} else if (values.condition == "AN"){
values.image = picture.angry.currentitem;
list.Hits_AN.appenditem(trial.go.correct);
if (trial.go.correct){
values.response_outcome = "HIT";
list.hitRT_AN.appenditem(trial.go.latency);
} else {
values.response_outcome = "MISS";
values.response_time = "";
};
};
]
/ posttrialpause = values.iti
</trial>
<trial nogo>
/ ontrialbegin = [
if (values.condition == "NF"){
trial.nogo.insertstimulustime(picture.fear, 0);
values.marker = (41);
} else if (values.condition == "FN"){
trial.nogo.insertstimulustime(picture.neutral, 0);
values.marker = (42);
} else if (values.condition == "HN"){
trial.nogo.insertstimulustime(picture.neutral, 0);
values.marker = (43);
} else if (values.condition == "NH"){
trial.nogo.insertstimulustime(picture.happy, 0);
values.marker = (44);
} else if (values.condition == "NA"){
trial.nogo.insertstimulustime(picture.angry, 0);
values.marker = (45);
} else if (values.condition == "AN"){
trial.nogo.insertstimulustime(picture.neutral, 0);
values.marker = (46);
} else if (values.condition == "SN"){
trial.nogo.insertstimulustime(picture.neutral, 0);
values.marker = (47);
} else if (values.condition == "NS"){
trial.nogo.insertstimulustime(picture.sad, 0);
values.marker = (48);
};
port.trialNogoFaceMarker.setitem(values.marker, 1);
trial.nogo.insertstimulustime(port.trialNogoFaceMarker, 0);
trial.nogo.insertstimulustime(clearscreen, parameters.picDuration);
trial.nogo.insertstimulustime(text.fixation, parameters.picDuration);
trial.nogo.insertstimulustime(text.fixation, parameters.responseDuration);
values.iti = list.iti.nextvalue;
]
/ validresponse = (parameters.goKey, 0)
/ correctresponse = (0)
/ beginresponsetime = 0
/ responseinterrupt = frames
/ timeout = parameters.responseDuration
/ ontrialend = [
trial.nogo.resetstimulusframes();
values.response_time = trial.nogo.latency;
list.FAs.appenditem(trial.nogo.error);
if (values.condition == "NF"){
values.image = picture.fear.currentitem;
list.FAs_NF.appenditem(trial.nogo.error);
if (trial.nogo.correct){
values.response_outcome = "CR";
values.response_time = "";
} else {
values.response_outcome = "FA";
};
} else if (values.condition == "FN"){
values.image = picture.neutral.currentitem;
list.FAs_FN.appenditem(trial.nogo.error);
if (trial.nogo.correct){
values.response_outcome = "CR";
values.response_time = "";
} else {
values.response_outcome = "FA";
};
} else if (values.condition == "HN"){
values.image = picture.neutral.currentitem;
list.FAs_HN.appenditem(trial.nogo.error);
if (trial.nogo.correct){
values.response_outcome = "CR";
values.response_time = "";
} else {
values.response_outcome = "FA";
};
} else if (values.condition == "NH"){
values.image = picture.happy.currentitem;
list.FAs_NH.appenditem(trial.nogo.error);
if (trial.nogo.correct){
values.response_outcome = "CR";
values.response_time = "";
} else {
values.response_outcome = "FA";
};
} else if (values.condition == "SN"){
values.image = picture.neutral.currentitem;
list.FAs_SN.appenditem(trial.nogo.error);
if (trial.nogo.correct){
values.response_outcome = "CR";
values.response_time = "";
} else {
values.response_outcome = "FA";
};
} else if (values.condition == "NS"){
values.image = picture.sad.currentitem;
list.FAs_NS.appenditem(trial.nogo.error);
if (trial.nogo.correct){
values.response_outcome = "CR";
values.response_time = "";
} else {
values.response_outcome = "FA";
};
} else if (values.condition == "AN"){
values.image = picture.neutral.currentitem;
list.FAs_AN.appenditem(trial.nogo.error);
if (trial.nogo.correct){
values.response_outcome = "CR";
values.response_time = "";
} else {
values.response_outcome = "FA";
};
} else if (values.condition == "NA"){
values.image = picture.angry.currentitem;
list.FAs_NA.appenditem(trial.nogo.error);
if (trial.nogo.correct){
values.response_outcome = "CR";
values.response_time = "";
} else {
values.response_outcome = "FA";
};
};
]
/ posttrialpause = values.iti;
</trial>
**************************************************************************************************************
**************************************************************************************************************
BLOCKS
**************************************************************************************************************
**************************************************************************************************************
<block intro>
/ onblockbegin = [
values.GoFaces = "";
values.NogoFaces = "";
]
/ trials = [1-2 = instructions]
</block>
<block practice>
/ skip = [
parameters.runPractice == false;
]
/ onblockbegin = [
values.GoFaces = "驚訝";
values.Nogofaces = "自然";
values.condition = "practice";
]
/ trials = [
1 = blockInstructions;
2 = getReady;
3 = start;
4-8 = noreplace(go_practice, nogo_practice);
9 = end;
]
/ onblockend = [
list.hits.reset();
list.FAs.reset();
list.hitRT.reset();
]
/ datastreams = eyetracker
</block>
<block testInstructions>
/ onblockbegin = [
picture.happy.resetselection();
picture.neutral.resetselection();
list.iti.reset();
]
/ trials = [1 = testInstructions]
/ datastreams = eyetracker
</block>
<block NF>
/ onblockbegin = [
values.condition = "NF";
values.GoFaces = "自然";
values.NogoFaces = "害怕";
text.instructions.textcolor = turquoise;
list.iti.reset();
picture.neutral.resetselection();
picture.fear.resetselection();
]
/ trials = [1 = blockInstructions; 2 = getReady; 3 = start; 4-33 = noreplace(go, go, nogo); 34 = end]
/ datastreams = eyetracker
</block>
<block FN>
/ onblockbegin = [
values.condition = "FN";
values.GoFaces = "害怕"; values.NogoFaces = "自然";
text.instructions.textcolor = yellow;
list.iti.reset();
picture.neutral.resetselection();
picture.fear.resetselection();
]
/ trials = [1 = blockInstructions; 2 = getReady; 3 = start; 4-33 = noreplace(go, go, nogo); 34 = end]
/ datastreams = eyetracker
</block>
<block NH>
/ onblockbegin = [
values.condition = "NH";
values.GoFaces = "自然";
values.NogoFaces = "開心";
text.instructions.textcolor = turquoise;
list.iti.reset();
picture.neutral.resetselection();
picture.happy.resetselection();
]
/ trials = [1 = blockInstructions; 2 = getReady; 3 = start; 4-33 = noreplace(go, go, nogo); 34 = end]
/ datastreams = eyetracker
</block>
<block HN>
/ onblockbegin = [
values.condition = "HN";
values.GoFaces = "開心";
values.NogoFaces = "自然";
text.instructions.textcolor = red;
list.iti.reset();
picture.neutral.resetselection();
picture.happy.resetselection();
]
/ trials = [1 = blockInstructions; 2 = getReady; 3 = start; 4-33 = noreplace(go, go, nogo); 34 = end]
/ datastreams = eyetracker
</block>
<block NS>
/ onblockbegin = [
values.condition = "NS";
values.GoFaces = "自然";
values.NogoFaces = "傷心";
text.instructions.textcolor = turquoise;
list.iti.reset();
picture.neutral.resetselection();
picture.sad.resetselection();
]
/ trials = [1 = blockInstructions; 2 = getReady; 3 = start; 4-33 = noreplace(go, go, nogo); 34 = end]
/ datastreams = eyetracker
</block>
<block SN>
/ onblockbegin = [
values.condition = "SN";
values.GoFaces = "傷心";
values.NogoFaces = "自然";
text.instructions.textcolor = red;
list.iti.reset();
picture.neutral.resetselection();
picture.sad.resetselection();
]
/ trials = [1 = blockInstructions; 2 = getReady; 3 = start; 4-33 = noreplace(go, go, nogo); 34 = end]
/ datastreams = eyetracker
</block>
<block NA>
/ onblockbegin = [
values.condition = "NA";
values.GoFaces = "自然";
values.NogoFaces = "憤怒";
text.instructions.textcolor = turquoise;
list.iti.reset();
picture.neutral.resetselection();
picture.angry.resetselection();
]
/ trials = [1 = blockInstructions; 2 = getReady; 3 = start; 4-33 = noreplace(go, go, nogo); 34 = end]
/ datastreams = eyetracker
</block>
<block AN>
/ onblockbegin = [
values.condition = "AN";
values.GoFaces = "憤怒";
values.NogoFaces = "自然";
text.instructions.textcolor = red;
list.iti.reset();
picture.neutral.resetselection();
picture.angry.resetselection();
]
/ trials = [1 = blockInstructions; 2 = getReady; 3 = start; 4-33 = noreplace(go, go, nogo); 34 = end]
/ datastreams = eyetracker
</block>
<block finish>
/ trials = [1 = finish]
</block>
**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************
<expt>
/ blocks = [
1 = intro;
2 = practice;
3-10 = noreplace(block.AN, block.NA, block.HN, block.NH, block.FN, block.NF, block.SN, block.NS);
11 = finish;
]
/ onexptend = [
values.completed = 1;
]
</expt>