Desktop User Guides > Professional > Interview scripting > Writing interview scripts > Events > OnAfterQuestionAsk event
 
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.
To define actions to be carried out after a question is asked, place the following statements in the routing section of the script:
Sub OnAfterQuestionAsk(Question, IOM)
  statements
End Sub
where:
Question represents the current question.
statements are interview scripting or mrScriptBasic statements that define the actions to be carried out.
IOM is the interview object. This gives the event access to all the properties and objects related to the interview.
Refer to Paradata example script for an example of using OnAfterQuestionAsk to prepare a record that can be written to the paradata database for the current question.
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. See Displaying a summary of answers at the end of the interview for more information.
See also
OnBeforeQuestionValidation event
Events