- <%= for i <- 0..(Ecto.Changeset.get_field(@changeset, :quiz_questions) |> length()) - 1 do %>
+ <% question_count = Ecto.Changeset.get_field(@changeset, :quiz_questions) |> length() %>
+
+
+ <%= for i <- 0..(question_count - 1) do %>
<% end %>
- <%= if Ecto.Changeset.get_field(@changeset, :quiz_questions) |> length() < 10 do %>
+ <%= if question_count < 10 do %>
<% end %>
- <%= inputs_for f, :quiz_questions, fn q -> %>
-
-
-
+ <%= inputs_for f, :quiz_questions, fn q -> %>
+
+
+
+ {q.index + 1}
+
+
+ {gettext("Question %{number}", number: q.index + 1)}
+
+
+
+ <.text_field
form={q}
key={:content}
- name={gettext("Your question")}
- autofocus="true"
- required="true"
+ label={gettext("Your question")}
+ placeholder={gettext("Enter your question")}
+ autocomplete="off"
+ required
/>
-
- <%= if Keyword.has_key?(q.errors, :quiz_question_opts) do %>
-
- {elem(Keyword.get(q.errors, :quiz_question_opts), 0)}
-
- <% end %>
+ <%= if Keyword.has_key?(q.errors, :quiz_question_opts) do %>
+
+ {elem(Keyword.get(q.errors, :quiz_question_opts), 0)}
+
+ <% end %>
-
<%= inputs_for q, :quiz_question_opts, fn o -> %>
-
-
-
-
-
-
- <%= label(class: "mt-6 cursor-pointer flex items-center text-white rounded-md px-2.5 py-2.5 h-full #{if (o.source.changes[:is_correct] != nil && o.source.changes[:is_correct]) || (!Map.has_key?(o.source.changes, :is_correct) && o.source.data.is_correct), do: "bg-green-500", else: "bg-red-500"}") do %>
+ <% is_correct =
+ (o.source.changes[:is_correct] != nil && o.source.changes[:is_correct]) ||
+ (!Map.has_key?(o.source.changes, :is_correct) && o.source.data.is_correct) %>
+
+ <.text_field
+ form={o}
+ key={:content}
+ label={gettext("Answer %{index}", index: o.index + 1)}
+ autocomplete="off"
+ required
+ >
+ <:trailing>
+
+ <%= if o.index > 1 do %>
+
<% end %>
-
-
-
- <%= if o.index > 1 do %>
-
- <% end %>
+
+
<% end %>
-
-
+
- <%= if Ecto.Changeset.get_field(@changeset, :quiz_questions) |> length() > 1 do %>
-
+
+
+ <% end %>
+
+ <% end %>
+
+
+
+
+
{gettext("Options")}
+
+ <.checkbox
+ form={f}
+ key={:allow_anonymous}
+ label={gettext("Allow anonymous submissions")}
+ />
+
+
+
+
+
+ <%= if @live_action == :edit do %>
+ {link(gettext("Delete"),
+ to: "#",
+ phx_click: "delete",
+ phx_target: @myself,
+ phx_value_id: @quiz.id,
+ data: [
+ confirm:
+ gettext(
+ "This will delete all responses associated and the quiz itself, are you sure?"
+ )
+ ],
+ class: "btn btn-outline btn-error w-full"
+ )}
+
+ <%= link to: ~p"/export/quizzes/#{@quiz.id}/qti",
+ class: "text-xs text-primary-500 font-medium inline-flex items-center gap-1",
+ method: :post,
+ target: "_blank" do %>
+ {gettext("Export to QTI (XML)")}
<% end %>
<% end %>
-
-
{gettext("Options")}
-
-
- {checkbox(f, :allow_anonymous, class: "h-4 w-4")}
- {label(
- f,
- :allow_anonymous,
- gettext("Allow anonymous submissions"),
- class: "text-sm font-medium"
- )}
-
-
-
-
-
-
- <%= if @live_action == :edit do %>
- {link(gettext("Delete"),
- to: "#",
- phx_click: "delete",
- phx_target: @myself,
- phx_value_id: @quiz.id,
- data: [
- confirm:
- gettext(
- "This will delete all responses associated and the quiz itself, are you sure?"
- )
- ],
- class: "btn btn-error w-full lg:w-auto"
- )}
- <% end %>
-
-
- <%= if @live_action == :edit do %>
- <%= link to: ~p"/export/quizzes/#{@quiz.id}/qti", class: "text-xs text-primary-500 font-medium flex items-center gap-1", method: :post, target: "_blank" do %>
- {gettext("Export to QTI (XML)")}
- <% end %>
- <% end %>
-
diff --git a/lib/claper_web/live/transcription_live/form_component.html.heex b/lib/claper_web/live/transcription_live/form_component.html.heex
index 5a36e66..050bef0 100644
--- a/lib/claper_web/live/transcription_live/form_component.html.heex
+++ b/lib/claper_web/live/transcription_live/form_component.html.heex
@@ -6,52 +6,51 @@
phx-target={@myself}
phx-change="validate"
phx-submit="save"
+ class="flex flex-col gap-6"
>
-
-
+
+
+
{gettext("Options")}
+
+ <.select_field
form={f}
- key={:language}
- name={gettext("Language")}
- array={@languages}
+ key={:visibility}
+ label={gettext("Show subtitles on")}
+ options={[
+ {gettext("Presenter and attendee"), "both"},
+ {gettext("Presenter only"), "presenter"},
+ {gettext("Attendee only"), "attendee"}
+ ]}
/>
-
-
{gettext("Options")}
-
-
-
-
-
-
{gettext("Microphone")}
-
-
-
-
+
+
+ {gettext("Microphone")}
+
+
+
{gettext("Microphone selection is saved locally in your browser.")}
-
-