Randomize 2 slider

Hi everybody,

I’m trying to randomize 2 sliders, I mean, I have 2 slider but I don’t want to show them always in the same order. I tried to set every repeat to “label” and “ticks” in each slider to exchange the values between them, but that doesn’t work. I read the autogenerate code and saw that the slider set the ticks and label values in the start of the experiment, eventhough I set the configuration to set every repeat.

if randint(0,1)==0:
    labelsA = (1, 2, 3, 4, 5)
    labelsB = (200, 400, 600, 800, 1000, 1200, 1400)
else:
    labelsB = (1, 2, 3, 4, 5)
    labelsA = (200, 400, 600, 800, 1000, 1200, 1400)

Any ideas?

Thanks in advance.

1 Like

Hi There,

This was a tricky one actually, and I think this is a feature that might need some development.

For now though this should do what you need. Here you have 2 routines (one that contains slider 1 and one that contains slider 2) and a loop is used to randomly pick which one will be presented on each trial.
randomiseSlider.psyexp (18.5 KB)
conditions.xlsx (8.5 KB)
Hope this helps :slight_smile:

Becca

Sorry for the late response. Your answer is so useful, I was really stuck on this. Also this helps me to solve other problems that I have.

Thanks!

I’m trying to make something similar to this question, where the slider has either 2 or 5 options. I got referred to this post. Is it still not possible to do it as proposed in the OP? I understand that I still need to make a separate component for each variation.