- Posts: 10
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
random selection of items
- eyaskil
- Topic Author
- Offline
- New Member
Less
More
1 year 9 months ago #230403
by eyaskil
random selection of items was created by eyaskil
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 5.3.18+220530
Own server or LimeSurvey hosting: Own server
Survey theme/template: vanilla
==================
Hello.
What I'm trying to do is this:
I present 8 questions to the respondents. Then I need to randomly choose 3 of them in order to use their contents for further questions.
for example, lets say I ask how much one consumes each of a list of 8 types of foods, like: bread, meat, eggs, plants, milk and so on.
Then I want to randomly choose 3 of 8 food types and ask about the perceived nutritional value of each type. i.e. I have to use the contents of 3 items selected at random and add it to further questions.
How do I do that?
Thanks,
Efrat.
Your LimeSurvey version: Version 5.3.18+220530
Own server or LimeSurvey hosting: Own server
Survey theme/template: vanilla
==================
Hello.
What I'm trying to do is this:
I present 8 questions to the respondents. Then I need to randomly choose 3 of them in order to use their contents for further questions.
for example, lets say I ask how much one consumes each of a list of 8 types of foods, like: bread, meat, eggs, plants, milk and so on.
Then I want to randomly choose 3 of 8 food types and ask about the perceived nutritional value of each type. i.e. I have to use the contents of 3 items selected at random and add it to further questions.
How do I do that?
Thanks,
Efrat.
Please Log in to join the conversation.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11661
- Thank you received: 2742
1 year 9 months ago #230428
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic random selection of items
So they respond all 8 initial questions or might there be some that they don't respond?
If they respond to all of them, I would create the 8 corresponding questions later, into 2 question groups. One with 3 questions, one with 5 questions. The one with 5 questions you will hide and you give all these questions the same "randomization group name".
What happens? The 8 questions will appear randomly between the 8 positions, 3 in the first group that is shown, 5 in the second group that will be hidden. This way, you'll always display 3 of the 5 questions at random.
If they respond to all of them, I would create the 8 corresponding questions later, into 2 question groups. One with 3 questions, one with 5 questions. The one with 5 questions you will hide and you give all these questions the same "randomization group name".
What happens? The 8 questions will appear randomly between the 8 positions, 3 in the first group that is shown, 5 in the second group that will be hidden. This way, you'll always display 3 of the 5 questions at random.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.
- eyaskil
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
1 year 9 months ago #230434
by eyaskil
Replied by eyaskil on topic random selection of items
well, it's a bit more complicated than this.
because actually I have 2 series of 8 questions each, and I need to randomly select 3 of each and combine then into 9 (3X3) further questions.
I figured that if I can produce 3 random digits between 1-8 for each series, then I can condition the 9 combinations using these random digits.
I know how to create 1 random digit, using the function rand(1,, but I don't know how to create 3 random digits. can you help me with that?
Thanks a lot.
Efrat.
because actually I have 2 series of 8 questions each, and I need to randomly select 3 of each and combine then into 9 (3X3) further questions.
I figured that if I can produce 3 random digits between 1-8 for each series, then I can condition the 9 combinations using these random digits.
I know how to create 1 random digit, using the function rand(1,, but I don't know how to create 3 random digits. can you help me with that?
Thanks a lot.
Efrat.
Please Log in to join the conversation.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11661
- Thank you received: 2742
1 year 9 months ago #230436
by holch
You should have mentioned this from the beginning then.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic random selection of items
well, it's a bit more complicated than this.
You should have mentioned this from the beginning then.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.
- eyaskil
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
1 year 9 months ago #230440
by eyaskil
Replied by eyaskil on topic random selection of items
You are absolutely right. I wasn't clear enough in my first message.
Still, I hope I can find some solution to my problem.
Thanks.
Still, I hope I can find some solution to my problem.
Thanks.
Please Log in to join the conversation.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11661
- Thank you received: 2742
1 year 9 months ago #230442
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic random selection of items
Please explain a little further what you need from these 3 random digits.
Creating 3 random numbers is easy: Just create a different equation type question for each random number. You should not use {rand(1,} though, because the random number would change everytime you "touch" it. Therefore we recommend with "randnumber" being the question code of the equation question itself, where this code is:
But I feel like there is more to it than just creating 2x 3 random numbers. I assume within each set of 3 random numbers you will want them to be unique?
Creating 3 random numbers is easy: Just create a different equation type question for each random number. You should not use {rand(1,} though, because the random number would change everytime you "touch" it. Therefore we recommend with "randnumber" being the question code of the equation question itself, where this code is:
{if(is_empty(randnumber),rand(1,4),randnumber.NAOK)}
But I feel like there is more to it than just creating 2x 3 random numbers. I assume within each set of 3 random numbers you will want them to be unique?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.
- tammo
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 967
- Thank you received: 220
1 year 9 months ago #230447
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic random selection of items
Maybe this helps:
toolsforresearch.com/limesurvey-randomly...of-y-question-groups
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Please Log in to join the conversation.