Millisecond Forums

Two pictures- click on one?

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

By beccabos - 2/20/2014

Hello,

I've figured out how to get two pictures on the screen at the same time using <picture> … how do I make it possible to select a picture as a form of choice? 

Thanks!

By Dave - 2/20/2014

It's pretty simple:

<picture a>
[...]
</picture>

<picture b>
[...]
</picture>

<trial mytrial>
/ stimulusframes = [1=a, b]
/ inputdevice = mouse
/ validresponse = (a, b)
[...]
</trial>

By beccabos - 3/22/2014

Awesome- thank you so much!

Now I have a quick follow up question- how do I randomize the side of the screen that the image appears on? Is that possible?
By Dave - 3/22/2014

Yes, of course that's possible. /position, /hposition and /vposition attributes accept expressions / can use <list> or <counter> elements. The approach you need to go for depends on what exactly you want to do: "Randomizing" screen position can mean a number of different things.
By beccabos - 3/22/2014

Ah, okay. If I wanted the images in the same positions on the screen, but just on different sides depending on the subject, would I need to make separate trials (e.g. a,b in one, b,a in the other)?
By Dave - 3/22/2014

No, not necessarily. You can do stuff like

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

<trial mytrial>
/ stimulusframes = [1=a,b]
/ validresponse = (a,b)
/ inputdevice = mouse
</trial>

<text a>
/ items = ("A")
/ hposition = list.hpositionlist.nextvalue
/ vposition = 50%
</text>

<text b>
/ items = ("B")
/ hposition = list.hpositionlist.nextvalue
/ vposition = 50%
</text>

<list hpositionlist>
/ items = (40%,60%)
/ selectionmode = random
/ selectionrate = always
</list>

or any number of more complex variations thereof. It all depends on what you want to achieve.
By beccabos - 3/22/2014

ah, okay, that is super helpful! thank you so much- I think I've figured most of it out.

what if I only wanted to randomize presentation of stimulus pairs by pair (e.g. a1 b1,  a2 b2, a3 b3 etc are paired, but either pair could be presented at a random time)? the code above flips the location, but doesn't keep the pairings consistent. 

i really appreciate your help!
By Dave - 3/22/2014

See the "How to present stimulus pairs" topic in the documentation.