Welcome to the LimeSurvey Community Forum

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

How to put quotas for answer options?

  • riversampling1
  • riversampling1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago - 2 years 11 months ago #216144 by riversampling1
How to put quotas for answer options? was created by riversampling1
Dear colleagues,
Good day or night!

We would like to set quotas of answer options for multiple question. And when the quota is reached this answer should be hidden for other participants from this question.
For example:

Q1. What colors do you like?
a. Blue (quota: 10)
b. Red
c. Green

When quota is reached the question should be:
Q1. What colors do you like?
b. Red
c. Green

Thanks a lot in advance,
Kind Regards!
Last edit: 2 years 11 months ago by riversampling1.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216154 by DenisChenu
Replied by DenisChenu on topic How to put quotas for answer options?
Your LimeSurvey version ?

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.
  • riversampling1
  • riversampling1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #216156 by riversampling1
Replied by riversampling1 on topic How to put quotas for answer options?
Our version of LimeSurvey is 3.25.16+210302
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216159 by DenisChenu
Replied by DenisChenu on topic How to put quotas for answer options?
You need to do it with javacript solution …

You can use
gitlab.com/SondagesPro/ExportAndStats/getStatInSurvey plugin.

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.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216165 by Joffm
Replied by Joffm on topic How to put quotas for answer options?
So, you do not want to use a quota.
Quota means, the 11th participant who selects "blue" is screened out.
Here you find an example. with the plugin Denis mentioned.

[url] forums.limesurvey.org/forum/can-i-do-thi...can-be-chosen#214612 [/url]

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • riversampling1
  • riversampling1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #216178 by riversampling1
Replied by riversampling1 on topic How to put quotas for answer options?
Dear Joffm, thanks a lot for this idea!

However, plugin does not work for me. Would you be so kind to have a look at your amended survey? Put it in attachment.
It shows that this function is unsupported. We tried to count the amount of every answer and show them in the next question until the sum is below 5.

Thanks and regards
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago - 2 years 11 months ago #216179 by Joffm
Replied by Joffm on topic How to put quotas for answer options?
Hi,
there are a few mistakes on your side.
1. You work with version 3.x.; but you try to use the function "statCount".
This plugin is only available in version 4.x. How could you activate it?

LimeSurvey 4.4 have an included plugin for statitstics

manual.limesurvey.org/StatFunctions

You have to use the plugin "getStatInSurvey" Denis mentioned this and showed the link

2. You changed the question "QValues" to type "multiple".
a. It was "multiple numerical input", because here the result of the plugin are stored.
This plugin is not usable directly in equations; therefore the deviation with the javascript.
b. You used it as the question that you are testing.
But in the sample survey this question was "Q1".

3. The main mistake.
Both plugins are not working with multiple questions.
 

If you have a look at the source code of the plugin you see the supported question types

                    switch ($oQuestion->type) {
                        case "5":
                        case "L":
                        case "!":
                        case "O":
                        case "I":
                        case "D":
                        case "N":
                        case "G":
                        case "Y":
                        case "*":
                        case "S":

And here you see what it means
[url] manual.limesurvey.org/ExpressionScript_-...code_variable_naming [/url]

So you have to insert a hidden question to convert the input of the multiple question to single dummies. Could be a "numerical input".

Joffm

Tomorrow I'll send an example.
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 11 months ago by Joffm.
The following user(s) said Thank You: DenisChenu, riversampling1
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216197 by DenisChenu
Replied by DenisChenu on topic How to put quotas for answer options?

Both plugins are not working with multiple questions.

 
statCount work with multiple choice question type :)

Q00_SQ01.sgqa retunr the column name of Q00_SQ01 :).

And about statCountIf : if i don't lake error : it must work with (for multiple numeric) : statCountIf(Q0_SQ01.sgqa,">0") since it use compare :) I muts cjeck and update manual if it's the case.
 

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 following user(s) said Thank You: riversampling1
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216199 by Joffm
Replied by Joffm on topic How to put quotas for answer options?
Oh, sorry, Denis.
I answered too rash.
But I have to admit, I am still not very familiar with these two new functions.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216203 by DenisChenu
Replied by DenisChenu on topic How to put quotas for answer options?

Oh, sorry, Denis.
I answered too rash.
But I have to admit, I am still not very familiar with these two new functions.

Joffm
 
No problem,

This allow me to improve manual :)

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.
  • riversampling1
  • riversampling1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #216204 by riversampling1
Replied by riversampling1 on topic How to put quotas for answer options?
Thank you very much for your reply,  we will try to do so! :) Have a nice day!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216218 by Joffm
Replied by Joffm on topic How to put quotas for answer options?
And here the promised, but nearly forgotten example.

 

File Attachment:

File Name: limesurvey...1181.lss
File Size:26 KB


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