Presenting image after Slider response

OS (e.g. Win10): win10
PsychoPy version (e.g. 1.84.x): v2021.1.2
Standard Standalone? (y/n) If not then what?:y
What are you trying to achieve?:
I want to present an image after the participant respond to a slider
What did you try to make it work?:
What should I write as end time for the slider

What should I write as the start time for the image

What specifically went wrong when you tried that?:
Include pasted full error message if possible. “That didn’t work” is not enough information.

When I looked at the participant data slider.stopped is not defined. when I write this to the condition $slider.stopped error comes up

In python code it is like this:

Try slider.getRating() or slider.rating



I also tried all other variables related to the slider but neither is worked.
Should I add a condition in the excel file?

You could try setting a flag, e.g.

sliderStarted = False

in Begin Routine

Then in Each Frame try

if slider.getRating:
sliderStarted = True

Then Ouse sliderStarted as the component start condition.

Begin Routine:
sliderEnded = False
Each Frame
if slider.getRating: #tried also with () and for slider.rating
sliderEnded = True

Set slider component end time as sliderEnded. (or left it empty)

Set image component start time as: sliderEnded

However, this resulted in the image appearing on the screen forever.

Did the image appear on screen when the slider was touched?

The slider end time should be blank
The imager end time should be a fixed number of seconds.

1 Like

What about a mouse click? If I want to present a text componenet after a mouse click, what should be the start time for the text

Also, I ask participants to click the image component after the slider response. Should I set end time of the image as the offset of the mouse click?

Hi B.D.5, did you manage to find a solution to this in the builder? I am also trying to set up my experiment so that an image pops up after a response on the slider is selected.

Hey Gillian,

Please try the attached method. I hope it helps.

untitled.psyexp (7.1 KB)
Uploading: download.png…