Question types

Created: - Updated:

This article covers these topics:

Info message question

A text message to display information to the user.

<question type="info">

Attributes

Attribute

Description

text

Question text.

Single-choice question

A single-choice question is a question where the respondent is given a list of alternatives from which he or she can select only one answer.

<question type="single">

Attributes

Attribute

Description

type

"single"

text

Question text.

alias

Question alias.

order

Choice order: fixed or randomized.

Sub elements

<choice>: for more information, see question and question choice.

Multiple-choice question

A multiple-choice question is a question where the respondent can select one or more answers.

<question type="multi">

Attributes

Attribute

Description

type

"multi"

text

Question text.

alias

Question alias.

max_select

Maximum number of answers a user can select.

min_select

Minimum number of answers a user must select before continuing.

order

Choice order: fixed or randomized.

Sub elements

<choice>: for information, see question and question choice.

Slider scale question

A single-choice question that is displayed as a slider.

<question type="slider">

Ranking question

A multiple-choice question, where the user can specify the order of the choices. For example, first choice, second choice, etc. 

<question type="ranking">

Open text question

Asks the user to enter text. You can set the permitted response length with the attributes given in the table below.

<question type="text">

Attributes

Attribute

Description

min_length

The minimum number of characters the user must enter in order to continue.

max_length

The maximum number of characters the user may enter.

Input_constraints

For details, see open text question.

Open Numeric question

Asks the user to enter a number. This question type treats the entered value as an integer. The range of an integer is -2,147,483,648 to 2,147,483,647. Also keep in mind that any leading zeros are removed (e.g. 020 becomes 20). If you need to record leading zeros (e.g. for a telephone number), we recommend using an open text question instead.

<question type="numeric">

Attributes

Attribute

Description

min

The minimum value the user can enter.

max

The maximum value the user can enter.

Multiple Open Text question

<question type="multiple_text" id="2" image="2" text="Answer the following questions.. " alias="Q2">
  <category label="Personal" id="1" anchored="false" exclusive="false" alias="">
    <choice id="1" label="Name" anchored="false" exclusive="false" alias=""/>
    <choice id="2" label="Gender" anchored="false" exclusive="false" alias=""/>
  </category>
  <category label="Address" id="2" anchored="false" exclusive="false" alias="">
    <choice id="3" label="Country" anchored="false" exclusive="false" alias=""/>
    <choice id="4" label="City" anchored="false" exclusive="false" alias=""/>
  </category>
</question>

Multiple Open Numeric question

<question type="multiple_numeric" top_label="Budget" sum_to_target="true" total="5000" id="1" image="1" text="How much is your Budget for the following aspects" alias="Q1">
  <category label="Monthly Charges" id="1" anchored="false" exclusive="false" alias="">
    <choice id="1" label="Rent &amp; Bills" anchored="false" exclusive="false" alias=""/>
    <choice id="2" label="Installments " anchored="false" exclusive="false" alias=""/>
  </category>
  <category label="Life Necessities " id="2" anchored="false" exclusive="false" alias="">
    <choice id="3" label="House shopping" anchored="false" exclusive="false" alias=""/>
    <choice id="4" label="Cloths shopping" anchored="false" exclusive="false" alias=""/>
  </category>
</question>

All the attributes are accessible through the UI.

Attribute Description
top_label Label text.
sum_to_target The default value is false; it is set to true once the total target value is reached.
total The total target value.

Menu question

For more information about scripting with menu please see Menus with advanced logic.

Date/Time question

This question type asks the user to enter a date, time or both.

<question type="datetime">

Attributes

Attribute

Description

type

"date"

label

 

mode

DATE, TIME or DATETIME

Photo Capture question

This question type asks the respondent to take a picture using his or her device's camera.

<question type="image">

Video Capture question

This question type asks the respondent to take a video using his or her device's camera.

<question type="capture_video">

Video Display question

This question type displays a video clip to the respondent.

<question type="video">

Barcode scanner

This question type asks the respondent to scan a barcode using his or her device's camera.

<question type="barcode">

Multitype Question

This question type asks the respondent to enter multiple integer, decimal, or boolean (true/false) questions.  It also allows for customized navigation buttons.  The various question types and buttons are added as question sub-elements "item".  Items must have unique ids and be arranged in numerical order.  Multibutton and button should be the last items in the question XML. 

<question type="multitype" alias="Q2" id="2">
     <item id="1" type="label" label="Enter the amounts below."/>
     <item id="2" type="numeric" label="Price (dollars)" optional_response="false" min="0" max="10" default="0" input_type="integer"/>
     <item id="3" type="numeric" label="Total price of purchase" optional_response="false" min="0" max="100" default="0" input_type="integer"/>
     <item id="4" type="boolean" label="Credit card purchase"/>
     <item id="5" type="label" label="Press enter another purchase to submit and continue."/>
     <item id="6" type="multibutton" label="OTHER OPTIONS">
          <action id="1" label="Enter another purchase"/>
          <action id="2" label="End survey"/>
     </item>
     <item id="7" type="button" label="NEXT"/>
</question>

The multibutton item is an additional toolbar button that will open a list of "action" elements.  These can be referenced in script using the multitypeanswer() function:

<postcondition if="multitypeanswer(Q2)==1" then="goto(Q5)">
<postcondition if="multitypeanswer(Q2)==2" then="endsurvey(complete)">
<postcondition if="multitypeanswer(Q2)==button" then="gotonext">

 

Function

Return

multitypeanswer(QALIAS)

Returns "button" if button selected.  Returns the id of the action if multibutton selected.

answer(QALIAS.ID)

Returns 0 if untoggled, 1 if toggled if id specified is a boolean response.  Returns the numeric input if id specified is numeric integer or