Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: can't change value of variable

can't change value of variable 1 Jahr 11 Monate her #87401

  • Mbambuto
  • Mbambutos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: can't change value of variable 1 Jahr 11 Monate her #87409

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6362
  • Dank erhalten: 827
  • Karma: 245
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: Mbambuto

Re: can't change value of variable 1 Jahr 11 Monate her #87417

  • TMSWhite
  • TMSWhites Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 759
  • Dank erhalten: 82
  • Karma: 36
Some people did need this, so it was added between 1.92+ releases. Try upgrading to latest 1.92+ release.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Aw: Re: can't change value of variable 1 Jahr 11 Monate her #87419

  • Mbambuto
  • Mbambutos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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 ^^
Letzte Änderung: 1 Jahr 11 Monate her von Mbambuto.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Aw: Re: can't change value of variable 1 Jahr 11 Monate her #87422

  • Mbambuto
  • Mbambutos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Aw: can't change value of variable 1 Jahr 10 Monate her #87957

  • Mbambuto
  • Mbambutos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.143 Sekunden
Donation Image