Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlion committed Dec 23, 2024
1 parent 93ade8d commit d89d95d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/claper/quizzes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ defmodule Claper.Quizzes do
if quiz.lti_resource_id do
Claper.Workers.QuizLti.edit(quiz.id) |> Oban.insert()
end

broadcast({:ok, updated_quiz, event_uuid}, :quiz_updated)

error ->
Expand Down
15 changes: 12 additions & 3 deletions lib/claper_web/live/stat_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ defmodule ClaperWeb.StatLive.Index do

defp average_polls(event, unique_attendees) do
poll_ids = Claper.Polls.list_polls(event.presentation_file.id) |> Enum.map(& &1.id)

case poll_ids do
[] -> 0
[] ->
0

poll_ids ->
distinct_votes = Claper.Stats.get_distinct_poll_votes(poll_ids)
distinct_votes / (Enum.count(poll_ids) * unique_attendees)
Expand All @@ -97,8 +100,11 @@ defmodule ClaperWeb.StatLive.Index do

defp average_quizzes(event, unique_attendees) do
quiz_ids = Claper.Quizzes.list_quizzes(event.presentation_file.id) |> Enum.map(& &1.id)

case quiz_ids do
[] -> 0
[] ->
0

quiz_ids ->
distinct_votes = Claper.Stats.get_distinct_quiz_responses(quiz_ids)
distinct_votes / (Enum.count(quiz_ids) * unique_attendees)
Expand All @@ -107,8 +113,11 @@ defmodule ClaperWeb.StatLive.Index do

defp average_forms(event, unique_attendees) do
form_ids = Claper.Forms.list_forms(event.presentation_file.id) |> Enum.map(& &1.id)

case form_ids do
[] -> 0
[] ->
0

form_ids ->
distinct_submits = Claper.Stats.get_distinct_form_submits(form_ids)
distinct_submits / (Enum.count(form_ids) * unique_attendees)
Expand Down

0 comments on commit d89d95d

Please sign in to comment.