# Feedback after a wrong response

**URL:** <https://discourse.psychopy.org/t/feedback-after-a-wrong-response/5731>\
**Category:** Coding\
**Created:** [November 5, 2018, 6:39pm UTC](https://discourse.psychopy.org/t/feedback-after-a-wrong-response/5731 "2018-11-05T18:39:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DocPsy](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@DocPsy](https://discourse.psychopy.org/u/DocPsy)\
**Post date:** [November 5, 2018, 6:39pm UTC](https://discourse.psychopy.org/t/feedback-after-a-wrong-response/5731/1 "2018-11-05T18:39:59Z")

</div>

Hello!!  
I’m trying to do a lexical decision task with two buttoms of response “p” and “a”. I would like that a feedback (a fixation cross) appeared when participant give a wrong answer. To do that, i’s tried in “begin routine” this code:

```auto
if resp.corr:
continueRoutine = FALSE

```

But when I try to run the experiment, every trial is followed by the feedback. I defined “correct answer” with the name of my correct answer in my file.xlsx. ($Corresp)

Thanks for your help

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [November 5, 2018, 8:44pm UTC](https://discourse.psychopy.org/t/feedback-after-a-wrong-response/5731/2 "2018-11-05T20:44:48Z")

</div>

The second line would need to be indented: please be careful about showing indentation in your Python code, as it has meaning.

You need to describe your task implementation a bit more. Is this code in the “begin routine” tab of the feedback routine, which follows the question routine?

---

<div class="post-metadata">

**Author:** ![DocPsy](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@DocPsy](https://discourse.psychopy.org/u/DocPsy)\
**Post date:** [November 5, 2018, 8:49pm UTC](https://discourse.psychopy.org/t/feedback-after-a-wrong-response/5731/3 "2018-11-05T20:49:48Z")

</div>

Hello @Michael. i put these codes in the feed-back routine which follow the trial. In this task, participant should determine if the Word presented in the screen is the real Word or not. The feed-back follow participant’s answer

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [November 6, 2018, 5:56am UTC](https://discourse.psychopy.org/t/feedback-after-a-wrong-response/5731/4 "2018-11-06T05:56:38Z")

</div>

> [@DocPsy](#):
>
> I defined “correct answer” with the name of my correct answer in my file.xlsx. ($Corresp)

- Did you specify that variable in the keyboard component?
- is the code you give above the _exact_ code you are using? Please cut and paste it rather than typing it from memory. For example in Python, it should be `False` rather than `FALSE`

What happens when you insert this (don’t keep these print statements in the final version of your experiment, they are just for temporary debugging):

```auto
print(Corresp)
print(resp.keys)
print(resp.corr)

if resp.corr:
    continueRoutine = False

```

---

<div class="post-metadata">

**Author:** ![DocPsy](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@DocPsy](https://discourse.psychopy.org/u/DocPsy)\
**Post date:** [November 6, 2018, 8:08am UTC](https://discourse.psychopy.org/t/feedback-after-a-wrong-response/5731/5 "2018-11-06T08:08:58Z")

</div>

Hello agai,  
I found the problem. I needed to write the code :

```auto
if(resp.keys == RepCorrecte):
    continueRoutine = False

Thanks!
```
