I am using a free format to collect some data and I am saving the collected answer (one value per question) in a certain variable.

I wanted to perform simple algebra on the value (subtraction from 10 and dividing by 10) and then save it in a new variable to use it in the analysis.

Note that I am displaying the value while the respondent is answering, so I can't perform this equation on the same variable. So I believe I need to save it to a new variable.

1- Is that correct?

2- how is that done?

3-how could I check if the equation was performed correctly?

Thanks a lot

Regards;

AMYN

I've tested this solution and it works nicely on a single response select question. This will work on any question of this type without editing the script. You don't even need to change the question number.

You can change the calculation / arithmetic for the new variable by changing the script. This version will minus 10 from the original variable.

Place this where you want the updated variable to appear ...

Now place this JavaScript into the footer of the same question ...

If you need any further variations of this, you can reach out via the forum or contact Zachary at zachary@sawtoothsoftware.com.

Hope this gets you sorted out.