Overview
When running an interview, in some cases you would like to cancel the interview due to certain quality control flags rather than waiting for the result to be collected and reviewed in the office.
Imagine the following scenario: Surveyors are sent to a remote location for the weekend to conduct interviews and have to meet certain quotas.
The back office is closed on weekends and so surveyors complete their work and return home. In the following week, as part of the quality control process, it is discovered that a portion of the interviews are disqualified due to certain quality control flags. In such scenarios, you will at times be required to send your surveyors back to the field which may come with a high cost.
With this feature, you can now automatically disqualify interviews if certain quality control flags appear, so quotas won't be affected and your surveyors can complete their work while in the field.
Using the “OnSurveyQCFlagChanged” callback function
To use the OnSurveyQCFlagChanged callback you need to add it to your survey's “Advanced scripts”. It receives an input of inFlags. This variable contains a Boolean value for each quality control flag indicating whether it is on or not.
See the following example code, wherein we wish to cancel the interview if we see that the mid survey flag ByFakeGPS is on:
function OnSurveyQCFlagChanged(inFlags)
{
if(inFlags.ByFakeGPS)
{
ExecutionMgr.CancelSubject();
}
}
The above will cause the interview to be canceled at the moment a fake GPS location is captured and identified.
Please Note: The quality control flags are not updated at the same point in time across the interview. The flags are divided into four categories by the manner in which they are updated:
- Survey Start - those that are set right at the start of the interview
- Mid Survey - those that are set immediately when they are violated
- Survey Save - those that are set when the interview is saved (either by auto-save, script, or manually)
- Survey End - those set after the interview is completed, and so do not trigger the callback unless the subject is re-entered after submitting.
In the following table you can see the division of flags by their categories:
Category | Type |
---|---|
Survey Start |
|
Mid Survey |
|
Survey Save |
|
Survey End |
|
Comments
Please sign in to leave a comment.