Skip to content

Commit 9723ec3

Browse files
authored
fix: Include permission check for auto publishing grades (#1158)
1 parent af06c66 commit 9723ec3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/cadet/assessments/assessments.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,7 +2387,7 @@ defmodule Cadet.Assessments do
23872387
def update_grading_info(
23882388
%{submission_id: submission_id, question_id: question_id},
23892389
attrs,
2390-
%CourseRegistration{id: grader_id}
2390+
cr = %CourseRegistration{id: grader_id}
23912391
)
23922392
when is_ecto_id(submission_id) and is_ecto_id(question_id) do
23932393
attrs = Map.put(attrs, "grader_id", grader_id)
@@ -2423,7 +2423,7 @@ defmodule Cadet.Assessments do
24232423
update_xp_bonus(submission)
24242424

24252425
if is_grading_auto_published and is_fully_graded?(submission_id) do
2426-
publish_grading(submission_id)
2426+
publish_grading(submission_id, cr)
24272427
end
24282428

24292429
{:ok, nil}

0 commit comments

Comments
 (0)