Millisecond Forums

Modified visual dot probe question

https://forums.millisecond.com/Topic14163.aspx

By Joel Cavallo - 9/9/2014

Hello,
I'm new to Inquisit and I was wondering if someone could help me modify the Alcohol dot probe task (from the task library). In brief, I am trying to change the probe from an "X" to a classification type probe that has either a circle picture or a square picture. As it stands right now, I have modified the alcohol dot probe to include 4 categories of pictures. There are 2 target pictures (ocean and mountain) and 2 distracter filler pictures (prairie tree and laketree). For all 4 of these categories, I am trying to make the probe randomly appear behind one of the images (just like a normal probe), in either the left or right position. I have pasted my entire code below for reference, but at this point, I was thinking about adding:
<picture probe>
/items = probeimage
/select = values.itemnumber
/hposition = values.probe_x
vposition = values.probe_y
/size = (values.imagewidth, values.imageheight)
</picture>

<item probeimage>
/1 = "circle.bmp"
/2 = "square.bmp"

That's about as far as I have gotten. My next instinct was to modify the <trial probe_PIOP> but I'm not sure what to add. PIOP stands for probe in ocean position, and PIMP, stands which stands for probe in mountain position. Any help would be greatly appreciated. Thank you in advance.

-Joel
Below is the code:

Editable Values
********************************************
*******************************************************
/fixationduration/targetduration:    the duration of the fixation cross (default: 500ms)/the targets (default: 1000ms)/
/probeduration:         the duration of the probe presentation (default: 1000ms)

/fixation_posttrialpause :      the posttrialpauses for the fixation crosses/the targets/the probe
/target_posttrialpause/probe_posttrialpause: (by default they are all = 0)
/probe:           the symbol used for the probe (default: X)
/responsekey_left-responsekey_right:   the keyboard scancodes associated with left probe and right probe
/responsekey_left_label:      responsekey labels
/minimum_latency:        the minimum latency of a correct response that is included into summary variables
            (default: 100ms)

Physical Settings of Display:     Note: change the settings to optimize the display on your computer screen
/target_left_x-target_right_x:     the x-coordinate in % of the right/left target (default: 33%, 67%)
/target_y:          the y-coordinate of the target (default: center at 50%)
/fixationcross_height:       the height of the fixation cross (default: 5%)
/probe_height:         the height of the probe (default: 5%)
/imagewidth:         the width of the image (default: 20%)
/imageheight:         the height of the image (default: 20%)

<values>
/fixationduration = 500
/targetduration = 2000
/probeduration = 1000
/fixation_posttrialpause = 0
/target_posttrialpause = 0
/probe_posttrialpause = 0
/probe = "X"
/responsekey_left = 44
/responsekey_right = 53
/responsekey_left_label = "z"
/responsekey_right_label = "?"
/minimum_latency = 100

/target_left_x = 27%
/target_right_x = 73%
/target_y = 50%
/fixationcross_height = 5%
/probe_height = 5%
/imagewidth = 40%
/imageheight = 40%
</values>

*******************************************************
********************************************
Editable Instructions
********************************************
*******************************************************
<instruct>
/ fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 1)
/ txcolor = (0, 0, 0)
/windowsize = (90%, 90%)
/ finishlabel = "Press <Spacebar> to continue"
/ nextkey = (57)
/nextlabel = "Press <Spacebar> to continue"
/prevkey = (28)
/prevlabel = "Press <Enter> to go back"
</instruct>

Note: the main instructions were generously provided by Dr. Fillmore. Customize below.

<page instructions>
This is a reaction time task.

^^Please place the index and middle fingers of your right hand on the <%values.responsekey_left_label%> and <%values.responsekey_right_label%> keys.
You will be presented with a fixation point at the center of the screen followed by a pair of images. These images are of various objects.
You are to look at and focus on both of the pictures while they are on the screen. Do not focus in the center.
You will need to move your eyes back and forth to focus on each of the pictures while they are on the screen. 
Once the images disappear from the screen, an X will appear on either the left or right side of the screen.
^^Your task is to respond as quickly as possible to the X by pressing the <%values.responsekey_left_label%> key if the X is on the left side of the screen
or the <%values.responsekey_right_label%> key if the X is on the right side of the screen.
Once you respond to the X, another fixation point will appear followed by the presentation of a new set of images. You will perform several of these trials.

^^Any questions? Are you ready to begin? Please keep your attention on the computer screen and remember to respond as quickly as possible.

^^^Please press the spacebar key to begin some practice.

</page>

<page practice>
Practice is over. If you have any questions, please ask your experimenter now.
^^^^When you are ready, continue on to the actual task. The actual task is like practice but there is not going to be any feedback.

^^^^^^^^^^^^^Please press the spacebar key to begin.
</page>

<page thankyou>
Thank you for your participation!
</page>

*******************************************************
********************************************
Editable Stimuli: original stimuli generously shared by Dr. Fillmore
********************************************
*******************************************************
Note:
itemnumbers 1-10: simple pictures
Note: itemnumbers 11-20 could contain complex pictures (itemnumbers > 10
would then always distinguish between simple and complex pictures)

<item oceanimage>
/1 = "ocean.jpg"
/2 = "ocean.jpg"
/3 = "ocean.jpg"
/4 = "ocean.jpg"
/5 = "ocean.jpg"
/6 = "ocean.jpg"
/7 = "ocean.jpg"
/8 = "ocean.jpg"
/9 = "ocean.jpg"
/10 = "ocean.jpg"
</item>

<item mountainimage>
/1 = "mountain.jpg"
/2 = "mountain.jpg"
/3 = "mountain.jpg"
/4 = "mountain.jpg"
/5 = "mountain.jpg"
/6 = "mountain.jpg"
/7 = "mountain.jpg"
/8 = "mountain.jpg"
/9 = "mountain.jpg"
/10 = "mountain.jpg"
</item>

<item fillerimages1>
/1 = "prairietree.jpg"
/2 = "prairietree.jpg"
/3 = "prairietree.jpg"
/4 = "prairietree.jpg"
/5 = "simple filler 5a.jpg"
/6 = "simple filler 6a.jpg"
/7 = "simple filler 7a.jpg"
/8 = "simple filler 8a.jpg"
/9 = "simple filler 9a.jpg"
/10 = "simple filler 10a.jpg"
</item>

<item fillerimages2>
/1 = "laketree.jpg"
/2 = "laketree.jpg"
/3 = "laketree.jpg"
/4 = "laketree.jpg"
/5 = "simple filler 5b.jpg"
/6 = "simple filler 6b.jpg"
/7 = "simple filler 7b.jpg"
/8 = "simple filler 8b.jpg"
/9 = "simple filler 9b.jpg"
/10 = "simple filler 10b.jpg"
</item>
*******************************************************************************************************************
*******************************************************************************************************************
DEFAULTS
*******************************************************************************************************************
*******************************************************************************************************************
requires Inquisit 4.0.3.0 or higher

<defaults>
/minimumversion = "4.0.3.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ txcolor = (white)
/txbgcolor = (black)
/screencolor = black
/canvasaspectratio = (4,3)
</defaults>

*******************************************************************************************************************
*******************************************************************************************************************
VALUES
*******************************************************************************************************************
*******************************************************************************************************************

********************
automatically updated
********************
/itemnumber:          itemnumber of currently selected picture
/selecteditem:          helper variable to determine itemnumber
/ocean_x-probe_x:         the y-coordinate (in %) of the ocean/mountain/probe
/mountainimage:          stores the currently presented mountain image (or pseudo mountain image)
/oceanimage:          stores the currently presented ocean image (or pseudo ocean image)
/oceanposition:          1 = ocean image on right; 2 = ocean image on left
/congruence:          0 = filler; 1 = probe and ocean position same; 2 = probe and ocean position different

Summary Variables: only for ocean and mountain pictures (not for filler1/filler2 pictures = filler stimuli)
/sum_correct:          counts the correct responses >= values.minimum_latency (here: 100ms)

/sum_correct_probeinoceanposition_simple:   counts the correct responses to probes in the ocean position/probes in the mountain position
/sum_correct_probeinmountainposition_simple:  for responses >= values.minimum_latency (simple pictures)

/sumrt_probeinoceanposition_simple:     adds up the latencies for CORRECT responses when the probe is in the ocean/mountain position
/sumrt_probeinmountainposition_simple:    and latencies >= values.minimum_latency (simple pictures)

/meanrt_probeinoceanposition_simple:    contains the mean latency for CORRECT responses when the probe is in the ocean/mountain position
/meanrt_probeinmountainposition_simple:    (simple pictures)

/sum_correct_filler:        counts all correct filler trials
/sumrt_correct_filler:        sums up all latencies of correct filler trials
/meanrt_correct_filler:        calculates the mean latency for correct responses in filler trials

/task:            1 = practice; 2 = test        

<values>
/itemnumber = 0
/selecteditem = ""
/ocean_x = 0
/mountain_x = 0
/probe_x = 0
/probe_y = 0
/mountainimage = ""
/oceanimage = ""
/oceanposition = 0
/congruence = 0

/sum_correct = 0

/sum_correct_probeinoceanposition_simple = 0
/sum_correct_probeinmountainposition_simple= 0

/sumrt_probeinoceanposition_simple = 0
/sumrt_probeinmountainposition_simple = 0

/meanrt_probeinoceanposition_simple = 0
/meanrt_probeinmountainposition_simple = 0

/sum_correct_filler = 0
/sumrt_correct_filler = 0
/meanrt_correct_filler = 0

/task = 0
</values>
*******************************************************************************************************************
*******************************************************************************************************************
EXPRESSIONS
*******************************************************************************************************************
*******************************************************************************************************************
/AB_simple:  Attentional Bias for simple pictures: If AB_simple > 0 => faster mean latencies to ocean pictures for simple pictures

<expressions>
/AB_simple = values.meanrt_probeinmountainposition_simple - values.meanrt_probeinoceanposition_simple
</expressions>


*******************************************************************************************************************
*******************************************************************************************************************
DATA
*******************************************************************************************************************
*******************************************************************************************************************
for explanations of custom values, go to VALUES/EXPRESSIONS. Customize.

********************
raw data
********************

date, time, subject:        date and time script was run with the current subject
blockcode, blocknum:        the name and number of the current block
trialcode, trialnum:         the name and number of the currently recorded trial
              (Note: not all trials that are run might record data)
/congruence:          0 = filler; 1 = probe and ocean position same; 2 = probe and ocean position different
/oceanposition:            1 = ocean image on right; 2 = ocean image on left
/mountain_x-probe_x:         the y-coordinate (in %) of the ocean/mountain/probe
/itemnumber:          itemnumber of currently selected picture
/oceanimage:          stores the currently presented ocean image (or pseudo ocean image)
/mountainimage:          stores the currently presented mountain image (or pseudo mountain image)
response:           the participant's response (scancode of response button)
correct:           accuracy of response
latency:            the response latency
/sum_correct:          counts the correct responses >= values.minimum_latency (here: 100ms)

/meanrt_probeinoceanposition_simple:    contains the mean latency for CORRECT responses when the probe is in the ocean/mountain position
/meanrt_probeinmountainposition_simple:    (simple pictures)
/sumrt_probeinoceanposition_simple:     adds up the latencies for CORRECT responses when the probe is in the ocean/mountain position
/sumrt_probeinmountainposition_simple:    and latencies >= values.minimum_latency (simple pictures)
/sum_correct_probeinoceanposition_simple:   counts the correct responses to probes in the ocean position/probes in the mountain position
/sum_correct_probeinmountainposition_simple:   for responses >= values.minimum_latency (simple pictures)
/AB_simple:           Attentional Bias for simple pictures: If AB_simple > 0 => faster mean latencies to ocean pictures for simple pictures
/sum_correct_filler:        counts all correct filler trials
/sumrt_correct_filler:        sums up all latencies of correct filler trials
/meanrt_correct_filler:        calculates the mean latency for correct responses in filler trials


<data>
/file = "EMAC_Dot_Probe_rawdata.iqdat"
/separatefiles = true
/columns = [date, time, subject, blockcode, blocknum, trialcode, trialnum,
values.congruence, values.oceanposition,
values.mountain_x, values.ocean_x, values.probe_x,
values.itemnumber, values.oceanimage, values.mountainimage,
response, correct, latency, values.sum_correct,

values.meanrt_probeinoceanposition_simple, values.sumrt_probeinoceanposition_simple, values.sum_correct_probeinoceanposition_simple,
values.meanrt_probeinmountainposition_simple, values.sumrt_probeinmountainposition_simple, values.sum_correct_probeinmountainposition_simple,
expressions.ab_simple,
values.sum_correct_filler, values.sumrt_correct_filler, values.meanrt_correct_filler]
</data>

********************
summary data
********************

/fixationduration/targetduration:    the duration of the fixation cross (default: 500ms)/the targets (default: 2000ms)/
/probeduration:         the duration of the probe presentation (default: 1000ms)

/fixation_posttrialpause :      the posttrialpauses for the fixation crosses/the targets/the probe
/target_posttrialpause/probe_posttrialpause: (by default they are all = 0)
/probe:           the symbol used for the probe (default: X)
/responsekey_left-responsekey_right:   the keyboard scancodes associated with left probe and right probe
/responsekey_left_label:      responsekey labels
/minimum_latency:        the minimum latency of a correct response that is included into summary variables
             (default: 100ms)

/sum_correct:          counts the correct responses >= values.minimum_latency (here: 100ms)

/meanrt_probeinoceanposition_simple:    contains the mean latency for CORRECT responses when the probe is in the ocean/mountain position
/meanrt_probeinmountainposition_simple:    (simple pictures)
/sumrt_probeinoceanposition_simple:     adds up the latencies for CORRECT responses when the probe is in the ocean/mountain position
/sumrt_probeinmountainposition_simple:    and latencies >= values.minimum_latency (simple pictures)
/sum_correct_probeinoceanposition_simple:   counts the correct responses to probes in the ocean position/probes in the mountain position
/sum_correct_probeinmountainposition_simple:  for responses >= values.minimum_latency (simple pictures)
/AB_simple:           Attentional Bias for simple pictures: If AB_simple > 0 => faster mean latencies to ocean pictures for simple pictures
/sum_correct_filler:        counts all correct filler trials
/sumrt_correct_filler:        sums up all latencies of correct filler trials
/meanrt_correct_filler:        calculates the mean latency for correct responses in filler trials


<summarydata >
/file = "EMAC_DotProbe_summary.iqdat"
/columns = [script.startdate, script.starttime, script.subjectid,
values.fixationduration, values.targetduration, values.probeduration,
values.fixation_posttrialpause, values.target_posttrialpause, values.probe_posttrialpause, values.minimum_latency,
values.sum_correct,
values.meanrt_probeinoceanposition_simple, values.sumrt_probeinoceanposition_simple, values.sum_correct_probeinoceanposition_simple,
values.meanrt_probeinmountainposition_simple, values.sumrt_probeinmountainposition_simple, values.sum_correct_probeinmountainposition_simple,
expressions.ab_simple,
values.sum_correct_filler, values.sumrt_correct_filler, values.meanrt_correct_filler]
</summarydata>

 
*******************************************************************************************************************
*******************************************************************************************************************
STIMULI
*******************************************************************************************************************
*******************************************************************************************************************
<picture oceanimage>
/items = oceanimage
/select = values.itemnumber
/hposition = values.ocean_x
/vposition = values.target_y
/size = (values.imagewidth, values.imageheight)
</picture>

<picture mountainimage>
/items = mountainimage
/select = values.itemnumber
/hposition = values.mountain_x
/vposition = values.target_y
/size = (values.imagewidth, values.imageheight)
</picture>

<picture filleroceanimage>
/items = fillerimages1
/select = values.itemnumber
/hposition = values.ocean_x
/vposition = values.target_y
/size = (values.imagewidth, values.imageheight)
</picture>

<picture fillermountainimage>
/items = fillerimages2
/select = values.itemnumber
/hposition = values.mountain_x
/vposition = values.target_y
/size = (values.imagewidth, values.imageheight)
</picture>
******************************
other stimuli
******************************
<text fixation>
/items = ("+")
/position = (50%, 50%)
/ fontstyle = ("Arial", values.fixationcross_height, false, false, false, false, 5, 1)
</text>

<text probe>
/items = ("<%values.probe%>")
/hposition = values.probe_x
/vposition = values.target_y
/txcolor = white
/ fontstyle = ("Arial", values.probe_height, false, false, false, false, 5, 1)
</text>

<shape eraser>
/shape = rectangle
/size = (100%, 100%)
/color = black
/position = (50%, 50%)
</shape>

<text feedback>
/items = ("Incorrect")
/txcolor = red
/position = (50%, 50%)
/ fontstyle = ("Arial", 10%, true, false, false, false, 5, 1)
</text>

*******************************************************************************************************************
*******************************************************************************************************************
LISTS
*******************************************************************************************************************
*******************************************************************************************************************

Note: the following lists the picture selection for the four different trial sequences
(experiment: probe in ocean/mountain position; filler: probe in 'ocean'/'mountain' position)
to ensure that each image is presented 4 times (right/left, with/without probe, NEW probe square/circle)
digits: refer to itemnumber
letter: A-> show 'ocean' picture on the right; B -> show 'ocean' picture on the left

<list PIOP_items>
/items = ("1A", "1B", "2A", "2B","3A", "3B", "4A", "4B", "5A", "5B", "6A", "6B", "7A", "7B", "8A", "8B", "9A", "9B", "10A", "10B")
/replace = false
/resetinterval = 1
</list>

<list PIMP_items>
/items = ("1A", "1B", "2A", "2B","3A", "3B", "4A", "4B", "5A", "5B", "6A", "6B", "7A", "7B", "8A", "8B", "9A", "9B", "10A", "10B")
/replace = false
/resetinterval = 1
</list>

<list filler_PIOP_items>
/items = ("1A", "1B", "2A", "2B","3A", "3B", "4A", "4B", "5A", "5B", "6A", "6B", "7A", "7B", "8A", "8B", "9A", "9B", "10A", "10B")
/replace = false
/resetinterval = 1
</list>

<list filler_PIMP_items>
/items = ("1A", "1B", "2A", "2B","3A", "3B", "4A", "4B", "5A", "5B", "6A", "6B", "7A", "7B", "8A", "8B", "9A", "9B", "10A", "10B")
/replace = false
/resetinterval = 1
</list>
*******************************************************************************************************************
*******************************************************************************************************************
EXPERIMENTAL TRIALS: pairs of ocean images - mountain images
*******************************************************************************************************************
*******************************************************************************************************************

********************************************
Probe in Ocean Position (PIOP) : Trial Sequence
********************************************

Note: trial.fixation_PIOP
1) presents the fixation stimulus in the center of the screen
2) calls trial.targets_PIOP
3) does not record any data (by default)
<trial fixation_PIOP>
/ontrialbegin = [values.congruence = 1]
/stimulusframes = [1 = eraser, fixation]
/timeout = values.fixationduration
/branch = [trial.targets_PIOP]
/posttrialpause = values.fixation_posttrialpause
/recorddata = false
</trial>

Note: trial.targets_PIOP
1) determines the itemnumber of the current image and whether to show it right or left
2) presents the two images for a set amount of time (values.targetduration)
3) calls trial.probe_PIOP
4) does not record any data (by default)
<trial targets_PIOP>
/ontrialbegin = [values.selecteditem = list.PIOP_items.nextvalue]
/ontrialbegin = [if (values.selecteditem == "1A") {values.itemnumber = 1; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "1B") {values.itemnumber = 1; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "2A") {values.itemnumber = 2; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "2B") {values.itemnumber = 2; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "3A") {values.itemnumber = 3; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "3B") {values.itemnumber = 3; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "4A") {values.itemnumber = 4; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "4B") {values.itemnumber = 4; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "5A") {values.itemnumber = 5; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "5B") {values.itemnumber = 5; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "6A") {values.itemnumber = 6; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "6B") {values.itemnumber = 6; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "7A") {values.itemnumber = 7; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "7B") {values.itemnumber = 7; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "8A") {values.itemnumber = 8; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "8B") {values.itemnumber = 8; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "9A") {values.itemnumber = 9; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "9B") {values.itemnumber = 9; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "10A") {values.itemnumber = 10; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "10B") {values.itemnumber = 10; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/stimulusframes = [1 = oceanimage, mountainimage]

/ontrialend = [values.oceanimage = picture.oceanimage.currentitem; values.mountainimage = picture.mountainimage.currentitem]
/timeout = values.targetduration
/posttrialpause = values.target_posttrialpause
/branch = [trial.probe_PIOP]
/recorddata = false
</trial>


Note: trial.probe_PIOP
1. the position of the current probe
2. presents the probe in the ocean position for max. 1000ms (after that a new trialsequence is started)
3. updates several measures
4. records the relevant data into the data file
<trial probe_PIOP>
/ontrialbegin = [values.probe_x = values.ocean_x]
/stimulusframes = [1 = probe]
/isvalidresponse = [trial.probe_PIOP.response == values.responsekey_left || trial.probe_PIOP.response == values.responsekey_right]
/monkeyresponse = (44, 53)
/iscorrectresponse = [(values.probe_x == values.target_left_x  && trial.probe_PIOP.response == values.responsekey_left) ||
     (values.probe_x == values.target_right_x && trial.probe_PIOP.response == values.responsekey_right) ]
 
/ontrialend = [if (trial.probe_PIOP.correct && trial.probe_piop.latency >= values.minimum_latency) {
    values.sum_correct += 1;
    values.sum_correct_probeinoceanposition_simple += 1;
    values.sumrt_probeinoceanposition_simple += trial.probe_PIOP.latency;
    values.meanrt_probeinoceanposition_simple = values.sumrt_probeinoceanposition_simple/values.sum_correct_probeinoceanposition_simple}]

/timeout = (values.probeduration)
/branch = [if (values.task == 1 && trial.probe_PIOP.error) trial.feedback else trial.intertrialinterval]
</trial>

********************************************
Probe in Mountain Position (PIMP) : Trial Sequence
********************************************

Note: trial.fixation_PIMP
1) presents the fixation stimulus in the center of the screen
2) calls trial.targets_PIMP
3) does not record any data (by default)
<trial fixation_PIMP>
/ontrialbegin = [values.congruence = 2]
/stimulusframes = [1 = eraser, fixation]
/timeout = values.fixationduration
/branch = [trial.targets_PIMP]
/posttrialpause = values.fixation_posttrialpause
/recorddata = false
</trial>

Note: trial.targets_PIMP
1) determines the itemnumber of the current image and whether to show it right or left
2) presents the two images for a set amount of time (values.targetduration)
3) calls trial.probe_PIMP
4) does not record any data (by default)
<trial targets_PIMP>
/ontrialbegin = [values.selecteditem = list.pimp_items.nextvalue]
/ontrialbegin = [if (values.selecteditem == "1A") {values.itemnumber = 1; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "1B") {values.itemnumber = 1; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "2A") {values.itemnumber = 2; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "2B") {values.itemnumber = 2; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "3A") {values.itemnumber = 3; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "3B") {values.itemnumber = 3; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "4A") {values.itemnumber = 4; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "4B") {values.itemnumber = 4; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "5A") {values.itemnumber = 5; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "5B") {values.itemnumber = 5; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "6A") {values.itemnumber = 6; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "6B") {values.itemnumber = 6; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "7A") {values.itemnumber = 7; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "7B") {values.itemnumber = 7; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "8A") {values.itemnumber = 8; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "8B") {values.itemnumber = 8; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "9A") {values.itemnumber = 9; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "9B") {values.itemnumber = 9; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "10A") {values.itemnumber = 10; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "10B") {values.itemnumber = 10; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/stimulusframes = [1 = oceanimage, mountainimage]
/ontrialend = [values.oceanimage = picture.oceanimage.currentitem; values.mountainimage = picture.mountainimage.currentitem]
/timeout = values.targetduration
/posttrialpause = values.target_posttrialpause
/branch = [trial.probe_PIMP]
/recorddata = false
</trial>

Note: trial.probe_PIMP
1. determines the position of the current probe
2. presents the probe in the mountain position
3. updates several measures
4. records the relevant data into the data file
<trial probe_PIMP>
/ontrialbegin = [values.probe_x = values.mountain_x]
/stimulusframes = [1 = probe]
/isvalidresponse = [trial.probe_PIMP.response == values.responsekey_left || trial.probe_PIMP.response == values.responsekey_right]
/monkeyresponse = (44, 53)
/iscorrectresponse = [(values.probe_x == values.target_left_x  && trial.probe_PIMP.response == values.responsekey_left) ||
     (values.probe_x == values.target_right_x && trial.probe_PIMP.response == values.responsekey_right) ]
 
/ontrialend = [if (trial.probe_PIMP.correct && trial.probe_PIMP.latency >= values.minimum_latency) {
    values.sum_correct += 1;
    values.sum_correct_probeinmountainposition_simple += 1;
    values.sumrt_probeinmountainposition_simple += trial.probe_PIMP.latency;
    values.meanrt_probeinmountainposition_simple = values.sumrt_probeinmountainposition_simple/values.sum_correct_probeinmountainposition_simple}]

/timeout = (values.probeduration)
/branch = [if (values.task == 1 && trial.probe_PIMP.error) trial.feedback else trial.intertrialinterval]
</trial>
*******************************************************************************************************************
*******************************************************************************************************************
FILLER TRIALS: same as experimental trials except with filler item pairs (neutral-neutral pairings)
*******************************************************************************************************************
*******************************************************************************************************************

********************************************
Probe in "Pseudoocean" Position (PIOP) : Trial Sequence

because there is no ocean in the filler trials
one item of the filler pairs is considered
a pseudo-ocean for the purpose of this script
********************************************

Note: trial.fixation_filler_PIOP
1) presents the fixation stimulus in the center of the screen
2) calls trial.targets_PIOP
3) does not record any data (by default)
<trial fixation_filler_PIOP>
/ontrialbegin = [values.congruence = 0]
/stimulusframes = [1 = eraser, fixation]
/timeout = values.fixationduration
/branch = [trial.targets_filler_PIOP]
/posttrialpause = values.fixation_posttrialpause
/recorddata = false
</trial>

Note: trial.targets_filler_PIOP
1) determines the itemnumber of the current image and whether to show it right or left
2) presents the two images for a set amount of time (values.targetduration)
3) calls trial.probe_filler_PIOP
4) does not record any data (by default)
<trial targets_filler_PIOP>
/ontrialbegin = [values.selecteditem = list.filler_PIOP_items.nextvalue]
/ontrialbegin = [if (values.selecteditem == "1A") {values.itemnumber = 1; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "1B") {values.itemnumber = 1; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "2A") {values.itemnumber = 2; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "2B") {values.itemnumber = 2; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "3A") {values.itemnumber = 3; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "3B") {values.itemnumber = 3; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "4A") {values.itemnumber = 4; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "4B") {values.itemnumber = 4; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "5A") {values.itemnumber = 5; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "5B") {values.itemnumber = 5; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "6A") {values.itemnumber = 6; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "6B") {values.itemnumber = 6; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "7A") {values.itemnumber = 7; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "7B") {values.itemnumber = 7; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "8A") {values.itemnumber = 8; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "8B") {values.itemnumber = 8; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "9A") {values.itemnumber = 9; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "9B") {values.itemnumber = 9; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "10A") {values.itemnumber = 10; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "10B") {values.itemnumber = 10; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/stimulusframes = [1 = filleroceanimage, fillermountainimage]

/ontrialend = [values.oceanimage = picture.filleroceanimage.currentitem; values.mountainimage = picture.fillermountainimage.currentitem]
/timeout = values.targetduration
/posttrialpause = values.target_posttrialpause
/branch = [trial.probe_filler_PIOP]
/recorddata = false
</trial>


Note: trial.probe_filler_PIOP
1. the position of the current probe
2. presents the probe in the ocean position
3. updates several measures
4. records the relevant data into the data file
<trial probe_filler_PIOP>
/ontrialbegin = [values.probe_x = values.ocean_x]
/stimulusframes = [1 = probe]
/isvalidresponse = [trial.probe_filler_PIOP.response == values.responsekey_left || trial.probe_filler_PIOP.response == values.responsekey_right]
/monkeyresponse = (44, 53)
/iscorrectresponse = [(values.probe_x == values.target_left_x  && trial.probe_filler_PIOP.response == values.responsekey_left) ||
     (values.probe_x == values.target_right_x && trial.probe_filler_PIOP.response == values.responsekey_right) ]
/ontrialend = [if (trial.probe_filler_PIOP.correct && trial.probe_filler_PIOP.latency >= values.minimum_latency) {
    values.sum_correct_filler += 1;
    values.sumrt_correct_filler += trial.probe_filler_PIOP.latency;
    values.meanrt_correct_filler = values.sumrt_correct_filler/values.sum_correct_filler}]

/timeout = (values.probeduration)
/branch = [if (values.task == 1 && trial.probe_filler_PIOP.error) trial.feedback else trial.intertrialinterval]
</trial>

********************************************
Probe in Mountain Position (PIMP) : Trial Sequence
********************************************

Note: trial.fixation_filler_PIMP
1) presents the fixation stimulus in the center of the screen
2) calls trial.targets_filler_PIMP
3) does not record any data (by default)
<trial fixation_filler_PIMP>
/ontrialbegin = [values.congruence = 0]
/stimulusframes = [1 = eraser, fixation]
/timeout = values.fixationduration
/branch = [trial.targets_filler_PIMP]
/posttrialpause = values.fixation_posttrialpause
/recorddata = false
</trial>


Note: trial.targets_filler_PIMP
1) determines the itemnumber of the current image and whether to show it right or left
2) presents the two images for a set amount of time (values.targetduration)
3) calls trial.probe_filler_PIMP
4) does not record any data (by default)
<trial targets_filler_PIMP>
/ontrialbegin = [values.selecteditem = list.filler_pimp_items.nextvalue]
/ontrialbegin = [if (values.selecteditem == "1A") {values.itemnumber = 1; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "1B") {values.itemnumber = 1; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "2A") {values.itemnumber = 2; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "2B") {values.itemnumber = 2; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "3A") {values.itemnumber = 3; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "3B") {values.itemnumber = 3; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "4A") {values.itemnumber = 4; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "4B") {values.itemnumber = 4; values.oceanposition = 2; values.ocean_x = values.target_left_x;values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "5A") {values.itemnumber = 5; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "5B") {values.itemnumber = 5; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "6A") {values.itemnumber = 6; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "6B") {values.itemnumber = 6; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "7A") {values.itemnumber = 7; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "7B") {values.itemnumber = 7; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "8A") {values.itemnumber = 8; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "8B") {values.itemnumber = 8; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "9A") {values.itemnumber = 9; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "9B") {values.itemnumber = 9; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "10A") {values.itemnumber = 10; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "10B") {values.itemnumber = 10; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/stimulusframes = [1 = filleroceanimage, fillermountainimage]

/ontrialend = [values.oceanimage = picture.filleroceanimage.currentitem; values.mountainimage = picture.fillermountainimage.currentitem]
/timeout = values.targetduration
/posttrialpause = values.target_posttrialpause
/branch = [trial.probe_filler_PIMP]
/recorddata = false
</trial>

Note: trial.probe_filler_PIMP
1. determines the position of the current probe
2. presents the probe in the pseudo-mountain position
3. updates several measures
4. records the relevant data into the data file
<trial probe_filler_PIMP>
/ontrialbegin = [values.probe_x = values.mountain_x]
/stimulusframes = [1 = probe]
/isvalidresponse = [trial.probe_filler_PIMP.response == values.responsekey_left || trial.probe_filler_PIMP.response == values.responsekey_right]
/monkeyresponse = (44, 53)
/iscorrectresponse = [(values.probe_x == values.target_left_x  && trial.probe_filler_PIMP.response == values.responsekey_left) ||
     (values.probe_x == values.target_right_x && trial.probe_filler_PIMP.response == values.responsekey_right) ]

/ontrialend = [if (trial.probe_filler_PIMP.correct && trial.probe_filler_PIMP.latency >= values.minimum_latency) {
    values.sum_correct_filler += 1;
    values.sumrt_correct_filler += trial.probe_filler_PIMP.latency;
    values.meanrt_correct_filler = values.sumrt_correct_filler/values.sum_correct_filler}]

/timeout = (values.probeduration)
/branch = [if (values.task == 1 && trial.probe_filler_PIMP.error) trial.feedback else trial.intertrialinterval]
</trial>

********************************************
Miscelleneous trials
********************************************
<trial feedback>
/stimulusframes = [1 = feedback]
/timeout = 500
/recorddata = false
/branch = [trial.intertrialinterval]
</trial>

<trial intertrialinterval>
/timeout = values.probe_posttrialpause
/recorddata = false
</trial>
*******************************************************************************************************************
*******************************************************************************************************************
EXPERIMENTAL BLOCKS
*******************************************************************************************************************
*******************************************************************************************************************
Note:
* presents 10 practice trials (see Miller & Fillmore, 2010)
<block Practice>
/onblockbegin = [values.task = 1]
/postinstructions = (practice)
/trials = [1-10 = noreplace(fixation_PIOP, fixation_PIMP, fixation_filler_PIOP, fixation_filler_PIMP)]
</block>

Note: presents 160 trials, randomly samples from all 4 conditions
<block EMACDotProbeTask>
/onblockbegin = [values.task = 2]
/onblockbegin = [values.sum_correct = 0;
 values.sum_correct_probeinoceanposition_simple = 0;
 values.sum_correct_probeinmountainposition_simple= 0;

 values.sumrt_probeinoceanposition_simple = 0;
 values.sumrt_probeinmountainposition_simple = 0;

 values.meanrt_probeinoceanposition_simple = 0;
 values.meanrt_probeinmountainposition_simple = 0;

 values.sum_correct_filler = 0;
 values.sumrt_correct_filler = 0;
 values.meanrt_correct_filler = 0]

/trials = [1-80 = noreplace(fixation_PIOP, fixation_PIMP, fixation_filler_PIOP, fixation_filler_PIMP)]
</block>

*******************************************************************************************************************
*******************************************************************************************************************
EXPERIMENT
*******************************************************************************************************************
*******************************************************************************************************************
<expt >
/preinstructions = (instructions)
/postinstructions = (thankyou)
/blocks = [1 = Practice; 2 = EMACDotProbeTask]
</expt>

Note: debug element
<monkey>
/ latencydistribution = normal(300, 50)
</monkey>

*******************************************************************************************************************
End of File
*******************************************************************************************************************



 

By Dave - 9/9/2014

<trial probe_filler_PIOP>
...
/stimulusframes = [1 = probe]
...
</trial>

is supposed to display a stimulus element called 'probe'. If you want it to display the <picture probe> element you included in your initial query, you must (a) add that to the script (it isn't there in the "full" code you pasted) and (b) remove the original <text probe> element. Otherwise, how would the software know which one of the two stimulus elements called 'probe' you actually mean?


Whether you'll want to use values.itemnumber for probe selection, I cannot tell. Lots of elements in your script use that value

<picture oceanimage>
/items = oceanimage
/select = values.itemnumber
/hposition = values.ocean_x
/vposition = values.target_y
/size = (values.imagewidth, values.imageheight)
</picture>

<picture mountainimage>
/items = mountainimage
/select = values.itemnumber
/hposition = values.mountain_x
/vposition = values.target_y
/size = (values.imagewidth, values.imageheight)
</picture>

<picture filleroceanimage>
/items = fillerimages1
/select = values.itemnumber
/hposition = values.ocean_x
/vposition = values.target_y
/size = (values.imagewidth, values.imageheight)
</picture>

<picture fillermountainimage>
/items = fillerimages2
/select = values.itemnumber
/hposition = values.mountain_x
/vposition = values.target_y
/size = (values.imagewidth, values.imageheight)
</picture>

and you can see how that value is determined by looking at your /ontrialbegin attributes

<trial targets_PIOP>
/ontrialbegin = [values.selecteditem = list.PIOP_items.nextvalue]
/ontrialbegin = [if (values.selecteditem == "1A") {values.itemnumber = 1; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "1B") {values.itemnumber = 1; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "2A") {values.itemnumber = 2; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "2B") {values.itemnumber = 2; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "3A") {values.itemnumber = 3; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "3B") {values.itemnumber = 3; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "4A") {values.itemnumber = 4; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "4B") {values.itemnumber = 4; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "5A") {values.itemnumber = 5; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "5B") {values.itemnumber = 5; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "6A") {values.itemnumber = 6; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "6B") {values.itemnumber = 6; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "7A") {values.itemnumber = 7; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "7B") {values.itemnumber = 7; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "8A") {values.itemnumber = 8; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "8B") {values.itemnumber = 8; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "9A") {values.itemnumber = 9; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "9B") {values.itemnumber = 9; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "10A") {values.itemnumber = 10; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "10B") {values.itemnumber = 10; values.oceanposition = 2; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
...
</trial>

Clearly, (a) it's not strictly randomly determined and more importantly (b) it can take on values 1-10, which does not make sense for the probe (it only has two items, not ten).

Hope this clarifies.
By Dave - 9/9/2014

P.S.: I personal request, if I may. If possible, please do not paste full scripts into a post's body. Instead use the forum's file attachment facilities to provide the entire, original script file. Thank you!
By Joel Cavallo - 9/9/2014

OK, sorry about that. I will do so in the future. Also, thanks for your tips, I will try out a few things and get back to you.
-Joel
By Joel Cavallo - 9/9/2014

Alright, so I have completed the first round of edits based on your advice. I have two more questions. 1) How do I randomize the presentation of the pictures and the probe (position and type)?

2) How do I clarify what a valid response is for this task under <trial probe_PIOP>? Originally, the response was correct if the participant clicked a left/right key when the probe was behind the left/right picture. Now, I am asking participants to press the "z" key if the probe was a square and the "?" key if it was a circle. The items that I have modifed are listed below and the script is attached. Thank you so much!

-Joel

I have now defined:

<item probeimage>
/1 = "circle.jpg"
/2 = "square.jpg"

I have also added:
<values>
/probenumber = 1

I have also added:
<list probe_items>
/items = ("1A", "1B", "2A", "2B")
/replace = true
/resetinterval = 1
</list>

I have also modified:
 <trial probe_PIOP>
/ontrialbegin = [values.selecteditem = list.probe_items.nextvalue]

I have modified this trial so that 1A = circle left, 1B = square left, 2A = circle right, 2B = square right.

By Dave - 9/9/2014

Re. #1:
<picture probe>
/items = probeimage
/select = values.probenumber
/hposition = values.probe_x
/vposition = values.target_y

/size = (values.imagewidth, values.imageheight)
</picture>

You've set the stimulus's position up to depend on the values highlighted above.

Again, how does values are determined, you can discern by examining your /ontrialbegin attributes:
<trial probe_PIOP>
/ontrialbegin = [values.selecteditem = list.probe_items.nextvalue]
/ontrialbegin = [if (values.selecteditem == "1A") {values.probenumber = 1; values.oceanposition = 1; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "1B") {values.probenumber = 2; values.oceanposition = 1; values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.selecteditem == "2A") {values.probenumber = 1; values.oceanposition = 2; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.selecteditem == "2B") {values.probenumber = 2; values.oceanposition = 2; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [values.probe_x = values.ocean_x]
...
</trial>

A random item is drawn from the highlighted <list>, the remaining values depend on that item.


Re. #2:
The method is exactly the same as before. The correct response is determined via the logic in the <trial>'s /iscorrectresponse attribute(s):

/iscorrectresponse = [(values.probe_x == values.target_left_x  && trial.probe_PIOP.response == values.responsekey_left) ||
                    (values.probe_x == values.target_right_x && trial.probe_PIOP.response == values.responsekey_right) ]

You need to adapt / extend that logic to reflect the specific probe item (circle vs square), i.e. via /ontrialbegin you'll want to set the applicable responsekey value to either the keyboard scancode for "?" or "Z" depending on the probe item selected.
By Joel Cavallo - 9/10/2014

Hello,
Thank you again for all of your help yesterday. I've made excellent progress based on your comments, but I'm still stuck on how to get the correct response key associated with the type of probe presented. Previously, the code for this program was written so that the correct response would be either Left or Right key presses (keys 51 and 52). The code was:
[(values.probe_x == values.target_left_x && trial.probe_PIOP.response == values.responsekey_left)]

Now, I am trying to make it so that when probenumber = 1, then the correct response is 53, and when probenumber = 2, then the correct key press is 44. I have modified these key values to correspond to values.responsekey_left and right. I have also tried changing the logic to the "iscorrect" function as you suggested, but it is still not working. The code I have inserted is:

[(values.probenumber == 2 && trial.probe_PIOP.response == values.responsekey_left)]
[(values.probenumber == 1 && trial.probe_PIOP.response == values.responsekey_right)]

I'm not entierly sure what you meant by modify the /ontrial section to include the correct response keys. I thought that these were set intitially in the values section and the logic would appear in the specific trials. Any help would be appreciated to iron out this logic function. Thank you in advance.

-Joel
By Dave - 9/10/2014

What I mean, schematically, is to do

<trial sometrial>
...
/ ontrialbegin = [if (values.probenumber == 1) values.responsekey_left=insert_appropriate_scancode_here]
/ ontrialbegin = [if (values.probenumber == 2) values.responsekey_left=insert_appropriate_scancode_here]
...
</trial>
and so forth for the right response key.
By Joel Cavallo - 9/10/2014

Hello,
Thank you for the response. Quick question, if I add the:
/ontrialbegin [if(values.probenumber ==2) values.responsekey_left = 44]

Then is my subsequent logic correct?:
/iscorrectresponse = [(values.probenumber == 2  && trial.probe_PIOP.response == values.responsekey_left)

Thank you.

-Joel
By Dave - 9/10/2014

I would think so, but of course cannot tell with absolute certainty based only on a little code snippet. You should be able to test this for yourself very quickly, though, since the data file will reveal if the response was recorded / evaluated / scored as you intended. Or is there something I'm missing?
By Joel Cavallo - 9/11/2014

Hello again,
I've ironed out that issue regarding the correct response key, but I've found a new one that concerns the randomized and counterbalanced presentations of the stimuli. The whole experiment is 16 trials  that involves 8 presentations of the target pics of interest (ocean or mountain) and 8 with distractor images (lake tree and prairie tree). Because the images are presented side by side, I would like to counterbalance the image presentation (ocean/mountain left/right; mountain/ocean left/right). I would also like to counterbalance the position and type of the probe (probe left/right; probe circle/square). Thus, the combinations of these factors yields 8 possible combinations that I would like to be randomly sampled, but not repeated (i.e. replaced). At this point, the experiment is randomly selecting values, but it appears to be using severl of them more than once (e.g. ocean/mountain in the left/right position, wih the square probe on the left 3 times. I assume this issue surrounds the use of replacement and the original script logic that determined how to randomly select values from my picture lists.

The decision tree of the Block procedure indicates that one of the four lists will be picked, but not replaced.

Once one of these lists is selected, a specific item is chosen from that list using the code:
/ontrialbegin = [values.selecteditem = list.PIOP_items.nextvalue]

Then, an item is selected using the logic:
/ontrialbegin = [if (values.selecteditem == "1A") {values.itemnumber = 1; values.oceanposition = 1; values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]

After this, there are 3 other logic strings that comprise the entire set of 4 images for this particular list. After trial is over, then I assumed that the item# would be updated so when this trial runs again, it will pick the next value as indicated by list.PIOP_items.nextvalue. The logic I'm referring to is:

/ontrialend = [values.oceanimage = picture.oceanimage.currentitem; values.mountainimage = picture.mountainimage.currentitem]

I have three questions, 1) When the "nextvalue" is determined, what is this value added to? 2) What does the .currentitem refer to? 3) Do I also need to have a similar update logic (/ontrialend = , etc.) for the probe trials, which would indicate the position and type of the probe?

Because the trials are separated into "probe in ocean position", "probe in mountain position" and the 2 distractor conditions, I think this should definitely be possible based on the current sequence of events. Thus, within the "probe in ocean position" PIOP trial, it will select a picture from the list randomly, display the pair either ocean/mountain, or mountain/ocean, then move to the probe trial. Here, the position and type of probe will be randomly selected from the probe list. Because selections from both lists are random, I'm wondering whether Inquisit doesn't know what combinations have been picked from the picture list and probe list, so that the selections come out random, despite the fact that I do not want them to be repeated/replaced. Therefore, I assumed that by using an /ontrialend function, I could update each of the selected items from each list, so that no combinations would be repeated.

At this point, I'm not sure what to do next, so any help would be appreciated. Thanks.

 
By Dave - 9/11/2014

> 1) When the "nextvalue" is determined, what is this value added to?

It isn't added to anything.

/ontrialbegin = [values.selecteditem = list.PIOP_items.nextvalue]

samples an item from the specified list. The list's sampling behavior is determined by its configuration (how many items are there, are they supposed to be sampled with or without replacement, etc.).

> 2) What does the .currentitem refer to

currentitem reflects the currently selected item for the given element. Contrary to e.g. nextvalue, currentitem does *not* cause a new item to be sampled, it merely reads out the item that already has been sampled through other means.

> 3) Do I also need to have a similar update logic (/ontrialend = , etc.) for the probe trials, which would indicate the position and type of the probe?

Various values reflecting probe position already exist in your script -- at least they did in previous versions.
By Joel Cavallo - 9/11/2014

OK, I believe I am following your comments. However, I am still not understanding how to make sure that combinations of my images and probe type/position do not repeat themselves. Do you have any ideas? Just to reiterate what I have right now. For each of my 4 picture lists, I state: /replace = false. And each list has 4 items.
For the PIOP list, I have the ocean picture repeated 4 times, in the left and right position twice.
For the Probe PIOP list, I have two probe pictures (circle2 and square2) in the left and right position.

On any given trial, the program chooses one of 4 lists (fixation_PIOP, fixation_PIMP, fixation_filler_PIOP, fixation_filler_PIMP). These are the starting points for each of the 4 picture lists mentioned above. Once one of those lists is chosen, it picks 1 of 4 pictures (ocean/mountain in left/right position) and then branches to the probe list. It now picks 1 of 4 options (circle/sqaure in left/right position).
So, the question is, how do I get these two lists in sync so that there is only 1 presentation of each image/probe combination? Thank you.

-Joel
By Dave - 9/11/2014

> So, the question is, how do I get these two lists in sync so that there is only 1 presentation of each image/probe combination?

You encode the combinations you want using <list> elements and then sample from those combinations as needed. See e.g. http://www.millisecond.com/forums/Topic13986.aspx#bm13987 for an example.
By Joel Cavallo - 9/12/2014

Hello, thanks for pointing me towards that sample code. It was very helpful. However, I'm still in a bit of a quandry because of some of the complications of my task. For example, in the sample code in the link you posted indicates multiple combinations of a single stimulus in the left/right position with 2 timeout values. In my experiment, I need to simultaneously present one image pair (ocean and mountain), which vary in the their position (left/right or right/left). In addition, I have the probe position (left/right) and the probe type (circle/square). Thus, I have 2x2x2 = 8 unique combinations of picturepairposition-probeposition-probetype. The first snag is that I have to know the subject reaction time to categories of those combinations, such as RT when the probe is behind the mountain picture, etc. So, in the code that I have currently, I thought it was a good idea to keep the lists segregated into "probe in ocean position" and "probe in mountain position" so that data capture would be clearer. Is there a different way to do this so that I can obtain data for each picture position, while enabling counterbalancing if each unique picture/probe combination?
By Dave - 9/12/2014

The method is the same -- regardless of whether you have separate <trial>s and associated <list>s "probe in ocean position" and "probe in mountain position". Encode the combinations for those in separate <list>s, sample from the respective, different lists in your <trial> elements. I.e. have a set of lists encoding the combinations that you sample from in your "PIOP"-trials and another set you sample from in your "PIMP"-trials.
By Joel Cavallo - 9/15/2014

Hello again. So I think that I'm understanding your intructions. It sounds like I should combine my PIOP trial with my probe trial (instead of branching) so that each picture/probeposition/probetype combination is only sampled once. However, if I create a single <trial PIOP> that presents my primary images of interest (eg Ocean or mountan), and then I want a probe image to follow that presentation, how do I state the /stimulusframes so that the ocean image is sequentially followed by the probe?
By Dave - 9/15/2014

E.g.

/ stimulustimes = [0=a; 500=b; ...]

or the equivalent expressed in display frames (if that's what you prefer to work with).
By Joel Cavallo - 9/15/2014

Ok great, so just to be clear. If I have two images presented on the screen simultaneously and this is followed by a probe picture, I should code:
/stimulusframes = [1=ocean; mountain; 2=probe]
Would this present the ocean/mountain pair, followed by the probe picture?
By Dave - 9/15/2014

#1: Syntax issue:

/stimulusframes = [1=ocean; mountain;...]

is wrong. Ought to read

/stimulusframes = [1=ocean, mountain;...]

See the documentation for /stimulustimes for details.

#2: Think about the timing you want:

/stimulusframes = [1=ocean, mountain; 2=probe]


will display 'ocean' and 'mountain' in the trial's 1st frame, 'probe' in the trial's 2nd frame. A frame is *very* short, its duration depending on a given display's refresh rate. For a display running at 100Hz, a frame lasts 10ms.
By Joel Cavallo - 9/16/2014

Hello,
So I'm making a little bit of progress and I wanted to ask you about lists within lists. As it stands right now, I have followed your earlier advice and created multiple lists that have all possible combinations of my ocean-mountain image pair (left/right), probe position (left/right), and probe type (circle/square). This yielded 12 lists, 3 for PIOP, PIMP, fillerPIOP, and fillerPIMP. These represent 4 unique combinations for probe in ocean position trials, and 4 unique combos for probe in mountain trials. These lists are coded as:

Note: for picture_position, 1 = ocean on right, 2 = ocean on left
for probe_type, 1 = circle, 2 = square
for probe_position, 1 = right, 2 = left.

<list PIOP_picture_position_list>
/items = (1,1,2,2)
/selectionmode = random
</list>

<list PIOP_probe_type_list>
/items = (1,2,1,2)
/selectionmode = list.piop_picture_position_list.currentindex
</list>

<list PIOP_probe_position_list>
/items = (1,1,2,2)
/selectionmode = list.piop_picture_position_list.currentindex
</list>


My basic question is, how do I get each number, 1 and 2, to represent a combination of the ocean-mountain pair in the two different orientations? My initial instinct was to follow a similar logic that was in the initial code under the <trial>, which was as follows:

<trial PIOP>
/ontrialbegin = [values.PIOP_picture_position = list.PIOP_picture_position_list.nextvalue; values.PIOP_probetype = list.PIOP_probe_type_list.nextvalue; values.PIOP_probe_position = list.PIOP_probe_position_list.nextvalue]
/ontrialbegin = [if (values.PIOP_picture_position == "1") {values.ocean_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.PIOP_picture_position == "2") {values.ocean_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/ontrialbegin = [if (values.PIOP_probe_type == "1") {values.probe_type = 1}]
/ontrialbegin = [if (values.PIOP_probe_type == "2") {values.probe_type = 2}]
/ontrialbegin = [if (values.PIOP_probe_position == "1") {values.probe_x = values.target_right_x; values.mountain_x = values.target_left_x}]
/ontrialbegin = [if (values.PIOP_probe_position == "2") {values.probe_x = values.target_left_x; values.mountain_x = values.target_right_x}]
/stimulusframes = [1 = oceanimage, mountainimage; 2 = probe]
/stimulustimes =


So, instead of referencing a specific orientation of the ocean/mountain, I simply create an if statement, that then specifies the orientation based on the selected values of the picture_position, probe_type, and probe_position. Does this seem correct? If not, I am wondering how I can specify the orientation of the pictures using code similar to what you posted last year when you had three text stimuli representing the values of 1,2,3:

<text stimtext>
/ items = ("A", "B", "C")
/ select = values.stim
/ hposition = values.position
</text>
 
To use this code as an analogy, I am wanting to replace the letters, A, B, (omit C), with specific combinations of ocean left/mountain right, and ocean right/mountain left. The same would be true for the probe position, and probe type. If you have any advice, I would greatly appreciate it. Thank you.

By Dave - 9/16/2014

> I simply create an if statement, that then specifies the orientation based on the selected values of the picture_position,
> probe_type, and probe_position. Does this seem correct?

Not sure what it exactly you mean by "correct", but yes, you can absolutely do it this way.

I would personally prefer to work with real values (e.g. horizontal position: 25%, ...) as in the example referenced previously (http://www.millisecond.com/forums/Topic13986.aspx#bm13987 ) instead of an abstract representation ("A"), but your approach will work as well.
By Joel Cavallo - 9/16/2014

Ok thank you. I'm following you so far, but I need to be more clear in my questions! So here it goes:

If I set up a picture using:
<picture picture_position>
/items = "ocean left", "ocean right"
/select = values.picture_position
</picture>

How do I link the "ocean left" and "ocean right" items to the two pictures?

I know htat I have to call each individual picture and specify certain attributes, such as:
<picture oceanimage>
/items = oceanimagefile
/select = values.itemnumber
/hposition = values.ocean_x
vposition = values.target_y
/size = (values.imagewidth, values.imageheight)

and then:

<item oceanimagefile>
/1 = "ocean.jpg"
</item>

So, in my code that specifies unique combos of the ocean/mtn pair, probe type and probe position, if I make my list as:

<list PIOP_picture_position_list>
/items = (1, 1, 2, 2)

How do I make "1" produce the ocean image on the right, mountain on the left, and "2" produce the opposite? Thus, my mental predicament stems from the concept of creating a list of the stimuli combinations, and having each value, 1,1,1, etc. refer to a specific set of stimuli that can fork and either be a 1 or a 2 (i.e. a square or a circle, probe on the left or right, or ocean on the right or left). I hope this makes things more clear. I really appreciate your patience by the way!

By Dave - 9/16/2014

Here's a boiled-down, simplified example for your "PIOP"-set:

<values>
/ oceanposition = 0
/ mountainposition = 0
/ probeposition = 0
/ probetype = 1
</values>

<block example>
/ trials = [1-4=piop]
</block>

<trial piop>
/ ontrialbegin = [values.oceanposition=list.piop_oceanpositionlist.nextvalue;
    values.mountainposition=list.piop_mountainpositionlist.nextvalue;
    values.probetype=list.piop_probetype.nextvalue;
    values.probeposition=values.oceanposition]
/ stimulustimes = [0=ocean, mountain; 2000=probe]
/ validresponse = (57)
</trial>

<text ocean>
/ items = ("Ocean")
/ hposition = values.oceanposition
</text>

<text mountain>
/ items = ("Mountain")
/ hposition = values.mountainposition
</text>

<text probe>
/ items = ("Square", "Circle")
/ select = values.probetype
/ hposition = values.probeposition
</text>

<list piop_oceanpositionlist>
/ items = (25%,25%,75%,75%)
</list>

<list piop_mountainpositionlist>
/ items = (75%,75%,25%,25%)
/ selectionmode = list.piop_oceanpositionlist.currentindex
</list>

<list piop_probetype>
/ items = (1,2,1,2)
/ selectionmode = list.piop_oceanpositionlist.currentindex
</list>

Don't be distracted by the use of <text> elements instead of <picture>. It works the same w/ <picture> elements. Also, don't be distracted by the fact that I condensed target/probe display into a single <trial>. It works the same if you have separate <trial> elements for both.
By Joel Cavallo - 9/17/2014

Wow, thanks! The program is working now, including counterbalancing! One quick thing though. Is there a way to specificy distinct /timeout times for individual items? During an individual trial, Inquisit presents a pair of images (ocean-mtn), followed by the probe picture. The probe picture replaces one of the pictures (ocean or mtn), but the one it did not replace stays on the screen. I am wondering how I can get the first picture to be removed, and therefore have only the probe picture presented in isolation. As always, thank you so much.

By Dave - 9/17/2014

You'll find the various options covered in the "How to erase stimuli" topic in the documentation's "How-to"-section.

Glad to hear it's mostly working now. It's not that hard once you get the hang of it...