Skip to content

Commit

Permalink
fix credo long line
Browse files Browse the repository at this point in the history
  • Loading branch information
YaleChen299 committed Jul 24, 2023
1 parent 55c5a36 commit af683fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/cadet/assessments/assessments.ex
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ defmodule Cadet.Assessments do
Answer
|> join(:inner, [a], s in assoc(a, :submission))
|> where([_, s], s.student_id == ^course_reg.id)
# change a.xp and a.xp_adjustment to 0 if a.is_grading_published is false and return all answers
# change a.xp and a.xp_adjustment to 0
# if a.is_grading_published is false and return all answers
|> select([a, s], %{
a
| xp: fragment("CASE WHEN ? THEN ? ELSE 0 END", s.is_grading_published, a.xp),
Expand Down Expand Up @@ -911,7 +912,8 @@ defmodule Cadet.Assessments do
end
end

# This function changes the is_grading_published field of the submission to true only if all the answers are graded
# This function changes the is_grading_published field of the submission to true
# only if all the answers are graded
# and sends a notification to the student
def publish_grading(submission_id, cr = %CourseRegistration{id: course_reg_id, role: role})
when is_ecto_id(submission_id) do
Expand Down

0 comments on commit af683fd

Please sign in to comment.