Welcome to the LimeSurvey Community Forum

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

Creating a goup with questions or only questions at runtime

More
2 years 4 weeks ago #251384 by lucianv
Please help us help you and fill where relevant:
Your LimeSurvey version: [6.0]
Own server or LimeSurvey hosting: own
Survey theme/template:
==================
Hello everybody,

I have two array questions looking like below:

Q1. Do you prefer your food                           Hot     Medium/Hot          Cold
                                                 Food  A             o            o                       o
                                                 Food  B             o            o                       o
                                                 Food  C             o            o                       o

Q2. Do you prefer your drink                          Hot      Medium/Hot          Cold
                                                Drink  X             o            o                        o
                                                Food  Y             o            o                        o
                                                Food  Z             o            o                        o

Both questions are mandatory to be answered.
Based on the answers to these two questions, I need to generate a number of text questions dynamically, only for the Hot and Cold answers. For example.
Q3. I would pay for my Food A and my Drink X .....
If a respondent selects Medium/Hot in both questions Q1 and Q2, then I do not have to generate any new text question at all.
If a respondent select Hot or Cold for question Q1 and only Medium/Hot for question Q2, then I will generate only questions based on the Q1 answers.There may be 3 questions, 2 questions, or 1 question depending on the selection.
....and so on with the logic.
The maximum number of new generated text questions could be: AX, AY, AZ, BX, BY, BZ, CX, CY, CZ.

Is there a way in Limesurvey to dynamically create questions as I need?
Something along the line:     if( <<condition is met in previous answer>>) then <<create new text question>>

The example above is just a simplification. In reality I will have three array questions with 6 items each, so creating a fix number of combinations beforehand will not be feasible.

Thank you for your answer.
                                               







 

Please Log in to join the conversation.

More
2 years 4 weeks ago #251386 by jelo

Is there a way in Limesurvey to dynamically create questions as I need?
 
No. When you activate a survey the structure in the database table is fixed.
You need to create the max amount of text questions and show/hide them depending on the answers of the previous question.
 

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

More
3 days 17 hours ago #273168 by glennkoyal

Please help us help you and fill where relevant:
Your LimeSurvey version: [6.0]
Own server or LimeSurvey hosting: own
Survey theme/template:
==================
Hello everybody,

I have two array questions looking like below:

Q1. Do you prefer your food                           Hot     Medium/Hot          Cold
                                                 Food  A             o            o                       o
                                                 Food  B             o            o                       o
                                                 Food  C             o            o                       o

Q2. Do you prefer your drink                          Hot      Medium/Hot          Cold
                                                Drink  X             o            o                        o
                                                Food  Y             o            o                        o
                                                Food  Z             o            o                        o

Both questions are mandatory to be answered.
Based on the answers to these two questions, I need to generate a number of text questions dynamically, only for the Hot and Cold answers. For example.
Q3. I would pay for my Food A and my Drink X .....
If a respondent selects Medium/Hot in both questions Q1 and Q2, then I do not have to generate any new text question at all.
If a respondent select Hot or Cold for question Q1 and only Medium/Hot for question Q2, then I will generate only questions based on the Q1 answers.There may be 3 questions, 2 questions, or 1 question depending on the selection.
....and so on with the logic.
The maximum number of new generated text questions could be: AX, AY, AZ, BX, BY, BZ, CX, CY, CZ.

Is there a way in Limesurvey to dynamically create questions as I need?
Something along the line:     if( <<condition is met in previous answer>>;) then <<create new text question>>

The example above is just a simplification. In reality I will have three array questions with 6 items each, so creating a fix number of combinations beforehand will not be feasible.

Thank you for your answer.









 
I have the same question, and I’m struggling with this exact type of dynamic logic in LimeSurvey. I’m also working with multiple array questions where respondents choose Hot / Medium-Hot / Cold, and based on those selections I need to generate follow-up text questions only for the combinations that match certain conditions.

The problem I’m running into is very similar: the number of possible combinations becomes too large to pre-create manually, and I also need LimeSurvey to generate these follow-ups only when the respondent selects Hot or Cold. If all answers are Medium/Hot, then no additional questions should appear at all.

I’ve been looking for a built-in way to dynamically create questions—or at least dynamically show or hide a variable number of text questions—but so far I haven’t found a clean solution. If anyone has experience with dynamically generating question sets or handling large combinational logic like this, I’d really appreciate any guidance.

Please Log in to join the conversation.

More
1 day 3 hours ago #273189 by Joffm
Hi,
it's not a good idea to "answer" an old topic.
Maybe anybody thought you really answer it.

If there is the same or similar question (still not answered), in my opinion it is better to open a new thread and insert a link to this old one.

Well, your question.
Obviously it is not possible to create questions "on the fly".
Always remember that you need columns in the database to store the answers. This means you would have to change the database.

No, the "hard" way is to create all possible follow-up question and show/hide them by the condition.

If your approach really is "the same" you only have one single question of type "muliple numerical" for this
I would pay for my Food A and my Drink X .....
where you show/hide the subquestions with subquestion relevance.

And depending on your real scenario you could consider a "tayloring" of the question text, meaning you dynamically enter the test according to the combination.

So I recommend you send the lss export of this relevant part of your survey.

Joffm

 

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

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose