Understanding a Survey Definition File

This article explains a Survey Definition file.  It is an HTML file that can be used to import your survey into the system and is also the file format for exporting your survey.


Sample Survey Definition File

Here's an example of a basic survey definition file.

<survey name="Basic Survey">
  <section>
    <page type="QUESTION_BLOCK">
      <question type="RADIO" name="Q1">
        <text>Question Text</text>
        <list>
          <group ordinal="0">
            <response name="1" type="CHOICE">Response 1</response>
            <response name="2" type="CHOICE">Response 2</response>
          </group>
       </list>
      </question>
    </page>
  </section>
</survey>

Understanding your Survey Definition File

HTML Tags are explained below.  Note that these are the tags and attributes currently supported by the import/export system.  Any additional tags and attributes may be lost during the import/export process.

  • <survey> Root element of the survey definition file.
  • <section> Allows you to group together pages in your survey to define sections in your survey.  For example, you can create a section for your screener questions and another section for demographics.  The section also allows you to create a loop for the elements within the <section>
  • <page> Defines a page in your survey.  Each page may contain one or more questions by simply surrounding your questions with the page tags.
  • <question> Defines a question element.  The question element must have the following attributes:
    • type - States the question type for the element.  Here are the following types;
      • RADIO - Single-select question
      • CHECKBOX - Multi-select question
      • DROPDOWN - Single-select type question with a dropdown menu as the responses
      • TEXT - Open-ended text question
      • NUMERIC - Numeric open-ended question
      • SCALE - Single-select question with a horizontal scale as the responses
      • NONE - Displays only text to the respondent
      • SIMPLE_GRID - Grid question type.  Can either a RADIO, CHECKBOX, TEXT OR NUMERIC question type.  Orientation can be horizontal or vertical.
    • name - Unique identifier for your question element.  This is typically the question number in your survey (i.e Q1).  Must also begin with an alpha character.
    • Within your question element, you will need to define your answer options or choices.  This is done using the following elements:
      • <list> Define your list or responses.  In a SIMPLE_GRID, you can define the type as rows or columns.
      • <group> Allows you to group responses together.  For example, you can group a list of brands together and then group "specify" and "none of the above" responses together.  By default, you must have at least 1 group defined.
      • <response> This element defines your answer options or choices for your question element.  You must have the following attributes your each response:
        • name - Unique identifer for your response.  Depending on the question type, it may also be used as a data value for the question variable or it may be part of the variable name.  For example, if Q1 is a checkbox, then a response with name="1" will give you a variable Q1_1 in your data.  If Q1 is a radio, a response with name="1" will be the value for that specific response if selected by the respondent.
        • type - Specify the type of response.  The following are available:
          • CHOICE - Standard answer option for your question (i.e. single-select type question will have a radio button)
          • SPECIFY - Uses the standard option for your question type and will have an open-ended box next to the response text
          • DONTKNOW - Allows the answer option to serve as a "Don't know" option in your list.  Useful for "None of the above" type answers in a checkbox or grid question
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.