OnAfterQuestionAsk event
The OnAfterQuestionAsk event runs after a question has been asked, answered, and validated using standard validation, and can be used to perform data cleaning (such as removing carriage return/line feed characters from text responses) or to track some aspect of the interview.
OnAfterQuestionAsk is an ideal way of building up a summary of the respondent’s answers that can be displayed at the end of the interview. Because it runs after a question has been asked, you can be sure that the summary will contain only the questions that the respondent answered rather than all questions in the script. For more information, see
Displaying a summary of answers at the end of the interview.
To define actions to be carried out after a question is asked, put the following statements in the routing section of the script:
Syntax
Sub OnAfterQuestionAsk(<question>, IOM)
<statements>
End Sub
Parameters
<question>
The current question.
<statements>
Interview scripting or mrScriptBasic statements that define the actions to be carried out.
IOM
The interview object. This gives the event access to all the properties and objects related to the interview.
Example
For an example of using
OnAfterQuestionAsk to prepare a record that can be written to the paradata database for the current question, see
Paradata example script.
See also