[solved] Reversing rating scales and logging variables
Hi everyone ! First of all, i'd like to apologize for my english as I am french native.
I've just begun learning how to use open sesame and I have two questions I hope you can answer :
I wonder how to reverse the value of a rating scale ? If the subject clicks on node n°1 in a rating scale consisting of 5 nodes, I want the variable correspondant being equal to 4 instead of 0. It would be useful for coding reversed items.
My second question concerns the logger and variables. I am using scales in my experiment and i've separated each question in a form_base item. When open sesame logs the results, i want it to save each response individually, without calculating a mean for my scale. As a consequence, my only resort was to use a different variable name for each question, which totally separates questions which originate from the same scale.
So here's my question : Is it possible to store numerous values in the same variable without them being cumulated or averaged ?
I've uploaded two pictures to illustrate my second question.
![]()
![]()
I hope i was precise enough, I would be very glad if you could bypass my english and find the time to answer at least one of my questions.
Have a good day !

Comments
Hi Olivier,
Welcome to the forum!
As far as i know this is not possible using the
rating_scalewidgets since it is hardcoded into the plug-in. But there are a number of ways to work around that.Yes, that is possible by defining the variable as a
listbut you'll need to add some scripting.Looking over the pictures you added, it might be a better idea to create different
loopfor you different scales and initialize theformsthat contain the questions in aninline_scriptand loop over the questions sequential.Let's combine both questions: add a
loopitem into yoursatisfaction sequenceand add two variables, let's say 'scale_question' and 'recode'. The first variable contains all the questions, while the second variable only contains 'yes' or 'no', depending on whether the question needs recoding.In this new loop add a sequence that contains an
inline_scriptand yourlogger. In this script add something like the following:And as a final step, add another
inline_scriptat the start of yourquestionnaires_sequencein which you create an empty list:var.response_list = []If you now run your experiment you'll end up with a logfile that contains a variable with every individual answer in one column and a variable (your list) that contains all responses combined.
Let me know if this is what you had in mind and if it works!
Cheers,
Laurent
Hi Laurent !
Thank you for your response, which is really complete !
Your solution for reversing the rating scales works like a charm, and i've tried using the scripts as you intended for my second question.
At first i got great results, and as long as i was using only one loop, everything turned out great. The screenshot shows the expected result :
But when I tried using it on all my scales, my log file contained values I didn't enter. I think it's due to the fact that all my scales don't have the same amount of questions.
I had to learn to use inline_script and a bit of python_language, but still didn't succeed.
I finished by understanding what was the role of response_list and that i didn't need it : I want my questions in their respective scales, not in a general variable.
Your script was still useful and I will use it, I just have to figure out my last problem.
I doubt you can help me with so little cue about what is actually the problem i'm facing, but i'm still posting a screenshot, in case the solution is obvious.
Have a good day !

Hi Olivier,
Good that you got the first part working!
I'm not sure about the remaining issue though:
What exactly do you mean with 'scales' here? Is it the value in the likert-scale? Or a subset of questions in your questionnaire?
I'm assuming you mean the latter of the two. In that case, would it suffice to add additional variables to the questionnaire loops (e.g. satisfaction, CSB etc.) indicating the scale the questions belong to? For example, based on the first picture, you add a variable
Difficulteto yoursatisfactionloop and assign the values to the corresponding questions: 'm', 'f' or 'd'. Add theDifficultevariable to the logger and you should end up with the example you provided.Futhermore, and i should've thought of this earlier my apologies, you can replace the whole
if elsestatements for recoding the answer with something simpler:Let me know if this gets you any further!
Hi Laurent,

Thanks again for your response. Concerning the recode statement, your last version if effectively much simpler, even though I managed to get what i wanted with the first writing.
On the subject of my variables, I think you understood what i wanted to get, and as I asked the help of my professor, we eventually ended up with the exact result i was trying to reach.
To do so, we made only one loop containing all our variables : [recode], [scale_question], [domain] to precise the scale the question is coming from and [changement_label] which decides which label the rating scale should have at its sides. Like in so :
In the trial sequence following, we put all our inline_scripts which would be running only when their domain corresponded. As seen here :

By creating a single variable [reponses_items] containing all our responses, we had the [response_list] you were suggering, but the items were labelled by their [domain] and [scale_question] in the resulting file. It shows like this in the logger :

And I ended with a file looking like that :

Anyway, I couldn't have done it without your help and my professor, so thank you again.
I feel like I could do it again, and that's as important as having this final result.
Have a good day !
Hi Olivier,
Glad to hear it all works now. After seeing the last file i understand what the problem was. Good luck with your study!