Help me! Rating scale nodes logging
Hello!
I'm working on an experiment that includes rating scales (going from 1-9), but when I run the experiment, in the logging document the rating is logged from 0-8 and I would like this to be logged as 1-9, but I don't know how to change this! Can someone please help me with this?
Thanks in advance!
Comments
Hi Eykman,
I believe Python starts counting at 0 so thats the reason your values are lower. If you want to count the 'normal' way you could add an
inline_scriptdirectly after your rating scaleformand add:Or, if needed, replace 'question' with the name of your variable.
Laurent
Hi,
When I tried to do it with the latest OpenSesame, I got an error as below.
"TypeError: can only concatenate str (not "int") to str"
I know what it means, but what is the best way to solve it with OpenSesame script (in a form_base plugin)?
Thanks
Hi @rrr,
A "TypeError: can only concatenate str (not "int") to str" error in rsponse to something like:
...means that one of the two elements you're trying to add is not numerical but a string. In this specific example, since 1 is definitely numerical, it must mean that
var.question1is a string. I'm gonna assume that thevar.question1contains the string form of a digit (e.g., "1"). You'd have to convert the string to an integer number. You can doi that using theparseInt()function in Javascript. Note that there are other ways to convert a string to a numerical value (see https://deadsimplechat.com/blog/5-ways-to-convert-string-to-a-number-in-javascript/) but in this specific case, partseInt should do.Hope this helps,
Fabrice.
Hi @Fab ,
Thank you for the advice.
Does it mean that we just add the code in python inline script? An error happens like "NameError: name 'parseInt' is not defined".
Also I'm just wondering whether there are easier way to log rating data along with the scale points such as 1-7.
Thanks
Hi @rrr,
parseIntis a javascript function. If you're using Python, you'd just have to use the Pythin equivalent (wihch isInt). the logic remains the same.There are any mumber of ways to collect ratings. If all you need is for the participant to select a value from, say 1 to 7, in response to a single item or statement, you could of course just present the statement in a sketchpad and use a keyboard object to take a response (1 to 7).
Best,
Fabrice.