Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

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.

POST/api/public/v1/project-todos/quizzes/manage

Auto-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 by formVersionId.
  • 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.

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

Terminal window
curl -s "https://www.opentrain.ai/api/public/v1/project-todos/quizzes/grading-packet?attemptId=att_789" \
-H "Authorization: Bearer $OPENTRAIN_API_TOKEN"

Awards points for manually graded questions on one attempt.

actionstringbodyrequired
grade
idempotencyKeystringbodyrequired
attemptIdstringbodyrequired
gradesarraybodyrequired

Up to 500 rows of { "questionId": "…", "awardedPoints": n } (0–10,000 points per question).

notestringbody
Optional grading note attached to the revision.
provenanceobjectbody

Who 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.

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

Terminal window
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
}
}'

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:

  1. The agent proposes. It reads the grading packet and proposes points per question against the rubric.
  2. OpenTrain records provenance. Send provenance with grader: "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.
  3. A person finalizes. Use resultRelease: MANUAL on quizzes that an agent grades, so AI trainers see no score until a person has checked the grade and run release. If the person changes a grade, they regrade with grader: "HUMAN", which adds a new revision; the agent’s revision stays in the history. OpenTrain does not enforce this step for you. With IMMEDIATE release, an agent’s grade is visible to the AI trainer as soon as it is saved.
  4. 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.
  5. 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.
actionstringbodyrequired
release or bulk_release
idempotencyKeystringbodyrequired
attemptIdstringbody
release: the single attempt to make visible.
jobIdstringbody
bulk_release: with formId, releases every releasable held result on the job.
formIdstringbody

Releasing notifies the AI trainer and makes their score visible. Attempts still awaiting manual grading are not releasable until graded.

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

Terminal window
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"

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 fieldValue
workerEmailOMITTED. Never a field, and names never fall back to an email.
workerName, workerIdINCLUDED. An AI trainer with no name on file appears as Worker <id suffix>.
answerValues, reviewNotesINCLUDED_EMAILS_REDACTED. Email addresses inside the text are replaced.
gradeProvenanceINCLUDED
gradeNotes, auditMetadata, answerKeys, rubrics, promptRichContent, coachingThreadsOMITTED

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

Terminal window
curl -s "https://www.opentrain.ai/api/public/v1/project-todos/quizzes/authoring/capabilities" \
-H "Authorization: Bearer $OPENTRAIN_API_TOKEN"