Please help me run this simple experiment

I tried to run an experiment where a set of faces (faces with headscarf and with no headscarf), with the condition where the set of faces will presented at random. In the memorization phase, there should be 16 pictures in total (8 with headscarves, 8 without headscarves). In total, there would only be 8 individuals, since their each of them provided a picture with headscarf and one picture without headscarf), but I could not seem to figure out how to make sure only 8 faces were presented for each participants, assuming the same individual’s faces were not presented.

The problem I faced was specifically in the excel file since I could not figure out the labels that I need to put for psychopy to be able to only present 8 faces for each participants, with no repeating individuals’ faces used.

Hi @skyfiz,

here is an idea: Have your conditions file have 8 rows and 2 columns. The rows represent your 8 faces, the 2 rows contain the image paths for that face with (column withHS) and without (column withoutHS) headscarf.

Then, add a code component to your trial with the following content:

Begin experiment

HS = [0,0,0,0,1,1,1,1]
shuffle(HS)

Begin routine

if HS[YourLoopName.thisN] == 0:
    image_file = withoutHS
    thisExp.addData("condition", "without")
elif HS[YourLoopName.thisN] == 1:
    image_file = withHS
    thisExp.addData("condition", "with")

thisExp.addData("image", image_file)

Then use $image_file in your image component set to “set every repeat”.

1 Like

Thank you so much for this response! It really helps and now it runs perfectly!