The article explain how to block a web respondent in case of multi-mode survey
|Written for||Scripters and Data Processors ; beginners|
script; askiascript; multi-mode; webprod;switch
If you're running a multi-mode survey, you may need to block a contact on web side, when you have switched it back to Cati.
The first thing you need to know is that Webprod has it own survey data database (named WebInterviews) where interview data is stored for each survey. Here how it works:
1 - Web survey only
Web interview data is sent in real time from Webprod (WebInterviews) to Cca (Surveys).
2 - Interview started in Cati then a link to the web survey is sent from Cati
Cati Interview data is sent from Cca (Surveys) to Webprod (WebInterviews) and the contact is blocked on Cati side.
3 - Interview started in Web and switched back to Cati
Web Interview data is sent to Cca (Surveys). But the link to the web survey is still available.
Here how to deal with case 3. For that, you need to get two informations:
- The SQL link to the WebInterviews database
- The name of the WebInterviews table for your survey.
Then, in Design, you need to:
1 - Import the Guid
The Guid is the unique identifier accross all data collection modes. This Guid is used in various places in our databases.
Create a "Guid" open ended question. And, with a routing at the very start of the survey, specify the Interview.GUID in it. There is a small subtlety as the Guid value specified is surrounded with brackets, while, on askiafield tables, that's not the case:
In your specified value, you will nee to remove these brackets with the following syntax:
Now you have a value that can be used in SQL queries.
2 - Update the WebInterviews survey table
Add a Start SQL Query at the end of your survey.
DSN is your SQL link to WebInterviews table:
Provider=sqloledb;Data Source=[YourSQLServer];Initial Catalog=[YourWebInterviewsDatabase];Trusted_Connection=no;User Id=[YourSQLLogin];Password=[YourSQLPassword]
Update [YourWebInterviewSurveyTable] Set IsCompleted=1, IsSentToCca=1 where Guid='??[YourGuidQuestion]??'
With The IsCompleted tag in Webinterview set as True, the respondent cannot use anymore the DoPanel link. He will get a "laready compelted" final page.