Difference between revisions of "SurveyCTO Coding Practices"

Jump to: navigation, search
Line 1: Line 1:
This article discuss solutions to specific but common issues in the programming language used in SurveyCTO. If you want a general introduction to how to structure your approach to programming a CAPI questionnaire or how to use best practices setting that reduce the risk of errors, then see the topic of [[Questionnaire Programming]].
+
This article discuss solutions to specific but common issues in the programming language used in SurveyCTO. If you want a general introduction to how to structure your approach to programming a CAPI questionnaire or how to use best practices settings that reduce the risk of errors, then see the topic of [[Questionnaire Programming]].
  
 
== Read First ==
 
== Read First ==
* All coding examples linked to in this section is stored in Google Drive. You can either copy that code to an Excel file, but Survey CTO allows you to pull this code using the URL of the Google Sheet directly from your own server.
+
* All coding examples linked to in this section are stored in Google Drive. You can copy that code to an Excel file, but Survey CTO also allows you to pull this code using the URL of the Google Sheet directly from your own server.
  
 
==Groups==
 
==Groups==
 
Use a lot of groups but do not over use them. This means that you should always ask yourself if anything you do can be done more simplistically with a group. Although, only include a group if they fulfill one of the purposes below:
 
Use a lot of groups but do not over use them. This means that you should always ask yourself if anything you do can be done more simplistically with a group. Although, only include a group if they fulfill one of the purposes below:
  
*Apply a [[Relevance Condition to Multiple Fields|relevance condition to multiple fields]]
+
*Apply a [[Relevance Condition to Multiple Fields|relevance condition to multiple fields]].
*If you have [[Multiple Questions Displayed at the Same Time |multiple questions displayed at the same time]]
+
*If you have [[Multiple Questions Displayed at the Same Time |multiple questions displayed at the same time]].
 
*Frame all the questions on a module in group. Only do this at the highest level of the survey, i.e. do not use this for sub-levels of a module.
 
*Frame all the questions on a module in group. Only do this at the highest level of the survey, i.e. do not use this for sub-levels of a module.
  
Line 17: Line 17:
 
==Choice Lists==
 
==Choice Lists==
  
Choice lists are the answer options an enumerator can choice from in a select one or select multiple question. They are listed in the choices in the SurveyCTO questionnaire. While the programming language ODK that SurveyCTO builds on, has very few restrictions on how you can code your options, there are [[SurveyCTO Choice Lists|choice list best practices]] that matters for data quality when using the data from these question in for example Excel.
+
Choice lists are the answer options an enumerator can choose from in a ''select one'' or ''select multiple question''. They are listed in the choices in the SurveyCTO questionnaire. While the programming language ODK that SurveyCTO builds on has very few restrictions on how you can code your options, there are [[SurveyCTO Choice Lists|choice list best practices]] that matters for data quality when using the data from these question in for example Excel.
  
 
The choice lists can also be [[SurveyCTO Dynamically Populated Choice Lists|dynamically populated]] by answers already given by the respondents.
 
The choice lists can also be [[SurveyCTO Dynamically Populated Choice Lists|dynamically populated]] by answers already given by the respondents.

Revision as of 15:01, 13 February 2017

This article discuss solutions to specific but common issues in the programming language used in SurveyCTO. If you want a general introduction to how to structure your approach to programming a CAPI questionnaire or how to use best practices settings that reduce the risk of errors, then see the topic of Questionnaire Programming.

Read First

  • All coding examples linked to in this section are stored in Google Drive. You can copy that code to an Excel file, but Survey CTO also allows you to pull this code using the URL of the Google Sheet directly from your own server.

Groups

Use a lot of groups but do not over use them. This means that you should always ask yourself if anything you do can be done more simplistically with a group. Although, only include a group if they fulfill one of the purposes below:

Repeat Groups

Repeat groups are a group that is repeated 1 or multiple times. This means that most properties that apply to a regular group, also applies to a repeat group.

Choice Lists

Choice lists are the answer options an enumerator can choose from in a select one or select multiple question. They are listed in the choices in the SurveyCTO questionnaire. While the programming language ODK that SurveyCTO builds on has very few restrictions on how you can code your options, there are choice list best practices that matters for data quality when using the data from these question in for example Excel.

The choice lists can also be dynamically populated by answers already given by the respondents.

Choice Filters

Preloading

Additional Resources

  • list here other articles related to this topic, with a brief description and link