Make a picture pop up upon pressing key buttons


Author
Message
mingwu
mingwu
Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)
Group: Forum Members
Posts: 6, Visits: 16
Hi,
I'm trying to program an experiment where in every trial, as soon as the participant presses any valid key button, an image will pop up for 1 second and disappear. I'm good with the other parts of the experiment, I just don't know how to make the picture flash upon participants pressing the key. Any one has any ideas?
Greatly appreciated!



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: 105K
mingwu - Monday, November 14, 2016
Hi,
I'm trying to program an experiment where in every trial, as soon as the participant presses any valid key button, an image will pop up for 1 second and disappear. I'm good with the other parts of the experiment, I just don't know how to make the picture flash upon participants pressing the key. Any one has any ideas?
Greatly appreciated!



You can either use the <trial>'s /responsemessage attribute or /branch to a separate <trial> that displays the image for the desired amount of time. The latter approach is the one you'll want to use in case you need to log information about the image presented.

<trial mytrial>
/ validresponse = ("d", "k")
/ branch = [if (trial.mytrial.response == 32) trial.d_pic]
/ branch = [if (trial.mytrial.response == 37) trial.k_pic]
</trial>

<trial d_pic>
/ stimulusframes = [1=d]
/ validresponse = (0)
/ trialduration = 1000
</trial>

<trial k_pic>
/ stimulusframes = [1=k]
/ validresponse = (0)
/ trialduration = 1000
</trial>

<picture d>
/ items = ("d1.jpg", "d2.jpg")
</picture>

<picture k>
/ items = ("k1.jpg", "k2.jpg")
</picture>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search