Welcome to the LimeSurvey Community Forum

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

Equal-sized groups for survey

  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
4 years 5 months ago #190411 by Jmantysalo
Equal-sized groups for survey was created by Jmantysalo
Suppose I have about 100 people that will answer to a survey and there are 10 versions of the survey -- for example 10 slightly different pictures and questions about how the respondent liked the picture. I can make a hidden question of type 'equation' having just rand(1, 10) as value and foo as name, and the use foo==1, foo==2 etc. as relevance equations for question of type 'text display'.

However the distribution will probably not be very equal-sized, as the number of people taking survey is quite small. Is there a workaround for this?

For example, can I refer to number of people already filled the survey in expression manager and then just compute the remainder when dividing by ten?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190412 by Joffm
Replied by Joffm on topic Equal-sized groups for survey
Hi,
as long as the quota management of LS is as basic, you have to query the database to see how many respondents already answered the different versions of the survey.
Do an ajax call in the first question; query the database by direct access or by the API.
Then you should use a "least filled" approach.

Do the respondents get an incentive?
If not, it shouldn't be an issue if you just wait until you have ten responses for each version. The slight overquote in some versions you may remove at random.


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
4 years 5 months ago #190413 by Jmantysalo
Replied by Jmantysalo on topic Equal-sized groups for survey

Joffm wrote: Do an ajax call in the first question; query the database by direct access or by the API.


Thanks. I have never used ajax, and only used API from an outside php page. Can you give some example about using API inside the survey?
The topic has been locked.
More
4 years 5 months ago #190414 by jelo
Replied by jelo on topic Equal-sized groups for survey

Jmantysalo wrote: However the distribution will probably not be very equal-sized, as the number of people taking survey is quite small.

If you had the technical feature to do it inside LimeSurvey, you might still have an uneven distribution after qualitycheck. Completed surveys by speedster or with bullshit are mostly removed afterwards. Even with a more sophisticated quota system (which is LimeSurvey lacking) this issue cannot be resolved.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
4 years 5 months ago #190417 by Jmantysalo
Replied by Jmantysalo on topic Equal-sized groups for survey

jelo wrote: Completed surveys by speedster or with bullshit are mostly removed afterwards. Even with a more sophisticated quota system (which is LimeSurvey lacking) this issue cannot be resolved.


This is true, of course, but having one problem is better than having two.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190423 by tpartner
Replied by tpartner on topic Equal-sized groups for survey

Can you give some example about using API inside the survey?

The API cannot be used from within LimeSurvey (yet). You will need to make an AJAX call to a remote PHP file that uses the API.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
4 years 5 months ago #190431 by Jmantysalo
Replied by Jmantysalo on topic Equal-sized groups for survey
OK. Then it is probably easier to make a php page that has just counter. Then the survey could have a "question" of type equation calling that page and computing remainder of it's value.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190436 by DenisChenu
Replied by DenisChenu on topic Equal-sized groups for survey
In my opinion :
Use gitlab.com/SondagesPro/ExportAndStats/getStatInSurvey
To do a JS solution (hidding biggest choice).

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.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
4 years 5 months ago #190951 by Jmantysalo
Replied by Jmantysalo on topic Equal-sized groups for survey
Got another idea: If I just use {SAVEDID}? Then I don't need an outside php to get a serial number.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190962 by holch
Replied by holch on topic Equal-sized groups for survey
Savedid is given to anyone that start the survey. So it does not guarantee that you have x respondents completed if there are x Savedids that end with 1 for example.

It would be roughly the same problem as for the rand(1,10), probably.

Now if you know all 100 respondents and you are sure all will participate and complete, than you could maybe create a token table and randomly assign the different "paths" to the respondents.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
4 years 5 months ago #190995 by Jmantysalo
Replied by Jmantysalo on topic Equal-sized groups for survey

holch wrote: Savedid is given to anyone that start the survey. So it does not guarantee that you have x respondents completed if there are x Savedids that end with 1 for example.

It would be roughly the same problem as for the rand(1,10), probably.


I think it will be at least as good as using rand().

Anyways, kind of strange that one can do about everything but can't refer to quota or number of complete responses. Maybe something like getStatInSurvey-plugin will be part of core in the future.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago - 4 years 5 months ago #190998 by DenisChenu
Replied by DenisChenu on topic Equal-sized groups for survey

Jmantysalo wrote: Anyways, kind of strange that one can do about everything but can't refer to quota or number of complete responses. Maybe something like getStatInSurvey-plugin will be part of core in the future.

github.com/LimeSurvey/LimeSurvey/pull/13...187a239308679b427506

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.
Last edit: 4 years 5 months ago by DenisChenu.
The following user(s) said Thank You: holch, Jmantysalo
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose