- Posts: 10
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
4 years 5 months ago #191331
by jennh01851
Auto Select Radio Button Based on previous answers was created 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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
4 years 5 months ago #191333
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Auto Select Radio Button Based on previous answers
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:
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
4 years 5 months ago #191334
by jennh01851
Replied by jennh01851 on topic Auto Select Radio Button Based on previous answers
I cannot figure out what i am doing wrong. I have attached the relevant page.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
4 years 5 months ago #191336
by DenisChenu
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.
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.
Replied by DenisChenu on topic Auto Select Radio Button Based on previous answers
Noholch 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)}
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.
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.
Attachments:
The following user(s) said Thank You: holch
The topic has been locked.
- jennh01851
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
4 years 5 months ago - 4 years 5 months ago #191354
by jennh01851
Replied by jennh01851 on topic Auto Select Radio Button Based on previous answers
It is still not auto selecting the radio button.....
Last edit: 4 years 5 months ago by jennh01851.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
4 years 5 months ago #191365
by DenisChenu
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.
Replied by DenisChenu on topic Auto Select Radio Button Based on previous answers
It select radio buttçon when move next …jennh01851 wrote: It is still not auto selecting the radio button.....
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
4 years 5 months ago #191376
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Auto Select Radio Button Based on previous answers
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 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.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
4 years 5 months ago #191380
by jelo
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
Replied by jelo on topic Auto Select Radio Button Based on previous answers
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
4 years 5 months ago #191381
by DenisChenu
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.
Replied by DenisChenu on topic Auto Select Radio Button Based on previous answers
What to check to have A1holch 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.
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
4 years 5 months ago - 4 years 5 months ago #191390
by jennh01851
Replied by jennh01851 on topic Auto Select Radio Button Based on previous answers
t
Last edit: 4 years 5 months ago by jennh01851. Reason: fixed based on last answer
The topic has been locked.