"Covariation" of stimuli and key press accuracy


Author
Message
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
skyeysss - Tuesday, November 13, 2018

Hi Dave,

I have a couple of questions for now:
First, if the only way to record response for each item in the triplet is to separate them into different trials. Then how to ensure the triplet images are grouped and each triplet are randomly selected to be presented?
For example, before we have:
<block myblock>
/ trials = [1-6 = noreplacenorepeat(NNN1,NNN2)]
</block>
where within NNN1, NNN2, NNN3, there are three individual images. And each triplet should appear three times
However, to make sure each image within the triplet have response recorded, we need to have something like this:
<block myblock>
/ trials = [1-18 = noreplacenorepeat(NNN1_1,NNN1_2,NNN1_3,NNN2_1,NNN2_2,NNN2_3)]
</block>
where NNN1_1,NNN1_2,NNN1_3 together is the NNN1 triplet equivalent as the first chunk of code.
Is there a way to ensure that NNN1_1,NNN1_2,NNN1_3 appear together and NNN2_1,NNN2_2,NNN2_3 appear together, each for three times?

Second, it turns out that to have the dot on the left side of the screen for half of the images (it doesn't matter which item within the triplet got the dot on the right or the left, as long as all together half of the images have the dot on each side) and the other half on the right side is an important feather of the experiment. Any idea how to incorporate that into your sample code above or my code below?

Here are my simplified code that works but might not be ideally right:

<defaults>
/ screencolor = black
/ fontstyle = ("Arial", 20pt)
/ quitcommand = (Shift+"q")
</defaults>

<text fixation>
/ items = ("+")
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 30pt)
/ erase = false
</text>

<values>
/ NNN1_neuitem1 = 1
/ NNN1_neuitem1_x = 1px
/ NNN1_neuitem1_y = 1px
/ NNN1_neuitem2 = 1
/ NNN1_neuitem2_x = 1px
/ NNN1_neuitem2_y = 1px
/ NNN1_neuitem3 = 1
/ NNN1_neuitem3_x = 1px
/ NNN1_neuitem3_y = 1px
/ NNN2_neuitem1 = 1
/ NNN2_neuitem1_x = 1px
/ NNN2_neuitem1_y = 1px
/ NNN2_neuitem2 = 1
/ NNN2_neuitem2_x = 1px
/ NNN2_neuitem2_y = 1px
/ NNN2_neuitem3 = 1
/ NNN2_neuitem3_x = 1px
/ NNN2_neuitem3_y = 1px

/ neu1item = 1
/ neu2item = 1
/ neu3item = 1

/ circle1x = 1px
/ circle1y = 1px
/ circle2x = 1px
/ circle2y = 1px
/ circle3x = 1px
/ circle3y = 1px

/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>


<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
...
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>

//define each item in the triplet
<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

//the location of x and y are chosen from the pool size..
<list circle_x>
/ poolsize = 640
/ selectionrate = always
</list>
<list circle_y>
/ poolsize = 480
/ selectionrate = always
</list>

// define circle for each item of the triplets
<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle1x
/ vposition = values.yoffset + values.circle1y
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle2x
/ vposition = values.yoffset + values.circle2y
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle3x
/ vposition = values.yoffset + values.circle3y
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle1x
/ vposition = values.yoffset + values.circle1y
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle2x
/ vposition = values.yoffset + values.circle2y
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle3x
/ vposition = values.yoffset + values.circle3y
</shape>


//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circle1x = values.NNN1_neuitem1_x;
values.circle1y = values.NNN1_neuitem1_y;
values.circle2x = values.NNN1_neuitem2_x;
values.circle2y = values.NNN1_neuitem2_y;
values.circle3x = values.NNN1_neuitem3_x;
values.circle3y = values.NNN1_neuitem3_y;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
</trial>


<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circle1x = values.NNN2_neuitem1_x;
values.circle1y = values.NNN2_neuitem1_y;
values.circle2x = values.NNN2_neuitem2_x;
values.circle2y = values.NNN2_neuitem2_y;
values.circle3x = values.NNN2_neuitem3_x;
values.circle3y = values.NNN2_neuitem3_y;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
</trial>


<shape erase>
/ shape = rectangle
/ color = black
/ size = (1px*display.width,1px*display.height)
</shape>


<block encoding>
/ trials = [1-6 = noreplacenorepeat(NNN1,NNN2)]
/ bgstim = (fixation)
</block>

*********************************************************************************
*********************************************************************************

<expt PrAff>
/ blocks = [1=encoding]
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem1_x = list.circle_x.nextindex;
values.NNN1_neuitem1_y = list.circle_y.nextindex;

values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem2_x = list.circle_x.nextindex;
values.NNN1_neuitem2_y = list.circle_y.nextindex;

values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN1_neuitem3_x = list.circle_x.nextindex;
values.NNN1_neuitem3_y = list.circle_y.nextindex;

values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem1_x = list.circle_x.nextindex;
values.NNN2_neuitem1_y = list.circle_y.nextindex;

values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem2_x = list.circle_x.nextindex;
values.NNN2_neuitem2_y = list.circle_y.nextindex;

values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem3_x = list.circle_x.nextindex;
values.NNN2_neuitem3_y = list.circle_y.nextindex;

]

</expt>

Hope my questions make sense. Thanks so much for your help!!!


Re. #1:

Suppose you've set up separate trials for each image in your triplet, i.e. NNN1_1,NNN1_2, and NNN1_3; NNN2_1, NNN2_2, and NNN2_3; and so forth. Then you simply just sample the 1st trial in that chain of trials at random

/ trials = [1-18 = noreplace (NNN1_1, NNN2_1)]

and /branch from NNN1_1 to NNN1_2, as well as from NNN1_2 to NNN1_3

<trial NNN1_1>
...
/branch = [trial.NNN1_2]
</trial>

<trial NNN1_2>
...
/branch = [trial.NNN1_3]
</trial>

All the item selection stuff can remain in <trial NNN1_1>, the 1st in the chain, for the most part.

As for ensuring the circle is on the left in half the images and on the right on the other half, sample the circle positions accordingly. In the original example code I gave you, <list lowerbound> takes care of this. Make sure you use and adjust that list according to your needs.

skyeysss
skyeysss
Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)
Group: Forum Members
Posts: 10, Visits: 29
Dave - Wednesday, November 7, 2018
skyeysss - Wednesday, November 7, 2018
Dave - Wednesday, November 7, 2018
skyeysss - Tuesday, November 6, 2018
Dave - Monday, November 5, 2018
skyeysss - Sunday, November 4, 2018
Hi,

Sorry I'm pretty new to Inquisit so forgive me if these are naive questions:
I've been trying to figure out a way to randomize the location of a grey solid circle with the change of the images for each trial. Basically, in each trial, a subject will see a negative or neutral image, and there should be a grey circle showing on top of that image. The location of the grey circle is not pre-determined, but randomized for each subject and for each image within a range. The circle will always need to present within the frame of the image (size 640*480 in the center of the screen). The location of the circle should be fixed for each image (because the images repeat 3 times within a block), such that each unique image has a circle overlaying on the exact same spot for that image. But the location of the circle across images should be randomized (not likely to be the same). Also the subject will respond by pressing either the left or right arrow button to indicate whether the grey circle locates at the right or left side of the image for each trial. So we want a random half of the images in each condition (negative or neutral) have the circle on the left and the other half in each condition on the right to ensure counterbalancing. The stimuli duration is fixed, so no matter they respond or didn't respond, the trial should proceed. But it would be nice to record their accuracy. So ideally it would be great to know how whether the circle is on either side of image and compare that to the key press.

So there really are two parts to this question:
1. how to make two stimuli "covary"?
2. how to "remember" or detect the circle location on each image and record their accuracy?

Hope I describe the question clearly. Thanks for the help in advance!!!

At the start of the experiment, i.e. /onexptbegin, you'll want to populate two <list> elements -- one for x coordinates, one for y coordinates -- with circle locations. Those <list> elements ought to be paired to your picture stimuli. This will ensure that a specific (randomly generated) location is and remains tied to a specific image stimulus. This also, then, tells you the circle location in each trial, i.e. you can determine whether it's on the left or right side from its horizontal position and determine response correctness accordingly. Here's a simple example:

<values>
/ itemnumber = 1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

// 4 items in this example
<list stimnumber>
/ poolsize = 4
</list>

<text stimulus>
/ items = stimitems
/ size = (640px, 480px)
/ txbgcolor = yellow
/ vjustify = center
/ select = values.itemnumber
</text>

<item stimitems>
/ 1 = "A"
/ 1 = "B"
/ 1 = "C"
/ 1 = "D"
</item>

<shape thecircle>
/ shape = circle
/ color = grey
/ size = (30px, 30px)
/ hposition = values.xoffset + values.circlex
/ vposition = values.yoffset + values.circley
</shape>

<list circlex>
/ selectionmode = values.itemnumber
</list>

<list circley>
/ selectionmode = values.itemnumber
</list>

<trial mytrial>
/ ontrialbegin = [
values.itemnumber = list.stimnumber.nextindex;
values.circlex = list.circlex.nextvalue;
values.circley = list.circley.nextvalue;
]
/ stimulusframes = [1=stimulus, thecircle]
/ validresponse = (203, 205)
/ iscorrectresponse = [
(trial.mytrial.response == 203 && values.circlex < 320) || (trial.mytrial.response == 205 && values.circlex > 320)
]
/ timeout = 5000
</trial>

<block myblock>
/ trials = [1-12 = mytrial]
</block>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>


<expt>
/ onexptbegin = [
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));

list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
]
/ blocks = [1=myblock]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex values.circley response latency correct)
/ separatefiles = true
</data>




Hi Dave,

Thanks so much for your help!! Although your code works great, I couldn't incorporate it into my code. In the code below: each three images become a triplet as one trial (this is what you suggested under another thread). And I've been trying to make a circle shape for each type of stimuli (Maybe that's excessive?). The major problem is that the circle doesn't randomize in the image space at all: it always shows up at the top left corner (except for one particular image somehow). Also, now the code only calculates accuracy for each trial, which has three images. But people will need to respond to every image within the triplet. Is there a way to get the 3 accuracy in each triplet?

Please take a look at the code:


<defaults>
/ screencolor = black
/ fontstyle = ("Arial", 20pt)
/ quitcommand = (Shift+"q")
</defaults>

<text fixation>
/ items = ("+")
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 30pt)
/ erase = false
</text>

*********************************************************************************
*********************************************************************************
encoding phase
<values>
/ BNN1_negitem1 = 1
/ BNN1_neuitem2 = 1
/ BNN1_neuitem3 = 1
/ BNN2_negitem1 = 1
/ BNN2_neuitem2 = 1
/ BNN2_neuitem3 = 1
/ BNN3_negitem1 = 1
/ BNN3_neuitem2 = 1
/ BNN3_neuitem3 = 1

/ NNB1_neuitem1 = 1
/ NNB1_neuitem2 = 1
/ NNB1_negitem3 = 1
/ NNB2_neuitem1 = 1
/ NNB2_neuitem2 = 1
/ NNB2_negitem3 = 1
/ NNB3_neuitem1 = 1
/ NNB3_neuitem2 = 1
/ NNB3_negitem3 = 1

/ NNN1_neuitem1 = 1
/ NNN1_neuitem2 = 1
/ NNN1_neuitem3 = 1
/ NNN2_neuitem1 = 1
/ NNN2_neuitem2 = 1
/ NNN2_neuitem3 = 1
/ NNN3_neuitem1 = 1
/ NNN3_neuitem2 = 1
/ NNN3_neuitem3 = 1

/ BBB1_negitem1 = 1
/ BBB1_negitem2 = 1
/ BBB1_negitem3 = 1
/ BBB2_negitem1 = 1
/ BBB2_negitem2 = 1
/ BBB2_negitem3 = 1
/ BBB3_negitem1 = 1
/ BBB3_negitem2 = 1
/ BBB3_negitem3 = 1

/ neg1item = 1
/ neg2item = 1
/ neg3item = 1
/ neu1item = 1
/ neu2item = 1
/ neu3item = 1
</values>
<values>
/ circlex_neu1item =1
/ circlex_neu2item =1
/ circlex_neu3item =1
/ circlex_neg1item =1
/ circlex_neg2item =1
/ circlex_neg3item =1
/ circley_neu1item =1
/ circley_neu2item =1
/ circley_neu3item =1
/ circley_neg1item =1
/ circley_neg2item =1
/ circley_neg3item =1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

<item negImages>
/ 1 = "./stimuli/negative/2053.jpg"
/ 2 = "./stimuli/negative/2141.jpg"
/ 3 = "./stimuli/negative/2205.jpg"
/ 4 = "./stimuli/negative/2301.jpg"
/ 5 = "./stimuli/negative/2345.1.jpg"
/ 6 = "./stimuli/negative/2352.2.jpg"
/ 7 = "./stimuli/negative/2456.jpg"
/ 8 = "./stimuli/negative/2683.jpg"
/ 9 = "./stimuli/negative/2688.jpg"
/ 10 = "./stimuli/negative/2710.jpg"
/ 11 = "./stimuli/negative/2730.jpg"
/ 12 = "./stimuli/negative/2751.jpg"
/ 13 = "./stimuli/negative/2799.jpg"
/ 14 = "./stimuli/negative/2800.jpg"
/ 15 = "./stimuli/negative/2811.jpg"
/ 16 = "./stimuli/negative/2900.jpg"
/ 17 = "./stimuli/negative/3001.jpg"
/ 18 = "./stimuli/negative/3015.jpg"
/ 19 = "./stimuli/negative/3019.jpg"
/ 20 = "./stimuli/negative/3053.jpg"
/ 21 = "./stimuli/negative/3064.jpg"
/ 22 = "./stimuli/negative/3120.jpg"
/ 23 = "./stimuli/negative/3160.jpg"
/ 24 = "./stimuli/negative/3170.jpg"
/ 25 = "./stimuli/negative/3180.jpg"
/ 26 = "./stimuli/negative/3195.jpg"
/ 27 = "./stimuli/negative/3212.jpg"
/ 28 = "./stimuli/negative/3230.jpg"
/ 29 = "./stimuli/negative/3261.jpg"
/ 30 = "./stimuli/negative/3300.jpg"
/ 31 = "./stimuli/negative/3350.jpg"
/ 32 = "./stimuli/negative/3400.jpg"
/ 33 = "./stimuli/negative/3550.1.jpg"
/ 34 = "./stimuli/negative/6243.jpg"
/ 35 = "./stimuli/negative/6312.jpg"
/ 36 = "./stimuli/negative/6315.jpg"
/ 37 = "./stimuli/negative/6563.jpg"
/ 38 = "./stimuli/negative/6570.jpg"
/ 39 = "./stimuli/negative/6571.jpg"
/ 40 = "./stimuli/negative/6821.jpg"
/ 41 = "./stimuli/negative/6825.jpg"
/ 42 = "./stimuli/negative/7380.jpg"
/ 43 = "./stimuli/negative/9006.jpg"
/ 44 = "./stimuli/negative/9041.jpg"
</item>
<list negItemNum>
/ poolsize = 44
/ selectionrate = always
</list>

<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
/ 2 = "./stimuli/neutral/1122.jpg"
/ 3 = "./stimuli/neutral/1230.jpg"
/ 4 = "./stimuli/neutral/1302.jpg"
/ 5 = "./stimuli/neutral/1350.jpg"
/ 6 = "./stimuli/neutral/1390.jpg"
/ 7 = "./stimuli/neutral/1560.jpg"
/ 8 = "./stimuli/neutral/1616.jpg"
/ 9 = "./stimuli/neutral/1617.jpg"
/ 10 = "./stimuli/neutral/1645.jpg"
/ 11 = "./stimuli/neutral/1670.jpg"
/ 12 = "./stimuli/neutral/1675.jpg"
/ 13 = "./stimuli/neutral/1726.jpg"
/ 14 = "./stimuli/neutral/1820.jpg"
/ 15 = "./stimuli/neutral/1903.jpg"
/ 16 = "./stimuli/neutral/1908.jpg"
/ 17 = "./stimuli/neutral/1931.jpg"
/ 18 = "./stimuli/neutral/1935.jpg"
/ 19 = "./stimuli/neutral/1945.jpg"
/ 20 = "./stimuli/neutral/1947.jpg"
/ 21 = "./stimuli/neutral/2020.jpg"
/ 22 = "./stimuli/neutral/2032.jpg"
/ 23 = "./stimuli/neutral/2101.jpg"
/ 24 = "./stimuli/neutral/2102.jpg"
/ 25 = "./stimuli/neutral/2107.jpg"
/ 26 = "./stimuli/neutral/2122.jpg"
/ 27 = "./stimuli/neutral/2191.jpg"
/ 28 = "./stimuli/neutral/2206.jpg"
/ 29 = "./stimuli/neutral/2210.jpg"
/ 30 = "./stimuli/neutral/2215.jpg"
/ 31 = "./stimuli/neutral/2220.jpg"
/ 32 = "./stimuli/neutral/2221.jpg"
/ 33 = "./stimuli/neutral/2235.jpg"
/ 34 = "./stimuli/neutral/2272.jpg"
/ 35 = "./stimuli/neutral/2279.jpg"
/ 36 = "./stimuli/neutral/2308.jpg"
/ 37 = "./stimuli/neutral/2309.jpg"
/ 38 = "./stimuli/neutral/2359.jpg"
/ 39 = "./stimuli/neutral/2377.jpg"
/ 40 = "./stimuli/neutral/2384.jpg"
/ 41 = "./stimuli/neutral/2393.jpg"
/ 42 = "./stimuli/neutral/2396.jpg"
/ 43 = "./stimuli/neutral/2397.jpg"
/ 44 = "./stimuli/neutral/2411.jpg"
/ 45 = "./stimuli/neutral/2435.jpg"
/ 46 = "./stimuli/neutral/2445.jpg"
/ 47 = "./stimuli/neutral/2446.jpg"
/ 48 = "./stimuli/neutral/2458.jpg"
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>


<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

<picture neg1>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg1item
</picture>
<picture neg2>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg2item
</picture>
<picture neg3>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg3item
</picture>

//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circlex_neu1item = list.circlex_NNN1_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN1_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN1_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN1_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN1_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN1_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN1.response == "j" && values.circlex_neu1item < 320) || (trial.NNN1.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circlex_neu1item = list.circlex_NNN2_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN2_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN2_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN2_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN2_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN2_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN2.response == "j" && values.circlex_neu1item < 320) || (trial.NNN2.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN3>
/ ontrialbegin = [
values.neu1item = values.NNN3_neuitem1;
values.neu2item = values.NNN3_neuitem2;
values.neu3item = values.NNN3_neuitem3;
values.circlex_neu1item = list.circlex_NNN3_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN3_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN3_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN3_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN3_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN3_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN3_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN3_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN3_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN3.response == "j" && values.circlex_neu1item < 320) || (trial.NNN3.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<list circlex_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circley_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circlex_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circley_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circlex_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circley_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circlex_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circley_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circlex_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circley_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circlex_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circley_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circlex_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circley_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circlex_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circley_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circlex_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>
<list circley_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>

//BBB triplets
<trial BBB1>
/ ontrialbegin = [
values.neg1item = values.BBB1_negitem1;
values.neg2item = values.BBB1_negitem2;
values.neg3item = values.BBB1_negitem3;
values.circlex_neg1item = list.circlex_BBB1_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB1_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB1_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB1_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB1_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB1_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB1_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB1_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB1_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB1.response == "j" && values.circlex_neg1item < 320) || (trial.BBB1.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB2>
/ ontrialbegin = [
values.neg1item = values.BBB2_negitem1;
values.neg2item = values.BBB2_negitem2;
values.neg3item = values.BBB2_negitem3;
values.circlex_neg1item = list.circlex_BBB2_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB2_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB2_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB2_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB2_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB2_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB2_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB2_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB2_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB2.response == "j" && values.circlex_neg1item < 320) || (trial.BBB2.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB3>
/ ontrialbegin = [
values.neg1item = values.BBB3_negitem1;
values.neg2item = values.BBB3_negitem2;
values.neg3item = values.BBB3_negitem3;
values.circlex_neg1item = list.circlex_BBB3_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB3_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB3_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB3_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB3_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB3_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB3_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB3_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB3_negitem3]
/ timeout = 4500
/ validresponse = ("j", "k")
/ iscorrectresponse = [
(trial.BBB3.response == "j" && values.circlex_neg1item < 320) || (trial.BBB3.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<list circlex_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circley_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circlex_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circley_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circlex_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circley_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circlex_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circley_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circlex_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circley_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circlex_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circley_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circlex_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circley_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circlex_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circley_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circlex_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>
<list circley_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>

<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN3_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN3_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN3_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>

<shape circle_BBB1_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB1_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB1_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB2_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB2_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB2_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB3_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB3_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB3_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>

<shape erase>
/ shape = rectangle
/ color = black
/ size = (1px*display.width,1px*display.height)
</shape>

<values>
/ imageCondition = 1
/ leftRightPosition = 1
</values>

<page encodingIntro>
^^Again, if you see a grey patch on the left side of the picture, please press the button “J” as quickly as possible. If you see a grey patch on the right side of the picture, please press the button “K” as quickly as possible.
^^Please make sure you always use the same fingers to press the buttons. You will have breaks periodically.
^^If at any point of this part of the experiment that you want to quit, please press control+Q.
^^To continue, please press the space bar.
</page>

<item times>
/1 = " Please take a break, the experiemnt will begin shortly. 1:00"
/2 = " Please take a break, the experiemnt will begin shortly. 00:59"
</item>
<text timepass>
/items = times
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 3%)
</text>
<trial break>
/stimulustimes = [0=timepass]
/timeout = 1000
</trial>

// trials = [1, 13 = noreplacenorepeat(NNN1,NNN2,BBB1); 2-12=break]
<block encoding>
/ preinstructions = (encodingIntro)
/ trials = [1-3 = noreplacenorepeat(NNN1,NNN2,BBB1)]
/ bgstim = (fixation)
</block>

*********************************************************************************
*********************************************************************************

<expt PrAff>
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN3_neuitem1 = list.neuItemNum.nextindex;
values.NNN3_neuitem2 = list.neuItemNum.nextindex;
values.NNN3_neuitem3 = list.neuItemNum.nextindex;

values.BBB1_negitem1 = list.negItemNum.nextindex;
values.BBB1_negitem2 = list.negItemNum.nextindex;
values.BBB1_negitem3 = list.negItemNum.nextindex;
values.BBB2_negitem1 = list.negItemNum.nextindex;
values.BBB2_negitem2 = list.negItemNum.nextindex;
values.BBB2_negitem3 = list.negItemNum.nextindex;
values.BBB3_negitem1 = list.negItemNum.nextindex;
values.BBB3_negitem2 = list.negItemNum.nextindex;
values.BBB3_negitem3 = list.negItemNum.nextindex;

values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem3.appenditem(round(rand(values.lower,values.upper)));

list.circley_BBB1_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem3.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem3.appenditem(round(rand(0,480)));
]
/ blocks = [1=encoding]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex_BBB1_negitem1 values.circley_BBB1_negitem1 response latency correct)
/ separatefiles = true
</data>






Thank you so much!!






If you need a response to *each* individual image in the triplet, you need to split things into separate trials -- there needs to be one *per* image in the triplet.

I have no real idea what you've been doing with respect to the circle positioning code. Please explain your reasoning in detail, i.e. please explain the code additions you made and what each is supposed to achieve.

Hi Dave,

I simplified the code and added comments in-between so it's easier to read. I hope it can make sense to you. In general, we want to select 9 images from an image pool to form three triplets of images. Each triplet will be shown for multiple times in a block. And the images within the triplet need to always be shown in that order. On top of that, we want each image to have a grey circle within the image frame. And the grey circle should appear on the same location every time the image repeats. Please see the code with commenting below. Again, thanks for helping out!


//The values below that started with "NNN" denotes the triplet images that was composed by three neutral images: neu-neu-neu = NNN
//There are in total three NNN triplets (e.g. NNN1, NNN2, NNN3). And "NNN3_neuitem2" refers to the second neutral image of third NNN triplet.
// neg1item denotes the first negative image of a triplet.
// The purpose of these values is to index from a pool of negative and neutral images to find non-repeating yet randomly-selected images to form these triplets from the pool, and use them in stimuli presentation

<values>
/ NNN1_neuitem1 = 1
/ NNN1_neuitem2 = 1
/ NNN1_neuitem3 = 1
/ NNN2_neuitem1 = 1
/ NNN2_neuitem2 = 1
/ NNN2_neuitem3 = 1
/ NNN3_neuitem1 = 1
/ NNN3_neuitem2 = 1
/ NNN3_neuitem3 = 1

/ neu1item = 1
/ neu2item = 1
/ neu3item = 1
</values>

//I made these values, e.g., "circlex_neu1item = 1px", to mirror the "neu1item = 1" as above, in order to have the circle and the image change in the same patter. Since there will be three images in a given trial, I think we'll need more than just circlex and circley to record circle position. But I think I might very likely be wrong here.
<values>
/ circley_neu1item =1px
/ circley_neu2item =1px
/ circley_neu3item =1px
/ circley_neg1item =1px
/ circley_neg2item =1px
/ circley_neg3item =1px

/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

//load in the neutral images, and define the item number based on the poolsize
<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
...
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>

//define each image that will fit into each triplet (three NNN triplets) chosen from the image pool
//for example neu1 is the first image of the NNN triplet

<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

//design the shape circle for each image within the triplet. For example, "circle_NNN1_neuitem1" means the circle for the first neutral image in the first NNN triplet, and "circle_NNN3_neuitem2" is for the circle in the second neutral image of the third NNN triplet
//My rationale is that there will be a different circle for each image, so we need these many different circles to fit in to each image. But maybe it's incorrect or excessive.
//Also I don't know if I'm doing it right to calculate the hposition and vposition.

<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN3_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN3_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN3_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>

//We define the trial element that for NNN1,NNN2, and NNN3. The image and the circle will show at the same time, and image will change in the same pattern as the circle location
//More specifically, in /ontrialbegin, because we have three items in a given trial, I think we're updating the values of image item number and circle coordinations for each image to keep them "covary"

//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circlex_neu1item = list.circlex_NNN1_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN1_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN1_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN1_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN1_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN1_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN1.response == "j" && values.circlex_neu1item < 320) || (trial.NNN1.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circlex_neu1item = list.circlex_NNN2_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN2_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN2_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN2_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN2_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN2_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN2.response == "j" && values.circlex_neu1item < 320) || (trial.NNN2.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN3>
/ ontrialbegin = [
values.neu1item = values.NNN3_neuitem1;
values.neu2item = values.NNN3_neuitem2;
values.neu3item = values.NNN3_neuitem3;
values.circlex_neu1item = list.circlex_NNN3_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN3_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN3_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN3_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN3_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN3_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN3_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN3_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN3_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN3.response == "j" && values.circlex_neu1item < 320) || (trial.NNN3.response == "k" && values.circlex_neu1item > 320)
]
</trial>

//I'm not 100% sure about the purpose of these list. I tried to mirror what you have in your sample code as "<list circlex> /selectionmode=values.itemnumber </list>"
<list circlex_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circley_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circlex_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circley_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circlex_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circley_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circlex_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circley_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circlex_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circley_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circlex_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circley_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circlex_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circley_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circlex_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circley_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circlex_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>
<list circley_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>

<list lowerbound>
/ items = (0,330)
/ poolsize = 49
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>

<block encoding>
/ preinstructions = (encodingIntro)
/ trials = [1-9 = noreplacenorepeat(NNN1,NNN2,NNN3)]
/ bgstim = (fixation)
</block>

//I took your suggestion to populate the lists of coordinates to make sure the location are tied to the image.
<expt PrAff>
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN3_neuitem1 = list.neuItemNum.nextindex;
values.NNN3_neuitem2 = list.neuItemNum.nextindex;
values.NNN3_neuitem3 = list.neuItemNum.nextindex;

values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem3.appenditem(round(rand(values.lower,values.upper)));

list.circley_NNN1_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem3.appenditem(round(rand(0,480)));
]
/ blocks = [1=encoding]
</expt>




Okay, if you essentially want a pre-selected (from some random space) circle position for tied to each selected image item, that -- just like the image item -- then remains fixed throughout the block / task, isn't it easiest to perform this in exactly the same way you perform the image selection? I.e. just like you have a value that denotes the item number for the first image in NNN1 triplet

<values>
/ NNN1_neuitem1 = 1
...
</values>

have values that denote the circle x and y positions for the circle *tied* to that item

<values>
/ NNN1_neuitem1 = 1
/ NNN1_neuitem1_x = 1px
/ NNN1_neuitem1_y = 1px
...
</values>

(and so forth for all the other triplets / items in the triplets)

Generate the x and y positions /onexpbegin as discussed, but don't store them in lists, store them in the respective values instead.

Then, finally, simply pull the x and y positions from the appropriate values /ontrialbegin, just like you do with the item numbers

<values>
/ circle1x = 1px
/ circle1y = 1px
/ circle2x = 1px
/ circle2y = 1px
/ circle3x = 1px
/ circle3y = 1px
</values>

<shape circle1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle1x
/ vposition = values.yoffset + values.circle1y
</shape>
<shape circle2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle2x
/ vposition = values.yoffset + values.circle2y
</shape>
<shape circle3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle3x
/ vposition = values.yoffset + values.circle3y
</shape>

//We define the trial element that for NNN1,NNN2, and NNN3. The image and the circle will show at the same time, and image will change in the same pattern as the circle location
//More specifically, in /ontrialbegin, because we have three items in a given trial, I think we're updating the values of image item number and circle coordinations for each image to keep them "covary"
//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circle1x = values.NNN1_neuitem1_x;
values.circle1y = values.NNN1_neuitem1_y;
values.circle2x = values.NNN1_neuitem2_x;
values.circle2y = values.NNN1_neuitem2_y;
values.circle3x = values.NNN1_neuitem3_x;
values.circle3y = values.NNN1_neuitem3_y;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle1; 1500=erase,fixation; 2000=neu2,circle2; 3000 = erase,fixation; 3500=neu3,circle3]
...
</trial>

Does that make sense?


Hi Dave,

I have a couple of questions for now:
First, if the only way to record response for each item in the triplet is to separate them into different trials. Then how to ensure the triplet images are grouped and each triplet are randomly selected to be presented?
For example, before we have:
<block myblock>
/ trials = [1-6 = noreplacenorepeat(NNN1,NNN2)]
</block>
where within NNN1, NNN2, NNN3, there are three individual images. And each triplet should appear three times
However, to make sure each image within the triplet have response recorded, we need to have something like this:
<block myblock>
/ trials = [1-18 = noreplacenorepeat(NNN1_1,NNN1_2,NNN1_3,NNN2_1,NNN2_2,NNN2_3)]
</block>
where NNN1_1,NNN1_2,NNN1_3 together is the NNN1 triplet equivalent as the first chunk of code.
Is there a way to ensure that NNN1_1,NNN1_2,NNN1_3 appear together and NNN2_1,NNN2_2,NNN2_3 appear together, each for three times?

Second, it turns out that to have the dot on the left side of the screen for half of the images (it doesn't matter which item within the triplet got the dot on the right or the left, as long as all together half of the images have the dot on each side) and the other half on the right side is an important feather of the experiment. Any idea how to incorporate that into your sample code above or my code below?

Here are my simplified code that works but might not be ideally right:

<defaults>
/ screencolor = black
/ fontstyle = ("Arial", 20pt)
/ quitcommand = (Shift+"q")
</defaults>

<text fixation>
/ items = ("+")
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 30pt)
/ erase = false
</text>

<values>
/ NNN1_neuitem1 = 1
/ NNN1_neuitem1_x = 1px
/ NNN1_neuitem1_y = 1px
/ NNN1_neuitem2 = 1
/ NNN1_neuitem2_x = 1px
/ NNN1_neuitem2_y = 1px
/ NNN1_neuitem3 = 1
/ NNN1_neuitem3_x = 1px
/ NNN1_neuitem3_y = 1px
/ NNN2_neuitem1 = 1
/ NNN2_neuitem1_x = 1px
/ NNN2_neuitem1_y = 1px
/ NNN2_neuitem2 = 1
/ NNN2_neuitem2_x = 1px
/ NNN2_neuitem2_y = 1px
/ NNN2_neuitem3 = 1
/ NNN2_neuitem3_x = 1px
/ NNN2_neuitem3_y = 1px

/ neu1item = 1
/ neu2item = 1
/ neu3item = 1

/ circle1x = 1px
/ circle1y = 1px
/ circle2x = 1px
/ circle2y = 1px
/ circle3x = 1px
/ circle3y = 1px

/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>


<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
...
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>

//define each item in the triplet
<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

//the location of x and y are chosen from the pool size..
<list circle_x>
/ poolsize = 640
/ selectionrate = always
</list>
<list circle_y>
/ poolsize = 480
/ selectionrate = always
</list>

// define circle for each item of the triplets
<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle1x
/ vposition = values.yoffset + values.circle1y
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle2x
/ vposition = values.yoffset + values.circle2y
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle3x
/ vposition = values.yoffset + values.circle3y
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle1x
/ vposition = values.yoffset + values.circle1y
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle2x
/ vposition = values.yoffset + values.circle2y
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle3x
/ vposition = values.yoffset + values.circle3y
</shape>


//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circle1x = values.NNN1_neuitem1_x;
values.circle1y = values.NNN1_neuitem1_y;
values.circle2x = values.NNN1_neuitem2_x;
values.circle2y = values.NNN1_neuitem2_y;
values.circle3x = values.NNN1_neuitem3_x;
values.circle3y = values.NNN1_neuitem3_y;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
</trial>


<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circle1x = values.NNN2_neuitem1_x;
values.circle1y = values.NNN2_neuitem1_y;
values.circle2x = values.NNN2_neuitem2_x;
values.circle2y = values.NNN2_neuitem2_y;
values.circle3x = values.NNN2_neuitem3_x;
values.circle3y = values.NNN2_neuitem3_y;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
</trial>


<shape erase>
/ shape = rectangle
/ color = black
/ size = (1px*display.width,1px*display.height)
</shape>


<block encoding>
/ trials = [1-6 = noreplacenorepeat(NNN1,NNN2)]
/ bgstim = (fixation)
</block>

*********************************************************************************
*********************************************************************************

<expt PrAff>
/ blocks = [1=encoding]
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem1_x = list.circle_x.nextindex;
values.NNN1_neuitem1_y = list.circle_y.nextindex;

values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem2_x = list.circle_x.nextindex;
values.NNN1_neuitem2_y = list.circle_y.nextindex;

values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN1_neuitem3_x = list.circle_x.nextindex;
values.NNN1_neuitem3_y = list.circle_y.nextindex;

values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem1_x = list.circle_x.nextindex;
values.NNN2_neuitem1_y = list.circle_y.nextindex;

values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem2_x = list.circle_x.nextindex;
values.NNN2_neuitem2_y = list.circle_y.nextindex;

values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem3_x = list.circle_x.nextindex;
values.NNN2_neuitem3_y = list.circle_y.nextindex;

]

</expt>

Hope my questions make sense. Thanks so much for your help!!!


skyeysss
skyeysss
Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)
Group: Forum Members
Posts: 10, Visits: 29
Dave - Wednesday, November 7, 2018
skyeysss - Wednesday, November 7, 2018
Dave - Wednesday, November 7, 2018
skyeysss - Tuesday, November 6, 2018
Dave - Monday, November 5, 2018
skyeysss - Sunday, November 4, 2018
Hi,

Sorry I'm pretty new to Inquisit so forgive me if these are naive questions:
I've been trying to figure out a way to randomize the location of a grey solid circle with the change of the images for each trial. Basically, in each trial, a subject will see a negative or neutral image, and there should be a grey circle showing on top of that image. The location of the grey circle is not pre-determined, but randomized for each subject and for each image within a range. The circle will always need to present within the frame of the image (size 640*480 in the center of the screen). The location of the circle should be fixed for each image (because the images repeat 3 times within a block), such that each unique image has a circle overlaying on the exact same spot for that image. But the location of the circle across images should be randomized (not likely to be the same). Also the subject will respond by pressing either the left or right arrow button to indicate whether the grey circle locates at the right or left side of the image for each trial. So we want a random half of the images in each condition (negative or neutral) have the circle on the left and the other half in each condition on the right to ensure counterbalancing. The stimuli duration is fixed, so no matter they respond or didn't respond, the trial should proceed. But it would be nice to record their accuracy. So ideally it would be great to know how whether the circle is on either side of image and compare that to the key press.

So there really are two parts to this question:
1. how to make two stimuli "covary"?
2. how to "remember" or detect the circle location on each image and record their accuracy?

Hope I describe the question clearly. Thanks for the help in advance!!!

At the start of the experiment, i.e. /onexptbegin, you'll want to populate two <list> elements -- one for x coordinates, one for y coordinates -- with circle locations. Those <list> elements ought to be paired to your picture stimuli. This will ensure that a specific (randomly generated) location is and remains tied to a specific image stimulus. This also, then, tells you the circle location in each trial, i.e. you can determine whether it's on the left or right side from its horizontal position and determine response correctness accordingly. Here's a simple example:

<values>
/ itemnumber = 1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

// 4 items in this example
<list stimnumber>
/ poolsize = 4
</list>

<text stimulus>
/ items = stimitems
/ size = (640px, 480px)
/ txbgcolor = yellow
/ vjustify = center
/ select = values.itemnumber
</text>

<item stimitems>
/ 1 = "A"
/ 1 = "B"
/ 1 = "C"
/ 1 = "D"
</item>

<shape thecircle>
/ shape = circle
/ color = grey
/ size = (30px, 30px)
/ hposition = values.xoffset + values.circlex
/ vposition = values.yoffset + values.circley
</shape>

<list circlex>
/ selectionmode = values.itemnumber
</list>

<list circley>
/ selectionmode = values.itemnumber
</list>

<trial mytrial>
/ ontrialbegin = [
values.itemnumber = list.stimnumber.nextindex;
values.circlex = list.circlex.nextvalue;
values.circley = list.circley.nextvalue;
]
/ stimulusframes = [1=stimulus, thecircle]
/ validresponse = (203, 205)
/ iscorrectresponse = [
(trial.mytrial.response == 203 && values.circlex < 320) || (trial.mytrial.response == 205 && values.circlex > 320)
]
/ timeout = 5000
</trial>

<block myblock>
/ trials = [1-12 = mytrial]
</block>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>


<expt>
/ onexptbegin = [
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));

list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
]
/ blocks = [1=myblock]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex values.circley response latency correct)
/ separatefiles = true
</data>




Hi Dave,

Thanks so much for your help!! Although your code works great, I couldn't incorporate it into my code. In the code below: each three images become a triplet as one trial (this is what you suggested under another thread). And I've been trying to make a circle shape for each type of stimuli (Maybe that's excessive?). The major problem is that the circle doesn't randomize in the image space at all: it always shows up at the top left corner (except for one particular image somehow). Also, now the code only calculates accuracy for each trial, which has three images. But people will need to respond to every image within the triplet. Is there a way to get the 3 accuracy in each triplet?

Please take a look at the code:


<defaults>
/ screencolor = black
/ fontstyle = ("Arial", 20pt)
/ quitcommand = (Shift+"q")
</defaults>

<text fixation>
/ items = ("+")
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 30pt)
/ erase = false
</text>

*********************************************************************************
*********************************************************************************
encoding phase
<values>
/ BNN1_negitem1 = 1
/ BNN1_neuitem2 = 1
/ BNN1_neuitem3 = 1
/ BNN2_negitem1 = 1
/ BNN2_neuitem2 = 1
/ BNN2_neuitem3 = 1
/ BNN3_negitem1 = 1
/ BNN3_neuitem2 = 1
/ BNN3_neuitem3 = 1

/ NNB1_neuitem1 = 1
/ NNB1_neuitem2 = 1
/ NNB1_negitem3 = 1
/ NNB2_neuitem1 = 1
/ NNB2_neuitem2 = 1
/ NNB2_negitem3 = 1
/ NNB3_neuitem1 = 1
/ NNB3_neuitem2 = 1
/ NNB3_negitem3 = 1

/ NNN1_neuitem1 = 1
/ NNN1_neuitem2 = 1
/ NNN1_neuitem3 = 1
/ NNN2_neuitem1 = 1
/ NNN2_neuitem2 = 1
/ NNN2_neuitem3 = 1
/ NNN3_neuitem1 = 1
/ NNN3_neuitem2 = 1
/ NNN3_neuitem3 = 1

/ BBB1_negitem1 = 1
/ BBB1_negitem2 = 1
/ BBB1_negitem3 = 1
/ BBB2_negitem1 = 1
/ BBB2_negitem2 = 1
/ BBB2_negitem3 = 1
/ BBB3_negitem1 = 1
/ BBB3_negitem2 = 1
/ BBB3_negitem3 = 1

/ neg1item = 1
/ neg2item = 1
/ neg3item = 1
/ neu1item = 1
/ neu2item = 1
/ neu3item = 1
</values>
<values>
/ circlex_neu1item =1
/ circlex_neu2item =1
/ circlex_neu3item =1
/ circlex_neg1item =1
/ circlex_neg2item =1
/ circlex_neg3item =1
/ circley_neu1item =1
/ circley_neu2item =1
/ circley_neu3item =1
/ circley_neg1item =1
/ circley_neg2item =1
/ circley_neg3item =1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

<item negImages>
/ 1 = "./stimuli/negative/2053.jpg"
/ 2 = "./stimuli/negative/2141.jpg"
/ 3 = "./stimuli/negative/2205.jpg"
/ 4 = "./stimuli/negative/2301.jpg"
/ 5 = "./stimuli/negative/2345.1.jpg"
/ 6 = "./stimuli/negative/2352.2.jpg"
/ 7 = "./stimuli/negative/2456.jpg"
/ 8 = "./stimuli/negative/2683.jpg"
/ 9 = "./stimuli/negative/2688.jpg"
/ 10 = "./stimuli/negative/2710.jpg"
/ 11 = "./stimuli/negative/2730.jpg"
/ 12 = "./stimuli/negative/2751.jpg"
/ 13 = "./stimuli/negative/2799.jpg"
/ 14 = "./stimuli/negative/2800.jpg"
/ 15 = "./stimuli/negative/2811.jpg"
/ 16 = "./stimuli/negative/2900.jpg"
/ 17 = "./stimuli/negative/3001.jpg"
/ 18 = "./stimuli/negative/3015.jpg"
/ 19 = "./stimuli/negative/3019.jpg"
/ 20 = "./stimuli/negative/3053.jpg"
/ 21 = "./stimuli/negative/3064.jpg"
/ 22 = "./stimuli/negative/3120.jpg"
/ 23 = "./stimuli/negative/3160.jpg"
/ 24 = "./stimuli/negative/3170.jpg"
/ 25 = "./stimuli/negative/3180.jpg"
/ 26 = "./stimuli/negative/3195.jpg"
/ 27 = "./stimuli/negative/3212.jpg"
/ 28 = "./stimuli/negative/3230.jpg"
/ 29 = "./stimuli/negative/3261.jpg"
/ 30 = "./stimuli/negative/3300.jpg"
/ 31 = "./stimuli/negative/3350.jpg"
/ 32 = "./stimuli/negative/3400.jpg"
/ 33 = "./stimuli/negative/3550.1.jpg"
/ 34 = "./stimuli/negative/6243.jpg"
/ 35 = "./stimuli/negative/6312.jpg"
/ 36 = "./stimuli/negative/6315.jpg"
/ 37 = "./stimuli/negative/6563.jpg"
/ 38 = "./stimuli/negative/6570.jpg"
/ 39 = "./stimuli/negative/6571.jpg"
/ 40 = "./stimuli/negative/6821.jpg"
/ 41 = "./stimuli/negative/6825.jpg"
/ 42 = "./stimuli/negative/7380.jpg"
/ 43 = "./stimuli/negative/9006.jpg"
/ 44 = "./stimuli/negative/9041.jpg"
</item>
<list negItemNum>
/ poolsize = 44
/ selectionrate = always
</list>

<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
/ 2 = "./stimuli/neutral/1122.jpg"
/ 3 = "./stimuli/neutral/1230.jpg"
/ 4 = "./stimuli/neutral/1302.jpg"
/ 5 = "./stimuli/neutral/1350.jpg"
/ 6 = "./stimuli/neutral/1390.jpg"
/ 7 = "./stimuli/neutral/1560.jpg"
/ 8 = "./stimuli/neutral/1616.jpg"
/ 9 = "./stimuli/neutral/1617.jpg"
/ 10 = "./stimuli/neutral/1645.jpg"
/ 11 = "./stimuli/neutral/1670.jpg"
/ 12 = "./stimuli/neutral/1675.jpg"
/ 13 = "./stimuli/neutral/1726.jpg"
/ 14 = "./stimuli/neutral/1820.jpg"
/ 15 = "./stimuli/neutral/1903.jpg"
/ 16 = "./stimuli/neutral/1908.jpg"
/ 17 = "./stimuli/neutral/1931.jpg"
/ 18 = "./stimuli/neutral/1935.jpg"
/ 19 = "./stimuli/neutral/1945.jpg"
/ 20 = "./stimuli/neutral/1947.jpg"
/ 21 = "./stimuli/neutral/2020.jpg"
/ 22 = "./stimuli/neutral/2032.jpg"
/ 23 = "./stimuli/neutral/2101.jpg"
/ 24 = "./stimuli/neutral/2102.jpg"
/ 25 = "./stimuli/neutral/2107.jpg"
/ 26 = "./stimuli/neutral/2122.jpg"
/ 27 = "./stimuli/neutral/2191.jpg"
/ 28 = "./stimuli/neutral/2206.jpg"
/ 29 = "./stimuli/neutral/2210.jpg"
/ 30 = "./stimuli/neutral/2215.jpg"
/ 31 = "./stimuli/neutral/2220.jpg"
/ 32 = "./stimuli/neutral/2221.jpg"
/ 33 = "./stimuli/neutral/2235.jpg"
/ 34 = "./stimuli/neutral/2272.jpg"
/ 35 = "./stimuli/neutral/2279.jpg"
/ 36 = "./stimuli/neutral/2308.jpg"
/ 37 = "./stimuli/neutral/2309.jpg"
/ 38 = "./stimuli/neutral/2359.jpg"
/ 39 = "./stimuli/neutral/2377.jpg"
/ 40 = "./stimuli/neutral/2384.jpg"
/ 41 = "./stimuli/neutral/2393.jpg"
/ 42 = "./stimuli/neutral/2396.jpg"
/ 43 = "./stimuli/neutral/2397.jpg"
/ 44 = "./stimuli/neutral/2411.jpg"
/ 45 = "./stimuli/neutral/2435.jpg"
/ 46 = "./stimuli/neutral/2445.jpg"
/ 47 = "./stimuli/neutral/2446.jpg"
/ 48 = "./stimuli/neutral/2458.jpg"
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>


<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

<picture neg1>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg1item
</picture>
<picture neg2>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg2item
</picture>
<picture neg3>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg3item
</picture>

//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circlex_neu1item = list.circlex_NNN1_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN1_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN1_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN1_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN1_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN1_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN1.response == "j" && values.circlex_neu1item < 320) || (trial.NNN1.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circlex_neu1item = list.circlex_NNN2_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN2_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN2_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN2_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN2_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN2_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN2.response == "j" && values.circlex_neu1item < 320) || (trial.NNN2.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN3>
/ ontrialbegin = [
values.neu1item = values.NNN3_neuitem1;
values.neu2item = values.NNN3_neuitem2;
values.neu3item = values.NNN3_neuitem3;
values.circlex_neu1item = list.circlex_NNN3_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN3_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN3_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN3_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN3_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN3_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN3_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN3_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN3_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN3.response == "j" && values.circlex_neu1item < 320) || (trial.NNN3.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<list circlex_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circley_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circlex_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circley_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circlex_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circley_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circlex_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circley_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circlex_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circley_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circlex_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circley_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circlex_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circley_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circlex_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circley_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circlex_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>
<list circley_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>

//BBB triplets
<trial BBB1>
/ ontrialbegin = [
values.neg1item = values.BBB1_negitem1;
values.neg2item = values.BBB1_negitem2;
values.neg3item = values.BBB1_negitem3;
values.circlex_neg1item = list.circlex_BBB1_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB1_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB1_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB1_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB1_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB1_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB1_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB1_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB1_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB1.response == "j" && values.circlex_neg1item < 320) || (trial.BBB1.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB2>
/ ontrialbegin = [
values.neg1item = values.BBB2_negitem1;
values.neg2item = values.BBB2_negitem2;
values.neg3item = values.BBB2_negitem3;
values.circlex_neg1item = list.circlex_BBB2_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB2_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB2_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB2_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB2_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB2_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB2_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB2_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB2_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB2.response == "j" && values.circlex_neg1item < 320) || (trial.BBB2.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB3>
/ ontrialbegin = [
values.neg1item = values.BBB3_negitem1;
values.neg2item = values.BBB3_negitem2;
values.neg3item = values.BBB3_negitem3;
values.circlex_neg1item = list.circlex_BBB3_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB3_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB3_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB3_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB3_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB3_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB3_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB3_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB3_negitem3]
/ timeout = 4500
/ validresponse = ("j", "k")
/ iscorrectresponse = [
(trial.BBB3.response == "j" && values.circlex_neg1item < 320) || (trial.BBB3.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<list circlex_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circley_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circlex_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circley_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circlex_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circley_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circlex_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circley_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circlex_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circley_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circlex_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circley_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circlex_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circley_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circlex_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circley_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circlex_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>
<list circley_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>

<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN3_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN3_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN3_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>

<shape circle_BBB1_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB1_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB1_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB2_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB2_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB2_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB3_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB3_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB3_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>

<shape erase>
/ shape = rectangle
/ color = black
/ size = (1px*display.width,1px*display.height)
</shape>

<values>
/ imageCondition = 1
/ leftRightPosition = 1
</values>

<page encodingIntro>
^^Again, if you see a grey patch on the left side of the picture, please press the button “J” as quickly as possible. If you see a grey patch on the right side of the picture, please press the button “K” as quickly as possible.
^^Please make sure you always use the same fingers to press the buttons. You will have breaks periodically.
^^If at any point of this part of the experiment that you want to quit, please press control+Q.
^^To continue, please press the space bar.
</page>

<item times>
/1 = " Please take a break, the experiemnt will begin shortly. 1:00"
/2 = " Please take a break, the experiemnt will begin shortly. 00:59"
</item>
<text timepass>
/items = times
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 3%)
</text>
<trial break>
/stimulustimes = [0=timepass]
/timeout = 1000
</trial>

// trials = [1, 13 = noreplacenorepeat(NNN1,NNN2,BBB1); 2-12=break]
<block encoding>
/ preinstructions = (encodingIntro)
/ trials = [1-3 = noreplacenorepeat(NNN1,NNN2,BBB1)]
/ bgstim = (fixation)
</block>

*********************************************************************************
*********************************************************************************

<expt PrAff>
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN3_neuitem1 = list.neuItemNum.nextindex;
values.NNN3_neuitem2 = list.neuItemNum.nextindex;
values.NNN3_neuitem3 = list.neuItemNum.nextindex;

values.BBB1_negitem1 = list.negItemNum.nextindex;
values.BBB1_negitem2 = list.negItemNum.nextindex;
values.BBB1_negitem3 = list.negItemNum.nextindex;
values.BBB2_negitem1 = list.negItemNum.nextindex;
values.BBB2_negitem2 = list.negItemNum.nextindex;
values.BBB2_negitem3 = list.negItemNum.nextindex;
values.BBB3_negitem1 = list.negItemNum.nextindex;
values.BBB3_negitem2 = list.negItemNum.nextindex;
values.BBB3_negitem3 = list.negItemNum.nextindex;

values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem3.appenditem(round(rand(values.lower,values.upper)));

list.circley_BBB1_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem3.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem3.appenditem(round(rand(0,480)));
]
/ blocks = [1=encoding]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex_BBB1_negitem1 values.circley_BBB1_negitem1 response latency correct)
/ separatefiles = true
</data>






Thank you so much!!






If you need a response to *each* individual image in the triplet, you need to split things into separate trials -- there needs to be one *per* image in the triplet.

I have no real idea what you've been doing with respect to the circle positioning code. Please explain your reasoning in detail, i.e. please explain the code additions you made and what each is supposed to achieve.

Hi Dave,

I simplified the code and added comments in-between so it's easier to read. I hope it can make sense to you. In general, we want to select 9 images from an image pool to form three triplets of images. Each triplet will be shown for multiple times in a block. And the images within the triplet need to always be shown in that order. On top of that, we want each image to have a grey circle within the image frame. And the grey circle should appear on the same location every time the image repeats. Please see the code with commenting below. Again, thanks for helping out!


//The values below that started with "NNN" denotes the triplet images that was composed by three neutral images: neu-neu-neu = NNN
//There are in total three NNN triplets (e.g. NNN1, NNN2, NNN3). And "NNN3_neuitem2" refers to the second neutral image of third NNN triplet.
// neg1item denotes the first negative image of a triplet.
// The purpose of these values is to index from a pool of negative and neutral images to find non-repeating yet randomly-selected images to form these triplets from the pool, and use them in stimuli presentation

<values>
/ NNN1_neuitem1 = 1
/ NNN1_neuitem2 = 1
/ NNN1_neuitem3 = 1
/ NNN2_neuitem1 = 1
/ NNN2_neuitem2 = 1
/ NNN2_neuitem3 = 1
/ NNN3_neuitem1 = 1
/ NNN3_neuitem2 = 1
/ NNN3_neuitem3 = 1

/ neu1item = 1
/ neu2item = 1
/ neu3item = 1
</values>

//I made these values, e.g., "circlex_neu1item = 1px", to mirror the "neu1item = 1" as above, in order to have the circle and the image change in the same patter. Since there will be three images in a given trial, I think we'll need more than just circlex and circley to record circle position. But I think I might very likely be wrong here.
<values>
/ circley_neu1item =1px
/ circley_neu2item =1px
/ circley_neu3item =1px
/ circley_neg1item =1px
/ circley_neg2item =1px
/ circley_neg3item =1px

/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

//load in the neutral images, and define the item number based on the poolsize
<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
...
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>

//define each image that will fit into each triplet (three NNN triplets) chosen from the image pool
//for example neu1 is the first image of the NNN triplet

<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

//design the shape circle for each image within the triplet. For example, "circle_NNN1_neuitem1" means the circle for the first neutral image in the first NNN triplet, and "circle_NNN3_neuitem2" is for the circle in the second neutral image of the third NNN triplet
//My rationale is that there will be a different circle for each image, so we need these many different circles to fit in to each image. But maybe it's incorrect or excessive.
//Also I don't know if I'm doing it right to calculate the hposition and vposition.

<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN3_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN3_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN3_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>

//We define the trial element that for NNN1,NNN2, and NNN3. The image and the circle will show at the same time, and image will change in the same pattern as the circle location
//More specifically, in /ontrialbegin, because we have three items in a given trial, I think we're updating the values of image item number and circle coordinations for each image to keep them "covary"

//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circlex_neu1item = list.circlex_NNN1_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN1_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN1_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN1_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN1_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN1_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN1.response == "j" && values.circlex_neu1item < 320) || (trial.NNN1.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circlex_neu1item = list.circlex_NNN2_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN2_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN2_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN2_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN2_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN2_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN2.response == "j" && values.circlex_neu1item < 320) || (trial.NNN2.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN3>
/ ontrialbegin = [
values.neu1item = values.NNN3_neuitem1;
values.neu2item = values.NNN3_neuitem2;
values.neu3item = values.NNN3_neuitem3;
values.circlex_neu1item = list.circlex_NNN3_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN3_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN3_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN3_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN3_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN3_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN3_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN3_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN3_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN3.response == "j" && values.circlex_neu1item < 320) || (trial.NNN3.response == "k" && values.circlex_neu1item > 320)
]
</trial>

//I'm not 100% sure about the purpose of these list. I tried to mirror what you have in your sample code as "<list circlex> /selectionmode=values.itemnumber </list>"
<list circlex_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circley_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circlex_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circley_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circlex_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circley_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circlex_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circley_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circlex_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circley_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circlex_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circley_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circlex_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circley_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circlex_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circley_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circlex_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>
<list circley_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>

<list lowerbound>
/ items = (0,330)
/ poolsize = 49
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>

<block encoding>
/ preinstructions = (encodingIntro)
/ trials = [1-9 = noreplacenorepeat(NNN1,NNN2,NNN3)]
/ bgstim = (fixation)
</block>

//I took your suggestion to populate the lists of coordinates to make sure the location are tied to the image.
<expt PrAff>
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN3_neuitem1 = list.neuItemNum.nextindex;
values.NNN3_neuitem2 = list.neuItemNum.nextindex;
values.NNN3_neuitem3 = list.neuItemNum.nextindex;

values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem3.appenditem(round(rand(values.lower,values.upper)));

list.circley_NNN1_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem3.appenditem(round(rand(0,480)));
]
/ blocks = [1=encoding]
</expt>




Okay, if you essentially want a pre-selected (from some random space) circle position for tied to each selected image item, that -- just like the image item -- then remains fixed throughout the block / task, isn't it easiest to perform this in exactly the same way you perform the image selection? I.e. just like you have a value that denotes the item number for the first image in NNN1 triplet

<values>
/ NNN1_neuitem1 = 1
...
</values>

have values that denote the circle x and y positions for the circle *tied* to that item

<values>
/ NNN1_neuitem1 = 1
/ NNN1_neuitem1_x = 1px
/ NNN1_neuitem1_y = 1px
...
</values>

(and so forth for all the other triplets / items in the triplets)

Generate the x and y positions /onexpbegin as discussed, but don't store them in lists, store them in the respective values instead.

Then, finally, simply pull the x and y positions from the appropriate values /ontrialbegin, just like you do with the item numbers

<values>
/ circle1x = 1px
/ circle1y = 1px
/ circle2x = 1px
/ circle2y = 1px
/ circle3x = 1px
/ circle3y = 1px
</values>

<shape circle1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle1x
/ vposition = values.yoffset + values.circle1y
</shape>
<shape circle2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle2x
/ vposition = values.yoffset + values.circle2y
</shape>
<shape circle3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle3x
/ vposition = values.yoffset + values.circle3y
</shape>

//We define the trial element that for NNN1,NNN2, and NNN3. The image and the circle will show at the same time, and image will change in the same pattern as the circle location
//More specifically, in /ontrialbegin, because we have three items in a given trial, I think we're updating the values of image item number and circle coordinations for each image to keep them "covary"
//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circle1x = values.NNN1_neuitem1_x;
values.circle1y = values.NNN1_neuitem1_y;
values.circle2x = values.NNN1_neuitem2_x;
values.circle2y = values.NNN1_neuitem2_y;
values.circle3x = values.NNN1_neuitem3_x;
values.circle3y = values.NNN1_neuitem3_y;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle1; 1500=erase,fixation; 2000=neu2,circle2; 3000 = erase,fixation; 3500=neu3,circle3]
...
</trial>

Does that make sense?


It took me a while to figure out exactly how I want the code to work. But yeah, your explanation makes total sense! Thank you!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
skyeysss - Wednesday, November 7, 2018
Dave - Wednesday, November 7, 2018
skyeysss - Tuesday, November 6, 2018
Dave - Monday, November 5, 2018
skyeysss - Sunday, November 4, 2018
Hi,

Sorry I'm pretty new to Inquisit so forgive me if these are naive questions:
I've been trying to figure out a way to randomize the location of a grey solid circle with the change of the images for each trial. Basically, in each trial, a subject will see a negative or neutral image, and there should be a grey circle showing on top of that image. The location of the grey circle is not pre-determined, but randomized for each subject and for each image within a range. The circle will always need to present within the frame of the image (size 640*480 in the center of the screen). The location of the circle should be fixed for each image (because the images repeat 3 times within a block), such that each unique image has a circle overlaying on the exact same spot for that image. But the location of the circle across images should be randomized (not likely to be the same). Also the subject will respond by pressing either the left or right arrow button to indicate whether the grey circle locates at the right or left side of the image for each trial. So we want a random half of the images in each condition (negative or neutral) have the circle on the left and the other half in each condition on the right to ensure counterbalancing. The stimuli duration is fixed, so no matter they respond or didn't respond, the trial should proceed. But it would be nice to record their accuracy. So ideally it would be great to know how whether the circle is on either side of image and compare that to the key press.

So there really are two parts to this question:
1. how to make two stimuli "covary"?
2. how to "remember" or detect the circle location on each image and record their accuracy?

Hope I describe the question clearly. Thanks for the help in advance!!!

At the start of the experiment, i.e. /onexptbegin, you'll want to populate two <list> elements -- one for x coordinates, one for y coordinates -- with circle locations. Those <list> elements ought to be paired to your picture stimuli. This will ensure that a specific (randomly generated) location is and remains tied to a specific image stimulus. This also, then, tells you the circle location in each trial, i.e. you can determine whether it's on the left or right side from its horizontal position and determine response correctness accordingly. Here's a simple example:

<values>
/ itemnumber = 1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

// 4 items in this example
<list stimnumber>
/ poolsize = 4
</list>

<text stimulus>
/ items = stimitems
/ size = (640px, 480px)
/ txbgcolor = yellow
/ vjustify = center
/ select = values.itemnumber
</text>

<item stimitems>
/ 1 = "A"
/ 1 = "B"
/ 1 = "C"
/ 1 = "D"
</item>

<shape thecircle>
/ shape = circle
/ color = grey
/ size = (30px, 30px)
/ hposition = values.xoffset + values.circlex
/ vposition = values.yoffset + values.circley
</shape>

<list circlex>
/ selectionmode = values.itemnumber
</list>

<list circley>
/ selectionmode = values.itemnumber
</list>

<trial mytrial>
/ ontrialbegin = [
values.itemnumber = list.stimnumber.nextindex;
values.circlex = list.circlex.nextvalue;
values.circley = list.circley.nextvalue;
]
/ stimulusframes = [1=stimulus, thecircle]
/ validresponse = (203, 205)
/ iscorrectresponse = [
(trial.mytrial.response == 203 && values.circlex < 320) || (trial.mytrial.response == 205 && values.circlex > 320)
]
/ timeout = 5000
</trial>

<block myblock>
/ trials = [1-12 = mytrial]
</block>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>


<expt>
/ onexptbegin = [
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));

list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
]
/ blocks = [1=myblock]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex values.circley response latency correct)
/ separatefiles = true
</data>




Hi Dave,

Thanks so much for your help!! Although your code works great, I couldn't incorporate it into my code. In the code below: each three images become a triplet as one trial (this is what you suggested under another thread). And I've been trying to make a circle shape for each type of stimuli (Maybe that's excessive?). The major problem is that the circle doesn't randomize in the image space at all: it always shows up at the top left corner (except for one particular image somehow). Also, now the code only calculates accuracy for each trial, which has three images. But people will need to respond to every image within the triplet. Is there a way to get the 3 accuracy in each triplet?

Please take a look at the code:


<defaults>
/ screencolor = black
/ fontstyle = ("Arial", 20pt)
/ quitcommand = (Shift+"q")
</defaults>

<text fixation>
/ items = ("+")
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 30pt)
/ erase = false
</text>

*********************************************************************************
*********************************************************************************
encoding phase
<values>
/ BNN1_negitem1 = 1
/ BNN1_neuitem2 = 1
/ BNN1_neuitem3 = 1
/ BNN2_negitem1 = 1
/ BNN2_neuitem2 = 1
/ BNN2_neuitem3 = 1
/ BNN3_negitem1 = 1
/ BNN3_neuitem2 = 1
/ BNN3_neuitem3 = 1

/ NNB1_neuitem1 = 1
/ NNB1_neuitem2 = 1
/ NNB1_negitem3 = 1
/ NNB2_neuitem1 = 1
/ NNB2_neuitem2 = 1
/ NNB2_negitem3 = 1
/ NNB3_neuitem1 = 1
/ NNB3_neuitem2 = 1
/ NNB3_negitem3 = 1

/ NNN1_neuitem1 = 1
/ NNN1_neuitem2 = 1
/ NNN1_neuitem3 = 1
/ NNN2_neuitem1 = 1
/ NNN2_neuitem2 = 1
/ NNN2_neuitem3 = 1
/ NNN3_neuitem1 = 1
/ NNN3_neuitem2 = 1
/ NNN3_neuitem3 = 1

/ BBB1_negitem1 = 1
/ BBB1_negitem2 = 1
/ BBB1_negitem3 = 1
/ BBB2_negitem1 = 1
/ BBB2_negitem2 = 1
/ BBB2_negitem3 = 1
/ BBB3_negitem1 = 1
/ BBB3_negitem2 = 1
/ BBB3_negitem3 = 1

/ neg1item = 1
/ neg2item = 1
/ neg3item = 1
/ neu1item = 1
/ neu2item = 1
/ neu3item = 1
</values>
<values>
/ circlex_neu1item =1
/ circlex_neu2item =1
/ circlex_neu3item =1
/ circlex_neg1item =1
/ circlex_neg2item =1
/ circlex_neg3item =1
/ circley_neu1item =1
/ circley_neu2item =1
/ circley_neu3item =1
/ circley_neg1item =1
/ circley_neg2item =1
/ circley_neg3item =1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

<item negImages>
/ 1 = "./stimuli/negative/2053.jpg"
/ 2 = "./stimuli/negative/2141.jpg"
/ 3 = "./stimuli/negative/2205.jpg"
/ 4 = "./stimuli/negative/2301.jpg"
/ 5 = "./stimuli/negative/2345.1.jpg"
/ 6 = "./stimuli/negative/2352.2.jpg"
/ 7 = "./stimuli/negative/2456.jpg"
/ 8 = "./stimuli/negative/2683.jpg"
/ 9 = "./stimuli/negative/2688.jpg"
/ 10 = "./stimuli/negative/2710.jpg"
/ 11 = "./stimuli/negative/2730.jpg"
/ 12 = "./stimuli/negative/2751.jpg"
/ 13 = "./stimuli/negative/2799.jpg"
/ 14 = "./stimuli/negative/2800.jpg"
/ 15 = "./stimuli/negative/2811.jpg"
/ 16 = "./stimuli/negative/2900.jpg"
/ 17 = "./stimuli/negative/3001.jpg"
/ 18 = "./stimuli/negative/3015.jpg"
/ 19 = "./stimuli/negative/3019.jpg"
/ 20 = "./stimuli/negative/3053.jpg"
/ 21 = "./stimuli/negative/3064.jpg"
/ 22 = "./stimuli/negative/3120.jpg"
/ 23 = "./stimuli/negative/3160.jpg"
/ 24 = "./stimuli/negative/3170.jpg"
/ 25 = "./stimuli/negative/3180.jpg"
/ 26 = "./stimuli/negative/3195.jpg"
/ 27 = "./stimuli/negative/3212.jpg"
/ 28 = "./stimuli/negative/3230.jpg"
/ 29 = "./stimuli/negative/3261.jpg"
/ 30 = "./stimuli/negative/3300.jpg"
/ 31 = "./stimuli/negative/3350.jpg"
/ 32 = "./stimuli/negative/3400.jpg"
/ 33 = "./stimuli/negative/3550.1.jpg"
/ 34 = "./stimuli/negative/6243.jpg"
/ 35 = "./stimuli/negative/6312.jpg"
/ 36 = "./stimuli/negative/6315.jpg"
/ 37 = "./stimuli/negative/6563.jpg"
/ 38 = "./stimuli/negative/6570.jpg"
/ 39 = "./stimuli/negative/6571.jpg"
/ 40 = "./stimuli/negative/6821.jpg"
/ 41 = "./stimuli/negative/6825.jpg"
/ 42 = "./stimuli/negative/7380.jpg"
/ 43 = "./stimuli/negative/9006.jpg"
/ 44 = "./stimuli/negative/9041.jpg"
</item>
<list negItemNum>
/ poolsize = 44
/ selectionrate = always
</list>

<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
/ 2 = "./stimuli/neutral/1122.jpg"
/ 3 = "./stimuli/neutral/1230.jpg"
/ 4 = "./stimuli/neutral/1302.jpg"
/ 5 = "./stimuli/neutral/1350.jpg"
/ 6 = "./stimuli/neutral/1390.jpg"
/ 7 = "./stimuli/neutral/1560.jpg"
/ 8 = "./stimuli/neutral/1616.jpg"
/ 9 = "./stimuli/neutral/1617.jpg"
/ 10 = "./stimuli/neutral/1645.jpg"
/ 11 = "./stimuli/neutral/1670.jpg"
/ 12 = "./stimuli/neutral/1675.jpg"
/ 13 = "./stimuli/neutral/1726.jpg"
/ 14 = "./stimuli/neutral/1820.jpg"
/ 15 = "./stimuli/neutral/1903.jpg"
/ 16 = "./stimuli/neutral/1908.jpg"
/ 17 = "./stimuli/neutral/1931.jpg"
/ 18 = "./stimuli/neutral/1935.jpg"
/ 19 = "./stimuli/neutral/1945.jpg"
/ 20 = "./stimuli/neutral/1947.jpg"
/ 21 = "./stimuli/neutral/2020.jpg"
/ 22 = "./stimuli/neutral/2032.jpg"
/ 23 = "./stimuli/neutral/2101.jpg"
/ 24 = "./stimuli/neutral/2102.jpg"
/ 25 = "./stimuli/neutral/2107.jpg"
/ 26 = "./stimuli/neutral/2122.jpg"
/ 27 = "./stimuli/neutral/2191.jpg"
/ 28 = "./stimuli/neutral/2206.jpg"
/ 29 = "./stimuli/neutral/2210.jpg"
/ 30 = "./stimuli/neutral/2215.jpg"
/ 31 = "./stimuli/neutral/2220.jpg"
/ 32 = "./stimuli/neutral/2221.jpg"
/ 33 = "./stimuli/neutral/2235.jpg"
/ 34 = "./stimuli/neutral/2272.jpg"
/ 35 = "./stimuli/neutral/2279.jpg"
/ 36 = "./stimuli/neutral/2308.jpg"
/ 37 = "./stimuli/neutral/2309.jpg"
/ 38 = "./stimuli/neutral/2359.jpg"
/ 39 = "./stimuli/neutral/2377.jpg"
/ 40 = "./stimuli/neutral/2384.jpg"
/ 41 = "./stimuli/neutral/2393.jpg"
/ 42 = "./stimuli/neutral/2396.jpg"
/ 43 = "./stimuli/neutral/2397.jpg"
/ 44 = "./stimuli/neutral/2411.jpg"
/ 45 = "./stimuli/neutral/2435.jpg"
/ 46 = "./stimuli/neutral/2445.jpg"
/ 47 = "./stimuli/neutral/2446.jpg"
/ 48 = "./stimuli/neutral/2458.jpg"
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>


<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

<picture neg1>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg1item
</picture>
<picture neg2>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg2item
</picture>
<picture neg3>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg3item
</picture>

//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circlex_neu1item = list.circlex_NNN1_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN1_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN1_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN1_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN1_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN1_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN1.response == "j" && values.circlex_neu1item < 320) || (trial.NNN1.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circlex_neu1item = list.circlex_NNN2_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN2_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN2_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN2_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN2_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN2_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN2.response == "j" && values.circlex_neu1item < 320) || (trial.NNN2.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN3>
/ ontrialbegin = [
values.neu1item = values.NNN3_neuitem1;
values.neu2item = values.NNN3_neuitem2;
values.neu3item = values.NNN3_neuitem3;
values.circlex_neu1item = list.circlex_NNN3_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN3_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN3_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN3_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN3_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN3_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN3_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN3_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN3_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN3.response == "j" && values.circlex_neu1item < 320) || (trial.NNN3.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<list circlex_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circley_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circlex_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circley_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circlex_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circley_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circlex_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circley_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circlex_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circley_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circlex_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circley_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circlex_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circley_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circlex_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circley_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circlex_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>
<list circley_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>

//BBB triplets
<trial BBB1>
/ ontrialbegin = [
values.neg1item = values.BBB1_negitem1;
values.neg2item = values.BBB1_negitem2;
values.neg3item = values.BBB1_negitem3;
values.circlex_neg1item = list.circlex_BBB1_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB1_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB1_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB1_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB1_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB1_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB1_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB1_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB1_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB1.response == "j" && values.circlex_neg1item < 320) || (trial.BBB1.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB2>
/ ontrialbegin = [
values.neg1item = values.BBB2_negitem1;
values.neg2item = values.BBB2_negitem2;
values.neg3item = values.BBB2_negitem3;
values.circlex_neg1item = list.circlex_BBB2_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB2_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB2_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB2_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB2_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB2_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB2_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB2_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB2_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB2.response == "j" && values.circlex_neg1item < 320) || (trial.BBB2.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB3>
/ ontrialbegin = [
values.neg1item = values.BBB3_negitem1;
values.neg2item = values.BBB3_negitem2;
values.neg3item = values.BBB3_negitem3;
values.circlex_neg1item = list.circlex_BBB3_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB3_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB3_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB3_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB3_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB3_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB3_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB3_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB3_negitem3]
/ timeout = 4500
/ validresponse = ("j", "k")
/ iscorrectresponse = [
(trial.BBB3.response == "j" && values.circlex_neg1item < 320) || (trial.BBB3.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<list circlex_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circley_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circlex_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circley_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circlex_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circley_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circlex_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circley_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circlex_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circley_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circlex_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circley_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circlex_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circley_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circlex_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circley_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circlex_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>
<list circley_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>

<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN3_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN3_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN3_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>

<shape circle_BBB1_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB1_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB1_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB2_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB2_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB2_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB3_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB3_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB3_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>

<shape erase>
/ shape = rectangle
/ color = black
/ size = (1px*display.width,1px*display.height)
</shape>

<values>
/ imageCondition = 1
/ leftRightPosition = 1
</values>

<page encodingIntro>
^^Again, if you see a grey patch on the left side of the picture, please press the button “J” as quickly as possible. If you see a grey patch on the right side of the picture, please press the button “K” as quickly as possible.
^^Please make sure you always use the same fingers to press the buttons. You will have breaks periodically.
^^If at any point of this part of the experiment that you want to quit, please press control+Q.
^^To continue, please press the space bar.
</page>

<item times>
/1 = " Please take a break, the experiemnt will begin shortly. 1:00"
/2 = " Please take a break, the experiemnt will begin shortly. 00:59"
</item>
<text timepass>
/items = times
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 3%)
</text>
<trial break>
/stimulustimes = [0=timepass]
/timeout = 1000
</trial>

// trials = [1, 13 = noreplacenorepeat(NNN1,NNN2,BBB1); 2-12=break]
<block encoding>
/ preinstructions = (encodingIntro)
/ trials = [1-3 = noreplacenorepeat(NNN1,NNN2,BBB1)]
/ bgstim = (fixation)
</block>

*********************************************************************************
*********************************************************************************

<expt PrAff>
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN3_neuitem1 = list.neuItemNum.nextindex;
values.NNN3_neuitem2 = list.neuItemNum.nextindex;
values.NNN3_neuitem3 = list.neuItemNum.nextindex;

values.BBB1_negitem1 = list.negItemNum.nextindex;
values.BBB1_negitem2 = list.negItemNum.nextindex;
values.BBB1_negitem3 = list.negItemNum.nextindex;
values.BBB2_negitem1 = list.negItemNum.nextindex;
values.BBB2_negitem2 = list.negItemNum.nextindex;
values.BBB2_negitem3 = list.negItemNum.nextindex;
values.BBB3_negitem1 = list.negItemNum.nextindex;
values.BBB3_negitem2 = list.negItemNum.nextindex;
values.BBB3_negitem3 = list.negItemNum.nextindex;

values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem3.appenditem(round(rand(values.lower,values.upper)));

list.circley_BBB1_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem3.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem3.appenditem(round(rand(0,480)));
]
/ blocks = [1=encoding]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex_BBB1_negitem1 values.circley_BBB1_negitem1 response latency correct)
/ separatefiles = true
</data>






Thank you so much!!






If you need a response to *each* individual image in the triplet, you need to split things into separate trials -- there needs to be one *per* image in the triplet.

I have no real idea what you've been doing with respect to the circle positioning code. Please explain your reasoning in detail, i.e. please explain the code additions you made and what each is supposed to achieve.

Hi Dave,

I simplified the code and added comments in-between so it's easier to read. I hope it can make sense to you. In general, we want to select 9 images from an image pool to form three triplets of images. Each triplet will be shown for multiple times in a block. And the images within the triplet need to always be shown in that order. On top of that, we want each image to have a grey circle within the image frame. And the grey circle should appear on the same location every time the image repeats. Please see the code with commenting below. Again, thanks for helping out!


//The values below that started with "NNN" denotes the triplet images that was composed by three neutral images: neu-neu-neu = NNN
//There are in total three NNN triplets (e.g. NNN1, NNN2, NNN3). And "NNN3_neuitem2" refers to the second neutral image of third NNN triplet.
// neg1item denotes the first negative image of a triplet.
// The purpose of these values is to index from a pool of negative and neutral images to find non-repeating yet randomly-selected images to form these triplets from the pool, and use them in stimuli presentation

<values>
/ NNN1_neuitem1 = 1
/ NNN1_neuitem2 = 1
/ NNN1_neuitem3 = 1
/ NNN2_neuitem1 = 1
/ NNN2_neuitem2 = 1
/ NNN2_neuitem3 = 1
/ NNN3_neuitem1 = 1
/ NNN3_neuitem2 = 1
/ NNN3_neuitem3 = 1

/ neu1item = 1
/ neu2item = 1
/ neu3item = 1
</values>

//I made these values, e.g., "circlex_neu1item = 1px", to mirror the "neu1item = 1" as above, in order to have the circle and the image change in the same patter. Since there will be three images in a given trial, I think we'll need more than just circlex and circley to record circle position. But I think I might very likely be wrong here.
<values>
/ circley_neu1item =1px
/ circley_neu2item =1px
/ circley_neu3item =1px
/ circley_neg1item =1px
/ circley_neg2item =1px
/ circley_neg3item =1px

/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

//load in the neutral images, and define the item number based on the poolsize
<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
...
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>

//define each image that will fit into each triplet (three NNN triplets) chosen from the image pool
//for example neu1 is the first image of the NNN triplet

<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

//design the shape circle for each image within the triplet. For example, "circle_NNN1_neuitem1" means the circle for the first neutral image in the first NNN triplet, and "circle_NNN3_neuitem2" is for the circle in the second neutral image of the third NNN triplet
//My rationale is that there will be a different circle for each image, so we need these many different circles to fit in to each image. But maybe it's incorrect or excessive.
//Also I don't know if I'm doing it right to calculate the hposition and vposition.

<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN3_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN3_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN3_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>

//We define the trial element that for NNN1,NNN2, and NNN3. The image and the circle will show at the same time, and image will change in the same pattern as the circle location
//More specifically, in /ontrialbegin, because we have three items in a given trial, I think we're updating the values of image item number and circle coordinations for each image to keep them "covary"

//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circlex_neu1item = list.circlex_NNN1_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN1_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN1_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN1_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN1_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN1_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN1.response == "j" && values.circlex_neu1item < 320) || (trial.NNN1.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circlex_neu1item = list.circlex_NNN2_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN2_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN2_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN2_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN2_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN2_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN2.response == "j" && values.circlex_neu1item < 320) || (trial.NNN2.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN3>
/ ontrialbegin = [
values.neu1item = values.NNN3_neuitem1;
values.neu2item = values.NNN3_neuitem2;
values.neu3item = values.NNN3_neuitem3;
values.circlex_neu1item = list.circlex_NNN3_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN3_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN3_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN3_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN3_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN3_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN3_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN3_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN3_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN3.response == "j" && values.circlex_neu1item < 320) || (trial.NNN3.response == "k" && values.circlex_neu1item > 320)
]
</trial>

//I'm not 100% sure about the purpose of these list. I tried to mirror what you have in your sample code as "<list circlex> /selectionmode=values.itemnumber </list>"
<list circlex_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circley_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circlex_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circley_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circlex_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circley_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circlex_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circley_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circlex_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circley_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circlex_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circley_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circlex_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circley_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circlex_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circley_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circlex_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>
<list circley_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>

<list lowerbound>
/ items = (0,330)
/ poolsize = 49
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>

<block encoding>
/ preinstructions = (encodingIntro)
/ trials = [1-9 = noreplacenorepeat(NNN1,NNN2,NNN3)]
/ bgstim = (fixation)
</block>

//I took your suggestion to populate the lists of coordinates to make sure the location are tied to the image.
<expt PrAff>
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN3_neuitem1 = list.neuItemNum.nextindex;
values.NNN3_neuitem2 = list.neuItemNum.nextindex;
values.NNN3_neuitem3 = list.neuItemNum.nextindex;

values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem3.appenditem(round(rand(values.lower,values.upper)));

list.circley_NNN1_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem3.appenditem(round(rand(0,480)));
]
/ blocks = [1=encoding]
</expt>




Okay, if you essentially want a pre-selected (from some random space) circle position for tied to each selected image item, that -- just like the image item -- then remains fixed throughout the block / task, isn't it easiest to perform this in exactly the same way you perform the image selection? I.e. just like you have a value that denotes the item number for the first image in NNN1 triplet

<values>
/ NNN1_neuitem1 = 1
...
</values>

have values that denote the circle x and y positions for the circle *tied* to that item

<values>
/ NNN1_neuitem1 = 1
/ NNN1_neuitem1_x = 1px
/ NNN1_neuitem1_y = 1px
...
</values>

(and so forth for all the other triplets / items in the triplets)

Generate the x and y positions /onexpbegin as discussed, but don't store them in lists, store them in the respective values instead.

Then, finally, simply pull the x and y positions from the appropriate values /ontrialbegin, just like you do with the item numbers

<values>
/ circle1x = 1px
/ circle1y = 1px
/ circle2x = 1px
/ circle2y = 1px
/ circle3x = 1px
/ circle3y = 1px
</values>

<shape circle1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle1x
/ vposition = values.yoffset + values.circle1y
</shape>
<shape circle2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle2x
/ vposition = values.yoffset + values.circle2y
</shape>
<shape circle3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circle3x
/ vposition = values.yoffset + values.circle3y
</shape>

//We define the trial element that for NNN1,NNN2, and NNN3. The image and the circle will show at the same time, and image will change in the same pattern as the circle location
//More specifically, in /ontrialbegin, because we have three items in a given trial, I think we're updating the values of image item number and circle coordinations for each image to keep them "covary"
//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circle1x = values.NNN1_neuitem1_x;
values.circle1y = values.NNN1_neuitem1_y;
values.circle2x = values.NNN1_neuitem2_x;
values.circle2y = values.NNN1_neuitem2_y;
values.circle3x = values.NNN1_neuitem3_x;
values.circle3y = values.NNN1_neuitem3_y;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle1; 1500=erase,fixation; 2000=neu2,circle2; 3000 = erase,fixation; 3500=neu3,circle3]
...
</trial>

Does that make sense?


skyeysss
skyeysss
Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)
Group: Forum Members
Posts: 10, Visits: 29
Dave - Wednesday, November 7, 2018
skyeysss - Tuesday, November 6, 2018
Dave - Monday, November 5, 2018
skyeysss - Sunday, November 4, 2018
Hi,

Sorry I'm pretty new to Inquisit so forgive me if these are naive questions:
I've been trying to figure out a way to randomize the location of a grey solid circle with the change of the images for each trial. Basically, in each trial, a subject will see a negative or neutral image, and there should be a grey circle showing on top of that image. The location of the grey circle is not pre-determined, but randomized for each subject and for each image within a range. The circle will always need to present within the frame of the image (size 640*480 in the center of the screen). The location of the circle should be fixed for each image (because the images repeat 3 times within a block), such that each unique image has a circle overlaying on the exact same spot for that image. But the location of the circle across images should be randomized (not likely to be the same). Also the subject will respond by pressing either the left or right arrow button to indicate whether the grey circle locates at the right or left side of the image for each trial. So we want a random half of the images in each condition (negative or neutral) have the circle on the left and the other half in each condition on the right to ensure counterbalancing. The stimuli duration is fixed, so no matter they respond or didn't respond, the trial should proceed. But it would be nice to record their accuracy. So ideally it would be great to know how whether the circle is on either side of image and compare that to the key press.

So there really are two parts to this question:
1. how to make two stimuli "covary"?
2. how to "remember" or detect the circle location on each image and record their accuracy?

Hope I describe the question clearly. Thanks for the help in advance!!!

At the start of the experiment, i.e. /onexptbegin, you'll want to populate two <list> elements -- one for x coordinates, one for y coordinates -- with circle locations. Those <list> elements ought to be paired to your picture stimuli. This will ensure that a specific (randomly generated) location is and remains tied to a specific image stimulus. This also, then, tells you the circle location in each trial, i.e. you can determine whether it's on the left or right side from its horizontal position and determine response correctness accordingly. Here's a simple example:

<values>
/ itemnumber = 1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

// 4 items in this example
<list stimnumber>
/ poolsize = 4
</list>

<text stimulus>
/ items = stimitems
/ size = (640px, 480px)
/ txbgcolor = yellow
/ vjustify = center
/ select = values.itemnumber
</text>

<item stimitems>
/ 1 = "A"
/ 1 = "B"
/ 1 = "C"
/ 1 = "D"
</item>

<shape thecircle>
/ shape = circle
/ color = grey
/ size = (30px, 30px)
/ hposition = values.xoffset + values.circlex
/ vposition = values.yoffset + values.circley
</shape>

<list circlex>
/ selectionmode = values.itemnumber
</list>

<list circley>
/ selectionmode = values.itemnumber
</list>

<trial mytrial>
/ ontrialbegin = [
values.itemnumber = list.stimnumber.nextindex;
values.circlex = list.circlex.nextvalue;
values.circley = list.circley.nextvalue;
]
/ stimulusframes = [1=stimulus, thecircle]
/ validresponse = (203, 205)
/ iscorrectresponse = [
(trial.mytrial.response == 203 && values.circlex < 320) || (trial.mytrial.response == 205 && values.circlex > 320)
]
/ timeout = 5000
</trial>

<block myblock>
/ trials = [1-12 = mytrial]
</block>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>


<expt>
/ onexptbegin = [
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));

list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
]
/ blocks = [1=myblock]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex values.circley response latency correct)
/ separatefiles = true
</data>




Hi Dave,

Thanks so much for your help!! Although your code works great, I couldn't incorporate it into my code. In the code below: each three images become a triplet as one trial (this is what you suggested under another thread). And I've been trying to make a circle shape for each type of stimuli (Maybe that's excessive?). The major problem is that the circle doesn't randomize in the image space at all: it always shows up at the top left corner (except for one particular image somehow). Also, now the code only calculates accuracy for each trial, which has three images. But people will need to respond to every image within the triplet. Is there a way to get the 3 accuracy in each triplet?

Please take a look at the code:


<defaults>
/ screencolor = black
/ fontstyle = ("Arial", 20pt)
/ quitcommand = (Shift+"q")
</defaults>

<text fixation>
/ items = ("+")
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 30pt)
/ erase = false
</text>

*********************************************************************************
*********************************************************************************
encoding phase
<values>
/ BNN1_negitem1 = 1
/ BNN1_neuitem2 = 1
/ BNN1_neuitem3 = 1
/ BNN2_negitem1 = 1
/ BNN2_neuitem2 = 1
/ BNN2_neuitem3 = 1
/ BNN3_negitem1 = 1
/ BNN3_neuitem2 = 1
/ BNN3_neuitem3 = 1

/ NNB1_neuitem1 = 1
/ NNB1_neuitem2 = 1
/ NNB1_negitem3 = 1
/ NNB2_neuitem1 = 1
/ NNB2_neuitem2 = 1
/ NNB2_negitem3 = 1
/ NNB3_neuitem1 = 1
/ NNB3_neuitem2 = 1
/ NNB3_negitem3 = 1

/ NNN1_neuitem1 = 1
/ NNN1_neuitem2 = 1
/ NNN1_neuitem3 = 1
/ NNN2_neuitem1 = 1
/ NNN2_neuitem2 = 1
/ NNN2_neuitem3 = 1
/ NNN3_neuitem1 = 1
/ NNN3_neuitem2 = 1
/ NNN3_neuitem3 = 1

/ BBB1_negitem1 = 1
/ BBB1_negitem2 = 1
/ BBB1_negitem3 = 1
/ BBB2_negitem1 = 1
/ BBB2_negitem2 = 1
/ BBB2_negitem3 = 1
/ BBB3_negitem1 = 1
/ BBB3_negitem2 = 1
/ BBB3_negitem3 = 1

/ neg1item = 1
/ neg2item = 1
/ neg3item = 1
/ neu1item = 1
/ neu2item = 1
/ neu3item = 1
</values>
<values>
/ circlex_neu1item =1
/ circlex_neu2item =1
/ circlex_neu3item =1
/ circlex_neg1item =1
/ circlex_neg2item =1
/ circlex_neg3item =1
/ circley_neu1item =1
/ circley_neu2item =1
/ circley_neu3item =1
/ circley_neg1item =1
/ circley_neg2item =1
/ circley_neg3item =1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

<item negImages>
/ 1 = "./stimuli/negative/2053.jpg"
/ 2 = "./stimuli/negative/2141.jpg"
/ 3 = "./stimuli/negative/2205.jpg"
/ 4 = "./stimuli/negative/2301.jpg"
/ 5 = "./stimuli/negative/2345.1.jpg"
/ 6 = "./stimuli/negative/2352.2.jpg"
/ 7 = "./stimuli/negative/2456.jpg"
/ 8 = "./stimuli/negative/2683.jpg"
/ 9 = "./stimuli/negative/2688.jpg"
/ 10 = "./stimuli/negative/2710.jpg"
/ 11 = "./stimuli/negative/2730.jpg"
/ 12 = "./stimuli/negative/2751.jpg"
/ 13 = "./stimuli/negative/2799.jpg"
/ 14 = "./stimuli/negative/2800.jpg"
/ 15 = "./stimuli/negative/2811.jpg"
/ 16 = "./stimuli/negative/2900.jpg"
/ 17 = "./stimuli/negative/3001.jpg"
/ 18 = "./stimuli/negative/3015.jpg"
/ 19 = "./stimuli/negative/3019.jpg"
/ 20 = "./stimuli/negative/3053.jpg"
/ 21 = "./stimuli/negative/3064.jpg"
/ 22 = "./stimuli/negative/3120.jpg"
/ 23 = "./stimuli/negative/3160.jpg"
/ 24 = "./stimuli/negative/3170.jpg"
/ 25 = "./stimuli/negative/3180.jpg"
/ 26 = "./stimuli/negative/3195.jpg"
/ 27 = "./stimuli/negative/3212.jpg"
/ 28 = "./stimuli/negative/3230.jpg"
/ 29 = "./stimuli/negative/3261.jpg"
/ 30 = "./stimuli/negative/3300.jpg"
/ 31 = "./stimuli/negative/3350.jpg"
/ 32 = "./stimuli/negative/3400.jpg"
/ 33 = "./stimuli/negative/3550.1.jpg"
/ 34 = "./stimuli/negative/6243.jpg"
/ 35 = "./stimuli/negative/6312.jpg"
/ 36 = "./stimuli/negative/6315.jpg"
/ 37 = "./stimuli/negative/6563.jpg"
/ 38 = "./stimuli/negative/6570.jpg"
/ 39 = "./stimuli/negative/6571.jpg"
/ 40 = "./stimuli/negative/6821.jpg"
/ 41 = "./stimuli/negative/6825.jpg"
/ 42 = "./stimuli/negative/7380.jpg"
/ 43 = "./stimuli/negative/9006.jpg"
/ 44 = "./stimuli/negative/9041.jpg"
</item>
<list negItemNum>
/ poolsize = 44
/ selectionrate = always
</list>

<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
/ 2 = "./stimuli/neutral/1122.jpg"
/ 3 = "./stimuli/neutral/1230.jpg"
/ 4 = "./stimuli/neutral/1302.jpg"
/ 5 = "./stimuli/neutral/1350.jpg"
/ 6 = "./stimuli/neutral/1390.jpg"
/ 7 = "./stimuli/neutral/1560.jpg"
/ 8 = "./stimuli/neutral/1616.jpg"
/ 9 = "./stimuli/neutral/1617.jpg"
/ 10 = "./stimuli/neutral/1645.jpg"
/ 11 = "./stimuli/neutral/1670.jpg"
/ 12 = "./stimuli/neutral/1675.jpg"
/ 13 = "./stimuli/neutral/1726.jpg"
/ 14 = "./stimuli/neutral/1820.jpg"
/ 15 = "./stimuli/neutral/1903.jpg"
/ 16 = "./stimuli/neutral/1908.jpg"
/ 17 = "./stimuli/neutral/1931.jpg"
/ 18 = "./stimuli/neutral/1935.jpg"
/ 19 = "./stimuli/neutral/1945.jpg"
/ 20 = "./stimuli/neutral/1947.jpg"
/ 21 = "./stimuli/neutral/2020.jpg"
/ 22 = "./stimuli/neutral/2032.jpg"
/ 23 = "./stimuli/neutral/2101.jpg"
/ 24 = "./stimuli/neutral/2102.jpg"
/ 25 = "./stimuli/neutral/2107.jpg"
/ 26 = "./stimuli/neutral/2122.jpg"
/ 27 = "./stimuli/neutral/2191.jpg"
/ 28 = "./stimuli/neutral/2206.jpg"
/ 29 = "./stimuli/neutral/2210.jpg"
/ 30 = "./stimuli/neutral/2215.jpg"
/ 31 = "./stimuli/neutral/2220.jpg"
/ 32 = "./stimuli/neutral/2221.jpg"
/ 33 = "./stimuli/neutral/2235.jpg"
/ 34 = "./stimuli/neutral/2272.jpg"
/ 35 = "./stimuli/neutral/2279.jpg"
/ 36 = "./stimuli/neutral/2308.jpg"
/ 37 = "./stimuli/neutral/2309.jpg"
/ 38 = "./stimuli/neutral/2359.jpg"
/ 39 = "./stimuli/neutral/2377.jpg"
/ 40 = "./stimuli/neutral/2384.jpg"
/ 41 = "./stimuli/neutral/2393.jpg"
/ 42 = "./stimuli/neutral/2396.jpg"
/ 43 = "./stimuli/neutral/2397.jpg"
/ 44 = "./stimuli/neutral/2411.jpg"
/ 45 = "./stimuli/neutral/2435.jpg"
/ 46 = "./stimuli/neutral/2445.jpg"
/ 47 = "./stimuli/neutral/2446.jpg"
/ 48 = "./stimuli/neutral/2458.jpg"
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>


<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

<picture neg1>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg1item
</picture>
<picture neg2>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg2item
</picture>
<picture neg3>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg3item
</picture>

//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circlex_neu1item = list.circlex_NNN1_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN1_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN1_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN1_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN1_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN1_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN1.response == "j" && values.circlex_neu1item < 320) || (trial.NNN1.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circlex_neu1item = list.circlex_NNN2_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN2_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN2_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN2_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN2_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN2_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN2.response == "j" && values.circlex_neu1item < 320) || (trial.NNN2.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN3>
/ ontrialbegin = [
values.neu1item = values.NNN3_neuitem1;
values.neu2item = values.NNN3_neuitem2;
values.neu3item = values.NNN3_neuitem3;
values.circlex_neu1item = list.circlex_NNN3_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN3_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN3_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN3_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN3_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN3_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN3_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN3_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN3_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN3.response == "j" && values.circlex_neu1item < 320) || (trial.NNN3.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<list circlex_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circley_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circlex_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circley_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circlex_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circley_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circlex_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circley_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circlex_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circley_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circlex_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circley_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circlex_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circley_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circlex_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circley_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circlex_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>
<list circley_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>

//BBB triplets
<trial BBB1>
/ ontrialbegin = [
values.neg1item = values.BBB1_negitem1;
values.neg2item = values.BBB1_negitem2;
values.neg3item = values.BBB1_negitem3;
values.circlex_neg1item = list.circlex_BBB1_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB1_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB1_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB1_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB1_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB1_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB1_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB1_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB1_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB1.response == "j" && values.circlex_neg1item < 320) || (trial.BBB1.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB2>
/ ontrialbegin = [
values.neg1item = values.BBB2_negitem1;
values.neg2item = values.BBB2_negitem2;
values.neg3item = values.BBB2_negitem3;
values.circlex_neg1item = list.circlex_BBB2_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB2_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB2_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB2_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB2_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB2_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB2_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB2_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB2_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB2.response == "j" && values.circlex_neg1item < 320) || (trial.BBB2.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB3>
/ ontrialbegin = [
values.neg1item = values.BBB3_negitem1;
values.neg2item = values.BBB3_negitem2;
values.neg3item = values.BBB3_negitem3;
values.circlex_neg1item = list.circlex_BBB3_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB3_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB3_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB3_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB3_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB3_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB3_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB3_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB3_negitem3]
/ timeout = 4500
/ validresponse = ("j", "k")
/ iscorrectresponse = [
(trial.BBB3.response == "j" && values.circlex_neg1item < 320) || (trial.BBB3.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<list circlex_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circley_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circlex_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circley_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circlex_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circley_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circlex_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circley_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circlex_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circley_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circlex_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circley_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circlex_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circley_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circlex_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circley_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circlex_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>
<list circley_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>

<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN3_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN3_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN3_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>

<shape circle_BBB1_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB1_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB1_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB2_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB2_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB2_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB3_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB3_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB3_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>

<shape erase>
/ shape = rectangle
/ color = black
/ size = (1px*display.width,1px*display.height)
</shape>

<values>
/ imageCondition = 1
/ leftRightPosition = 1
</values>

<page encodingIntro>
^^Again, if you see a grey patch on the left side of the picture, please press the button “J” as quickly as possible. If you see a grey patch on the right side of the picture, please press the button “K” as quickly as possible.
^^Please make sure you always use the same fingers to press the buttons. You will have breaks periodically.
^^If at any point of this part of the experiment that you want to quit, please press control+Q.
^^To continue, please press the space bar.
</page>

<item times>
/1 = " Please take a break, the experiemnt will begin shortly. 1:00"
/2 = " Please take a break, the experiemnt will begin shortly. 00:59"
</item>
<text timepass>
/items = times
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 3%)
</text>
<trial break>
/stimulustimes = [0=timepass]
/timeout = 1000
</trial>

// trials = [1, 13 = noreplacenorepeat(NNN1,NNN2,BBB1); 2-12=break]
<block encoding>
/ preinstructions = (encodingIntro)
/ trials = [1-3 = noreplacenorepeat(NNN1,NNN2,BBB1)]
/ bgstim = (fixation)
</block>

*********************************************************************************
*********************************************************************************

<expt PrAff>
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN3_neuitem1 = list.neuItemNum.nextindex;
values.NNN3_neuitem2 = list.neuItemNum.nextindex;
values.NNN3_neuitem3 = list.neuItemNum.nextindex;

values.BBB1_negitem1 = list.negItemNum.nextindex;
values.BBB1_negitem2 = list.negItemNum.nextindex;
values.BBB1_negitem3 = list.negItemNum.nextindex;
values.BBB2_negitem1 = list.negItemNum.nextindex;
values.BBB2_negitem2 = list.negItemNum.nextindex;
values.BBB2_negitem3 = list.negItemNum.nextindex;
values.BBB3_negitem1 = list.negItemNum.nextindex;
values.BBB3_negitem2 = list.negItemNum.nextindex;
values.BBB3_negitem3 = list.negItemNum.nextindex;

values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem3.appenditem(round(rand(values.lower,values.upper)));

list.circley_BBB1_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem3.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem3.appenditem(round(rand(0,480)));
]
/ blocks = [1=encoding]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex_BBB1_negitem1 values.circley_BBB1_negitem1 response latency correct)
/ separatefiles = true
</data>






Thank you so much!!






If you need a response to *each* individual image in the triplet, you need to split things into separate trials -- there needs to be one *per* image in the triplet.

I have no real idea what you've been doing with respect to the circle positioning code. Please explain your reasoning in detail, i.e. please explain the code additions you made and what each is supposed to achieve.

Hi Dave,

I simplified the code and added comments in-between so it's easier to read. I hope it can make sense to you. In general, we want to select 9 images from an image pool to form three triplets of images. Each triplet will be shown for multiple times in a block. And the images within the triplet need to always be shown in that order. On top of that, we want each image to have a grey circle within the image frame. And the grey circle should appear on the same location every time the image repeats. Please see the code with commenting below. Again, thanks for helping out!


//The values below that started with "NNN" denotes the triplet images that was composed by three neutral images: neu-neu-neu = NNN
//There are in total three NNN triplets (e.g. NNN1, NNN2, NNN3). And "NNN3_neuitem2" refers to the second neutral image of third NNN triplet.
// neg1item denotes the first negative image of a triplet.
// The purpose of these values is to index from a pool of negative and neutral images to find non-repeating yet randomly-selected images to form these triplets from the pool, and use them in stimuli presentation

<values>
/ NNN1_neuitem1 = 1
/ NNN1_neuitem2 = 1
/ NNN1_neuitem3 = 1
/ NNN2_neuitem1 = 1
/ NNN2_neuitem2 = 1
/ NNN2_neuitem3 = 1
/ NNN3_neuitem1 = 1
/ NNN3_neuitem2 = 1
/ NNN3_neuitem3 = 1

/ neu1item = 1
/ neu2item = 1
/ neu3item = 1
</values>

//I made these values, e.g., "circlex_neu1item = 1px", to mirror the "neu1item = 1" as above, in order to have the circle and the image change in the same patter. Since there will be three images in a given trial, I think we'll need more than just circlex and circley to record circle position. But I think I might very likely be wrong here.
<values>
/ circley_neu1item =1px
/ circley_neu2item =1px
/ circley_neu3item =1px
/ circley_neg1item =1px
/ circley_neg2item =1px
/ circley_neg3item =1px

/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

//load in the neutral images, and define the item number based on the poolsize
<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
...
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>

//define each image that will fit into each triplet (three NNN triplets) chosen from the image pool
//for example neu1 is the first image of the NNN triplet

<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

//design the shape circle for each image within the triplet. For example, "circle_NNN1_neuitem1" means the circle for the first neutral image in the first NNN triplet, and "circle_NNN3_neuitem2" is for the circle in the second neutral image of the third NNN triplet
//My rationale is that there will be a different circle for each image, so we need these many different circles to fit in to each image. But maybe it's incorrect or excessive.
//Also I don't know if I'm doing it right to calculate the hposition and vposition.

<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN3_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN3_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN3_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>

//We define the trial element that for NNN1,NNN2, and NNN3. The image and the circle will show at the same time, and image will change in the same pattern as the circle location
//More specifically, in /ontrialbegin, because we have three items in a given trial, I think we're updating the values of image item number and circle coordinations for each image to keep them "covary"

//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circlex_neu1item = list.circlex_NNN1_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN1_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN1_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN1_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN1_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN1_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN1.response == "j" && values.circlex_neu1item < 320) || (trial.NNN1.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circlex_neu1item = list.circlex_NNN2_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN2_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN2_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN2_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN2_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN2_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN2.response == "j" && values.circlex_neu1item < 320) || (trial.NNN2.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN3>
/ ontrialbegin = [
values.neu1item = values.NNN3_neuitem1;
values.neu2item = values.NNN3_neuitem2;
values.neu3item = values.NNN3_neuitem3;
values.circlex_neu1item = list.circlex_NNN3_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN3_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN3_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN3_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN3_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN3_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN3_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN3_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN3_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN3.response == "j" && values.circlex_neu1item < 320) || (trial.NNN3.response == "k" && values.circlex_neu1item > 320)
]
</trial>

//I'm not 100% sure about the purpose of these list. I tried to mirror what you have in your sample code as "<list circlex> /selectionmode=values.itemnumber </list>"
<list circlex_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circley_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circlex_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circley_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circlex_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circley_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circlex_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circley_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circlex_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circley_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circlex_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circley_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circlex_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circley_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circlex_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circley_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circlex_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>
<list circley_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>

<list lowerbound>
/ items = (0,330)
/ poolsize = 49
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>

<block encoding>
/ preinstructions = (encodingIntro)
/ trials = [1-9 = noreplacenorepeat(NNN1,NNN2,NNN3)]
/ bgstim = (fixation)
</block>

//I took your suggestion to populate the lists of coordinates to make sure the location are tied to the image.
<expt PrAff>
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN3_neuitem1 = list.neuItemNum.nextindex;
values.NNN3_neuitem2 = list.neuItemNum.nextindex;
values.NNN3_neuitem3 = list.neuItemNum.nextindex;

values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem3.appenditem(round(rand(values.lower,values.upper)));

list.circley_NNN1_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem3.appenditem(round(rand(0,480)));
]
/ blocks = [1=encoding]
</expt>




Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
skyeysss - Tuesday, November 6, 2018
Dave - Monday, November 5, 2018
skyeysss - Sunday, November 4, 2018
Hi,

Sorry I'm pretty new to Inquisit so forgive me if these are naive questions:
I've been trying to figure out a way to randomize the location of a grey solid circle with the change of the images for each trial. Basically, in each trial, a subject will see a negative or neutral image, and there should be a grey circle showing on top of that image. The location of the grey circle is not pre-determined, but randomized for each subject and for each image within a range. The circle will always need to present within the frame of the image (size 640*480 in the center of the screen). The location of the circle should be fixed for each image (because the images repeat 3 times within a block), such that each unique image has a circle overlaying on the exact same spot for that image. But the location of the circle across images should be randomized (not likely to be the same). Also the subject will respond by pressing either the left or right arrow button to indicate whether the grey circle locates at the right or left side of the image for each trial. So we want a random half of the images in each condition (negative or neutral) have the circle on the left and the other half in each condition on the right to ensure counterbalancing. The stimuli duration is fixed, so no matter they respond or didn't respond, the trial should proceed. But it would be nice to record their accuracy. So ideally it would be great to know how whether the circle is on either side of image and compare that to the key press.

So there really are two parts to this question:
1. how to make two stimuli "covary"?
2. how to "remember" or detect the circle location on each image and record their accuracy?

Hope I describe the question clearly. Thanks for the help in advance!!!

At the start of the experiment, i.e. /onexptbegin, you'll want to populate two <list> elements -- one for x coordinates, one for y coordinates -- with circle locations. Those <list> elements ought to be paired to your picture stimuli. This will ensure that a specific (randomly generated) location is and remains tied to a specific image stimulus. This also, then, tells you the circle location in each trial, i.e. you can determine whether it's on the left or right side from its horizontal position and determine response correctness accordingly. Here's a simple example:

<values>
/ itemnumber = 1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

// 4 items in this example
<list stimnumber>
/ poolsize = 4
</list>

<text stimulus>
/ items = stimitems
/ size = (640px, 480px)
/ txbgcolor = yellow
/ vjustify = center
/ select = values.itemnumber
</text>

<item stimitems>
/ 1 = "A"
/ 1 = "B"
/ 1 = "C"
/ 1 = "D"
</item>

<shape thecircle>
/ shape = circle
/ color = grey
/ size = (30px, 30px)
/ hposition = values.xoffset + values.circlex
/ vposition = values.yoffset + values.circley
</shape>

<list circlex>
/ selectionmode = values.itemnumber
</list>

<list circley>
/ selectionmode = values.itemnumber
</list>

<trial mytrial>
/ ontrialbegin = [
values.itemnumber = list.stimnumber.nextindex;
values.circlex = list.circlex.nextvalue;
values.circley = list.circley.nextvalue;
]
/ stimulusframes = [1=stimulus, thecircle]
/ validresponse = (203, 205)
/ iscorrectresponse = [
(trial.mytrial.response == 203 && values.circlex < 320) || (trial.mytrial.response == 205 && values.circlex > 320)
]
/ timeout = 5000
</trial>

<block myblock>
/ trials = [1-12 = mytrial]
</block>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>


<expt>
/ onexptbegin = [
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));

list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
]
/ blocks = [1=myblock]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex values.circley response latency correct)
/ separatefiles = true
</data>




Hi Dave,

Thanks so much for your help!! Although your code works great, I couldn't incorporate it into my code. In the code below: each three images become a triplet as one trial (this is what you suggested under another thread). And I've been trying to make a circle shape for each type of stimuli (Maybe that's excessive?). The major problem is that the circle doesn't randomize in the image space at all: it always shows up at the top left corner (except for one particular image somehow). Also, now the code only calculates accuracy for each trial, which has three images. But people will need to respond to every image within the triplet. Is there a way to get the 3 accuracy in each triplet?

Please take a look at the code:


<defaults>
/ screencolor = black
/ fontstyle = ("Arial", 20pt)
/ quitcommand = (Shift+"q")
</defaults>

<text fixation>
/ items = ("+")
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 30pt)
/ erase = false
</text>

*********************************************************************************
*********************************************************************************
encoding phase
<values>
/ BNN1_negitem1 = 1
/ BNN1_neuitem2 = 1
/ BNN1_neuitem3 = 1
/ BNN2_negitem1 = 1
/ BNN2_neuitem2 = 1
/ BNN2_neuitem3 = 1
/ BNN3_negitem1 = 1
/ BNN3_neuitem2 = 1
/ BNN3_neuitem3 = 1

/ NNB1_neuitem1 = 1
/ NNB1_neuitem2 = 1
/ NNB1_negitem3 = 1
/ NNB2_neuitem1 = 1
/ NNB2_neuitem2 = 1
/ NNB2_negitem3 = 1
/ NNB3_neuitem1 = 1
/ NNB3_neuitem2 = 1
/ NNB3_negitem3 = 1

/ NNN1_neuitem1 = 1
/ NNN1_neuitem2 = 1
/ NNN1_neuitem3 = 1
/ NNN2_neuitem1 = 1
/ NNN2_neuitem2 = 1
/ NNN2_neuitem3 = 1
/ NNN3_neuitem1 = 1
/ NNN3_neuitem2 = 1
/ NNN3_neuitem3 = 1

/ BBB1_negitem1 = 1
/ BBB1_negitem2 = 1
/ BBB1_negitem3 = 1
/ BBB2_negitem1 = 1
/ BBB2_negitem2 = 1
/ BBB2_negitem3 = 1
/ BBB3_negitem1 = 1
/ BBB3_negitem2 = 1
/ BBB3_negitem3 = 1

/ neg1item = 1
/ neg2item = 1
/ neg3item = 1
/ neu1item = 1
/ neu2item = 1
/ neu3item = 1
</values>
<values>
/ circlex_neu1item =1
/ circlex_neu2item =1
/ circlex_neu3item =1
/ circlex_neg1item =1
/ circlex_neg2item =1
/ circlex_neg3item =1
/ circley_neu1item =1
/ circley_neu2item =1
/ circley_neu3item =1
/ circley_neg1item =1
/ circley_neg2item =1
/ circley_neg3item =1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

<item negImages>
/ 1 = "./stimuli/negative/2053.jpg"
/ 2 = "./stimuli/negative/2141.jpg"
/ 3 = "./stimuli/negative/2205.jpg"
/ 4 = "./stimuli/negative/2301.jpg"
/ 5 = "./stimuli/negative/2345.1.jpg"
/ 6 = "./stimuli/negative/2352.2.jpg"
/ 7 = "./stimuli/negative/2456.jpg"
/ 8 = "./stimuli/negative/2683.jpg"
/ 9 = "./stimuli/negative/2688.jpg"
/ 10 = "./stimuli/negative/2710.jpg"
/ 11 = "./stimuli/negative/2730.jpg"
/ 12 = "./stimuli/negative/2751.jpg"
/ 13 = "./stimuli/negative/2799.jpg"
/ 14 = "./stimuli/negative/2800.jpg"
/ 15 = "./stimuli/negative/2811.jpg"
/ 16 = "./stimuli/negative/2900.jpg"
/ 17 = "./stimuli/negative/3001.jpg"
/ 18 = "./stimuli/negative/3015.jpg"
/ 19 = "./stimuli/negative/3019.jpg"
/ 20 = "./stimuli/negative/3053.jpg"
/ 21 = "./stimuli/negative/3064.jpg"
/ 22 = "./stimuli/negative/3120.jpg"
/ 23 = "./stimuli/negative/3160.jpg"
/ 24 = "./stimuli/negative/3170.jpg"
/ 25 = "./stimuli/negative/3180.jpg"
/ 26 = "./stimuli/negative/3195.jpg"
/ 27 = "./stimuli/negative/3212.jpg"
/ 28 = "./stimuli/negative/3230.jpg"
/ 29 = "./stimuli/negative/3261.jpg"
/ 30 = "./stimuli/negative/3300.jpg"
/ 31 = "./stimuli/negative/3350.jpg"
/ 32 = "./stimuli/negative/3400.jpg"
/ 33 = "./stimuli/negative/3550.1.jpg"
/ 34 = "./stimuli/negative/6243.jpg"
/ 35 = "./stimuli/negative/6312.jpg"
/ 36 = "./stimuli/negative/6315.jpg"
/ 37 = "./stimuli/negative/6563.jpg"
/ 38 = "./stimuli/negative/6570.jpg"
/ 39 = "./stimuli/negative/6571.jpg"
/ 40 = "./stimuli/negative/6821.jpg"
/ 41 = "./stimuli/negative/6825.jpg"
/ 42 = "./stimuli/negative/7380.jpg"
/ 43 = "./stimuli/negative/9006.jpg"
/ 44 = "./stimuli/negative/9041.jpg"
</item>
<list negItemNum>
/ poolsize = 44
/ selectionrate = always
</list>

<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
/ 2 = "./stimuli/neutral/1122.jpg"
/ 3 = "./stimuli/neutral/1230.jpg"
/ 4 = "./stimuli/neutral/1302.jpg"
/ 5 = "./stimuli/neutral/1350.jpg"
/ 6 = "./stimuli/neutral/1390.jpg"
/ 7 = "./stimuli/neutral/1560.jpg"
/ 8 = "./stimuli/neutral/1616.jpg"
/ 9 = "./stimuli/neutral/1617.jpg"
/ 10 = "./stimuli/neutral/1645.jpg"
/ 11 = "./stimuli/neutral/1670.jpg"
/ 12 = "./stimuli/neutral/1675.jpg"
/ 13 = "./stimuli/neutral/1726.jpg"
/ 14 = "./stimuli/neutral/1820.jpg"
/ 15 = "./stimuli/neutral/1903.jpg"
/ 16 = "./stimuli/neutral/1908.jpg"
/ 17 = "./stimuli/neutral/1931.jpg"
/ 18 = "./stimuli/neutral/1935.jpg"
/ 19 = "./stimuli/neutral/1945.jpg"
/ 20 = "./stimuli/neutral/1947.jpg"
/ 21 = "./stimuli/neutral/2020.jpg"
/ 22 = "./stimuli/neutral/2032.jpg"
/ 23 = "./stimuli/neutral/2101.jpg"
/ 24 = "./stimuli/neutral/2102.jpg"
/ 25 = "./stimuli/neutral/2107.jpg"
/ 26 = "./stimuli/neutral/2122.jpg"
/ 27 = "./stimuli/neutral/2191.jpg"
/ 28 = "./stimuli/neutral/2206.jpg"
/ 29 = "./stimuli/neutral/2210.jpg"
/ 30 = "./stimuli/neutral/2215.jpg"
/ 31 = "./stimuli/neutral/2220.jpg"
/ 32 = "./stimuli/neutral/2221.jpg"
/ 33 = "./stimuli/neutral/2235.jpg"
/ 34 = "./stimuli/neutral/2272.jpg"
/ 35 = "./stimuli/neutral/2279.jpg"
/ 36 = "./stimuli/neutral/2308.jpg"
/ 37 = "./stimuli/neutral/2309.jpg"
/ 38 = "./stimuli/neutral/2359.jpg"
/ 39 = "./stimuli/neutral/2377.jpg"
/ 40 = "./stimuli/neutral/2384.jpg"
/ 41 = "./stimuli/neutral/2393.jpg"
/ 42 = "./stimuli/neutral/2396.jpg"
/ 43 = "./stimuli/neutral/2397.jpg"
/ 44 = "./stimuli/neutral/2411.jpg"
/ 45 = "./stimuli/neutral/2435.jpg"
/ 46 = "./stimuli/neutral/2445.jpg"
/ 47 = "./stimuli/neutral/2446.jpg"
/ 48 = "./stimuli/neutral/2458.jpg"
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>


<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

<picture neg1>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg1item
</picture>
<picture neg2>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg2item
</picture>
<picture neg3>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg3item
</picture>

//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circlex_neu1item = list.circlex_NNN1_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN1_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN1_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN1_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN1_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN1_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN1.response == "j" && values.circlex_neu1item < 320) || (trial.NNN1.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circlex_neu1item = list.circlex_NNN2_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN2_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN2_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN2_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN2_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN2_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN2.response == "j" && values.circlex_neu1item < 320) || (trial.NNN2.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN3>
/ ontrialbegin = [
values.neu1item = values.NNN3_neuitem1;
values.neu2item = values.NNN3_neuitem2;
values.neu3item = values.NNN3_neuitem3;
values.circlex_neu1item = list.circlex_NNN3_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN3_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN3_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN3_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN3_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN3_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN3_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN3_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN3_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN3.response == "j" && values.circlex_neu1item < 320) || (trial.NNN3.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<list circlex_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circley_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circlex_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circley_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circlex_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circley_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circlex_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circley_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circlex_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circley_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circlex_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circley_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circlex_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circley_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circlex_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circley_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circlex_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>
<list circley_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>

//BBB triplets
<trial BBB1>
/ ontrialbegin = [
values.neg1item = values.BBB1_negitem1;
values.neg2item = values.BBB1_negitem2;
values.neg3item = values.BBB1_negitem3;
values.circlex_neg1item = list.circlex_BBB1_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB1_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB1_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB1_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB1_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB1_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB1_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB1_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB1_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB1.response == "j" && values.circlex_neg1item < 320) || (trial.BBB1.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB2>
/ ontrialbegin = [
values.neg1item = values.BBB2_negitem1;
values.neg2item = values.BBB2_negitem2;
values.neg3item = values.BBB2_negitem3;
values.circlex_neg1item = list.circlex_BBB2_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB2_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB2_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB2_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB2_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB2_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB2_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB2_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB2_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB2.response == "j" && values.circlex_neg1item < 320) || (trial.BBB2.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB3>
/ ontrialbegin = [
values.neg1item = values.BBB3_negitem1;
values.neg2item = values.BBB3_negitem2;
values.neg3item = values.BBB3_negitem3;
values.circlex_neg1item = list.circlex_BBB3_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB3_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB3_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB3_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB3_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB3_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB3_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB3_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB3_negitem3]
/ timeout = 4500
/ validresponse = ("j", "k")
/ iscorrectresponse = [
(trial.BBB3.response == "j" && values.circlex_neg1item < 320) || (trial.BBB3.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<list circlex_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circley_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circlex_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circley_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circlex_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circley_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circlex_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circley_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circlex_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circley_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circlex_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circley_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circlex_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circley_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circlex_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circley_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circlex_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>
<list circley_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>

<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN3_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN3_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN3_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>

<shape circle_BBB1_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB1_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB1_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB2_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB2_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB2_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB3_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB3_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB3_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>

<shape erase>
/ shape = rectangle
/ color = black
/ size = (1px*display.width,1px*display.height)
</shape>

<values>
/ imageCondition = 1
/ leftRightPosition = 1
</values>

<page encodingIntro>
^^Again, if you see a grey patch on the left side of the picture, please press the button “J” as quickly as possible. If you see a grey patch on the right side of the picture, please press the button “K” as quickly as possible.
^^Please make sure you always use the same fingers to press the buttons. You will have breaks periodically.
^^If at any point of this part of the experiment that you want to quit, please press control+Q.
^^To continue, please press the space bar.
</page>

<item times>
/1 = " Please take a break, the experiemnt will begin shortly. 1:00"
/2 = " Please take a break, the experiemnt will begin shortly. 00:59"
</item>
<text timepass>
/items = times
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 3%)
</text>
<trial break>
/stimulustimes = [0=timepass]
/timeout = 1000
</trial>

// trials = [1, 13 = noreplacenorepeat(NNN1,NNN2,BBB1); 2-12=break]
<block encoding>
/ preinstructions = (encodingIntro)
/ trials = [1-3 = noreplacenorepeat(NNN1,NNN2,BBB1)]
/ bgstim = (fixation)
</block>

*********************************************************************************
*********************************************************************************

<expt PrAff>
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN3_neuitem1 = list.neuItemNum.nextindex;
values.NNN3_neuitem2 = list.neuItemNum.nextindex;
values.NNN3_neuitem3 = list.neuItemNum.nextindex;

values.BBB1_negitem1 = list.negItemNum.nextindex;
values.BBB1_negitem2 = list.negItemNum.nextindex;
values.BBB1_negitem3 = list.negItemNum.nextindex;
values.BBB2_negitem1 = list.negItemNum.nextindex;
values.BBB2_negitem2 = list.negItemNum.nextindex;
values.BBB2_negitem3 = list.negItemNum.nextindex;
values.BBB3_negitem1 = list.negItemNum.nextindex;
values.BBB3_negitem2 = list.negItemNum.nextindex;
values.BBB3_negitem3 = list.negItemNum.nextindex;

values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem3.appenditem(round(rand(values.lower,values.upper)));

list.circley_BBB1_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem3.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem3.appenditem(round(rand(0,480)));
]
/ blocks = [1=encoding]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex_BBB1_negitem1 values.circley_BBB1_negitem1 response latency correct)
/ separatefiles = true
</data>






Thank you so much!!






If you need a response to *each* individual image in the triplet, you need to split things into separate trials -- there needs to be one *per* image in the triplet.

I have no real idea what you've been doing with respect to the circle positioning code. Please explain your reasoning in detail, i.e. please explain the code additions you made and what each is supposed to achieve.

skyeysss
skyeysss
Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)
Group: Forum Members
Posts: 10, Visits: 29
Dave - Monday, November 5, 2018
skyeysss - Sunday, November 4, 2018
Hi,

Sorry I'm pretty new to Inquisit so forgive me if these are naive questions:
I've been trying to figure out a way to randomize the location of a grey solid circle with the change of the images for each trial. Basically, in each trial, a subject will see a negative or neutral image, and there should be a grey circle showing on top of that image. The location of the grey circle is not pre-determined, but randomized for each subject and for each image within a range. The circle will always need to present within the frame of the image (size 640*480 in the center of the screen). The location of the circle should be fixed for each image (because the images repeat 3 times within a block), such that each unique image has a circle overlaying on the exact same spot for that image. But the location of the circle across images should be randomized (not likely to be the same). Also the subject will respond by pressing either the left or right arrow button to indicate whether the grey circle locates at the right or left side of the image for each trial. So we want a random half of the images in each condition (negative or neutral) have the circle on the left and the other half in each condition on the right to ensure counterbalancing. The stimuli duration is fixed, so no matter they respond or didn't respond, the trial should proceed. But it would be nice to record their accuracy. So ideally it would be great to know how whether the circle is on either side of image and compare that to the key press.

So there really are two parts to this question:
1. how to make two stimuli "covary"?
2. how to "remember" or detect the circle location on each image and record their accuracy?

Hope I describe the question clearly. Thanks for the help in advance!!!

At the start of the experiment, i.e. /onexptbegin, you'll want to populate two <list> elements -- one for x coordinates, one for y coordinates -- with circle locations. Those <list> elements ought to be paired to your picture stimuli. This will ensure that a specific (randomly generated) location is and remains tied to a specific image stimulus. This also, then, tells you the circle location in each trial, i.e. you can determine whether it's on the left or right side from its horizontal position and determine response correctness accordingly. Here's a simple example:

<values>
/ itemnumber = 1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

// 4 items in this example
<list stimnumber>
/ poolsize = 4
</list>

<text stimulus>
/ items = stimitems
/ size = (640px, 480px)
/ txbgcolor = yellow
/ vjustify = center
/ select = values.itemnumber
</text>

<item stimitems>
/ 1 = "A"
/ 1 = "B"
/ 1 = "C"
/ 1 = "D"
</item>

<shape thecircle>
/ shape = circle
/ color = grey
/ size = (30px, 30px)
/ hposition = values.xoffset + values.circlex
/ vposition = values.yoffset + values.circley
</shape>

<list circlex>
/ selectionmode = values.itemnumber
</list>

<list circley>
/ selectionmode = values.itemnumber
</list>

<trial mytrial>
/ ontrialbegin = [
values.itemnumber = list.stimnumber.nextindex;
values.circlex = list.circlex.nextvalue;
values.circley = list.circley.nextvalue;
]
/ stimulusframes = [1=stimulus, thecircle]
/ validresponse = (203, 205)
/ iscorrectresponse = [
(trial.mytrial.response == 203 && values.circlex < 320) || (trial.mytrial.response == 205 && values.circlex > 320)
]
/ timeout = 5000
</trial>

<block myblock>
/ trials = [1-12 = mytrial]
</block>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>


<expt>
/ onexptbegin = [
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));

list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
]
/ blocks = [1=myblock]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex values.circley response latency correct)
/ separatefiles = true
</data>




Hi Dave,

Thanks so much for your help!! Although your code works great, I couldn't incorporate it into my code. In the code below: each three images become a triplet as one trial (this is what you suggested under another thread). And I've been trying to make a circle shape for each type of stimuli (Maybe that's excessive?). The major problem is that the circle doesn't randomize in the image space at all: it always shows up at the top left corner (except for one particular image somehow). Also, now the code only calculates accuracy for each trial, which has three images. But people will need to respond to every image within the triplet. Is there a way to get the 3 accuracy in each triplet?

Please take a look at the code:


<defaults>
/ screencolor = black
/ fontstyle = ("Arial", 20pt)
/ quitcommand = (Shift+"q")
</defaults>

<text fixation>
/ items = ("+")
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 30pt)
/ erase = false
</text>

*********************************************************************************
*********************************************************************************
encoding phase
<values>
/ BNN1_negitem1 = 1
/ BNN1_neuitem2 = 1
/ BNN1_neuitem3 = 1
/ BNN2_negitem1 = 1
/ BNN2_neuitem2 = 1
/ BNN2_neuitem3 = 1
/ BNN3_negitem1 = 1
/ BNN3_neuitem2 = 1
/ BNN3_neuitem3 = 1

/ NNB1_neuitem1 = 1
/ NNB1_neuitem2 = 1
/ NNB1_negitem3 = 1
/ NNB2_neuitem1 = 1
/ NNB2_neuitem2 = 1
/ NNB2_negitem3 = 1
/ NNB3_neuitem1 = 1
/ NNB3_neuitem2 = 1
/ NNB3_negitem3 = 1

/ NNN1_neuitem1 = 1
/ NNN1_neuitem2 = 1
/ NNN1_neuitem3 = 1
/ NNN2_neuitem1 = 1
/ NNN2_neuitem2 = 1
/ NNN2_neuitem3 = 1
/ NNN3_neuitem1 = 1
/ NNN3_neuitem2 = 1
/ NNN3_neuitem3 = 1

/ BBB1_negitem1 = 1
/ BBB1_negitem2 = 1
/ BBB1_negitem3 = 1
/ BBB2_negitem1 = 1
/ BBB2_negitem2 = 1
/ BBB2_negitem3 = 1
/ BBB3_negitem1 = 1
/ BBB3_negitem2 = 1
/ BBB3_negitem3 = 1

/ neg1item = 1
/ neg2item = 1
/ neg3item = 1
/ neu1item = 1
/ neu2item = 1
/ neu3item = 1
</values>
<values>
/ circlex_neu1item =1
/ circlex_neu2item =1
/ circlex_neu3item =1
/ circlex_neg1item =1
/ circlex_neg2item =1
/ circlex_neg3item =1
/ circley_neu1item =1
/ circley_neu2item =1
/ circley_neu3item =1
/ circley_neg1item =1
/ circley_neg2item =1
/ circley_neg3item =1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

<item negImages>
/ 1 = "./stimuli/negative/2053.jpg"
/ 2 = "./stimuli/negative/2141.jpg"
/ 3 = "./stimuli/negative/2205.jpg"
/ 4 = "./stimuli/negative/2301.jpg"
/ 5 = "./stimuli/negative/2345.1.jpg"
/ 6 = "./stimuli/negative/2352.2.jpg"
/ 7 = "./stimuli/negative/2456.jpg"
/ 8 = "./stimuli/negative/2683.jpg"
/ 9 = "./stimuli/negative/2688.jpg"
/ 10 = "./stimuli/negative/2710.jpg"
/ 11 = "./stimuli/negative/2730.jpg"
/ 12 = "./stimuli/negative/2751.jpg"
/ 13 = "./stimuli/negative/2799.jpg"
/ 14 = "./stimuli/negative/2800.jpg"
/ 15 = "./stimuli/negative/2811.jpg"
/ 16 = "./stimuli/negative/2900.jpg"
/ 17 = "./stimuli/negative/3001.jpg"
/ 18 = "./stimuli/negative/3015.jpg"
/ 19 = "./stimuli/negative/3019.jpg"
/ 20 = "./stimuli/negative/3053.jpg"
/ 21 = "./stimuli/negative/3064.jpg"
/ 22 = "./stimuli/negative/3120.jpg"
/ 23 = "./stimuli/negative/3160.jpg"
/ 24 = "./stimuli/negative/3170.jpg"
/ 25 = "./stimuli/negative/3180.jpg"
/ 26 = "./stimuli/negative/3195.jpg"
/ 27 = "./stimuli/negative/3212.jpg"
/ 28 = "./stimuli/negative/3230.jpg"
/ 29 = "./stimuli/negative/3261.jpg"
/ 30 = "./stimuli/negative/3300.jpg"
/ 31 = "./stimuli/negative/3350.jpg"
/ 32 = "./stimuli/negative/3400.jpg"
/ 33 = "./stimuli/negative/3550.1.jpg"
/ 34 = "./stimuli/negative/6243.jpg"
/ 35 = "./stimuli/negative/6312.jpg"
/ 36 = "./stimuli/negative/6315.jpg"
/ 37 = "./stimuli/negative/6563.jpg"
/ 38 = "./stimuli/negative/6570.jpg"
/ 39 = "./stimuli/negative/6571.jpg"
/ 40 = "./stimuli/negative/6821.jpg"
/ 41 = "./stimuli/negative/6825.jpg"
/ 42 = "./stimuli/negative/7380.jpg"
/ 43 = "./stimuli/negative/9006.jpg"
/ 44 = "./stimuli/negative/9041.jpg"
</item>
<list negItemNum>
/ poolsize = 44
/ selectionrate = always
</list>

<item neuImages>
/ 1 = "./stimuli/neutral/1114.jpg"
/ 2 = "./stimuli/neutral/1122.jpg"
/ 3 = "./stimuli/neutral/1230.jpg"
/ 4 = "./stimuli/neutral/1302.jpg"
/ 5 = "./stimuli/neutral/1350.jpg"
/ 6 = "./stimuli/neutral/1390.jpg"
/ 7 = "./stimuli/neutral/1560.jpg"
/ 8 = "./stimuli/neutral/1616.jpg"
/ 9 = "./stimuli/neutral/1617.jpg"
/ 10 = "./stimuli/neutral/1645.jpg"
/ 11 = "./stimuli/neutral/1670.jpg"
/ 12 = "./stimuli/neutral/1675.jpg"
/ 13 = "./stimuli/neutral/1726.jpg"
/ 14 = "./stimuli/neutral/1820.jpg"
/ 15 = "./stimuli/neutral/1903.jpg"
/ 16 = "./stimuli/neutral/1908.jpg"
/ 17 = "./stimuli/neutral/1931.jpg"
/ 18 = "./stimuli/neutral/1935.jpg"
/ 19 = "./stimuli/neutral/1945.jpg"
/ 20 = "./stimuli/neutral/1947.jpg"
/ 21 = "./stimuli/neutral/2020.jpg"
/ 22 = "./stimuli/neutral/2032.jpg"
/ 23 = "./stimuli/neutral/2101.jpg"
/ 24 = "./stimuli/neutral/2102.jpg"
/ 25 = "./stimuli/neutral/2107.jpg"
/ 26 = "./stimuli/neutral/2122.jpg"
/ 27 = "./stimuli/neutral/2191.jpg"
/ 28 = "./stimuli/neutral/2206.jpg"
/ 29 = "./stimuli/neutral/2210.jpg"
/ 30 = "./stimuli/neutral/2215.jpg"
/ 31 = "./stimuli/neutral/2220.jpg"
/ 32 = "./stimuli/neutral/2221.jpg"
/ 33 = "./stimuli/neutral/2235.jpg"
/ 34 = "./stimuli/neutral/2272.jpg"
/ 35 = "./stimuli/neutral/2279.jpg"
/ 36 = "./stimuli/neutral/2308.jpg"
/ 37 = "./stimuli/neutral/2309.jpg"
/ 38 = "./stimuli/neutral/2359.jpg"
/ 39 = "./stimuli/neutral/2377.jpg"
/ 40 = "./stimuli/neutral/2384.jpg"
/ 41 = "./stimuli/neutral/2393.jpg"
/ 42 = "./stimuli/neutral/2396.jpg"
/ 43 = "./stimuli/neutral/2397.jpg"
/ 44 = "./stimuli/neutral/2411.jpg"
/ 45 = "./stimuli/neutral/2435.jpg"
/ 46 = "./stimuli/neutral/2445.jpg"
/ 47 = "./stimuli/neutral/2446.jpg"
/ 48 = "./stimuli/neutral/2458.jpg"
/ 49 = "./stimuli/neutral/2484.jpg"
</item>
<list neuItemNum>
/ poolsize = 49
/ selectionrate = always
</list>


<picture neu1>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu1item
</picture>
<picture neu2>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu2item
</picture>
<picture neu3>
/ items = neuImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neu3item
</picture>

<picture neg1>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg1item
</picture>
<picture neg2>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg2item
</picture>
<picture neg3>
/ items = negImages
/ size = (640px, 480px)
/ valign = center
/ select = values.neg3item
</picture>

//NNN triplet
<trial NNN1>
/ ontrialbegin = [
values.neu1item = values.NNN1_neuitem1;
values.neu2item = values.NNN1_neuitem2;
values.neu3item = values.NNN1_neuitem3;
values.circlex_neu1item = list.circlex_NNN1_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN1_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN1_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN1_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN1_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN1_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN1_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN1_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN1_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN1.response == "j" && values.circlex_neu1item < 320) || (trial.NNN1.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN2>
/ ontrialbegin = [
values.neu1item = values.NNN2_neuitem1;
values.neu2item = values.NNN2_neuitem2;
values.neu3item = values.NNN2_neuitem3;
values.circlex_neu1item = list.circlex_NNN2_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN2_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN2_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN2_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN2_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN2_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN2_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN2_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN2_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN2.response == "j" && values.circlex_neu1item < 320) || (trial.NNN2.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<trial NNN3>
/ ontrialbegin = [
values.neu1item = values.NNN3_neuitem1;
values.neu2item = values.NNN3_neuitem2;
values.neu3item = values.NNN3_neuitem3;
values.circlex_neu1item = list.circlex_NNN3_neuitem1.nextvalue;
values.circley_neu1item = list.circley_NNN3_neuitem1.nextvalue;
values.circlex_neu2item = list.circlex_NNN3_neuitem2.nextvalue;
values.circley_neu2item = list.circley_NNN3_neuitem2.nextvalue;
values.circlex_neu3item = list.circlex_NNN3_neuitem3.nextvalue;
values.circley_neu3item = list.circley_NNN3_neuitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neu1,circle_NNN3_neuitem1; 1500=erase,fixation; 2000=neu2,circle_NNN3_neuitem2; 3000 = erase,fixation; 3500=neu3,circle_NNN3_neuitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.NNN3.response == "j" && values.circlex_neu1item < 320) || (trial.NNN3.response == "k" && values.circlex_neu1item > 320)
]
</trial>
<list circlex_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circley_NNN1_neuitem1>
/ selectionmode = values.NNN1_neuitem1
</list>
<list circlex_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circley_NNN1_neuitem2>
/ selectionmode = values.NNN1_neuitem2
</list>
<list circlex_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circley_NNN1_neuitem3>
/ selectionmode = values.NNN1_neuitem3
</list>
<list circlex_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circley_NNN2_neuitem1>
/ selectionmode = values.NNN2_neuitem1
</list>
<list circlex_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circley_NNN2_neuitem2>
/ selectionmode = values.NNN2_neuitem2
</list>
<list circlex_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circley_NNN2_neuitem3>
/ selectionmode = values.NNN2_neuitem3
</list>
<list circlex_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circley_NNN3_neuitem1>
/ selectionmode = values.NNN3_neuitem1
</list>
<list circlex_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circley_NNN3_neuitem2>
/ selectionmode = values.NNN3_neuitem2
</list>
<list circlex_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>
<list circley_NNN3_neuitem3>
/ selectionmode = values.NNN3_neuitem3
</list>

//BBB triplets
<trial BBB1>
/ ontrialbegin = [
values.neg1item = values.BBB1_negitem1;
values.neg2item = values.BBB1_negitem2;
values.neg3item = values.BBB1_negitem3;
values.circlex_neg1item = list.circlex_BBB1_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB1_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB1_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB1_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB1_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB1_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB1_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB1_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB1_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB1.response == "j" && values.circlex_neg1item < 320) || (trial.BBB1.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB2>
/ ontrialbegin = [
values.neg1item = values.BBB2_negitem1;
values.neg2item = values.BBB2_negitem2;
values.neg3item = values.BBB2_negitem3;
values.circlex_neg1item = list.circlex_BBB2_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB2_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB2_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB2_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB2_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB2_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB2_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB2_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB2_negitem3]
/ timeout = 4500
/ iscorrectresponse = [
(trial.BBB2.response == "j" && values.circlex_neg1item < 320) || (trial.BBB2.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<trial BBB3>
/ ontrialbegin = [
values.neg1item = values.BBB3_negitem1;
values.neg2item = values.BBB3_negitem2;
values.neg3item = values.BBB3_negitem3;
values.circlex_neg1item = list.circlex_BBB3_negitem1.nextvalue;
values.circley_neg1item = list.circley_BBB3_negitem1.nextvalue;
values.circlex_neg2item = list.circlex_BBB3_negitem2.nextvalue;
values.circley_neg2item = list.circley_BBB3_negitem2.nextvalue;
values.circlex_neg3item = list.circlex_BBB3_negitem3.nextvalue;
values.circley_neg3item = list.circley_BBB3_negitem3.nextvalue;
]
/ stimulustimes = [1=fixation; 500 = neg1,circle_BBB3_negitem1; 1500=erase,fixation; 2000=neg2,circle_BBB3_negitem2; 3000 = erase,fixation; 3500=neg3,circle_BBB3_negitem3]
/ timeout = 4500
/ validresponse = ("j", "k")
/ iscorrectresponse = [
(trial.BBB3.response == "j" && values.circlex_neg1item < 320) || (trial.BBB3.response == "k" && values.circlex_neg1item > 320)
]
</trial>
<list circlex_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circley_BBB1_negitem1>
/ selectionmode = values.BBB1_negitem1
</list>
<list circlex_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circley_BBB1_negitem2>
/ selectionmode = values.BBB1_negitem2
</list>
<list circlex_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circley_BBB1_negitem3>
/ selectionmode = values.BBB1_negitem3
</list>
<list circlex_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circley_BBB2_negitem1>
/ selectionmode = values.BBB2_negitem1
</list>
<list circlex_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circley_BBB2_negitem2>
/ selectionmode = values.BBB2_negitem2
</list>
<list circlex_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circley_BBB2_negitem3>
/ selectionmode = values.BBB2_negitem3
</list>
<list circlex_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circley_BBB3_negitem1>
/ selectionmode = values.BBB3_negitem1
</list>
<list circlex_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circley_BBB3_negitem2>
/ selectionmode = values.BBB3_negitem2
</list>
<list circlex_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>
<list circley_BBB3_negitem3>
/ selectionmode = values.BBB3_negitem3
</list>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>

<shape circle_NNN1_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN1_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN1_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN2_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN2_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN2_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>
<shape circle_NNN3_neuitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu1item
/ vposition = values.yoffset + values.circley_neu1item
</shape>
<shape circle_NNN3_neuitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu2item
/ vposition = values.yoffset + values.circley_neu2item
</shape>
<shape circle_NNN3_neuitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neu3item
/ vposition = values.yoffset + values.circley_neu3item
</shape>

<shape circle_BBB1_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB1_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB1_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB2_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB2_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB2_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>
<shape circle_BBB3_negitem1>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg1item
/ vposition = values.yoffset + values.circley_neg1item
</shape>
<shape circle_BBB3_negitem2>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg2item
/ vposition = values.yoffset + values.circley_neg2item
</shape>
<shape circle_BBB3_negitem3>
/ shape = circle
/ color = darkgray
/ size = (1px*display.height/20,1px*display.height/20)
/ hposition = values.xoffset + values.circlex_neg3item
/ vposition = values.yoffset + values.circley_neg3item
</shape>

<shape erase>
/ shape = rectangle
/ color = black
/ size = (1px*display.width,1px*display.height)
</shape>

<values>
/ imageCondition = 1
/ leftRightPosition = 1
</values>

<page encodingIntro>
^^Again, if you see a grey patch on the left side of the picture, please press the button “J” as quickly as possible. If you see a grey patch on the right side of the picture, please press the button “K” as quickly as possible.
^^Please make sure you always use the same fingers to press the buttons. You will have breaks periodically.
^^If at any point of this part of the experiment that you want to quit, please press control+Q.
^^To continue, please press the space bar.
</page>

<item times>
/1 = " Please take a break, the experiemnt will begin shortly. 1:00"
/2 = " Please take a break, the experiemnt will begin shortly. 00:59"
</item>
<text timepass>
/items = times
/ color = white
/ txbgcolor = black
/ fontstyle = ("Arial", 3%)
</text>
<trial break>
/stimulustimes = [0=timepass]
/timeout = 1000
</trial>

// trials = [1, 13 = noreplacenorepeat(NNN1,NNN2,BBB1); 2-12=break]
<block encoding>
/ preinstructions = (encodingIntro)
/ trials = [1-3 = noreplacenorepeat(NNN1,NNN2,BBB1)]
/ bgstim = (fixation)
</block>

*********************************************************************************
*********************************************************************************

<expt PrAff>
/onexptbegin = [
values.NNN1_neuitem1 = list.neuItemNum.nextindex;
values.NNN1_neuitem2 = list.neuItemNum.nextindex;
values.NNN1_neuitem3 = list.neuItemNum.nextindex;
values.NNN2_neuitem1 = list.neuItemNum.nextindex;
values.NNN2_neuitem2 = list.neuItemNum.nextindex;
values.NNN2_neuitem3 = list.neuItemNum.nextindex;
values.NNN3_neuitem1 = list.neuItemNum.nextindex;
values.NNN3_neuitem2 = list.neuItemNum.nextindex;
values.NNN3_neuitem3 = list.neuItemNum.nextindex;

values.BBB1_negitem1 = list.negItemNum.nextindex;
values.BBB1_negitem2 = list.negItemNum.nextindex;
values.BBB1_negitem3 = list.negItemNum.nextindex;
values.BBB2_negitem1 = list.negItemNum.nextindex;
values.BBB2_negitem2 = list.negItemNum.nextindex;
values.BBB2_negitem3 = list.negItemNum.nextindex;
values.BBB3_negitem1 = list.negItemNum.nextindex;
values.BBB3_negitem2 = list.negItemNum.nextindex;
values.BBB3_negitem3 = list.negItemNum.nextindex;

values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB1_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB2_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_BBB3_negitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN1_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN2_neuitem3.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem1.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem2.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex_NNN3_neuitem3.appenditem(round(rand(values.lower,values.upper)));

list.circley_BBB1_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB1_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB2_negitem3.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem1.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem2.appenditem(round(rand(0,480)));
list.circley_BBB3_negitem3.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN1_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN2_neuitem3.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem1.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem2.appenditem(round(rand(0,480)));
list.circley_NNN3_neuitem3.appenditem(round(rand(0,480)));
]
/ blocks = [1=encoding]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex_BBB1_negitem1 values.circley_BBB1_negitem1 response latency correct)
/ separatefiles = true
</data>






Thank you so much!!






Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
skyeysss - Sunday, November 4, 2018
Hi,

Sorry I'm pretty new to Inquisit so forgive me if these are naive questions:
I've been trying to figure out a way to randomize the location of a grey solid circle with the change of the images for each trial. Basically, in each trial, a subject will see a negative or neutral image, and there should be a grey circle showing on top of that image. The location of the grey circle is not pre-determined, but randomized for each subject and for each image within a range. The circle will always need to present within the frame of the image (size 640*480 in the center of the screen). The location of the circle should be fixed for each image (because the images repeat 3 times within a block), such that each unique image has a circle overlaying on the exact same spot for that image. But the location of the circle across images should be randomized (not likely to be the same). Also the subject will respond by pressing either the left or right arrow button to indicate whether the grey circle locates at the right or left side of the image for each trial. So we want a random half of the images in each condition (negative or neutral) have the circle on the left and the other half in each condition on the right to ensure counterbalancing. The stimuli duration is fixed, so no matter they respond or didn't respond, the trial should proceed. But it would be nice to record their accuracy. So ideally it would be great to know how whether the circle is on either side of image and compare that to the key press.

So there really are two parts to this question:
1. how to make two stimuli "covary"?
2. how to "remember" or detect the circle location on each image and record their accuracy?

Hope I describe the question clearly. Thanks for the help in advance!!!

At the start of the experiment, i.e. /onexptbegin, you'll want to populate two <list> elements -- one for x coordinates, one for y coordinates -- with circle locations. Those <list> elements ought to be paired to your picture stimuli. This will ensure that a specific (randomly generated) location is and remains tied to a specific image stimulus. This also, then, tells you the circle location in each trial, i.e. you can determine whether it's on the left or right side from its horizontal position and determine response correctness accordingly. Here's a simple example:

<values>
/ itemnumber = 1
/ circlex = 1px
/ circley = 1px
/ xoffset = 1px*(display.width/2 - 320)
/ yoffset = 1px*(display.height/2 - 240)
</values>

// 4 items in this example
<list stimnumber>
/ poolsize = 4
</list>

<text stimulus>
/ items = stimitems
/ size = (640px, 480px)
/ txbgcolor = yellow
/ vjustify = center
/ select = values.itemnumber
</text>

<item stimitems>
/ 1 = "A"
/ 1 = "B"
/ 1 = "C"
/ 1 = "D"
</item>

<shape thecircle>
/ shape = circle
/ color = grey
/ size = (30px, 30px)
/ hposition = values.xoffset + values.circlex
/ vposition = values.yoffset + values.circley
</shape>

<list circlex>
/ selectionmode = values.itemnumber
</list>

<list circley>
/ selectionmode = values.itemnumber
</list>

<trial mytrial>
/ ontrialbegin = [
values.itemnumber = list.stimnumber.nextindex;
values.circlex = list.circlex.nextvalue;
values.circley = list.circley.nextvalue;
]
/ stimulusframes = [1=stimulus, thecircle]
/ validresponse = (203, 205)
/ iscorrectresponse = [
(trial.mytrial.response == 203 && values.circlex < 320) || (trial.mytrial.response == 205 && values.circlex > 320)
]
/ timeout = 5000
</trial>

<block myblock>
/ trials = [1-12 = mytrial]
</block>

<list lowerbound>
/ items = (0,330)
/ poolsize = 4
/ selectionrate = always
</list>

<values>
/ lower = 0
/ upper = 0
</values>


<expt>
/ onexptbegin = [
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));
values.lower = list.lowerbound.nextvalue;
values.upper = values.lower + 310;
list.circlex.appenditem(round(rand(values.lower,values.upper)));

list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
list.circley.appenditem(round(rand(0,480)));
]
/ blocks = [1=myblock]
</expt>

<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode stimulusitem values.circlex values.circley response latency correct)
/ separatefiles = true
</data>




skyeysss
skyeysss
Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)Partner Member (602 reputation)
Group: Forum Members
Posts: 10, Visits: 29
Hi,

Sorry I'm pretty new to Inquisit so forgive me if these are naive questions:
I've been trying to figure out a way to randomize the location of a grey solid circle with the change of the images for each trial. Basically, in each trial, a subject will see a negative or neutral image, and there should be a grey circle showing on top of that image. The location of the grey circle is not pre-determined, but randomized for each subject and for each image within a range. The circle will always need to present within the frame of the image (size 640*480 in the center of the screen). The location of the circle should be fixed for each image (because the images repeat 3 times within a block), such that each unique image has a circle overlaying on the exact same spot for that image. But the location of the circle across images should be randomized (not likely to be the same). Also the subject will respond by pressing either the left or right arrow button to indicate whether the grey circle locates at the right or left side of the image for each trial. So we want a random half of the images in each condition (negative or neutral) have the circle on the left and the other half in each condition on the right to ensure counterbalancing. The stimuli duration is fixed, so no matter they respond or didn't respond, the trial should proceed. But it would be nice to record their accuracy. So ideally it would be great to know how whether the circle is on either side of image and compare that to the key press.

So there really are two parts to this question:
1. how to make two stimuli "covary"?
2. how to "remember" or detect the circle location on each image and record their accuracy?

Hope I describe the question clearly. Thanks for the help in advance!!!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search