trainingAttempt
query · in the family Training attempt
What it does
Look up one sitting — the person, the course, the drawn questions, the answers and the score once submitted.
One TrainingAttempt by id. The record must belong to your organization group; an id from another group reads as not found.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Your own session — What every signed-in person may do for themselves — their session, their profile and their own work.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- Cashier
- An API key whose scope allows
api:trainingAttempt
What happens
Read-only; your own sitting, or anyone’s with the training-manage right.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
id | ID ID! | yes | The id of the record. |
Returns
TrainingAttempt — A TrainingAttempt: 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. 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.
Example request
query ExampleTrainingAttempt($id: ID!) {
trainingAttempt(id: $id) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
userId
orgId
courseKey
questionIds
answers
score
passed
passMark
startedAt
submittedAt
curriculumVersion
certificateId
}
}Variables:
{
"id": "01900000-0000-7000-8000-1ffd0a840000"
}Example response
{
"data": {
"trainingAttempt": {
"id": "01900000-0000-7000-8000-1ffd0a840000",
"sysId": "TT-EXMP-0000-000F",
"type": "TrainingAttempt",
"caption": "Blue jeans",
"status": "open",
"parentId": "01900000-0000-7000-8000-eacdfcfd0000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-53c6eea90000",
"userId": "01900000-0000-7000-8000-e0a63e120000",
"orgId": "01900000-0000-7000-8000-1971e30a0000",
"courseKey": "<course key>",
"questionIds": [
"01900000-0000-7000-8000-00a700650000"
],
"answers": [
1
],
"score": 1,
"passed": true,
"passMark": 1,
"startedAt": "2027-01-31T00:00:00.000Z",
"submittedAt": "2027-01-31T00:00:00.000Z",
"curriculumVersion": "<curriculum version>",
"certificateId": "01900000-0000-7000-8000-4bce2b100000"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)