Setting quotas on answer options

Difficulty level: Difficult

What does the functionality do?

If you set quotas on e.g. the answer options of a certain question, a participant can continue with the survey as long as the set quota for his/her selected answer option has not yet been reached. This quota can be determined for each answer option in a filter condition.

Each time a participant has selected an answer option for which a quota has been defined and has completed the corresponding survey, the counter is incremented by 1. Once the quota for a particular answer option is reached, participants who subsequently select that answer option can be forwarded directly to the end page using a forwarding element. The Screenout status can be assigned to the survey they have filled out.

Use case and how to set it up?

First of all, you have to include a question in the survey for which you want to set quotas. This will usually be a single response question. In the example below, four quotas will be set for the four different answer options in question q1. For each of the four answer options (England, Scotland, Wales and Northern Ireland) we are going to define a quota of 5, i.e. all answer options can only be selected up to five times by survey participants.

After you have added the quota question to the survey, you need to include a value assignment in which a counter, e.g. counter11, should be created as a survey variable for each answer option. For this, you can click the Create Variable button on the right.

On the resulting window, you can define the variable name and the Integer number data type for each of the four counters, see image above.

After this, you can include the entire formula for all counters in one go in the box Is equal to the following term:. In this example, it involves the formula:

counter11=countInterviews(q1==1 and survey.State==’Completed’)
counter12=countInterviews(q1==2 and survey.State==’Completed’)
counter13=countInterviews(q1==3 and survey.State==’Completed’)
counter14=countInterviews(q1==4 and survey.State==’Completed’)

This formula can be interpreted as follows: when the first survey participant has selected the England answer option (value 1) from question q1 (q1==1) and has completed the survey (survey status Completed), the counter for the England answer option (i.e. counter11) will go from 0 to 1. Each time a participant selects the England answer option, this counter will be incremented by the value 1 again. If for an answer option the counter stands at 5 (i.e. the set quota has been reached), the next participant who selects this answer option will automatically be redirected to, for example, the thank you page. In order to set a quota of 5, see further on in this description.

The other counters in this value assignment function in the same way:

  • Counter12 records the number of times a participant has selected the Scotland answer option (q1==2).
  • Counter13 records the number of times a participant has selected the Wales answer option (q1==3).
  • Counter14 records the number of times a participant has selected the Northern Ireland answer option (q1==4).

In the Execute setting, you select the option Every time the participant passes this point.

If you want to display a participant a summary with the current counter score of the four answer options, you can include a text block in the survey after the value assignment. In this text block, you can define four custom variable placeholders in addition to a little text. Such a placeholder is always assigned the prefix custom, e.g. {{custom.counter11}}.

In order to include a custom placeholder in a text box, proceed as follows:

  • Click the link labelled Rich text editor at the top right of the text box to go to the RTE window.
  • Click the Placeholder icon (1).
  • Click the triangle in front of Custom Variables (2) at the bottom of the RTE window so that all custom variables created for the corresponding survey are displayed, see the Placeholder column on the right.
  • Specify the position in the text box (3) where a custom variable placeholder should be inserted.
  • Click a custom link, e.g. {{custom.counter11}}, (4) for this placeholder to be included at the indicated position in the text box.
  • Repeat the two previous steps for the other three custom placeholders.
  • Click the Save changes button (5) in the Rich text editor. The custom variable placeholders will be included in the survey.

For more information, please refer to the Rich Text Editor (RTE) article.

Finally, you include a forwarding element in your survey after the text block. In this, you can, for example, record that a participant’s survey will be assigned the Screenout status if, for question q1, he/she selects an answer option that has already been chosen before by five other participants (after all, the quota to be set for all answer options is 5).

If you click on the inserted forwarding element in the survey, you can specify the closing text, e.g. Thank you for wanting to participate, but we have already received enough responses from participants in your country, and the filter condition(s) on the right-hand side of the screen.

Once you have clicked the Add filter button, the Filter window appears allowing you to specify the condition(s) under which a message will or will not be displayed to a participant.

  • Show this element
  • if – Question – q1 In what part of the UK do you live? – 1 England – selected
    and – Custom variable – counter11 – > 5
  • or – Question – q1 In what part of the UK do you live? – 2 Scotland – selected
    and – Custom variable – counter12 – > 5
  • or – Question – q1 In what part of the UK do you live? – 3 Wales – selected
    and – Custom variable – counter13 – > 5
  • or – Question – q1 In what part of the UK do you live? – 4 Northern Ireland – selected
    and – Custom variable – counter14 – > 5

After you have completed the setup, you still need to click the green Save changes button. The closing text will be displayed to a participant, when he/she selects one of the four answer options for question q1 which has already been chosen five times before by other participants.

Updated on August 2, 2023
Was this article helpful?

Related Articles

Need Support?
Please login to your Survalyzer account and use the "Create Support Request" form.
Login to Survalyzer