Welcome to the LimeSurvey Community Forum

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

Show 60 time each question from random question pool

  • Chiara_Posadinu
  • Chiara_Posadinu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 7 months ago #188504 by Chiara_Posadinu
Hi,
I created a survey with 153 questions, but each participant can see only 10 of these picked randomly from the question pool. But, I also need 60 answer for each question. Is there an automatich way to stop to show the quastions that have 60 answer and keep randomize the others?

Thanks in advance!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #188510 by DenisChenu
No,

Must construct a plugin for this …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • Chiara_Posadinu
  • Chiara_Posadinu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 7 months ago #188534 by Chiara_Posadinu
Replied by Chiara_Posadinu on topic Show 60 time each question from random question pool
As I thought. Thank you for the confirmation!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #188579 by Joffm
Hi, Chiara,
if you have some knowledge in php and access to your server, you can do an ajax call.
Create a question of type "short text" (let's call it "rq") where you start your ajax call and store the result.
A small php program queries the LimeSurvey database to find all questions with less than 60 answers
and returns a string with 10 randomly selected questions like
,4,23,67,134,49,17,121,143,87,45,

In LimeSurvey you put all 153 questions into one group with the same randomization group name.
Then you can set the relevance equation of each question to
question 1: strpos(rq,",1,")!==false // meaning: If the string ",1," was found in "rq", display the question
...
question 87: strpos(rq,",87,")!==false
...
question 153: strpos(rq,",153,")!==false


Joffm

At the moment I am on vacation; so I don't have time to create an example. Maybe later.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #188590 by tpartner
Yes, you could also use the API to detect questions with more than 60 responses but be careful where you put the AJAX call - it will take some time to return a result so should be in a previous group or the relevance may be set before the AJAX return.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose