Welcome to the LimeSurvey Community Forum

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

Show a limited number of random options in array questions

  • jamarin
  • jamarin's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 3 months ago #161772 by jamarin
I have a long list of Items (rows) in an array question. But I want to show only ten (or whatever other number) of options, at random, each time the question is presented to a respondent.
Randomize options it is not enough because always shows the long list. And limit the number of max or min reponses neither solve my problem. Because I want to show each time only a sort set of the original options.
(I have lots of respondents and don't need to burden to all the respondents asking them all the questions. But I want to collect enough answers for all of the options)

I have considered to split the list in several sections and show the sections at random. But it is not good for me because I need that all the options had the same probability to be presented and in different combinations (not always the same set of options together).

As far as I know, it is not possible to set filter (advanced option in array type question) to select/exclude at random a number of options. You need to specify which ones

The Issue can be solved if there is a way to complete automatically (a hidden question) a multiple choice question with random selection of the options. I don't know how to do it, but if anybody can solve this, then I can use this multiple choice question to filter the array

Regards,
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 3 months ago #161773 by Joffm
Hi,
how long is your list?
Two rough ideas:
Less than 52 items
By EM create a string of ten random characters A-Z, a-z like "DGHOQTbfhr".
Then display:
Subquestion 1, if string contains "A" (strpos(mystring,"A")===true)
Subquestion 2, if string contains "B"
Subquestion 3, if string contains "C"
...
Subquestion 27, if string contains "a"
Subquestion 28, if string contains "b"

More than 52 items:
create a string of length(itemcount) (str_repeat("0",itemcount))
at random set ten positions to "1".
Then display:
Subquestion 1, if string contains "1" at position 1 (substr(mystring,0)=="1")
Subquestion 2, if string contains "1" at position 2 (substr(mystring,1)=="1")
...


As said, just two ideas

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: jamarin
The topic has been locked.
  • jamarin
  • jamarin's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 3 months ago #161785 by jamarin
Thanks Joffm, my list has 62 elements, then I am going to test the second one (and also is a more general workaround that I can reuse with any number of subquestions in the future)
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 3 months ago #161814 by Joffm
Hi,

well, in your case you have about 2* 1011 options to select 10 out of 62.

A proposal to create your string.
Do it in EXCEL and add it as ATTRIBUTE to the participants list.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose