Welcome to the LimeSurvey Community Forum

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

Auto Select Radio Button Based on previous answers

  • jennh01851
  • jennh01851's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago #191331 by jennh01851
I need a way to record if a participant is eligible or not based on their answers.
Ideally, a final radio button that gets selected automatically based on their previous answers. This would also be used to determine which thank you page they get sent to when they hit submit.
I am sure there is an equation that can do this but I am stumped.
I am using LimeSurvey
Version 3.17.7+190627

Basically ...(i am simplifying)
if Q1) Yes Q2) No then they are eligible and I want the radio button clicked.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #191333 by holch
You can use the Expression Manager/Script for this.

You could create this question with radio buttons and then create an equation question which will click automatically an answer in this question, based on previous responses.

Lets say you have the following questions:

Q1:
(1) Yes
(2) No

Q2:
(1) Yes
(2) No

Q3:
(1) Eligable
(2) Not eligable

Q4 (type equation) should contain something like this (not tested, just to give you an idea:
Code:
{if(Q1==1 AND Q2==2, Q3=1)}

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • jennh01851
  • jennh01851's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago #191334 by jennh01851
I cannot figure out what i am doing wrong. I have attached the relevant page.

File Attachment:

File Name: limesurvey...8861.lss
File Size:22 KB
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #191336 by DenisChenu

holch wrote: Q4 (type equation) should contain something like this (not tested, just to give you an idea:

Code:
{if(Q1==1 AND Q2==2, Q3=1)}

No ;)

See manual : manual.limesurvey.org/Expression_Manager..._Assignment_Operator

Then :
{Q3=if(Q1==1 AND Q2==2,1,Q3.NAOK)}


Else : seems you can use quota for your system, then I update the survey with a 0 quota.

File Attachment:

File Name: limesurvey...ixed.lss
File Size:23 KB

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: holch
The topic has been locked.
  • jennh01851
  • jennh01851's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago - 4 years 5 months ago #191354 by jennh01851
It is still not auto selecting the radio button.....
Last edit: 4 years 5 months ago by jennh01851.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #191365 by DenisChenu

jennh01851 wrote: It is still not auto selecting the radio button.....

It select radio buttçon when move next …
And goes to the quota out when are not "eligible"
Pregnant woman goes out by quota …

proof

And best is to read …


I think i take more time to fix your issue then you take to explain what you want …

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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #191376 by holch
Hi Denis,
I had downloaded your version and tested and it didn't work for me either. It always just wrote marked "A2" (not eligible) for me. But I didn't have much time to test yesterday.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
4 years 5 months ago #191380 by jelo
Code:
if(twins.NAOK == 'A2' AND hairsample== "Y", 'A1','A2'))}

Pregnant with twins or more=NO and Hairsample=YES -> A1
All other combinations = A2

Is that really the intention?
The threadstarting post with Q1..Q3 is not relating to the LSS export.
Q1 = Yes and Q2=No -> Eligable

I recommend to explain the wanted behavior with variable names of the LSS export.
And to compare the LimeSurvey versions used by everyone if not error can be found in the LSS export.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #191381 by DenisChenu

holch wrote: Hi Denis,
I had downloaded your version and tested and it didn't work for me either. It always just wrote marked "A2" (not eligible) for me. But I didn't have much time to test yesterday.

What to check to have A1

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.
  • jennh01851
  • jennh01851's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago - 4 years 5 months ago #191390 by jennh01851
t
Last edit: 4 years 5 months ago by jennh01851. Reason: fixed based on last answer
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose