Survey formatting requirements
  • 27 Oct 2021
  • PDF

Survey formatting requirements

  • PDF

Surveys to be used in the Kernel system must follow specific formatting rules. The files can be saved in either the JSON or YAML format and must contain the following information. Sample code is illustrated below

  • Name:   This is the name of the survey as it appears in the Data Streams list in a Kernel Cloud Study page, and in the Kernel App for a participant. 
  • Steps: 
    • ID (step): This element identifies the step (page of questions) with a unique alphanumeric identifier.
    • Questions: This groups the specific questions within a step. 
      • ID (question): This element identifies the question with a unique alphanumeric identifier. 
      • Label: This is a header field displayed in the survey in bold. Typically used for a question number.
      • Body: This is the text that describes the question. This field supports Markdown.  
      • Type: This identifies the type of question, it must be one of the following types (each with required sub-elements, described below):
        • INSTRUCTION: Generates onscreen text with no interaction required from participant.
        • INPUT: Presents a text entry field. 
        • NUMBER: Presents a text entry field restricted to numerical inputs.
        • RANGE: Presents a slider with preset values and increments.
        • MULTIPLE CHOICE: Presents a pop-up menu of preset values.
        • MULTIPLE CHOICE RADIO: Presents a list of preset values with radio buttons.
        • MULTIPLE SELECTION: Presents a pop-up menu of preset values where the participant can select multiple list items. NOTE: This question type is not supported by the Survey Builder. 

For INSTRUCTION questions:

  • Instructions: This element supports Markdown.

For INPUT questions:

  • [No arguments]; entry questions automatically present a text entry field to collect input.

For NUMBER questions:

  • [No arguments]; entry questions automatically present a text entry field to collect input, but input must be numerical. (A numerical keyboard is presented for entry.)

For RANGE questions:

  • Minimum Value: The lowest value option for data analysis purposes.
  • Minimum Label: The onscreen label for the left side of the slider.
  • Maximum Value: The highest value option for data analysis purposes.
  • Maximum Label: The onscreen label for the right side of the slider.
  • Steps: the number of increments between lowest and highest along the slider.

For MULTIPLE CHOICE questions (Must include at least two choices):

  • Label:  For each answer choice, the text that appears in the pop-up menu.
  • Value: For each answer choice, the value to be used for data analysis.
    • If Value is set as "other," a text entry field will appear if that choice is selected.
  • Skip to (step ID) (optional)If your survey includes Steps

For MULTIPLE CHOICE RADIO questions (Must include at least two choices):

  • Label:  For each answer choice, the text that appears as a radio button selection.
  • Value: For each answer choice, the value to be used for data analysis.
    • If Value is set as "other," a text entry field will appear if that choice is selected.
  • Skip to (step ID) (optional)If your survey includes Steps

For MULTIPLE SELECT questions (Must included at least two choices):

  • Label:  For each answer choice, the text that appears as a selectable item in the list.
  • Value: For each answer choice, the value to be used for data analysis.

The sample below includes an example of each question type: 

{
  "name":"Brainfog Questionnaire",
  "steps": [
    {
      "id":"step_1",
      "questions": [
        {
          "id":"00_onboard",
          "label":"Welcome",
          "title":"Please fill out all questions below.",
          "type":"Instruction"
        },
        {
          "id":"01_Routine",
          "label":"1.",
          "title":"Describe your morning routine.",
          "type":"Input"
        },
        {
          "id":"02_Demog",
          "label":"2.",
          "title":"How many caffeinated beverages do you consume on a typical day?",
          "type":"Number"
        },
        {
          "id":"03_agelimit",
          "label":"3.",
          "title":"`Are you over 18 years of age?",
          "type":"MultipleChoice",
          "choices":[
            {
              "label":"Yes",
              "value":"1"
            },
            {
              "label":"No",
              "value":"2"
            }
          ]
        },
        {
          "id":"04_quantity_range",
          "label":"4.",
          "title":"How many caffeinated beverages have you consumed today? ",
          "type":"Range",
          "range": {
            "minimumLabel": "0",
            "maximumLabel": "5 or more",
            "minimumValue": "0",
            "maximumValue": "5",
            "step": 1
          }
        },
        {
          "id":"05_Predisposition",
          "label":"5.",
          "title":"What is your perceived sensitivity?",
          "type":"MultipleChoiceRadio",
          "choices":[
            {
              "label":"I can drink one or more caffeinated beverages less than 4 hours before bedtime and still sleep normally.",
              "value":"1"
            },
            {
              "label":"If I have any caffeine less than 8 hours before bedtime it disturbs my sleep",
              "value":"2"
            },
            {
              "label":"Any caffeine intake whatsoever disturbs my sleep",
              "value":"3"
            }
            {
              "label":"Other",
              "value":"other"
            }
              {
          "id":"06_Favorites",
          "label":"6.",
          "title":"Which of the following do you enjoy? Select as many as apply.",
          "type":"MultipleSelect",
          "choices":[
            {
              "label":"Espresso",
              "value":"1"
            },
            {
              "label":"Drip Coffee",
              "value":"2"
            },
            {
              "label":"Cold Brew",
              "value":"3"
            }
            {
              "label":"Tea",
              "value":"4"
            }
            ]
        }
      ]
    }
  ]
}