Using Results of Equation Question

More
3 weeks 5 days ago #177056 by jma6610
jma6610 created the topic: Using Results of Equation Question
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
3 weeks 5 days ago #177057 by tpartner
tpartner replied the topic: Using Results of Equation Question
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.

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

More
3 weeks 5 days ago #177058 by jma6610
jma6610 replied the topic: Using Results of Equation Question
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
3 weeks 5 days ago #177060 by jma6610
jma6610 replied the topic: Using Results of Equation Question
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
3 weeks 4 days ago #177090 by DenisChenu
DenisChenu replied the topic: Using Results of Equation Question
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

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

More
3 weeks 4 days ago #177098 by jma6610
jma6610 replied the topic: Using Results of Equation Question
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
3 weeks 4 days ago #177102 by DenisChenu
DenisChenu replied the topic: Using Results of Equation Question
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

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

More
3 weeks 3 days ago #177175 by lfanfoni
lfanfoni replied the topic: Using Results of Equation Question
Did you try XXX.NAOK?

Aiutaci a far crescere la comunità italiana di LimeSurvey: posta sul forum Italiano le richieste e le soluzioni trovate citando sempre la versione che stai utilizzando, non scrivere in privato, suggerisci modifiche o nuove traduzioni del software su: translate.limesurvey.org/

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

More
3 weeks 3 days ago #177176 by jma6610
jma6610 replied the topic: Using Results of Equation Question
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!