# Delayed feedback

**URL:** <https://discourse.psychopy.org/t/delayed-feedback/7297>\
**Category:** Coding\
**Created:** [April 3, 2019, 8:33pm UTC](https://discourse.psychopy.org/t/delayed-feedback/7297 "2019-04-03T20:33:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smile667](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@smile667](https://discourse.psychopy.org/u/smile667)\
**Post date:** [April 3, 2019, 8:33pm UTC](https://discourse.psychopy.org/t/delayed-feedback/7297/1 "2019-04-03T20:33:23Z")

</div>

**OS** (e.g. Win10): Windows 10 home  
**PsychoPy version** (e.g. 1.84.x): 1.90.1

Hi, I’m having trouble with one aspect of my experiment. Participants are shown a stimulus and they give their answer, which is recorded. Then after they complete all the tests I want them to receive feedback on all their answers. I couldn’t figure out how to provide feedback if the tests were in the loop so in the end I’ve put each test and corresponding feedback as a separate routine. It all worked fine with substitute words, but once I put in actual words and stimuli it only gives incorrect feedback…  
My test routine looks like this:

 ![2019-04-03%20(3)](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/2/62916fa91d2f86ae9a33776ccc38581f588a329b.png)  
with the code component like this:

```auto
Begin Experiment:
import string
allLetters = list(string.ascii_lowercase)
Begin Routine:
textFill = ''
Each Frame:
keys = event.getKeys()
if 'escape' in keys:
    core.quit()
else:
    if keys:
        if keys[0] == 'space':
            textFill += ' '
        elif keys[0] == 'backspace':
            textFill = textFill[:-1]
        elif keys[0] in allLetters:
            textFill+=keys[0]
        showresponse1.setText(textFill)
End Routine:
thisExp.addData("textResponse", showresponse1.text)
if showresponse1.text.lower() == answercorrect1.text.lower():
    correctResp = 1
else:
    correctResp = 0

```

My feedback routine looks like this:

 ![2019-04-03%20(2)](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/d/6/d6146c9a03716a98efe37768b57a237d402f84d5.png)  
with the code component like this:

```auto
Begin Experiment:
msg=''
Begin Routine:
if showresponse1.text.lower() == correctanswer1.text.lower():
    msg="Correct!"
else:
    msg="Incorrect!"

```

Basically what I need is for my feedback routine to be able to tell whether the showresponse from the test routine is the same as the correctanswer component. Like I said it seemed to work fine with substitute words, but when I put in actual stimuli it stopped.

I’d appreciate any help!
