Survey tool code component for scoring

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): win 10
PsychoPy version (e.g. 1.84.x): PsychoPy3
Standard Standalone? (y/n) If not then what?:y
**What are you trying to achieve?:**creating electronic version of Beck’s depression score using survey component

**What did you try to make it work?:**I am using the survey component, in builder. Excel headings:
index questionText options layout type questionWidth responseWidth questionColor responseColor
as per demo. Works well but data out put records response label e.g.I do not feel sad/ I feel sad much of the time/ I am sad all of the time/ I am so sad or unhappy that I can’t stand it rather than score. Is there a code component to assign a score to the response? In the ratings tool (testing another parameter) I have previously used a code component to create a score output
if rating.getRating() ==0:
thisExp.addData(‘intake’,0)
if rating.getRating() ==1:
thisExp.addData(‘intake’,score)
if rating.getRating() ==2:
thisExp.addData(‘intake’,3score)
if rating.getRating() == 3:
thisExp.addData(‘intake’,7
score)
if rating.getRating() ==4:
thisExp.addData(‘intake’,14*score)

is there a similar system that can be used for the survey component?
What specifically went wrong when you tried that?:
Include pasted full error message if possible. “That didn’t work” is not enough information.

Hi @esandhu, currently if you use radio responses, you only get the label of the rating, not the value. I can get this fixed, but in the mean time, if you use type “rating” for your responses, you get the value rather than the label of the rating.