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
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
7 years 2 months ago - 7 years 2 months ago #148660 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?
Last edit: 7 years 2 months ago by blocka.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #148664 by Joffm
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

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
7 years 2 months ago #148671 by blocka
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.
The topic has been locked.
More
7 years 2 months ago #148674 by jelo

Joffm wrote: Now you have your numerical value where you can set a quota.
Not a working example, but you know the way.

Are equation questions now accessible in the quota system?
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
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago - 7 years 2 months ago #148695 by Joffm
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

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.

Lime-years ahead

Online-surveys for every purse and purpose