Auto tick multiple choice answer based on a previous anwer

Mehr
9 Monate 3 Wochen her #174654 von develnick
I'd like to auto-tick multiple-choice answer based on a previous answer.

For example

Question q1: Select your documents

> Subquestion a: Document A [ ]
> Subquestion b: Document B [ ]
> Subquestion c: Document C [X]

i.e. User selects Document C

Question q2: Select your documents

> Subquestion d: Document D
> Subquestion e: Document E
> Subquestion f: Document C [X]

i.e. User doens't need to select another time Document C, it is auto-selected.

I tried using relevance equation for Subquestion f as it follows:
!q1_c.NAOK

but this code only hide the question.

- Nick

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
9 Monate 3 Wochen her #174657 von holch
The relevance equation is only there for hiding/showing questions.

What you will probably have to do is create a hidden equation type question, check if a subquestion has been checked and then mark it.

Probalby something like this (not tested, and you will of course have to make adaptation to fit for your survey):
{if(q1_c=="Y", q2_f="Y",)

Something like that.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174666 von DenisChenu

holch schrieb: Probalby something like this (not tested, and you will of course have to make adaptation to fit for your survey):

{if(q1_c=="Y", q2_f="Y",)

Something like that.

No, it never work.

Asignation must be done like this:
{q2_f=if(q1_c=="Y", "Y","")}

{QuestionToAssign=ValueToSet}

Not in other way :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174670 von holch

No, it never work.


I noticed that. I played around a little, and it did not work.

Thanks for skipping in and proposing the correct way.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174671 von DenisChenu

holch schrieb: …

Thanks for skipping in and proposing the correct way.

Thanks to you for all community help you offer gracefully :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174673 von holch
But somehow your solution didn't work for me either.

I assumed it works only if the second question is on a different page, but it didn't.

Do you see any errors?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her - 9 Monate 3 Wochen her #174675 von DenisChenu

holch schrieb: …

I assumed it works only if the second question is on a different page, but it didn't.

Yes : assign action is done only with PHP, then when move next /previous

In same page : you can have a look at this old javascript code : demonstration.sondages.pro/676785?lang=fr

survey in french, but code is international ;)

MULTIPLE : updated via js (to trigger filter on FILTER and FILTEREXCLUDE)

MULTIPLE2 : updated via php (to trigger filter on FILTER2 and FILTEREXCLUDE2)

Think the system still work on 3.X.
If PHP system didn't work : it's a bug ;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Letzte Änderung: 9 Monate 3 Wochen her von DenisChenu.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174677 von develnick
Hi Denis, thank you for your answer.

I'm using Version 3.14.10+180924. I tried your code this way

{q2_f=if(q1_c=="Y", "Y","")}

and I also tried

{q2_f=if(q1_c=="Y", "Y","N")}

However, it didn't work.

I also saw your Demo here demonstration.sondages.pro/676785?lang=fr , however it seems this example is using array questions.

However, in my survey we are using simple multiple choice questions. Maybe that's the issue here.

- Nick

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174682 von tpartner
@develnick, your first equation is correct but the assignment needs to be done in an equation type question, not in a long-text as you have for "G1Q3".

Working sample survey attached:

Dateianhang:

Dateiname: limesurvey...1541.lss
Dateigröße:20 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Anhänge:
Folgende Benutzer bedankten sich: DenisChenu, develnick

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174685 von holch
This was actually my example (thus my error!). I don't know how this could happen. Must have clicked wrong at one point. I even wondered what that stupid box was in the equation question...

I guess I know now. I need the weekend. ;-)

Tried to change it, but it won't change??? Strange. Need to check if this is a bug.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174686 von holch
Works! Thank you Tpartner for highlighting this stupid mistake with the wrong question type. I was looking and looking and looking and didn't see what was wrong with my code. Turns out: Nothing. :-)

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174753 von develnick
Thanks, your explanation is great.
What about if the user wants to change also the Q1_c answer while choosing Q2_f i.e. one-to-one correspondence? For instance, imagine an user de-tick Q2_f. With your code, Q1_c is still selected.

Maybe I can try

{q1_c=if(q2_f=="Y", "Y","")} but where do I have to put that code?

- Nick

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174760 von tpartner
In an equation question in a group after the q2 group.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 3 Wochen her #174766 von develnick
Ok. And what happens if the user hits the "Previous" button? Is this code executed?

- Nick

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
9 Monate 2 Wochen her #174780 von tpartner
Yes, it will be executed every time the page is visited. I assumed that with this type of value assignment that you had the Previous button disabled.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha