Difference between revisions of "SurveyCTO Programming"

Jump to: navigation, search
 
(50 intermediate revisions by 7 users not shown)
Line 1: Line 1:
There are two common ways to program your questionnaire in SurveyCTO. Either by using the form builder or by writing your code in an Excel Sheet. The form builder is useful for the absolute beginner and also when you need to make a quick edit in a form already uploaded to the server. However, the complexity of a typical DIME survey makes all projects sooner or later switch to coding in Excel.  
The [[Impact Evaluation Team|impact evaluation team]] (or '''research team''') must begin by first [[Questionnaire Design|designing]] and [[Questionnaire Translation|translating]] the '''survey instrument''' (or '''questionnaire'''). Once the translated survey instrument is ready, the next step in [[Primary Data Collection|primary data collection]] is to [[Questionnaire Programming|program the electronic survey]] for a [[Computer-Assisted Personal Interviews (CAPI)|CAPI]] or a [[Remote Surveys#Phone Surveys (CATI)|CATI]]. The biggest challenge in '''questionnaire programming''' is keeping track of the [[Questionnaire Design#Modules|content and structure]] of the questionnaire. While there are several [[Computer-Assisted Personal Interviews (CAPI)#Software|software tools]] available for questionnaire programming, [https://www.surveycto.com/ SurveyCTO] is the most commonly-used [https://getodk.org/ Open Data Kit (ODK)-based] tool in development research. Learning the [[SurveyCTO Programming Work Flow|steps]] and [[SurveyCTO Coding Practices|best practices]] in '''SurveyCTO programming''' is therefore essential for anyone who wishes to code a complex, high-quality survey instrument.


As a questionnaire grows bigger, even the best coder lose the overview over the questionnaire. This is the most significant advantage of coding in Excel. While it is possibly to push through and keep using the form builder, data sets from questionnaires not finalized in Excel tend to be less well structured and more cumbersome to work with.  
== Read First ==
* [https://www.worldbank.org/en/research/dime/data-and-analytics DIME Analytics] has created the following [https://osf.io/n7ctd/ SurveyCTO user guide] for '''enumerators'''.
* DIME Analytics has also created a [https://docs.google.com/document/u/2/d/1yVFdWugHV37vRaXmt-FnW80r015JVESR0bIHloFq378/edit SurveyCTO Style Guide] for [[Questionnaire Programming|programming electronic surveys]].
* The [[Impact Evaluation Team|research team]] must only move to [[Questionnaire Programming|questionnaire programming]] after finalizing the [[Questionnaire Design|design]] and [[Questionnaire Translation|translated versions]] of a questionnaire.
* [https://www.surveycto.com/ SurveyCTO] is the most commonly-used [https://getodk.org/ Open Data Kit (ODK)-based] tool for '''programming electronic surveys''' in development research.
* There are two common methods involved in '''SurveyCTO programming''' - using the built-in '''form builder''' in '''SurveyCTO''', or by writing the code in an Excel sheet.
* While it is easier to '''program an instrument''' using the '''form builder''', we strongly recommend switching over to the '''Excel method''' as soon as possible. A '''research team''' will have to do this eventually as the instrument becomes longer and more complex.
* It is easy to switch back and forth between the form builder and the Excel method.
* A recommended strategy to transition into programming with the Excel method is to create a form using the '''form builder method''', and then download and inspect it in Excel.


We do not object towards starting programming in the form builder, but we strongly recommend that the questionnaire is at least reviewed in Excel. Experienced coders tend to skip the form builder part altogether, apart from making a quick update to a form already uploaded to the server.
== Form Builder Method ==
There are two common ways to program your questionnaire in SurveyCTO: using the form builder or writing your code in an Excel Sheet. The form builder is useful for beginners and also when you need to make a quick edit in a form already uploaded to a server. Keep in mind, however, that the complexity of a typical DIME survey makes all projects sooner or later switch to the Excel method.


= Read First =
As a questionnaire grows bigger, even the best coders lose the overview over the questionnaire. This is the most significant advantage of coding in Excel. While it is possibly to push through and keep using the form builder, data sets from questionnaires not finalized in Excel tend to be less well structured and more cumbersome to work with.


*It is easy to switch back and forth between the form builder and the Excel method. Therefore, one way to transition into coding in Excel might be to create something in the form builder that can be downloaded and inspected in Excel format.
We do not object towards starting programming in the form builder, but we strongly recommend that the questionnaire is at least reviewed in Excel. Experienced coders tend to skip the form builder part altogether, apart from when making a quick update to a form already uploaded to the server.
*While it is easier for a beginner to start in the form builder, we strongly recommend you to switch over to the Excel Method as soon as possible, as you will have to do that eventually unless your questionnaire is very short.
The form builder is a feature that SurveyCTO provides on their servers.
 
=== How to access this method? ===
For existing forms, you access the form builder method by going to the Design tab and clicking on any form that already exists. After clicking the form a menu will appear below it. Click <code>'''edit'''</code> and this questionnaire will be opened in the form builder.
 
To create a new form using the form builder, click on the <code>'''+'''</code> button below the section header ''Your forms and datasets'' of the Design tab. If you hover over the button, you will see the message ''Add form, group or dataset''. After clicking it, select <code>'''Start new form'''</code>. Register a form title, click <code>'''Next'''</code>, and select <code>'''Edit online'''</code>. A new tab with the form builder will open in your browser.
 
=== How to use it? ===
The form builder is an intuitive web interface where you add new questions or groups. When adding a new question or group, you specify the question type, labels, skip patterns, value restrictions, and other attributes.
 
=== How to switch to the Excel method? ===
Save your work in the form builder. When you are back to the Design tab on your web browser, click on your questionnaire. A menu will open below. Click on <code>'''download'''</code>, and in the next menu that appears select <code>'''Form files'''</code>. You will then get a list of the files associated with the questionnaire. Download the file in <code>'''Spreadsheet form definition (filename.xlsx)'''</code> and open it in Excel.
 
== Excel Method ==
 
This method is inherited from Open Data Kit (ODK), the open-source CAPI software that SurveyCTO is built on.  


= Form Builder =
=== How to access this method? ===
The form builder is a feature that SurveyCTO provides on their servers.


== How to access? ==
Questionnaires using the Excel form method are saved as Excel files. To edit an already existing form, simply open that file in Excel. Each row is an element of the questionnaire, for example: individual questions, opening and closing groups, notes, repeated groups, and others. Each column contains the information and attributes that control how the elements behave or are displayed.
You access it by going to the Design tab and click on any form that already exist. After clicking the form a menu appears below it. Click <code>'''edit'''</code> and this questionnaire will be opened in the form builder. If you do not already have a form you want to edit, then click <code>'''start new'''</code> right at the top of the section ''Your Forms''. After you have filled in the forms and generated your questionnaire, you can click <code>'''edit online'''</code> and it will open your new questionnaire in the form builder.


== How to use? ==
If you want to create a new form, there are two main options available:
The form builder is an intuitive web interface where you add new questions, groups, etc. by the click of a button. After creating a question you fill in a form with question type, question label, skip patterns, etc.


== How to switch to the Excel method? ==
* Access SurveyCTO's [https://docs.google.com/spreadsheets/d/1JroFCu0HqnPsZwt0jAYa7o311VeOZFc6FRYfET4wAsA basic template form] and modify it to program your questionnaire. Remember to encrypt this form when it is ready to be used for data collection.
Save your work in the form builder and when you are back to the Design tab on your server, you can click the questionnaire. After clicking it you have a menu below the questionnaire, click <code>'''download'''</code>, and in the second menu that appears click <code>'''form files'''</code>. You then get a list of the files associated with the questionnaire. Download the <code>'''Spreadsheet form definition (filename.xlsx)'''</code> and then open that file in Excel.
* Create a new questionnaire from SurveyCTO's [[SurveyCTO_Programming_Work_Flow#Template_Forms|template forms]] from the form builder. Then download the new form as described in [[SurveyCTO_Programming#How_to_switch_to_the_Excel_method?|How to switch to the Excel method?]] and open the downloaded file in Excel.


= Programming in Excel =
=== How to use it? ===


This method is inherited from ODK (the open source CAPI language that SurveyCTO is built on).  
The language used to program Questionnaires in Excel is inherited from ODK. It is more difficult for a beginner to get started with the Excel method compared to the form builder, but there are a lot of resources to help you. All Excel versions of the form templates provided by SurveyCTO have help tabs with quick help on how to program questionnaire forms. Aditionally, SurveyCTO provides detailed documentation in the <code>'''Documentation'''</code> section of all of their servers, which you will find in the upper right part of your server. Many experienced SurveyCTO programmers have gained their skills by looking at other people's code. Finally, the ODK community also provides resources. However, use this with care as SurveyCTO has made some alterations to how ODK is implemented. Use the ODK community's resources as a final solution if no SurveyCTO source provides you with an answer.


== How to access? ==
'''''Tip''''': An excellent way to learn is by trying out new constraints, settings, and checks in the Form Builder first and then [[SurveyCTO_Programming#How_to_switch_to_the_Excel_method?|downloading the excel file]] for that form and studying the code.
The questionnaire is saved as an Excel file. To edit a form that already exist, you simply open that file in Excel. Each row is a element in the questionnaire, for example, question, group, note, repeat group etc. Each column is the information that controls how the question, group, note, repeat group etc. behaves and/or is displayed.


To start a new form, create a questionnaire from SurveyCTO's [[SCTO_Programming_Work_Flow#Template_Forms|template forms]] from the form builder. Download the new form as described in the [[SCTO_Programming#How_to_switch_to_the_Excel_method?|How to switch to the Excel method?]] above and open the downloaded file in Excel.
=== How to switch to the form builder? ===
After logging in to a SurveyCTO server, go to the design tab and in the menu at the top of the Your forms section click the <code>'''Upload Form'''</code> button. Upload your form by following the instructions. The name of your form on the server is set in the [[SurveyCTO Form Settings|form settings]] in the settings tab in your questionnaire file.  


== How to use? ==
After uploading your Excel form, scroll down to find it and access the form builder according to the [[SurveyCTO_Programming#Form_Builder|How to access the form builder]] instructions.
The language used to program Questionnaires in Excel is inherited from ODK. It is more difficult for a beginner to get started with the Excel method compared to the form builder, but there are a lot of resources to help you. All Excel versions of the form templates provided by SurveyCTO has help tabs with quick help on how to write the Questionnaire. SurveyCTO provides detailed documentation on in the help section of all of their servers. Many experienced SurveyCTO programmers have gained their skills by looking at other people's code. Finally, the ODK community also provide resources. However, use this with care as SurveyCTO have made some alterations to how ODK is implemented. Use the ODK community's resources as a final solution if no SurveyCTO source provides you with an answer.


== How to switch to the form builder? ==
== DIME Analytics SurveyCTO Style Guide ==
After logging in to a SurveyCTO server, go to the design tab and in the menu at the top of the Your forms section click the <code>'''Upload Form'''</code> button. Upload your form by following the instructions. The name of your form on the server is set in the [[SCTO_Form_Settings|form settings]] in the settings tab in your questionnaire file.
[https://www.worldbank.org/en/research/dime/data-and-analytics DIME Analytics] has created the [https://docs.google.com/document/d/1yVFdWugHV37vRaXmt-FnW80r015JVESR0bIHloFq378/edit#heading=h.ifwt68s1w4n SurveyCTO Style Guide], with the aim of establishing the use of a standardized coding style for [[Field Surveys|field surveys]] in '''development research'''. In addition, we have developed the [https://docs.google.com/spreadsheets/u/2/d/1I2uXEgga0LwEPnz8m_pPrgTgmIjsC4yl/edit#gid=1987277168 DIME XLSForm Template] to provide concrete examples of the recommendations provided in this guide. The '''DIME Analytics SurveyCTO Style Guide'''  broadly covers three stylistic aspects of [[Questionnaire Programming|programming an electronic survey]] using '''XLSForms''' (or '''Excel method'''):


Scroll down to find your form and access the form builder according tot the [[SCTO_Programming#form_builder|How to access the form builder]] instruction.
# '''Design and development'''. This deals with making XLSForms easier to read during the stage of [[Questionnaire Design|survey design]].
# '''User interface'''. This deals with the set up of '''XLSForm programming''' that improves user experience when answering the survey.
# '''Exported form dataset'''. This deals with the set up of XLSForm programming that supports more efficient ways of working with the exported data.


= Back to parent article =
== Related Pages ==


This article is a part of the chapter [[Questionnaire Programming]].
This article is a part of the chapter [[Questionnaire Programming]].


= See also =
== Additional Resources ==
*DIME Analytics (World Bank), [https://osf.io/ezm68 Overview of SurveyCTO at the World Bank]
*DIME Analytics (World Bank), [https://osf.io/8e7bj Introduction to SurveyCTO]
*DIME Analytics (World Bank), [https://osf.io/2nepd Advanced SurveyCTO Programming]
*DIME Analytics (World Bank), [https://osf.io/t5kq3 SurveyCTO Resources]
*SurveyCTO, [https://drive.google.com/file/d/1supgBxfpDaGMbJEFCAOFQ8T84aHEWBip/view Successful Web Form Deployment]
*OpenDataKit, [https://opendatakit.org/help/form-design/ Form Design]


= Further Reading =
[[Category: Questionnaire Programming]]
*https://opendatakit.org/help/form-design/

Latest revision as of 18:55, 2 August 2023

The impact evaluation team (or research team) must begin by first designing and translating the survey instrument (or questionnaire). Once the translated survey instrument is ready, the next step in primary data collection is to program the electronic survey for a CAPI or a CATI. The biggest challenge in questionnaire programming is keeping track of the content and structure of the questionnaire. While there are several software tools available for questionnaire programming, SurveyCTO is the most commonly-used Open Data Kit (ODK)-based tool in development research. Learning the steps and best practices in SurveyCTO programming is therefore essential for anyone who wishes to code a complex, high-quality survey instrument.

Read First

  • DIME Analytics has created the following SurveyCTO user guide for enumerators.
  • DIME Analytics has also created a SurveyCTO Style Guide for programming electronic surveys.
  • The research team must only move to questionnaire programming after finalizing the design and translated versions of a questionnaire.
  • SurveyCTO is the most commonly-used Open Data Kit (ODK)-based tool for programming electronic surveys in development research.
  • There are two common methods involved in SurveyCTO programming - using the built-in form builder in SurveyCTO, or by writing the code in an Excel sheet.
  • While it is easier to program an instrument using the form builder, we strongly recommend switching over to the Excel method as soon as possible. A research team will have to do this eventually as the instrument becomes longer and more complex.
  • It is easy to switch back and forth between the form builder and the Excel method.
  • A recommended strategy to transition into programming with the Excel method is to create a form using the form builder method, and then download and inspect it in Excel.

Form Builder Method

There are two common ways to program your questionnaire in SurveyCTO: using the form builder or writing your code in an Excel Sheet. The form builder is useful for beginners and also when you need to make a quick edit in a form already uploaded to a server. Keep in mind, however, that the complexity of a typical DIME survey makes all projects sooner or later switch to the Excel method.

As a questionnaire grows bigger, even the best coders lose the overview over the questionnaire. This is the most significant advantage of coding in Excel. While it is possibly to push through and keep using the form builder, data sets from questionnaires not finalized in Excel tend to be less well structured and more cumbersome to work with.

We do not object towards starting programming in the form builder, but we strongly recommend that the questionnaire is at least reviewed in Excel. Experienced coders tend to skip the form builder part altogether, apart from when making a quick update to a form already uploaded to the server. The form builder is a feature that SurveyCTO provides on their servers.

How to access this method?

For existing forms, you access the form builder method by going to the Design tab and clicking on any form that already exists. After clicking the form a menu will appear below it. Click edit and this questionnaire will be opened in the form builder.

To create a new form using the form builder, click on the + button below the section header Your forms and datasets of the Design tab. If you hover over the button, you will see the message Add form, group or dataset. After clicking it, select Start new form. Register a form title, click Next, and select Edit online. A new tab with the form builder will open in your browser.

How to use it?

The form builder is an intuitive web interface where you add new questions or groups. When adding a new question or group, you specify the question type, labels, skip patterns, value restrictions, and other attributes.

How to switch to the Excel method?

Save your work in the form builder. When you are back to the Design tab on your web browser, click on your questionnaire. A menu will open below. Click on download, and in the next menu that appears select Form files. You will then get a list of the files associated with the questionnaire. Download the file in Spreadsheet form definition (filename.xlsx) and open it in Excel.

Excel Method

This method is inherited from Open Data Kit (ODK), the open-source CAPI software that SurveyCTO is built on.

How to access this method?

Questionnaires using the Excel form method are saved as Excel files. To edit an already existing form, simply open that file in Excel. Each row is an element of the questionnaire, for example: individual questions, opening and closing groups, notes, repeated groups, and others. Each column contains the information and attributes that control how the elements behave or are displayed.

If you want to create a new form, there are two main options available:

  • Access SurveyCTO's basic template form and modify it to program your questionnaire. Remember to encrypt this form when it is ready to be used for data collection.
  • Create a new questionnaire from SurveyCTO's template forms from the form builder. Then download the new form as described in How to switch to the Excel method? and open the downloaded file in Excel.

How to use it?

The language used to program Questionnaires in Excel is inherited from ODK. It is more difficult for a beginner to get started with the Excel method compared to the form builder, but there are a lot of resources to help you. All Excel versions of the form templates provided by SurveyCTO have help tabs with quick help on how to program questionnaire forms. Aditionally, SurveyCTO provides detailed documentation in the Documentation section of all of their servers, which you will find in the upper right part of your server. Many experienced SurveyCTO programmers have gained their skills by looking at other people's code. Finally, the ODK community also provides resources. However, use this with care as SurveyCTO has made some alterations to how ODK is implemented. Use the ODK community's resources as a final solution if no SurveyCTO source provides you with an answer.

Tip: An excellent way to learn is by trying out new constraints, settings, and checks in the Form Builder first and then downloading the excel file for that form and studying the code.

How to switch to the form builder?

After logging in to a SurveyCTO server, go to the design tab and in the menu at the top of the Your forms section click the Upload Form button. Upload your form by following the instructions. The name of your form on the server is set in the form settings in the settings tab in your questionnaire file.

After uploading your Excel form, scroll down to find it and access the form builder according to the How to access the form builder instructions.

DIME Analytics SurveyCTO Style Guide

DIME Analytics has created the SurveyCTO Style Guide, with the aim of establishing the use of a standardized coding style for field surveys in development research. In addition, we have developed the DIME XLSForm Template to provide concrete examples of the recommendations provided in this guide. The DIME Analytics SurveyCTO Style Guide broadly covers three stylistic aspects of programming an electronic survey using XLSForms (or Excel method):

  1. Design and development. This deals with making XLSForms easier to read during the stage of survey design.
  2. User interface. This deals with the set up of XLSForm programming that improves user experience when answering the survey.
  3. Exported form dataset. This deals with the set up of XLSForm programming that supports more efficient ways of working with the exported data.

Related Pages

This article is a part of the chapter Questionnaire Programming.

Additional Resources