# logic for multiple choice question

8 months 2 weeks ago #168131 by Rixy
Rixy created the topic: logic for multiple choice question
Hi All,

Need help on the following

"Which of these programs do you watch regularly ? MULTI ANSWER"

Program A
Program B
Program C
Program D

These are the subqustions for a mutiple choice question, the logic i want to put here is

TERMINATE SURVEY IF PROGRAM B or C NOT CODED.

B alone continue. C alone continue

B and c both continue

B with any other choice continue

C with any other choice continue

A alone termiate , D aloner terminate

A& D termatinate

is it possible to put logic like this

8 months 2 weeks ago #168140 by jelo
jelo replied the topic: logic for multiple choice question
There is no jump logic in LimeSurvey.
If you don't need to finish the survey (e.g. terminate survey), you can try to use Quota with count=0 to terminate the survey after that question.

I wonder, why you mention "A& D termatinate" in your logic.
You already terminate, when A alone is chosen. And when D alone is chosen.

Are you a student conducting a survey? If yes, tell me why you use LimeSurvey?
www.limesurvey.org/forum/development/116...y-you-use-limesurvey

8 months 2 weeks ago - 8 months 2 weeks ago #168141 by Joffm
Joffm replied the topic: logic for multiple choice question
Hi,

you have to use an equation to set a single answer question to "1" or "0".
This you can use for quota.

Well, just define your logic for screenout:

1. (B!="Y" or C!="Y")
2. (A=="Y" and count(Question)==1)
3. (D=="Y" and count(Question)==1)
4. (A=="Y" and D=="Y")

So, the equation will look like this (not tested):
Let's say the multiple question is M1, the used single is Q1

{Q1=if(((M1_B!="Y" or M1_C!="Y") or (M1_A=="Y" and count(that.M1.NAOK)==1) or (M1_D=="Y" and count(that.M1.NAOK)==1) or (M1_A!="Y" or M1_D!="Y")),1,0)}

But: What happens, if somebody selects A,C,D?
You say:
1. C with any other choice continue
2. A& D terminate

Now, what is it?

There ar more confusing things:
1. terminate if B or C NOT CODED.

2. B alone continue. So B alone, BUT C is NOT selected; termination because of 1.
3. C alone continue. So C alone, BUT B is NOT selected; termination because of 1.

B and c both continue

B with any other choice continue. So B and D should be posible, BUT C is NOT selected; termination because of 1.

In total there are only 20 different possible combinations.
Write them down and mark the terminations.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last Edit: 8 months 2 weeks ago by Joffm.

8 months 2 weeks ago #168205 by Joffm
Joffm replied the topic: logic for multiple choice question
Hi, Rixy,

thinking again about it, I saw, that only your first condition is relevant. Prople who do NEITHER select B NOR C are screened out. Everything else is only an example for outcome.

So:
After your multiple question "M1", create a question of type "equation" and a question of type "list radio" "Qu1" with two answer options (0=No, 1=Yes)

In the question text of the equation, enter
{Qu1=if(M1_SQ002=="Y" or M1_SQ003=="Y",1,0)}
meaning: If the second or the third subquestion of M1 is selected, the value of Qu1 is equal 1, else equal 0.

Both question are hidden.

Now you can set a quota on Qu1.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless