Function get_all_memo_outputs

Source
pub async fn get_all_memo_outputs(
    __arg0: State<AppState>,
    __arg1: Path<(i64, i64)>,
) -> impl IntoResponse
Expand description

GET /api/modules/{module_id}/assignments/{assignment_id}/memo_output

Retrieve all memo output files for a given assignment, parsed into structured format.

Scans the memo_output directory for the specified assignment and parses each file into a MemoTaskOutput object, which contains labeled subsections and the raw file content.

Path Parameters

  • module_id (i64): The ID of the module
  • assignment_id (i64): The ID of the assignment

Success Response (200 OK)

[
  {
    "task_number": 1,
    "name": "Task 1",
    "subsections": [
      { "label": "Section A", "output": "..." }
    ],
    "raw": "..."
  }
]

Error Responses

  • 404 Not Found if the memo output directory does not exist or contains no valid files
  • 500 Internal Server Error if reading the directory fails

Example Request

curl http://localhost:3000/api/modules/1/assignments/2/memo_output