Undefinied variable problem in Expression Manager

More
3 years 11 months ago #99429 by asze
asze created the topic: Undefinied variable problem in Expression Manager
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!

Please Log in to join the conversation.

More
3 years 11 months ago #99430 by holch
holch replied the topic: Undefinied variable problem in Expression Manager
Maybe the missing else after the comma?
{if( codeOfQuestion1.value + codeOfQuestion2.value > 5, 'You should exercise more!','else')}

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
3 years 11 months ago #99431 by first
first replied the topic: Undefinied variable problem in Expression Manager
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.

Survey Designer and Programmer

Please Log in to join the conversation.

More
3 years 11 months ago #99435 by asze
asze replied the topic: Undefinied variable problem in Expression Manager
Still the same problem. Refreshing wont help.

Please Log in to join the conversation.

More
3 years 11 months ago #99438 by first
first replied the topic: Undefinied variable problem in Expression Manager
try .NAOK instead of .value and upload a dummy lss. We will see..

Survey Designer and Programmer

Please Log in to join the conversation.

More
3 years 11 months ago #99460 by DenisChenu
DenisChenu replied the topic: Undefinied variable problem in Expression Manager
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

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: asze

Please Log in to join the conversation.

More
3 years 11 months ago #99479 by asze
asze replied the topic: Undefinied variable problem in Expression Manager

DenisChenu wrote: 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)

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now