Millisecond Forums

Trouble randomly selecting items from more than one list

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

By mvanrooij - 8/25/2015

Hi, I'm new to Inquest so please forgive my ignorance.
I'm trying to present stimuli in the following form 'a + b = ' and collect an open-ended response. I have specified two lists with the numbers 'a' and 'b' as follows:

<list firstnumbers>
/ items = (0,1,1, 1, 3, 3, etc.)
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = (1,1,1, 2, 2, 2, etc.)
/ selectionmode = sequence
</list>

Through an expression 'generatemathproblems', I generate the strings 'a + b = ' and this works fine. However, what I would like to do is not to select the numbers 'a' and 'b' in sequence, but randomly while preserving the correspondence between the numbers 'a' and 'b'. In other words, if say, the fourth item is selected for 'a', then I want 'b' to be the fourth item too; the fourth however should be randomly chosen. I tried to make a list 'stimulustracker' with a randomly chosen index between 1 and the maxnumberstimuli but list doesn't seem to support 'select':

<list stimulustracker>
/ poolsize = values.maxnumberstimuli
</list>

<list firstnumbers>
/ items = (0,1,1, 1, 3, 3, etc.)
/ select = list.stimulustracker.nextindex
</lis>

<list secondnumbers>
/ items = (1,1,1, 2, 2, 2, etc.)
/ select = list.stimulustracker.currentindex
</list>

Does anyone know how to solve this problem? Thanks a bunch!
--Marieke
By Dave - 8/25/2015

#1: Your <list> syntax is off. There is no /select attribute for <list> elements, the correct attribute is /selectionmode. That's why your syntax does not work, the <list>s are not paired.

#2: You don't need a 3rd list to serve as index into the other two lists. You simply do:

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

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<list firstnumbers>
/ items = (0,1,1,1,3,3)
/ selectionmode = random
</list>

<list secondnumbers>
/ items = (1,1,1,2,2,2)
/ selectionmode = list.firstnumbers.currentindex
</list>

<text mytext>
/ items = ("<%list.firstnumbers.nextvalue%> + <%list.secondnumbers.nextvalue%> = ?")
</text>

By mvanrooij - 8/26/2015

It works! Thanks so much :)