DEVELOPER DOCUMENTATION
Results, Grading, and Release
Read attempts and rosters, grade with a per-question packet and recorded provenance, release held results, and export results as CSV, JSON, or JSONL.
/api/public/v1/project-todos/quizzes/manageAuto-graded answers are scored on submission. Manually graded questions hold the attempt’s verdict until you award points. Result visibility follows the form’s release setting: IMMEDIATE shows scores on grading; MANUAL holds them until you release.
GET /quizzes/results?jobId=…&formId=…— attempts across the form’s published versions, with scores, pass verdicts, and release status. Optionally filter byformVersionId.GET /quizzes/attempts/{attemptId}— one attempt with every answer. Employer-authorized reads may include the sanitized expected-answer projection; AI-trainer surfaces never receive answer keys.GET /quizzes/roster?jobId=…&formId=…— per-person assignment status, attempt counts, and remaining attempts.GET /quizzes/export-csv?jobId=…&formId=…— all attempts as spreadsheet-safe CSV with personal emails redacted.GET /quizzes/grading-packet?attemptId=…— everything needed to grade one attempt. See Grading packet.GET /quizzes/export?jobId=…&formId=…&format=json|jsonl— results with a redaction manifest. See Export results as JSON or JSONL.GET /quizzes/authoring/capabilities— the static authoring contract. See Authoring capabilities.
All reads require project_todos:read and employer access to the job.
Grading packet
Section titled “Grading packet”The grading packet gives a grader, person or agent, one attempt question by question. For each answerable question it has the prompt, type, and options; the AI trainer’s response; the allowed point range; the current grade and revision; the employer-only rubric for manually graded questions; and the expected answer for auto-graded questions only. A manually graded question never carries an answer key.
It also has the grading state (IN_PROGRESS, PENDING_MANUAL, GRADED, or UNSCORED), the questions still waiting for a manual grade, the pass rule, the release mode and whether results are released, the current provenance, the full revision history with provenance, and a nextAction.
REST
curl -s "https://www.opentrain.ai/api/public/v1/project-todos/quizzes/grading-packet?attemptId=att_789" \ -H "Authorization: Bearer $OPENTRAIN_API_TOKEN"SDK
const packet = await opentrain.getProjectTodoQuizGradingPacket({ attemptId: 'att_789' });CLI
opentrain todos quiz grading-packet --attempt-id att_789MCP
Call opentrain_quiz_grading_packet with attemptId.
Awards points for manually graded questions on one attempt.
actionstringbodyrequiredgradeidempotencyKeystringbodyrequiredattemptIdstringbodyrequiredgradesarraybodyrequiredUp to 500 rows of { "questionId": "…", "awardedPoints": n } (0–10,000 points per question).
notestringbodyprovenanceobjectbodyWho or what produced the grade: grader (AGENT or HUMAN, required when you send provenance), and optional model and provider (up to 120 characters each), confidence (0 to 1), rubricVersion (up to 120 characters), and humanReviewed (boolean).
Grades are append-only revisions: regrading records a new revision instead of rewriting history. When grading completes a passing verdict under ON_PASS, the linked to-do completes automatically.
Grade provenance
Section titled “Grade provenance”Provenance is stored on the grade’s audit event and read back on the attempt history and the grading packet. It is never shown to AI trainers. A retry with the same idempotencyKey keeps the original provenance. Provenance records what happened; it does not change how the grade is applied.
REST
curl -s -X POST "https://www.opentrain.ai/api/public/v1/project-todos/quizzes/manage" \ -H "Authorization: Bearer $OPENTRAIN_API_TOKEN" -H 'content-type: application/json' -d '{ "action": "grade", "idempotencyKey": "grade-att-789-r1", "attemptId": "att_789", "grades": [{ "questionId": "q_why", "awardedPoints": 3 }], "note": "Names the hazard and the consequence.", "provenance": { "grader": "AGENT", "model": "your-model-id", "provider": "your-provider", "confidence": 0.82, "rubricVersion": "v3", "humanReviewed": false }}'SDK
await opentrain.manageProjectTodoQuiz({ action: 'grade', idempotencyKey: 'grade-att-789-r1', attemptId: 'att_789', grades: [{ questionId: 'q_why', awardedPoints: 3 }], note: 'Names the hazard and the consequence.', provenance: { grader: 'AGENT', model: 'your-model-id', provider: 'your-provider', confidence: 0.82, rubricVersion: 'v3', humanReviewed: false, },});CLI
opentrain todos quiz grade --attempt-id att_789 \ --grades-json '[{"questionId":"q_why","awardedPoints":3}]' \ --note "Names the hazard and the consequence." \ --grader AGENT --grader-model your-model-id --grader-provider your-provider \ --confidence 0.82 --rubric-version v3 --confirm-liveAdd --human-reviewed when a person checked the grade. The other provenance flags require --grader.
MCP
Call opentrain_manage_project_todo_quiz with action: "grade" and the same fields, including provenance.
AI-assisted grading safely
Section titled “AI-assisted grading safely”OpenTrain does not grade quizzes with AI on its own. The quiz operations on this page have no hosted grader, and they send no quiz content or AI trainer answers to any model provider. When you use an AI agent to grade, the agent runs in your environment under your API key. Follow these rules:
- The agent proposes. It reads the grading packet and proposes points per question against the rubric.
- OpenTrain records provenance. Send
provenancewithgrader: "AGENT", the model, the provider, the agent’s confidence, and the rubric version. The record stays on the audit trail even after a person regrades. - A person finalizes. Use
resultRelease: MANUALon quizzes that an agent grades, so AI trainers see no score until a person has checked the grade and runrelease. If the person changes a grade, they regrade withgrader: "HUMAN", which adds a new revision; the agent’s revision stays in the history. OpenTrain does not enforce this step for you. WithIMMEDIATErelease, an agent’s grade is visible to the AI trainer as soon as it is saved. - Know where answers go. The grading packet holds AI trainer answers and your rubric. Your agent sends them to the model it runs on. Use only a model provider your organization has approved for this data.
- Keep keys and rubrics private. Answer keys, rubrics, and grade history never reach AI trainers through OpenTrain. Do not paste them into worker-facing messages or coaching comments.
release and bulk_release
Section titled “release and bulk_release”actionstringbodyrequiredrelease or bulk_releaseidempotencyKeystringbodyrequiredattemptIdstringbodyrelease: the single attempt to make visible.jobIdstringbodybulk_release: with formId, releases every releasable held result on the job.formIdstringbodyReleasing notifies the AI trainer and makes their score visible. Attempts still awaiting manual grading are not releasable until graded.
Export results as JSON or JSONL
Section titled “Export results as JSON or JSONL”GET /quizzes/export returns a form’s results as JSON (the default) or JSONL, with a redaction manifest that states what is included. Add formVersionId to export one version.
REST
curl -s "https://www.opentrain.ai/api/public/v1/project-todos/quizzes/export?jobId=job_123&formId=form_456&format=jsonl" \ -H "Authorization: Bearer $OPENTRAIN_API_TOKEN"SDK
const exported = await opentrain.exportProjectTodoQuizResults({ jobId: 'job_123', formId: 'form_456', format: 'jsonl',});CLI
opentrain todos quiz results-export --job-id job_123 --form-id form_456 \ --format jsonl --out ./results.jsonlWith --out, the file describes itself: a JSON file keeps the whole response, including the manifest, and the first line of a JSONL file is the manifest.
MCP
Call opentrain_export_quiz_results with jobId, formId, and optional formVersionId and format.
A JSON response has format: "json", jobId, formId, formVersionId, filename, generatedAt, rowCount, redaction, and results. results has exactly form, summary, questionAggregates, attempts, and gradeRevisions. A JSONL response has format: "jsonl", filename, rowCount, lineCount, redaction, and jsonl. Each JSONL line has a kind: one manifest line, one attempt line per attempt, one summary line, one question line per question, and one grade-revision line per grade revision.
redaction field | Value |
|---|---|
workerEmail | OMITTED. Never a field, and names never fall back to an email. |
workerName, workerId | INCLUDED. An AI trainer with no name on file appears as Worker <id suffix>. |
answerValues, reviewNotes | INCLUDED_EMAILS_REDACTED. Email addresses inside the text are replaced. |
gradeProvenance | INCLUDED |
gradeNotes, auditMetadata, answerKeys, rubrics, promptRichContent, coachingThreads | OMITTED |
Authoring capabilities
Section titled “Authoring capabilities”GET /quizzes/authoring/capabilities returns the authoring contract as data. It needs only project_todos:read and works before the Project To-dos agent surface is turned on for your organization. It holds no organization data.
It lists the quiz-as-code document version, schema versions, question types, limits (prompt length, options, points, rubric length), grading modes and answer-key shapes, partial-credit modes, the grade provenance fields, settings and To-do enums, export formats, the standard workflows, and what is never exposed to AI trainers.
REST
curl -s "https://www.opentrain.ai/api/public/v1/project-todos/quizzes/authoring/capabilities" \ -H "Authorization: Bearer $OPENTRAIN_API_TOKEN"SDK
const capabilities = await opentrain.getProjectTodoQuizCapabilities();CLI
opentrain todos quiz capabilitiesMCP
Call opentrain_quiz_authoring_capabilities with no arguments.