psychopy.org | Reference | Downloads | Github

Any way to remove marker from appearing in ratingScale component?

Hello, I am using the RatingScale component in the Coder view, and I am experiencing two different issues with it. I’m on Mac OS 10.11.6 and Psychopy 1.84.2.

Some background: Users input one key (1, 2, 3, 4, or 5) to rate an image, and this forces the end of the routine, until another image appears, and it loops.

Even though I have the code to Force end of Routine = True, sometimes it does not actually stop the routine after the user keys in a response. The marker just randomly appears and I am forced to press the key multiple times in order to advance to the next image. Other times it works successfully and the routine ends after one button press.

My primary question: Is it possible to just have the scale appear without the marker appearing as well?

And, secondarily, any ideas why it randomly does not end the routine after single key input?

The portion of my code is below; thanks for the help:

 
trialClock = core.Clock()
rafd_face = visual.ImageStim(
    win=win, name='rafd_face',units='pix', 
    image='sin', mask=None,
    ori=0, pos=(0, 3), size=(341, 512),
    color=[1,1,1], colorSpace='rgb', opacity=1,
    flipHoriz=False, flipVert=False,
    texRes=128, interpolate=True, depth=0.0)
rating = visual.RatingScale(win=win, name='rating', marker='glow', markerStart=None, markerColor=None, size=1.5, textSize=0.5, pos=[0.0, -0.75], choices=[u'1 = Not at all', u'2 = Somewhat', u'3 = Average', u'4 = Very', u'5 = Extremely'], tickHeight='-1', showValue=False, showAccept=False)
Fixation = visual.TextStim(win=win, name='Fixation',
    text='+',
    font='Arial',
    pos=(0, 0), height=0.1, wrapWidth=None, ori=0, 
    color='black', colorSpace='rgb', opacity=1,
    depth=-3.0);

Hi,
regarding the 1st question, from the doc about the marker parameter of the ratingscale component:

        The moveable visual indicator of the current selection. The
        predefined styles are 'triangle', 'circle', 'glow', 'slider',
        and 'hover'. A slider moves smoothly when there are enough
        screen positions to move through, e.g., low=0, high=100.
        Hovering requires a set of choices, and allows clicking directly
        on individual choices; dwell-time is not recorded.
        Can also be set to a custom marker stimulus: any object with
        a .draw() method and .pos will work, e.g.,
        ``visual.TextStim(win, text='[]', units='norm')``.

So I’d try to add a code component where, in the BeginExperiment tab I’d put: myMarker = visual.TextStim(win, text=’’, units=‘norm’).

Then on the ‘Customize everything’ everything of the ‘ratingscale’ component, write:

win=win, name=‘rating’, marker=myMarker, markerStart=None, markerColor=None, size=1.5, textSize=0.5, pos=[0.0, -0.75], choices=[u’1 = Not at all’, u’2 = Somewhat’, u’3 = Average’, u’4 = Very’, u’5 = Extremely’], tickHeight=’-1’, showValue=False, showAccept=False

For the other questions there are no enough elements to answer.
Pls, post the relevant code.

Cheers,
Luca

Q1: Is it possible to just have the scale appear without the marker appearing as well?

Yes, because you are using Coder view its easy to set the opacity of the marker to be 0.0 when you want the marker to be hidden. Set to 1.0 to view “full strength”. (In Builder, you would need a code component for this, which is also pretty easy.)

rs.marker.opacity = 0  # assuming you named your rating scale rs

Q2 any ideas why it randomly does not end the routine after single key input?

This part sounds like some other part of your code (such as your force-end-routine check) is doing event.clearEvents() or event.getKeys(). Probably some of the time that runs after a key press but before the rating scale can detect the key (so the key press gets lost), and some of the time the keys get through to the rating scale.

1 Like

Thank you so much for the help! Modifying the opacity got rid of the marker, and the force-end-routine problem was indeed with the getKeys command elsewhere in the code. Thanks!