- Posts: 30
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Ranking questions with multiple groups
- FSoave
- Topic Author
- Offline
- Junior Member
Less
More
4 years 2 weeks ago #196059
by FSoave
Ranking questions with multiple groups was created by FSoave
Hello,
I have a list of sentences and I have to ask a user to group them "freely" (at least 3 groups, max 10 groups).
Basic example (simplest case possible, 3 groups)
these options: A1,C1,B2,A3,C3,A2,C2,B1,B3
could be grouped in 3 groups by the letter: (A1, A2, A3) - (B1, B2, B3) - (C1, C2, C3)
How can I achieve this assuming each option can only be contained in 1 group?
The only idea I have (not sure if doable) is:
I have 10 questions with my options. The first 3 are mandatory. The questions are in subsequent pages.
Each question only contains options that were not previously selected.
Can I filter the options based on what was previously selected?
Any suggestion?
Thanks!
I have a list of sentences and I have to ask a user to group them "freely" (at least 3 groups, max 10 groups).
Basic example (simplest case possible, 3 groups)
these options: A1,C1,B2,A3,C3,A2,C2,B1,B3
could be grouped in 3 groups by the letter: (A1, A2, A3) - (B1, B2, B3) - (C1, C2, C3)
How can I achieve this assuming each option can only be contained in 1 group?
The only idea I have (not sure if doable) is:
I have 10 questions with my options. The first 3 are mandatory. The questions are in subsequent pages.
Each question only contains options that were not previously selected.
Can I filter the options based on what was previously selected?
Any suggestion?
Thanks!
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
4 years 2 weeks ago #196066
by Joffm
Buzzword: Array filter exclusion
Start with a multiple question with ALL your sentences.
Respondents select options for first "group".
Display by "Array filter exclusion" only the not selected options in the next question.
Respondents select options for second "group".
Display by "Array filter exclusion" only the not selected options in the next question.
Respondents select options for third "group".
And so on.
If there is nothing left to distribute, skip to rest of the questionnaire.
It's an idea, have a look.
An other option is to use something like the question theme cardsort.
github.com/tpartner/LimeSurvey-Card-Sorting-3.x
Depends on the length of your items.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Ranking questions with multiple groups
Each question only contains options that were not previously selected.
Buzzword: Array filter exclusion
Start with a multiple question with ALL your sentences.
Respondents select options for first "group".
Display by "Array filter exclusion" only the not selected options in the next question.
Respondents select options for second "group".
Display by "Array filter exclusion" only the not selected options in the next question.
Respondents select options for third "group".
And so on.
If there is nothing left to distribute, skip to rest of the questionnaire.
It's an idea, have a look.
An other option is to use something like the question theme cardsort.
github.com/tpartner/LimeSurvey-Card-Sorting-3.x
Depends on the length of your items.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: FSoave
The topic has been locked.
- FSoave
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 30
- Thank you received: 0
4 years 2 weeks ago #196088
by FSoave
Replied by FSoave on topic Ranking questions with multiple groups
Thanks for the guidance! I have used the card-sorting 3.x. I've made a fork with some customization for longer sentences (
github.com/francescosoave/LimeSurvey-Card-Sorting-3.x
)
I have another question somehow related. Can I bring all the values - as they were grouped by the user - in my next page?
Basically First I let the user organize the options in the groups, but then I'd like to have another page which displays the grouping done by the user along with a text field for each group, for the user to describe what they've done. Do you think it's possible?
Thanks!
I have another question somehow related. Can I bring all the values - as they were grouped by the user - in my next page?
Basically First I let the user organize the options in the groups, but then I'd like to have another page which displays the grouping done by the user along with a text field for each group, for the user to describe what they've done. Do you think it's possible?
Thanks!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
4 years 2 weeks ago - 4 years 2 weeks ago #196093
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Ranking questions with multiple groups
Yes, if using the Card-Sorting question, you can use ExpressionScript (Expression Manager) to pipe in the items placed in each category.
Unfortunately, ExpressionScript does not support arrays or looping and the sumifop() function is horribly buggy so the piping gets a little verbose, but something like this if using the demo survey from the my GitHub page.
Sample survey:
Unfortunately, ExpressionScript does not support arrays or looping and the sumifop() function is horribly buggy so the piping gets a little verbose, but something like this if using the demo survey from the my GitHub page.
Code:
<div> <h4>You listed {if(sum(q1_1 == '1', q1_2 == '1', q1_3 == '1', q1_4 == '1', q1_5 == '1', q1_6 == '1', q1_7 == '1', q1_8 == '1') > 0, 'the following', 'no')} items as "Very Important"</h4> <ul> {if(q1_1 == '1', '<li>'+q1_1.question+'</li>', '')} {if(q1_2 == '1', '<li>'+q1_2.question+'</li>', '')} {if(q1_3 == '1', '<li>'+q1_3.question+'</li>', '')} {if(q1_4 == '1', '<li>'+q1_4.question+'</li>', '')} {if(q1_5 == '1', '<li>'+q1_5.question+'</li>', '')} {if(q1_6 == '1', '<li>'+q1_6.question+'</li>', '')} {if(q1_7 == '1', '<li>'+q1_7.question+'</li>', '')} {if(q1_8 == '1', '<li>'+q1_8.question+'</li>', '')} </ul> <h4>You listed {if(sum(q1_1 == '2', q1_2 == '2', q1_3 == '2', q1_4 == '2', q1_5 == '2', q1_6 == '2', q1_7 == '2', q1_8 == '2') > 0, 'the following', 'no')} items as "Fairly Important"</h4> <ul> {if(q1_1 == '2', '<li>'+q1_1.question+'</li>', '')} {if(q1_2 == '2', '<li>'+q1_2.question+'</li>', '')} {if(q1_3 == '2', '<li>'+q1_3.question+'</li>', '')} {if(q1_4 == '2', '<li>'+q1_4.question+'</li>', '')} {if(q1_5 == '2', '<li>'+q1_5.question+'</li>', '')} {if(q1_6 == '2', '<li>'+q1_6.question+'</li>', '')} {if(q1_7 == '2', '<li>'+q1_7.question+'</li>', '')} {if(q1_8 == '2', '<li>'+q1_8.question+'</li>', '')} </ul> <h4>You listed {if(sum(q1_1 == '3', q1_2 == '3', q1_3 == '3', q1_4 == '3', q1_5 == '3', q1_6 == '3', q1_7 == '3', q1_8 == '3') > 0, 'the following', 'no')} items as "Not very important"</h4> <ul> {if(q1_1 == '3', '<li>'+q1_1.question+'</li>', '')} {if(q1_2 == '3', '<li>'+q1_2.question+'</li>', '')} {if(q1_3 == '3', '<li>'+q1_3.question+'</li>', '')} {if(q1_4 == '3', '<li>'+q1_4.question+'</li>', '')} {if(q1_5 == '3', '<li>'+q1_5.question+'</li>', '')} {if(q1_6 == '3', '<li>'+q1_6.question+'</li>', '')} {if(q1_7 == '3', '<li>'+q1_7.question+'</li>', '')} {if(q1_8 == '3', '<li>'+q1_8.question+'</li>', '')} </ul> </div>
Sample survey:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 2 weeks ago by tpartner.
The following user(s) said Thank You: FSoave
The topic has been locked.
- FSoave
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 30
- Thank you received: 0
4 years 2 weeks ago #196107
by FSoave
Replied by FSoave on topic Ranking questions with multiple groups
thanks a lot! I'll try to implement it later.
Also, I need to display a text box for each group as the user should write justification about their choices. Can I do it dynamically (eg display 1 text-box for each non-empty group)?
Since you are the dev, I have another question for you about your theme. Is there a way to make only some groups mandatory? For example, with your demo, say I need the groups "very important" and "fairly important" to be mandatory (where mandatory means at least 1 item for each group).
Thanks!
Also, I need to display a text box for each group as the user should write justification about their choices. Can I do it dynamically (eg display 1 text-box for each non-empty group)?
Since you are the dev, I have another question for you about your theme. Is there a way to make only some groups mandatory? For example, with your demo, say I need the groups "very important" and "fairly important" to be mandatory (where mandatory means at least 1 item for each group).
Thanks!
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
4 years 2 weeks ago #196113
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Ranking questions with multiple groups
Hi,
as you see in the answer table for each item (in your case "sentence") the number of the group is stored.
So you might validate
countifop("==","1",self.NAOK)>0 AND countifop("==","2",self.NAOK)>0
meaning: both "group 1" and "group 2" have a count >0
Joffm
as you see in the answer table for each item (in your case "sentence") the number of the group is stored.
So you might validate
countifop("==","1",self.NAOK)>0 AND countifop("==","2",self.NAOK)>0
meaning: both "group 1" and "group 2" have a count >0
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: tpartner
The topic has been locked.
- FSoave
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 30
- Thank you received: 0
4 years 2 weeks ago #196118
by FSoave
Replied by FSoave on topic Ranking questions with multiple groups
Hi thanks,
I've read on the manual and I understand the expression..but I'm can't seem to find the "answer table for each item" you mentioned..what/where is it..? ..attached my survey so you can see what I'm doing.
I've read on the manual and I understand the expression..but I'm can't seem to find the "answer table for each item" you mentioned..what/where is it..? ..attached my survey so you can see what I'm doing.
Attachments:
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
4 years 2 weeks ago #196120
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Ranking questions with multiple groups
Hi,
not: in the answer table for each item (in your case "sentence") the number of the group
but: in the answer table for each item (in your case "sentence") the number of the group
Unfortunately language is not assoziative.
It's a difference between Girls (trading school) and (Girls trading) school.
Okay,
here you see some items of the cardsort. And the stored value is the number of the group.
Joffm
not: in the answer table for each item (in your case "sentence") the number of the group
but: in the answer table for each item (in your case "sentence") the number of the group
Unfortunately language is not assoziative.
It's a difference between Girls (trading school) and (Girls trading) school.
Okay,
here you see some items of the cardsort. And the stored value is the number of the group.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- FSoave
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 30
- Thank you received: 0
4 years 2 weeks ago #196122
by FSoave
Replied by FSoave on topic Ranking questions with multiple groups
The topic has been locked.
- FSoave
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 30
- Thank you received: 0
4 years 2 weeks ago #196160
by FSoave
Replied by FSoave on topic Ranking questions with multiple groups
Sorry I realized maybe I wasn't clear above
I was just asking where (in which part of limesurvey) is the field in which I should specify the conditional expression countifop("==","1",self.NAOK)>0 AND countifop("==","2",self.NAOK)>0
Thanks
I was just asking where (in which part of limesurvey) is the field in which I should specify the conditional expression countifop("==","1",self.NAOK)>0 AND countifop("==","2",self.NAOK)>0
Thanks
The topic has been locked.
- FSoave
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 30
- Thank you received: 0
4 years 2 weeks ago #196163
by FSoave
Replied by FSoave on topic Ranking questions with multiple groups
ok sorry again, I've managed to find the right place for the equation and it's working!
Edit question -> Logic -> Question validation equation
I can't edit the previous posts, sorry for the mess.
Thanks!
Edit question -> Logic -> Question validation equation
I can't edit the previous posts, sorry for the mess.
Thanks!
The topic has been locked.