can't change value of variable

More
4 years 4 months ago #87401 by Mbambuto
I have created a survey with LS Version 1.92+ Build 120919 on my computer and tried to import that survey to another Server witch runs a different Build of LS. (1.92+ Build 120623, slightly older...)
Everything works fine, except some equatations.
For example, i have created a question to calculate this: aa_score=sum(aa_1, aa_2, aa_3, aa_4) / 4
aa_score is the Question code.
This works perfekt on my computer, but on the other server i get an error, saying that i am not allowed to change the value of aa_score.

Has anyone any ideas?
Thanks for the help!

Please Log in to join the conversation.

More
4 years 4 months ago #87409 by DenisChenu
Hello,

Think it's a bad idea to put directly:aa_score=sum(aa_1, aa_2, aa_3, aa_4) / 4 / And i'm surprised it working ????

You can use question type equation to do this.

Code: aa_score
Question text: {sum(aa_1, aa_2, aa_3, aa_4) / 4}

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
The following user(s) said Thank You: Mbambuto

Please Log in to join the conversation.

More
4 years 4 months ago #87417 by TMSWhite
Some people did need this, so it was added between 1.92+ releases. Try upgrading to latest 1.92+ release.

Please Log in to join the conversation.

More
4 years 4 months ago - 4 years 4 months ago #87419 by Mbambuto
Upgrading is out of the question, because it is not my server ^^

But changing {aa_score = sum(aa_1, aa_2, aa_3, aa_4) / 4} to
{sum(aa_1, aa_2, aa_3, aa_4) / 4} seems to help.
Thank you!

/edit
the question type is already equatation, but this is my first survey, so i might have done it a little bit more complicated then i had to ^^
Last Edit: 4 years 4 months ago by Mbambuto.

Please Log in to join the conversation.

More
4 years 4 months ago #87422 by Mbambuto
Another equatation is still problematic:
(It should simply invert a 5 point score)


{if(sod_1 == 1, sod_1_invert = 5,if(sod_1 == 2, sod_1_invert = 4,if(sod_1 == 3,sod_1_invert = 3,if(sod_1 == 4, sod_1_invert = 2,sod_1_invert = 1))))}

Again, i cant`t directly change the variables, but i can`t find a way to make this work without it.
In this case i get also additional error for the comma after sod_1 == 1.

Please Log in to join the conversation.

More
4 years 4 months ago #87957 by Mbambuto
changed it to:

{if(sod_1 == 1, 5,if(sod_1 == 2, 4,if(sod_1 == 3,3,if(sod_1 == 4, 2,1))))}

now it seems to work, if anyone has similar problems.

Please Log in to join the conversation.