can't change value of variable

More
5 years 1 month ago #87401 by Mbambuto
Mbambuto created the topic: can't change value of variable
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
5 years 1 month ago #87409 by DenisChenu
DenisChenu replied the topic: can't change value of variable
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).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: Mbambuto

Please Log in to join the conversation.

More
5 years 1 month ago #87417 by TMSWhite
TMSWhite replied the topic: can't change value of variable
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
5 years 1 month ago - 5 years 1 month ago #87419 by Mbambuto
Mbambuto replied the topic: Aw: Re: can't change value of variable
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: 5 years 1 month ago by Mbambuto.

Please Log in to join the conversation.

More
5 years 1 month ago #87422 by Mbambuto
Mbambuto replied the topic: Aw: Re: can't change value of variable
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
5 years 1 month ago #87957 by Mbambuto
Mbambuto replied the topic: Aw: can't change value of variable
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.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!