
Workbook Structure for ODK: Excel Tips for Form Creation
"Learn how to structure your workbook in Excel for ODK form creation. From adding sections to required questions, this guide covers essential steps for a seamless workflow."
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
1 ODK Basic Workbook Structure Dr. Caroline Krafft St. Catherine University cgkrafft@stkate.edu Version: January 19, 2018
2 Structure of your workbook In Excel, back to working on the file that you will put in XLSXconverter to make your form (survey) Remember 3 required sheets: Survey, Choices, Settings New! Optional sheets: Sections (give them names and call them from survey) Queries (call other data, like csvs), Properties (change views), and Calculates (for example, calculate age from date of birth and visit date) Optional columns: Sheets have required columns, but also a number of options. We re going to work through a number of the different optional sheets and columns within sheets to learn features of ODK
3 a. Adding a section
4 Adding a section Go back to our firstForm form and open in Excel app-designer/app/config/tables/firstForm/forms/firstForm Rename the survey worksheet section1 Duplicate section1 worksheet and rename it section2 Change the name to test2 and the display.title.text to be test 2 work ? Create a new worksheet and rename it survey
5 Revising the survey sheet for a new section Add a new column, clause A2: do section section1 A3: do section section2 Need to add the required type, values_list, name, display.prompt.text columns
6 Revising the settings sheet for a new section Add two setting_names to the list: section1 (display.title.text Section 1) section2 (display.title.text Section 2) Grunt your app designer folder to open the XLSXconverter XLSX convert your firstForm file Do not need to update framework same file name Test the survey! Note that navigating across sections is complex. From the first question in a section, if you hit the back button you can see all the different sections in contents
7 b. Required questions
8 Required questions Typically want to require people to answer certain questions, others may be optional Ideal design: questions are required OR required depending on skip logic Let s revise our firstForm form to require our first question To do this, add a column in the section1 sheet named required In the row for our question test, type TRUE in the required column This is how we tell ODK the question is required
9 Required questions and finalizing Remember that there are three types of saves: Checkpoint saves (saves every response to tables on tablet as its created) Prevents data loss if run out of battery in middle of survey Incomplete saves Finalized saves Both incomplete and finalized data can by synced; checkpoint saves will demand a status of incomplete or finalized before syncing You can only finalize an instance when all required questions are answered
10 Testing required questions and finalizing If you XLSXconvert the revised firstForm questionnaire you can see the required functionality After converting start a new instance. Do NOT answer the first question Try to go to the next question (click next button). Should get an error message that required value was not provided for the question Try to go to the contents (Section 1 button) and Finalize Changes + Exit. Should get same error In the contents you can only Save Changes & Exit Then in the form you can see this instance listed as incomplete.
11 c. Prompt types
12 Prompt types ODK has a number of different prompts available for development Categorize as informational, assign, and questions (collect data) Will go through some (others described but grayed out) Informational: Note: Used to display a message to the user Acknowledge: Used to display a message to the user and have them click a checkbox to acknowledge that they have read the message. Assign: Used for internal assignment of a variable Example: calculate age based on a birth date
13 Question types: audio-visual Audio Image Barcode Video
14 Question types: select from choices select_one: can only pick one response (did you eat breakfast today? Yes or no) select_multiple: can pick multiple responses (what days did you work this week?) select_multiple: Used to ask the user a multiple choice question and allows the user to click multiple checkboxes. select_multiple_grid: Used to ask the user a multiple choice question, displays the choices to the user in a grid, and allows the user to click multiple grid items. select_multiple_inline: Used to ask the user a multiple choice question, displays the choices to the user inline, and allows the user to click multiple items. select_one: Used to ask the user a multiple choice question and allows the user to click one item. select_one_dropdown: Used to ask the user a multiple choice question and allows the user to select one item from a dropdown box. select_one_grid: Used to ask the user a multiple choice question and allows the user to select one item from a grid. select_one_inline: Used to ask the user a multiple choice question, displays the choices to the users inline, and allows the user to click one item. select_one_with_other: Used to ask the user a multiple choice question, displays the choices to the user, and allows the user to click one item. One of the choices provided is an other option which if clicked provides a text box for the user to enter a value.
15 Question types: text string: Used to ask the user a question and allows them to enter a string. text: Used to ask the user a question and allows them to enter text.
16 Question types: Quantities decimal: Used to display a message to the user and have them enter a decimal (example: hourly wage of 9.43). integer: Used to display a message to the user and have them enter an integer (whole number) (example: 5 children)
17 Question types: Time and place geopoint: used to capture a GPS location date: Uses a date picker widget (calendar) to capture a date datetime: Uses a date picker widget (calendar) to capture a date and time time: Uses a timepicker widget (clock) to capture a time
18 Question types: Advanced user_branch: Used to allow the user to pick which section of the form they would like to enter. linked_table: Used to display the instances of table and allows the user to add another instance, edit an existing instance, or delete an instance.
19 Adding some prompts: Interviewer Go back to your firstForm Excel. Let s add some questions Section 1 will be about the household Section 2 will be about individuals in the household (later) Will leave our test question for now Let s record the name and number of the interviewer in section 1 first Delete test question Create a new question to ask the interviewer name type: text, name: q1a, display.prompt.text: Interviewer name Leave values_list blank Create a new question to ask the interviewer number type: integer, name: q1b, display.prompt.text: Interviewer number
20 Adding some prompts: Visit Add a note to help distinguish sections type: note, values_list and name are blank, display.prompt.text : First visit Add a first visit date Type: date, values_list is blank, name: q2, display.prompt.text: Date of first visit Will show this year in the top of date Add the GPS location Type: geopoint, values_list is blank, name: q3, display.prompt.text : GPS location Will require you to type data in Preview, so make sure to check again on tablet
21 Convert and test Or debug
22 d. Grouping
2323 Grouping questions We have been working with one question per screen Have to click next a lot Often want to be looking at related questions together Can put questions on the same screen In a survey sheet or section sheet add a column: clause Add a clause column to section1 of firstForm in column F Let s put together the interviewer name and number Insert a row before q1a and after q1b Enter begin screen in the row you inserted before q1a in the clause column Enter end screen in the row you inserted after q1b in the clause c
24 Convert and test Or debug
25 e. Skip Patterns
26 Programming Skip Patterns Often only certain people should answer certain questions Only wage workers should provide wages Only married individuals answer questions about their spouse To program these skip patterns in ODK, we add if and end if clauses to the survey/sections Let s add a consent question to section1 If someone does consent, they continue, if not, the interview is over
27 Adding clauses & conditions for skips If and end if can be added to the clause column The condition to be evaluated (if what?) goes in the new condition column Add condition as column H on firstForm section1 Add a new select_one question, name: consent values_list: yesno display.prompt.text: Do you consent? to the end of section1 Add a subsequent text question, name: confirm_consent display.prompt.text: Write name to confirm consent to verify consent This should only be asked if the household did consent! Add three blank rows before confirm_consent New row 1: enter the clause: if In the condition column for the if: selected (data('consent'), '2') This says if consent=2 for no, do the following: New row 2: type column in the row after the if statement: finalize This says end the instance/interview New row 3: enter the clause: end if This is where everyone to whom the if did not apply will go to next, i.e. answer the confirm_consent
28 Convert and test At the consent question If you answer no it should end the instance If you answer yes it should keep going to confirm interviewer name
29 Required & Skips Earlier we added a required column and set it to be TRUE for our test question When there are skip patterns, if you set something to required the instance will not be able to finalize when that question is skipped Use same logic/syntax as condition in required to note who is required to answer the question Test with firstForm In the required column, row confirm_consent: selected (data('consent'), '1') Interviewer must write name if consent is yes
30 Convert and test Go to the consent question If you answer no it should end the instance If you answer yes it should keep going to confirm interviewer name. You can no longer skip this question (could previously) ***Must be very careful to make sure considered complete universe of required v. not Example: if the consent question is not required, then someone could skip that AND the interviewer name for consent
31 More on skip patterns in conditions Conditions use JavaScript syntax https://www.w3schools.com/js/default.asp is a handy repository of javascript formulas and tutorials Three basic operators are: And: && Or: || Not: not( As in not(selected(data(
32 f. Instance Names
33 Naming your instance with a variable So far our instances have been named things like 2018- 01-02T19:46:53.975Z (date and time) This is not a helpful instance name We can assign an instance name based on a variable Such as household id To do this for firstForm In the settings worksheet, add a setting_name: instance_name Give it the value hhid Now in section1 add a type: integer, name: hhid, display.prompt.text: Household ID
34 Convert and Test Go to the household id question Enter 12345 Save & Exit Now in your list of previously created instances you should have 12345