Welcome, Guest
Username: Password: Remember me

TOPIC: can't change value of variable

can't change value of variable 1 year 10 months ago #87401

  • Mbambuto
  • Mbambuto's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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!
The administrator has disabled public write access.

Re: can't change value of variable 1 year 10 months ago #87409

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6318
  • Thank you received: 810
  • Karma: 242
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
The administrator has disabled public write access.
The following user(s) said Thank You: Mbambuto

Re: can't change value of variable 1 year 10 months ago #87417

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Some people did need this, so it was added between 1.92+ releases. Try upgrading to latest 1.92+ release.
The administrator has disabled public write access.

Aw: Re: can't change value of variable 1 year 10 months ago #87419

  • Mbambuto
  • Mbambuto's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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: 1 year 10 months ago by Mbambuto.
The administrator has disabled public write access.

Aw: Re: can't change value of variable 1 year 10 months ago #87422

  • Mbambuto
  • Mbambuto's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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.
The administrator has disabled public write access.

Aw: can't change value of variable 1 year 10 months ago #87957

  • Mbambuto
  • Mbambuto's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.106 seconds
Donation Image