Programming with PsychoPy, Final assignment

It is time for the grande finale: the final assignment. We prepared for you a template with example functions, code snippets and useful comments. It contains the examples from this course and much more. You can use these functions from the template directly or you can copy them into your own experiment and change them. It often makes sense to change the name of the function if you change it's behaviour. Look in lesson 6 to see how to use the functions directly.

The experiment

As final assignment you will write an experiment.

We present a text which serves as prime. Then we show an action picture. The participant must indicate wether the prime matches the action or not. There are both plausible and implausible actions. Will there be a faster reaction for plausible actions? Will there be a faster reaction for matching primes?

You will need these files:

image.zip
all 24 action pictures
stimuli.csv
all 48 different conditions
my.py
a few useful functions, from lesson 6
template.py
a well structured dummy experiment
template_stimuli.csv
conditions for the dummy experiment

Trial specifications:

  1. Present fixation, Wait (1000 ms)
  2. Present prime for 800 ms ("to taste", "to smell", "to listen", "to look")
  3. Black screen Wait (jitter 500 - 1500 ms),
  4. Present action picture for for a maximum of (2000 ms) waiting for response
  5. Play correct or false sound
  6. Black screen for 700 ms

  1. Use the template to make a well structured experiment.
  2. Use the timeline to build up the experiment bit by bit, start with presenting a fixation cross. Do not write huge chunks of code only to find out later that it doesn't work. Test after every addition.
  3. Create a 1000 ms delay and check the actual delay before the text stimulus is shown.
  4. Use the conditions file (stimuli.csv) the trials are defined in there.
  5. Read in a semicolon delimited file with the function my.getStimulusInputFile("stimuli.csv")
  6. Create all the text stimuli in the setup section
  7. Create all the picture in the setup section
  8. Add text "correct" and "incorrect" to the picture stimuli.
  9. Create a feedback for correct and incorrect responses.
  10. Present the text screen for 800 ms
  11. Present the black screen with a jitter of 500 - 1500 ms. hint; random.uniform()
  12. Present the picture stimulus
  13. Give the participant 2000 ms to react.
  14. Only except the responses "Y" and "N".
  15. Present a black screen for 200 ms
  16. Check with the conditions file's last column (n or y) if the answers given to the picture are correct and give feedback
  17. Log which button is pressed and the time the button is pressed.
  18. Log all the times when pictures are presented
  19. Write all the logged data to the hard disk use writer.writerow()
  20. Check if the output file is correct