How to set eye-tracker markers for each block for the emotional Go/No Go task


How to set eye-tracker markers for each block for the emotional Go/No...

Author
Message
jnmchan
jnmchan
New Member
New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)

Group: Forum Members
Posts: 7, Visits: 34
Hi 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!






Attachments
Dave
Dave
Supreme Being
Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
jnmchan - 10/30/2019
Hi 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.

Edited
2 Months Ago by Dave
Dave
Dave
Supreme Being
Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
Dave - 10/31/2019
jnmchan - 10/30/2019
Hi 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.

For the sake of illustration, suppose you wish to send the marker value 1 during during practice go trials, and the value 2 for practice no go trials, at the time the practice stimulus is presented.

You have already define a marker <port> element as

<port marker>
/ items = (0)
/ port = eyetracker
/ erase = false
</port>

so then you can do

<trial go_practice>
/ ontrialbegin = [
port.marker.setitem(1, 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, marker]
/ 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>

and for the no-go trial

<trial nogo_practice>
/ ontrialbegin = [
port.marker.setitem(2, 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, marker]
/ 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>

jnmchan
jnmchan
New Member
New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)

Group: Forum Members
Posts: 7, Visits: 34
Dave - 10/31/2019
jnmchan - 10/30/2019
Hi 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.  


   
Dave
Dave
Supreme Being
Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
jnmchan - 11/3/2019
Dave - 10/31/2019
jnmchan - 10/30/2019
Hi 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.

jnmchan
jnmchan
New Member
New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)

Group: Forum Members
Posts: 7, Visits: 34
Dave - 11/4/2019
jnmchan - 11/3/2019
Dave - 10/31/2019
jnmchan - 10/30/2019
Hi 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>

Dave
Dave
Supreme Being
Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
jnmchan - 11/7/2019
Dave - 11/4/2019
jnmchan - 11/3/2019
Dave - 10/31/2019
jnmchan - 10/30/2019
Hi 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>

Define a <port> element with the value you wish to send along with the fixation stimulus

<port fixationmarker>
/ items = (10)
...
</port>

and then insert the port along with the fixation text in your trial elements.

<trial start>
/ ontrialbegin = [
text.fixation.textcolor = white;
]
/ stimulusframes = [1 = fixation, fixationmarker]
/ trialduration = parameters.startFixation
/ recorddata = false
</trial>

<trial go>
/ ontrialbegin = [
...
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(port.fixationmarker, parameters.picDuration);
trial.go.insertstimulustime(text.fixation, parameters.responseDuration);
trial.go.insertstimulustime(port.fixationmarker, parameters.responseDuration);
values.iti = list.iti.nextvalue;
]
...
</trial>

etc.

jnmchan
jnmchan
New Member
New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)

Group: Forum Members
Posts: 7, Visits: 34
Dave - 11/7/2019
jnmchan - 11/7/2019
Dave - 11/4/2019
jnmchan - 11/3/2019
Dave - 10/31/2019
jnmchan - 10/30/2019
Hi 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>

Define a <port> element with the value you wish to send along with the fixation stimulus

<port fixationmarker>
/ items = (10)
...
</port>

and then insert the port along with the fixation text in your trial elements.

<trial start>
/ ontrialbegin = [
text.fixation.textcolor = white;
]
/ stimulusframes = [1 = fixation, fixationmarker]
/ trialduration = parameters.startFixation
/ recorddata = false
</trial>

<trial go>
/ ontrialbegin = [
...
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(port.fixationmarker, parameters.picDuration);
trial.go.insertstimulustime(text.fixation, parameters.responseDuration);
trial.go.insertstimulustime(port.fixationmarker, parameters.responseDuration);
values.iti = list.iti.nextvalue;
]
...
</trial>

etc.

Thank you so much Dave! Finally I got the fixation marker and all block markers as well. So happy to learn from you.
jnmchan
jnmchan
New Member
New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)New Member (41 reputation)

Group: Forum Members
Posts: 7, Visits: 34
Dave - 11/7/2019
jnmchan - 11/7/2019
Dave - 11/4/2019
jnmchan - 11/3/2019
Dave - 10/31/2019
jnmchan - 10/30/2019
Hi 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>

Define a <port> element with the value you wish to send along with the fixation stimulus

<port fixationmarker>
/ items = (10)
...
</port>

and then insert the port along with the fixation text in your trial elements.

<trial start>
/ ontrialbegin = [
text.fixation.textcolor = white;
]
/ stimulusframes = [1 = fixation, fixationmarker]
/ trialduration = parameters.startFixation
/ recorddata = false
</trial>

<trial go>
/ ontrialbegin = [
...
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(port.fixationmarker, parameters.picDuration);
trial.go.insertstimulustime(text.fixation, parameters.responseDuration);
trial.go.insertstimulustime(port.fixationmarker, parameters.responseDuration);
values.iti = list.iti.nextvalue;
]
...
</trial>

etc.

Dear Dave,
Thank you very much for your kind help previously. As now I'm thinking about how to generate a heat map by using gaze pt data from inquisit. May I ask you how could I using the gaze point raw data to generate a heat map of the task from inquisit?
Is it possible to output a heat map directly from inquisit? or any other software should I use to generate it? 
Many thanks,
JK

Dave
Dave
Supreme Being
Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)Supreme Being (749K reputation)

Group: Administrators
Posts: 9.9K, Visits: 49K
jnmchan - 11/28/2019
Dave - 11/7/2019
jnmchan - 11/7/2019
Dave - 11/4/2019
jnmchan - 11/3/2019
Dave - 10/31/2019
jnmchan - 10/30/2019
Hi 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>

Define a <port> element with the value you wish to send along with the fixation stimulus

<port fixationmarker>
/ items = (10)
...
</port>

and then insert the port along with the fixation text in your trial elements.

<trial start>
/ ontrialbegin = [
text.fixation.textcolor = white;
]
/ stimulusframes = [1 = fixation, fixationmarker]
/ trialduration = parameters.startFixation
/ recorddata = false
</trial>

<trial go>
/ ontrialbegin = [
...
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(port.fixationmarker, parameters.picDuration);
trial.go.insertstimulustime(text.fixation, parameters.responseDuration);
trial.go.insertstimulustime(port.fixationmarker, parameters.responseDuration);
values.iti = list.iti.nextvalue;
]
...
</trial>

etc.

Dear Dave,
Thank you very much for your kind help previously. As now I'm thinking about how to generate a heat map by using gaze pt data from inquisit. May I ask you how could I using the gaze point raw data to generate a heat map of the task from inquisit?
Is it possible to output a heat map directly from inquisit? or any other software should I use to generate it? 
Many thanks,
JK

No, Inquisit cannot output a heatmap; you may, however, want Inquisit to create screencaptures to facilitate later heatmap generation using some external software ( https://www.millisecond.com/support/docs/v5/html/language/attributes/screencapture.htm ). There are various software packages around that allow for generating heatmaps, e.g. https://github.com/esdalmaijer/PyGazeAnalyser / https://www.pygaze.org/2015/06/pygaze-analyser/ . For more generic solutions, see e.g. https://stackoverflow.com/questions/2369492/generate-a-heatmap-in-matplotlib-using-a-scatter-data-set or https://stackoverflow.com/questions/16118566/creating-heatmap-with-r-with-eye-tracker-data

GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search