think_feel_do_engine 3.19.9 → 3.20.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +11 -3
  3. data/app/assets/config/manifest.js +3 -0
  4. data/app/assets/javascripts/think_feel_do_engine/activities/activity_tracker.js +3 -2
  5. data/app/controllers/think_feel_do_engine/application_controller.rb +4 -3
  6. data/app/controllers/think_feel_do_engine/bit_maker/content_modules_controller.rb +4 -3
  7. data/app/controllers/think_feel_do_engine/bit_maker/content_providers_controller.rb +2 -1
  8. data/app/controllers/think_feel_do_engine/bit_maker/slides_controller.rb +7 -5
  9. data/app/controllers/think_feel_do_engine/bit_maker/slideshow_anchors_controller.rb +3 -2
  10. data/app/controllers/think_feel_do_engine/bit_maker/slideshows_controller.rb +1 -0
  11. data/app/controllers/think_feel_do_engine/coach/group_dashboard_controller.rb +1 -0
  12. data/app/controllers/think_feel_do_engine/coach/memberships_controller.rb +7 -4
  13. data/app/controllers/think_feel_do_engine/coach/messages_controller.rb +2 -1
  14. data/app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb +1 -0
  15. data/app/controllers/think_feel_do_engine/coach/participant_thoughts_visualizations_controller.rb +1 -0
  16. data/app/controllers/think_feel_do_engine/coach/patient_dashboards_controller.rb +1 -0
  17. data/app/controllers/think_feel_do_engine/coach/phq_assessments_controller.rb +1 -0
  18. data/app/controllers/think_feel_do_engine/coach/received_messages_controller.rb +2 -1
  19. data/app/controllers/think_feel_do_engine/coach/sent_messages_controller.rb +1 -0
  20. data/app/controllers/think_feel_do_engine/coach/site_messages_controller.rb +1 -0
  21. data/app/controllers/think_feel_do_engine/coach_dashboard_controller.rb +1 -0
  22. data/app/controllers/think_feel_do_engine/concerns/browser_detective.rb +13 -12
  23. data/app/controllers/think_feel_do_engine/concerns/invalid_auth_token.rb +1 -0
  24. data/app/controllers/think_feel_do_engine/concerns/navigator_enabled.rb +1 -0
  25. data/app/controllers/think_feel_do_engine/keep_alive_controller.rb +1 -0
  26. data/app/controllers/think_feel_do_engine/lesson_slides_controller.rb +3 -2
  27. data/app/controllers/think_feel_do_engine/lessons_controller.rb +4 -3
  28. data/app/controllers/think_feel_do_engine/manage/groups_controller.rb +3 -2
  29. data/app/controllers/think_feel_do_engine/manage/tasks_controller.rb +1 -0
  30. data/app/controllers/think_feel_do_engine/memberships_controller.rb +1 -0
  31. data/app/controllers/think_feel_do_engine/navigator_controller.rb +7 -4
  32. data/app/controllers/think_feel_do_engine/participant_data_controller.rb +3 -2
  33. data/app/controllers/think_feel_do_engine/participants/activities_controller.rb +8 -11
  34. data/app/controllers/think_feel_do_engine/participants/assessments_controller.rb +4 -3
  35. data/app/controllers/think_feel_do_engine/participants/lessons_controller.rb +1 -0
  36. data/app/controllers/think_feel_do_engine/participants/media_access_events_controller.rb +3 -3
  37. data/app/controllers/think_feel_do_engine/participants/passwords_controller.rb +1 -0
  38. data/app/controllers/think_feel_do_engine/participants/public_slides_controller.rb +3 -2
  39. data/app/controllers/think_feel_do_engine/participants/sessions_controller.rb +1 -0
  40. data/app/controllers/think_feel_do_engine/participants/thoughts_controller.rb +4 -5
  41. data/app/controllers/think_feel_do_engine/password_entropy_bits_controller.rb +3 -1
  42. data/app/controllers/think_feel_do_engine/privacy_policies_controller.rb +1 -0
  43. data/app/controllers/think_feel_do_engine/quick_sign_ins_controller.rb +1 -0
  44. data/app/controllers/think_feel_do_engine/users/passwords_controller.rb +1 -0
  45. data/app/controllers/think_feel_do_engine/users/registrations_controller.rb +1 -0
  46. data/app/controllers/think_feel_do_engine/users/sessions_controller.rb +1 -0
  47. data/app/helpers/think_feel_do_engine/activities_helper.rb +2 -1
  48. data/app/helpers/think_feel_do_engine/application_helper.rb +2 -1
  49. data/app/helpers/think_feel_do_engine/brand_helper.rb +1 -0
  50. data/app/helpers/think_feel_do_engine/coach/activity_color_code_helper.rb +1 -0
  51. data/app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb +6 -5
  52. data/app/helpers/think_feel_do_engine/coach/group_dashboard_helper.rb +5 -3
  53. data/app/helpers/think_feel_do_engine/coach/messages_helper.rb +3 -1
  54. data/app/helpers/think_feel_do_engine/coach/moods_and_phq_viz_helper.rb +1 -0
  55. data/app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb +9 -8
  56. data/app/helpers/think_feel_do_engine/emotions_helper.rb +1 -0
  57. data/app/helpers/think_feel_do_engine/phq_assessment_helper.rb +1 -0
  58. data/app/helpers/think_feel_do_engine/presenters_helper.rb +1 -0
  59. data/app/helpers/think_feel_do_engine/slides_helper.rb +5 -2
  60. data/app/helpers/think_feel_do_engine/tasks_helper.rb +11 -9
  61. data/app/mailers/think_feel_do_engine/lesson_notification_mailer.rb +5 -2
  62. data/app/mailers/think_feel_do_engine/message_notifications.rb +1 -0
  63. data/app/mailers/think_feel_do_engine/site_message_mailer.rb +3 -1
  64. data/app/models/ability.rb +1 -0
  65. data/app/models/activity.rb +21 -10
  66. data/app/models/activity_type.rb +1 -0
  67. data/app/models/arm.rb +2 -2
  68. data/app/models/arm_validator.rb +3 -1
  69. data/app/models/available_content_module.rb +6 -2
  70. data/app/models/awake_period.rb +1 -0
  71. data/app/models/bit_core/slide_observer.rb +1 -0
  72. data/app/models/coach_assignment.rb +1 -0
  73. data/app/models/concerns/accessibility.rb +1 -0
  74. data/app/models/concerns/copier.rb +25 -17
  75. data/app/models/content_modules/lesson_module.rb +6 -5
  76. data/app/models/content_modules.rb +3 -2
  77. data/app/models/content_provider_decorator.rb +1 -0
  78. data/app/models/content_provider_policy.rb +1 -0
  79. data/app/models/content_providers/accomplished_activity_index_provider.rb +1 -0
  80. data/app/models/content_providers/activity_index_provider.rb +1 -0
  81. data/app/models/content_providers/augmented_thoughts_table_provider.rb +1 -0
  82. data/app/models/content_providers/awake_period_form.rb +1 -0
  83. data/app/models/content_providers/create_activity.rb +4 -3
  84. data/app/models/content_providers/edit_past_feel_provider.rb +1 -0
  85. data/app/models/content_providers/evaluate_thoughts_provider.rb +1 -0
  86. data/app/models/content_providers/fun_activity_checklist.rb +5 -4
  87. data/app/models/content_providers/harmful_thoughts_edit_form_provider.rb +1 -0
  88. data/app/models/content_providers/helpful_thoughts_index_provider.rb +1 -0
  89. data/app/models/content_providers/important_activity_checklist.rb +5 -4
  90. data/app/models/content_providers/index_past_feel_provider.rb +1 -0
  91. data/app/models/content_providers/input_new_activity_form.rb +1 -0
  92. data/app/models/content_providers/learn_lessons_index_provider.rb +5 -4
  93. data/app/models/content_providers/messages_index_provider.rb +2 -1
  94. data/app/models/content_providers/module_index_provider.rb +1 -0
  95. data/app/models/content_providers/new_complete_thought_form_provider.rb +1 -0
  96. data/app/models/content_providers/new_current_emotion_provider.rb +1 -0
  97. data/app/models/content_providers/new_current_feel_provider.rb +1 -0
  98. data/app/models/content_providers/new_harmful_thought_form_provider.rb +1 -0
  99. data/app/models/content_providers/new_message_form_provider.rb +1 -0
  100. data/app/models/content_providers/new_past_feel_provider.rb +1 -0
  101. data/app/models/content_providers/new_thought_form_provider.rb +1 -0
  102. data/app/models/content_providers/new_thoughts_form_provider.rb +1 -0
  103. data/app/models/content_providers/past_activity_form.rb +1 -0
  104. data/app/models/content_providers/past_activity_review_form.rb +1 -0
  105. data/app/models/content_providers/past_due_activities_viz.rb +1 -0
  106. data/app/models/content_providers/pleasurable_activity_index_provider.rb +1 -0
  107. data/app/models/content_providers/previous_planned_activities_provider.rb +1 -0
  108. data/app/models/content_providers/random_slide_provider.rb +1 -0
  109. data/app/models/content_providers/show_message_provider.rb +5 -3
  110. data/app/models/content_providers/thought_patterns_index_provider.rb +1 -0
  111. data/app/models/content_providers/thoughts_distortion_viz_provider.rb +1 -0
  112. data/app/models/content_providers/thoughts_table_provider.rb +1 -0
  113. data/app/models/content_providers/unhelpful_thoughts_list_provider.rb +5 -2
  114. data/app/models/content_providers/unhelpful_thoughts_reflection_provider.rb +1 -0
  115. data/app/models/content_providers/unplanned_activity_form.rb +1 -0
  116. data/app/models/content_providers/your_activities_provider.rb +4 -2
  117. data/app/models/delivered_message.rb +3 -1
  118. data/app/models/emotion.rb +3 -2
  119. data/app/models/emotional_rating.rb +1 -0
  120. data/app/models/engagement.rb +1 -0
  121. data/app/models/group.rb +2 -1
  122. data/app/models/group_metrics/weekly_activities_count.rb +1 -0
  123. data/app/models/group_metrics/weekly_comments_count.rb +1 -0
  124. data/app/models/group_metrics/weekly_count.rb +1 -0
  125. data/app/models/group_metrics/weekly_goals_count.rb +1 -0
  126. data/app/models/group_metrics/weekly_likes_count.rb +1 -0
  127. data/app/models/group_metrics/weekly_logins_count.rb +1 -0
  128. data/app/models/group_metrics/weekly_on_the_mind_statements_count.rb +1 -0
  129. data/app/models/group_metrics/weekly_thoughts_count.rb +1 -0
  130. data/app/models/media_access_event.rb +1 -0
  131. data/app/models/membership.rb +5 -3
  132. data/app/models/message.rb +1 -0
  133. data/app/models/message_sms_notification.rb +3 -1
  134. data/app/models/mood.rb +3 -1
  135. data/app/models/participant.rb +2 -1
  136. data/app/models/participant_login_event.rb +1 -0
  137. data/app/models/participant_metrics/weekly_count.rb +1 -0
  138. data/app/models/participant_metrics/weekly_logins_count.rb +1 -0
  139. data/app/models/participant_token.rb +3 -2
  140. data/app/models/phq_assessment.rb +3 -0
  141. data/app/models/phq_stepping.rb +5 -4
  142. data/app/models/phq_stepping_assessment.rb +12 -13
  143. data/app/models/planned_activity.rb +1 -0
  144. data/app/models/roles/clinician.rb +1 -0
  145. data/app/models/roles/content_author.rb +1 -0
  146. data/app/models/roles/researcher.rb +1 -0
  147. data/app/models/site_message.rb +1 -0
  148. data/app/models/slideshow_anchor.rb +2 -1
  149. data/app/models/task.rb +3 -1
  150. data/app/models/task_status.rb +4 -2
  151. data/app/models/think_feel_do_engine/addressable.rb +1 -0
  152. data/app/models/think_feel_do_engine/concerns/validate_password.rb +1 -0
  153. data/app/models/think_feel_do_engine/password_validator.rb +3 -1
  154. data/app/models/think_feel_do_engine/reports/emotional_rating.rb +1 -0
  155. data/app/models/think_feel_do_engine/reports/event.rb +3 -2
  156. data/app/models/think_feel_do_engine/reports/lesson_module.rb +4 -3
  157. data/app/models/think_feel_do_engine/reports/lesson_slide_view.rb +1 -0
  158. data/app/models/think_feel_do_engine/reports/lesson_viewing.rb +9 -8
  159. data/app/models/think_feel_do_engine/reports/login.rb +1 -0
  160. data/app/models/think_feel_do_engine/reports/messaging.rb +2 -1
  161. data/app/models/think_feel_do_engine/reports/module_page_view.rb +1 -0
  162. data/app/models/think_feel_do_engine/reports/module_session.rb +6 -5
  163. data/app/models/think_feel_do_engine/reports/patient_activity.rb +1 -0
  164. data/app/models/think_feel_do_engine/reports/patient_thought.rb +2 -1
  165. data/app/models/think_feel_do_engine/reports/phq_assessment.rb +1 -0
  166. data/app/models/think_feel_do_engine/reports/reporter.rb +2 -1
  167. data/app/models/think_feel_do_engine/reports/site_session.rb +1 -0
  168. data/app/models/think_feel_do_engine/reports/task_completion.rb +3 -2
  169. data/app/models/think_feel_do_engine/reports/tool_access.rb +1 -0
  170. data/app/models/think_feel_do_engine/reports/tool_module.rb +1 -0
  171. data/app/models/think_feel_do_engine/reports/user_agent.rb +1 -0
  172. data/app/models/think_feel_do_engine/reports/video_session.rb +1 -0
  173. data/app/models/think_feel_do_engine/reports/wai_assessment.rb +1 -0
  174. data/app/models/thought.rb +4 -2
  175. data/app/models/thought_pattern.rb +1 -0
  176. data/app/models/tool_nav_item.rb +2 -1
  177. data/app/models/tools/home.rb +1 -0
  178. data/app/models/tools/learn.rb +1 -0
  179. data/app/models/tools/messages.rb +1 -0
  180. data/app/models/tools/think.rb +1 -0
  181. data/app/models/unplanned_activities.rb +2 -2
  182. data/app/models/user.rb +1 -0
  183. data/app/models/user_role.rb +2 -1
  184. data/app/models/values/accomplishment.rb +1 -0
  185. data/app/models/values/emotional_rating.rb +1 -0
  186. data/app/models/values/mood.rb +1 -0
  187. data/app/models/values/pleasure.rb +1 -0
  188. data/app/models/wai_assessment.rb +4 -1
  189. data/app/presenters/think_feel_do_engine/harmful_thought_viz_presenter.rb +1 -0
  190. data/app/presenters/think_feel_do_engine/lesson_event/completion_data_presenter.rb +1 -0
  191. data/app/presenters/think_feel_do_engine/media_access_event_presenter.rb +1 -0
  192. data/app/support/mood_and_emotion_visualization_service.rb +22 -25
  193. data/lib/think_feel_do_engine/engine.rb +1 -0
  194. data/lib/think_feel_do_engine/version.rb +2 -1
  195. data/lib/think_feel_do_engine.rb +1 -0
  196. metadata +20 -6
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Grouping logic for the visualization of participant mood and emotion data.
2
3
  class MoodAndEmotionVisualizationService
3
4
  def initialize(participant)
@@ -9,20 +10,18 @@ class MoodAndEmotionVisualizationService
9
10
  daily_ratings = @participant
10
11
  .moods
11
12
  .group_by { |x| x.created_at.strftime("%Y-%m-%d") }
12
- # rubocop:disable all
13
13
  daily_ratings.each do |day, moods_array|
14
- # rubocop:enable all
15
14
  ratings = moods_array.collect do |mood|
16
15
  [mood.rating, mood.created_at].compact
17
16
  end
18
- if ratings.size > 0
19
- averaged_ratings << { day: day,
20
- intensity: average_rating(ratings),
21
- is_positive: true,
22
- drill_down: ratings,
23
- data_type: "Mood"
24
- }
25
- end
17
+
18
+ next if ratings.empty?
19
+
20
+ averaged_ratings << { day: day,
21
+ intensity: average_rating(ratings),
22
+ is_positive: true,
23
+ drill_down: ratings,
24
+ data_type: "Mood" }
26
25
  end
27
26
  averaged_ratings
28
27
  end
@@ -30,30 +29,28 @@ class MoodAndEmotionVisualizationService
30
29
  def emotional_rating_daily_averages
31
30
  averaged_ratings = []
32
31
 
33
- daily_ratings = @participant.emotional_ratings
32
+ daily_ratings = @participant
33
+ .emotional_ratings
34
34
  .group_by { |x| x.created_at.strftime("%Y-%m-%d") }
35
- # rubocop:disable all
36
35
  daily_ratings.each do |day, emotion_array|
37
- # rubocop:enable all
38
36
  positive_ratings = @participant.positive_emotions(emotion_array)
39
- if positive_ratings.size > 0
37
+ unless positive_ratings.empty?
40
38
  daily_positive = { day: day,
41
39
  intensity: average_rating(positive_ratings),
42
40
  is_positive: true,
43
41
  drill_down: positive_ratings,
44
- data_type: "Emotion"
45
- }
42
+ data_type: "Emotion" }
46
43
  averaged_ratings << daily_positive
47
44
  end
48
45
  negative_ratings = @participant.negative_emotions(emotion_array)
49
- if negative_ratings.size > 0
50
- daily_negative = { day: day,
51
- intensity: average_rating(negative_ratings),
52
- is_positive: false,
53
- drill_down: negative_ratings, data_type: "Emotion"
54
- }
55
- averaged_ratings << daily_negative
56
- end
46
+
47
+ next if negative_ratings.empty?
48
+
49
+ daily_negative = { day: day,
50
+ intensity: average_rating(negative_ratings),
51
+ is_positive: false,
52
+ drill_down: negative_ratings, data_type: "Emotion" }
53
+ averaged_ratings << daily_negative
57
54
  end
58
55
  averaged_ratings
59
56
  end
@@ -63,4 +60,4 @@ class MoodAndEmotionVisualizationService
63
60
  def average_rating(array)
64
61
  array.reduce(0) { |a, e| a.to_f + e[0] } / array.size
65
62
  end
66
- end
63
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ThinkFeelDoEngine
2
3
  # The mountable application engine.
3
4
  class Engine < ::Rails::Engine
@@ -1,4 +1,5 @@
1
+ # frozen_string_literal: true
1
2
  # nodoc
2
3
  module ThinkFeelDoEngine
3
- VERSION = "3.19.9"
4
+ VERSION = "3.20.1"
4
5
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Devise must be required first to override views.
2
3
  require "devise"
3
4
  require "think_feel_do_engine/engine"
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.19.9
4
+ version: 3.20.1
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-06-09 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '4.0'
145
+ version: 6.0.0.beta1
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '4.0'
152
+ version: 6.0.0.beta1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: underscore-rails
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -212,6 +212,20 @@ dependencies:
212
212
  - - "~>"
213
213
  - !ruby/object:Gem::Version
214
214
  version: '2.2'
215
+ - !ruby/object:Gem::Dependency
216
+ name: sprockets-rails
217
+ requirement: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - "~>"
220
+ - !ruby/object:Gem::Version
221
+ version: '3.0'
222
+ type: :runtime
223
+ prerelease: false
224
+ version_requirements: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - "~>"
227
+ - !ruby/object:Gem::Version
228
+ version: '3.0'
215
229
  - !ruby/object:Gem::Dependency
216
230
  name: jshintrb
217
231
  requirement: !ruby/object:Gem::Requirement
@@ -334,6 +348,7 @@ files:
334
348
  - MIT-LICENSE
335
349
  - README.md
336
350
  - Rakefile
351
+ - app/assets/config/manifest.js
337
352
  - app/assets/images/changing_actions.gif
338
353
  - app/assets/images/evaluating_thoughts.gif
339
354
  - app/assets/images/favicon.ico
@@ -988,9 +1003,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
988
1003
  version: '0'
989
1004
  requirements: []
990
1005
  rubyforge_project:
991
- rubygems_version: 2.6.4
1006
+ rubygems_version: 2.5.1
992
1007
  signing_key:
993
1008
  specification_version: 4
994
1009
  summary: Summary of ThinkFeelDoEngine.
995
1010
  test_files: []
996
- has_rdoc: