How to display an image on screen from previous routine

Hi there,

I have an experiment where, in one routine, I have two image components where participants have to make a choice of one of these images with a keyboard response component (so there are two response keys associated with both of these images). In another routine following this one, I want to present the image that was selected in the previous routine.

I can access which key was presented with the resp.keys variable in the output/data files, but I am unsure how to use that so I can present the image participants selected.

Thank you so much in advance!

Kind regards,

Let’s say your image variables are called image1 and image2 and your keyboard component is key_resp with ‘1’ for image1 and ‘2’ for image2 and your image variable for the later routine is called image3. You could then put the following in an End Routine code component tab in your choice routine:

if '1' in key_resp.keys:
     image3 = image1
elif '2' in key_resp.keys:
     image3 = image2

Thank you so much!! That’s worked.