# Slider marker does not show online

**URL:** <https://discourse.psychopy.org/t/slider-marker-does-not-show-online/23975>\
**Category:** Online experiments\
**Created:** [July 10, 2021, 10:33am UTC](https://discourse.psychopy.org/t/slider-marker-does-not-show-online/23975 "2021-07-10T10:33:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![varmas](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@varmas](https://discourse.psychopy.org/u/varmas)\
**Post date:** [July 10, 2021, 10:33am UTC](https://discourse.psychopy.org/t/slider-marker-does-not-show-online/23975/1 "2021-07-10T10:33:26Z")

</div>

[testSlider.psyexp](https://discourse.psychopy.org/uploads/short-url/u2HNCrkaPIjKZ5Kvc3BnYuB249v.psyexp) (7.7 KB)

 ![sc1](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/b/fb125988574a99a33ed333c98ad17c74c4f8a1c1.png)  
 ![sc2](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/9/c/9cadac5c399c42428f3523bd2c478df33654ffd3.png)

URL of experiment: [testSlider [PsychoPy]](https://run.pavlovia.org/svarma/pavtest)

Description of the problem: On Pavlovia, the Slider radio marker doesn’t show up if Force End of Routine is ON. Even then the selected choices do get recorded correctly, which is good.  
If I turn Force End of Routine OFF, the marker shows up (in Red, as expected). Since I wish to record the RT associated with the slider choice, I need to keep Force End of Routine ON. I’d prefer not to add a “press space to continue” sort of workaround.  
I know that these issues were raised [last year](https://discourse.psychopy.org/t/no-marker-for-slider-online/7679/19), but I couldn’t find a fix to this issue. I’d appreciate some help.  
Thanks.  
Sam

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [July 10, 2021, 1:57pm UTC](https://discourse.psychopy.org/t/slider-marker-does-not-show-online/23975/2 "2021-07-10T13:57:38Z")

</div>

I sometimes add a brief delay after the rating is not undefined. However, you may find my interactive slider demo useful.

---

<div class="post-metadata">

**Author:** ![varmas](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@varmas](https://discourse.psychopy.org/u/varmas)\
**Post date:** [July 12, 2021, 11:36am UTC](https://discourse.psychopy.org/t/slider-marker-does-not-show-online/23975/3 "2021-07-12T11:36:45Z")

</div>

> [@wakecarter](#):
>
> interactive slider demo

Hi! Thanks for the reply. I think the demo is indeed useful but I am not very experienced with the code. Given the version I sent, could you explain how to add a delay if the rating is not undefined? Thanks.

---

<div class="post-metadata">

**Author:** ![varmas](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@varmas](https://discourse.psychopy.org/u/varmas)\
**Post date:** [July 14, 2021, 4:32pm UTC](https://discourse.psychopy.org/t/slider-marker-does-not-show-online/23975/4 "2021-07-14T16:32:56Z")

</div>

I’m still unable to fix this. The slider is set to “Force end of Routine” as I need to record exact RT of the click and move on to the next trial. How can I record the response, and keep the screen for a few seconds without having Force end of Routine set to ON?  
I tried the following - disabled this setting, show a gap screen as soon as the slider option has been selected. And when gap.status == FINISHED, do continueRoutine = False. This works well locally but on Pavlovia, the experiment doesn’t wait for any input. I am not sure what I am doing wrong and how to fix this. Please help.

[testSlider.psyexp](https://discourse.psychopy.org/uploads/short-url/kQ7U6N0XyoKdQGRt03O7jgw6aAL.psyexp) (12.1 KB)  
[https://run.pavlovia.org/svarma/pavtest](https://run.pavlovia.org/svarma/pavtest)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [July 14, 2021, 8:14pm UTC](https://discourse.psychopy.org/t/slider-marker-does-not-show-online/23975/5 "2021-07-14T20:14:04Z")

</div>

I’m afraid that I have barely any Internet until Saturday.

It should work if you do something like.

Don’t end the routine automatically

Each Frame

```auto
if slider.getRating() > 0 and rated == 0:
    rated = t
elif rated > 0 and t > rated + .25:
    continueRoutine = False

```

You’ll need to put rated = 0 in Begin Routine

---

<div class="post-metadata">

**Author:** ![varmas](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@varmas](https://discourse.psychopy.org/u/varmas)\
**Post date:** [July 15, 2021, 10:03pm UTC](https://discourse.psychopy.org/t/slider-marker-does-not-show-online/23975/6 "2021-07-15T22:03:36Z")

</div>

Hey! Thanks a lot for this.  
It didn’t work at the beginning probably because _slider.getRating() \> 0_ expected a _NoneType_ instead of an _int_. So, I changed it to _slider.getRating() != None_. That worked on the local machine, but not on Pavlovia. There the experiment would end the second it started. I don’t know why.  
I messed around on the Console with some debug statements and found out that the if condition _slider.getRating ()!=None and rated ==0_ was _True_ even before the slider was presented. That didn’t make sense.  
Further drilling showed that the the default value of slider.getRating() was _undefined_ whereas the code was checking for _None_ in py or _null_ in js. I then replaced _None_ with _undefined_ and it worked on Pavlovia - but obviously no more on the local machine.  
Now that the main issue is sorted (thanks! :), could you tell me how to make this work on both platforms? Here is the code:

```auto
if (fSlider.getRating()!= undefined) and (rated == 0):
    rated = t
elif rated > 0 and t > (rated+0.25) :
    continueRoutine = False

```

Thanks a lot for your help so far!

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [July 16, 2021, 5:24pm UTC](https://discourse.psychopy.org/t/slider-marker-does-not-show-online/23975/7 "2021-07-16T17:24:01Z")

</div>

Try changing the code component to Both and None / null to undefined on the JS side
