I am trying to digitize a psych questionnaire in which some of the answers are reverse scored (ex. using a 1,2,3,4,5,6 scale, an answer of 2 becomes 5, an answer of 1 becomes 6, etc. The participant still answers on a 1-6 scale, but their scores are reversed later.) To do this, I want to create a formula so that when the “scoring” column in my spreadsheet = “reverse”, the participant’s answer is subtracted from 7. Is this possible in psychopy?
I’m using a rating scale of 1-6. This is the code I have tried. I have it in a custom code box under the End Routine tab:
if Scoring=="normal": revscore=ratingScale.getRating() thisExp.addOtherData("revscore", revscore) elif Scoring=="reverse": revscore=7-ratingScale.getRating() thisExp.addOtherData("revscore", revscore)
I get an error message saying that the - sign is not the correct format. I’ve also gotten several other error messages and the experiment has crashed on the reverse scored trials. I’m not sure what to do.
Thank you for your time and thought!
Mac OSX 10.10