POST /api/v1/assignment/{id}/add-content

Add structured content blocks to an assignment (instructions, requirements, rubrics). Only admins and lecturers can add content.

Path parameters

  • id string Required

    UUID of the assignment

application/json

Body Required

Content data including type and text

  • question string Required
  • type string Required

    Default value is UNSTRUCTURED.

Responses

  • 201 application/json

    Content added successfully

  • 400

    Invalid content data

  • 403

    Forbidden - Admin or Lecturer role required

  • 404

    Assignment not found

POST /api/v1/assignment/{id}/add-content
curl \
 --request POST 'https://api.echoplain.social/api/v1/assignment/assignment-123/add-content' \
 --header "Content-Type: application/json" \
 --data '{"text":"1. Implement both merge sort and quicksort\n2. Include time complexity analysis\n3. Submit as .zip file","type":"INSTRUCTIONS","title":"Submission Guidelines"}'
Request examples
{
  "text": "1. Implement both merge sort and quicksort\n2. Include time complexity analysis\n3. Submit as .zip file",
  "type": "INSTRUCTIONS",
  "title": "Submission Guidelines"
}
{
  "text": "Code correctness: 50 points\nCode efficiency: 30 points\nDocumentation: 20 points",
  "type": "RUBRIC",
  "title": "Grading Criteria"
}
Response examples (201)
{
  "content": {
    "id": "content-1",
    "text": "1. Implement both merge sort and quicksort...",
    "type": "INSTRUCTIONS",
    "title": "Submission Guidelines",
    "assignmentId": "assignment-123"
  },
  "message": "Content added successfully"
}