PATCH /api/v1/exam/{id}

Update exam information such as title, description, timing, or scoring settings. Only admins and lecturers can update exams.

Path parameters

  • id string Required

    UUID of the exam to update

application/json

Body Required

Partial exam data to update

  • title string Required
  • examPeriodId string Required
  • releaseDate string(date-time) Required
  • dueDate string(date-time) Required
  • durationMinutes number Required
  • maxAttempts number Required

    Default value is 1.

  • status string Required

Responses

  • 200 application/json

    Exam updated successfully

  • 400

    Invalid exam data provided

  • 404

    Exam not found

PATCH /api/v1/exam/{id}
curl \
 --request PATCH 'http://localhost:3500/api/v1/exam/123e4567-e89b-12d3-a456-426614174000' \
 --header "Content-Type: application/json" \
 --data '{"title":"Updated Midterm Exam - Data Structures","description":"Updated description"}'
Request examples
{
  "title": "Updated Midterm Exam - Data Structures",
  "description": "Updated description"
}
{
  "endTime": "2025-11-21T11:30:00Z",
  "startTime": "2025-11-21T09:00:00Z",
  "durationMinutes": 150
}
Response examples (200)
{
  "exam": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "title": "Updated Midterm Exam - Data Structures"
  },
  "message": "Exam updated successfully",
  "success": true
}