think_feel_do_engine 3.12.7 → 3.12.8
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5eda6daa84e50aee599b51148c676115de55d51e
|
4
|
+
data.tar.gz: f0ae52521b0989d9cd36a0c63b5b418268743738
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32f96a9a4ea720b696a50782e487d4204a56bf17d4e443fd8ff7eacbc9e145155e90bacd2fd66e3126c98990bd54db015286081b0ea7544416ca2c0f41c7939e
|
7
|
+
data.tar.gz: 435508a4bdd58facc163bae3c9bf1d6fadf14ec593d128610735ee35030322458c1d9a302e37ce8fa16b19a1d2a1c0957049629694e51265969e6d688dfdd0b9
|
@@ -20,6 +20,9 @@ module ThinkFeelDoEngine
|
|
20
20
|
|
21
21
|
def new
|
22
22
|
@participants = current_user.participants_for_group(@group)
|
23
|
+
redirect_to(coach_group_site_messages_path(@group),
|
24
|
+
alert: "A group must have participants in order "\
|
25
|
+
" to send site message.") if @participants.empty?
|
23
26
|
end
|
24
27
|
|
25
28
|
def create
|
@@ -14,9 +14,12 @@ module ThinkFeelDoEngine
|
|
14
14
|
|
15
15
|
# condense adjacent interactions
|
16
16
|
filtered_interactions = []
|
17
|
+
|
17
18
|
interactions.each_with_index do |interaction, i|
|
18
|
-
previous_interaction =
|
19
|
-
next if previous_interaction
|
19
|
+
previous_interaction = find_previous_interaction(interactions, i)
|
20
|
+
next if previous_interaction.nil? ||
|
21
|
+
interaction.nil? ||
|
22
|
+
previous_interaction[:slide_id] == interaction[:slide_id]
|
20
23
|
|
21
24
|
next_interaction = interactions[i + 1] || {}
|
22
25
|
filtered_interaction = interaction.clone
|
@@ -39,17 +42,20 @@ module ThinkFeelDoEngine
|
|
39
42
|
slide_view_events(lessons, participant.id).map do |lesson_event|
|
40
43
|
e = lesson_event[1]
|
41
44
|
lesson_id = lesson_event[0]
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
begin
|
46
|
+
slides = ContentModules::LessonModule.find(lesson_id).slides
|
47
|
+
slide = find_slide_by_url(slides, e.current_url)
|
48
|
+
{
|
49
|
+
participant_id: participant.study_id,
|
50
|
+
lesson_id: lesson_id,
|
51
|
+
slide_id: slide.try(:id),
|
52
|
+
slide_title: slide.try(:title),
|
53
|
+
slide_selected_at: e.emitted_at.try(:iso8601),
|
54
|
+
slide_exited_at: next_event_at(e).try(:iso8601)
|
55
|
+
}
|
56
|
+
rescue ActiveRecord::RecordNotFound
|
57
|
+
lesson_module_not_found(participant, lesson_id) if defined?(Raven)
|
58
|
+
end
|
53
59
|
end
|
54
60
|
end.flatten
|
55
61
|
end
|
@@ -87,7 +93,20 @@ module ThinkFeelDoEngine
|
|
87
93
|
slide_position = url[/\d+$/].to_i
|
88
94
|
end
|
89
95
|
|
90
|
-
slides.find_by_position(slide_position)
|
96
|
+
slides.find_by_position(slide_position) unless slides.empty?
|
97
|
+
end
|
98
|
+
|
99
|
+
def self.lesson_module_not_found(participant, lesson_id)
|
100
|
+
Raven.capture_message "No slides found for lesson found",
|
101
|
+
extra: {
|
102
|
+
participant_id: participant.try(:id),
|
103
|
+
study_id: participant.try(:study_id),
|
104
|
+
lesson_id: lesson_id
|
105
|
+
}
|
106
|
+
end
|
107
|
+
|
108
|
+
def self.find_previous_interaction(interactions, index)
|
109
|
+
index > 0 ? interactions[index - 1] : {}
|
91
110
|
end
|
92
111
|
end
|
93
112
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: think_feel_do_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.12.
|
4
|
+
version: 3.12.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Carty-Fickes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|