select matching substrings of items 50% of the time?


Author
Message
S F
S F
Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)
Group: Forum Members
Posts: 29, Visits: 175
hi! I'm trying to write a script that, half the time, will pair items from picture and audio elements randomly for a trial. However, I also want to be able to set how frequently it samples matching files (i.e. 50% of the time, if "acorn.mp3" is selected from the video/audio element, "acorn.jpg" should be selected from the picture element). 

I'm trying to build a toy example but I've gotten nowhere-- I wonder if there's a way to use the startswith function? Or if all the items appear in the same order I could use / select and have it select for the same index as the other element? But if I did that I'd have to create two sets of audio and video elements and I don't want items to repeat during the experiment, plus I'm not sure how I would randomize the selection order across the elements.

Any thoughts appreciated!

<picture pictures>
/items=("acorn.jpg", "apple.jpg", "balloon.jpg")
/ hposition = 50%
/ vposition = 50%
/ size = (300,300)
</picture>

<video audio>
/items=("acorn.mp3", "apple.mp3", "balloon.mp3")
</video>

<trial trial>
/ stimulusframes=[1=audio; 10=pictures]
/ inputdevice=keyboard
/ validresponse=(57)
/ timeout = 1600

</trial>

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

<expt myexpt>
/ blocks = [1=myblock]
</expt>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search