psychopy.org | Reference | Downloads | Github

Slider does not end routine


#1

Hi,
I set ‘Force end of Routine’ in the Slider Component but in the online Experiment after clicking on the scale the routine is not ended. in the standalone version on my mac it works. Any ideas? I am using v3.0.2

url: https://pavlovia.org/run/vertrautheit/experiment/html/


#2

Hi Jakob,

I’ve experience this issue too. For now, if you want to end the routine when the user click on the slider, add a code component to your slider’s routine, and on the “Each Frame” tab, put this in the Javascript code:

if (slider.getRating() !== undefined) {
      continueRoutine = false
      slider.status = PsychoJS.Status.FINISHED
}

slider_example.psyexp (16.1 KB)

Check out the attached .psyexp. You can take a look at the result online at https://pavlovia.org/run/kevinhroberts/slider_example/html/


#3

Thank you! Works perfectly


#4

Thanks Kevin, and we’ll make sure the code is correctly output (like that) from Builder in the next release


#5

Another issue i found is that after calling slider.setReadOnly() the Slider is greyed out but it is still possible to set the value.


#6

Yes, this was already in the JS code compiler for Slider, however was commented out as I was replicating the Slider demo code. See https://github.com/psychopy/psychopy/pull/2244 for pull req.