Interview Model
Last updated
Last updated
The Interview Model is a set of classes that allow the customization of a survey experience:
The Interview Model supports the representation of the questions defined through the fields statements in OneScript.
The Interview Model supports access to every properties and feature of a question or field to be stored with the results of a survey.
The Interview Model supports the ability to route between questions depending on the results collected. 1. The interview handles saving questions in a format be loaded into a DB for analysis.
To run an interview a OneScript Image is loaded and creates an Interview State used to maintain a session for the interview to processed. The Interview State provides access to a context value which in turn provides access to the Interview Model for the current interview.
The interview state is used to access the state of the current interview from within a OneScript application. Interview State is only created when fields are defined in OneScript. Form more information on this please refer to .
As the OneScript image is executed it will manipulate the Interview Model. This includes asking questions. Some of these activities will update the Interview Action. The is aware of the Interview State if present and will react to the Interview Action in the most appropriate way:
Action
Description
Restart
Restart a survey and process all the code until a an unasked question has been discovered.
Ask
Pause the virtual machine because a question has been asked.
Show
Pause the virtual machine because a question has been shown
Continue
Continue the code from the point that it was last paused
Pausing a virtual machine requires the surrounding environment it runs in to handle the pauses successfully and continue running the virtual machine in the most appropriate manner.
As an interview is run a cache is generated that contains the result of the survey. These cache files can be loaded into a database for analysis. In cases where an interview times out a cache file is also used to restart a survey.
The interview model contains a summary of the interview status and a list of the questions together with their responses.
Each field created in OneScript will have a Question Model added to the Interview Model. The Question Model contains a list of
For complex type questions (for example, those with multiple choices) Categorical Models are generated.
Each Question Model contains a reference to the response made at the data entry point of the survey.
Where text can be displayed a label model is referenced. This allows access to piping and multiple languages for questions, options and navigation.
The navigation model describes the navigation of a survey and manages what controls (buttons and dropdowns) appear to manage the navigation back and forth through a survey.