Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kjw142857 authored Sep 15, 2023
1 parent 662c4f1 commit fa29efb
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions lib/cadet/jobs/autograder/utilities.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,6 @@ defmodule Cadet.Autograder.Utilities do
|> Enum.map(&sort_assessment_questions(&1))
end

# fetch voting questions that are about to open the next day
def fetch_voting_questions do
Question
|> where(type: :voting)
|> join(:inner, [q], asst in assoc(q, :assessment))
|> where(
[q, asst],
asst.open_at > ^Timex.now() and asst.open_at <= ^Timex.shift(Timex.now(), days: 1)
)
|> select([q, asst], %{course_id: asst.course_id, question: q.question, question_id: q.id})
|> Repo.all()
end

def sort_assessment_questions(assessment = %Assessment{}) do
sorted_questions = Enum.sort_by(assessment.questions, & &1.id)
Map.put(assessment, :questions, sorted_questions)
Expand Down

0 comments on commit fa29efb

Please sign in to comment.