Welcome, Guest
Username: Password: Remember me

TOPIC: Set hidden yes/no value using equation

Set hidden yes/no value using equation 10 months 3 weeks ago #103021

  • jlwood
  • jlwood's Avatar
  • OFFLINE
  • Silver Donor
  • Posts: 4
  • Karma: 0
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 administrator has disabled public write access.

Set hidden yes/no value using equation 10 months 3 weeks ago #103044

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6551
  • Thank you received: 869
  • Karma: 257
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.
The administrator has disabled public write access.

Set hidden yes/no value using equation 10 months 3 weeks ago #103053

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4369
  • Thank you received: 829
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Set hidden yes/no value using equation 10 months 3 weeks ago #103056

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6551
  • Thank you received: 869
  • Karma: 257
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 ;)
Last Edit: 10 months 3 weeks ago by DenisChenu.
The administrator has disabled public write access.

Set hidden yes/no value using equation 10 months 3 weeks ago #103059

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4369
  • Thank you received: 829
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: jlwood

Set hidden yes/no value using equation 10 months 3 weeks ago #103064

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6551
  • Thank you received: 869
  • Karma: 257
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;)
The administrator has disabled public write access.
The following user(s) said Thank You: jlwood

Set hidden yes/no value using equation 10 months 2 weeks ago #103139

  • jlwood
  • jlwood's Avatar
  • OFFLINE
  • Silver Donor
  • Posts: 4
  • Karma: 0
@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 administrator has disabled public write access.

Set hidden yes/no value using equation 10 months 2 weeks ago #103140

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4369
  • Thank you received: 829
  • Karma: 381
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu
Moderators: ITEd
Time to create page: 0.180 seconds
Donation Image