Millisecond Forums

assignment of a randomly selected picture

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

By jens - 10/29/2013

Hello,


I want to select one of two pictures (a vertical or a horizontal dot probe). I tried the following code (see below). The assignment works but unfortunately the script only selects the first of the two dot probes. The fixation cross is replace by the dot probe, but only by the horizontal dots. The vertical dots are never selected. Suggestions?


In addition, I'd like to record the selected dot probe and store its value in the data file.


<picture dot.hor.ver.pic>
/items = ("Stimuli/DotHor.png" , "Stimuli/DotVer.png")
/select = noreplace
</picture>

<picture dot.pic>
/items = ("Stimuli/Fixation.png")
</picture>


<trial m.an.o.tar>
/ ontrialbegin = [picture.dot.pic.items.1 = picture.dot.hor.ver.pic.currentitem]
/ stimulusframes = [10 = fixation.pic; 55 = maske; 56 = m.neu.pic, m.an.pic; 58 = mask1.pic, mask2.pic; 65 = maske; 66 = dot.pic]
/ validresponse = ("F", "J")
/ correctresponse = ("F")
/ timeout = 3000
</trial>



Best regards Jens








By Dave - 10/29/2013

<trial m.an.o.tar>
/ ontrialbegin = [picture.dot.pic.items.1 = picture.dot.hor.ver.pic.currentitem]
/ stimulusframes = [10 = fixation.pic; 55 = maske; 56 = m.neu.pic, m.an.pic; 58 = mask1.pic, mask2.pic; 65 = maske; 66 = dot.pic]
/ validresponse = ("F", "J")
/ correctresponse = ("F")
/ timeout = 3000
</trial>


Since you never actually display <picture dot.hor.ver.pic>, no actual selection will ever occur for that element (and the currentitem property will always return the 1st item). You should use a <list> or <counter> for selection instead.

By jens - 10/29/2013

Hello,


ok, that explains the problem ;-) I changed the code in the following manner:


<counter dot.counter>
/ items = (1,2)
/ select = noreplace
</counter>


<picture dot.hor.ver.pic>
/items = ("Stimuli/DotHor.png" , "Stimuli/DotVer.png")
/select = dot.counter
</picture>


<trial m.an.o.tar>
/ ontrialbegin = [picture.dot.pic.items.1 = getitem(picture.dot.hor.ver.pic, dot.counter)]
/ ontrialbegin = [{picture.m.neu.pic.vposition = 75%; picture.m.an.pic.vposition = 25%; picture.dot.pic.vposition = 25%}]
/ stimulusframes = [10 = fixation.pic; 55 = maske; 56 = m.neu.pic, m.an.pic; 58 = mask1.pic, mask2.pic; 65 = maske; 66 = dot.pic]
/ validresponse = ("F", "J")
/ correctresponse = ("F")
/ timeout = 3000
</trial>


Now, I only have to store the dot.counter in the data file. I guess the column "values.dot.counter" will do.


Thanks a lot for pointing me in the right direction.


Jens