Function patch_plagiarism_review

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

PATCH /api/modules/{module_id}/assignments/{assignment_id}/plagiarism/{case_id}/review

Marks a plagiarism case as reviewed after manual inspection, indicating it’s been cleared of plagiarism concerns. Accessible only to lecturers and assistant lecturers assigned to the module.

§Path Parameters

  • module_id: The ID of the parent module
  • assignment_id: The ID of the assignment containing the plagiarism case
  • case_id: The ID of the plagiarism case to mark as reviewed

§Returns

Returns an HTTP response indicating the result:

  • 200 OK with minimal case information on success
  • 403 FORBIDDEN if user lacks required permissions
  • 404 NOT FOUND if specified plagiarism case doesn’t exist
  • 500 INTERNAL SERVER ERROR for database errors or update failures

The response body includes only essential fields after the status change.

§Example Response (200 OK)

{
  "success": true,
  "message": "Plagiarism case marked as reviewed",
  "data": {
    "id": 17,
    "status": "reviewed",
    "updated_at": "2024-05-20T17:45:00Z"
  }
}

§Example Responses

  • 404 Not Found
{
  "success": false,
  "message": "Plagiarism case not found"
}
  • 500 Internal Server Error
{
  "success": false,
  "message": "Failed to update plagiarism case: [error details]"
}

§Notes

  • This operation updates the case status to “reviewed” and sets the current timestamp to updated_at
  • Only users with lecturer or assistant lecturer roles assigned to the module can perform this action
  • Typically indicates the case was investigated and determined not to be plagiarism