> For the complete documentation index, see [llms.txt](https://docs.instruqt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.instruqt.com/tracks/challenges/add-a-quiz-to-a-track.md).

# Add quizzes

## Before you begin

A quiz is a multiple-choice question learners must answer during a track before proceeding to the next challenge. Each quiz needs at least two possible answers. You can assign one or more answers as correct. Each challenge supports only one quiz. To add additional quizzes, create a separate challenge for each one.

**Note:** The `solution` field uses **zero-based indexing**, meaning `0` refers to the first choice.

## Add a quiz challenge

You can add a quizzes using the Web UI or the Instruqt CLI.

{% tabs %}
{% tab title="🌐 Web UI" %}

1. Click the track you want to add a quiz to.
2. In the **Challenges** section, click **Add new** and select **Multiple choice** from the dropdown.
3. Provide a **Name**, **URL**, and **Description** for the challenge.
4. Click **Save**.
5. In the **Quiz** tab, input a question in the Editor.
6. Click **Add answer** as many times as needed to generate possible choices
7. Click the **This is a correct answer** checkbox beside all correct choices
8. Click **Save changes**.
   {% endtab %}

{% tab title="💻 Instruqt CLI" %}

1. Change into the track directory you want to add a quiz to:

   ```xml
   cd <track-directory>
   ```
2. Add a challenge to the track:

   ```
   instruqt challenge create --title "Example quiz title"
   ```
3. Open the `assignment.md` file of the newly created challenge and replace its content with the following (modify as needed):

   ```yaml
   ---
   slug: example-quiz-title
   type: quiz
   title: Example quiz title
   teaser: Example quiz
   answers:
   - 42
   - Sun
   - Instruqt
   solution:
   - 0
   difficulty: basic
   timelimit: 600
   ---
   What is the answer to the universe?
   ```
4. Save the `assignment.md` file and push the changes to Instruqt:
5. ```
   instruqt track push
   ```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.instruqt.com/tracks/challenges/add-a-quiz-to-a-track.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
