POST /api/v1/exam/{id}/grade-all

Automatically grade all pending exam attempts for a specific exam. This is useful after an exam period ends to process all student submissions at once. Structured questions are auto-graded, and AI is used for unstructured questions.

Path parameters

  • id string Required

    UUID of the exam

Responses

  • 200 application/json

    Batch grading completed with summary statistics

  • 400 application/json

    Default bad request error 400 response

    Hide response attributes Show response attributes object
    • message string Required

      Response message

    • error string Required
    • statusCode number Required
  • 403

    Forbidden - Admin or Lecturer role required

  • 404

    Exam not found

POST /api/v1/exam/{id}/grade-all
curl \
 --request POST 'http://localhost:3500/api/v1/exam/123e4567-e89b-12d3-a456-426614174000/grade-all'
Response examples (200)
{
  "errors": 0,
  "examId": "123e4567-e89b-12d3-a456-426614174000",
  "message": "Batch grading completed",
  "processed": 25,
  "autoGraded": 20,
  "totalFound": 25,
  "completedAt": "2025-11-20T15:00:00Z",
  "needsManualReview": 5
}
Response examples (400)
{
  "message": "string",
  "error": "string",
  "statusCode": 42.0
}