POST /api/v1/unit-instance/{unit}/new-cat

Create a new Continuous Assessment Test (CAT) for the unit. Only admins and lecturers can create CATs.

Path parameters

  • unit string Required

    UUID of the unit instance (unit offering)

application/json

Body Required

CAT data including title, release/due dates, duration, score, and attempts

  • title string Required
  • releaseDate string(date-time) Required
  • dueDate string(date-time) Required
  • durationMinutes number Required
  • score number Required
  • status string Required

    Values are ARCHIVED, DRAFT, COMPLETED, RELEASED, GRADED, UPCOMING, or ACTIVE. Default value is DRAFT.

  • maxAttempts number Required

    Default value is 1.

Responses

  • 201 application/json

    CAT created successfully

  • 400

    Invalid CAT data

  • 403

    Forbidden - Admin or Lecturer role required

POST /api/v1/unit-instance/{unit}/new-cat
curl \
 --request POST 'http://localhost:3500/api/v1/unit-instance/123e4567-e89b-12d3-a456-426614174000/new-cat' \
 --header "Content-Type: application/json" \
 --data '{"score":50,"title":"CAT 1 - Introduction to Algorithms","status":"DRAFT","dueDate":"2025-11-25T10:00:00Z","maxAttempts":1,"releaseDate":"2025-11-25T09:00:00Z","durationMinutes":60}'
Request examples
{
  "score": 50,
  "title": "CAT 1 - Introduction to Algorithms",
  "status": "DRAFT",
  "dueDate": "2025-11-25T10:00:00Z",
  "maxAttempts": 1,
  "releaseDate": "2025-11-25T09:00:00Z",
  "durationMinutes": 60
}
{
  "score": 75,
  "title": "CAT 2 - Data Structures",
  "status": "RELEASED",
  "dueDate": "2025-12-10T15:30:00Z",
  "maxAttempts": 2,
  "releaseDate": "2025-12-10T14:00:00Z",
  "durationMinutes": 90
}
Response examples (201)
{
  "cat": {
    "id": "cat-654",
    "score": 50,
    "title": "CAT 1 - Introduction to Algorithms",
    "status": "DRAFT",
    "dueDate": "2025-11-25T10:00:00Z",
    "createdAt": "2025-11-17T11:30:00Z",
    "maxAttempts": 1,
    "releaseDate": "2025-11-25T09:00:00Z",
    "unitOfferingId": "123e4567-e89b-12d3-a456-426614174000",
    "durationMinutes": 60
  },
  "message": "CAT created successfully"
}