# TrainingAttempt

object type

A TrainingAttempt (🎓 — THE TRAINING PROGRAM, THE WIRE): ONE sitting of a course's test by ONE person — ALWAYS the caller who started it (nobody starts one for someone else). At start the platform draws 10 ACTIVE questions of the course (every active question when fewer; below 3 the start refuses CONFLICT/TRAINING_TOO_FEW_QUESTIONS) and stores EXACTLY that draw (questionIds); passMark is copied from the strictest requirement binding the person for the course, else the default; curriculumVersion is the play's content hash at the sitting. At submit the answers are GRADED SERVER-SIDE against the STORED draw (a later bank edit never re-grades it) — score 0..100, passed = score >= passMark; a PASS mints the TrainingCertificate in the SAME transaction (certificateId). open (live) → submitted (terminal, kept) by the subject · open → doomed (terminal) by manage authority. ONE open sitting per (person, course) — a second start refuses CONFLICT/TRAINING_ATTEMPT_OPEN; at most 5 sittings per (person, course) per UTC day (CONFLICT/TRAINING_CAP). The by-id read answers the subject or the training-manage right; the listing is the manage right's. NOT searchable.

## Fields

| Field | Type | Notes |
| --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
| `sysId` | [String](/types/#scalars) `String!` | The group-scoped human-facing system id (TT-…). |
| `type` | [String](/types/#scalars) `String!` | The kind of record — always `TrainingAttempt` here. |
| `caption` | [String](/types/#scalars) `String!` | The record’s display name — what people see it called. |
| `status` | [String](/types/#scalars) `String!` | The FSM state: open \| submitted \| doomed. |
| `parentId` | [ID](/types/#scalars) `ID!` | The parent org group; for a TrainingAttempt parentId === rootId. |
| `rootId` | [ID](/types/#scalars) `ID!` | The org-group family root. |
| `createdAt` | [String](/types/#scalars) `String!` | When the record was created, as a UTC timestamp. |
| `updatedAt` | [String](/types/#scalars) `String!` | When the record last changed, as a UTC timestamp. |
| `revisionNum` | [Int](/types/#scalars) `Int!` | How many times this record has been edited; the first save is 0. |
| `revision` | [ID](/types/#scalars) `ID!` | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
| `refCaptions` | [RefCaption](/types/RefCaption/) `[RefCaption!]!` | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
| `userId` | [ID](/types/#scalars) `ID!` | The subject — the User who started the sitting; ALWAYS the caller. IMMUTABLE at birth. |
| `orgId` | [ID](/types/#scalars) `ID!` | The organization the sitting was started in (the session’s acting org) — the progress record’s second coordinate. IMMUTABLE at birth. |
| `courseKey` | [String](/types/#scalars) `String!` | The course — a live play key. IMMUTABLE at birth. |
| `questionIds` | [ID](/types/#scalars) `[ID!]!` | THE DRAW — 3..10 question ids drawn from the ACTIVE bank at start, in the order asked; the grade is taken against exactly these. IMMUTABLE at birth. |
| `answers` | [Int](/types/#scalars) `[Int!]` | One option index per drawn question, in the draw order — set ONCE at submit; null while open or doomed. |
| `score` | [Int](/types/#scalars) | The grade 0..100 (rounded) — set at submit; null while open or doomed. |
| `passed` | [Boolean](/types/#scalars) | score >= passMark — set at submit; null while open or doomed. |
| `passMark` | [Int](/types/#scalars) `Int!` | Copied at start from the strictest requirement binding the person for the course, else the default 80. IMMUTABLE at birth. |
| `startedAt` | [String](/types/#scalars) `String!` | The start instant (UTC ISO-8601). IMMUTABLE at birth. |
| `submittedAt` | [String](/types/#scalars) | The submit instant (UTC ISO-8601); null while open or doomed. |
| `curriculumVersion` | [String](/types/#scalars) `String!` | The play’s content hash at the sitting (16 hex — sha-256 over its title, line and the steps’ words); ’s refresh rule compares it. IMMUTABLE at birth. |
| `certificateId` | [ID](/types/#scalars) | The certificate a PASSING submit minted in the same transaction; null on a fail, while open, or when doomed. |

## Used by

- [doomTrainingAttempt](/reference/training/doomTrainingAttempt/)
- [startTrainingAttempt](/reference/your-own-session/startTrainingAttempt/)
- [submitTrainingAttempt](/reference/your-own-session/submitTrainingAttempt/)
- [trainingAttempt](/reference/training-attempt/trainingAttempt/)
