0% found this document useful (0 votes)
249 views14 pages

Introduction To ODK - Part 3 XlsForms - Question Types

The document discusses question types in XLSForms, including: - Single select and multiple select questions which allow selecting one or multiple answers from a list. - Text, integer, decimal, date, and time questions for collecting different data types. - Calculate questions for performing internal calculations and creating new variables. - Metadata questions for collecting device and user information. - Notes for displaying text without requiring input. It provides examples of how to set up different question types in the XLSForm survey sheet and choices sheet.

Uploaded by

momotouremomo96
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
249 views14 pages

Introduction To ODK - Part 3 XlsForms - Question Types

The document discusses question types in XLSForms, including: - Single select and multiple select questions which allow selecting one or multiple answers from a list. - Text, integer, decimal, date, and time questions for collecting different data types. - Calculate questions for performing internal calculations and creating new variables. - Metadata questions for collecting device and user information. - Notes for displaying text without requiring input. It provides examples of how to set up different question types in the XLSForm survey sheet and choices sheet.

Uploaded by

momotouremomo96
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Introduction to

ODK
Part 3: XLSforms – Question types

Creative Commons Attribution-ShareAlike 4.0 International


Example XLSForm

The example XLSForm used for


demonstrations in this webinar series
is available for download at:
https://stats4sd.org/resources/500

You can use it to explore and practice


or follow along with these videos.

Stats4SD
• Question types
• Multiple and Single Select

Contents • Text
• Integer/Decimal
• Other
• Metadata
• Calculate

Stats4SD
Writing questions - Types
Question type Answer input Example question
integer Integer (whole number) How old are you? (in completed years)
decimal Decimal input How tall are you? (in meters)
text A free text field What is your name?
select_one [list_name] Select one answer from a range of answer choices What is your sex?
[male, female, other]
select_multiple [list_name] Select multiple answers from a range of answer Do you own any of the following? pick all that apply
choices [television, mobile device, personal computer, tablet, e-reader]

note This displays a note to the data collector, does not The informed consent note prior to the beginning of the survey
require any form of input
geopoint Take a single GPS coordinate Take a GPS reading of the location of data collection
date Input a date Please enter your birth date
time Input a time Please enter a rough time you usually begin working in the day

Image Take a picture with the devices camera or upload an Please take a photo of the data collection area
image file
calculate Carries out an internal calculation which is not Multiple integer questions about the costs of resources then adding
displayed to the user them up for a total.
trigger/acknowledge Displays a note which can be acknowledged with an Question --- has been left blank, if this was intentional please press OK
“OK” to continue to continue

Stats4SD
Writing questions - Single and Multiple Select

• A select question is perhaps one of the most common question types you will need to become familiar
with when creating your XLSform.

• Under the “type column” you would write select_one/select_multiple and then the “list_name” from the
choices sheet for the answer options you wish to show.

• Then you will give this question a name and a label, the label will be the text which appears on the form.
These three are mandatory but you can set additional constraints or relevancies as needed.

Stats4SD
Writing questions - Single and Multiple Select

• On the choices sheet, you will create a row for each of your answer choices
• Use the name you wrote in the survey sheet as your “list_name”
• Write in some variable names for each of these options (there should be no spaces (can have . or _)
• Under “label::[language]” write in the label for the answer choice which will appear on the form

Stats4SD
Writing questions - Text
• Text questions are another common question type, though it is recommended not to use too
many of them in one survey as select questions are much more optimized for data
management and analysis.

• You do not need to do anything with the choices sheet; simply write in “text”, your variable
name and your question label in the respective columns

• For instance, in the example below, we have created a question asking the respondent for
their name:

Stats4SD
Writing questions - Integer vs. Decimal

• Integer and decimal questions are very similar, the main difference being integer questions only accept a whole
number as its input while decimal will allow for decimal numbers such as 1.2. Be sure to use the one which is most
appropriate for the data you are trying to collect.

• The example above shows an integer question. You write name and label much like you would any other question.

• We have also provided a hint to the enumerator that they should write 0 rather than leaving the question blank if the
answer is none.

• We have also added a constraint and a constraint message; we have restricted the input to only be less than 367 so that
one cannot say they are taking more trips than there are days in the year. We will come back to these in more detail.

Stats4SD
Other question types
You can use notes to display text to the
data collector, such as notes and
instructions to the respondent, but which
do not require any form of input.

You can also ask for dates using the “date” question type. In the example below, we ask the respondent for
their date of birth. Note the use of “no-calendar” in the appearance column; this controls how the user inputs
the answer. In this case, the device will not show a calendar format but in a month/day/year list to select from.

Stats4SD
Metadata
There are many more metadata questions
which can be collected:

Metadata type Meaning


IMEI (International Mobile
deviceid
Equipment Identity)

• A number of additional internal question types exist for subscriberid


IMSI (International Mobile
Subscriber Identity)
the purposes of gathering metadata about the data
collection process such as the start time, end time and simserial SIM serial number.

the date. (as shown in the example above) phonenumber Phone number
username Username configured
• It is generally good practice that these be put at the
email Email address configured
start or end of your form and grouped together. These
are not displayed but collected automatically and do audit
Log enumerator behavior
during data entry
not need a label.

Stats4SD
Calculate
• Calculate are an extremely useful and versatile question type you can use within your
forms.
• Could be used for multiple purposes
• Calculate variables for the analysis stage
• Save incredible amounts of time and effort in the post data collection stage, can recode
variables/create new ones where possible
• Of course some variables are best coded afterwards in response to the data itself so do not
overuse calculate
• Calculate variables for internal use
• Names & numbers to be referred to in text
• Statistics/Numbers to be double checked e.g. totals
• To simplify a constraint/skip pattern

Stats4SD
Calculate – Operators/Functions
You would write “calculate” into the type column and then write your formula into the
calculation column (e.g. ${v1} + ${v2}). There are many operators and functions you can use:
• Operators
• Maths (+, -, *, div)
• Comparison ( =, != (not equal to), >, >=, <, <=)
• Boolean (and, or)
• Functions
• Accessing response values (selected, selected-at, count-selected, jr:choice-name)
• Repeated groups (sum, count, max, min)
• Strings (starts-with, ends-with, contains, substr (substring), concat)
• Maths (round, pow (power), log, log10, etc.)

Stats4SD
• Many different question types you can use
• Single and multiple select
• Define your answers in the choices sheet
• Decimal and integer

Summary
• Text questions
• Best to limit their use
• Many, many more – date, note etc.
• Metadata can be useful for data monitoring
• Calculates are highly flexible and useful
• Try not to complicate them too far beyond your
own skills and limits

Stats4SD
From the webinar series:
Introduction to ODK
Created and presented by Alex Thomson
CCRP – Research Methods Support project
May 2020

Find more guides and materials at


stats4sd.org/resources

©2020 Statistics for Sustainable Development Creative Commons Attribution-ShareAlike 4.0 International

You might also like