Excluding potential screen locations for linked stimuli


Author
Message
KarenRosa
KarenRosa
New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)
Group: Forum Members
Posts: 3, Visits: 64
Hi All,

I’m having some problems making exclusions from a list of potential screen locations

Here’s briefly what I am trying to do:
•    Each trial is to show images of 9 different identity’s faces to be displayed in a 3 x 3 grid.
•    For each identity I have two images – one depicting a fearful expression and one depicting a neutral expression.
•    Each trial is to show 1 fearful face only (the target). Across 9 trials I want to show each identity once with a fearful expression, and to have a fearful expression showing once in each grid position.
•    Per trial, the remaining 8 grid positions are to display the 8 other identities with a neutral expression.

The code works for the target expression – a fearful expression is displayed once per identity and once per grid position. The remaining 8 identities are also selected correctly per trial and randomly placed into 8 different locations. So far so good. The problem is, a neutral face is often assigned the same position as the fearful face, and therefore only the 8 distractors end up being displayed. It seems my code is not removing the target position from the pool of potential positions before assigning locations to the distractors, but I just can’t work out how to fix it. Any advice would be greatly appreciated‼

This is just the simpler condition. The next, more complex, condition needs to do all of the above, plus for each identity to randomly select between the faces being oriented left or right. I am hopeful that when this first condition is sorted out a similar logic can be applied to this later condition as well, but if you have any ideas about that as well, that would be fantastic.

Here's the code:

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list xPosTgt>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ poolsize = 9
</list>

<list yPosTgt>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosTgt.currentindex
/ selectionrate = always
</list>

<list xPosDst>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ not = [list.xPosTgt.currentindex]
</list>

<list yPosDst>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosDst.currentindex
/ selectionrate = always
</list>

<list target>
/items=(1,2,3,4,5,6,7,8,9)
/ poolsize = 9
</list>

<list distractor1>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor2>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
</list>

<list distractor3>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor4>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor5>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor6>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor7>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor8>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex
]
</list>

<picture target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor1>
/ items = neutral
/ select=list.distractor1.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor2>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor3>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor4>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor5>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor6>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor7>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor8>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<trial fearful>
/ ontrialbegin = [
    list.xPosDst.reset();
    list.yPosDst.reset();
    picture.target.hposition=list.xPosTgt.nextvalue;
    picture.target.vposition=list.yPosTgt.nextvalue;
    picture.distractor1.hposition = list.xPosDst.nextvalue;
    picture.distractor1.vposition = list.yPosDst.nextvalue;
    picture.distractor2.hposition = list.xPosDst.nextvalue;
    picture.distractor2.vposition = list.yPosDst.nextvalue;        
    picture.distractor3.hposition = list.xPosDst.nextvalue;
    picture.distractor3.vposition = list.yPosDst.nextvalue;        
    picture.distractor4.hposition = list.xPosDst.nextvalue;
    picture.distractor4.vposition = list.yPosDst.nextvalue;        
    picture.distractor5.hposition = list.xPosDst.nextvalue;
    picture.distractor5.vposition = list.yPosDst.nextvalue;
    picture.distractor6.hposition = list.xPosDst.nextvalue;
    picture.distractor6.vposition = list.yPosDst.nextvalue;
    picture.distractor7.hposition = list.xPosDst.nextvalue;
    picture.distractor7.vposition = list.yPosDst.nextvalue;        
    picture.distractor8.hposition = list.xPosDst.nextvalue;
    picture.distractor8.vposition = list.yPosDst.nextvalue
    ]    
/stimulustimes = [1=clearscreen; 2=target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>

Dave
Dave
Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)
Group: Administrators
Posts: 11K, Visits: 71K
KarenRosa - 7/22/2021
Hi All,

I’m having some problems making exclusions from a list of potential screen locations

Here’s briefly what I am trying to do:
•    Each trial is to show images of 9 different identity’s faces to be displayed in a 3 x 3 grid.
•    For each identity I have two images – one depicting a fearful expression and one depicting a neutral expression.
•    Each trial is to show 1 fearful face only (the target). Across 9 trials I want to show each identity once with a fearful expression, and to have a fearful expression showing once in each grid position.
•    Per trial, the remaining 8 grid positions are to display the 8 other identities with a neutral expression.

The code works for the target expression – a fearful expression is displayed once per identity and once per grid position. The remaining 8 identities are also selected correctly per trial and randomly placed into 8 different locations. So far so good. The problem is, a neutral face is often assigned the same position as the fearful face, and therefore only the 8 distractors end up being displayed. It seems my code is not removing the target position from the pool of potential positions before assigning locations to the distractors, but I just can’t work out how to fix it. Any advice would be greatly appreciated‼

This is just the simpler condition. The next, more complex, condition needs to do all of the above, plus for each identity to randomly select between the faces being oriented left or right. I am hopeful that when this first condition is sorted out a similar logic can be applied to this later condition as well, but if you have any ideas about that as well, that would be fantastic.

Here's the code:

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list xPosTgt>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ poolsize = 9
</list>

<list yPosTgt>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosTgt.currentindex
/ selectionrate = always
</list>

<list xPosDst>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ not = [list.xPosTgt.currentindex]
</list>

<list yPosDst>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosDst.currentindex
/ selectionrate = always
</list>

<list target>
/items=(1,2,3,4,5,6,7,8,9)
/ poolsize = 9
</list>

<list distractor1>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor2>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
</list>

<list distractor3>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor4>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor5>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor6>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor7>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor8>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex
]
</list>

<picture target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor1>
/ items = neutral
/ select=list.distractor1.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor2>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor3>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor4>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor5>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor6>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor7>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor8>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<trial fearful>
/ ontrialbegin = [
    list.xPosDst.reset();
    list.yPosDst.reset();
    picture.target.hposition=list.xPosTgt.nextvalue;
    picture.target.vposition=list.yPosTgt.nextvalue;
    picture.distractor1.hposition = list.xPosDst.nextvalue;
    picture.distractor1.vposition = list.yPosDst.nextvalue;
    picture.distractor2.hposition = list.xPosDst.nextvalue;
    picture.distractor2.vposition = list.yPosDst.nextvalue;        
    picture.distractor3.hposition = list.xPosDst.nextvalue;
    picture.distractor3.vposition = list.yPosDst.nextvalue;        
    picture.distractor4.hposition = list.xPosDst.nextvalue;
    picture.distractor4.vposition = list.yPosDst.nextvalue;        
    picture.distractor5.hposition = list.xPosDst.nextvalue;
    picture.distractor5.vposition = list.yPosDst.nextvalue;
    picture.distractor6.hposition = list.xPosDst.nextvalue;
    picture.distractor6.vposition = list.yPosDst.nextvalue;
    picture.distractor7.hposition = list.xPosDst.nextvalue;
    picture.distractor7.vposition = list.yPosDst.nextvalue;        
    picture.distractor8.hposition = list.xPosDst.nextvalue;
    picture.distractor8.vposition = list.yPosDst.nextvalue
    ]    
/stimulustimes = [1=clearscreen; 2=target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>

The fundamental problem is here:

<list xPosDst>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ not = [list.xPosTgt.currentindex]
</list>

The not constraint operates on the item value, not the index. Assume the 3rd item is selected in <list xPosTgt> (35%). Then, in <list xPosDst>, the value 3 is excluded. But none of the items have that value, so all 9 items are available for sampling. So, what you need to do is exclude a value, i.e.

<list xPosDst>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ not = [list.xPosTgt.currentvalue]
</list>

That, however, brings another problem. By excluding e.g. 65%, you're not excluding just one position, but three. Short of introducing another list that simply operates on position numbers, the dirty trick to resolve that is to make the position values minimally different:

<list xPosTgt>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = trial
</list>

...

<list xPosDst>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = always
/ not = (list.xPosTgt.currentvalue)
</list>


Runnable example, which should give proper results:

<parameters>
/ picsize = 5%
</parameters>

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list xPosTgt>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = trial
</list>

<list yPosTgt>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosTgt.currentindex
/ selectionrate = trial
</list>

<list xPosDst>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = always
/ not = (list.xPosTgt.currentvalue)
</list>

<list yPosDst>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosDst.currentindex
/ selectionrate = always
</list>

<list target>
/items=(1,2,3,4,5,6,7,8,9)
/ poolsize = 9
</list>

<list distractor1>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor2>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor3>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor4>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor5>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor6>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor7>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor8>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
]
</list>

<text target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
/ txcolor = red
</text>

<text distractor1>
/ items = neutral
/ select=list.distractor1.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor2>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor3>
/ items = neutral
/ select=list.distractor3.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor4>
/ items = neutral
/ select=list.distractor4.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor5>
/ items = neutral
/ select=list.distractor5.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor6>
/ items = neutral
/ select=list.distractor6.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor7>
/ items = neutral
/ select=list.distractor7.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor8>
/ items = neutral
/ select=list.distractor8.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<trial fearful>
/ ontrialbegin = [
list.xPosDst.reset();
list.yPosDst.reset();
    
text.target.hposition=list.xPosTgt.nextvalue;
text.target.vposition=list.yPosTgt.nextvalue;
    
text.distractor1.hposition = list.xPosDst.nextvalue;
text.distractor1.vposition = list.yPosDst.nextvalue;
    
text.distractor2.hposition = list.xPosDst.nextvalue;
text.distractor2.vposition = list.yPosDst.nextvalue;
    
text.distractor3.hposition = list.xPosDst.nextvalue;
text.distractor3.vposition = list.yPosDst.nextvalue;
    
text.distractor4.hposition = list.xPosDst.nextvalue;
text.distractor4.vposition = list.yPosDst.nextvalue;
    
text.distractor5.hposition = list.xPosDst.nextvalue;
text.distractor5.vposition = list.yPosDst.nextvalue;
    
text.distractor6.hposition = list.xPosDst.nextvalue;
text.distractor6.vposition = list.yPosDst.nextvalue;

    text.distractor7.hposition = list.xPosDst.nextvalue;
    text.distractor7.vposition = list.yPosDst.nextvalue;

    text.distractor8.hposition = list.xPosDst.nextvalue;
text.distractor8.vposition = list.yPosDst.nextvalue;
]
/stimulustimes = [0=clearscreen, target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>


As an aside, unless there's some reason for the multiple-lists design choice that I'm not catching, the distractor item selection can be simplified to:

<parameters>
/ picsize = 5%
</parameters>

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list xPosTgt>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = trial
</list>

<list yPosTgt>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosTgt.currentindex
/ selectionrate = trial
</list>

<list xPosDst>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = always
/ not = (list.xPosTgt.currentvalue)
</list>

<list yPosDst>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosDst.currentindex
/ selectionrate = always
</list>

<list target>
/items=(1,2,3,4,5,6,7,8,9)
/ poolsize = 9
</list>

<list distractors>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [list.target.currentvalue]
/ selectionrate = always
</list>

<text target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
/ txcolor = red
</text>

<text distractor1>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor2>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor3>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor4>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor5>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor6>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor7>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor8>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<trial fearful>
/ ontrialbegin = [
list.xPosDst.reset();
list.yPosDst.reset();
    list.distractors.reset();
    
text.target.hposition=list.xPosTgt.nextvalue;
text.target.vposition=list.yPosTgt.nextvalue;
    
text.distractor1.hposition = list.xPosDst.nextvalue;
text.distractor1.vposition = list.yPosDst.nextvalue;
    
text.distractor2.hposition = list.xPosDst.nextvalue;
text.distractor2.vposition = list.yPosDst.nextvalue;
    
text.distractor3.hposition = list.xPosDst.nextvalue;
text.distractor3.vposition = list.yPosDst.nextvalue;
    
text.distractor4.hposition = list.xPosDst.nextvalue;
text.distractor4.vposition = list.yPosDst.nextvalue;
    
text.distractor5.hposition = list.xPosDst.nextvalue;
text.distractor5.vposition = list.yPosDst.nextvalue;
    
text.distractor6.hposition = list.xPosDst.nextvalue;
text.distractor6.vposition = list.yPosDst.nextvalue;

    text.distractor7.hposition = list.xPosDst.nextvalue;
    text.distractor7.vposition = list.yPosDst.nextvalue;

    text.distractor8.hposition = list.xPosDst.nextvalue;
text.distractor8.vposition = list.yPosDst.nextvalue;
]
/stimulustimes = [0=clearscreen, target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>





Edited 6 days ago @ 5:09 PM by Dave
Dave
Dave
Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)Supreme Being (947K reputation)
Group: Administrators
Posts: 11K, Visits: 71K
Dave - 7/22/2021
KarenRosa - 7/22/2021
Hi All,

I’m having some problems making exclusions from a list of potential screen locations

Here’s briefly what I am trying to do:
•    Each trial is to show images of 9 different identity’s faces to be displayed in a 3 x 3 grid.
•    For each identity I have two images – one depicting a fearful expression and one depicting a neutral expression.
•    Each trial is to show 1 fearful face only (the target). Across 9 trials I want to show each identity once with a fearful expression, and to have a fearful expression showing once in each grid position.
•    Per trial, the remaining 8 grid positions are to display the 8 other identities with a neutral expression.

The code works for the target expression – a fearful expression is displayed once per identity and once per grid position. The remaining 8 identities are also selected correctly per trial and randomly placed into 8 different locations. So far so good. The problem is, a neutral face is often assigned the same position as the fearful face, and therefore only the 8 distractors end up being displayed. It seems my code is not removing the target position from the pool of potential positions before assigning locations to the distractors, but I just can’t work out how to fix it. Any advice would be greatly appreciated‼

This is just the simpler condition. The next, more complex, condition needs to do all of the above, plus for each identity to randomly select between the faces being oriented left or right. I am hopeful that when this first condition is sorted out a similar logic can be applied to this later condition as well, but if you have any ideas about that as well, that would be fantastic.

Here's the code:

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list xPosTgt>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ poolsize = 9
</list>

<list yPosTgt>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosTgt.currentindex
/ selectionrate = always
</list>

<list xPosDst>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ not = [list.xPosTgt.currentindex]
</list>

<list yPosDst>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosDst.currentindex
/ selectionrate = always
</list>

<list target>
/items=(1,2,3,4,5,6,7,8,9)
/ poolsize = 9
</list>

<list distractor1>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor2>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
</list>

<list distractor3>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor4>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor5>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor6>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor7>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor8>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex
]
</list>

<picture target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor1>
/ items = neutral
/ select=list.distractor1.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor2>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor3>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor4>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor5>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor6>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor7>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor8>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<trial fearful>
/ ontrialbegin = [
    list.xPosDst.reset();
    list.yPosDst.reset();
    picture.target.hposition=list.xPosTgt.nextvalue;
    picture.target.vposition=list.yPosTgt.nextvalue;
    picture.distractor1.hposition = list.xPosDst.nextvalue;
    picture.distractor1.vposition = list.yPosDst.nextvalue;
    picture.distractor2.hposition = list.xPosDst.nextvalue;
    picture.distractor2.vposition = list.yPosDst.nextvalue;        
    picture.distractor3.hposition = list.xPosDst.nextvalue;
    picture.distractor3.vposition = list.yPosDst.nextvalue;        
    picture.distractor4.hposition = list.xPosDst.nextvalue;
    picture.distractor4.vposition = list.yPosDst.nextvalue;        
    picture.distractor5.hposition = list.xPosDst.nextvalue;
    picture.distractor5.vposition = list.yPosDst.nextvalue;
    picture.distractor6.hposition = list.xPosDst.nextvalue;
    picture.distractor6.vposition = list.yPosDst.nextvalue;
    picture.distractor7.hposition = list.xPosDst.nextvalue;
    picture.distractor7.vposition = list.yPosDst.nextvalue;        
    picture.distractor8.hposition = list.xPosDst.nextvalue;
    picture.distractor8.vposition = list.yPosDst.nextvalue
    ]    
/stimulustimes = [1=clearscreen; 2=target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>

The fundamental problem is here:

<list xPosDst>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ not = [list.xPosTgt.currentindex]
</list>

The not constraints operates on the item value, not the index. Assume the 3rd item is selected in <list xPosTgt> (35%). Then, in <list xPosDst>, the value 3 is excluded. But none of the items have that value, so all 9 items are available for sampling. So, what you need to do is exclude a value, i.e.

<list xPosDst>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ not = [list.xPosTgt.currentvalue]
</list>

That, however, brings another proplem. By excluding e.g. 65%, you're not excluding just one position, but three. Short of introducing another list that simply operates on position numbers, the dirty trick to resolve that is to make the position values minimally different:

<list xPosTgt>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = trial
</list>

...

<list xPosDst>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = always
/ not = (list.xPosTgt.currentvalue)
</list>


Runnable example, which should give proper results:

<parameters>
/ picsize = 5%
</parameters>

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list xPosTgt>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = trial
</list>

<list yPosTgt>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosTgt.currentindex
/ selectionrate = trial
</list>

<list xPosDst>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = always
/ not = (list.xPosTgt.currentvalue)
</list>

<list yPosDst>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosDst.currentindex
/ selectionrate = always
</list>

<list target>
/items=(1,2,3,4,5,6,7,8,9)
/ poolsize = 9
</list>

<list distractor1>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor2>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor3>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor4>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor5>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor6>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor7>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor8>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
]
</list>

<text target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
/ txcolor = red
</text>

<text distractor1>
/ items = neutral
/ select=list.distractor1.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor2>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor3>
/ items = neutral
/ select=list.distractor3.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor4>
/ items = neutral
/ select=list.distractor4.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor5>
/ items = neutral
/ select=list.distractor5.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor6>
/ items = neutral
/ select=list.distractor6.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor7>
/ items = neutral
/ select=list.distractor7.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor8>
/ items = neutral
/ select=list.distractor8.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<trial fearful>
/ ontrialbegin = [
list.xPosDst.reset();
list.yPosDst.reset();
    
text.target.hposition=list.xPosTgt.nextvalue;
text.target.vposition=list.yPosTgt.nextvalue;
    
text.distractor1.hposition = list.xPosDst.nextvalue;
text.distractor1.vposition = list.yPosDst.nextvalue;
    
text.distractor2.hposition = list.xPosDst.nextvalue;
text.distractor2.vposition = list.yPosDst.nextvalue;
    
text.distractor3.hposition = list.xPosDst.nextvalue;
text.distractor3.vposition = list.yPosDst.nextvalue;
    
text.distractor4.hposition = list.xPosDst.nextvalue;
text.distractor4.vposition = list.yPosDst.nextvalue;
    
text.distractor5.hposition = list.xPosDst.nextvalue;
text.distractor5.vposition = list.yPosDst.nextvalue;
    
text.distractor6.hposition = list.xPosDst.nextvalue;
text.distractor6.vposition = list.yPosDst.nextvalue;

    text.distractor7.hposition = list.xPosDst.nextvalue;
    text.distractor7.vposition = list.yPosDst.nextvalue;

    text.distractor8.hposition = list.xPosDst.nextvalue;
text.distractor8.vposition = list.yPosDst.nextvalue;
]
/stimulustimes = [0=clearscreen, target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>


As an aside, unless there's some reason for the multiple-lists design choice that I'm not catching, the distractor item selection can be simplified to:

<parameters>
/ picsize = 5%
</parameters>

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list xPosTgt>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = trial
</list>

<list yPosTgt>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosTgt.currentindex
/ selectionrate = trial
</list>

<list xPosDst>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = always
/ not = (list.xPosTgt.currentvalue)
</list>

<list yPosDst>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosDst.currentindex
/ selectionrate = always
</list>

<list target>
/items=(1,2,3,4,5,6,7,8,9)
/ poolsize = 9
</list>

<list distractors>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [list.target.currentvalue]
/ selectionrate = always
</list>

<text target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
/ txcolor = red
</text>

<text distractor1>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor2>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor3>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor4>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor5>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor6>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor7>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor8>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<trial fearful>
/ ontrialbegin = [
list.xPosDst.reset();
list.yPosDst.reset();
    list.distractors.reset();
    
text.target.hposition=list.xPosTgt.nextvalue;
text.target.vposition=list.yPosTgt.nextvalue;
    
text.distractor1.hposition = list.xPosDst.nextvalue;
text.distractor1.vposition = list.yPosDst.nextvalue;
    
text.distractor2.hposition = list.xPosDst.nextvalue;
text.distractor2.vposition = list.yPosDst.nextvalue;
    
text.distractor3.hposition = list.xPosDst.nextvalue;
text.distractor3.vposition = list.yPosDst.nextvalue;
    
text.distractor4.hposition = list.xPosDst.nextvalue;
text.distractor4.vposition = list.yPosDst.nextvalue;
    
text.distractor5.hposition = list.xPosDst.nextvalue;
text.distractor5.vposition = list.yPosDst.nextvalue;
    
text.distractor6.hposition = list.xPosDst.nextvalue;
text.distractor6.vposition = list.yPosDst.nextvalue;

    text.distractor7.hposition = list.xPosDst.nextvalue;
    text.distractor7.vposition = list.yPosDst.nextvalue;

    text.distractor8.hposition = list.xPosDst.nextvalue;
text.distractor8.vposition = list.yPosDst.nextvalue;
]
/stimulustimes = [0=clearscreen, target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>





For the sake of completeness, here's the "clean" solution working with unique position numbers 1 to 9:

<parameters>
/ picsize = 5%
</parameters>

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list targetPos>
/ items = (1,2,3,4,5,6,7,8,9)
/ selectionrate = trial
/ replace = false
</list>

<list distractorPos>
/ items = (1,2,3,4,5,6,7,8,9)
/ selectionrate = always
/ replace = false
/ not = (list.targetPos.currentvalue)
</list>

<list xPos>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
</list>

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

<list target>
/items=(1,2,3,4,5,6,7,8,9)
</list>

<list distractors>
/items=(1,2,3,4,5,6,7,8,9)
/ selectionrate = always
/ not = (list.target.currentvalue)
</list>

<text target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
/ txcolor = red
</text>

<text distractor1>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor2>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor3>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor4>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor5>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor6>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor7>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor8>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<trial fearful>
/ ontrialbegin = [
list.distractorPos.reset();
    list.distractors.reset();
    
text.target.hposition=list.xPos.item(list.targetPos.nextvalue);
text.target.vposition=list.yPos.item(list.targetPos.currentvalue);
    
text.distractor1.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor1.vposition = list.yPos.item(list.distractorPos.currentvalue);
    
text.distractor2.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor2.vposition = list.yPos.item(list.distractorPos.currentvalue);
    
text.distractor3.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor3.vposition = list.yPos.item(list.distractorPos.currentvalue);
    
text.distractor4.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor4.vposition = list.yPos.item(list.distractorPos.currentvalue);
    
text.distractor5.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor5.vposition = list.yPos.item(list.distractorPos.currentvalue);
    
text.distractor6.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor6.vposition = list.yPos.item(list.distractorPos.currentvalue);

text.distractor7.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor7.vposition = list.yPos.item(list.distractorPos.currentvalue);

text.distractor8.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor8.vposition = list.yPos.item(list.distractorPos.currentvalue);
]
/stimulustimes = [0=clearscreen, target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>

KarenRosa
KarenRosa
New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)New Member (8 reputation)
Group: Forum Members
Posts: 3, Visits: 64
Dave - 7/22/2021
Dave - 7/22/2021
KarenRosa - 7/22/2021
Hi All,

I’m having some problems making exclusions from a list of potential screen locations

Here’s briefly what I am trying to do:
•    Each trial is to show images of 9 different identity’s faces to be displayed in a 3 x 3 grid.
•    For each identity I have two images – one depicting a fearful expression and one depicting a neutral expression.
•    Each trial is to show 1 fearful face only (the target). Across 9 trials I want to show each identity once with a fearful expression, and to have a fearful expression showing once in each grid position.
•    Per trial, the remaining 8 grid positions are to display the 8 other identities with a neutral expression.

The code works for the target expression – a fearful expression is displayed once per identity and once per grid position. The remaining 8 identities are also selected correctly per trial and randomly placed into 8 different locations. So far so good. The problem is, a neutral face is often assigned the same position as the fearful face, and therefore only the 8 distractors end up being displayed. It seems my code is not removing the target position from the pool of potential positions before assigning locations to the distractors, but I just can’t work out how to fix it. Any advice would be greatly appreciated‼

This is just the simpler condition. The next, more complex, condition needs to do all of the above, plus for each identity to randomly select between the faces being oriented left or right. I am hopeful that when this first condition is sorted out a similar logic can be applied to this later condition as well, but if you have any ideas about that as well, that would be fantastic.

Here's the code:

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list xPosTgt>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ poolsize = 9
</list>

<list yPosTgt>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosTgt.currentindex
/ selectionrate = always
</list>

<list xPosDst>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ not = [list.xPosTgt.currentindex]
</list>

<list yPosDst>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosDst.currentindex
/ selectionrate = always
</list>

<list target>
/items=(1,2,3,4,5,6,7,8,9)
/ poolsize = 9
</list>

<list distractor1>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor2>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
</list>

<list distractor3>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor4>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor5>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor6>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor7>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor8.currentindex
]
</list>

<list distractor8>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex
]
</list>

<picture target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor1>
/ items = neutral
/ select=list.distractor1.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor2>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor3>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor4>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor5>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor6>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor7>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<picture distractor8>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</picture>

<trial fearful>
/ ontrialbegin = [
    list.xPosDst.reset();
    list.yPosDst.reset();
    picture.target.hposition=list.xPosTgt.nextvalue;
    picture.target.vposition=list.yPosTgt.nextvalue;
    picture.distractor1.hposition = list.xPosDst.nextvalue;
    picture.distractor1.vposition = list.yPosDst.nextvalue;
    picture.distractor2.hposition = list.xPosDst.nextvalue;
    picture.distractor2.vposition = list.yPosDst.nextvalue;        
    picture.distractor3.hposition = list.xPosDst.nextvalue;
    picture.distractor3.vposition = list.yPosDst.nextvalue;        
    picture.distractor4.hposition = list.xPosDst.nextvalue;
    picture.distractor4.vposition = list.yPosDst.nextvalue;        
    picture.distractor5.hposition = list.xPosDst.nextvalue;
    picture.distractor5.vposition = list.yPosDst.nextvalue;
    picture.distractor6.hposition = list.xPosDst.nextvalue;
    picture.distractor6.vposition = list.yPosDst.nextvalue;
    picture.distractor7.hposition = list.xPosDst.nextvalue;
    picture.distractor7.vposition = list.yPosDst.nextvalue;        
    picture.distractor8.hposition = list.xPosDst.nextvalue;
    picture.distractor8.vposition = list.yPosDst.nextvalue
    ]    
/stimulustimes = [1=clearscreen; 2=target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>

The fundamental problem is here:

<list xPosDst>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ not = [list.xPosTgt.currentindex]
</list>

The not constraints operates on the item value, not the index. Assume the 3rd item is selected in <list xPosTgt> (35%). Then, in <list xPosDst>, the value 3 is excluded. But none of the items have that value, so all 9 items are available for sampling. So, what you need to do is exclude a value, i.e.

<list xPosDst>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
/ replace = false
/ selectionrate = always
/ not = [list.xPosTgt.currentvalue]
</list>

That, however, brings another proplem. By excluding e.g. 65%, you're not excluding just one position, but three. Short of introducing another list that simply operates on position numbers, the dirty trick to resolve that is to make the position values minimally different:

<list xPosTgt>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = trial
</list>

...

<list xPosDst>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = always
/ not = (list.xPosTgt.currentvalue)
</list>


Runnable example, which should give proper results:

<parameters>
/ picsize = 5%
</parameters>

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list xPosTgt>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = trial
</list>

<list yPosTgt>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosTgt.currentindex
/ selectionrate = trial
</list>

<list xPosDst>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = always
/ not = (list.xPosTgt.currentvalue)
</list>

<list yPosDst>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosDst.currentindex
/ selectionrate = always
</list>

<list target>
/items=(1,2,3,4,5,6,7,8,9)
/ poolsize = 9
</list>

<list distractor1>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor2>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor3>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor4>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor5>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor6>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor7.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor7>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor8.currentindex;
]
</list>

<list distractor8>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [
list.target.currentindex;
list.distractor1.currentindex;
list.distractor2.currentindex;
list.distractor3.currentindex;
list.distractor4.currentindex;
list.distractor5.currentindex;
list.distractor6.currentindex;
list.distractor7.currentindex;
]
</list>

<text target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
/ txcolor = red
</text>

<text distractor1>
/ items = neutral
/ select=list.distractor1.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor2>
/ items = neutral
/ select=list.distractor2.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor3>
/ items = neutral
/ select=list.distractor3.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor4>
/ items = neutral
/ select=list.distractor4.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor5>
/ items = neutral
/ select=list.distractor5.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor6>
/ items = neutral
/ select=list.distractor6.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor7>
/ items = neutral
/ select=list.distractor7.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor8>
/ items = neutral
/ select=list.distractor8.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<trial fearful>
/ ontrialbegin = [
list.xPosDst.reset();
list.yPosDst.reset();
    
text.target.hposition=list.xPosTgt.nextvalue;
text.target.vposition=list.yPosTgt.nextvalue;
    
text.distractor1.hposition = list.xPosDst.nextvalue;
text.distractor1.vposition = list.yPosDst.nextvalue;
    
text.distractor2.hposition = list.xPosDst.nextvalue;
text.distractor2.vposition = list.yPosDst.nextvalue;
    
text.distractor3.hposition = list.xPosDst.nextvalue;
text.distractor3.vposition = list.yPosDst.nextvalue;
    
text.distractor4.hposition = list.xPosDst.nextvalue;
text.distractor4.vposition = list.yPosDst.nextvalue;
    
text.distractor5.hposition = list.xPosDst.nextvalue;
text.distractor5.vposition = list.yPosDst.nextvalue;
    
text.distractor6.hposition = list.xPosDst.nextvalue;
text.distractor6.vposition = list.yPosDst.nextvalue;

    text.distractor7.hposition = list.xPosDst.nextvalue;
    text.distractor7.vposition = list.yPosDst.nextvalue;

    text.distractor8.hposition = list.xPosDst.nextvalue;
text.distractor8.vposition = list.yPosDst.nextvalue;
]
/stimulustimes = [0=clearscreen, target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>


As an aside, unless there's some reason for the multiple-lists design choice that I'm not catching, the distractor item selection can be simplified to:

<parameters>
/ picsize = 5%
</parameters>

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list xPosTgt>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = trial
</list>

<list yPosTgt>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosTgt.currentindex
/ selectionrate = trial
</list>

<list xPosDst>
/items = (35.001%,35.002%,35.003%,50.001%,50.002%,50.003%,65.001%,65.002%,65.003%)
/ replace = false
/ selectionrate = always
/ not = (list.xPosTgt.currentvalue)
</list>

<list yPosDst>
/items = (25%,50%,75%,25%,50%,75%,25%,50%,75%)
/ selectionmode = list.xPosDst.currentindex
/ selectionrate = always
</list>

<list target>
/items=(1,2,3,4,5,6,7,8,9)
/ poolsize = 9
</list>

<list distractors>
/items=(1,2,3,4,5,6,7,8,9)
/ not = [list.target.currentvalue]
/ selectionrate = always
</list>

<text target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
/ txcolor = red
</text>

<text distractor1>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor2>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor3>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor4>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor5>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor6>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor7>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor8>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<trial fearful>
/ ontrialbegin = [
list.xPosDst.reset();
list.yPosDst.reset();
    list.distractors.reset();
    
text.target.hposition=list.xPosTgt.nextvalue;
text.target.vposition=list.yPosTgt.nextvalue;
    
text.distractor1.hposition = list.xPosDst.nextvalue;
text.distractor1.vposition = list.yPosDst.nextvalue;
    
text.distractor2.hposition = list.xPosDst.nextvalue;
text.distractor2.vposition = list.yPosDst.nextvalue;
    
text.distractor3.hposition = list.xPosDst.nextvalue;
text.distractor3.vposition = list.yPosDst.nextvalue;
    
text.distractor4.hposition = list.xPosDst.nextvalue;
text.distractor4.vposition = list.yPosDst.nextvalue;
    
text.distractor5.hposition = list.xPosDst.nextvalue;
text.distractor5.vposition = list.yPosDst.nextvalue;
    
text.distractor6.hposition = list.xPosDst.nextvalue;
text.distractor6.vposition = list.yPosDst.nextvalue;

    text.distractor7.hposition = list.xPosDst.nextvalue;
    text.distractor7.vposition = list.yPosDst.nextvalue;

    text.distractor8.hposition = list.xPosDst.nextvalue;
text.distractor8.vposition = list.yPosDst.nextvalue;
]
/stimulustimes = [0=clearscreen, target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>





For the sake of completeness, here's the "clean" solution working with unique position numbers 1 to 9:

<parameters>
/ picsize = 5%
</parameters>

<item fearful>
/1="ID_03_fearful.jpg"
/2="ID_05_fearful.jpg"
/3="ID_07_fearful.jpg"
/4="ID_20_fearful.jpg"
/5="ID_23_fearful.jpg"
/6="ID_38_fearful.jpg"
/7="ID_46_fearful.jpg"
/8="ID_49_fearful.jpg"
/9="ID_71_fearful.jpg"
</item>

<item Neutral>
/1="ID_03_neutral.jpg"
/2="ID_05_neutral.jpg"
/3="ID_07_neutral.jpg"
/4="ID_20_neutral.jpg"
/5="ID_23_neutral.jpg"
/6="ID_38_neutral.jpg"
/7="ID_46_neutral.jpg"
/8="ID_49_neutral.jpg"
/9="ID_71_neutral.jpg"
</item>

<list targetPos>
/ items = (1,2,3,4,5,6,7,8,9)
/ selectionrate = trial
/ replace = false
</list>

<list distractorPos>
/ items = (1,2,3,4,5,6,7,8,9)
/ selectionrate = always
/ replace = false
/ not = (list.targetPos.currentvalue)
</list>

<list xPos>
/items = (35%,35%,35%,50%,50%,50%,65%,65%,65%)
</list>

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

<list target>
/items=(1,2,3,4,5,6,7,8,9)
</list>

<list distractors>
/items=(1,2,3,4,5,6,7,8,9)
/ selectionrate = always
/ not = (list.target.currentvalue)
</list>

<text target>
/ items = fearful
/ select=list.target.nextvalue
/ size = (parameters.picSize, parameters.picSize)
/ txcolor = red
</text>

<text distractor1>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor2>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor3>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor4>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor5>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor6>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor7>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<text distractor8>
/ items = neutral
/ select=list.distractors.nextvalue
/ size = (parameters.picSize, parameters.picSize)
</text>

<trial fearful>
/ ontrialbegin = [
list.distractorPos.reset();
    list.distractors.reset();
    
text.target.hposition=list.xPos.item(list.targetPos.nextvalue);
text.target.vposition=list.yPos.item(list.targetPos.currentvalue);
    
text.distractor1.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor1.vposition = list.yPos.item(list.distractorPos.currentvalue);
    
text.distractor2.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor2.vposition = list.yPos.item(list.distractorPos.currentvalue);
    
text.distractor3.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor3.vposition = list.yPos.item(list.distractorPos.currentvalue);
    
text.distractor4.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor4.vposition = list.yPos.item(list.distractorPos.currentvalue);
    
text.distractor5.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor5.vposition = list.yPos.item(list.distractorPos.currentvalue);
    
text.distractor6.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor6.vposition = list.yPos.item(list.distractorPos.currentvalue);

text.distractor7.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor7.vposition = list.yPos.item(list.distractorPos.currentvalue);

text.distractor8.hposition = list.xPos.item(list.distractorPos.nextvalue);
text.distractor8.vposition = list.yPos.item(list.distractorPos.currentvalue);
]
/stimulustimes = [0=clearscreen, target, distractor1, distractor2, distractor3, distractor4, distractor5, distractor6, distractor7, distractor8]
/ validresponse = (" ")
</trial>

<block doIt>
/ trials = [1-9=noreplace(fearful)]
</block>

Dave – you’re a legend! Thanks so much for your help. FYI the reason for the multiple-list design was simply my lack of coding skills, so I really appreciate your extra advice too!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search