Create a new exam attempt for the authenticated student. Validates that the exam is within the allowed time window and the student has not exceeded the maximum number of attempts.
POST
/api/v1/exam/{id}/new-attempt
curl \
--request POST 'https://api.echoplain.social/api/v1/exam/123e4567-e89b-12d3-a456-426614174000/new-attempt'
Response examples (201)
{
"attempt": {
"id": "attempt-123",
"examId": "123e4567-e89b-12d3-a456-426614174000",
"status": "IN_PROGRESS",
"expiresAt": "2025-11-20T11:15:00Z",
"startedAt": "2025-11-20T09:15:00Z",
"studentId": "student-456"
},
"message": "Exam attempt created"
}
Response examples (400)
Exam not started
{
"error": "Bad Request",
"message": "Exam has not started yet",
"statusCode": 400
}
{
"error": "Bad Request",
"message": "Exam has already ended",
"statusCode": 400
}
{
"error": "Bad Request",
"message": "Maximum number of attempts reached",
"statusCode": 400
}