pub async fn patch_plagiarism_flag(
__arg0: State<AppState>,
__arg1: Path<(i64, i64, i64)>,
) -> impl IntoResponse
Expand description
PATCH /api/modules/{module_id}/assignments/{assignment_id}/plagiarism/{case_id}/flag
Flags a plagiarism case after manual review, indicating confirmed plagiarism. Accessible only to lecturers and assistant lecturers assigned to the module.
§Path Parameters
module_id
: The ID of the parent moduleassignment_id
: The ID of the assignment containing the plagiarism casecase_id
: The ID of the plagiarism case to flag
§Returns
Returns an HTTP response indicating the result:
200 OK
with minimal case information on success403 FORBIDDEN
if user lacks required permissions404 NOT FOUND
if specified plagiarism case doesn’t exist500 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 flagged",
"data": {
"id": 17,
"status": "flagged",
"updated_at": "2024-05-20T16:30: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 “flagged” and sets the current timestamp to
updated_at
- Only users with lecturer or assistant lecturer roles assigned to the module can perform this action
- Considered an irreversible action indicating confirmed plagiarism