Performing quota checks

Created: - Updated:

Quota checks are carried out via pre or post conditions. The isoverquota(quota_name) function can be used to check whether a quota target has been met, and the endsurvey(quotafull) function can be used to mark the current entry as quota full. The isoverquota function should always be placed after the question the quota refers to.

<precondition if="isoverquota(quota_name)" then="endsurvey(quotafull)"/>

Respondents can be screened out (based on a specific condition) by using the endsurvey(screenout) function. For example, this can be used to screen out respondents who are less than 18 years old after asking an age question. The following script shows this scenario:

First, we would define Q1 as:

<question type="single" id="1" max_select="1" order="fixed" style="more-options-below" enable_lookup="false" optional_response="false" text="How old are you?" alias="Q1">

  <choice id="1" label="&lt; 18" anchored="false" exclusive="false" alias=""/>

  <choice id="2" label="18" anchored="false" exclusive="false" alias=""/>

  <choice id="3" label="&gt; 18" anchored="false" exclusive="false" alias=""/>

</question>

We would then add the quota to this question:

Finally, we would define Q2 as:

<question type="single" max_select="1" order="fixed" style="more-options-below" enable_lookup="false" optional_response="false" id="2" text="how many often do you play poker?" alias="Q2">

  <choice id="1" label="not so often" anchored="false" exclusive="false" alias=""/>

  <choice id="2" label="often " anchored="false" exclusive="false" alias=""/>

  <choice id="3" label="quite often" anchored="false" exclusive="false" alias=""/>

  <precondition if="isoverquota(SQ1)" then="endsurvey(screenout)"/>

</question>

If the respondent is 18 or less than 18 years old, he/she will be screened out and the survey will end.