Welcome to the LimeSurvey Community Forum

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

Set hidden yes/no value using equation

  • jlwood
  • jlwood's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 2 months ago #103021 by jlwood
I have a quota that needs to be based on the result of a longish equation. I know that quotas cannot yet be based on equation questions, and I see in the manual that a hidden Yes/No question can have its value set using an equation --

From manual.limesurvey.org/Question_type_-_Yes-No under subheading "Always hide this question (hidden)"

Hint: The question are not diplay in HTML, it can be set with an equation question or survey URL, but not in javascript


but how on earth do I accomplish this? I've scrounged around and can't seem to find and example or instructions. What am I missing?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago #103044 by DenisChenu
Replied by DenisChenu on topic Set hidden yes/no value using equation
Hi,

Question code:
EQUATION
YESNO
EQSETYESNO

You can hide all 3 and put in one group, not sure if need a showed question in this group (to be tested).

YESNO : leave it empty
EQSETYESNO:
Code:
{YESNO=if(EQUATION.NAOK>10,"Y","N")}

With = : you set an answer.

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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago #103053 by tpartner
Replied by tpartner on topic Set hidden yes/no value using equation
I'm not sure you need the ".NAOK".

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago - 10 years 2 months ago #103056 by DenisChenu
Replied by DenisChenu on topic Set hidden yes/no value using equation

tpartner wrote: I'm not sure you need the ".NAOK".

Yes, but don't make problem ?

PS: the EQSETYESNO MUST be an equation question type ;)

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.
Last edit: 10 years 2 months ago by DenisChenu.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago #103059 by tpartner
Replied by tpartner on topic Set hidden yes/no value using equation

Yes, but don't make problem ?

Yep, it doesn't seem to cause a problem :)

I just thought it's probably not required because YESNO (being a quota question) would always be relevant.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: jlwood
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago #103064 by DenisChenu
Replied by DenisChenu on topic Set hidden yes/no value using equation
Yep, but EQUATION can be unrelevant ;).

I don't know what happen if we use
{YESNO.NAOK="Y"}

I think it's broke.


If YESNO is unrelevant : YESNO="Y" happen at page start, and removed after with JS, removed a second time after with PHP;)

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 following user(s) said Thank You: jlwood
The topic has been locked.
  • jlwood
  • jlwood's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 2 months ago #103139 by jlwood
Replied by jlwood on topic Set hidden yes/no value using equation
@tpartner and DenisChenu, Thank you both. This seems to have led me down the right path. I was approaching things a little wrong and couldn't quite make my situation work. It would be nice if a more full-fledged example of this were in the documentation. As it is, the equation manager docs only say to be careful using the assignment operator, and never offers examples of correct use.
Thanks!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago #103140 by tpartner
Replied by tpartner on topic Set hidden yes/no value using equation
The documentation is a Wiki so anyone can edit it and upload sample surveys. Please do so as you see fit.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose