Wakefield's Daily Tips

Submitting slider responses

The easiest way to add a slider which allows the participant to select a response but change it before submitting is to have a button component with a start condition of showButton.

Then create a code component with the following code:
Begin Routine

showButton = False

Each Frame

if not showButton:
    try:
        if isinstance(slider.getRating(), float):
            showButton = True
    except:
        pass

This code is more complex than I would like because slider.getRating() can’t be checked until it exists and Auto code components translate None to null instead of undefined in this instance.

Locally this slider looks like:

Online it is slightly different.