By piotr_styrkowiec - 12/30/2014
I'm stuck with the following thing: There are 10 images. Each image is a jpg file of a small white circle, each image has its own onscreen position (no other image got this position).In each trial I want random 4 circles to be displayed on the screen.How can I get it? It's probably very easy though I cannot figure it out... Will be grateful for any help.Piotr
|
By Dave - 1/1/2015
<block myblock> / trials = [1-5 = mytrial] </block>
<trial mytrial> / ontrialend = [list.imagelist.reset(); ] / stimulusframes = [1=img1, img2, img3, img4] ... </trial>
<picture img1> / items = imageitems / select = list.imagelist.nextindex ... </picture> ... <picture img4> / items = imageitems / select = list.imagelist.nextindex ... </picture>
<list imagelist> / poolsize = 10 / selectionrate = always </list>
<item imageitems> / 1 = "circle1.jpg" ... / 10 = "circle10.jpg" </item>
|
By piotr_styrkowiec - 1/4/2015
It looks fine, but there is one problem.The onscreen position of each image is not set within the jpg file.It is set in the picture element for each object, this is:
< picture circle_1> / items = ("circle_1.jpg") / vposition = 5 / hposition = 5 </picture>
<picture circle_1> / items = ("circle_2.jpg") / vposition = 10 / hposition = 10< /picture> ... <picture circle_10> / items = ("circle_10.jpg") / vposition = 95 / hposition = 95 </picture>
How should I implement these picture elements in item element in order to use it in the list element? Is it possible? If no, is there any other way I can get 4 random pictures out of 10 pictures (such as presented just above) in each trial?
|
By Dave - 1/4/2015
You can define two additional list elements (one for hposition, one for vposition) and link them to the 1st list. EDITED Here's a full example with <text> elements (it works the same for <picture>s):
<block myblock> / trials = [1-10 = mytrial] </block>
<trial mytrial> / ontrialend = [list.mylist.reset(); ] / stimulusframes = [1=txt1, txt2, txt3, txt4] / validresponse = (57) </trial>
<text txt1> / items = myitems / select = list.mylist.nextindex / hposition = list.hpos.nextvalue / vposition = list.vpos.nextvalue </text>
<text txt2> / items = myitems / select = list.mylist.nextindex / hposition = list.hpos.nextvalue / vposition = list.vpos.nextvalue </text>
<text txt3> / items = myitems / select = list.mylist.nextindex / hposition = list.hpos.nextvalue / vposition = list.vpos.nextvalue </text>
<text txt4> / items = myitems / select = list.mylist.nextindex / hposition = list.hpos.nextvalue / vposition = list.vpos.nextvalue </text>
<item myitems> / 1 = "A" / 2 = "B" / 3 = "C" / 4 = "D" / 5 = "E" / 6 = "F" / 7 = "G" / 8 = "H" / 9 = "I" / 10 = "J" </item>
<list mylist> / poolsize = 10 / selectionrate = always </list>
<list hpos> / items = (5%,10%,15%,20%,25%,75%,80%,85%,90%,95%) / selectionmode = list.mylist.currentindex / selectionrate = always </list>
<list vpos> / items = (5%,10%,15%,20%,25%,75%,80%,85%,90%,95%) / selectionmode = list.mylist.currentindex / selectionrate = always </list>
|
By piotr_styrkowiec - 1/5/2015
Works perfectly! Thank you very much Dave.
|
|