How to Reverse Score output

OK, that makes it clear (and a good example of why it is useful to provide the literal error message rather than an interpretation of it: it is easy to go awry if you don’t know how to read the key message).

The issue is that the rating scale is returning the response as a character string (ie str) rather than an integer (int) and it isn’t possible to effectively subtract a letter from a number. I don’t know enough about rating scales to say if it could be configured to directly return a number, but you can convert the result yourself, e.g. convert the string '1' to the integer 1 like this:

resp = (7 - int(ratingScale.getRating()))

Also see this post about how to get formatted code in this forum: