OS MacOS 10.15.3
PsychoPy version 3.2.4
Standard Standalone? (y/n) y
Hey everyone,
So I’m designing an experiment where I randomly pair a list of faces with 5 job titles in an encoding task. To do this, I set a randomizer called “dice” to randomly draw 5 numbers, then an if statement that takes whichever number was drawn and ties it to the face, repeating 45 times.
So I inserted a code component in the encoding routine to make the position randomizer. The code looks like this:
dice = np.random.randint(5, size = 1)
if dice == 0:
title = "Vice President"
elif dice == 1:
title = "Director"
elif dice == 2:
title = "Middle Manager"
elif dice == 3:
title = "Entry-level Employee"
elif dice == 4:
title = "Support Staff"
else:
title = "None"
thisExp.addData("jobTitle", title)
This seems to work, but the issue I’m having is that there’s a recognition task that includes 90 faces, 45 of which were seen previously and 45 foils. I can’t seem to get the code to take the job titles that were applied in the encoding task and have them paired with the same faces in the recognition task. I’ve either had them all paired with “None” or one of the other titles.
What did you try to make it work?:
I inserted a code component in the recognition routine where I tried writing an if statement that takes the job title from the data and applies it to a new name, like this:
if title == 0:
recogTitle = "Vice President"
elif title == 1:
recogTitle = "Director"
elif title == 2:
recogTitle = "Middle Manager"
elif title == 3:
recogTitle = "Entry-level Employee"
elif title == 4:
recogTitle = "Support Staff"
else:
recogTitle = "None"
thisExp.addData("recTitle", recogTitle)
I’ve tried statements that replace the word “title” with “dice” or “jobTitle” and neither has worked out the way I need.