Millisecond Forums

Selecting from different lists depending on trial name

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

By drivas - 8/12/2014

Hi!

I am looking for a way to make a picture element select from a different list depending on a trial name. For example I have two lists:

<list A>
/items= (2, 5, 8, 1)
</list>

<list B>
/ items = (3, 6, 4, 10)
</list>

And my picture element looks like this:

<picture stim>
/items = mypictures
/select = <% list.listA.nextvalue %>
</picture>

Would there be a way to dynamically change the "select" mode to <%list.listB.nextvalue%> with an /ontrialbegin clause? Is there another way? I could always hard code them but since my pictures can be either on the left or on the right, from category X or Y, and finally from pool A or B of a category, this would yield 2^3 picture elements with basically the same code which just seems like very bad programming to me.

By Dave - 8/12/2014

Sure. You simply do

<values>
/ myvalue = 1
</values>

<picture stim>
/items = mypictures
/select = values.myvalue
</picture>

<trial Atrial>
/ ontrialbegin = [values.myvalue=list.A.nextvalue]
...
</trial>

<trial Btrial>
/ ontrialbegin = [values.myvalue=list.B.nextvalue]
...
</trial>
By drivas - 8/12/2014

Wow. Thanks again for the fast reply!
By drivas - 8/12/2014

I just realized something with my script. In fact, during the trial (which is actually a surveypage), I display two stimuli simultaneously and ask the subject to rate the similarity using a slider. This means that during a trial, I must fetch two picture elements, and thus using a value would make my script simply select the same image again.

<surveypage page>
/stimulustimes= [0=pictureLeft, pictureRight]
...
</surveypage>

<picture pictureLeft>
/items= mypictures
/select = values.myvalue
...
</picture>

<picture pictureRight>
/items= mypictures
/select = values.myvalue
...
</picture>

I would like my script to select the next value in the list after list.listA(or B).nextvalue.
By Dave - 8/12/2014

You need to set the <list>s' /selectionrate appropriately, i.e. to 'always'. See the documentation for said attribute for details. In addition, you need two <values> entries. One for the left pic, another for the right. Populate them from the <list> /ontrialbegin as needed.