Skip to content

Commit

Permalink
Fix report
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlion committed Dec 28, 2024
1 parent f3a3616 commit 3300bd2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/claper_web/live/stat_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ defmodule ClaperWeb.StatLive.Index do
distinct_poster_count / unique_attendees
end

defp average_polls(_event, 0), do: 0

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

Expand All @@ -98,6 +100,8 @@ defmodule ClaperWeb.StatLive.Index do
end
end

defp average_quizzes(_event, 0), do: 0

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

Expand All @@ -111,6 +115,8 @@ defmodule ClaperWeb.StatLive.Index do
end
end

defp average_forms(_event, 0), do: 0

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

Expand Down

0 comments on commit 3300bd2

Please sign in to comment.