draftTrainingQuestions
query · in the family Training
What it does
Ask the assistant for candidate questions grounded on one play’s own words — shown to you, saved only when you keep one.
Draft up to count (1..10) candidate questions for ONE course through the assistant, grounded on the play's own words alone — its title, its line, its steps and the operations' guide summaries. Every candidate is parsed one by one through the strict TrainingQuestionDraft schema; the invalid are dropped AND counted (dropped). Nothing is stored — save each kept one through createTrainingQuestion with source drafted. A metered AI read (office.training_draft) on the user plane; requires the training-manage right. courseKey must be a live play key (VALIDATION otherwise); the assistant unavailable (keyless, a provider fault, an unreadable answer) answers INTEGRATION/UNAVAILABLE — write the questions by hand.
Before you call
A signed-in user’s session — the call refuses an API key (AUTHZ/FORBIDDEN).
Capability area: Training — Courses, tests, certificates and the training rules of your team.
Roles that may call it:
- Owner
- System Administrator
- Manager
What happens
A drafting assist that spends kernels; nothing is stored, and a candidate that does not fit is dropped and counted.
Arguments
Returns
TrainingQuestionDrafts TrainingQuestionDrafts! — The draft call's answer: the course, the kept candidates (at most the count asked) and how many the strict schema dropped — loud, never silent.
Example request
query ExampleDraftTrainingQuestions($courseKey: String!, $count: Int!) {
draftTrainingQuestions(courseKey: $courseKey, count: $count) {
courseKey
dropped
}
}Variables:
{
"courseKey": "<course key>",
"count": 1
}Example response
{
"data": {
"draftTrainingQuestions": {
"courseKey": "<course key>",
"dropped": 1
}
},
"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)