Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Using Results of Equation Question

  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #177056 by jma6610
Using Results of Equation Question was created 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
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177057 by tpartner
Replied by tpartner on topic Using Results of Equation Question
It may be a string instead of number. Try this:

Code:
{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.
The topic has been locked.
  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #177058 by jma6610
Replied by jma6610 on 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.
The topic has been locked.
  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #177060 by jma6610
Replied by jma6610 on topic Using Results of Equation Question
The problem may also be caused when you copy an equation question. I'm unsure.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177090 by DenisChenu
Replied by DenisChenu on 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 some javascript action on same page, but it's unsure
In LimeSurvey 4.X (in some month) : equation question trigger near all javascript 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 , plugin development .
I don't answer to private message.
The topic has been locked.
  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 3 months ago #177098 by jma6610
Replied by jma6610 on 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?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177102 by DenisChenu
Replied by DenisChenu on 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 , plugin development .
I don't answer to private message.
The topic has been locked.
More
5 years 3 months ago #177175 by lfanfoni
Replied by lfanfoni on topic Using Results of Equation Question
Did you try XXX.NAOK?

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The topic has been locked.
  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 3 months ago #177176 by jma6610
Replied by jma6610 on 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.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose