| Reference | Downloads | Github

Slider - Marker not visible online

URL of experiment:

Description of the problem:

The marker is not visible in the online version of the experiment.
I checked earlier posts and fiddled with colour, but to no avail.
However, the trial does wait until a response is made (i.e. click on the scale), so it is not the problem of the trial ending before the marker is drawn (as per pervious posts)

Any pointers?

Hi @Marc_Buehner, this is a problem that occurs when the Slider ends the routine when a rating is made. Here, the trial ends before the marker is drawn. To get around this, you could set the 'Slider to not end the routine, and use another method to continue, e.g., pressing space after a response is made.

HI David,
Thanks for that! Yes, that works!
TWO follow on questions:

a) in JS the marker only becomes visible once the mouse is released. Running locally, the marker becomes visible as soon as the scale is clicked.
Is there a way to change this?

b) How do I change the size of the marker? It is much bigger in JS than locally. I tried the solution you posted to an earlier question (slider.marker.size=(.1,.1) at BeginRoutine), but that throws an error in JS

Thanks, as always!

Hi @dvbridges is there another way to show the marker, while keeping the “force end of routine” option on? Timing is essential in my study so I’d like to avoid another step. Thanks.

Hi Marc,
I’m having a similar issue with the slider online. The solution to add a keypress after the rating is not ideal for me, but it works. I had a look at your experiment, and was wondering what parameters you used so that participants could not simply press “space” without giving a rating? How do you force them to use the slider, if it’s not the action that forces the end of the routine? Thanks!

HI @lcrible,

Here is what I did in PsychoPy

for thisRater in catchList:
    if thisRater.getRating() in [1,2]:
if responseChecker >= 6 and mouse.isPressedIn(button):
    continueRoutine = False

and in PsychoJS:

for (let thisRater of catchList){
    if ([1,2].includes(thisRater.getRating())){
        responseChecker = responseChecker +1;
        var index_L = catchList.indexOf(thisRater);
        if (index_L > -1) {
            catchList.splice(index_L, 1);

if (responseChecker >= 6 && button.contains(mouse) && mouse.getPressed()[0] === 1)
    continueRoutine = false;

responseChecker is set to 0 at the start of the routine, and increments by 1 each time a valid rating (here coded as 1 or 2) is made on one of the ‘sliders’ (radio buttons) – which are contained in catchList

Hope that makes sense


Hi Marc,

Thanks for your reply. So if I don’t need to check for the answer (any answer is fine), could I just use

if mouse.isPressedIn(button):

    continueRoutine = False


Or is the bit before necessary?

Also I get a “mouse not defined” error so I assume you had to define that before, could I ask how? Thanks again.



HI @lcrible,

I think there are a couple of things here.
I have a mouse event in the builder called ‘mouse’ and it has ‘button’ as a clickable stimulus.
If you leave the code before out, then a subject could just press the button and proceed – you would not be able to force them to make the selections from the radio buttons. In my case any response is fine as well, but I need this code to make sure that there is SOME response.
Hope this makes sense

I looked at your experiment file and simply realized that you set the keyboard component to start on the condition “slider.rating”, which works like a charm. Thanks a lot!