# Quiz Components

## \<ArlinearQuiz> Component

#### Input Parameters

| Parameter                  | Type     | Description                                                                                       |
| -------------------------- | -------- | ------------------------------------------------------------------------------------------------- |
| `quizKey`                  | String   | The unique identifier for the quiz.                                                               |
| `primaryKey`               | String   | The primary key associated with the student. If empty, grades are not saved.                      |
| `questionsPerPageOverride` | Number   | Control how many questions to show per page.                                                      |
| `onSubmit`                 | Function | A function to run when the user submits the quiz.                                                 |
| `submission`               | Object   | (Optional) If passing in a submission, it will show the corrected quiz with the student's inputs. |

#### Example usage:

```jsx
<ArlinearQuiz 
    quizKey="ba777045-7033-4701-b17b-da9e90dcd41e"
    primaryKey="emily@school.com"  // if empty, this does not save grades
    questionsPerPageOverride={1} // control how many questions to show per page
    onSubmit={submit}
    submission={submission} // Note: if passing in a submission, it show the corrected quiz with student's inputs
/>
```

## \<ArlinearQuizWithResult>

#### Input Parameters

| Parameter                  | Type     | Description                                                                           |
| -------------------------- | -------- | ------------------------------------------------------------------------------------- |
| `quizKey`                  | String   | The unique identifier for the quiz.                                                   |
| `primaryKey`               | String   | The primary key associated with the student. If empty, grades are not saved.          |
| `questionsPerPageOverride` | Number   | Control how many questions to show per page.                                          |
| `onSubmit`                 | Function | A function to run when the user submits the quiz.                                     |
| `onTryAgain`               | Function | A function to run when the user clicks the "Try again" button at the end of the quiz. |

#### Example usage:

```jsx
/* Render Quiz & Displays results on quiz submit */
<ArlinearQuizWithResult
    quizKey="ba777045-7033-4701-b17b-da9e90dcd41e"
    primaryKey="emily@school.com"  // if empty, this does not save grades
    questionsPerPageOverride={1} // control how many questions to show per page
    onSubmit={submit} // function to run onSubmit
    onTryAgain={tryAgain} // function to run onTryAgain (at the end there is a "Try again button")
/>
```


---

# Agent Instructions: 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:

```
GET https://arlinear.gitbook.io/documentation/react/quiz-components.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
