Creating a Survey - Text File - part 1

This is a more advanced method of creating a survey, as such, is mainly used by programmers and users that prefer a text based interface. 


With this method you're able to build / script an entire survey, then import it into Q-Fi to create or update your survey.


NOTE: We will frequently reference the words identifiers and shortcodes, these are used to reference the different elements in a survey structure.


Text Editor Software

Creating and importing your survey using a text file requires building the survey in a plain text format and saving it in a .txt extension. 


Any text editor (not word processing) software that can save a file in the .txt file extension will work. Here are some examples of free text editing software you can use:

  • TextPad
  • Notepad++
  • Brackets
  • TextWrangler (Mac)
  • Sublime (Mac)
  • Atom


Question types

In this introductory part we will create the following question types:

  1. Descriptive question
  2. List question
  3. Grid question
  4. Textbox question
  5. Open-end question 


Now let's begin. Open your favorite text editor..


1. Descriptive Question

Let's start by adding a new page called "Page 1":

  • The command "~" tells Q-Fi to expect a new element, like a page, question, settings, etc.

Now that we have a page, let's add a question, we will add a Descriptive question with the name / number "BEGIN"

  • "~NQ:" - this tells Q-Fi that we are adding / updating the question called "BEGIN". "NQ" stands for New Question
  • "DS" - is a shortcode that represents the "Descriptive" question type

Let's add the question text for the BEGIN question:

  • "~BEGIN_QT:" - represents the Question Text (QT) for the "BEGIN" question

That's it! Your first question is ready to go. The final code for this question should look like this:

  • The "#" symbol can be used to separate your questions, this makes the file easier to read once you've added a few questions.

If you import this question into a new project at this point and preview the survey, then you should see the following output:

2. List Question

Next up is a choice list question. We will start by creating a new page called "Page 2"

Now, we define the question name / number and question type:

  • "~NQ:" - Tells Q-Fi that we are adding / updating the question called "Q1".
  • "LS" - The LS short-code represent a Choice List Question.

Now we add the question text for the Q1 question:

  • "~Q1_QT:" - represents the Question Text (QT) for the "Q1" question

A list question will need a list of choices for respondents to select from, so let's add the list:

  • "~Q1_CL:" - represents the choice list (CL) for the "Q1" question
  • "[{MIN:1; *MAX:5;}]" - the MIN and MAX properties defines the minimum and maximum number of items that a respondent can be selected from the choice list.

Your new list question is ready to be imported. The final code for this question should look like this:

After importing and previewing Q1, you should have a similar result as the following screenshot:

3. Grid Question

A grid question is usually referred to as a likert scale or matrix question. It usually consists of multiple rows and columns and is an efficient way of asking respondents to rate multiple elements in one question. To start we will create a new page called "Page 3"

  • "GR" - The GR short-code represent a Grid Question type
  • "~Q2_QT:" - represents the Question Text (QT) for the "Q2" question
  • "~Q2_ROW:" - represents the rows or list of statements the respondents will need to rate for the "Q2" question
  • The letters in the curly brackets are used as identifiers for each row item in the the question and is required, these are basically the codes that can be referenced in the data
  • "~Q2_COL:" - represents the columns or choices the respondents will use to rate the items in the rows in the "Q2" question
  • The numbers in the curly brackets are codes or identifiers for each item in the choice list and is required.

After importing and previewing Q2, you should have a similar result as the following screenshot:

4. Textbox Question

A textbox question is normally used to collect things like name, email address, phone number, etc. Let's start by creating a new page called "Page 4"

  • "TEXT" - The TEXT short-code represent a Textbox Question type
  • "~Q3_QT:" - represents the Question Text (QT) for the "Q3" question

  • "~Q3_CL:" - many questions in Q-Fi share similar elements, just like a choice list question the textbox question also consists of a list, which is used to list all the textboxes for a textbox question. The "CL" in this case represents the list of textboxes we will add in the Q3 question.

  • The numbers in the curly brackets are codes or identifiers for each item in the choice list and is required.

  • "Year" will be the label that is shown to respondents

  • "[{P:Range:1900-2017;}]" - this part of the code indicates that we are applying a "Range" property so that respondents can only enter values within the rage of 1900 to 2017 into the textbox.

The new textbox question is ready to be imported. After importing and previewing Q3, you should have a similar result as the following screenshot:

5. Open-end Question

An Open-end question is normally used to collect larger amounts of text, such as verbatim answers or comments. Let's start by creating a new page called "Page 5"

  • "~NQ:" - Tells Q-Fi that we are adding / updating the question called "Q4".
  • "OPENENDED" - The OPENENDED short-code represent an Open-end Question type
  • "~Q4_QT:" - represents the Question Text (QT) for the "Q4" question
  • "~Q4_CL:" - The "CL" in this case represents the list of open-end boxes we will add in the Q4 question.
  • The numbers in the curly brackets are codes or identifiers for each item in the choice list and is required.
  • "~Q4_SET:" - the "_SET" is used to define settings for Q4
  • "[{LABELPOSITION:inside;}] - settings are defined inside curly brackets, in this case we are defining the position of the choice label. For open-end questions we can place the label in the Top, Left, Right, Inside or Hide the label. For this example we are placing the label "inside" the open-end box.

The new open-end question is ready to be imported. After importing and previewing Q4, you should have a similar result as the following screenshot:

Part 2 is coming soon.

Was this article helpful?

0 out of 0 liked this article

Still need help? Message Us