Change answer on slider after first click, with forced response

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2020.2.10
What are you trying to achieve?:

Hi,

I want participants to be able to give an answer on a slider, then be able to change their mind and change their rating if they like, and then press space to continue. So a forced response, but with the possibility of changing your rating after your first click.

What did you try to make it work?:
Currently, I use this code component (each frame) to ensure that participants are forced to give an answer. After they picked an answer, they still have to press space in order to continue (which is what I want, and why I added event.waitKeys()). This works fine.
However, participants are not able to change their (slider)rating after their first click. How could I alter my code to make that possible?

if slider_bestgedaan.getRating() is not None:
    event.waitKeys()
    if key_resp.keys=='space': 
        continueRoutine=False

Thank you very much in advance for any help!

You shouldn’t use waitKeys() in Builder. How about

if slider_bestgedaan.getRating() is not None:
    keys = event.getKeys()
    if 'space' in keys: 
        continueRoutine=False

When I use this, the routine ends immediately after te first click on the slider, so a participant cannot change his mind. :confused:

The previous routine ends with space in a keyboard component, doesn’t it?

Add event.clearEvents() to Begin Routine

Hm, no it does not.

I do notice now that participants are able to change their rating IF they did not press space yet.
If I try to ‘’ skip’’’ the question by pressing space before giving an answer, you can only give one answer (click) and then you immediately move on to the next routine and do not have the option to change your answer anymore.

I would like to make it so that participants who press space before answering are still able to change their mind after their first click on the slider.

No problem

Try

keys = event.getKeys()
if slider_bestgedaan.getRating() is not None and 'space' in keys:
        continueRoutine=False
1 Like

That works perfectly, thank you very much!