Set hidden yes/no value using equation

More
3 years 10 months ago #103021 by jlwood
jlwood created the topic: Set hidden yes/no value using equation
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?

Please Log in to join the conversation.

More
3 years 10 months ago #103044 by DenisChenu
DenisChenu replied the 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:
{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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
3 years 10 months ago #103053 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

More
3 years 10 months ago - 3 years 10 months ago #103056 by DenisChenu
DenisChenu replied the 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 3 years 10 months ago by DenisChenu.

Please Log in to join the conversation.

More
3 years 10 months ago #103059 by tpartner
tpartner replied the 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

Please Log in to join the conversation.

More
3 years 10 months ago #103064 by DenisChenu
DenisChenu replied the 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: jlwood

Please Log in to join the conversation.

More
3 years 10 months ago #103139 by jlwood
jlwood replied the 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!

Please Log in to join the conversation.

More
3 years 10 months ago #103140 by tpartner
tpartner replied the 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

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!