Fix a PsychoPy experiment

Practise your PsychoPy error finding and fixing skills

PsychoPy
Python
Pavlovia

Attempt to fix the 15 issues incorporated into the PsychoPy experiment made available in this blog post.

Author

Jan Derrfuss

Published

June 28, 2022

 

In our previous blog post, we described some common PsychoPy error messages and how to find and fix the underlying issues. Here, we provide you with a “broken” PsychoPy experiment to give you an opportunity to practise your error finding and fixing skills. Your task will be to identify and fix the 15 issues incorporated into this experiment.

The first five students to identify and fix all 15 issues will get a certificate!1 Please note that rather than a running experiment, we expect you to us a document briefly describing the issues and how to fix them. Please note that only undergraduate and postgraduate students will be eligible for a certificate. Therefore, if you would like to obtain a certificate, please send the email from your university account. We will announce here when all five certificates have been given out.

I’ve come across all of the issues incorporated into the experiment in one form or another while teaching PsychoPy to our undergraduate students. Note that not all issues will stop the experiment from running. An issue could also lead to the feedback not working correctly or could mean that the results cannot be meaningfully analysed. You should be able to discover all issues using this blog post alone; i.e., there should be no need to start reading the very extensive literature on task switching.

In addition to our previous blog post, the PsychoPy chapters in my online book for our undergraduate practical methods classes will likely also provide some helpful pointers.

Experiment description

The experiment is a cued task-switching experiment. Participants have to complete two tasks in random order:

  • Task 1 is to decide if the target number is odd or even. This task is cued by a square.
  • Task 2 is to decide if the target number is below or above 5. This task is cued by a circle.

In addition, the cue-target interval (CTI) is manipulated. That is, the time between the cue onset and the target onset is variable (two levels: 0.2 s or 1 s). Participants can prepare for the current task as soon as the cue is shown, but they can only meaningfully respond once the target appears on the screen.

The stimulus-response mappings are as follows:

  • odd/below 5: left arrow key
  • even/above 5: right arrow key

If you feel you need more details about the paradigm, see Derrfuss et al. (2004) or search for cued task switching online.

The code components

As code components can be challenging for beginners, we briefly explain what the code components in this experiment do.

fbCode

  • This is part of the feedback routine.
  • The aim of this code component is to determine the type of feedback provided in the practice trials.

trialCode

  • This is part of the trial routine.
  • This code component assigns the CTI. While it would be possible to directly specify the CTIs in the conditions file, it is easier to modify them when they are defined using a code component.

Footnotes

  1. This might be helpful if at some point in your career you would like to provide some evidence for your PsychoPy skills.↩︎