- Posts: 409
- Thank you received: 34
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Using Quotas to Restrict response by postal code
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
7 years 2 months ago - 7 years 2 months ago #148660
by blocka
Using Quotas to Restrict response by postal code was created by blocka
I have a scenario where I want to prevent people from completing a survey if they aren't in a range of postal codes.
For example:
- a single postal code value (like A1A),
and/or
- a series of ranges (like K1A, M3B, V5C, etc.)
I know I can't use a short text in a Quota, but I think there should be a way to create a hidden question of type "Yes/No", that validates the postal code field to check if it (a) matches a single prefix or (2) a series of prefixes...
If the postal code isn't in my valid list, then the response to the Yes/No question is set to "N" -- and then I can use Quotas to terminate the survey for respondents where the Y/N question is equal to "N".
I'm wondering if someone can provide me with a working example of how to set this up or suggest another way do this?
For example:
- a single postal code value (like A1A),
and/or
- a series of ranges (like K1A, M3B, V5C, etc.)
I know I can't use a short text in a Quota, but I think there should be a way to create a hidden question of type "Yes/No", that validates the postal code field to check if it (a) matches a single prefix or (2) a series of prefixes...
If the postal code isn't in my valid list, then the response to the Yes/No question is set to "N" -- and then I can use Quotas to terminate the survey for respondents where the Y/N question is equal to "N".
I'm wondering if someone can provide me with a working example of how to set this up or suggest another way do this?
Last edit: 7 years 2 months ago by blocka.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
7 years 2 months ago #148664
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Using Quotas to Restrict response by postal code
Hi, blocka,
you already have your solution.
Create an equation which sets your "valuation value".
Like {if(postalcode=="A1A",1,if(postalcode=="C3S",1,if(postalcode=="K4D",1,0)))}
Now you have your numerical value where you can set a quota.
Not a working example, but you know the way.
Best regards
Joffm
you already have your solution.
Create an equation which sets your "valuation value".
Like {if(postalcode=="A1A",1,if(postalcode=="C3S",1,if(postalcode=="K4D",1,0)))}
Now you have your numerical value where you can set a quota.
Not a working example, but you know the way.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
7 years 2 months ago #148671
by blocka
Replied by blocka on topic Using Quotas to Restrict response by postal code
I've been able to implement this, and I've attached it as an example for anyone else who is trying to accomplish something like this (as I couldn't find an example on the forums).
My example shows how you can create a text question, and a Yes/No question, and an equation request, and use the equation question to inspect the text question, and assign either Yes or No to the Yes/No question.
These 3 questions are in my first Question Group. A second question group contains a few silly questions... And a quota has been implemented to terminate the survey if the value of my Yes/No question is No.
So, if you enter a valid postal code A1A, C3S, or K4D then you'll see the 2nd question group -- else the Quota kicks in, and terminates the survey with a friendly message.
My example shows how you can create a text question, and a Yes/No question, and an equation request, and use the equation question to inspect the text question, and assign either Yes or No to the Yes/No question.
These 3 questions are in my first Question Group. A second question group contains a few silly questions... And a quota has been implemented to terminate the survey if the value of my Yes/No question is No.
So, if you enter a valid postal code A1A, C3S, or K4D then you'll see the 2nd question group -- else the Quota kicks in, and terminates the survey with a friendly message.
Attachments:
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
7 years 2 months ago #148674
by jelo
I always needed a proxy question, which was set via Javascript or EM.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Using Quotas to Restrict response by postal code
Are equation questions now accessible in the quota system?Joffm wrote: Now you have your numerical value where you can set a quota.
Not a working example, but you know the way.
I always needed a proxy question, which was set via Javascript or EM.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
7 years 2 months ago - 7 years 2 months ago #148695
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Using Quotas to Restrict response by postal code
Hi, Jelo,
okay, I did not mention that, because I thought, it's obvious.
You have to assign the equation value to a hidden question that supports quotas.
Like: {Test2=if(equation1==1,1,2)}
And blocka did it this way - assigning the equation value to a "Y/N" question.
Best regards
Joffm
okay, I did not mention that, because I thought, it's obvious.
You have to assign the equation value to a hidden question that supports quotas.
Like: {Test2=if(equation1==1,1,2)}
And blocka did it this way - assigning the equation value to a "Y/N" question.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 7 years 2 months ago by Joffm. Reason: Typo
The topic has been locked.