31  Lab 6 exercises

31.1 Main exercise

In this exercise, you will modify a choice reaction time task.


Once downloaded, unzip the file and open the experiment using PsychoPy and the input file using Excel.

Exercise 1: Use an Image component

Remove the Text component in the routine trial and use an Image component instead. Use two different images in your experiment (replacing the previous stimuli “&” and “%” in the experiment you downloaded; you can use the two images from Lab 5 if you would like to). On each trial, one of the images should be presented.

Also, change the response keys to use the arrow keys on the keyboard.

Make sure to adapt the input file and the task instructions accordingly.

PsychoPy comes with a number of helpful demos. Before using the demos for the first time, you need to unpack them (Demos → Unpack Demos…). If you are using one of the iMacs, unpack them on the Desktop. If you are using your own machine, choose a location of your own liking.

Once unpacked, open and run the demo keyNameFinder. When keyNameFinder runs and you press a key on the keyboard, the name of this key in PsychoPy will be displayed on the screen.

Location of the keyNameFinder demo in the menu bar.

Exercise 2: Use a Polygon component

After having saved your previous exercise, make a copy for this exercise. Then, remove the Image component in the routine trial and use a Polygon component (located in Stimuli components) instead. Change the colour of the Polygon component from trial to trial.

Make sure to adapt the input file and the task instructions accordingly.

31.2 Challenge exercise

The 2-letter version of the letter flanker task has a potential confound: congruent stimuli always consist of exactly the same letters, whereas incongruent stimuli consist of different letters. Maybe the interference effect is due to the fact that the row of identical letters in congruent trials speeds up letter recognition, and not the fact that in incongruent trials flanker and target map onto different responses?

Investigate this question by creating a 4-letter version of the flanker task as a 4-letter version allows for congruent trials where flankers and target differ.

The four letters in your task and the correct responses are:

  • B and G: left arrow key
  • D and Q: right arrow key

For the purpose of defining correct responses in an input file, the names for the arrow keys are left and right.

Please create an experiment that fulfils the following criteria:

  • Congruent and incongruent trials should be equally frequent.
  • Congruent trials should not include strings of identical letters (e.g., BBBBB).
  • There should be 64 trials overall.
  • The input file should be repeated 4 times.
  • The letter presentation should begin 0.5 seconds after the start of the trial.
  • The presentation of the letters should end when a response key is pressed.
  • Trials should be presented in random order.
  • PsychoPy should write accuracy information to the output file.
  • Trial-wise congruency should also be coded in the output file.

Your stimuli should be:

  • 150 pixels high
  • White on black background
  • Presented in the centre of the screen

Start by opening my version of the flanker task the you downloaded in Lab 5 and try to work out how this task works. Run it. Play around with it. Change things and see what happens. As mentioned in the previous lab, you can’t really break anything. If you change something and the task no longer works, simply download it again (or make a copy or the original version before you make changes to it).

Once you think you have a sufficient understanding of how the task works, adapt this two-letter version instead of creating a completely new experiment.

The basic idea is to create all possible letter combinations that meet the criteria defined above.

You might be puzzled by the fact that you end up with fewer possible congruent stimuli (4) than incongruent stimuli (8). The solution is to simply duplicate the congruent stimuli, so you have eight congruent and incongruent stimuli.

These are your eight congruent stimuli:

BBGBB, BBGBB, GGBGG, GGBGG, DDQDD, DDQDD, QQDQQ, QQDQQ

These are your eight incongruent stimuli:

DDBDD, QQBQQ, DDGDD, QQGQQ, BBDBB, GGDGG, BBQBB, GGQGG

You now have 16 “conditions” in your input file. Thus, you need four repetitions to achieve 64 trials overall.

You can watch a video of the solution here: