psychopy.org | Reference | Downloads | Github

Slider Granularity

Hi everyone,

I am struggling with adjusting my radio label slider as integer scale in a way that will not let click between different options.

OS ( Win10):
PsychoPy version (2021.1.2):

What are you trying to achieve?:
I am trying to use slider, radio labels to get responses from categories (emotion labels like Angry, Happy,…).

What did you try to make it work?:
I chose granularity as 1 to make it integer instead of having continuous one with 0. I also tried to clear caches, deleting and uploading the experiment and trying to run it in a private window. Also, I tried to add marker however, it does not appear at all neither online nor remotely.

What specifically went wrong when you tried that?:
I can still click the space between two options, so adjusting granularity do not work.

Thank you for any help in advance :four_leaf_clover:

What do you have in “ticks”? I think you need (1,2,3) for three radio buttons if your granularity is 1.

As far as I know, when you click between the buttons, the option closest will be selected as the answer. (So even when you click on something between the buttons, something will be selected.) Can you see this in your data?

I have ticks as (1,2,3,4) for four radio buttons and granularity is 1.

Okay – so I just tied clicking in the middle of a radio slider with two options (1,2) and it did select one of them. Is that what you are trying to avoid?

I noticed that this is the case, however, children will be completing the task so it is important to be sure that they clicked on a certain option. not in the middle.

Yes, I don’t want them to choose somewhere in the middle and possibly recording unintended option.

Btw thanks a lot for your quick reply.

Do you see the red/coloured dot when you select a button?

If you disable ‘force end of routine’ and add a spacebar which can only be used to force the end of a routine once an answer on the slider scale has been clicked, you are able to see a red dot when you click a button. This way it is very clear what you selected.

1 Like

Thanks a lot for your reply. :four_leaf_clover: I get what I need to do however I couldn’t figure out how to code force end of routine. Also, could it be possible to make double click instead of spacebar so that it will be easier for children?

keys = event.getKeys()

if yourslidernamehere.getRating() is not None and 'space' in keys:
        continueRoutine=False


in Python, and you then auto-generate JS code and change the ‘Null’ to ‘undefined’ as per wakefields cribsheet.

(Note: I did not try this in 2021.1.2 but it did work in 2020.2.10)

I do not know about the double click, I am sorry.

2 Likes

I wonder if it would be possible to change the granularity (e.g. to .25) but then only end the routine if the answer was 1 or 2.

1 Like

Sorry if this is something so simple. I make it work partially however, it does not continue routine after pressing space. I tried to change space to enter, it didn’t work neither.

I will try this too and let you know if I make it work. Thanks :slight_smile:

Did you enter it in the ‘each frame’ code component?

1 Like

Thanks a lot! It works perfectly now.

1 Like