Desktop User Guides > Author > Testing questionnaires > Viewing the questionnaire script
 
Viewing the questionnaire script
When you create a questionnaire using UNICOM Intelligence Author, the questions and routing items that you create are stored in the questionnaire (.mdd) file in the form of a script. The script is written using the Interview Scripting Language. It is not necessary to understand the script underlying the questionnaire file in order to use UNICOM Intelligence Author, as the user interface provides the options necessary to create many types of questionnaire without using the scripting language. However, if you are creating complex questionnaires, you might find that there are some things you want to do that require you to edit the script directly. You cannot edit the script in UNICOM Intelligence Author, but you can open .mdd files created using UNICOM Intelligence Author in UNICOM Intelligence Professional. UNICOM Intelligence Professional provides an integrated development environment that enables you to create, edit, run, and debug scripts.
If you use UNICOM Intelligence Professional to edit scripts, you might find it useful to view the script that UNICOM Intelligence Author creates as you add questions and routing items to your questionnaire file, so that you can see the effect of a change in the user interface on the underlying script. You can do this using the View Script dialog.
To view the script for a questionnaire
1 In the Routings pane, select the routing for which you want to view the script.
2 Click Tools > View Script, or press Alt+T, S.
The View Script dialog displays the script for the selected routing in the currently open questionnaire file. This consists of the following sections:
Script header
Error handler
Routing
Metadata
For more information, see Script sections in the View Script dialog.
Copying and saving the script
You can reuse parts of the script in your own script files using UNICOM Intelligence Professional. You can copy or save the contents of the View Script dialog and use the saved file as a source of script snippets.
To copy the contents of the View Script dialog, click Copy All. You can then paste the copied text into a text file.
To save the contents of the View Script dialog to a file, click Save As, and then select the folder where you want to save the file. The file is saved with the extension .ivs.
You can then open the file in a text editor or in UNICOM Intelligence Professional and edit it as required, before pasting the required items into an .mdd file in UNICOM Intelligence Professional (you will need to add the routing and metadata sections separately and remove the line numbering and other unwanted sections).
UNICOM Intelligence Professional does not recognize files saved from the View Script dialog as valid .mdd files, but as text files. This is because the View Script dialog just displays and copies the text from the .mdd file rather than including the XML structure that enables UNICOM Intelligence applications to interpret it as a metadata file. The View Script dialog is intended for viewing scripts, and to provide a quick method of copying snippets of script. To edit a file that you have created using UNICOM Intelligence Author in UNICOM Intelligence Professional, save and close the file in UNICOM Intelligence Author, and then open the .mdd file in UNICOM Intelligence Professional.
See also
Script sections in the View Script dialog
Testing questionnaires