> ## Documentation Index
> Fetch the complete documentation index at: https://developer.vclasses.net/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Grade a PDF Quiz Submission — POST /api/v3/quiz/grade

> Award a grade to a PDF quiz submission. Records the earned grade and total possible grade, marking the submission as graded. Requires admin Bearer token.

This endpoint records a student's earned grade and the total possible grade for a specific PDF quiz submission. Once saved, the submission's `is_marked` flag is set to `1` and the awarded grade becomes visible to the student.

## Endpoint

```text theme={null}
POST /api/v3/quiz/pdf-quizzes/grade/{grade_id}
```

## Required Role

**Admin** — you must authenticate with an admin-scoped Bearer token.

## Required Headers

| Header          | Value                  |
| --------------- | ---------------------- |
| `Authorization` | `Bearer <admin-token>` |
| `Accept`        | `application/json`     |
| `Content-Type`  | `application/json`     |

<Note>
  `grade_id` is the submission ID — it corresponds to the `id` field within the `submissions` array returned by the [List Quizzes](/api-reference/quizzes/list) and [Get Quiz](/api-reference/quizzes/get) endpoints. It is **not** the quiz's own `id`.
</Note>

## Path Parameters

<ParamField path="grade_id" type="integer" required>
  The unique ID of the student submission you want to grade. Retrieve this value from the `id` field inside the `submissions` array of any quiz response.
</ParamField>

## Request Body

<ParamField body="grade" type="numeric" required>
  The grade you are awarding to the student for this submission. Must not exceed `total_grade`.
</ParamField>

<ParamField body="total_grade" type="numeric" required>
  The maximum possible grade for this submission. This value is recorded alongside the awarded grade so students can see their score in context.
</ParamField>

## Example Request

```bash theme={null}
curl -X POST https://app.example.com/api/v3/quiz/pdf-quizzes/grade/15 \
  -H "Authorization: Bearer your-admin-token" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"grade": 85, "total_grade": 100}'
```

## Response

### 200 OK

```json theme={null}
{
  "status": true,
  "message": "Grade Saved Successfully"
}
```

### 422 Validation Error

```json theme={null}
{
  "message": "Invalid Data",
  "errors": {
    "grade": ["The grade field is required."]
  }
}
```

## Error Responses

| Status | Message             | Cause                                                                |
| ------ | ------------------- | -------------------------------------------------------------------- |
| `403`  | Unauthorized Access | The token provided does not belong to an admin account.              |
| `404`  | Not Found           | No submission exists with the specified `grade_id`.                  |
| `422`  | Invalid Data        | The `grade` or `total_grade` field is missing from the request body. |
