Prevent experiment start after failed calibration

Dear colleagues! We created our own plugin to allow our custom eye tracker to work with Psychopy. However, we encountered a problem: if calibration takes a long time or fails on the first attempt, the experiment still starts after a while. Is there a way to prevent Psychopy from starting an experiment without successful calibration in the settings? Or does this need to be configured in the plugin?

Hi There,

We would need to know more about the plugin itself to advise specifically, however if your plugin returns some variable like calibration_pass = False you could be able to use a code component to call core.quit() ?

Thanks,

Becca

Yea more detail is needed.

If calibration fails, there’s going to be math that involves dividing by 0, and python is going to get upset.

This means you overrode that check, or you your plugin isn’t working as intended.

My guess is when trying to do a timeout for fixations at various points, it still thinks a timeout is ok, and then carries on. The plugin itself isn’t creating a “failed calibration state” and crashing. Once the plugin does that, you then have your plugin instead put up a prompt saying “calibration failed. Would you like to try again?” Or have psychopy see that failed state value and do the same thing, as @Becca mentioned.

Issac