psychopy.org | Reference | Downloads | Github

A couple of RatingScale questions (and one curiosity)

Hello everyone,

I’m trying to use the RatingScale class to present a couple of rating scales at the same time (as in example #3 in the ratingScale.py demo), in a trial-by-trial fashion.

Now there’s a couple of things I can’t seem to be able to do.

  1. First of all, I’d like to NOT show the marker anywhere on the scale before the subject actually clicks on the scale (so as not to anchor them to any particular value). This seems to be possible if, when I initialise my RatingScale, I assign a markerStart value that is outside the actual range of the scale. For example if the scale is low=0, high=100, I would put markerStart=200. This however works only for the very first trial, and from the second onwards, the marker starts from the value select by the subject in the previous trial. I have tried to overcome this by re-assigning a markerStart value outside of the scale range (e.g. 200) at the end of my loop, but this isn’t working. Do you know if there’s a way to do this?

  2. The second issue is a minor visual bug regarding the color of the marker. As I said I’m presenting two scales at the same time as in the coder demo, so that the code looks something like this:

while myRatingScaleLeft.noResponse or myRatingScaleRight.noResponse:
    myItemLeft.draw()
    myItemRight.draw()
    myRatingScaleLeft.draw()
    myRatingScaleRight.draw()
    win.flip()

myRatingScaleLeft.noResponse = True
myRatingScaleRight.noResponse = True

The scales both have custom markers. What happens is that when a subject first confirms a response on one scale, the marker automatically turns grey to show that a response has been made for that scale. But when the subject also confirms a response for the second scale, the loop breaks as it has received both responses, and the experiment goes to the next trial. However the color of the marker of the second scale has not changed to grey, and is still the original color (let’s say black). Now the issue is that these changes of colors carry over to the next trial, so that when the rating scales appear again, the first scale has a grey marker from the start, while the second is still black. Similarly to my first issue, I tried to solve this by re-assigning the value of the markerColor at the end of my loop, but this seems to be completely ignored.

Finally I have a curiosity, it seems to me that if I don’t reset the value of myScale.noResponse to “True” (as shown in code above) at the end of my loop, in the next trial that value will stay to “False” based on the participant giving a response on the previous trial, resulting in the scale showing only on the first trial, and never again. Is this normal, and is my solution the “right” one if I need to show a rating scale in a trial-by-trial fashion?

Thank you in advance!

Hi @mahiko, have you thought about switching to Slider? Using slider will address both of your main issues.

Hey @dvbridges, thanks for your reply!

I have not tried the Slider class yet as I thought it was still in development. Is it stable now and definitely an upgrade over RatingScale?

I’ve tried some other things but this seems to me like a bug.

In general it looks like every time I try to .draw() a rating scale, psychopy always draws the original scale that was initialised at the beginning of the experiment. I tried to change a bunch of attributes, but while the changes are correctly registered, the .draw() function always draws the very first version of the rating scale. Simple example below:

from psychopy import visual

win = visual.Window(size = (800,600), fullscr = False)
myScale = visual.RatingScale(win, lineColor = 'red')
print(myScale.lineColor)

while myScale.noResponse:
    myScale.lineColor = 'white'
    myScale.draw()
    print(myScale.lineColor)
    win.flip()

This results in PsychoPy drawing a red rating scale, while normally it should be white (as confirmed by the 2nd print argument). I don’t know if I’m missing something…

The online documentation for the RatingScale class (http://www.psychopy.org/api/visual/ratingscale.html) doesn’t tell you this, but the lineColor variable and other parameters that you can set when creating your object cannot subsequently be changed by direct assignment. However, some of them can be changed by using undocumented ‘set’ methods that can be found in the source code (https://github.com/psychopy/versions/blob/master/psychopy/visual/ratingscale.py). The reset() method changes the marker colour back to the one specified when the RatingScale object was created, so that the grey colour that it changed to automatically after registering the previous response does not persist in the next trial. There doesn’t appear to be a method that allows you to change the marker to a new colour though, if this is also something that you require. Another useful method is setMarkerPos(), which can be used to move the marker to a specified position, for example back to its original position, instead of leaving it where it was at the end of the last trial.