# Questionnaire (H5P.Questionnaire)

A survey: open questions and multiple-choice questions with no right answer, then a thank-you screen. Not scored.

- Each item of `questionnaireElements` holds its question under `library`, which is itself sub-content: `{ "library": { "library": "H5P.SimpleMultiChoice", "params": { … } }, "requiredField": true }`.
- H5P.SimpleMultiChoice: `question` (plain text), `inputType` `"radio"` (one answer) or `"checkbox"` (several), `alternatives` of `{ "text": "…" }`.
- H5P.OpenEndedQuestion: `question`, `placeholderText`, `inputRows` `"1"`, `"2"`, `"3"` or `"10"`.
- The answers go out as xAPI statements; nothing stores them unless the site does.

## Example

```json
{
  "type": "H5P.Questionnaire",
  "params": {
    "questionnaireElements": [
      {
        "library": {
          "library": "H5P.SimpleMultiChoice",
          "params": { "question": "How often do you walk by a river?", "inputType": "radio", "alternatives": [{ "text": "Every week" }, { "text": "Sometimes" }, { "text": "Never" }] }
        },
        "requiredField": true
      },
      { "library": { "library": "H5P.OpenEndedQuestion", "params": { "question": "Which river do you know best, and why?", "inputRows": "3" } } }
    ]
  }
}
```

<!-- Generated by `h5p-author schema --markdown` from the pinned pack. Do not edit by hand. -->

## Fields of H5P.Questionnaire 1.3

The example is `type` and `params` alone, and `params` holds the fields below. A source also names its own `title`, `language`, `license` and `authors`, all four required: the build refuses a source that leaves out any of them. The author's name and the licence are the user's: ask for what they have not given. For a name they skip, write the one you know them by, or "Unknown"; for a licence they skip, `U`.

- `questionnaireElements` list 1+ of, required — Questionnaire elements
  - `library` sub-content: H5P.OpenEndedQuestion | H5P.SimpleMultiChoice, required — Library: Choose a library
  - `requiredField` boolean = false — Required field
- `successScreenOptions` group — Success screen options
  - `enableSuccessScreen` boolean = true — Enable success screen
  - `successScreenImage` sub-content: H5P.Image — Add success screen image
  - `successMessage` text = "You have completed the questionnaire." — Text to display on submit
- `uiElements` group — UI Elements
  - `buttonLabels` group — Button labels
    - `prevLabel` text = "Back" — Previous button label
    - `continueLabel` text = "Continue" — Continue button label
    - `nextLabel` text = "Next" — Next button label
    - `submitLabel` text = "Submit" — Submit button label
  - `accessibility` group — Accessibility
    - `requiredTextExitLabel` text = "Close error message" — Required message exit button label
    - `progressBarText` text = "Question %current of %max" — Progress bar text: Used to tell assistive technologies what question it is. Variables: [ %current, %max ]
  - `requiredMessage` text = "This question requires an answer" — Required message: Will display if this field is unanswered and required by a wrapper content type
  - `requiredText` text = "required" — Required symbol text: Text that will accompany an asterisk to signal that a question is required
  - `submitScreenTitle` text = "You successfully answered all of the questions" — Title for the submit screen
  - `submitScreenSubtitle` text = "Click below to submit your answers" — Subtitle for the submit screen

It has no interface texts of its own.

<!-- End of the generated section. -->
