randomize selected 1-2 in multi qusetions

More
2 months 1 week ago #183056 by zn0610
Hi Team

I have a complicated logic related with MA selected and randomize setup 1-2 option for next 2 Array questions was asked.

Details:

There is 1 MA question with 10 options and respond can selected 1-10 options.

If selected option size>1, then in next question will randomize selected 2 options and shown for next 2 Array questions(like Q2a and Q2b).Like:
Q2aWhy do you selected in Q1(brand1).
Q2bWhy do you selected in Q1(brand2).

But if there is one option like option7(brand 7) was selected, must ask option7 in next SA question and randomize selected one option to asked from others.
If not including option7(brand 7), randomize selected 2 options and asked in next 2 Array questions.

Not sure if clear, thanks

Jerry

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
2 months 1 week ago #183061 by Joffm
Hi, not very clear.
As far as I understand:
There is a multiple question with 7 items, The respondent may select 0 to 7 items.
There are 2 question groups about 2 items.

Now there are three scenarios:
1. Resp, selects 2 or more -> select randomly 2 out of the selected items
2. Resp, selects 1 item -> select this one and randomly 1 out of the not selected items
3. Resp, selects 0 item -> select randomly 2 out of all items

Correct?

Joffm


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

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago - 2 months 1 week ago #183070 by Joffm
If I understood,
here is a working example.
It uses only LS internal functions (like "rand", "strlen", "substr", "str_replace" and "join"), no javascript.
I used letters to identify the brands; later you can use this in relevance equations like "b1=="F".

More than one item selected:


Only one item selected:


No item selected:


File Attachment:

File Name: limesurvey...4-09.lss
File Size:31 KB


Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 2 months 1 week ago by Joffm.
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago #183141 by zn0610
Hi Joffm

Sorry for late responds.

Thanks a lot for your help, that's very helpful.It's correct.

Just one thing, there is another condition:
If selected option7(like brand7), must show brand7 first.
It's very important brand and priority to show.

Logic:
Q3 is Multi questions(number is 1-7).
IF BRAND SELECTED IN Q3 IS Brand7 THEN ASSIGN THE Brand7 AND ANOTHER RANDOMISED BRAND.
IF Brand7 IS NOT SELECTED Q25 (NOT AWARE OF Brand7) THEN ALLOCATE THEM TWO RANDOMISED BRANDS.
RESPONDENT TO BE SHOWN ONE BRAND AT A TIME to below questions.
Q26a and Q26b(if Q3.size>1)
Q26a. please selected statements for randomize shown brand1
Q26b. please selected statements for randomize shown brand2

Thanks

Jerry

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago #183146 by Joffm
Hi,
then you just extend the example.

Now you have to distinguish between:
1. 1 brand selected -> this brand (Brand 7 or not) + 1 random brand
2. 2 and more
  1. Brand 7 was selected -> Brand 7 + 1 random brand
  2. Brand 7 was not selected -> 2 random brand
3. No brand selected: -> 2 random brands

All except the blue scenario are already covered.
In the green scenarios (which just select 2 random brands) you have to add a relevance of "Brand 7 not selected" which is obvious in 3.

Good luck
Joffm


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

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!