# submitTrainingPractice

mutation · in the family [Your own session](/reference/your-own-session/)

## What it does

Hand in your practice — graded on the server against the current questions, the right answers and explanations shown; no certificate, no record anyone else sees.

Hand in YOUR OWN open practice — one option index (0-based) per drawn question, in the draw order (a wrong count, or an index past its question's options, refuses VALIDATION; no open practice refuses CONFLICT/TRAINING_PRACTICE_NOT_OPEN): graded SERVER-SIDE against the CURRENT questions (one retired for good since the start counts as missed) — score 0..100, passed = score at or above your pass mark; the right answers, the explanations and your picks come back. The last result replaces the previous one in your own progress record; nothing is certified. Requires the unrestricted capability on a USER session.

## What happens

Writes only your own progress record; the last result replaces the previous one.

## Who may call it

Capability area: **Your own session** — What every signed-in person may do for themselves — their session, their profile and their own work.

- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- Cashier
- An API key whose scope allows `api:submitTrainingPractice`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `courseKey` | [String](/types/#scalars) `String!` | yes | No further notes. |
| `answers` | [Int](/types/#scalars) `[Int!]!` | yes | No further notes. |

## Returns

[TrainingPracticeResult](/types/TrainingPracticeResult/) `TrainingPracticeResult!` — A handed-in practice: the score over the WHOLE draw, the pass mark, passed (the answer's alone — never a standing; no certificate, no notice), the readable questions with their keys and your picks, practices started today, when. The last result replaces the previous one in your own progress record.

## Example request

```graphql
mutation ExampleSubmitTrainingPractice($courseKey: String!, $answers: [Int!]!) {
  submitTrainingPractice(courseKey: $courseKey, answers: $answers) {
    courseKey
    score
    passMark
    passed
    practiceToday
    submittedAt
  }
}
```

Variables:

```json
{
  "courseKey": "<course key>",
  "answers": [
    1
  ]
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

## Example response

```json
{
  "data": {
    "submitTrainingPractice": {
      "courseKey": "<course key>",
      "score": 1,
      "passMark": 1,
      "passed": true,
      "practiceToday": 1,
      "submittedAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `CONFLICT/*` — The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. ([CONFLICT](/errors/CONFLICT/))
- `VALIDATION/VERSION_REQUIRED` — The request did not say which app version it came from. ([VALIDATION](/errors/VALIDATION/))
