Feedback using different pictures after correct answers

Hi guys! I’m designing an experiment for young children using the builder. Blue and red bricks are being shown and the children have to press a button if they see a red brick. The “story” we would like to tell them is that the goal is to build a tower (made out of red and blue bricks). I would like to give them feedback about the tower if they give a correct answer to remind them of the goal. I made a feedback where they just see a picture of the finished tower but it would be better if they actually saw the process of the tower being built.

So I would like to show different pictures in a fixed order as feedback after every correct answer. So for example after one correct answer they would see one line of the tower, after a second correct answer an other line etc. Is this possible to make? :slight_smile: Thanks for the help in advance!

Hi There,

Firstly, this task sounds awesome.

Secondly, this is totally doable and there are multiple ways of achieving this.

One solution is to make a list of stimuli that you want to present in a code component. e.g.

In your begin experiment tab:

feedback_images = ['Picture1.png', 'Picture2.png', 'Picture3.png']
corrCount = 0

Then in your end routine tab draw the image:

if key_resp.corr:
    thisImage=feedback_images[corrCount]
    image = visual.ImageStim(win, image=thisImage)
    image.draw()
    win.flip()
    core.wait(2)
    corrCount=corrCount+1

if you only want to show feedback on red bricks you could adapt this last bit to include that in your if statement:

if key_resp.corr and colour=='red': #colour is a variable in your conditions file
    thisImage=feedback_images[corrCount]
    image = visual.ImageStim(win, image=thisImage)
    image.draw()
    win.flip()
    core.wait(2)
    corrCount=corrCount+1

Hope this helps!

Becca

example builder file towerFeedback.psyexp (13.3 KB)
example conditions file conditions.xlsx (8.5 KB)

Hi Becca,

thanks for you help, I really apreciate it! :slight_smile: I tried to use the code segments you’ve sent me, but I’m not very great at programming and it gives an error “AttributeError: Couldn’t make sense of requested image.”. I’ve uploaded the experiment file and the excel file I use. If you have time could you please look at it and help me figure out what is wrong? Example.psyexp (29.8 KB)
block1.xlsx (8.8 KB)

Hi There,

OK so a subtle difference is that you have your feedback image in a different routine (“feedback1” in your file) whereas my example has the feedback presented in the same trial (both are totally fine!).

For your format, you will instead need the code component in the “begin routine” tab and you will want it to look something like this:

if key_resp.corr:
    thisImage=feedback_images[corrCount]
    corrCount=corrCount+1

Then you want the “$feedback_images” in your “image_2” component to read “$thisImage”.

Note that now you are not creating a new image object in your code because instead you are feeding the filename directly to your image component.

Hope this does what you need,
Becca

1 Like

Hi Becca,

thank you for your help and explaining it so well! The feedback works perfectly and I even added a code part for wrong answers.

Good luck with whathever experiment you are designing now! :slight_smile:

1 Like

Ah fantastic - good luck putting your work “in action” - I am sure the participants will love the story line :slight_smile: