# Need help in getting feedback based on rating scale response from previous rountine. Partial Success

**URL:** <https://discourse.psychopy.org/t/need-help-in-getting-feedback-based-on-rating-scale-response-from-previous-rountine-partial-success/4181>\
**Category:** Coding\
**Created:** [March 22, 2018, 10:01pm UTC](https://discourse.psychopy.org/t/need-help-in-getting-feedback-based-on-rating-scale-response-from-previous-rountine-partial-success/4181 "2018-03-22T22:01:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertqin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/robertqin/32/2269_2.png) [@robertqin](https://discourse.psychopy.org/u/robertqin)\
**Post date:** [March 22, 2018, 10:01pm UTC](https://discourse.psychopy.org/t/need-help-in-getting-feedback-based-on-rating-scale-response-from-previous-rountine-partial-success/4181/1 "2018-03-22T22:01:26Z")

</div>

Hi all,

I am very new to python and psychopy. In my current experiment, I am trying to report a score back to participants based on their choice from previous routine. I used the rating scale (name: rating) to get choices. Currently it is binary (0 and 1)

I built a loop that repeats 4 times like this:

Choice → Feedback

In the feedback routine, I inserted codes like this:  
Begin Experiment:

> msg=‘’ #msg is empty  
> balance = 1500

Begin Routine:  
choice = rating.getRating()

> if choice == 1:  
> balance = balance - 200  
> msg = balance  
> else:  
> msg = balance

I am able to get the correct feedback. The problem is that, however, the feedback is one trial late. The feedback for trial one is shown after Choice Screen of trial two, and so on, while the Feedback screen in trial one is blank. I would appreciate any help on this matter! Thanks so much!

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [March 22, 2018, 10:45pm UTC](https://discourse.psychopy.org/t/need-help-in-getting-feedback-based-on-rating-scale-response-from-previous-rountine-partial-success/4181/2 "2018-03-22T22:45:14Z")

</div>

Hi @robertqin, please follow [these guidelines](https://discourse.psychopy.org/t/please-surround-python-code-with-backticks/1775?u=dvbridges) for correctly formatting your code with backticks, that way it will be easier to read and we can more easily provide help.

---

<div class="post-metadata">

**Author:** ![robertqin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/robertqin/32/2269_2.png) [@robertqin](https://discourse.psychopy.org/u/robertqin)\
**Post date:** [March 24, 2018, 2:00am UTC](https://discourse.psychopy.org/t/need-help-in-getting-feedback-based-on-rating-scale-response-from-previous-rountine-partial-success/4181/3 "2018-03-24T02:00:04Z")

</div>

Got it! Thank you for the tip!

---

<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:** [March 25, 2018, 5:56am UTC](https://discourse.psychopy.org/t/need-help-in-getting-feedback-based-on-rating-scale-response-from-previous-rountine-partial-success/4181/4 "2018-03-25T05:56:41Z")

</div>

> [@robertqin](#):
>
> Thank you for the tip!

It wasn’t so much a tip as a plea. In Python, indentation has meaning, and people will generally not bother trying to debug someone’s code if they can’t see it properly formatted. So you really do need to edit your post as David suggests if you hope to get an answer.
