Different task condition for each picture

Hello everyone, sorry if I’m asking something very easy. I am very new at Psychopy. I’m trying to create an experiment but ı’m not very good at coding. ı can simple things. I will be grateful if someone can help me with this.
**What are you trying to achieve?: I’m trying to create a memory test. During the test phase, I will show 10 pictures to the participants, but while showing these pictures, if they have seen that picture before, they will answer as old, if not, they will answer as new.
I want to show random pictures and show a different task if that picture is in the recall task and they answered as old. For example, when a picture is shown and gives a correct answer, I want to show a task related to that picture. but the tasks will be separate for all the pictures.

One way of doing this would be to have a presentation loop that appends the presented image names to a list and then breaks after X iterations

Then in the text loop you could check whether the current filename is in the presented list to see whether it had been seen before.

Code you might use:

# Begin Experiment
presented = [] 

# Presentation Loop Begin Routine

if presentation_loop.thisN == X-1:
     presentation_loop.finished = True

# Test Loop Begin Routine

corrAns = 'o'
if imageFile in presented:
     corrAns = 'n'

1 Like

Thank you very much @wakecarter :slight_smile: I am trying this way.

Hello again
Your solution looks fine, but since I’m very new to psychopy, I had a hard time understanding what you’re trying to do… so I’d like to re-explain my task a bit simpler. I want a loop to run according to their correct answer for different images coming here. all images are matched to a duty cycle. For example, if it gives the correct answer in the image 1 picture in the excel file, the trial 1 loop should appear. then the loop should go back to the beginning and do the same for the other pictures and the trials_4 loop should end.

I am trying to write o code like ‘if keyresp.corr for image2 trial2=1’
memory context.psyexp (23.8 KB)
I would be very happy if you can help