psychopy.org | Reference | Downloads | Github

Variable position of rating scale

Hey guys,

at the moment I am trying to present a rating scale on variable positions like you see in the following picture:

Until now I used six different Rating Scale Components where I inserted the different positions e.g. [0, 0.5] and [0, 0.3] But now I want to use one Rating Scale in a Loop:

For the loop I have chosen the following conditon file

and in the rating scale I tried to use $Direction as the variable for the position

Now unfortunately the position is of the scale is just the default-position and not one of the numbers that I’ve written in the conditions file.

Does anyone have an idea, why the variable is not accepted?

Thank you!

OS Win7
PsychoPy version 1.90.0
Standard Standalone

Hi @kantarev, it appears the rating scale only updates the position on initialization of the rating scale object. Your best option at this point is to initialize the rating scale at the beginning of every routine.

First, as you are only changing the y-location of the rating scale, you only need to include the y-coordinates in your conditions file. This way, you only need to refer to the y-coordinates in your Direction variable. So, set up your rating scale in Builder, then compile the script, and copy the rating initialization code. It will look something like this:

rating = visual.RatingScale(win=win, name='rating', marker='triangle', size=1.0, low=1, high=7, labels=[''], scale='', showAccept=False)

At this point, the position of the rating scale is not defined. So, you want to add a code component in Builder, and paste the rating code into the tab labelled Begin Routine. Then, you will want to add the position data, and assuming you have only added the y-coordinates to the Excel file under the Direction column, will look something like this - Note, the addition of the pos attribute:

rating = visual.RatingScale(win=win, name='rating', marker='triangle', size=1.0, low=1, high=7, labels=[''], scale='', showAccept=False, pos = (0, Directions))

This will re-initialize the rating scale on every trial, and in the process update the position of the scale.

2 Likes

Hey dvbridges,

that works perfectly for me! Thank you!

1 Like