Setting up Response for Staircase Manually in Mouse-Tracking Experiment

Hi everyone,

I am using psychopy to design an experiment in which participants reach for targets using their mouse. Success is determined by whether the target circle contains the mouse during a specific time window. We have stored a boolean variable which indicates whether the participants succeeded or not. We tried to set that boolean value as the response for a staircase of target size in a code component, but it seems to have no effect and the trial is recorded as incorrect every time.


trials.addResponse(pos_corr)

Going through the code, I found a comment preceding a line:


# NB PsychoPy doesn't handle a 'correct answer' for mouse events so doesn't know how to handle mouse with StairHandler

trials.addData('mouse_6.x', mouse_6.x)

So I suspect that it has been returning false because of this. There is no keyboard component in the experiment.

Is there any way that I can set up the response for the staircase manually? Thanks in advance!

OS (e.g. Win10): Mac Big Sur
PsychoPy version (e.g. 1.84.x): 2020.2.8

To add a line in your data file use

thisExp.addData(‘column name’,value)

Hi wakecarter, thanks for the response! I don’t want to add a line to my data file though, I want to set up a variable as the response for my staircase update. Do you have any solutions for that?

Are you asking

a) How to record whether the target circle contains the mouse, e.g. in End Routine

if target_circle.contains(mouse):
     pos_corr = 1
else:
     pos_corr = 0

or

b) How to save the string of responses, e.g. using

trialScores.append(pos_corr)

Neither. The question is how to update the staircase with a response manually computed from mouse position and not a keyboard input.