# Add and edit questions

## Overview

[Video: Add and edit questions](https://www.youtube.com/watch?v=-rIvaVO_yhg)

This flow describes how to add questions to a [questionnaire](https://docs.ohc.network/concepts/definitions/questionnaire.md) and change them in the question editor. When you save changed questions, Care makes a new version of the questionnaire and keeps the earlier questions as a past version.

## Pre-requisites

* The questionnaire is saved in your facility. See [Create a questionnaire](https://docs.ohc.network/flows/definitions/questionnaire/create-questionnaire.md).
* You are a member of a department of the facility, so the facility sidebar shows **Settings**.
* You change the current version of the questionnaire. A past version cannot be changed.
* If the questionnaire has actions, you are allowed to use each of its actions.
* You have the permissions listed below.

## Permissions

| Permission | Access |
| - | - |
| Can Create/Update Questionnaires | Shows **Edit Questions** and lets you change and save the questions. You must hold it in the facility's root organization (**Administration**). Without it, the editor opens in preview only. By default, the Facility Admin role holds it. |
| Can Read Questionnaires | Lets you find the questionnaire in the list and open it. You must hold it in the root organization, in a department that the questionnaire is shared with, or in a department above one. By default, the Facility Admin, Administrator, Doctor, Nurse, Staff, Pharmacist and Volunteer roles hold it. |
| Can Read ValueSets | Lets you pick a facility valueset in **Select a value set**. You must hold it in a department that the valueset is shared with, or in a department above one. Holding it in the root organization is not enough unless the valueset is shared with the root organization. Valuesets that are shared across the whole Care instance appear without it. By default, the Facility Admin, Administrator, Doctor, Nurse, Staff, Pharmacist and Volunteer roles hold it. |

## Steps

### 1. Open the questionnaire

In the facility sidebar, select **Settings**. In the settings sidebar, under **Forms**, select **Questionnaires**.

The list shows **Active** questionnaires. If the questionnaire has another status, select the **Draft** or **Retired** tab. Select the questionnaire in the list.

![Step 1, Open the questionnaire: the screen at this step, with the control for the step outlined](/assets/images/add-and-edit-questions-1-d45c52ec9952d22f45b103cb2bb07b21.webp)

### 2. Open the question editor

Select **Edit Questions**.

You can also select **Add Question** in the **Questions** list, or **Add First Question** if the questionnaire has no questions. To start at one question, open its row menu and select **Edit**.

![Step 2, Open the question editor: the screen at this step, with the control for the step outlined](/assets/images/add-and-edit-questions-2-0af279652cd7a07e2728240bdae104f8.webp)

### 3. Add a question or a section

Select **Add new question**. Care adds a **String** question with no title. To add a group of questions, select **Add Section**.

To change a question that is already there, select it in the form. Care marks it **Editing**.

Note: If the questionnaire has no questions, you can select **Import Questions** instead. Choose **Import from a JSON file** or **Import from URL**. Check the **Question count**, then select **Import**. Care warns "All existing data will be replaced": the imported questions replace the questions in the editor. Care saves them only when you select **Save Changes**.

![Step 3, Add a question or a section: the screen at this step, with the control for the step outlined](/assets/images/add-and-edit-questions-3-46cf95c75cdf89102f2e7fcbc4b9f749.webp)

### 4. Fill in the Question tab

| Components | What it captures |
| - | - |
| **Question Title** | The question that people read on the form. Every question needs a title. |
| **Helper text** | Extra text that Care shows under the question. |
| **Answer type** | The kind of answer, for example **Date**, **Choice** or **Quantity**. |
| **Templates** | For **String** and **Text** questions: named pieces of text that people can insert into the answer. Select **Add template**, then enter a **Template Name** and the text to insert. |
| **Unit** | For **Integer**, **Decimal** and **Choice** questions: a unit that Care shows next to the question label. |
| **Required** | The form cannot be submitted without an answer to this question. |
| **Repeatable** | People can record more than one answer. Care does not show it for **Boolean**, **Display** and **Structured** questions. |
| **Read only** | Care shows the question, but people cannot answer it. |

Note: The **Structured** answer types that Care offers depend on the subject type of the questionnaire.

Note: Each template needs a name and the text to insert. If either is missing, Care lists "Every template needs a name and content. Fill them in or remove the template." as an issue, and you cannot save. To remove a template, select the delete icon next to it. If you change the answer type to a type other than **String** or **Text**, Care removes the templates of the question.

Note: People who fill in the form insert a template with **Insert template** at the bottom of the answer box, or by typing "/" in an empty answer. See [Questionnaire](https://docs.ohc.network/concepts/definitions/questionnaire.md).

![Step 4, Fill in the Question tab: the screen at this step, with the control for the step outlined](/assets/images/add-and-edit-questions-4-5b80b3d1de18409b96bd5b889515d703.webp)

### 5. Set the answers

If the answer type is **Choice**, go to **Answer options**. Select **Custom Options** or **Value Set**.

For **Custom Options**, select **Add Option**. Type the answer in **Option Value**. Do this for each answer. To make an option the default answer, select **Set as default**. Use **Move Up**, **Move Down** and **Delete** on a row to order or remove options.

For **Value Set**, select a [valueset](https://docs.ohc.network/concepts/definitions/valueset.md) in **Select a value set**.

If the answer type is **Quantity**, go to **Unit Options**. In **Select a value set**, select the valueset of units that people can answer with. You can also set a **Default Unit**.

For a section or a **Simple Group** question, select **Add Sub-Question** under **Sub-Questions**. A group needs at least one sub-question.

![Step 5, Set the answers: the screen at this step, with the control for the step outlined](/assets/images/add-and-edit-questions-5-3e6bc62ce7fc162a6523309bd79fe760.webp)

### 6. Choose when the question appears

If the question must show only after certain answers, open the **Logic** tab. With no conditions, Care always shows the question.

Select **Add a condition**. Set the question that it depends on, the operator and the answer. If you add more than one condition, select **All conditions are true (AND)** or **Any condition is true (OR)**. Read the rule under **In plain words**.

Note: A condition cannot depend on a group or display question. Conditions also cannot form a loop.

![Step 6, Choose when the question appears: the screen at this step, with the control for the step outlined](/assets/images/add-and-edit-questions-6-7a9e5171ab7e8921e765a44475954e81.webp)

### 7. Link the question to a standard code

If answers must be comparable across facilities, open the **Coding** tab. Link the question to a standard code. To record more fields with the answer, use **Also capture**.

Note: **Also capture** does not change the [observation](https://docs.ohc.network/concepts/clinical/observation.md) that Care records from an answer. The observation has no body site or method, and its time is always the time when the form is submitted. Care keeps a body site, method or time recorded with the answer only in the response.

![Step 7, Link the question to a standard code: the screen at this step, with the control for the step outlined](/assets/images/add-and-edit-questions-7-8e2b9214eb9660097efe0cb6de2f99a1.webp)

### 8. Move, copy or delete a question

Select the question in the form. Use the buttons on the selected question:

* **Move question up** and **Move question down** change its place.
* **Duplicate question** adds a copy, with "(Copy)" after the title.
* **Delete question** removes it.

Note: On the questionnaire page, you can also drag a question or use **Move Up** and **Move Down** in its row menu. Care saves the new order at once, as a new version.

![Step 8, Move, copy or delete a question: the screen at this step, with the control for the step outlined](/assets/images/add-and-edit-questions-8-536d5e669aa376efb985ab28673cce83.webp)

### 9. Save the changes

To check the form before you save, select **Preview**. To go back, select **Edit**.

At the top of the editor, Care shows **Ready to save**, or a button with the number of issues, for example "2 to fix". If you see that button, select it. Select each issue to go to its question, and fix it.

Select **Save Changes**. To remove all changes that you did not save, select **Discard**.

Note: **Form Settings** in the editor holds the questionnaire details, such as the title and the status. Changes there also save with **Save Changes**.

![Step 9, Save the changes: the screen at this step, with the control for the step outlined](/assets/images/add-and-edit-questions-9-7a490310975be1aefdfc7464a1bc5ec9.webp)

## Expected Outcome

* Care shows "Questionnaire updated successfully".
* If you changed the questions, Care saves them as a new version. The earlier questions stay available as a past version.
* If you changed only the questionnaire details, such as the title, the version stays the same.
* Each response records the version of the questionnaire that was filled in.

## Related

Concepts:

* [Questionnaire](https://docs.ohc.network/concepts/definitions/questionnaire.md)
* [Valueset](https://docs.ohc.network/concepts/definitions/valueset.md)

Flows:

* [Create a questionnaire](https://docs.ohc.network/flows/definitions/questionnaire/create-questionnaire.md)
* [View earlier versions of a questionnaire](https://docs.ohc.network/flows/definitions/questionnaire/view-questionnaire-versions.md)
* [Update or retire a questionnaire](https://docs.ohc.network/flows/definitions/questionnaire/update-or-retire-questionnaire.md)
* [Clone a questionnaire](https://docs.ohc.network/flows/definitions/questionnaire/clone-questionnaire.md)
