Millisecond Forums

list selection

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

By tecnika - 9/13/2018

Hello David,

I would need to select a sequence of picture a list if a condition is verified, otherwise another list.

I have tried this

<picture Visual_Cue>
/ items = Visual_Cue
/ size = (25%, 25%)
/ hposition = values.x
/ vposition = values.y
/ dropsource = true
/ select = [if (dropdown.CueOrder.response == "random") list.Cue_random.nextvalue;
else if (dropdown.CueOrder.response == "predetermined") list.Cue_sequence.nextvalue]
</picture>


but it does not work ... this was my interpretation of dependency that I could not find anywhere...
/ select = dependency(listname) 

Shall I do a list of a list?
By Dave - 9/14/2018

tecnika - Friday, September 14, 2018
Hello David,

I would need to select a sequence of picture a list if a condition is verified, otherwise another list.

I have tried this

<picture Visual_Cue>
/ items = Visual_Cue
/ size = (25%, 25%)
/ hposition = values.x
/ vposition = values.y
/ dropsource = true
/ select = [if (dropdown.CueOrder.response == "random") list.Cue_random.nextvalue;
else if (dropdown.CueOrder.response == "predetermined") list.Cue_sequence.nextvalue]
</picture>


but it does not work ... this was my interpretation of dependency that I could not find anywhere...
/ select = dependency(listname) 

Shall I do a list of a list?

Yes, using a "list of lists" is the right approach, i.e. do something like this:

<values>
/ listnumber = 1
</values>

<list mainlist>
/ items = (list.randomorder.nextvalue, list.fixedorder.nextvalue)
/ selectionmode = values.listnumber
</list>

<list randomorder>
/ items = (1,2,3,4)
/ selectionmode = random
</list>

<list fixedorder>
/ items = (1,2,3,4)
/ selectionmode = sequence
</list>

<surveypage selectorder>
/ ontrialend = [
    values.listnumber = dropdown.order.response;
]
/ questions = [1=order]
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<dropdown order>
/ caption = "Select the order:"
/ options = ("random", "fixed")
/ optionvalues = ("1", "2")
</dropdown>

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

<text mytext>
/ items = ("A", "B", "C", "D")
/ select = list.mainlist.nextvalue
</text>

<block myblock>
/ trials = [1=selectorder; 2-5 = mytrial]
</block>