Skip to content

Commit

Permalink
Add quizz feature + improvements
Browse files Browse the repository at this point in the history
commit 705ea00
Author: Alex Lion <[email protected]>
Date:   Sat Dec 21 10:08:42 2024 -0500

    Change version

commit 330173b
Author: Alex Lion <[email protected]>
Date:   Sat Dec 21 10:01:52 2024 -0500

    Fix layout

commit 3cc0759
Author: Alex Lion <[email protected]>
Date:   Thu Dec 19 14:20:59 2024 +0100

    Update changelog

commit 63b1fa7
Author: Alex Lion <[email protected]>
Date:   Sun Dec 15 18:56:01 2024 +0100

    Fix upper

commit 8e7bb19
Author: Alex Lion <[email protected]>
Date:   Sun Dec 15 18:49:20 2024 +0100

    Add pagination for events

commit 28beacd
Author: Alex Lion <[email protected]>
Date:   Mon Dec 9 21:03:13 2024 +0100

    Add pagination

commit c79d6cc
Author: Alex Lion <[email protected]>
Date:   Sun Dec 8 21:24:23 2024 +0100

    Fix tests

commit caad25a
Author: Alex Lion <[email protected]>
Date:   Sun Dec 8 17:43:55 2024 +0100

    Fix user registration bug

commit 38c3eec
Author: Alex Lion <[email protected]>
Date:   Sat Dec 7 22:23:24 2024 +0100

    Update changelog

commit e648ef0
Author: Alex Lion <[email protected]>
Date:   Sat Dec 7 22:06:27 2024 +0100

    Add obin

commit 6925117
Author: Alex Lion <[email protected]>
Date:   Sat Dec 7 19:39:03 2024 +0100

    WIP

commit be9b288
Author: Alex Lion <[email protected]>
Date:   Sat Dec 7 16:19:09 2024 +0100

    Add LTI AGS for quizzes

commit 29a7c96
Author: Alex Lion <[email protected]>
Date:   Thu Dec 5 13:30:49 2024 +0100

    Add translations

commit 249fdc9
Author: Alex Lion <[email protected]>
Date:   Tue Dec 3 21:37:27 2024 +0100

    Add qti export

commit c2d56e3
Author: Alex Lion <[email protected]>
Date:   Tue Dec 3 20:44:58 2024 +0100

    Fix report embed

commit a34c239
Author: Alex Lion <[email protected]>
Date:   Sat Nov 30 11:32:32 2024 +0100

    Add export quiz

commit 8d1f34b
Author: Alex Lion <[email protected]>
Date:   Sat Nov 30 00:56:50 2024 +0100

    Improve design

commit d9a7370
Author: Alex Lion <[email protected]>
Date:   Sat Nov 30 00:43:27 2024 +0100

    Add exports

commit b374b7b
Author: Alex Lion <[email protected]>
Date:   Thu Nov 28 15:22:41 2024 +0100

    Remove presence on manager

commit 404e759
Author: Alex Lion <[email protected]>
Date:   Thu Nov 28 15:22:33 2024 +0100

    Improve engagement report

commit 39dbec6
Author: Alex Lion <[email protected]>
Date:   Sat Nov 23 15:39:59 2024 +0100

    Add translation

commit 354c2e3
Author: Alex Lion <[email protected]>
Date:   Sat Nov 23 15:18:53 2024 +0100

    Change product tour behavior

commit 5f25381
Author: Alex <[email protected]>
Date:   Tue Nov 19 19:59:32 2024 +0100

    WIP

commit f411180
Author: Alex <[email protected]>
Date:   Tue Nov 19 19:32:30 2024 +0100

    WIP

commit 2b59897
Author: Alex <[email protected]>
Date:   Sun Nov 17 19:31:27 2024 +0100

    WIP

commit c8750a6
Author: Alex <[email protected]>
Date:   Sun Nov 17 18:23:01 2024 +0100

    WIP

commit fdb9efe
Author: Alex <[email protected]>
Date:   Sun Nov 17 17:55:57 2024 +0100

    WIP

commit 5d12b12
Author: Alex <[email protected]>
Date:   Sat Nov 16 21:22:12 2024 +0100

    WIP

commit 548b714
Author: Alex <[email protected]>
Date:   Fri Nov 15 15:34:00 2024 +0100

    WIP

commit f0c87f3
Author: Alex <[email protected]>
Date:   Wed Nov 13 22:09:24 2024 +0100

    WIP

commit c0c8bf9
Author: Alex <[email protected]>
Date:   Mon Nov 11 13:02:36 2024 +0100

    WIP

commit 245ea9b
Author: Alex <[email protected]>
Date:   Sun Nov 10 19:07:36 2024 +0100

    Add presenter

commit 0cf5091
Author: Alex <[email protected]>
Date:   Sat Nov 9 23:20:35 2024 +0100

    Refactor reactions

commit ef8ffef
Author: Alex <[email protected]>
Date:   Sat Nov 9 22:21:13 2024 +0100

    Add tests

commit c405514
Author: Alex <[email protected]>
Date:   Sat Nov 9 11:28:00 2024 +0100

    WIP

commit 779e697
Author: Alex <[email protected]>
Date:   Fri Nov 8 17:21:11 2024 +0100

    WIP

commit 9d25c44
Author: Alex <[email protected]>
Date:   Fri Nov 8 11:54:31 2024 +0100

    WIP

commit c015748
Author: Alex <[email protected]>
Date:   Fri Nov 1 17:13:04 2024 +0100

    Fix condition

commit a64439f
Author: Alex <[email protected]>
Date:   Fri Nov 1 12:16:21 2024 +0100

    WIP

commit a994d95
Author: Alex <[email protected]>
Date:   Wed Oct 30 23:06:24 2024 +0100

    Fix changeset

commit 5b2935f
Merge: cec1a97 7476269
Author: Alex <[email protected]>
Date:   Sun Oct 20 11:26:51 2024 +0200

    Merge branch 'dev' into feature/quizz

commit cec1a97
Author: Alex <[email protected]>
Date:   Sat Oct 19 22:52:00 2024 +0200

    WIP

commit f65854f
Author: Alex <[email protected]>
Date:   Sat Oct 19 16:55:42 2024 +0200

    WIP

commit 1e6429a
Merge: 1977959 6f8a2fd
Author: Alex <[email protected]>
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 1977959
Author: Alex <[email protected]>
Date:   Sat Oct 5 12:57:09 2024 +0200

    WIP
  • Loading branch information
alxlion committed Dec 21, 2024
1 parent 7476269 commit 093bb79
Show file tree
Hide file tree
Showing 82 changed files with 7,727 additions and 2,436 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
### v.2.3.0

### Features

- Add quizzes interaction with LTI AGS integration and QTI export
- Add join link in manager view to join attendee room more easily
- Export all interactions to CSV in the reports view
- Add Oban for asynchronous jobs (mailer and LMS API calls)

### Fixes and improvements

- New report view with better metrics and tab-view for all interactions
- Improve design improvements for interaction boxes in attendee room
- Fix engagement rate stats
- Add button to trigger product tour instead of automatically starting it
- Improve design and UX for interactions and presentation settings in the manager view
- Add pagination for events on the dashboard

## v2.2.0

### Features
Expand Down
31 changes: 29 additions & 2 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ Hooks.EmbeddedBanner = {

Hooks.TourGuide = {
mounted() {
this.triggerDiv = document.querySelector(this.el.dataset.btnTrigger);
this.btnTrigger = this.triggerDiv.querySelector('.open');
this.closeBtnTrigger = this.triggerDiv.querySelector('.close');

this.tour = new TourGuideClient({
nextLabel: this.el.dataset.nextLabel,
prevLabel: this.el.dataset.prevLabel,
Expand All @@ -77,12 +81,35 @@ Hooks.TourGuide = {
});

if (!this.tour.isFinished(this.el.dataset.group)) {
this.tour.start(this.el.dataset.group);
this.triggerDiv.classList.remove("hidden");
}

this.tour.onBeforeExit(() => {
this.tour.finishTour(true, this.el.dataset.group);
});

this.btnTrigger.addEventListener("click", () => {
this.startTour();
});

this.closeBtnTrigger.addEventListener("click", (e) => {
this.triggerDiv.classList.add("hidden");
this.tour.finishTour(true, this.el.dataset.group);
});
},

startTour() {
this.triggerDiv.classList.add("hidden");
this.tour.start(this.el.dataset.group);
},
destroyed() {
this.btnTrigger.removeEventListener("click", () => {
this.startTour();
});
this.closeBtnTrigger.removeEventListener("click", () => {
this.triggerDiv.classList.add("hidden");
this.tour.finishTour(true, this.el.dataset.group);
});
},
};

Expand All @@ -95,7 +122,7 @@ Hooks.Split = {
const columnSlitValue =
localStorage.getItem(`column-split-${id}`) || "1fr 10px 1fr";
const rowSlitValue =
localStorage.getItem(`row-split-${id}`) || "1fr 10px 1fr";
localStorage.getItem(`row-split-${id}`) || "0.5fr 10px 1fr";

if (type === "column") {
this.columnSplit = Split({
Expand Down
9 changes: 9 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ config :claper, ClaperWeb.Gettext,
default_locale: "en",
locales: ~w(fr en de es nl)

config :claper, Oban,
engine: Oban.Engines.Basic,
queues: [default: 10, mailers: 20],
repo: Claper.Repo,
plugins: [
{Oban.Plugins.Pruner, max_age: 60 * 60 * 24 * 7},
{Oban.Plugins.Lifeline, rescue_after: :timer.minutes(30)}
]

config :dart_sass,
version: "1.61.0",
default: [
Expand Down
34 changes: 22 additions & 12 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,37 @@ port = get_int_from_path_or_env(config_dir, "PORT", "4000")

secret_key_base = get_var_from_path_or_env(config_dir, "SECRET_KEY_BASE", nil)

case secret_key_base do
nil ->
raise "SECRET_KEY_BASE configuration option is required. See https://docs.claper.co/configuration.html#production-docker"
if System.get_env("MIX_ENV") == "prod" or Application.get_env(:claper, :server, false) do
case secret_key_base do
nil ->
raise "SECRET_KEY_BASE configuration option is required. See https://docs.claper.co/configuration.html#production-docker"

key when byte_size(key) < 32 ->
raise "SECRET_KEY_BASE must be at least 32 bytes long. See https://docs.claper.co/configuration.html#production-docker"
key when byte_size(key) < 32 ->
raise "SECRET_KEY_BASE must be at least 32 bytes long. See https://docs.claper.co/configuration.html#production-docker"

_ ->
nil
_ ->
nil
end
end

base_url = get_var_from_path_or_env(config_dir, "BASE_URL")
base_url = get_var_from_path_or_env(config_dir, "BASE_URL", "http://localhost:4000")

if !base_url do
raise "BASE_URL configuration option is required. See https://docs.claper.co/configuration.html#production-docker"
if System.get_env("MIX_ENV") == "prod" or Application.get_env(:claper, :server, false) do
case base_url do
nil ->
raise "BASE_URL configuration option is required. See https://docs.claper.co/configuration.html#production-docker"

_ ->
nil
end
end

base_url = URI.parse(base_url)

if base_url.scheme not in ["http", "https"] do
raise "BASE_URL must start with `http` or `https`. Currently configured as `#{System.get_env("BASE_URL")}`"
if System.get_env("MIX_ENV") == "prod" or Application.get_env(:claper, :server, false) do
if base_url.scheme not in ["http", "https"] do
raise "BASE_URL must start with `http` or `https`. Currently configured as `#{System.get_env("BASE_URL")}`"
end
end

max_file_size = get_int_from_path_or_env(config_dir, "MAX_FILE_SIZE_MB", 15)
Expand Down
2 changes: 2 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ config :claper, ClaperWeb.Endpoint,
# In test we don't send emails.
config :claper, Claper.Mailer, adapter: Swoosh.Adapters.Test

config :claper, Oban, testing: :inline

# Print only warnings and errors during test
config :logger, level: :warning

Expand Down
2 changes: 2 additions & 0 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ args=("$@")

if [ "${args[0]}" == "start" ]; then
mix phx.server
elif [ "${args[0]}" == "iex" ]; then
iex -S mix
else
mix "$@"
fi
Expand Down
3 changes: 3 additions & 0 deletions lib/claper/accounts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ defmodule Claper.Accounts do

Repo.insert!(user_token)
UserNotifier.deliver_magic_link(email, magic_link_url_fun.(encoded_token))
{:ok, encoded_token}
end

@doc """
Expand All @@ -293,6 +294,7 @@ defmodule Claper.Accounts do

Repo.insert!(user_token)
UserNotifier.deliver_update_email_instructions(user, update_email_url_fun.(encoded_token))
{:ok, encoded_token}
end

@doc """
Expand Down Expand Up @@ -393,6 +395,7 @@ defmodule Claper.Accounts do
{encoded_token, user_token} = UserToken.build_email_token(user, "confirm")
Repo.insert!(user_token)
UserNotifier.deliver_confirmation_instructions(user, confirmation_url_fun.(encoded_token))
{:ok, encoded_token}
end
end

Expand Down
1 change: 1 addition & 0 deletions lib/claper/accounts/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ defmodule Claper.Accounts.User do
field :locale, :string

has_many :events, Claper.Events.Event
has_one :lti_user, Lti13.Users.User

timestamps()
end
Expand Down
32 changes: 10 additions & 22 deletions lib/claper/accounts/user_notifier.ex
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
defmodule Claper.Accounts.UserNotifier do
# import Swoosh.Email

alias Claper.Mailer

# Delivers the email using the application mailer.
# defp deliver(recipient, subject, body) do
# from_name = Application.get_env(:claper, :mail)[:from_name]
Expand All @@ -21,51 +19,41 @@ defmodule Claper.Accounts.UserNotifier do
# end

def deliver_magic_link(email, url) do
email = ClaperWeb.Notifiers.UserNotifier.magic(email, url)
Claper.Workers.Mailers.new_magic_link(email, url) |> Oban.insert()

with {:ok, _metadata} <- Mailer.deliver(email) do
{:ok, email}
end
{:ok, :enqueued}
end

def deliver_welcome(email) do
email = ClaperWeb.Notifiers.UserNotifier.welcome(email)
Claper.Workers.Mailers.new_welcome(email) |> Oban.insert()

with {:ok, _metadata} <- Mailer.deliver(email) do
{:ok, email}
end
{:ok, :enqueued}
end

@doc """
Deliver instructions to confirm account.
"""
def deliver_confirmation_instructions(user, url) do
email = ClaperWeb.Notifiers.UserNotifier.confirm(user, url)
Claper.Workers.Mailers.new_confirmation(user.id, url) |> Oban.insert()

with {:ok, _metadata} <- Mailer.deliver(email) do
{:ok, email}
end
{:ok, :enqueued}
end

@doc """
Deliver instructions to reset a user password.
"""
def deliver_reset_password_instructions(user, url) do
email = ClaperWeb.Notifiers.UserNotifier.reset(user, url)
Claper.Workers.Mailers.new_reset_password(user.id, url) |> Oban.insert()

with {:ok, _metadata} <- Mailer.deliver(email) do
{:ok, email}
end
{:ok, :enqueued}
end

@doc """
Deliver instructions to update a user email.
"""
def deliver_update_email_instructions(user, url) do
email = ClaperWeb.Notifiers.UserNotifier.update_email(user, url)
Claper.Workers.Mailers.new_update_email(user.id, url) |> Oban.insert()

with {:ok, _metadata} <- Mailer.deliver(email) do
{:ok, email}
end
{:ok, :enqueued}
end
end
4 changes: 3 additions & 1 deletion lib/claper/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ defmodule Claper.Application do
def start(_type, _args) do
topologies = Application.get_env(:libcluster, :topologies) || []
oidc_config = Application.get_env(:claper, :oidc) || []
Oban.Telemetry.attach_default_logger()

children = [
{Cluster.Supervisor, [topologies, [name: Claper.ClusterSupervisor]]},
Expand All @@ -26,7 +27,8 @@ defmodule Claper.Application do
{Finch, name: Swoosh.Finch},
{Task.Supervisor, name: Claper.TaskSupervisor},
{Oidcc.ProviderConfiguration.Worker,
%{issuer: oidc_config[:issuer], name: Claper.OidcProviderConfig}}
%{issuer: oidc_config[:issuer], name: Claper.OidcProviderConfig}},
{Oban, Application.fetch_env!(:claper, Oban)}
]

# See https://hexdocs.pm/elixir/Supervisor.html
Expand Down
Loading

0 comments on commit 093bb79

Please sign in to comment.