Saving responses to call images up again later


I am looking for help with some coding for an experiment. Essentially the experiment works that the participant will be shown an image, and then asked 3 questions about the image. I will use a text object with responses for the questions.
I want to then take their response from question 3, record this response, and then use if to show them the same images later.
For example:
We have 9 images
They select the correct response to question 3 for 4 of the 9 images.
They are then shown the 4 images they correctly identified, on one screen, and will be asked to pick one.

The help I am looking for is with coding this. I am guessing I’ll need to store correct answers in a list, and then use this to call back the images?

Any help would be great.

Thank you

Here is a simple example of what you are describing. Images are presented, that have a correct or incorrect response defined in the conditions file. If the correct answer is left, and the user clicks the “left” text on screen, the answer is correct. If the answer is correct, the image name gets saved in a list for later. After the loop of images has been presented, the list of saved images is presented on screen. This is achieved by creating image place holders (I used 6, you will need 9) and setting the images of those placeholders using the list of image names we stored in a list.

Here is the example and files

cond.xlsx (7.9 KB) condImage.psyexp (23.6 KB)





This is a fantastic help and it works fantastically. Do you know how to go about switching it to keyboard? I added a keyboard response and changed the coding from if corrAns in mouse.clicked_name[-1].lower(): to if corrAns in key.resp(): but it’s giving me an error for the Keyboard.

Thank you