Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Undefinied variable problem in Expression Manager

Undefinied variable problem in Expression Manager 1 Jahr 2 Monate her #99429

  • asze
  • aszes Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 3
  • Karma: 0
Hello, I have the following code which should sum up assessment values for some questions and then give feedback.
{if( codeOfQuestion1.value + codeOfQuestion2.value > 5, 'You should exercise more!',)}

However just after saving, Limesurvey displays that "codeOfQuestion1.value" and "codeOfQuestion2.value" are "Undefined Variable"

What could be the problem?

Thanks for your help!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Undefinied variable problem in Expression Manager 1 Jahr 2 Monate her #99430

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2950
  • Dank erhalten: 377
  • Karma: 124
Maybe the missing else after the comma?
{if( codeOfQuestion1.value + codeOfQuestion2.value > 5, 'You should exercise more!','else')}
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Undefinied variable problem in Expression Manager 1 Jahr 2 Monate her #99431

  • trivender
  • trivenders Avatar
  • OFFLINE
  • Expert Lime
  • Beiträge: 146
  • Dank erhalten: 7
  • Karma: 7
As per my experience sometimes refreshing lime survey(logout/login) will fix this problem:).One day I spend almost 4 hours to figure out this.
Trivender Singh
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Undefinied variable problem in Expression Manager 1 Jahr 2 Monate her #99435

  • asze
  • aszes Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 3
  • Karma: 0
Still the same problem. Refreshing wont help.

Der Administrator hat öffentliche Schreibrechte deaktiviert.

Undefinied variable problem in Expression Manager 1 Jahr 2 Monate her #99438

  • trivender
  • trivenders Avatar
  • OFFLINE
  • Expert Lime
  • Beiträge: 146
  • Dank erhalten: 7
  • Karma: 7
try .NAOK instead of .value and upload a dummy lss. We will see..
Trivender Singh
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Undefinied variable problem in Expression Manager 1 Jahr 2 Monate her #99460

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6551
  • Dank erhalten: 868
  • Karma: 257
Hi,

value must be replaced by "assesment value" not code (like NAOK).

Can you put the lss file here to have a test file ?

Denis
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: asze

Undefinied variable problem in Expression Manager 1 Jahr 2 Monate her #99479

  • asze
  • aszes Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 3
  • Karma: 0
DenisChenu schrieb:
Hi,

value must be replaced by "assesment value" not code (like NAOK).

Can you put the lss file here to have a test file ?

Denis

I am going to post it a bit later (I have no access to it yet)

However, it is very simple:
*4 questions Q1, Q2, Q3, Q4
*2 groups - Group1: Q1 and Q3, Group2: Q2 and Q4
Every question is in "array" mode, 1 subquestion and 3 answers. In assessmen first answer has 1 points, second 2 points and third 3 points (for all questions)
*I want feedback if Q1+Q3 score is higher than 5 (minumum is 2, maximum is 6)
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.248 Sekunden
Donation Image