Files
Claper/lib/claper_web/live/event_live/manage.ex

959 lines
25 KiB
Elixir
Raw Normal View History

defmodule ClaperWeb.EventLive.Manage do
use ClaperWeb, :live_view
alias ClaperWeb.Presence
alias Claper.Polls
alias Claper.Forms
2023-11-23 16:36:39 +05:30
alias Claper.Embeds
Add quizz feature + improvements commit 705ea00064e552f482bff52c3c5b11d23fbd5b4c Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:08:42 2024 -0500 Change version commit 330173bd64bb18c5ea7e68a2122f66497981c3c3 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:01:52 2024 -0500 Fix layout commit 3cc075962e961f8a78b0c30eca9b79db6b9a5731 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 19 14:20:59 2024 +0100 Update changelog commit 63b1fa7ee591d40e44005b7939f51c99cf3e119e Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:56:01 2024 +0100 Fix upper commit 8e7bb1990c58e343de5aa18036eb0916573fb4c6 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:49:20 2024 +0100 Add pagination for events commit 28beacd120f0a1081e670e4a06bbc185cc699beb Author: Alex Lion <dev@alexandrelion.com> Date: Mon Dec 9 21:03:13 2024 +0100 Add pagination commit c79d6cce947869b98795b9baf541a32952624969 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 21:24:23 2024 +0100 Fix tests commit caad25ad75b5937ca0906dca89dedaa4d58ae072 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 17:43:55 2024 +0100 Fix user registration bug commit 38c3eecc49d1397a8bb7a4a11203775396d00272 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:23:24 2024 +0100 Update changelog commit e648ef08a0f61cf4b554fcbf0a83e02a2249de0d Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:06:27 2024 +0100 Add obin commit 6925117818e117dbd60efea5ae6c81a26a57f76f Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 19:39:03 2024 +0100 WIP commit be9b2886d3b879452f5bae08b3cdd181cac254f8 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 16:19:09 2024 +0100 Add LTI AGS for quizzes commit 29a7c96de6d4e38b26dfaa61bfa5e689a16d4935 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 5 13:30:49 2024 +0100 Add translations commit 249fdc9188c7613a6adafb0b983303c1ae7601bd Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 21:37:27 2024 +0100 Add qti export commit c2d56e30cdb6c629e957c64e4393dfd9d5af7159 Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 20:44:58 2024 +0100 Fix report embed commit a34c239f9014e53b079106f1935bc2b079d01eed Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 11:32:32 2024 +0100 Add export quiz commit 8d1f34b90635776ae40849bd75fd135693b116fb Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:56:50 2024 +0100 Improve design commit d9a7370419ed9e288eccf263c2715330831e45e4 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:43:27 2024 +0100 Add exports commit b374b7bbccfa655dfad7695d7a24c5ddd4a07b66 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:41 2024 +0100 Remove presence on manager commit 404e759ae3d2f5e555ae20437204553bffdc5065 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:33 2024 +0100 Improve engagement report commit 39dbec6692c2d3f74a97647a703993d6152bfa06 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:39:59 2024 +0100 Add translation commit 354c2e30aece5bc7d800893ce8dee3868a1c1f71 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:18:53 2024 +0100 Change product tour behavior commit 5f253812282fb11011694b8828580d886f1f5899 Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:59:32 2024 +0100 WIP commit f411180433a05b89fc9d029e2b313968985e5c3f Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:32:30 2024 +0100 WIP commit 2b5989774eeb839f7b7b2a49377aca9fe4d68c09 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 19:31:27 2024 +0100 WIP commit c8750a667f131b68818859796670c3022c6d53fe Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 18:23:01 2024 +0100 WIP commit fdb9efecb5688423ed2c82cf445868040653d380 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 17:55:57 2024 +0100 WIP commit 5d12b12ce33eb5c1ba2a3307ef4ac679b279f511 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 16 21:22:12 2024 +0100 WIP commit 548b714fda61464517247910af7e3e1c2bdae8cf Author: Alex <dev@alexandrelion.com> Date: Fri Nov 15 15:34:00 2024 +0100 WIP commit f0c87f34ea2ac837b4b3b3d6fd51c32bd625371e Author: Alex <dev@alexandrelion.com> Date: Wed Nov 13 22:09:24 2024 +0100 WIP commit c0c8bf99a538653208e28300566cced3d444a764 Author: Alex <dev@alexandrelion.com> Date: Mon Nov 11 13:02:36 2024 +0100 WIP commit 245ea9b836c2e69c7269fc7d8c7fd2edd0032eed Author: Alex <dev@alexandrelion.com> Date: Sun Nov 10 19:07:36 2024 +0100 Add presenter commit 0cf50918d62a9ab5ea127698219e05f781c659bb Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 23:20:35 2024 +0100 Refactor reactions commit ef8ffefe56d5b19dd895be181437c461134176ab Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 22:21:13 2024 +0100 Add tests commit c4055142ed63d8ea1be921f527bcaf595a2b9268 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 11:28:00 2024 +0100 WIP commit 779e6970f7ee7ca89aab2bdfcff6197895b9ce5e Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 17:21:11 2024 +0100 WIP commit 9d25c440b830ded7e6fc2e0bcc9353520ec4a951 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 11:54:31 2024 +0100 WIP commit c0157487a9e20b6773e517553681915c12367851 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 17:13:04 2024 +0100 Fix condition commit a64439fbf2d852e127deb00a11906fb86b0c9ece Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 12:16:21 2024 +0100 WIP commit a994d959afe20ee380d42feb5ca6da2ab832d569 Author: Alex <dev@alexandrelion.com> Date: Wed Oct 30 23:06:24 2024 +0100 Fix changeset commit 5b2935fc33577af21ccc2558b49d9a813f4835f3 Merge: cec1a97 7476269 Author: Alex <dev@alexandrelion.com> Date: Sun Oct 20 11:26:51 2024 +0200 Merge branch 'dev' into feature/quizz commit cec1a97650867da3a09d8e23d0756a3a573e1bc8 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 22:52:00 2024 +0200 WIP commit f65854f638393ce80fd9d17642e8a90ee5c1a06e Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 16:55:42 2024 +0200 WIP commit 1e6429a386c56be6a8fdd2f083e273b50a6bc4c9 Merge: 1977959 6f8a2fd Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 13:49:22 2024 +0200 Merge branch 'dev' into feature/quizz # Conflicts: # lib/claper_web/live/event_live/manage.html.heex commit 1977959efb12b5fb2f1795a8547e501c02e62122 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 5 12:57:09 2024 +0200 WIP
2024-12-21 10:09:29 -05:00
alias Claper.Quizzes
@impl true
def mount(%{"code" => code}, session, socket) do
with %{"locale" => locale} <- session do
Gettext.put_locale(ClaperWeb.Gettext, locale)
end
event =
Claper.Events.get_event_with_code(code, [
:user,
Add quizz feature + improvements commit 705ea00064e552f482bff52c3c5b11d23fbd5b4c Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:08:42 2024 -0500 Change version commit 330173bd64bb18c5ea7e68a2122f66497981c3c3 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:01:52 2024 -0500 Fix layout commit 3cc075962e961f8a78b0c30eca9b79db6b9a5731 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 19 14:20:59 2024 +0100 Update changelog commit 63b1fa7ee591d40e44005b7939f51c99cf3e119e Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:56:01 2024 +0100 Fix upper commit 8e7bb1990c58e343de5aa18036eb0916573fb4c6 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:49:20 2024 +0100 Add pagination for events commit 28beacd120f0a1081e670e4a06bbc185cc699beb Author: Alex Lion <dev@alexandrelion.com> Date: Mon Dec 9 21:03:13 2024 +0100 Add pagination commit c79d6cce947869b98795b9baf541a32952624969 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 21:24:23 2024 +0100 Fix tests commit caad25ad75b5937ca0906dca89dedaa4d58ae072 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 17:43:55 2024 +0100 Fix user registration bug commit 38c3eecc49d1397a8bb7a4a11203775396d00272 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:23:24 2024 +0100 Update changelog commit e648ef08a0f61cf4b554fcbf0a83e02a2249de0d Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:06:27 2024 +0100 Add obin commit 6925117818e117dbd60efea5ae6c81a26a57f76f Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 19:39:03 2024 +0100 WIP commit be9b2886d3b879452f5bae08b3cdd181cac254f8 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 16:19:09 2024 +0100 Add LTI AGS for quizzes commit 29a7c96de6d4e38b26dfaa61bfa5e689a16d4935 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 5 13:30:49 2024 +0100 Add translations commit 249fdc9188c7613a6adafb0b983303c1ae7601bd Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 21:37:27 2024 +0100 Add qti export commit c2d56e30cdb6c629e957c64e4393dfd9d5af7159 Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 20:44:58 2024 +0100 Fix report embed commit a34c239f9014e53b079106f1935bc2b079d01eed Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 11:32:32 2024 +0100 Add export quiz commit 8d1f34b90635776ae40849bd75fd135693b116fb Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:56:50 2024 +0100 Improve design commit d9a7370419ed9e288eccf263c2715330831e45e4 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:43:27 2024 +0100 Add exports commit b374b7bbccfa655dfad7695d7a24c5ddd4a07b66 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:41 2024 +0100 Remove presence on manager commit 404e759ae3d2f5e555ae20437204553bffdc5065 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:33 2024 +0100 Improve engagement report commit 39dbec6692c2d3f74a97647a703993d6152bfa06 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:39:59 2024 +0100 Add translation commit 354c2e30aece5bc7d800893ce8dee3868a1c1f71 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:18:53 2024 +0100 Change product tour behavior commit 5f253812282fb11011694b8828580d886f1f5899 Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:59:32 2024 +0100 WIP commit f411180433a05b89fc9d029e2b313968985e5c3f Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:32:30 2024 +0100 WIP commit 2b5989774eeb839f7b7b2a49377aca9fe4d68c09 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 19:31:27 2024 +0100 WIP commit c8750a667f131b68818859796670c3022c6d53fe Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 18:23:01 2024 +0100 WIP commit fdb9efecb5688423ed2c82cf445868040653d380 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 17:55:57 2024 +0100 WIP commit 5d12b12ce33eb5c1ba2a3307ef4ac679b279f511 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 16 21:22:12 2024 +0100 WIP commit 548b714fda61464517247910af7e3e1c2bdae8cf Author: Alex <dev@alexandrelion.com> Date: Fri Nov 15 15:34:00 2024 +0100 WIP commit f0c87f34ea2ac837b4b3b3d6fd51c32bd625371e Author: Alex <dev@alexandrelion.com> Date: Wed Nov 13 22:09:24 2024 +0100 WIP commit c0c8bf99a538653208e28300566cced3d444a764 Author: Alex <dev@alexandrelion.com> Date: Mon Nov 11 13:02:36 2024 +0100 WIP commit 245ea9b836c2e69c7269fc7d8c7fd2edd0032eed Author: Alex <dev@alexandrelion.com> Date: Sun Nov 10 19:07:36 2024 +0100 Add presenter commit 0cf50918d62a9ab5ea127698219e05f781c659bb Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 23:20:35 2024 +0100 Refactor reactions commit ef8ffefe56d5b19dd895be181437c461134176ab Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 22:21:13 2024 +0100 Add tests commit c4055142ed63d8ea1be921f527bcaf595a2b9268 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 11:28:00 2024 +0100 WIP commit 779e6970f7ee7ca89aab2bdfcff6197895b9ce5e Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 17:21:11 2024 +0100 WIP commit 9d25c440b830ded7e6fc2e0bcc9353520ec4a951 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 11:54:31 2024 +0100 WIP commit c0157487a9e20b6773e517553681915c12367851 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 17:13:04 2024 +0100 Fix condition commit a64439fbf2d852e127deb00a11906fb86b0c9ece Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 12:16:21 2024 +0100 WIP commit a994d959afe20ee380d42feb5ca6da2ab832d569 Author: Alex <dev@alexandrelion.com> Date: Wed Oct 30 23:06:24 2024 +0100 Fix changeset commit 5b2935fc33577af21ccc2558b49d9a813f4835f3 Merge: cec1a97 7476269 Author: Alex <dev@alexandrelion.com> Date: Sun Oct 20 11:26:51 2024 +0200 Merge branch 'dev' into feature/quizz commit cec1a97650867da3a09d8e23d0756a3a573e1bc8 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 22:52:00 2024 +0200 WIP commit f65854f638393ce80fd9d17642e8a90ee5c1a06e Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 16:55:42 2024 +0200 WIP commit 1e6429a386c56be6a8fdd2f083e273b50a6bc4c9 Merge: 1977959 6f8a2fd Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 13:49:22 2024 +0200 Merge branch 'dev' into feature/quizz # Conflicts: # lib/claper_web/live/event_live/manage.html.heex commit 1977959efb12b5fb2f1795a8547e501c02e62122 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 5 12:57:09 2024 +0200 WIP
2024-12-21 10:09:29 -05:00
:lti_resource,
presentation_file: [:polls, :presentation_state]
])
2024-07-11 16:33:02 +02:00
if is_nil(event) || not leader?(socket, event) do
{:ok,
socket
2024-04-06 17:39:42 +02:00
|> put_flash(:error, gettext("Event doesn't exist"))
|> redirect(to: "/")}
else
if connected?(socket) do
Claper.Events.Event.subscribe(event.uuid)
2024-07-11 12:53:47 +02:00
Claper.Presentations.subscribe(event.presentation_file.id)
end
2024-04-13 12:54:05 +02:00
posts = list_all_posts(socket, event.uuid)
pinned_posts = list_pinned_posts(socket, event.uuid)
questions = list_all_questions(socket, event.uuid)
2024-04-27 12:38:04 +02:00
form_submits = list_form_submits(socket, event.presentation_file.id)
2024-04-13 12:54:05 +02:00
socket =
socket
|> assign(:interaction_modal, false)
2024-04-16 22:36:50 +02:00
|> assign(:settings_modal, false)
|> assign(:attendees_nb, 1)
|> assign(:event, event)
2024-04-13 12:54:05 +02:00
|> assign(:sort_questions_by, "date")
|> assign(:state, event.presentation_file.presentation_state)
2024-04-13 12:54:05 +02:00
|> stream(:posts, posts)
|> stream(:questions, questions)
|> stream(:pinned_posts, pinned_posts)
2024-04-27 12:38:04 +02:00
|> stream(:form_submits, form_submits)
2024-04-13 12:54:05 +02:00
|> assign(:pinned_post_count, length(pinned_posts))
|> assign(:question_count, length(questions))
|> assign(:post_count, length(posts))
2024-07-11 12:53:47 +02:00
|> assign(
:total_interactions,
Claper.Interactions.get_number_total_interactions(event.presentation_file.id)
)
2024-04-06 11:48:47 +02:00
|> assign(
:form_submit_count,
2024-04-27 12:38:04 +02:00
length(form_submits)
2024-04-06 11:48:47 +02:00
)
|> assign(:create, nil)
|> assign(:list_tab, :posts)
|> assign(:create_action, :new)
2024-07-11 12:53:47 +02:00
|> assign(:preview, false)
|> push_event("page-manage", %{
current_page: event.presentation_file.presentation_state.position,
timeout: 500
})
2024-07-11 12:53:47 +02:00
|> interactions_at_position(event.presentation_file.presentation_state.position)
2024-04-06 11:48:47 +02:00
{:ok, socket}
end
end
2024-07-11 16:33:02 +02:00
defp leader?(%{assigns: %{current_user: current_user}} = _socket, event) do
2025-11-20 10:44:06 +01:00
Claper.Events.led_by?(current_user.email, event) || event.user.id == current_user.id
end
2024-07-11 16:33:02 +02:00
defp leader?(_socket, _event), do: false
@impl true
def handle_info(%{event: "presence_diff"}, %{assigns: %{event: event}} = socket) do
attendees = Presence.list("event:#{event.uuid}")
{:noreply, push_event(socket, "update-attendees", %{count: Enum.count(attendees)})}
end
@impl true
def handle_info({:post_created, post}, socket) do
2024-04-13 12:54:05 +02:00
socket =
socket
|> stream_insert(:posts, post)
|> update(:post_count, fn post_count -> post_count + 1 end)
2025-01-02 21:27:36 +01:00
case ClaperWeb.Helpers.body_without_links(post.body) =~ "?" do
2024-04-13 12:54:05 +02:00
true ->
{:noreply,
socket
|> stream_insert(:questions, post)
|> update(:question_count, fn question_count -> question_count + 1 end)
|> push_event("scroll", %{})}
_ ->
{:noreply, socket |> push_event("scroll", %{})}
end
end
@impl true
2023-11-23 13:58:44 +01:00
def handle_info({:post_updated, updated_post}, socket) do
{:noreply,
socket
2024-04-06 11:48:47 +02:00
|> stream_insert(:posts, updated_post)
2024-04-13 12:54:05 +02:00
|> then(fn socket ->
sorted_questions =
list_all_questions(socket, socket.assigns.event.uuid, socket.assigns.sort_questions_by)
stream(socket, :questions, sorted_questions, reset: true)
end)
2024-04-06 11:48:47 +02:00
|> stream_insert(:pinned_posts, updated_post)}
end
@impl true
2023-11-23 13:58:44 +01:00
def handle_info({:post_deleted, deleted_post}, socket) do
2024-04-13 12:54:05 +02:00
socket =
socket
|> stream_delete(:posts, deleted_post)
|> stream_delete(:pinned_posts, deleted_post)
|> update(:pinned_post_count, fn pinned_post_count ->
pinned_post_count - if deleted_post.pinned, do: 1, else: 0
end)
|> update(:post_count, fn post_count -> post_count - 1 end)
2025-01-02 21:27:36 +01:00
case ClaperWeb.Helpers.body_without_links(deleted_post.body) =~ "?" do
2024-04-13 12:54:05 +02:00
true ->
{:noreply,
socket
|> stream_delete(:questions, deleted_post)
|> update(:question_count, fn question_count -> question_count - 1 end)}
_ ->
{:noreply, socket}
end
end
@impl true
2023-11-24 23:03:08 +01:00
def handle_info({:post_pinned, post}, socket) do
2023-11-23 13:58:44 +01:00
updated_socket =
socket
2024-04-06 11:48:47 +02:00
|> stream_insert(:posts, post)
|> stream_insert(:pinned_posts, post)
2024-10-13 20:57:00 +02:00
|> stream_insert(:questions, post)
2023-11-24 23:03:08 +01:00
|> assign(:pinned_post_count, socket.assigns.pinned_post_count + 1)
2023-11-23 13:58:44 +01:00
{:noreply, updated_socket}
end
@impl true
2023-11-24 23:03:08 +01:00
def handle_info({:post_unpinned, post}, socket) do
2023-11-23 13:58:44 +01:00
updated_socket =
socket
2024-04-06 11:48:47 +02:00
|> stream_insert(:posts, post)
|> stream_delete(:pinned_posts, post)
2024-10-13 20:57:00 +02:00
|> stream_insert(:questions, post)
2023-11-24 23:03:08 +01:00
|> assign(:pinned_post_count, socket.assigns.pinned_post_count - 1)
2023-12-01 12:31:57 +01:00
2023-11-23 13:58:44 +01:00
{:noreply, updated_socket}
end
@impl true
def handle_info({:form_submit_created, fs}, socket) do
{:noreply,
2023-02-26 23:15:55 +01:00
socket
2024-04-06 11:48:47 +02:00
|> stream_insert(:form_submits, fs)
|> update(:form_submit_count, fn form_submit_count -> form_submit_count + 1 end)
2023-02-26 23:15:55 +01:00
|> push_event("scroll", %{})}
end
@impl true
def handle_info({:form_submit_updated, fs}, socket) do
2024-04-06 11:48:47 +02:00
{:noreply, socket |> stream_insert(:form_submits, fs)}
end
@impl true
def handle_info({:form_submit_deleted, fs}, socket) do
2024-04-06 11:48:47 +02:00
{:noreply,
socket
|> stream_delete(:form_submits, fs)
|> update(:form_submit_count, fn form_submit_count -> form_submit_count - 1 end)}
end
@impl true
2024-07-11 12:53:47 +02:00
def handle_info({:poll_created, poll}, socket) do
{:noreply,
socket
2024-07-11 12:53:47 +02:00
|> interactions_at_position(poll.position)}
end
@impl true
2024-07-11 12:53:47 +02:00
def handle_info({:form_created, form}, socket) do
{:noreply,
socket
|> interactions_at_position(form.position)}
end
@impl true
def handle_info({:embed_created, embed}, socket) do
{:noreply,
socket
|> interactions_at_position(embed.position)}
end
2024-12-25 10:02:07 -05:00
@impl true
def handle_info({:quiz_created, quiz}, socket) do
{:noreply,
socket
|> interactions_at_position(quiz.position)}
end
2024-07-11 12:53:47 +02:00
@impl true
def handle_info({:poll_updated, poll}, socket) do
{:noreply,
socket
|> interactions_at_position(poll.position)}
end
2023-11-23 16:36:39 +05:30
@impl true
def handle_info({:embed_updated, embed}, socket) do
{:noreply,
socket
2024-07-11 12:53:47 +02:00
|> interactions_at_position(embed.position)}
end
@impl true
def handle_info({:form_updated, form}, socket) do
{:noreply,
socket
|> interactions_at_position(form.position)}
end
Add quizz feature + improvements commit 705ea00064e552f482bff52c3c5b11d23fbd5b4c Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:08:42 2024 -0500 Change version commit 330173bd64bb18c5ea7e68a2122f66497981c3c3 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:01:52 2024 -0500 Fix layout commit 3cc075962e961f8a78b0c30eca9b79db6b9a5731 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 19 14:20:59 2024 +0100 Update changelog commit 63b1fa7ee591d40e44005b7939f51c99cf3e119e Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:56:01 2024 +0100 Fix upper commit 8e7bb1990c58e343de5aa18036eb0916573fb4c6 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:49:20 2024 +0100 Add pagination for events commit 28beacd120f0a1081e670e4a06bbc185cc699beb Author: Alex Lion <dev@alexandrelion.com> Date: Mon Dec 9 21:03:13 2024 +0100 Add pagination commit c79d6cce947869b98795b9baf541a32952624969 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 21:24:23 2024 +0100 Fix tests commit caad25ad75b5937ca0906dca89dedaa4d58ae072 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 17:43:55 2024 +0100 Fix user registration bug commit 38c3eecc49d1397a8bb7a4a11203775396d00272 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:23:24 2024 +0100 Update changelog commit e648ef08a0f61cf4b554fcbf0a83e02a2249de0d Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:06:27 2024 +0100 Add obin commit 6925117818e117dbd60efea5ae6c81a26a57f76f Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 19:39:03 2024 +0100 WIP commit be9b2886d3b879452f5bae08b3cdd181cac254f8 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 16:19:09 2024 +0100 Add LTI AGS for quizzes commit 29a7c96de6d4e38b26dfaa61bfa5e689a16d4935 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 5 13:30:49 2024 +0100 Add translations commit 249fdc9188c7613a6adafb0b983303c1ae7601bd Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 21:37:27 2024 +0100 Add qti export commit c2d56e30cdb6c629e957c64e4393dfd9d5af7159 Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 20:44:58 2024 +0100 Fix report embed commit a34c239f9014e53b079106f1935bc2b079d01eed Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 11:32:32 2024 +0100 Add export quiz commit 8d1f34b90635776ae40849bd75fd135693b116fb Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:56:50 2024 +0100 Improve design commit d9a7370419ed9e288eccf263c2715330831e45e4 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:43:27 2024 +0100 Add exports commit b374b7bbccfa655dfad7695d7a24c5ddd4a07b66 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:41 2024 +0100 Remove presence on manager commit 404e759ae3d2f5e555ae20437204553bffdc5065 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:33 2024 +0100 Improve engagement report commit 39dbec6692c2d3f74a97647a703993d6152bfa06 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:39:59 2024 +0100 Add translation commit 354c2e30aece5bc7d800893ce8dee3868a1c1f71 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:18:53 2024 +0100 Change product tour behavior commit 5f253812282fb11011694b8828580d886f1f5899 Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:59:32 2024 +0100 WIP commit f411180433a05b89fc9d029e2b313968985e5c3f Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:32:30 2024 +0100 WIP commit 2b5989774eeb839f7b7b2a49377aca9fe4d68c09 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 19:31:27 2024 +0100 WIP commit c8750a667f131b68818859796670c3022c6d53fe Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 18:23:01 2024 +0100 WIP commit fdb9efecb5688423ed2c82cf445868040653d380 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 17:55:57 2024 +0100 WIP commit 5d12b12ce33eb5c1ba2a3307ef4ac679b279f511 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 16 21:22:12 2024 +0100 WIP commit 548b714fda61464517247910af7e3e1c2bdae8cf Author: Alex <dev@alexandrelion.com> Date: Fri Nov 15 15:34:00 2024 +0100 WIP commit f0c87f34ea2ac837b4b3b3d6fd51c32bd625371e Author: Alex <dev@alexandrelion.com> Date: Wed Nov 13 22:09:24 2024 +0100 WIP commit c0c8bf99a538653208e28300566cced3d444a764 Author: Alex <dev@alexandrelion.com> Date: Mon Nov 11 13:02:36 2024 +0100 WIP commit 245ea9b836c2e69c7269fc7d8c7fd2edd0032eed Author: Alex <dev@alexandrelion.com> Date: Sun Nov 10 19:07:36 2024 +0100 Add presenter commit 0cf50918d62a9ab5ea127698219e05f781c659bb Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 23:20:35 2024 +0100 Refactor reactions commit ef8ffefe56d5b19dd895be181437c461134176ab Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 22:21:13 2024 +0100 Add tests commit c4055142ed63d8ea1be921f527bcaf595a2b9268 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 11:28:00 2024 +0100 WIP commit 779e6970f7ee7ca89aab2bdfcff6197895b9ce5e Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 17:21:11 2024 +0100 WIP commit 9d25c440b830ded7e6fc2e0bcc9353520ec4a951 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 11:54:31 2024 +0100 WIP commit c0157487a9e20b6773e517553681915c12367851 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 17:13:04 2024 +0100 Fix condition commit a64439fbf2d852e127deb00a11906fb86b0c9ece Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 12:16:21 2024 +0100 WIP commit a994d959afe20ee380d42feb5ca6da2ab832d569 Author: Alex <dev@alexandrelion.com> Date: Wed Oct 30 23:06:24 2024 +0100 Fix changeset commit 5b2935fc33577af21ccc2558b49d9a813f4835f3 Merge: cec1a97 7476269 Author: Alex <dev@alexandrelion.com> Date: Sun Oct 20 11:26:51 2024 +0200 Merge branch 'dev' into feature/quizz commit cec1a97650867da3a09d8e23d0756a3a573e1bc8 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 22:52:00 2024 +0200 WIP commit f65854f638393ce80fd9d17642e8a90ee5c1a06e Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 16:55:42 2024 +0200 WIP commit 1e6429a386c56be6a8fdd2f083e273b50a6bc4c9 Merge: 1977959 6f8a2fd Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 13:49:22 2024 +0200 Merge branch 'dev' into feature/quizz # Conflicts: # lib/claper_web/live/event_live/manage.html.heex commit 1977959efb12b5fb2f1795a8547e501c02e62122 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 5 12:57:09 2024 +0200 WIP
2024-12-21 10:09:29 -05:00
@impl true
def handle_info({:quiz_updated, quiz}, socket) do
{:noreply,
socket
|> interactions_at_position(quiz.position)}
end
2024-07-11 12:53:47 +02:00
@impl true
def handle_info({:poll_deleted, poll}, socket) do
{:noreply,
socket
|> interactions_at_position(poll.position)}
end
@impl true
def handle_info({:embed_deleted, embed}, socket) do
{:noreply,
socket
|> interactions_at_position(embed.position)}
end
@impl true
def handle_info({:form_deleted, form}, socket) do
{:noreply,
socket
|> interactions_at_position(form.position)}
2023-11-23 16:36:39 +05:30
end
Add quizz feature + improvements commit 705ea00064e552f482bff52c3c5b11d23fbd5b4c Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:08:42 2024 -0500 Change version commit 330173bd64bb18c5ea7e68a2122f66497981c3c3 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:01:52 2024 -0500 Fix layout commit 3cc075962e961f8a78b0c30eca9b79db6b9a5731 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 19 14:20:59 2024 +0100 Update changelog commit 63b1fa7ee591d40e44005b7939f51c99cf3e119e Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:56:01 2024 +0100 Fix upper commit 8e7bb1990c58e343de5aa18036eb0916573fb4c6 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:49:20 2024 +0100 Add pagination for events commit 28beacd120f0a1081e670e4a06bbc185cc699beb Author: Alex Lion <dev@alexandrelion.com> Date: Mon Dec 9 21:03:13 2024 +0100 Add pagination commit c79d6cce947869b98795b9baf541a32952624969 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 21:24:23 2024 +0100 Fix tests commit caad25ad75b5937ca0906dca89dedaa4d58ae072 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 17:43:55 2024 +0100 Fix user registration bug commit 38c3eecc49d1397a8bb7a4a11203775396d00272 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:23:24 2024 +0100 Update changelog commit e648ef08a0f61cf4b554fcbf0a83e02a2249de0d Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:06:27 2024 +0100 Add obin commit 6925117818e117dbd60efea5ae6c81a26a57f76f Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 19:39:03 2024 +0100 WIP commit be9b2886d3b879452f5bae08b3cdd181cac254f8 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 16:19:09 2024 +0100 Add LTI AGS for quizzes commit 29a7c96de6d4e38b26dfaa61bfa5e689a16d4935 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 5 13:30:49 2024 +0100 Add translations commit 249fdc9188c7613a6adafb0b983303c1ae7601bd Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 21:37:27 2024 +0100 Add qti export commit c2d56e30cdb6c629e957c64e4393dfd9d5af7159 Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 20:44:58 2024 +0100 Fix report embed commit a34c239f9014e53b079106f1935bc2b079d01eed Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 11:32:32 2024 +0100 Add export quiz commit 8d1f34b90635776ae40849bd75fd135693b116fb Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:56:50 2024 +0100 Improve design commit d9a7370419ed9e288eccf263c2715330831e45e4 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:43:27 2024 +0100 Add exports commit b374b7bbccfa655dfad7695d7a24c5ddd4a07b66 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:41 2024 +0100 Remove presence on manager commit 404e759ae3d2f5e555ae20437204553bffdc5065 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:33 2024 +0100 Improve engagement report commit 39dbec6692c2d3f74a97647a703993d6152bfa06 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:39:59 2024 +0100 Add translation commit 354c2e30aece5bc7d800893ce8dee3868a1c1f71 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:18:53 2024 +0100 Change product tour behavior commit 5f253812282fb11011694b8828580d886f1f5899 Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:59:32 2024 +0100 WIP commit f411180433a05b89fc9d029e2b313968985e5c3f Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:32:30 2024 +0100 WIP commit 2b5989774eeb839f7b7b2a49377aca9fe4d68c09 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 19:31:27 2024 +0100 WIP commit c8750a667f131b68818859796670c3022c6d53fe Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 18:23:01 2024 +0100 WIP commit fdb9efecb5688423ed2c82cf445868040653d380 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 17:55:57 2024 +0100 WIP commit 5d12b12ce33eb5c1ba2a3307ef4ac679b279f511 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 16 21:22:12 2024 +0100 WIP commit 548b714fda61464517247910af7e3e1c2bdae8cf Author: Alex <dev@alexandrelion.com> Date: Fri Nov 15 15:34:00 2024 +0100 WIP commit f0c87f34ea2ac837b4b3b3d6fd51c32bd625371e Author: Alex <dev@alexandrelion.com> Date: Wed Nov 13 22:09:24 2024 +0100 WIP commit c0c8bf99a538653208e28300566cced3d444a764 Author: Alex <dev@alexandrelion.com> Date: Mon Nov 11 13:02:36 2024 +0100 WIP commit 245ea9b836c2e69c7269fc7d8c7fd2edd0032eed Author: Alex <dev@alexandrelion.com> Date: Sun Nov 10 19:07:36 2024 +0100 Add presenter commit 0cf50918d62a9ab5ea127698219e05f781c659bb Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 23:20:35 2024 +0100 Refactor reactions commit ef8ffefe56d5b19dd895be181437c461134176ab Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 22:21:13 2024 +0100 Add tests commit c4055142ed63d8ea1be921f527bcaf595a2b9268 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 11:28:00 2024 +0100 WIP commit 779e6970f7ee7ca89aab2bdfcff6197895b9ce5e Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 17:21:11 2024 +0100 WIP commit 9d25c440b830ded7e6fc2e0bcc9353520ec4a951 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 11:54:31 2024 +0100 WIP commit c0157487a9e20b6773e517553681915c12367851 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 17:13:04 2024 +0100 Fix condition commit a64439fbf2d852e127deb00a11906fb86b0c9ece Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 12:16:21 2024 +0100 WIP commit a994d959afe20ee380d42feb5ca6da2ab832d569 Author: Alex <dev@alexandrelion.com> Date: Wed Oct 30 23:06:24 2024 +0100 Fix changeset commit 5b2935fc33577af21ccc2558b49d9a813f4835f3 Merge: cec1a97 7476269 Author: Alex <dev@alexandrelion.com> Date: Sun Oct 20 11:26:51 2024 +0200 Merge branch 'dev' into feature/quizz commit cec1a97650867da3a09d8e23d0756a3a573e1bc8 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 22:52:00 2024 +0200 WIP commit f65854f638393ce80fd9d17642e8a90ee5c1a06e Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 16:55:42 2024 +0200 WIP commit 1e6429a386c56be6a8fdd2f083e273b50a6bc4c9 Merge: 1977959 6f8a2fd Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 13:49:22 2024 +0200 Merge branch 'dev' into feature/quizz # Conflicts: # lib/claper_web/live/event_live/manage.html.heex commit 1977959efb12b5fb2f1795a8547e501c02e62122 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 5 12:57:09 2024 +0200 WIP
2024-12-21 10:09:29 -05:00
@impl true
def handle_info({:quiz_deleted, quiz}, socket) do
{:noreply,
socket
|> interactions_at_position(quiz.position)}
end
2023-11-23 16:36:39 +05:30
@impl true
def handle_info(
2024-07-11 12:53:47 +02:00
{:current_interaction, interaction},
2023-11-23 16:36:39 +05:30
socket
) do
2024-07-11 12:53:47 +02:00
if socket.assigns.current_interaction != interaction do
position = if interaction, do: interaction.position, else: socket.assigns.state.position
{:noreply,
socket
|> assign(:current_interaction, interaction)
|> interactions_at_position(position)}
else
{:noreply, socket}
end
end
@impl true
def handle_info({:state_updated, state}, socket) do
if state.position != socket.assigns.state.position do
{:noreply, socket |> assign(:state, state) |> interactions_at_position(state.position)}
else
{:noreply, socket |> assign(:state, state)}
end
2023-11-23 16:36:39 +05:30
end
@impl true
def handle_info(_, socket) do
{:noreply, socket}
end
@impl true
def handle_event(
"current-page",
%{"page" => page},
%{assigns: %{state: state}} = socket
) do
page = String.to_integer(page)
{:ok, new_state} =
Claper.Presentations.update_presentation_state(
state,
%{
:position => page
}
)
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:page_changed, page}
)
{:noreply,
socket
|> assign(:state, new_state)
2024-07-11 12:53:47 +02:00
|> interactions_at_position(page)}
end
2023-11-23 16:36:39 +05:30
def handle_event("poll-set-active", %{"id" => id}, socket) do
2024-07-11 12:53:47 +02:00
with poll <- Polls.get_poll!(id), :ok <- Claper.Interactions.enable_interaction(poll) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:current_interaction, poll}
)
2023-11-23 16:36:39 +05:30
2024-07-11 12:53:47 +02:00
{:noreply,
socket
|> assign(:current_interaction, poll)
|> interactions_at_position(socket.assigns.state.position)}
end
end
2023-02-26 23:15:55 +01:00
2023-11-23 16:36:39 +05:30
def handle_event("form-set-active", %{"id" => id}, socket) do
2024-07-11 12:53:47 +02:00
with form <- Forms.get_form!(id), :ok <- Claper.Interactions.enable_interaction(form) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:current_interaction, form}
)
2023-11-23 16:36:39 +05:30
2024-07-11 12:53:47 +02:00
{:noreply,
socket
|> assign(:current_interaction, form)
|> interactions_at_position(socket.assigns.state.position)}
end
2023-11-23 16:36:39 +05:30
end
def handle_event("embed-set-active", %{"id" => id}, socket) do
2024-07-11 12:53:47 +02:00
with embed <- Embeds.get_embed!(id), :ok <- Claper.Interactions.enable_interaction(embed) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:current_interaction, embed}
)
2023-11-23 16:36:39 +05:30
2024-07-11 12:53:47 +02:00
{:noreply,
socket
|> assign(:current_interaction, embed)
|> interactions_at_position(socket.assigns.state.position)}
end
2023-11-23 16:36:39 +05:30
end
def handle_event("poll-set-inactive", %{"id" => id}, socket) do
2024-07-11 12:53:47 +02:00
with poll <- Polls.get_poll!(id), {:ok, _} <- Claper.Interactions.disable_interaction(poll) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:current_interaction, nil}
)
end
2023-11-23 16:36:39 +05:30
{:noreply,
socket
2024-07-11 12:53:47 +02:00
|> assign(:current_interaction, nil)
|> interactions_at_position(socket.assigns.state.position)}
2023-11-23 16:36:39 +05:30
end
def handle_event("form-set-inactive", %{"id" => id}, socket) do
2024-07-11 12:53:47 +02:00
with form <- Forms.get_form!(id), {:ok, _} <- Claper.Interactions.disable_interaction(form) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:current_interaction, nil}
)
end
2023-11-23 16:36:39 +05:30
{:noreply,
socket
2024-07-11 12:53:47 +02:00
|> assign(:current_interaction, nil)
|> interactions_at_position(socket.assigns.state.position)}
end
2023-11-23 16:36:39 +05:30
def handle_event("embed-set-inactive", %{"id" => id}, socket) do
2024-07-11 12:53:47 +02:00
with embed <- Embeds.get_embed!(id),
{:ok, _} <- Claper.Interactions.disable_interaction(embed) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:current_interaction, nil}
)
end
2023-11-23 16:36:39 +05:30
{:noreply,
socket
2024-07-11 12:53:47 +02:00
|> assign(:current_interaction, nil)
|> interactions_at_position(socket.assigns.state.position)}
2023-11-23 16:36:39 +05:30
end
Add quizz feature + improvements commit 705ea00064e552f482bff52c3c5b11d23fbd5b4c Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:08:42 2024 -0500 Change version commit 330173bd64bb18c5ea7e68a2122f66497981c3c3 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:01:52 2024 -0500 Fix layout commit 3cc075962e961f8a78b0c30eca9b79db6b9a5731 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 19 14:20:59 2024 +0100 Update changelog commit 63b1fa7ee591d40e44005b7939f51c99cf3e119e Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:56:01 2024 +0100 Fix upper commit 8e7bb1990c58e343de5aa18036eb0916573fb4c6 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:49:20 2024 +0100 Add pagination for events commit 28beacd120f0a1081e670e4a06bbc185cc699beb Author: Alex Lion <dev@alexandrelion.com> Date: Mon Dec 9 21:03:13 2024 +0100 Add pagination commit c79d6cce947869b98795b9baf541a32952624969 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 21:24:23 2024 +0100 Fix tests commit caad25ad75b5937ca0906dca89dedaa4d58ae072 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 17:43:55 2024 +0100 Fix user registration bug commit 38c3eecc49d1397a8bb7a4a11203775396d00272 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:23:24 2024 +0100 Update changelog commit e648ef08a0f61cf4b554fcbf0a83e02a2249de0d Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:06:27 2024 +0100 Add obin commit 6925117818e117dbd60efea5ae6c81a26a57f76f Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 19:39:03 2024 +0100 WIP commit be9b2886d3b879452f5bae08b3cdd181cac254f8 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 16:19:09 2024 +0100 Add LTI AGS for quizzes commit 29a7c96de6d4e38b26dfaa61bfa5e689a16d4935 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 5 13:30:49 2024 +0100 Add translations commit 249fdc9188c7613a6adafb0b983303c1ae7601bd Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 21:37:27 2024 +0100 Add qti export commit c2d56e30cdb6c629e957c64e4393dfd9d5af7159 Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 20:44:58 2024 +0100 Fix report embed commit a34c239f9014e53b079106f1935bc2b079d01eed Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 11:32:32 2024 +0100 Add export quiz commit 8d1f34b90635776ae40849bd75fd135693b116fb Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:56:50 2024 +0100 Improve design commit d9a7370419ed9e288eccf263c2715330831e45e4 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:43:27 2024 +0100 Add exports commit b374b7bbccfa655dfad7695d7a24c5ddd4a07b66 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:41 2024 +0100 Remove presence on manager commit 404e759ae3d2f5e555ae20437204553bffdc5065 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:33 2024 +0100 Improve engagement report commit 39dbec6692c2d3f74a97647a703993d6152bfa06 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:39:59 2024 +0100 Add translation commit 354c2e30aece5bc7d800893ce8dee3868a1c1f71 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:18:53 2024 +0100 Change product tour behavior commit 5f253812282fb11011694b8828580d886f1f5899 Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:59:32 2024 +0100 WIP commit f411180433a05b89fc9d029e2b313968985e5c3f Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:32:30 2024 +0100 WIP commit 2b5989774eeb839f7b7b2a49377aca9fe4d68c09 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 19:31:27 2024 +0100 WIP commit c8750a667f131b68818859796670c3022c6d53fe Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 18:23:01 2024 +0100 WIP commit fdb9efecb5688423ed2c82cf445868040653d380 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 17:55:57 2024 +0100 WIP commit 5d12b12ce33eb5c1ba2a3307ef4ac679b279f511 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 16 21:22:12 2024 +0100 WIP commit 548b714fda61464517247910af7e3e1c2bdae8cf Author: Alex <dev@alexandrelion.com> Date: Fri Nov 15 15:34:00 2024 +0100 WIP commit f0c87f34ea2ac837b4b3b3d6fd51c32bd625371e Author: Alex <dev@alexandrelion.com> Date: Wed Nov 13 22:09:24 2024 +0100 WIP commit c0c8bf99a538653208e28300566cced3d444a764 Author: Alex <dev@alexandrelion.com> Date: Mon Nov 11 13:02:36 2024 +0100 WIP commit 245ea9b836c2e69c7269fc7d8c7fd2edd0032eed Author: Alex <dev@alexandrelion.com> Date: Sun Nov 10 19:07:36 2024 +0100 Add presenter commit 0cf50918d62a9ab5ea127698219e05f781c659bb Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 23:20:35 2024 +0100 Refactor reactions commit ef8ffefe56d5b19dd895be181437c461134176ab Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 22:21:13 2024 +0100 Add tests commit c4055142ed63d8ea1be921f527bcaf595a2b9268 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 11:28:00 2024 +0100 WIP commit 779e6970f7ee7ca89aab2bdfcff6197895b9ce5e Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 17:21:11 2024 +0100 WIP commit 9d25c440b830ded7e6fc2e0bcc9353520ec4a951 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 11:54:31 2024 +0100 WIP commit c0157487a9e20b6773e517553681915c12367851 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 17:13:04 2024 +0100 Fix condition commit a64439fbf2d852e127deb00a11906fb86b0c9ece Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 12:16:21 2024 +0100 WIP commit a994d959afe20ee380d42feb5ca6da2ab832d569 Author: Alex <dev@alexandrelion.com> Date: Wed Oct 30 23:06:24 2024 +0100 Fix changeset commit 5b2935fc33577af21ccc2558b49d9a813f4835f3 Merge: cec1a97 7476269 Author: Alex <dev@alexandrelion.com> Date: Sun Oct 20 11:26:51 2024 +0200 Merge branch 'dev' into feature/quizz commit cec1a97650867da3a09d8e23d0756a3a573e1bc8 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 22:52:00 2024 +0200 WIP commit f65854f638393ce80fd9d17642e8a90ee5c1a06e Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 16:55:42 2024 +0200 WIP commit 1e6429a386c56be6a8fdd2f083e273b50a6bc4c9 Merge: 1977959 6f8a2fd Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 13:49:22 2024 +0200 Merge branch 'dev' into feature/quizz # Conflicts: # lib/claper_web/live/event_live/manage.html.heex commit 1977959efb12b5fb2f1795a8547e501c02e62122 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 5 12:57:09 2024 +0200 WIP
2024-12-21 10:09:29 -05:00
@impl true
def handle_event("quiz-set-active", %{"id" => id}, socket) do
with quiz <- Quizzes.get_quiz!(id, [:quiz_questions, quiz_questions: :quiz_question_opts]),
:ok <- Claper.Interactions.enable_interaction(quiz) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:current_interaction, quiz}
)
{:noreply,
socket
|> assign(:current_interaction, quiz)
|> interactions_at_position(socket.assigns.state.position)}
end
end
def handle_event("quiz-set-inactive", %{"id" => id}, socket) do
with quiz <- Quizzes.get_quiz!(id),
{:ok, _} <- Claper.Interactions.disable_interaction(quiz) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:current_interaction, nil}
)
end
{:noreply,
socket
|> assign(:current_interaction, nil)
|> interactions_at_position(socket.assigns.state.position)}
end
@impl true
def handle_event(
"ban",
%{"attendee-identifier" => attendee_identifier},
%{assigns: %{event: event}} = socket
) do
Claper.Posts.delete_all_posts(:attendee_identifier, attendee_identifier, event)
ban(attendee_identifier, socket)
end
2023-11-23 13:58:44 +01:00
@impl true
def handle_event("pin", %{"id" => id}, socket) do
post = Claper.Posts.get_post!(id, [:event])
pin(post, socket)
end
@impl true
def handle_event(
"ban",
%{"user-id" => user_id},
%{assigns: %{event: event}} = socket
) do
Claper.Posts.delete_all_posts(:user_id, user_id, event)
ban(String.to_integer(user_id), socket)
end
@impl true
def handle_event(
"checked",
%{"key" => "chat_visible", "value" => value},
%{assigns: %{state: state}} = socket
) do
{:ok, new_state} =
Claper.Presentations.update_presentation_state(
state,
%{
:chat_visible => value
}
)
{:noreply, socket |> assign(:state, new_state)}
end
@impl true
def handle_event(
"checked",
%{"key" => "poll_visible", "value" => value},
%{assigns: %{state: state}} = socket
) do
{:ok, new_state} =
Claper.Presentations.update_presentation_state(
state,
%{
:poll_visible => value
}
)
{:noreply, socket |> assign(:state, new_state)}
end
@impl true
def handle_event(
"checked",
%{"key" => "chat_enabled", "value" => value},
%{assigns: %{state: state}} = socket
) do
{:ok, new_state} =
Claper.Presentations.update_presentation_state(
state,
%{
:chat_enabled => value
}
)
{:noreply, socket |> assign(:state, new_state)}
end
@impl true
def handle_event(
"checked",
%{"key" => "anonymous_chat_enabled", "value" => value},
%{assigns: %{state: state}} = socket
) do
{:ok, new_state} =
Claper.Presentations.update_presentation_state(
state,
%{
:anonymous_chat_enabled => value
}
)
{:noreply, socket |> assign(:state, new_state)}
end
2024-04-06 11:48:47 +02:00
@impl true
def handle_event(
"checked",
%{"key" => "message_reaction_enabled", "value" => value},
%{assigns: %{state: state}} = socket
) do
{:ok, new_state} =
Claper.Presentations.update_presentation_state(
state,
%{
:message_reaction_enabled => value
}
)
{:noreply, socket |> assign(:state, new_state)}
end
2023-11-23 13:58:44 +01:00
@impl true
def handle_event(
"checked",
%{"key" => "show_only_pinned", "value" => value},
%{assigns: %{event: _event, state: state}} = socket
) do
{:ok, new_state} =
Claper.Presentations.update_presentation_state(
state,
%{
:show_only_pinned => value
}
)
{:noreply, socket |> assign(:state, new_state)}
end
@impl true
def handle_event(
"checked",
%{"key" => "show_attendee_count", "value" => value},
%{assigns: %{event: _event, state: state}} = socket
) do
{:ok, new_state} =
Claper.Presentations.update_presentation_state(
state,
%{
:show_attendee_count => value
}
)
{:noreply, socket |> assign(:state, new_state)}
end
@impl true
def handle_event(
"checked",
%{"key" => "join_screen_visible", "value" => value},
%{assigns: %{state: state}} = socket
) do
{:ok, new_state} =
Claper.Presentations.update_presentation_state(
state,
%{
:join_screen_visible => value
}
)
{:noreply, socket |> assign(:state, new_state)}
end
Add quizz feature + improvements commit 705ea00064e552f482bff52c3c5b11d23fbd5b4c Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:08:42 2024 -0500 Change version commit 330173bd64bb18c5ea7e68a2122f66497981c3c3 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:01:52 2024 -0500 Fix layout commit 3cc075962e961f8a78b0c30eca9b79db6b9a5731 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 19 14:20:59 2024 +0100 Update changelog commit 63b1fa7ee591d40e44005b7939f51c99cf3e119e Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:56:01 2024 +0100 Fix upper commit 8e7bb1990c58e343de5aa18036eb0916573fb4c6 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:49:20 2024 +0100 Add pagination for events commit 28beacd120f0a1081e670e4a06bbc185cc699beb Author: Alex Lion <dev@alexandrelion.com> Date: Mon Dec 9 21:03:13 2024 +0100 Add pagination commit c79d6cce947869b98795b9baf541a32952624969 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 21:24:23 2024 +0100 Fix tests commit caad25ad75b5937ca0906dca89dedaa4d58ae072 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 17:43:55 2024 +0100 Fix user registration bug commit 38c3eecc49d1397a8bb7a4a11203775396d00272 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:23:24 2024 +0100 Update changelog commit e648ef08a0f61cf4b554fcbf0a83e02a2249de0d Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:06:27 2024 +0100 Add obin commit 6925117818e117dbd60efea5ae6c81a26a57f76f Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 19:39:03 2024 +0100 WIP commit be9b2886d3b879452f5bae08b3cdd181cac254f8 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 16:19:09 2024 +0100 Add LTI AGS for quizzes commit 29a7c96de6d4e38b26dfaa61bfa5e689a16d4935 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 5 13:30:49 2024 +0100 Add translations commit 249fdc9188c7613a6adafb0b983303c1ae7601bd Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 21:37:27 2024 +0100 Add qti export commit c2d56e30cdb6c629e957c64e4393dfd9d5af7159 Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 20:44:58 2024 +0100 Fix report embed commit a34c239f9014e53b079106f1935bc2b079d01eed Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 11:32:32 2024 +0100 Add export quiz commit 8d1f34b90635776ae40849bd75fd135693b116fb Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:56:50 2024 +0100 Improve design commit d9a7370419ed9e288eccf263c2715330831e45e4 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:43:27 2024 +0100 Add exports commit b374b7bbccfa655dfad7695d7a24c5ddd4a07b66 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:41 2024 +0100 Remove presence on manager commit 404e759ae3d2f5e555ae20437204553bffdc5065 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:33 2024 +0100 Improve engagement report commit 39dbec6692c2d3f74a97647a703993d6152bfa06 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:39:59 2024 +0100 Add translation commit 354c2e30aece5bc7d800893ce8dee3868a1c1f71 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:18:53 2024 +0100 Change product tour behavior commit 5f253812282fb11011694b8828580d886f1f5899 Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:59:32 2024 +0100 WIP commit f411180433a05b89fc9d029e2b313968985e5c3f Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:32:30 2024 +0100 WIP commit 2b5989774eeb839f7b7b2a49377aca9fe4d68c09 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 19:31:27 2024 +0100 WIP commit c8750a667f131b68818859796670c3022c6d53fe Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 18:23:01 2024 +0100 WIP commit fdb9efecb5688423ed2c82cf445868040653d380 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 17:55:57 2024 +0100 WIP commit 5d12b12ce33eb5c1ba2a3307ef4ac679b279f511 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 16 21:22:12 2024 +0100 WIP commit 548b714fda61464517247910af7e3e1c2bdae8cf Author: Alex <dev@alexandrelion.com> Date: Fri Nov 15 15:34:00 2024 +0100 WIP commit f0c87f34ea2ac837b4b3b3d6fd51c32bd625371e Author: Alex <dev@alexandrelion.com> Date: Wed Nov 13 22:09:24 2024 +0100 WIP commit c0c8bf99a538653208e28300566cced3d444a764 Author: Alex <dev@alexandrelion.com> Date: Mon Nov 11 13:02:36 2024 +0100 WIP commit 245ea9b836c2e69c7269fc7d8c7fd2edd0032eed Author: Alex <dev@alexandrelion.com> Date: Sun Nov 10 19:07:36 2024 +0100 Add presenter commit 0cf50918d62a9ab5ea127698219e05f781c659bb Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 23:20:35 2024 +0100 Refactor reactions commit ef8ffefe56d5b19dd895be181437c461134176ab Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 22:21:13 2024 +0100 Add tests commit c4055142ed63d8ea1be921f527bcaf595a2b9268 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 11:28:00 2024 +0100 WIP commit 779e6970f7ee7ca89aab2bdfcff6197895b9ce5e Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 17:21:11 2024 +0100 WIP commit 9d25c440b830ded7e6fc2e0bcc9353520ec4a951 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 11:54:31 2024 +0100 WIP commit c0157487a9e20b6773e517553681915c12367851 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 17:13:04 2024 +0100 Fix condition commit a64439fbf2d852e127deb00a11906fb86b0c9ece Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 12:16:21 2024 +0100 WIP commit a994d959afe20ee380d42feb5ca6da2ab832d569 Author: Alex <dev@alexandrelion.com> Date: Wed Oct 30 23:06:24 2024 +0100 Fix changeset commit 5b2935fc33577af21ccc2558b49d9a813f4835f3 Merge: cec1a97 7476269 Author: Alex <dev@alexandrelion.com> Date: Sun Oct 20 11:26:51 2024 +0200 Merge branch 'dev' into feature/quizz commit cec1a97650867da3a09d8e23d0756a3a573e1bc8 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 22:52:00 2024 +0200 WIP commit f65854f638393ce80fd9d17642e8a90ee5c1a06e Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 16:55:42 2024 +0200 WIP commit 1e6429a386c56be6a8fdd2f083e273b50a6bc4c9 Merge: 1977959 6f8a2fd Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 13:49:22 2024 +0200 Merge branch 'dev' into feature/quizz # Conflicts: # lib/claper_web/live/event_live/manage.html.heex commit 1977959efb12b5fb2f1795a8547e501c02e62122 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 5 12:57:09 2024 +0200 WIP
2024-12-21 10:09:29 -05:00
@impl true
def handle_event(
"checked",
%{"key" => "quiz_show_results", "value" => value},
%{assigns: %{current_interaction: interaction}} = socket
) do
{:ok, new_interaction} =
Claper.Quizzes.update_quiz(
socket.assigns.event.uuid,
interaction,
%{
:show_results => value
}
)
{:noreply, socket |> assign(:current_interaction, new_interaction)}
end
@impl true
def handle_event("checked", %{"key" => "review_quiz_questions"}, socket) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:review_quiz_questions}
)
{:noreply, socket}
end
@impl true
def handle_event("checked", %{"key" => "next_quiz_question"}, socket) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:next_quiz_question}
)
{:noreply, socket}
end
@impl true
def handle_event("checked", %{"key" => "prev_quiz_question"}, socket) do
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{socket.assigns.event.uuid}",
{:prev_quiz_question}
)
{:noreply, socket}
end
@impl true
2023-11-23 13:58:44 +01:00
def handle_event("delete", %{"id" => id}, socket) do
post = Claper.Posts.get_post!(id, [:event])
{:ok, _} = Claper.Posts.delete_post(post)
2023-11-23 13:58:44 +01:00
updated_socket =
if post.pinned do
2024-04-06 11:48:47 +02:00
stream(socket, :pinned_posts, list_pinned_posts(socket, socket.assigns.event.uuid),
reset: true
)
stream(socket, :posts, list_all_posts(socket, socket.assigns.event.uuid), reset: true)
2023-11-23 13:58:44 +01:00
else
2024-04-06 11:48:47 +02:00
stream(socket, :posts, list_all_posts(socket, socket.assigns.event.uuid), reset: true)
2023-11-23 13:58:44 +01:00
end
{:noreply, updated_socket}
end
2024-04-13 12:54:05 +02:00
@impl true
def handle_event("sort-questions", %{"sort" => sort}, socket) do
{:noreply,
socket
|> assign(:sort_questions_by, sort)
|> stream(:questions, list_all_questions(socket, socket.assigns.event.uuid, sort),
reset: true
)}
end
@impl true
def handle_event("delete-form-submit", %{"event-id" => event_id, "id" => id}, socket) do
form = Claper.Forms.get_form_submit_by_id!(id)
{:ok, _} = Claper.Forms.delete_form_submit(event_id, form)
2023-02-26 23:15:55 +01:00
{:noreply,
assign(
socket,
:form_submits,
list_form_submits(socket, socket.assigns.event.presentation_file.id)
)}
end
@impl true
def handle_event("list-tab", %{"tab" => tab}, socket) do
socket = assign(socket, :list_tab, String.to_atom(tab))
2023-02-26 23:15:55 +01:00
socket =
case tab do
"posts" ->
2023-11-23 13:58:44 +01:00
socket
2024-04-13 12:54:05 +02:00
|> stream(:posts, list_all_posts(socket, socket.assigns.event.uuid), reset: true)
"questions" ->
socket
|> stream(:questions, list_all_questions(socket, socket.assigns.event.uuid),
2024-04-06 11:48:47 +02:00
reset: true
)
2023-02-26 23:15:55 +01:00
"forms" ->
2024-04-06 11:48:47 +02:00
stream(
2023-02-26 23:15:55 +01:00
socket,
:form_submits,
2024-04-06 11:48:47 +02:00
list_form_submits(socket, socket.assigns.event.presentation_file.id),
reset: true
2023-02-26 23:15:55 +01:00
)
2023-11-23 13:58:44 +01:00
"pinned_posts" ->
socket
2024-04-06 11:48:47 +02:00
|> stream(:pinned_posts, list_pinned_posts(socket, socket.assigns.event.uuid),
reset: true
)
2023-02-26 23:15:55 +01:00
end
{:noreply, socket}
end
@impl true
def handle_event("maybe-redirect", _params, socket) do
if socket.assigns.create != nil do
{:noreply,
socket
2024-04-07 10:27:12 +02:00
|> push_navigate(to: ~p"/e/#{socket.assigns.event.code}/manage")}
else
{:noreply, socket}
end
end
@impl true
def handle_event("delete-poll", %{"id" => id}, socket) do
poll = Polls.get_poll!(id)
{:ok, _} = Polls.delete_poll(socket.assigns.event.uuid, poll)
2024-07-11 12:53:47 +02:00
{:noreply, socket}
end
Add quizz feature + improvements commit 705ea00064e552f482bff52c3c5b11d23fbd5b4c Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:08:42 2024 -0500 Change version commit 330173bd64bb18c5ea7e68a2122f66497981c3c3 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:01:52 2024 -0500 Fix layout commit 3cc075962e961f8a78b0c30eca9b79db6b9a5731 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 19 14:20:59 2024 +0100 Update changelog commit 63b1fa7ee591d40e44005b7939f51c99cf3e119e Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:56:01 2024 +0100 Fix upper commit 8e7bb1990c58e343de5aa18036eb0916573fb4c6 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:49:20 2024 +0100 Add pagination for events commit 28beacd120f0a1081e670e4a06bbc185cc699beb Author: Alex Lion <dev@alexandrelion.com> Date: Mon Dec 9 21:03:13 2024 +0100 Add pagination commit c79d6cce947869b98795b9baf541a32952624969 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 21:24:23 2024 +0100 Fix tests commit caad25ad75b5937ca0906dca89dedaa4d58ae072 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 17:43:55 2024 +0100 Fix user registration bug commit 38c3eecc49d1397a8bb7a4a11203775396d00272 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:23:24 2024 +0100 Update changelog commit e648ef08a0f61cf4b554fcbf0a83e02a2249de0d Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:06:27 2024 +0100 Add obin commit 6925117818e117dbd60efea5ae6c81a26a57f76f Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 19:39:03 2024 +0100 WIP commit be9b2886d3b879452f5bae08b3cdd181cac254f8 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 16:19:09 2024 +0100 Add LTI AGS for quizzes commit 29a7c96de6d4e38b26dfaa61bfa5e689a16d4935 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 5 13:30:49 2024 +0100 Add translations commit 249fdc9188c7613a6adafb0b983303c1ae7601bd Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 21:37:27 2024 +0100 Add qti export commit c2d56e30cdb6c629e957c64e4393dfd9d5af7159 Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 20:44:58 2024 +0100 Fix report embed commit a34c239f9014e53b079106f1935bc2b079d01eed Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 11:32:32 2024 +0100 Add export quiz commit 8d1f34b90635776ae40849bd75fd135693b116fb Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:56:50 2024 +0100 Improve design commit d9a7370419ed9e288eccf263c2715330831e45e4 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:43:27 2024 +0100 Add exports commit b374b7bbccfa655dfad7695d7a24c5ddd4a07b66 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:41 2024 +0100 Remove presence on manager commit 404e759ae3d2f5e555ae20437204553bffdc5065 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:33 2024 +0100 Improve engagement report commit 39dbec6692c2d3f74a97647a703993d6152bfa06 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:39:59 2024 +0100 Add translation commit 354c2e30aece5bc7d800893ce8dee3868a1c1f71 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:18:53 2024 +0100 Change product tour behavior commit 5f253812282fb11011694b8828580d886f1f5899 Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:59:32 2024 +0100 WIP commit f411180433a05b89fc9d029e2b313968985e5c3f Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:32:30 2024 +0100 WIP commit 2b5989774eeb839f7b7b2a49377aca9fe4d68c09 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 19:31:27 2024 +0100 WIP commit c8750a667f131b68818859796670c3022c6d53fe Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 18:23:01 2024 +0100 WIP commit fdb9efecb5688423ed2c82cf445868040653d380 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 17:55:57 2024 +0100 WIP commit 5d12b12ce33eb5c1ba2a3307ef4ac679b279f511 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 16 21:22:12 2024 +0100 WIP commit 548b714fda61464517247910af7e3e1c2bdae8cf Author: Alex <dev@alexandrelion.com> Date: Fri Nov 15 15:34:00 2024 +0100 WIP commit f0c87f34ea2ac837b4b3b3d6fd51c32bd625371e Author: Alex <dev@alexandrelion.com> Date: Wed Nov 13 22:09:24 2024 +0100 WIP commit c0c8bf99a538653208e28300566cced3d444a764 Author: Alex <dev@alexandrelion.com> Date: Mon Nov 11 13:02:36 2024 +0100 WIP commit 245ea9b836c2e69c7269fc7d8c7fd2edd0032eed Author: Alex <dev@alexandrelion.com> Date: Sun Nov 10 19:07:36 2024 +0100 Add presenter commit 0cf50918d62a9ab5ea127698219e05f781c659bb Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 23:20:35 2024 +0100 Refactor reactions commit ef8ffefe56d5b19dd895be181437c461134176ab Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 22:21:13 2024 +0100 Add tests commit c4055142ed63d8ea1be921f527bcaf595a2b9268 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 11:28:00 2024 +0100 WIP commit 779e6970f7ee7ca89aab2bdfcff6197895b9ce5e Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 17:21:11 2024 +0100 WIP commit 9d25c440b830ded7e6fc2e0bcc9353520ec4a951 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 11:54:31 2024 +0100 WIP commit c0157487a9e20b6773e517553681915c12367851 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 17:13:04 2024 +0100 Fix condition commit a64439fbf2d852e127deb00a11906fb86b0c9ece Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 12:16:21 2024 +0100 WIP commit a994d959afe20ee380d42feb5ca6da2ab832d569 Author: Alex <dev@alexandrelion.com> Date: Wed Oct 30 23:06:24 2024 +0100 Fix changeset commit 5b2935fc33577af21ccc2558b49d9a813f4835f3 Merge: cec1a97 7476269 Author: Alex <dev@alexandrelion.com> Date: Sun Oct 20 11:26:51 2024 +0200 Merge branch 'dev' into feature/quizz commit cec1a97650867da3a09d8e23d0756a3a573e1bc8 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 22:52:00 2024 +0200 WIP commit f65854f638393ce80fd9d17642e8a90ee5c1a06e Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 16:55:42 2024 +0200 WIP commit 1e6429a386c56be6a8fdd2f083e273b50a6bc4c9 Merge: 1977959 6f8a2fd Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 13:49:22 2024 +0200 Merge branch 'dev' into feature/quizz # Conflicts: # lib/claper_web/live/event_live/manage.html.heex commit 1977959efb12b5fb2f1795a8547e501c02e62122 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 5 12:57:09 2024 +0200 WIP
2024-12-21 10:09:29 -05:00
@impl true
def handle_event("delete-quiz", %{"id" => id}, socket) do
quiz = Quizzes.get_quiz!(id)
{:ok, _} = Quizzes.delete_quiz(socket.assigns.event.uuid, quiz)
{:noreply, socket}
end
2024-07-11 12:53:47 +02:00
@impl true
def handle_event("toggle-preview", _params, %{assigns: %{preview: preview}} = socket) do
{:noreply, socket |> assign(:preview, !preview)}
end
@impl true
def handle_event(
"toggle-interaction-modal",
_params,
%{assigns: %{interaction_modal: _interaction_modal = true}} = socket
) do
{:noreply, socket |> push_navigate(to: ~p"/e/#{socket.assigns.event.code}/manage")}
end
@impl true
def handle_event(
"toggle-interaction-modal",
_params,
%{assigns: %{interaction_modal: _interaction_modal}} = socket
) do
{:noreply, socket |> assign(:interaction_modal, true)}
end
@impl true
def handle_params(params, _url, socket) do
{:noreply, apply_action(socket, socket.assigns.live_action, params)}
end
2024-04-16 22:36:50 +02:00
def toggle_settings_modal(js \\ %JS{}) do
js
|> JS.toggle(
to: "#settings-modal",
out: "animate__animated animate__fadeOut",
in: "animate__animated animate__fadeIn"
)
end
defp apply_action(socket, :show, _params) do
socket
end
defp apply_action(socket, :add_poll, _params) do
socket
|> assign(:create, "poll")
|> assign(:poll, %Polls.Poll{
2024-10-19 13:48:08 +02:00
poll_opts: [%Polls.PollOpt{content: gettext("Yes")}, %Polls.PollOpt{content: gettext("No")}]
})
end
defp apply_action(socket, :edit_poll, %{"id" => id}) do
poll = Polls.get_poll!(id)
socket
|> assign(:create, "poll")
|> assign(:interaction_modal, true)
|> assign(:create_action, :edit)
|> assign(:poll, poll)
end
defp apply_action(socket, :add_form, _params) do
socket
|> assign(:create, "form")
|> assign(:form, %Forms.Form{
2023-02-26 23:15:55 +01:00
fields: [
%Forms.Field{name: gettext("Name"), type: "text"},
%Forms.Field{name: gettext("Email"), type: "email"}
]
})
end
2023-11-23 16:36:39 +05:30
defp apply_action(socket, :add_embed, _params) do
socket
|> assign(:create, "embed")
|> assign(:embed, %Embeds.Embed{})
end
defp apply_action(socket, :import, _params) do
socket
|> assign(:create, "import")
|> assign(:events, Claper.Events.list_events(socket.assigns.current_user.id))
end
defp apply_action(socket, :edit_form, %{"id" => id}) do
form = Forms.get_form!(id)
socket
|> assign(:create, "form")
|> assign(:interaction_modal, true)
|> assign(:create_action, :edit)
|> assign(:form, form)
end
2023-11-23 16:36:39 +05:30
defp apply_action(socket, :edit_embed, %{"id" => id}) do
embed = Embeds.get_embed!(id)
socket
|> assign(:create, "embed")
|> assign(:interaction_modal, true)
2023-11-23 16:36:39 +05:30
|> assign(:create_action, :edit)
|> assign(:embed, embed)
end
Add quizz feature + improvements commit 705ea00064e552f482bff52c3c5b11d23fbd5b4c Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:08:42 2024 -0500 Change version commit 330173bd64bb18c5ea7e68a2122f66497981c3c3 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:01:52 2024 -0500 Fix layout commit 3cc075962e961f8a78b0c30eca9b79db6b9a5731 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 19 14:20:59 2024 +0100 Update changelog commit 63b1fa7ee591d40e44005b7939f51c99cf3e119e Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:56:01 2024 +0100 Fix upper commit 8e7bb1990c58e343de5aa18036eb0916573fb4c6 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:49:20 2024 +0100 Add pagination for events commit 28beacd120f0a1081e670e4a06bbc185cc699beb Author: Alex Lion <dev@alexandrelion.com> Date: Mon Dec 9 21:03:13 2024 +0100 Add pagination commit c79d6cce947869b98795b9baf541a32952624969 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 21:24:23 2024 +0100 Fix tests commit caad25ad75b5937ca0906dca89dedaa4d58ae072 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 17:43:55 2024 +0100 Fix user registration bug commit 38c3eecc49d1397a8bb7a4a11203775396d00272 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:23:24 2024 +0100 Update changelog commit e648ef08a0f61cf4b554fcbf0a83e02a2249de0d Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:06:27 2024 +0100 Add obin commit 6925117818e117dbd60efea5ae6c81a26a57f76f Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 19:39:03 2024 +0100 WIP commit be9b2886d3b879452f5bae08b3cdd181cac254f8 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 16:19:09 2024 +0100 Add LTI AGS for quizzes commit 29a7c96de6d4e38b26dfaa61bfa5e689a16d4935 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 5 13:30:49 2024 +0100 Add translations commit 249fdc9188c7613a6adafb0b983303c1ae7601bd Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 21:37:27 2024 +0100 Add qti export commit c2d56e30cdb6c629e957c64e4393dfd9d5af7159 Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 20:44:58 2024 +0100 Fix report embed commit a34c239f9014e53b079106f1935bc2b079d01eed Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 11:32:32 2024 +0100 Add export quiz commit 8d1f34b90635776ae40849bd75fd135693b116fb Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:56:50 2024 +0100 Improve design commit d9a7370419ed9e288eccf263c2715330831e45e4 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:43:27 2024 +0100 Add exports commit b374b7bbccfa655dfad7695d7a24c5ddd4a07b66 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:41 2024 +0100 Remove presence on manager commit 404e759ae3d2f5e555ae20437204553bffdc5065 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:33 2024 +0100 Improve engagement report commit 39dbec6692c2d3f74a97647a703993d6152bfa06 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:39:59 2024 +0100 Add translation commit 354c2e30aece5bc7d800893ce8dee3868a1c1f71 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:18:53 2024 +0100 Change product tour behavior commit 5f253812282fb11011694b8828580d886f1f5899 Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:59:32 2024 +0100 WIP commit f411180433a05b89fc9d029e2b313968985e5c3f Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:32:30 2024 +0100 WIP commit 2b5989774eeb839f7b7b2a49377aca9fe4d68c09 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 19:31:27 2024 +0100 WIP commit c8750a667f131b68818859796670c3022c6d53fe Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 18:23:01 2024 +0100 WIP commit fdb9efecb5688423ed2c82cf445868040653d380 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 17:55:57 2024 +0100 WIP commit 5d12b12ce33eb5c1ba2a3307ef4ac679b279f511 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 16 21:22:12 2024 +0100 WIP commit 548b714fda61464517247910af7e3e1c2bdae8cf Author: Alex <dev@alexandrelion.com> Date: Fri Nov 15 15:34:00 2024 +0100 WIP commit f0c87f34ea2ac837b4b3b3d6fd51c32bd625371e Author: Alex <dev@alexandrelion.com> Date: Wed Nov 13 22:09:24 2024 +0100 WIP commit c0c8bf99a538653208e28300566cced3d444a764 Author: Alex <dev@alexandrelion.com> Date: Mon Nov 11 13:02:36 2024 +0100 WIP commit 245ea9b836c2e69c7269fc7d8c7fd2edd0032eed Author: Alex <dev@alexandrelion.com> Date: Sun Nov 10 19:07:36 2024 +0100 Add presenter commit 0cf50918d62a9ab5ea127698219e05f781c659bb Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 23:20:35 2024 +0100 Refactor reactions commit ef8ffefe56d5b19dd895be181437c461134176ab Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 22:21:13 2024 +0100 Add tests commit c4055142ed63d8ea1be921f527bcaf595a2b9268 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 11:28:00 2024 +0100 WIP commit 779e6970f7ee7ca89aab2bdfcff6197895b9ce5e Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 17:21:11 2024 +0100 WIP commit 9d25c440b830ded7e6fc2e0bcc9353520ec4a951 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 11:54:31 2024 +0100 WIP commit c0157487a9e20b6773e517553681915c12367851 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 17:13:04 2024 +0100 Fix condition commit a64439fbf2d852e127deb00a11906fb86b0c9ece Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 12:16:21 2024 +0100 WIP commit a994d959afe20ee380d42feb5ca6da2ab832d569 Author: Alex <dev@alexandrelion.com> Date: Wed Oct 30 23:06:24 2024 +0100 Fix changeset commit 5b2935fc33577af21ccc2558b49d9a813f4835f3 Merge: cec1a97 7476269 Author: Alex <dev@alexandrelion.com> Date: Sun Oct 20 11:26:51 2024 +0200 Merge branch 'dev' into feature/quizz commit cec1a97650867da3a09d8e23d0756a3a573e1bc8 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 22:52:00 2024 +0200 WIP commit f65854f638393ce80fd9d17642e8a90ee5c1a06e Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 16:55:42 2024 +0200 WIP commit 1e6429a386c56be6a8fdd2f083e273b50a6bc4c9 Merge: 1977959 6f8a2fd Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 13:49:22 2024 +0200 Merge branch 'dev' into feature/quizz # Conflicts: # lib/claper_web/live/event_live/manage.html.heex commit 1977959efb12b5fb2f1795a8547e501c02e62122 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 5 12:57:09 2024 +0200 WIP
2024-12-21 10:09:29 -05:00
defp apply_action(socket, :add_quiz, _params) do
socket
|> assign(:create, "quiz")
|> assign(:quiz, %Quizzes.Quiz{
presentation_file_id: socket.assigns.event.presentation_file.id,
quiz_questions: [
%Quizzes.QuizQuestion{
id: 0,
quiz_question_opts: [
%Quizzes.QuizQuestionOpt{
id: 0
},
%Quizzes.QuizQuestionOpt{
id: 1
}
]
}
]
})
end
defp apply_action(socket, :edit_quiz, %{"id" => id}) do
quiz = Quizzes.get_quiz!(id, [:quiz_questions, quiz_questions: :quiz_question_opts])
socket
|> assign(:create, "quiz")
|> assign(:interaction_modal, true)
Add quizz feature + improvements commit 705ea00064e552f482bff52c3c5b11d23fbd5b4c Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:08:42 2024 -0500 Change version commit 330173bd64bb18c5ea7e68a2122f66497981c3c3 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 21 10:01:52 2024 -0500 Fix layout commit 3cc075962e961f8a78b0c30eca9b79db6b9a5731 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 19 14:20:59 2024 +0100 Update changelog commit 63b1fa7ee591d40e44005b7939f51c99cf3e119e Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:56:01 2024 +0100 Fix upper commit 8e7bb1990c58e343de5aa18036eb0916573fb4c6 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 15 18:49:20 2024 +0100 Add pagination for events commit 28beacd120f0a1081e670e4a06bbc185cc699beb Author: Alex Lion <dev@alexandrelion.com> Date: Mon Dec 9 21:03:13 2024 +0100 Add pagination commit c79d6cce947869b98795b9baf541a32952624969 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 21:24:23 2024 +0100 Fix tests commit caad25ad75b5937ca0906dca89dedaa4d58ae072 Author: Alex Lion <dev@alexandrelion.com> Date: Sun Dec 8 17:43:55 2024 +0100 Fix user registration bug commit 38c3eecc49d1397a8bb7a4a11203775396d00272 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:23:24 2024 +0100 Update changelog commit e648ef08a0f61cf4b554fcbf0a83e02a2249de0d Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 22:06:27 2024 +0100 Add obin commit 6925117818e117dbd60efea5ae6c81a26a57f76f Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 19:39:03 2024 +0100 WIP commit be9b2886d3b879452f5bae08b3cdd181cac254f8 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Dec 7 16:19:09 2024 +0100 Add LTI AGS for quizzes commit 29a7c96de6d4e38b26dfaa61bfa5e689a16d4935 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Dec 5 13:30:49 2024 +0100 Add translations commit 249fdc9188c7613a6adafb0b983303c1ae7601bd Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 21:37:27 2024 +0100 Add qti export commit c2d56e30cdb6c629e957c64e4393dfd9d5af7159 Author: Alex Lion <dev@alexandrelion.com> Date: Tue Dec 3 20:44:58 2024 +0100 Fix report embed commit a34c239f9014e53b079106f1935bc2b079d01eed Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 11:32:32 2024 +0100 Add export quiz commit 8d1f34b90635776ae40849bd75fd135693b116fb Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:56:50 2024 +0100 Improve design commit d9a7370419ed9e288eccf263c2715330831e45e4 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 30 00:43:27 2024 +0100 Add exports commit b374b7bbccfa655dfad7695d7a24c5ddd4a07b66 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:41 2024 +0100 Remove presence on manager commit 404e759ae3d2f5e555ae20437204553bffdc5065 Author: Alex Lion <dev@alexandrelion.com> Date: Thu Nov 28 15:22:33 2024 +0100 Improve engagement report commit 39dbec6692c2d3f74a97647a703993d6152bfa06 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:39:59 2024 +0100 Add translation commit 354c2e30aece5bc7d800893ce8dee3868a1c1f71 Author: Alex Lion <dev@alexandrelion.com> Date: Sat Nov 23 15:18:53 2024 +0100 Change product tour behavior commit 5f253812282fb11011694b8828580d886f1f5899 Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:59:32 2024 +0100 WIP commit f411180433a05b89fc9d029e2b313968985e5c3f Author: Alex <dev@alexandrelion.com> Date: Tue Nov 19 19:32:30 2024 +0100 WIP commit 2b5989774eeb839f7b7b2a49377aca9fe4d68c09 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 19:31:27 2024 +0100 WIP commit c8750a667f131b68818859796670c3022c6d53fe Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 18:23:01 2024 +0100 WIP commit fdb9efecb5688423ed2c82cf445868040653d380 Author: Alex <dev@alexandrelion.com> Date: Sun Nov 17 17:55:57 2024 +0100 WIP commit 5d12b12ce33eb5c1ba2a3307ef4ac679b279f511 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 16 21:22:12 2024 +0100 WIP commit 548b714fda61464517247910af7e3e1c2bdae8cf Author: Alex <dev@alexandrelion.com> Date: Fri Nov 15 15:34:00 2024 +0100 WIP commit f0c87f34ea2ac837b4b3b3d6fd51c32bd625371e Author: Alex <dev@alexandrelion.com> Date: Wed Nov 13 22:09:24 2024 +0100 WIP commit c0c8bf99a538653208e28300566cced3d444a764 Author: Alex <dev@alexandrelion.com> Date: Mon Nov 11 13:02:36 2024 +0100 WIP commit 245ea9b836c2e69c7269fc7d8c7fd2edd0032eed Author: Alex <dev@alexandrelion.com> Date: Sun Nov 10 19:07:36 2024 +0100 Add presenter commit 0cf50918d62a9ab5ea127698219e05f781c659bb Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 23:20:35 2024 +0100 Refactor reactions commit ef8ffefe56d5b19dd895be181437c461134176ab Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 22:21:13 2024 +0100 Add tests commit c4055142ed63d8ea1be921f527bcaf595a2b9268 Author: Alex <dev@alexandrelion.com> Date: Sat Nov 9 11:28:00 2024 +0100 WIP commit 779e6970f7ee7ca89aab2bdfcff6197895b9ce5e Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 17:21:11 2024 +0100 WIP commit 9d25c440b830ded7e6fc2e0bcc9353520ec4a951 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 8 11:54:31 2024 +0100 WIP commit c0157487a9e20b6773e517553681915c12367851 Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 17:13:04 2024 +0100 Fix condition commit a64439fbf2d852e127deb00a11906fb86b0c9ece Author: Alex <dev@alexandrelion.com> Date: Fri Nov 1 12:16:21 2024 +0100 WIP commit a994d959afe20ee380d42feb5ca6da2ab832d569 Author: Alex <dev@alexandrelion.com> Date: Wed Oct 30 23:06:24 2024 +0100 Fix changeset commit 5b2935fc33577af21ccc2558b49d9a813f4835f3 Merge: cec1a97 7476269 Author: Alex <dev@alexandrelion.com> Date: Sun Oct 20 11:26:51 2024 +0200 Merge branch 'dev' into feature/quizz commit cec1a97650867da3a09d8e23d0756a3a573e1bc8 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 22:52:00 2024 +0200 WIP commit f65854f638393ce80fd9d17642e8a90ee5c1a06e Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 16:55:42 2024 +0200 WIP commit 1e6429a386c56be6a8fdd2f083e273b50a6bc4c9 Merge: 1977959 6f8a2fd Author: Alex <dev@alexandrelion.com> Date: Sat Oct 19 13:49:22 2024 +0200 Merge branch 'dev' into feature/quizz # Conflicts: # lib/claper_web/live/event_live/manage.html.heex commit 1977959efb12b5fb2f1795a8547e501c02e62122 Author: Alex <dev@alexandrelion.com> Date: Sat Oct 5 12:57:09 2024 +0200 WIP
2024-12-21 10:09:29 -05:00
|> assign(:create_action, :edit)
|> assign(:quiz, quiz)
end
2023-11-23 13:58:44 +01:00
defp pin(post, socket) do
{:ok, _updated_post} = Claper.Posts.toggle_pin_post(post)
2023-11-24 23:03:08 +01:00
{:noreply, socket}
2023-11-23 13:58:44 +01:00
end
2023-11-23 14:15:19 +01:00
defp ban(user, %{assigns: %{event: event, state: state}} = socket) do
{:ok, new_state} =
Claper.Presentations.update_presentation_state(state, %{
"banned" => state.banned ++ ["#{user}"]
})
Phoenix.PubSub.broadcast(
Claper.PubSub,
"event:#{event.uuid}",
{:banned, user}
)
{:noreply, socket |> assign(:state, new_state)}
end
2024-07-11 12:53:47 +02:00
defp interactions_at_position(
%{assigns: %{event: event}} = socket,
position,
broadcast \\ false
) do
with {:ok, interactions} <-
Claper.Interactions.get_interactions_at_position(event, position, broadcast) do
active = interactions |> Enum.find(& &1.enabled)
socket |> assign(:interactions, interactions) |> assign(:current_interaction, active)
end
end
2023-11-23 13:58:44 +01:00
defp list_pinned_posts(_socket, event_id) do
Claper.Posts.list_pinned_posts(event_id, [:event, :reactions])
end
defp list_all_posts(_socket, event_id) do
Claper.Posts.list_posts(event_id, [:event, :reactions])
end
2024-04-13 12:54:05 +02:00
defp list_all_questions(_socket, event_id, sort \\ "date") do
Claper.Posts.list_questions(event_id, [:event, :reactions], String.to_atom(sort))
2025-01-02 21:27:36 +01:00
|> Enum.filter(&(ClaperWeb.Helpers.body_without_links(&1.body) =~ "?"))
2024-04-13 12:54:05 +02:00
end
defp list_form_submits(_socket, presentation_file_id) do
2024-04-06 11:48:47 +02:00
Claper.Forms.list_form_submits(presentation_file_id, [:form])
end
2024-06-07 15:06:38 +02:00
end