Lecturer and Student Shared API Routes

This section documents API endpoints that are accessible to both lecturer and student users.

GET /bd/assessments/<assessment_id>/questions

Description: Get all questions for a specific assessment (lecturer and student).
Note: You must include credentials: include when sending the request.

Request:
GET http://localhost:8080/api/v1/bd/assessments/<assessment_id>/questions

Response:
[
    {
        "assessment_id": "e49d387f-7128-42c3-939e-0175847733ab",
        "choices": null,
        "correct_answer": null,
        "created_at": "2025-06-26T14:21:50.422085",
        "id": "b0136541-5f9b-4ed7-9c68-1ed1e663cbe1",
        "marks": 3.0,
        "rubric": "Award full marks for correct year; partial for close guesses",
        "text": "Challenge of key exchange, possible solutions",
        "type": "open-ended"
    }
]

GET /bd/notes/<note_id>/download

Description: Download note materials (lecturer and student).
Note: You must include credentials: include when sending the request.

Request:
GET http://localhost:8080/api/v1/bd/notes/<note_id>/download

GET /bd/units/<unit_id>/notes

Description: Retrieve note materials in a specific unit (lecturer and student).
Note: You must include credentials: include when sending the request.

Request:
GET http://localhost:8080/api/v1/bd/units/<unit_id>/notes

Response:
{
    "course": {
        "code": "CS",
        "id": "7d1360db-d1f3-40c1-9f05-6ab64d60f281",
        "name": "Computer Science"
    },
    "message": "Notes retrieved successfully.",
    "notes": [
        {
            "course_id": "7d1360db-d1f3-40c1-9f05-6ab64d60f281",
            "created_at": "2025-06-26T15:06:30.974635",
            "description": "",
            "file_size": 17460,
            "file_type": "docx",
            "id": "33b77145-0716-4b9d-9c89-0639b1a3cfc8",
            "lecturer_id": "daa64de5-44d5-435a-a156-08637dccb58a",
            "mime_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
            "original_filename": "machine_learning_outline.docx",
            "title": "course outline",
            "unit_id": "91827bb6-2be8-4b0a-9bc0-af472aacc375",
            "updated_at": "2025-06-26T15:06:30.974643"
        }
    ],
    "unit": {
        "code": "CCS 4102",
        "id": "91827bb6-2be8-4b0a-9bc0-af472aacc375",
        "name": "Machine Learning"
    }
}