Page:12

Fill in a multiple choice question based on previous answers 8 months 1 week ago #111473

 wilmslow3 OFFLINE Fresh Lemon Posts: 12 Thank you received: 1 Karma: 0 Hi, Just wondering if this is possible, Can you automatically answer a multiple choice question based on previous answers (i.e. radio button questions, multiple choice questions and array questions) Reason being...I want to have a "summary multiple choice question" that based on previous answers ticks a multiple choice question. I have a couple of multiple choice questions and a couple of radio buttons questions that when the options are selected a later question records the answers in a "big multiple choice question". (This can be hidden or shown) Is this possible? Ive looked at the EM and can't seem to get it to work - does anyone have any sample surveys they could share with the correct syntax or point me in the right direction. Thanks The administrator has disabled public write access.

Fill in a multiple choice question based on previous answers 8 months 1 week ago #111487

• tpartner
• LimeSurvey Team
• Posts: 4690
• Karma: 409
Yes, you can use equation questions to select the options in the "results" question. These equation questions must be placed after the "results" question.

In the case of multiple options questions the equation is a simple - you can directly tie the "results" option to the "q1" option:
`{results_SQ001 = q1_SQ001}`

In the case of radio questions you will need to define which answer will result in a checked box in the "results" question. The easiest way to do that is to simply give that radio answer a code of "Y". Then you can tie them directly in the equation:
`{results_SQ002 = q2}`

If you can not use an answer code of "Y", you will need to put in a intermediary equation question to define "Y". So, for example, if I had a radio question (lets call it "q3") where I wanted answer code "A1" to check the box in "results", my intermediary equation (lets call it "equation1") would be:
`if(q3 == 'A1', 'Y', '')`
This would be followed by another equation question to control "results":
`results_SQ003 = equation1`

Here's a working example for LS2.05.

File Attachment:

File Name: limesurvey_survey_235541_2014-08-07.lss
File Size: 24 KB

Fill in a multiple choice question based on previous answers 8 months 1 week ago #111501

 Ben_V OFFLINE Platinum Lime Posts: 1292 Thank you received: 303 Karma: 86 Hello Tony, Very kind explanations & sample...as you used to provide! Is this method already explained somewhere in the manual (and where)? Benoît goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche) goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar) goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de... The administrator has disabled public write access.

Fill in a multiple choice question based on previous answers 8 months 1 week ago #111503

 tpartner OFFLINE LimeSurvey Team Posts: 4690 Thank you received: 942 Karma: 409 Hi Ben, The only thing I could find is here - manual.limesurvey.org/Expression_Manager#Operators Feel free to expand on that if you wish. . 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: Ben_V

Fill in a multiple choice question based on previous answers 8 months 1 week ago #111528

 david2013 OFFLINE Senior Lime Posts: 41 Thank you received: 4 Karma: 2 Can we use one equation question instead of two? for example, results_SQ003 = if(q3 == 'A1', 'Y', ''). The administrator has disabled public write access.

Fill in a multiple choice question based on previous answers 8 months 1 week ago #111530

 tpartner OFFLINE LimeSurvey Team Posts: 4690 Thank you received: 942 Karma: 409 I'm not sure why but that didn't work for me in testing. 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: wilmslow3

Fill in a multiple choice question based on previous answers 8 months 6 days ago #111542

 wilmslow3 OFFLINE Fresh Lemon Posts: 12 Thank you received: 1 Karma: 0 Thanks TPartner Your solution is perfect for my needs, really good explanation and I'm sure I'll be using a few variations for the future. With this I have implemented a filter in an array question based on two questions into my questionnaire using this method. See www.limesurvey.org/en/forum/can-i-do-thi...swers-of-2-questions and www.limesurvey.org/en/forum/can-i-do-thi...ter-on-two-questions I have two questions 10a and 10b at Q9 people select what bands they have heard of at 10a people select their favourite band (array filter of Q9) at 10b people select other top 4 bands (with array filter of Q9 and array exclusion of 10a) At 10c Peple can rate the bands they have slected in q10a and 10b in an array question. (array filter from results) So inbetween 10b and 10c I load a equation (Sum1, Sum2 etc) for each of the options using: {if(Q10a_A1=='Y','Y',Q10b_A1)} then {Results_A1 = Sum1} The administrator has disabled public write access. The following user(s) said Thank You: Ben_V

Fill in a multiple choice question based on previous answers 8 months 6 days ago #111544

 tpartner OFFLINE LimeSurvey Team Posts: 4690 Thank you received: 942 Karma: 409 That's a great explanation of a real-world application. 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: wilmslow3