I have a nearly finished experiment but am trying to add a visual analogue scale (i.e., a slider) as a last routine. However, I can’t get anything to work from the code I find online.
In brief, participants make a choice, a short video plays, and then I want the VAS screen to display. Here is the code for the video playing:
PRP_Clock.reset() thisExp.addData("OutStart", time.strftime('%x %X')) Movie.setAutoDraw(True) Movie.play() Choice_Window.flip() while Movie.status != constants.FINISHED: Choice_Window.flip() if Movie.getCurrentFrameTime() >= (Movie.duration - 0.1): Movie.pause() Movie.setAutoDraw(False) event.waitKeys(keyList=["space"])
Once the spacebar is pressed, I’m wanting it to move on to a routine with the slider. My code doesnt work as it advances to a blank screen. I’m trying:
VAS = visual.Slider(win=win, name='VAS', pos=(0, -0.4), units=None, labels=("Very Unhappy","Neutral","Very Happy"), ticks=(0,25,50,75,100), granularity=1.0, style='slider', styleTweaks=(), opacity=1.0, color='LightGray', fillColor='Red', borderColor='White', colorSpace='rgb', font='Arial', labelHeight=0.05, flip=False, depth=0, readOnly=False) VAS.markerPos = 50 VAS.draw() Choice_Window.flip() while not VAS.rating: VAS.draw() Choice_Window.flip() if VAS.getRating() is not None and VAS.status == STARTED: continueRoutine = False
I’ve also tried putting in a slider component within the builder, but doing so causes the experiment to freeze after the movie and it won’t advance. I don’t feel like this should be hard, but I need some help figuring out what I"m missing. Alternatively, if someone wouldn’t mind sharing their code for a slider in full that would be much appreciated.