Millisecond Forums

Items Selection Based on Block

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

By ldb24 - 1/30/2020

I have a task where I have 3 lists of images: practice images, familiar images, and novel images. I run 3 blocks, 1 practice then counterbalance the order of the familiar and novel image blocks. On a trial, they will see 4 items, then select which one changes after a brief interval (so a new object on each trial).


What I'd like to do is set up 5 picture elements, one for each object and then one for the new object, and have the items selection based on the condition. I thought I could make a value that I set at the start of each block that has the stimulus items list name that I could put under items for a picture element. This is a rough version of what I was thinking:

<item practice>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
</item>

<item familiar>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
</item>

<item novel>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
</item>

<picture object1>
/ items = values.currentStimSet
/select = values.object1
/hposition = values.object1_x
/vposition = values.object1_y
/size = (300,300)
</picture>

(etc.)

<block instructions>
/trials = [1 = instructions1; 2 = instructions2; 3 = instructions3]
</block>

<block practice>
/onblockbegin = [values.practice = 1; values.currentStimSet = "practice"]
/ recorddata = false
/trials = [1-6 = start]
</block>

<block familiar>
/onblockbegin = [values.practice = 0; values.currentStimSet = "familiar"]
/ trials = [1-72 = start]
</block>

<block novel>
/onblockbegin = [values.practice = 0; values.currentStimSet = "novel"]
/ trials = [1-72 = start]
</block>

<expt familiarFirst>
/ subjects = (1 of 2)
/ groupassignment = random
/postinstructions = (end)
/blocks = [1 = instructions; 1 = practice; 1 = familiar; 1 = novel]
</expt>

<expt novelFirst>
/ subjects = (2 of 2)
/ groupassignment = random
/postinstructions = (end)
/blocks = [1 = instructions; 1 = practice; 1 = novel; 1 = familiar]
</expt>

When I do this, I get an error for picture.object1 "Could not locate item values.currentStimSet" (it is listed under values and spelled correctly). Is there a way to do this so that I don't have to create 5 picture elements for each stimulus type? I feel like I'm missing something simple with "/items =" that would allow me to use a value element. 

Thank you!
By Dave - 1/30/2020

ldb24 - 1/30/2020
I have a task where I have 3 lists of images: practice images, familiar images, and novel images. I run 3 blocks, 1 practice then counterbalance the order of the familiar and novel image blocks. On a trial, they will see 4 items, then select which one changes after a brief interval (so a new object on each trial).


What I'd like to do is set up 5 picture elements, one for each object and then one for the new object, and have the items selection based on the condition. I thought I could make a value that I set at the start of each block that has the stimulus items list name that I could put under items for a picture element. This is a rough version of what I was thinking:

<item practice>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
</item>

<item familiar>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
</item>

<item novel>
/1 = "pic1.jpg"
/2 = "pic2.jpg"
/3 = "pic3.jpg"
/4 = "pic4.jpg"
/5 = "pic5.jpg"
</item>

<picture object1>
/ items = values.currentStimSet
/select = values.object1
/hposition = values.object1_x
/vposition = values.object1_y
/size = (300,300)
</picture>

(etc.)

<block instructions>
/trials = [1 = instructions1; 2 = instructions2; 3 = instructions3]
</block>

<block practice>
/onblockbegin = [values.practice = 1; values.currentStimSet = "practice"]
/ recorddata = false
/trials = [1-6 = start]
</block>

<block familiar>
/onblockbegin = [values.practice = 0; values.currentStimSet = "familiar"]
/ trials = [1-72 = start]
</block>

<block novel>
/onblockbegin = [values.practice = 0; values.currentStimSet = "novel"]
/ trials = [1-72 = start]
</block>

<expt familiarFirst>
/ subjects = (1 of 2)
/ groupassignment = random
/postinstructions = (end)
/blocks = [1 = instructions; 1 = practice; 1 = familiar; 1 = novel]
</expt>

<expt novelFirst>
/ subjects = (2 of 2)
/ groupassignment = random
/postinstructions = (end)
/blocks = [1 = instructions; 1 = practice; 1 = novel; 1 = familiar]
</expt>

When I do this, I get an error for picture.object1 "Could not locate item values.currentStimSet" (it is listed under values and spelled correctly). Is there a way to do this so that I don't have to create 5 picture elements for each stimulus type? I feel like I'm missing something simple with "/items =" that would allow me to use a value element. 

Thank you!

You need to put all the images in a single <item> element. You can then select the item set using <list> elements holding the respective item numbers constituting a given set. Here's a basic illustration:

<text object1>
/items = allitems
/select = values.object1
</text>


<item allitems>
/1 = "f_pic1.jpg"
/2 = "f_pic2.jpg"
/3 = "f_pic3.jpg"
/4 = "f_pic4.jpg"
/5 = "f_pic5.jpg"

/6 = "n_pic1.jpg"
/7 = "n_pic2.jpg"
/8 = "n_pic3.jpg"
/9 = "n_pic4.jpg"
/10 = "n_pic5.jpg"
</item>

// familiar items are items 1 to 5
<list familiar_items>
/ items = (1,2,3,4,5)
</list>

// novel items are items 6 to 10
<list novel_items>
/ items = (6,7,8,9,10)
</list>

<list setlist>
/ items = (list.familiar_items.nextvalue, list.novel_items.nextvalue)
/ selectionmode = values.stimset
</list>

<values>
/ stimset = 1
/ object1 = 1
</values>

<trial mytrial>
/ ontrialbegin = [
    values.object1 = list.setlist.nextvalue;
]
/ stimulusframes = [1=object1]
/ validresponse = (57)
</trial>

<block familiar>
/ onblockbegin = [
    values.stimset = 1;
]
/ trials = [1-5 = mytrial]
</block>

<block novel>
/ onblockbegin = [
    values.stimset = 2;
]
/ trials = [1-5 = mytrial]
</block>

<expt>
/ subjects = (1 of 2)
/ groupassignment = groupnumber
/ blocks = [1=familiar; 2=novel]
</expt>

<expt>
/ subjects = (2 of 2)
/ groupassignment = groupnumber
/ blocks = [1=novel; 2=familiar]
</expt>