Presenting multiple image at once


Author
Message
otago
otago
Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)
Group: Forum Members
Posts: 2, Visits: 7
Dave - Wednesday, January 2, 2019
Dave - Wednesday, January 2, 2019
otago - Wednesday, January 2, 2019
Hi,

I am trying to create a trial that will show 7 images and 3 random images at all once on different location, then a fixation, and a red dot. My script so far only works when I only isted 3 random images but I need add more random images (I am new to programming). Is there a way always to select 7 images from the pool A and 3 random images from pool B?

Thank you.


You'll want to set up 7 <picture> elements that draw from pool A, and 3 that draw from pool B. This can be done using <list> elements for selection. You then (perhaps) want to randomize the location of those 10 <picture> elements on a trial by trial basis. (I say "perhaps" because that's not entirely clear from your description), This, too, can be achieved using <list> elements. Here's an example using <text> elements, it works the same way with <picture> elements:

<values>
/ a1 = 1
/ a1x = 0%
/ a1y = 0%
/ a2 = 1
/ a2x = 0%
/ a2y = 0%
/ a3 = 1
/ a3x = 0%
/ a3y = 0%
/ a4 = 1
/ a4x = 0%
/ a4y = 0%
/ a5 = 1
/ a5x = 0%
/ a5y = 0%
/ a6 = 1
/ a6x = 0%
/ a6y = 0%
/ a7 = 1
/ a7x = 0%
/ a7y = 0%

/ b1 = 1
/ b1x = 0%
/ b1y = 0%
/ b2 = 1
/ b2x = 0%
/ b2y = 0%
/ b3 = 1
/ b3x = 0%
/ b3y = 0%
</values>

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

<trial mytrial>
/ ontrialbegin = [
values.a1 = list.aitemnumbers.nextindex;
values.a1x = list.xpos.nextvalue;
values.a1y = list.ypos.nextvalue;
values.a2 = list.aitemnumbers.nextindex;
values.a2x = list.xpos.nextvalue;
values.a2y = list.ypos.nextvalue;
values.a3 = list.aitemnumbers.nextindex;
values.a3x = list.xpos.nextvalue;
values.a3y = list.ypos.nextvalue;
values.a4 = list.aitemnumbers.nextindex;
values.a4x = list.xpos.nextvalue;
values.a4y = list.ypos.nextvalue;
values.a5 = list.aitemnumbers.nextindex;
values.a5x = list.xpos.nextvalue;
values.a5y = list.ypos.nextvalue;
values.a6 = list.aitemnumbers.nextindex;
values.a6x = list.xpos.nextvalue;
values.a6y = list.ypos.nextvalue;
values.a7 = list.aitemnumbers.nextindex;
values.a7x = list.xpos.nextvalue;
values.a7y = list.ypos.nextvalue;

values.b1 = list.bitemnumbers.nextindex;
values.b1x = list.xpos.nextvalue;
values.b1y = list.ypos.nextvalue;
values.b2 = list.bitemnumbers.nextindex;
values.b2x = list.xpos.nextvalue;
values.b2y = list.ypos.nextvalue;
values.b3 = list.bitemnumbers.nextindex;
values.b3x = list.xpos.nextvalue;
values.b3y = list.ypos.nextvalue;
]
/ stimulustimes = [0=a1,a2,a3,a4,a5,a6,a7,b1,b2,b3]
/ validresponse = (57)
</trial>

<text a1>
/ items = poolaitems
/ select = values.a1
/ hposition = values.a1x
/ vposition = values.a1y
</text>

<text a2>
/ items = poolaitems
/ select = values.a2
/ hposition = values.a2x
/ vposition = values.a2y
</text>

<text a3>
/ items = poolaitems
/ select = values.a3
/ hposition = values.a3x
/ vposition = values.a3y
</text>

<text a4>
/ items = poolaitems
/ select = values.a4
/ hposition = values.a4x
/ vposition = values.a4y
</text>

<text a5>
/ items = poolaitems
/ select = values.a5
/ hposition = values.a5x
/ vposition = values.a5y
</text>

<text a6>
/ items = poolaitems
/ select = values.a6
/ hposition = values.a6x
/ vposition = values.a6y
</text>

<text a7>
/ items = poolaitems
/ select = values.a7
/ hposition = values.a7x
/ vposition = values.a7y
</text>

<text b1>
/ items = poolbitems
/ select = values.b1
/ hposition = values.b1x
/ vposition = values.b1y
</text>

<text b2>
/ items = poolbitems
/ select = values.b2
/ hposition = values.b2x
/ vposition = values.b2y
</text>

<text b3>
/ items = poolbitems
/ select = values.b3
/ hposition = values.b3x
/ vposition = values.b3y
</text>

<item poolaitems>
/ 1 = "A01"
/ 2 = "A02"
/ 3 = "A03"
/ 4 = "A04"
/ 5 = "A05"
/ 6 = "A06"
/ 7 = "A07"
/ 8 = "A08"
/ 9 = "A09"
/ 10 = "A10"
/ 11 = "A11"
/ 12 = "A12"
/ 13 = "A13"
/ 14 = "A14"
/ 15 = "A15"
/ 16 = "A16"
/ 17 = "A17"
/ 18 = "A18"
/ 19 = "A19"
/ 20 = "A20"
/ 21 = "A21"
</item>

<item poolbitems>
/ 1 = "B01"
/ 2 = "B02"
/ 3 = "B03"
/ 4 = "B04"
/ 5 = "B05"
/ 6 = "B06"
/ 7 = "B07"
/ 8 = "B08"
/ 9 = "B09"
</item>

//21 items in pool A in this example
<list aitemnumbers>
/ poolsize = 21
/ selectionrate = always
</list>

//9 items in pool B in this example
<list bitemnumbers>
/ poolsize = 9
/ selectionrate = always
</list>

//10 screen positions expressed as pairs of X and Y coordinates
<list xpos>
/ items = (10%, 30%, 50%, 70%, 90%, 10%, 30%, 50%, 70%, 90%)
/ selectionmode = random
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 25%, 25%, 25%, 75%, 75%, 75%, 75%, 75%)
/ selectionmode = list.xpos.currentindex
/ selectionrate = always
</list>





And if your items in pool A are composed of different sets (i.e. 7 specific items belong together and should be shown together in a given trial), that's possible as well along the same lines.

<values>
/ aset = 1

/ a1 = 1
/ a1x = 0%
/ a1y = 0%
/ a2 = 1
/ a2x = 0%
/ a2y = 0%
/ a3 = 1
/ a3x = 0%
/ a3y = 0%
/ a4 = 1
/ a4x = 0%
/ a4y = 0%
/ a5 = 1
/ a5x = 0%
/ a5y = 0%
/ a6 = 1
/ a6x = 0%
/ a6y = 0%
/ a7 = 1
/ a7x = 0%
/ a7y = 0%

/ b1 = 1
/ b1x = 0%
/ b1y = 0%
/ b2 = 1
/ b2x = 0%
/ b2y = 0%
/ b3 = 1
/ b3x = 0%
/ b3y = 0%
</values>

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

<trial mytrial>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.aitemnumbers.nextvalue;
values.a1x = list.xpos.nextvalue;
values.a1y = list.ypos.nextvalue;
values.a2 = list.aitemnumbers.nextvalue;
values.a2x = list.xpos.nextvalue;
values.a2y = list.ypos.nextvalue;
values.a3 = list.aitemnumbers.nextvalue;
values.a3x = list.xpos.nextvalue;
values.a3y = list.ypos.nextvalue;
values.a4 = list.aitemnumbers.nextvalue;
values.a4x = list.xpos.nextvalue;
values.a4y = list.ypos.nextvalue;
values.a5 = list.aitemnumbers.nextvalue;
values.a5x = list.xpos.nextvalue;
values.a5y = list.ypos.nextvalue;
values.a6 = list.aitemnumbers.nextvalue;
values.a6x = list.xpos.nextvalue;
values.a6y = list.ypos.nextvalue;
values.a7 = list.aitemnumbers.nextvalue;
values.a7x = list.xpos.nextvalue;
values.a7y = list.ypos.nextvalue;

values.b1 = list.bitemnumbers.nextindex;
values.b1x = list.xpos.nextvalue;
values.b1y = list.ypos.nextvalue;
values.b2 = list.bitemnumbers.nextindex;
values.b2x = list.xpos.nextvalue;
values.b2y = list.ypos.nextvalue;
values.b3 = list.bitemnumbers.nextindex;
values.b3x = list.xpos.nextvalue;
values.b3y = list.ypos.nextvalue;
]
/ stimulustimes = [0=a1,a2,a3,a4,a5,a6,a7,b1,b2,b3]
/ validresponse = (57)
</trial>

<text a1>
/ items = poolaitems
/ select = values.a1
/ hposition = values.a1x
/ vposition = values.a1y
</text>

<text a2>
/ items = poolaitems
/ select = values.a2
/ hposition = values.a2x
/ vposition = values.a2y
</text>

<text a3>
/ items = poolaitems
/ select = values.a3
/ hposition = values.a3x
/ vposition = values.a3y
</text>

<text a4>
/ items = poolaitems
/ select = values.a4
/ hposition = values.a4x
/ vposition = values.a4y
</text>

<text a5>
/ items = poolaitems
/ select = values.a5
/ hposition = values.a5x
/ vposition = values.a5y
</text>

<text a6>
/ items = poolaitems
/ select = values.a6
/ hposition = values.a6x
/ vposition = values.a6y
</text>

<text a7>
/ items = poolaitems
/ select = values.a7
/ hposition = values.a7x
/ vposition = values.a7y
</text>

<text b1>
/ items = poolbitems
/ select = values.b1
/ hposition = values.b1x
/ vposition = values.b1y
</text>

<text b2>
/ items = poolbitems
/ select = values.b2
/ hposition = values.b2x
/ vposition = values.b2y
</text>

<text b3>
/ items = poolbitems
/ select = values.b3
/ hposition = values.b3x
/ vposition = values.b3y
</text>

<item poolaitems>
/ 1 = "A1_01"
/ 2 = "A1_02"
/ 3 = "A1_03"
/ 4 = "A1_04"
/ 5 = "A1_05"
/ 6 = "A1_06"
/ 7 = "A1_07"

/ 8 = "A2_01"
/ 9 = "A2_02"
/ 10 = "A2_03"
/ 11 = "A2_04"
/ 12 = "A2_05"
/ 13 = "A2_06"
/ 14 = "A2_07"

/ 15 = "A3_01"
/ 16 = "A3_02"
/ 17 = "A3_03"
/ 18 = "A3_04"
/ 19 = "A3_05"
/ 20 = "A3_06"
/ 21 = "A3_07"
</item>

<item poolbitems>
/ 1 = "B01"
/ 2 = "B02"
/ 3 = "B03"
/ 4 = "B04"
/ 5 = "B05"
/ 6 = "B06"
/ 7 = "B07"
/ 8 = "B08"
/ 9 = "B09"
</item>


<list aitemnumbers>
/ items = (list.a_set1.nextvalue, list.a_set2.nextvalue, list.a_set3.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list asetnumbers>
/ poolsize = 3
</list>

//set #1 is composed of items 1 to 7
<list a_set1>
/ items = (1,2,3,4,5,6,7)
/ selectionrate = always
</list>

//set #2 is composed of items 8 to 14
<list a_set2>
/ items = (8,9,10,11,12,13,14)
/ selectionrate = always
</list>

//set #3 is composed of items 15 to 21
<list a_set3>
/ items = (15,16,17,18,19,20,21)
/ selectionrate = always
</list>

//9 items in pool B in this example
<list bitemnumbers>
/ poolsize = 9
/ selectionrate = always
</list>

//10 screen positions expressed as pairs of X and Y coordinates
<list xpos>
/ items = (10%, 30%, 50%, 70%, 90%, 10%, 30%, 50%, 70%, 90%)
/ selectionmode = random
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 25%, 25%, 25%, 75%, 75%, 75%, 75%, 75%)
/ selectionmode = list.xpos.currentindex
/ selectionrate = always
</list>


Hi Dave,

This is exactly what I want to do.

Thank you very much.

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
Dave - Wednesday, January 2, 2019
otago - Wednesday, January 2, 2019
Hi,

I am trying to create a trial that will show 7 images and 3 random images at all once on different location, then a fixation, and a red dot. My script so far only works when I only isted 3 random images but I need add more random images (I am new to programming). Is there a way always to select 7 images from the pool A and 3 random images from pool B?

Thank you.


You'll want to set up 7 <picture> elements that draw from pool A, and 3 that draw from pool B. This can be done using <list> elements for selection. You then (perhaps) want to randomize the location of those 10 <picture> elements on a trial by trial basis. (I say "perhaps" because that's not entirely clear from your description), This, too, can be achieved using <list> elements. Here's an example using <text> elements, it works the same way with <picture> elements:

<values>
/ a1 = 1
/ a1x = 0%
/ a1y = 0%
/ a2 = 1
/ a2x = 0%
/ a2y = 0%
/ a3 = 1
/ a3x = 0%
/ a3y = 0%
/ a4 = 1
/ a4x = 0%
/ a4y = 0%
/ a5 = 1
/ a5x = 0%
/ a5y = 0%
/ a6 = 1
/ a6x = 0%
/ a6y = 0%
/ a7 = 1
/ a7x = 0%
/ a7y = 0%

/ b1 = 1
/ b1x = 0%
/ b1y = 0%
/ b2 = 1
/ b2x = 0%
/ b2y = 0%
/ b3 = 1
/ b3x = 0%
/ b3y = 0%
</values>

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

<trial mytrial>
/ ontrialbegin = [
values.a1 = list.aitemnumbers.nextindex;
values.a1x = list.xpos.nextvalue;
values.a1y = list.ypos.nextvalue;
values.a2 = list.aitemnumbers.nextindex;
values.a2x = list.xpos.nextvalue;
values.a2y = list.ypos.nextvalue;
values.a3 = list.aitemnumbers.nextindex;
values.a3x = list.xpos.nextvalue;
values.a3y = list.ypos.nextvalue;
values.a4 = list.aitemnumbers.nextindex;
values.a4x = list.xpos.nextvalue;
values.a4y = list.ypos.nextvalue;
values.a5 = list.aitemnumbers.nextindex;
values.a5x = list.xpos.nextvalue;
values.a5y = list.ypos.nextvalue;
values.a6 = list.aitemnumbers.nextindex;
values.a6x = list.xpos.nextvalue;
values.a6y = list.ypos.nextvalue;
values.a7 = list.aitemnumbers.nextindex;
values.a7x = list.xpos.nextvalue;
values.a7y = list.ypos.nextvalue;

values.b1 = list.bitemnumbers.nextindex;
values.b1x = list.xpos.nextvalue;
values.b1y = list.ypos.nextvalue;
values.b2 = list.bitemnumbers.nextindex;
values.b2x = list.xpos.nextvalue;
values.b2y = list.ypos.nextvalue;
values.b3 = list.bitemnumbers.nextindex;
values.b3x = list.xpos.nextvalue;
values.b3y = list.ypos.nextvalue;
]
/ stimulustimes = [0=a1,a2,a3,a4,a5,a6,a7,b1,b2,b3]
/ validresponse = (57)
</trial>

<text a1>
/ items = poolaitems
/ select = values.a1
/ hposition = values.a1x
/ vposition = values.a1y
</text>

<text a2>
/ items = poolaitems
/ select = values.a2
/ hposition = values.a2x
/ vposition = values.a2y
</text>

<text a3>
/ items = poolaitems
/ select = values.a3
/ hposition = values.a3x
/ vposition = values.a3y
</text>

<text a4>
/ items = poolaitems
/ select = values.a4
/ hposition = values.a4x
/ vposition = values.a4y
</text>

<text a5>
/ items = poolaitems
/ select = values.a5
/ hposition = values.a5x
/ vposition = values.a5y
</text>

<text a6>
/ items = poolaitems
/ select = values.a6
/ hposition = values.a6x
/ vposition = values.a6y
</text>

<text a7>
/ items = poolaitems
/ select = values.a7
/ hposition = values.a7x
/ vposition = values.a7y
</text>

<text b1>
/ items = poolbitems
/ select = values.b1
/ hposition = values.b1x
/ vposition = values.b1y
</text>

<text b2>
/ items = poolbitems
/ select = values.b2
/ hposition = values.b2x
/ vposition = values.b2y
</text>

<text b3>
/ items = poolbitems
/ select = values.b3
/ hposition = values.b3x
/ vposition = values.b3y
</text>

<item poolaitems>
/ 1 = "A01"
/ 2 = "A02"
/ 3 = "A03"
/ 4 = "A04"
/ 5 = "A05"
/ 6 = "A06"
/ 7 = "A07"
/ 8 = "A08"
/ 9 = "A09"
/ 10 = "A10"
/ 11 = "A11"
/ 12 = "A12"
/ 13 = "A13"
/ 14 = "A14"
/ 15 = "A15"
/ 16 = "A16"
/ 17 = "A17"
/ 18 = "A18"
/ 19 = "A19"
/ 20 = "A20"
/ 21 = "A21"
</item>

<item poolbitems>
/ 1 = "B01"
/ 2 = "B02"
/ 3 = "B03"
/ 4 = "B04"
/ 5 = "B05"
/ 6 = "B06"
/ 7 = "B07"
/ 8 = "B08"
/ 9 = "B09"
</item>

//21 items in pool A in this example
<list aitemnumbers>
/ poolsize = 21
/ selectionrate = always
</list>

//9 items in pool B in this example
<list bitemnumbers>
/ poolsize = 9
/ selectionrate = always
</list>

//10 screen positions expressed as pairs of X and Y coordinates
<list xpos>
/ items = (10%, 30%, 50%, 70%, 90%, 10%, 30%, 50%, 70%, 90%)
/ selectionmode = random
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 25%, 25%, 25%, 75%, 75%, 75%, 75%, 75%)
/ selectionmode = list.xpos.currentindex
/ selectionrate = always
</list>





And if your items in pool A are composed of different sets (i.e. 7 specific items belong together and should be shown together in a given trial), that's possible as well along the same lines.

<values>
/ aset = 1

/ a1 = 1
/ a1x = 0%
/ a1y = 0%
/ a2 = 1
/ a2x = 0%
/ a2y = 0%
/ a3 = 1
/ a3x = 0%
/ a3y = 0%
/ a4 = 1
/ a4x = 0%
/ a4y = 0%
/ a5 = 1
/ a5x = 0%
/ a5y = 0%
/ a6 = 1
/ a6x = 0%
/ a6y = 0%
/ a7 = 1
/ a7x = 0%
/ a7y = 0%

/ b1 = 1
/ b1x = 0%
/ b1y = 0%
/ b2 = 1
/ b2x = 0%
/ b2y = 0%
/ b3 = 1
/ b3x = 0%
/ b3y = 0%
</values>

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

<trial mytrial>
/ ontrialbegin = [
values.aset = list.asetnumbers.nextindex;
values.a1 = list.aitemnumbers.nextvalue;
values.a1x = list.xpos.nextvalue;
values.a1y = list.ypos.nextvalue;
values.a2 = list.aitemnumbers.nextvalue;
values.a2x = list.xpos.nextvalue;
values.a2y = list.ypos.nextvalue;
values.a3 = list.aitemnumbers.nextvalue;
values.a3x = list.xpos.nextvalue;
values.a3y = list.ypos.nextvalue;
values.a4 = list.aitemnumbers.nextvalue;
values.a4x = list.xpos.nextvalue;
values.a4y = list.ypos.nextvalue;
values.a5 = list.aitemnumbers.nextvalue;
values.a5x = list.xpos.nextvalue;
values.a5y = list.ypos.nextvalue;
values.a6 = list.aitemnumbers.nextvalue;
values.a6x = list.xpos.nextvalue;
values.a6y = list.ypos.nextvalue;
values.a7 = list.aitemnumbers.nextvalue;
values.a7x = list.xpos.nextvalue;
values.a7y = list.ypos.nextvalue;

values.b1 = list.bitemnumbers.nextindex;
values.b1x = list.xpos.nextvalue;
values.b1y = list.ypos.nextvalue;
values.b2 = list.bitemnumbers.nextindex;
values.b2x = list.xpos.nextvalue;
values.b2y = list.ypos.nextvalue;
values.b3 = list.bitemnumbers.nextindex;
values.b3x = list.xpos.nextvalue;
values.b3y = list.ypos.nextvalue;
]
/ stimulustimes = [0=a1,a2,a3,a4,a5,a6,a7,b1,b2,b3]
/ validresponse = (57)
</trial>

<text a1>
/ items = poolaitems
/ select = values.a1
/ hposition = values.a1x
/ vposition = values.a1y
</text>

<text a2>
/ items = poolaitems
/ select = values.a2
/ hposition = values.a2x
/ vposition = values.a2y
</text>

<text a3>
/ items = poolaitems
/ select = values.a3
/ hposition = values.a3x
/ vposition = values.a3y
</text>

<text a4>
/ items = poolaitems
/ select = values.a4
/ hposition = values.a4x
/ vposition = values.a4y
</text>

<text a5>
/ items = poolaitems
/ select = values.a5
/ hposition = values.a5x
/ vposition = values.a5y
</text>

<text a6>
/ items = poolaitems
/ select = values.a6
/ hposition = values.a6x
/ vposition = values.a6y
</text>

<text a7>
/ items = poolaitems
/ select = values.a7
/ hposition = values.a7x
/ vposition = values.a7y
</text>

<text b1>
/ items = poolbitems
/ select = values.b1
/ hposition = values.b1x
/ vposition = values.b1y
</text>

<text b2>
/ items = poolbitems
/ select = values.b2
/ hposition = values.b2x
/ vposition = values.b2y
</text>

<text b3>
/ items = poolbitems
/ select = values.b3
/ hposition = values.b3x
/ vposition = values.b3y
</text>

<item poolaitems>
/ 1 = "A1_01"
/ 2 = "A1_02"
/ 3 = "A1_03"
/ 4 = "A1_04"
/ 5 = "A1_05"
/ 6 = "A1_06"
/ 7 = "A1_07"

/ 8 = "A2_01"
/ 9 = "A2_02"
/ 10 = "A2_03"
/ 11 = "A2_04"
/ 12 = "A2_05"
/ 13 = "A2_06"
/ 14 = "A2_07"

/ 15 = "A3_01"
/ 16 = "A3_02"
/ 17 = "A3_03"
/ 18 = "A3_04"
/ 19 = "A3_05"
/ 20 = "A3_06"
/ 21 = "A3_07"
</item>

<item poolbitems>
/ 1 = "B01"
/ 2 = "B02"
/ 3 = "B03"
/ 4 = "B04"
/ 5 = "B05"
/ 6 = "B06"
/ 7 = "B07"
/ 8 = "B08"
/ 9 = "B09"
</item>


<list aitemnumbers>
/ items = (list.a_set1.nextvalue, list.a_set2.nextvalue, list.a_set3.nextvalue)
/ selectionmode = values.aset
/ selectionrate = always
</list>

<list asetnumbers>
/ poolsize = 3
</list>

//set #1 is composed of items 1 to 7
<list a_set1>
/ items = (1,2,3,4,5,6,7)
/ selectionrate = always
</list>

//set #2 is composed of items 8 to 14
<list a_set2>
/ items = (8,9,10,11,12,13,14)
/ selectionrate = always
</list>

//set #3 is composed of items 15 to 21
<list a_set3>
/ items = (15,16,17,18,19,20,21)
/ selectionrate = always
</list>

//9 items in pool B in this example
<list bitemnumbers>
/ poolsize = 9
/ selectionrate = always
</list>

//10 screen positions expressed as pairs of X and Y coordinates
<list xpos>
/ items = (10%, 30%, 50%, 70%, 90%, 10%, 30%, 50%, 70%, 90%)
/ selectionmode = random
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 25%, 25%, 25%, 75%, 75%, 75%, 75%, 75%)
/ selectionmode = list.xpos.currentindex
/ selectionrate = always
</list>



Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
otago - Wednesday, January 2, 2019
Hi,

I am trying to create a trial that will show 7 images and 3 random images at all once on different location, then a fixation, and a red dot. My script so far only works when I only isted 3 random images but I need add more random images (I am new to programming). Is there a way always to select 7 images from the pool A and 3 random images from pool B?

Thank you.


You'll want to set up 7 <picture> elements that draw from pool A, and 3 that draw from pool B. This can be done using <list> elements for selection. You then (perhaps) want to randomize the location of those 10 <picture> elements on a trial by trial basis. (I say "perhaps" because that's not entirely clear from your description), This, too, can be achieved using <list> elements. Here's an example using <text> elements, it works the same way with <picture> elements:

<values>
/ a1 = 1
/ a1x = 0%
/ a1y = 0%
/ a2 = 1
/ a2x = 0%
/ a2y = 0%
/ a3 = 1
/ a3x = 0%
/ a3y = 0%
/ a4 = 1
/ a4x = 0%
/ a4y = 0%
/ a5 = 1
/ a5x = 0%
/ a5y = 0%
/ a6 = 1
/ a6x = 0%
/ a6y = 0%
/ a7 = 1
/ a7x = 0%
/ a7y = 0%

/ b1 = 1
/ b1x = 0%
/ b1y = 0%
/ b2 = 1
/ b2x = 0%
/ b2y = 0%
/ b3 = 1
/ b3x = 0%
/ b3y = 0%
</values>

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

<trial mytrial>
/ ontrialbegin = [
values.a1 = list.aitemnumbers.nextindex;
values.a1x = list.xpos.nextvalue;
values.a1y = list.ypos.nextvalue;
values.a2 = list.aitemnumbers.nextindex;
values.a2x = list.xpos.nextvalue;
values.a2y = list.ypos.nextvalue;
values.a3 = list.aitemnumbers.nextindex;
values.a3x = list.xpos.nextvalue;
values.a3y = list.ypos.nextvalue;
values.a4 = list.aitemnumbers.nextindex;
values.a4x = list.xpos.nextvalue;
values.a4y = list.ypos.nextvalue;
values.a5 = list.aitemnumbers.nextindex;
values.a5x = list.xpos.nextvalue;
values.a5y = list.ypos.nextvalue;
values.a6 = list.aitemnumbers.nextindex;
values.a6x = list.xpos.nextvalue;
values.a6y = list.ypos.nextvalue;
values.a7 = list.aitemnumbers.nextindex;
values.a7x = list.xpos.nextvalue;
values.a7y = list.ypos.nextvalue;

values.b1 = list.bitemnumbers.nextindex;
values.b1x = list.xpos.nextvalue;
values.b1y = list.ypos.nextvalue;
values.b2 = list.bitemnumbers.nextindex;
values.b2x = list.xpos.nextvalue;
values.b2y = list.ypos.nextvalue;
values.b3 = list.bitemnumbers.nextindex;
values.b3x = list.xpos.nextvalue;
values.b3y = list.ypos.nextvalue;
]
/ stimulustimes = [0=a1,a2,a3,a4,a5,a6,a7,b1,b2,b3]
/ validresponse = (57)
</trial>

<text a1>
/ items = poolaitems
/ select = values.a1
/ hposition = values.a1x
/ vposition = values.a1y
</text>

<text a2>
/ items = poolaitems
/ select = values.a2
/ hposition = values.a2x
/ vposition = values.a2y
</text>

<text a3>
/ items = poolaitems
/ select = values.a3
/ hposition = values.a3x
/ vposition = values.a3y
</text>

<text a4>
/ items = poolaitems
/ select = values.a4
/ hposition = values.a4x
/ vposition = values.a4y
</text>

<text a5>
/ items = poolaitems
/ select = values.a5
/ hposition = values.a5x
/ vposition = values.a5y
</text>

<text a6>
/ items = poolaitems
/ select = values.a6
/ hposition = values.a6x
/ vposition = values.a6y
</text>

<text a7>
/ items = poolaitems
/ select = values.a7
/ hposition = values.a7x
/ vposition = values.a7y
</text>

<text b1>
/ items = poolbitems
/ select = values.b1
/ hposition = values.b1x
/ vposition = values.b1y
</text>

<text b2>
/ items = poolbitems
/ select = values.b2
/ hposition = values.b2x
/ vposition = values.b2y
</text>

<text b3>
/ items = poolbitems
/ select = values.b3
/ hposition = values.b3x
/ vposition = values.b3y
</text>

<item poolaitems>
/ 1 = "A01"
/ 2 = "A02"
/ 3 = "A03"
/ 4 = "A04"
/ 5 = "A05"
/ 6 = "A06"
/ 7 = "A07"
/ 8 = "A08"
/ 9 = "A09"
/ 10 = "A10"
/ 11 = "A11"
/ 12 = "A12"
/ 13 = "A13"
/ 14 = "A14"
/ 15 = "A15"
/ 16 = "A16"
/ 17 = "A17"
/ 18 = "A18"
/ 19 = "A19"
/ 20 = "A20"
/ 21 = "A21"
</item>

<item poolbitems>
/ 1 = "B01"
/ 2 = "B02"
/ 3 = "B03"
/ 4 = "B04"
/ 5 = "B05"
/ 6 = "B06"
/ 7 = "B07"
/ 8 = "B08"
/ 9 = "B09"
</item>

//21 items in pool A in this example
<list aitemnumbers>
/ poolsize = 21
/ selectionrate = always
</list>

//9 items in pool B in this example
<list bitemnumbers>
/ poolsize = 9
/ selectionrate = always
</list>

//10 screen positions expressed as pairs of X and Y coordinates
<list xpos>
/ items = (10%, 30%, 50%, 70%, 90%, 10%, 30%, 50%, 70%, 90%)
/ selectionmode = random
/ selectionrate = always
</list>

<list ypos>
/ items = (25%, 25%, 25%, 25%, 25%, 75%, 75%, 75%, 75%, 75%)
/ selectionmode = list.xpos.currentindex
/ selectionrate = always
</list>





otago
otago
Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)Associate Member (141 reputation)
Group: Forum Members
Posts: 2, Visits: 7
Hi,

I am trying to create a trial that will show 7 images and 3 random images at all once on different location, then a fixation, and a red dot. My script so far only works when I only isted 3 random images but I need add more random images (I am new to programming). Is there a way always to select 7 images from the pool A and 3 random images from pool B?

Thank you.


Attachments
trial3.iqx (433 views, 3.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search