psychopy.org | Reference | Downloads | Github

Stimuli stay after a response


#1

Hi everyone,

I’m trying to show a picture for 3 seconds then a 1s blank, and I want participants to name the picture asap.

  1. The tricky part is that I want the picture to stay on the screen for 500ms after a response is given. If I use a button box, the picture will disappear immediately when a response is given; if I use the built-in mic, the picture will stay there for the whole 3 seconds.

  2. I also want the picture routine to finish even if a response is given. For example, if a response is given at 700ms (RT=700), the participant should be able to see the picture for 700+500=1200ms, then 3000-1200=1800ms blank, and then 1s blank.

Is this doable?

Many thanks!!


#2

Hi @psylingcc, yes this is possible. You need to use code component to get this done. First, make sure that your response box does not force the end of the routine on response - should be a checkbox in Builder. Set your image to have a duration of 3 seconds. I will use a keyboard in this example, but the logic is the same. In the relevant tabs:

# Begin routine
response = False
responseTimer = None

# Every Frame
if len(keyboard.keys) and not response:  # On the first response
    response = True
    responseTimer = t + .5  # get time of response and add your 500ms delay

if response and t >= responseTimer:  # make image invisible 500ms after response
    image.opacity = 0  # Make image invisible until end of trial.

For the final blank, just add another routine after your trial containing a blank screen with 1 second duration.


#3

Many thanks!!