How to create image feedback

Hi everyone,
I’m trying to create a feedback to the participant’s response which is made up of an image. It is a task for children so:

  • when the participant answers correctly, I would like to appear a happy image
  • when the participant answers incorrectly, I would like to appear a sad image
  • when the participant does not respond I would like to appear a surprised image.

I tried to insert these feedback in my experiment by creating a loop and inserting the names of the images in the excel, then I created a code that would recall the image according to the type of response but it doesn’t work.

Can you help me?

Hello PsychoB

you need to provide more information. For instance, the code that you used for checking for the response type. Also, you need to be more explicit in telling us what did not work. Where there no feedback pictures? Did the experiment not run? How do you register the response?

Best Jens

Thanks for your interest JensBoelte,

This is my code

-> In before experiment
feedback = “type_of_image”

-> In end routine
if ssig and not SST_resp.corr:
feedback = “surprise.png”
elif not ssig and not SST_resp.corr:
feedback = “sad.png”
else:
feedback = “happy.png”

Legend:
ssig: stimulus of interest
SSt_resp.corr: correct answer
surprise.png or happy.png: the name of image in my excel
type_of_image: the name of raw in my excel.

The experiment not run if I put this in my code.

Hello PsychoB

do you mind uploading a toy-version of your experiment, e.g. *.psyexp, *.png, *.xlsx.

when you post code, surround it by triple `.

Code surrounded by triple ` will be formatted making it easier to recognize errors. Compare

msg = "too slow"
if (response.rt < 1.5):
    continueRoutine = False

with

msg = “too slow”
if (response.rt < 1.5):
continueRoutine = False

There is no error message?

is not detailed enough. You need to provide more details.

Best wishes Jens

Hi Jens I had a similar problem and it seems you might be a great help for my question here: TypeError '>' not supported between instances of 'list' and 'float' (feedback only after 1.5s). Can you help me with respKey.rt[-1]<= 1.5 thank you so much. sorry for cross-posting the question in advance.