Skip to content

Commit

Permalink
fix: Include permission check for auto publishing grades
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielCWT committed Aug 23, 2024
1 parent af06c66 commit 8a39326
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cadet/assessments/assessments.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2387,7 +2387,7 @@ defmodule Cadet.Assessments do
def update_grading_info(
%{submission_id: submission_id, question_id: question_id},
attrs,
%CourseRegistration{id: grader_id}
cr = %CourseRegistration{id: grader_id}
)
when is_ecto_id(submission_id) and is_ecto_id(question_id) do
attrs = Map.put(attrs, "grader_id", grader_id)
Expand Down Expand Up @@ -2423,7 +2423,7 @@ defmodule Cadet.Assessments do
update_xp_bonus(submission)

if is_grading_auto_published and is_fully_graded?(submission_id) do
publish_grading(submission_id)
publish_grading(submission_id, cr)
end

{:ok, nil}
Expand Down

0 comments on commit 8a39326

Please sign in to comment.