Welcome to the LimeSurvey Community Forum

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

Can I create a random assessment with x questions from a pool of y?

  • TinTim
  • TinTim's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200610 by TinTim
I need to create a multiple choice test / assessment with 25 questions randomly selected from a pool of about 100 questions. There will be about 50 groups of participants taking the test (1000 people in total), and the tests should not differ within each group.

I have seen this topic pick-x-random-questions-from-a-bucket-of-y and it works fine so far, however every time someone takes the survey the questions are reshuffled, meaning that the questions are different for every participant. I tried making the survey closed access and requiring tokens to take the test, but even with the same token the questions are reshuffled every time I load the test.

Is it possible to "lock" the shuffling so to speak, so that each group sees their own fixed (but randomly selected) set of questions, without having to create 50 different tests?

Or even if I have to create 50 different tests, is it possible to randomize the questions only once and not every time the test is started?

Any ideas appreaciated!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200617 by Joffm
Hi,
yes, you are right.
The randomization is done each time, and you cannot avoid it.

BUT:
You have 50 groups, meaning only 50 different selections 25 out of 100.
So, I should create these 50 selections in EXCEL or somewhere else.
In the TOKEN_ATTRIBUTE you assign the selection, maybe like this:
"02,05,15,22,24,34,38,44,46,56,...,77,89,94"
Always 20 participants get the same selection.

And in your survey you display your randomized question (randomization group name)
with relevance like
Q34: strpos(TOKEN:ATTRIBUTE_1,"34")>0

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: TinTim
The topic has been locked.
  • TinTim
  • TinTim's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200700 by TinTim
Thanks for the workaround!

Funny enough I have to start the attribute_1 with a space, like " 03, 02, 06" - if I assign "03, 02, 06" it will only display question 02 and 06. Any idea what might cause that?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200712 by Joffm
This is because the first character gets the index "0".
"strpos" starts at "0".

Unfortunately the result "0" of "strpos" means "not found".

So this:
strpos("ABCDEF","A") is "0"
and
strpos("ABCDEF","X") is "0"

And you cannot distinguish.
Furthermore LimeSurvey does not support the "!==" operator. This one could distinguish.


So you have to take care that the first found index is at least "1".

Sorry, I forgot to mention that in my quick post.
There are many workarounds like this, where I always start with a "#".

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