alembic 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 414b18ccf58a55058214c461aa4fe906fb77c7e1044d749b26e95fd1bf23e982
|
|
4
|
+
data.tar.gz: cf244807438a8324fbc6ea2c79822a7921a0760b34b98aa57768d1ab43699475
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24209db470a718be9af4a25a3e4c4223a25c7c80ad493995a277a2052d341ec02389b2f087f6e468dacfdef826115c523b6a65fbee4a1007e864f25cb3b0ad5b
|
|
7
|
+
data.tar.gz: 87a2aa618d2ee1ed3adf08fff98f0fb0c25c75768c7da4a931e07310f02005d33933b0f7b02f11c97f57da360761bd4660573ebc6656e57e6892400142de79d7
|
|
@@ -10,7 +10,7 @@ module Alembic
|
|
|
10
10
|
helper ContentBlocksHelper
|
|
11
11
|
helper KsBlocks::LayoutHelper
|
|
12
12
|
after_action :keep_ended_inner_run, only: :step
|
|
13
|
-
helper_method :flow_summary, :first_step_path, :summary_values, :intro_values, :start_over_path, :finish_link, :visited_flow_address
|
|
13
|
+
helper_method :flow_summary, :first_step_path, :summary_values, :intro_values, :start_over_path, :finish_link, :visited_flow_address, :answered_right?
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
private
|
|
@@ -78,6 +78,10 @@ module Alembic
|
|
|
78
78
|
.merge("slug" => @guide.slug, "note" => result_note, "answers" => answers_given)
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
+
def answered_right?(step, value)
|
|
82
|
+
(run&.flow || flow).scored? && Outputs::WeightedSum.weight_of(@guide.step(step).config, value).positive?
|
|
83
|
+
end
|
|
84
|
+
|
|
81
85
|
def answers_given
|
|
82
86
|
@answered.map { |step, value| [ @guide.question_text(step), @guide.choice_label(step, value) ] }
|
|
83
87
|
end
|
|
@@ -40,7 +40,12 @@
|
|
|
40
40
|
<% @answered.each do |step, value| %>
|
|
41
41
|
<li data-answer="<%= step %>" class="flex items-baseline justify-between gap-6 py-3">
|
|
42
42
|
<span class="ks-tone-muted"><%= @guide.question_text(step) %></span>
|
|
43
|
-
<span class="shrink-0 font-(weight:--ks-font-weight-medium) ks-tone-neutral"
|
|
43
|
+
<span class="flex shrink-0 items-center gap-2 font-(weight:--ks-font-weight-medium) ks-tone-neutral">
|
|
44
|
+
<%= @guide.choice_label(step, value) %>
|
|
45
|
+
<% if answered_right?(step, value) %>
|
|
46
|
+
<svg aria-label="Right" role="img" class="size-5 ks-tone-success" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z" clip-rule="evenodd" /></svg>
|
|
47
|
+
<% end %>
|
|
48
|
+
</span>
|
|
44
49
|
</li>
|
|
45
50
|
<% end %>
|
|
46
51
|
</ul>
|
data/lib/alembic/version.rb
CHANGED