Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Set hidden yes/no value using equation

Set hidden yes/no value using equation 9 Monate 3 Wochen her #103021

  • jlwood
  • jlwoods Avatar
  • OFFLINE
  • Silver Donor
  • Beiträge: 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?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Set hidden yes/no value using equation 9 Monate 2 Wochen her #103044

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6451
  • Dank erhalten: 844
  • Karma: 249
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Set hidden yes/no value using equation 9 Monate 2 Wochen her #103053

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4272
  • Dank erhalten: 806
  • Karma: 369
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Set hidden yes/no value using equation 9 Monate 2 Wochen her #103056

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6451
  • Dank erhalten: 844
  • Karma: 249
tpartner schrieb:
I'm not sure you need the ".NAOK".
Yes, but don't make problem ?

PS: the EQSETYESNO MUST be an equation question type ;)
Letzte Änderung: 9 Monate 2 Wochen her von DenisChenu.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Set hidden yes/no value using equation 9 Monate 2 Wochen her #103059

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4272
  • Dank erhalten: 806
  • Karma: 369
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: jlwood

Set hidden yes/no value using equation 9 Monate 2 Wochen her #103064

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6451
  • Dank erhalten: 844
  • Karma: 249
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;)
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: jlwood

Set hidden yes/no value using equation 9 Monate 2 Wochen her #103139

  • jlwood
  • jlwoods Avatar
  • OFFLINE
  • Silver Donor
  • Beiträge: 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!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Set hidden yes/no value using equation 9 Monate 2 Wochen her #103140

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4272
  • Dank erhalten: 806
  • Karma: 369
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: DenisChenu
Moderatoren: ITEd
Ladezeit der Seite: 0.184 Sekunden
Donation Image