| Reference | Downloads | Github

Getting entered string data to appear later in the experiment

Hi all,

I am a complete novice in both Psychopy and Python coding and need a bit of help. Our lab is moving towards online testing given the current lockdown situation and I could use some guidance around the construction of an Implicit Association Test (IAT).

I have managed to design and successfully run a basic IAT in Psychopy. I understand the basic Psychopy GUI but am clueless when it comes to coding in Python.

The main issue is that we need demographic information entered by the participant at the start of the experiment, to appear as stimuli in the IAT trials later on. One of the IAT categories will be ME vs NOT ME stimuli and we would like the “me” stimuli to be the participants’ own name, date of birth, home town etc. So, the vague plan is to get the participant to enter their name, date of birth, home town etc in a demographics section at the beginning and then we need Psychopy to store this information and then present it in the later IAT trails.

Do you know if a) this is at all possible b) how this could be done?

a) It is definitely possible :wink:

b) The information entered in the dialogue box at the beginning of the experiment is stored in a python dictionary with the name expInfo as key - value pairs. For example expInfo['participant'] returns the value you enter for ‘participant’ in the dialogue box.

The trial list (trialList) of a loop, which you use, to loop over your IAT items has a list of dictionaries to define the items in every trial. The trial list is stored as an attribute of a TrialHandler.

In your conditions file, you could have placeholder default values for the information you want to insert. What you’ll need to do is insert the entries from expInfo in your trial list at the correct point to replace the placeholder values from your .xlsx conditions files.