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

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!

Hi @robertqin, please follow these guidelines for correctly formatting your code with backticks, that way it will be easier to read and we can more easily provide help.

Got it! 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.