From c1108e03e6269a0c8f9b2ac3b9617748a6268bb3 Mon Sep 17 00:00:00 2001 From: GabrielCWT <77312579+GabrielCWT@users.noreply.github.com> Date: Mon, 26 Aug 2024 22:23:08 +0800 Subject: [PATCH] fix: Mark notifications for grading as read when publishing grading --- lib/cadet/assessments/assessments.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/cadet/assessments/assessments.ex b/lib/cadet/assessments/assessments.ex index d1d326741..39533077f 100644 --- a/lib/cadet/assessments/assessments.ex +++ b/lib/cadet/assessments/assessments.ex @@ -1250,6 +1250,12 @@ defmodule Cadet.Assessments do :published_grading ) + Notification + |> where([submission_id: ^submission.id, type: :submitted]) + |> select([n], n.id) + |> Repo.all() + |> Notifications.acknowledge(cr) + {:ok, nil} {:submission_found?, false} ->