How to reset marker position using hover on rating scale?

Hi there,

New user of Psychopy, mostly focusing on using the builder. I’ve come across an issue using the hover option in my rating scale. Basically, I present an image of a face in the center of the screen, and then after 6s, the rating scale appears with 5 emotion categories, of which all participants need to do is to click one.

When the mouse is hovered over each category, it lights up, as expected. However, when the next trial (same routine, looped for a new stimulus) begins, regardless of the mouse position, the response that was selected in the previous trial “lights up” as if it is being hovered over. For the life of me I can’t seem to get the marker to reset to a null position for each trial. I have tried markerStart=None, and other things, but the best I can get is for each trial to begin with the same option hovered using markerStart=‘happy’ for example.

This issue has come up in the past, but I’m not sure it has been resolved:

https://groups.google.com/forum/#!topic/psychopy-users/D2Qf6WCCZu8

Can provide more information if needed.

Thanks.

Ryan

I should note, I’m using PsychoPy v1.85.4 on Win10.

@sutry542, your easiest hack would be to insert a code component and reinitialize the rating scale at the end of the routine. This will reset the rating scale. You will first need to compile the script to get the code where rating is initialised, e.g., rating = visual.RatingScale(win, etc...).This will solve your problem, and you can ignore the next part if you wish.

The actual fix requires you to change some psychopy code, and I will put this in as a bugfix on github. If you wanted to, you could change the reset method in the rating scale code. Add the following just after the comments at line 1295:

# reset label color if using hover
if self.markerStyle == 'hover':
    for labels in self.labels:
        labels.setColor(self.textColor, log=False)

RatingScale can be found in ~\PsychoPy2\Lib\site-packages\psychopy\visual\ratingscale.py

2 Likes

Thanks for your help @dvbridges! Both methods work perfectly (so far :wink: ).