Log final response on rating timeout

Hi all,

I’m trying to use rating-scales with fixed durations - the subject moves the marker back and forth until they’re happy, and then waits for the next rating scale. I really only want to use a 2-button response box (for… reasons) so I don’t want to have the accept button visible, or use an accept key - I want the logged data to be the final position of the marker on the scale, at the end of the trial duration.

I seem to recall that this used to be quite easily done in earlier versions of PsychoPy, in the builder interface. However, now it looks like the only option for doing what I need is ticking the ‘Store History’ box in the advanced tab in the rating-scale element. This is not perfect, as the list of responses will be variable across trials/subjects, which makes analysis a bit of a pain.

Someone else asked a similar question here: Store rating after timeout, which unfortunately has no replies. Am I missing something obvious here?

Any help much appreciated! Many thanks.

Matt.

Hi Matt,

The rating scale is a bit of a closed book to me, as it has so many options. I thought it would work to insert a code component and simply send the rating a .getResponse() or .acceptResponse() message, as per http://www.psychopy.org/api/visual/ratingscale.html to get the final value, but that didn’t seem to work.

But this does seem to do what you need. Insert a code component, and in its End routine tab, put something like this:

thisExp.addData('final_rating', your_ratingscale_name.getHistory()[-1][0])

i.e. this gets the last entry (index -1) in the rating scale history and then extracts the zeroth entry from within that tuple (the rating value itself: the other entry is the reaction time).

This will safely report None if no response was actually made.

1 Like

this works for me!
Many thanks,

Emanuele

Michael,

Brilliant - many thanks for this!

Matt.