Welcome, Guest
Username: Password: Remember me

TOPIC: randomly draw several numbers out of a sample

randomly draw several numbers out of a sample 1 year 5 months ago #96502

  • debirah
  • debirah's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Dear Limesurvey Community

I have a question, is it possible to draw six random numbers out of total 12 numbers without repetition? So that each selected number appears only once?

Thank you very much for your help.
The administrator has disabled public write access.

randomly draw several numbers out of a sample 1 year 5 months ago #96518

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4366
  • Thank you received: 828
  • Karma: 381
Could you please give us some context? What are you trying to do?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

randomly draw several numbers out of a sample 1 year 5 months ago #96520

  • debirah
  • debirah's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
I have 12 possible answers, however for each participant I only want to display 6 of the 12 possible answers. These 6 have to be drawn randomly. So I thought that each answer will be coded as a number and limesurvey then randomly draws for each participant an array of 6 numbers out of the 12 possible numbers.

So as an example:
Participant 1: 12,1,5,4,8,6
Participant 2: 10,6,7,3,11,4

etc.

I hope this helps to understand what I want to do...
The administrator has disabled public write access.

randomly draw several numbers out of a sample 1 year 5 months ago #96526

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4366
  • Thank you received: 828
  • Karma: 381
Probably the easiest way to handle that would be to set the answers to display randomly and then use JavaScript to hide all but the first 6 answers.

I suspect you would want to record which were shown so you may want a following hidden short-text for that.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.102 seconds
Donation Image