Using Results of Equation Question

More
6 months 2 days ago #177056 by jma6610
I'm using Lime 2.x

XXX is an equation question that's either 1 or 0


I'm unsure why the following won't work within a subsequent text display question.


{if(XXX== 1,"Print Option 1","")}


What am I doing wrong?


Thanks in advance

Please Log in or Create an account to join the conversation.

More
6 months 2 days ago #177057 by tpartner
It may be a string instead of number. Try this:

{if(XXX == '1', "Print Option 1", "")}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
6 months 2 days ago #177058 by jma6610
That's the first thing I tried. There appears to be some type of bug with equation questions. I'm unsure what's going on exactly, but it appears that if you write code in an equation question to produce a numeric, it won't change back to a string (and I think vice-versa) if you alter the code to produce a string. At least I think that's what's going on.

I recreated the equation question and put in the exact same code and it work's fine with the second equation question but refuses to work with the first one regardless of what I do.

I've finally got it going after about 5 hours trying to figure this out.

Please Log in or Create an account to join the conversation.

More
6 months 2 days ago #177060 by jma6610
The problem may also be caused when you copy an equation question. I'm unsure.

Please Log in or Create an account to join the conversation.

More
6 months 1 day ago #177090 by DenisChenu
In LimeSurvey 2.X : equation question didn't trigger javascript action on the same page
In LimeSUrvey 3.X : equation question trigger someJavaScript action on same page, but it's unsure
In LimeSurvey 4.X (in some month) : equation question trigger near allJavaScript action on same page : github.com/LimeSurvey/LimeSurvey/commit/...b023787ae93291e5130f

See related mantis issue:
bugs.limesurvey.org/view.php?id=14047
bugs.limesurvey.org/view.php?id=14183
bugs.limesurvey.org/view.php?id=13317

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
6 months 1 day ago #177098 by jma6610
So a known issue.

Do I understand correctly that there is a lime version 4.x coming out soon? Is there anything on-line that would explain what the updates/new-features are?

Please Log in or Create an account to join the conversation.

More
6 months 1 day ago #177102 by DenisChenu
No at the 2 questions ;).

Else before : use same equation than the equation question are the best solution. 5and 4.X can still have issue)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
6 months 15 hours ago #177175 by lfanfoni
Did you try XXX.NAOK?

Aiutaci a far crescere la comunità italiana di LimeSurvey: vai sul forum Italiano per richieste e soluzioni citando sempre la versione usata, non scrivere in privato, suggerisci modifiche o nuove traduzioni - www.limesurvey.org/forum/italian-forum/118441

Please Log in or Create an account to join the conversation.

More
6 months 14 hours ago #177176 by jma6610
Yup. ...tried the NAOK also - didn't change anything. What worked was creating a new equation question from the beginning and simply pasting the exact same code that didn't work in the old equation question into it. ...and then it worked fine. I've got no idea why, but can say that this was occurring for several equation questions that were all copied from a different equation question. In all cases, when I created a new equation question without copying, they all worked with the exact same code that failed in the original equation questions. I can't say positively it had something to do with the copy process since a few things were done at the same time and I haven't had the time or desire to try to replicate the errors.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!