Spreadsheets
One of the aspects I love about PsychoPy is its use of spreadsheets. Before I switched to PsychoPy I used to user SuperLab 2. At the time, you had to enter all of the trial specifications directly into the software. I used to set up the framework of an experiment and then leave the student (whose project I was working on) to laboriously enter the stimuli and then connect each item to the corresponding trial. With SuperLab 4 this aspect was made much easier, but that effectively meant that I no longer had any aspects to delegate to the student.
On the other hand, in PsychoPy I can show the student a template spreadsheet and then ask them to send me an updated one with their stimuli / conditions / file names, etc.
A PsychoPy spreadsheet needs to have variable names in the first row and then conditions the values for those variables in the following rows. There should not be any empty rows and the variable names must not contain spaces. The format can be CSV or Excel xlsx, but in the latter case only the first sheet is used.
What types of variables go in a PsychoPy spreadsheet?
Information: So long as ‘is trials’ is ticked in the loop then the values of each variable in the spreadsheet will be copied into the data file. This means that you might include variables such as ItemType which have no effect on the experiment, but will be useful at the analysis stage.
Text: You can set the text of a text or textbox component to come from a spreadsheet. This is usually used for text stimuli, but it can also be used for longer text, such as instructions. The cells can contain newlines, but their behaviour can be different online compared with locally and Excel vs CSV.
File names: Media cannot be embedded into a PsychoPy spreadsheet. Instead, you can include the file name, including the relative path and extension, such as images/hat.png
.
Parameters: Many numeric parameters can be updated via a spreadsheet. Lists don’t always work so one option is to set the values (for example of positions or colour channels) separately.
Correct Answer: Keyboard components (and mouse components in the most recent versions) can accept a variable as the correct answer. If the response matches the given answer, the .corr value is set to 1, otherwise it is set to 0.
Spreadsheet names: If you set up concentric loops, the spreadsheet for the outer loop can specify which spreadsheet to use in an inner loop. However, in another tip, I recommend setting the selected rows instead.