# Moodey YAML Reference # General Structure The structure of the YAML text describing the Mood Survey (Also called the **Mood Survey Descriptor**) is like so: ```yaml= - name: [name of the first question] type: [question type of first question] title: [title of first question] [other fields depending on question type] ... - name: [name of the second question] type: [question type of second question] title: [title of second question] [other fields depending on question type] ... ... ``` The structure of the YAML text describing the Questionnaire Sequence (Also called the **Questionnaire Sequence Descriptor**) is like so: ```yaml= - name: [name of first questionnnaire] explanation: title: [title of the explanation screen of the first questonnaire] body: [body of the explanation screen of the first questonnaire] questions: - name: [name of the first question] type: [question type of first question] title: [title of first question] [other fields depending on question type] ... - name: [name of the second question] type: [question type of second question] title: [title of second question] [other fields depending on question type] ... ... - name: [name of second questionnnaire] explanation: title: [title of the explanation screen of the second questionnnaire] body: [body of the explanation screen of the second questionnnaire] questions: [list of question descriptors for the second questionnnaire] ... ``` # Terminology ## Question Descriptor A Question Descriptor is a collection of fields (also called a Dictionary) describing an interface which prompts the user for some input. The Mood Survey Descriptor is nothing but a list of Question Descriptors. ## Field A field is a key-value pair. When we refer to a "field `xyz`" we refer to the field whose key is`xyz`. ## Questionnaire Descriptor Dictionary containing a list of Question Descriptors (in the field `questions`) as well as a `name` field and an optional `explanation` field . ## Mood Survey Descriptor A list of Question Descriptors. ## Questionnaire Sequence Descriptor A list of Questionnaire Descriptors. # Keywords ## Questionnaire Descriptor *These fields are **required** on all Questionnaire Descriptors, unless specified otherwise.* - `name` Name of the questionnaire. This is not displayed to the user but stored with the answers. Data will be marked with this name when exporting data via Moodey Manager. - `explanation` Describes a screen appearing before the first question. This screen can be used to give the user instructions or motivate them to complete the questionnaire or something like that - Is not required. If left out, the first question will be displayed immediately after starting the questionnaire. - `title` Field contained in the `explanation` field. Describes the title text of the explanation screen - `body` Field contained in the `explanation` field. Describes the body text of the explanation screen - `questions` List of Question Descriptors making up the questionnaire ## Question Descriptor ### All questions *These fields are **required** on descriptors of all question types, unless specified otherwise.* - `type` Must be one of the keywords listed under "Question types". E.g. `radio-buttons`. - `super-title` Less prominent text displayed above the title. - Not required - `title` Text to be displayed above the user input interface. - `name` Name of the question. This is not displayed to the user but stored with the answers. Data will be marked with this name when exporting data via Moodey Manager. - `visualization-tag` Tag specifying how answers to this question should be displayed when visualizing data - both in the Mobile App and in Moodey Manager - Not required - Currently only works on slider questions - Possible values: - `mood` Answers to this question will by displayed on a graph line named "Mood" or something similar when visualizing data - `stress` Answers to this question will by displayed on a graph line named "Stress" or something similar when visualizing data ### Question types ### `slider` *These fields are **required** on Question Descriptors where the field `type` is set to `slider`, unless specified otherwise.* - `slider-increments` How many different values there are on the slider - `slider-label-left` Text to the left of the slider - `slider-label-right` Text to the right of the slider - `slider-picture-left` Image displayed to the left of the slider - Possible values found under "Image values" - `slider-picture-right` Image displayed to the right of the slider - Possible values found under "Image values" ### `special-situations` *These fields are **required** on Question Descriptors where the field `type` is set to `special-situations`, unless specified otherwise.* - `situations` List of Strings describing situations which the user can choose from. Must be relatively short to fit the popup button. - `situation-selection-prompt` String prompting the user to choose one of the situations. Must be relatively short to fit the popup button. ### `companion-selection` *No additional fields are required on Question Descriptors where the field `type` is set to `companion-selection` (The fields listed under "All questions" are still required though)* ### `radio-buttons` *These fields are **required** on Question Descriptors where the field `type` is set to `radio-buttons`, unless specified otherwise.* - `possible-answers` List of answers which the user can choose from. ### `text` *These fields are **required** on Question Descriptors where the field `type` is set to `text`, unless specified otherwise.* - `hint` Placeholder text in the text box, prompting entry of data. ### `number` *These fields are **required** on Question Descriptors where the field `type` is set to `number`, unless specified otherwise.* - `hint` Placeholder text in the text box, prompting entry of data. ### `consent-form` *These fields are **required** on Question Descriptors where the field `type` is set to `consent-form`, unless specified otherwise.* - `body` Text describing the terms and conditions which we want the user to agree to. - `checkbox-text` Text next to the checkbox which the user checks to accept the terms and conditions. # Image values ## Emojis - `emoji_1` through `emoji_103`. Mostly yellow faces and some others.