AlmondTill/G3N API

submitTrainingPractice

mutation · in the family 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.

The last result replaces the previous one in your own progress record; nothing is certified. Requires the unrestricted capability on a user session.

Before you call

A signed-in user’s session — the call refuses an API key (AUTHZ/FORBIDDEN).

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:

What happens

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

Arguments

NameTypeRequiredNotes
courseKeyString String!yes
answersInt [Int!]!yes

Returns

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