First download the HelloWorld.zip folder and unpack it, open the folder and open HelloWorld_experiment.psyexp.
This is a very simple ‘experiment’ (it’s not really an experiment). Run the experiment before you start editing it by pressing the play button, entering any participant number and pressing ‘ok’. You should see a screen that displays the numbers 3, 2 then 1 - each number is on the screen for one second. Finally, a screen saying ‘Hello World (press space to end)’ will be shown - press space to finish. Now you know what the experimental file does, it’s time to start playing around with it. Feel free to try whatever you want, but below are some things to guide your exploration.
What you learn
The idea is that making changes to the PsychoPy experiment will help you get a feel of opening, running and modifying PsychoPy experiments. This introductory experiment is aimed at helping you:
- Modifying basic components of loops, routines and components.
- Getting used to the idea of linking information in the excel file to the PsychoPy experiment.
- Changing the Excel file.
- Adding new components.
Things to change
1. Change the order of the numbers so they appear in random.
Click on the trials
loop - see what options are available to you when you click on it, what happens when you change these?
2. Make the numbers appear on the screen for only 0.5 seconds.
Click on the count
routine, within there is a component called text
- see what options are available to you when you click on it. You can try changing any of these options and see what happens.
3. Add more numbers - count down from 10.
This is a little less obvious, so don’t worry if you are having trouble. In the folder where the experiment file was located there is an Excel file called - ‘Trials’ - open this up, make some changes, save it and go back to the PsychoPy experiment. You may need to reload the Excel file into PsychoPy this is done from within the Trials
loop.
4. Make the numbers stay on the screen until a response from the participant is given.
To do this you will have to modify the duration of the component text
within the count
routine, and you will also need to add a new response component to the same routine.
5. Change the numbers so that they display traffic light images - red, amber and green.
This is a bit more involved and really there are a few ways you can do this. You should remove the text
component from the count
routine. Then you can add an image, or a polygon. If you add an image you will need to make (or find online) three seperate files - red, amber and green - the name of the image should be linked to the Excel file. Alternatively, you can link the colour of a polygon to the Excel file. Play about - find the most efficient way for you to make it work.
Test yourself
Question 1 | On the last screen of the experiment you have to press space for the experiment to exit. What column in the data generated for any run of the experiment gives you this reaction time?
key_resp.rt
All data generated for an experiment is saved the data folder automatically generated when you run a PsychoPy Experiment. Within that folder - each participant has a spreadsheet, text document and PSYDAT file. Opening the spreadsheet is the easiest way to get a quick overview of the data collected. Within that spreadsheet, components from the experiment have their own column, and names are appended to indicate what they reflect. In this case the component is called key_resp
and is appended with .rt
to reflect that data in that column is reaction time.
Question 2 | What value should you enter if you want a stimuli to remain on the screen indefinately?
In the duration (s)
property of any component you can specify how long that component should appear on the screen for. If you want, as we often do in an experiment, to wait for a response you can specify that the component is kept on the screen indefinitely by leaving this value blank.
Question 3 | If you wanted to accept multiple different keys in a keyboard response what would you use to deliminate keys?
Sometimes you will need a participant to choose from more than one response, in this case make sure the ‘Allowed keys’ property of a response component has the keys separated by a comma.