think_feel_do_engine 3.14.1 → 3.14.2
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 +4 -4
- data/app/models/concerns/accessibility.rb +43 -0
- data/app/models/membership.rb +1 -2
- data/app/models/task_status.rb +9 -37
- data/app/views/think_feel_do_engine/activities/_past_due_table.erb +6 -4
- data/app/views/think_feel_do_engine/activities/previously_planned_fullpage.html.erb +6 -4
- data/app/views/think_feel_do_engine/activities/unplanned_activity_form.html.erb +6 -4
- data/app/views/think_feel_do_engine/coach/patient_dashboards/_details.html.erb +5 -3
- data/app/views/think_feel_do_engine/coach/patient_dashboards/_test_summary.html.erb +4 -2
- data/app/views/think_feel_do_engine/manage/groups/edit_tasks.html.erb +8 -6
- data/app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb +9 -7
- data/lib/think_feel_do_engine/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87a27bee53ec55a100c20dbd9b2102aea9b1675f
|
4
|
+
data.tar.gz: e6f94f97ace1fc6b05545d9e4ba305a2fc89f632
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3717a2bb4678d29db736dcbd06e02ce415615bf87b642c96770bb1fbf07a266601fd26f87ce43d5c912e59eb9ec9662a781d9668bad71684618ac30b4f9e420f
|
7
|
+
data.tar.gz: 645338da6fdf28927ab8158bd7eec544568abfd1c19bfc7ba294298b8196eeb7b8c0e32a570a1222cada4cf53e4fc9b528b0cd4a95a0f84be92eac393fa85ac6
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Concerns
|
2
|
+
# Determines whether a participant can access a lesson
|
3
|
+
module Accessibility
|
4
|
+
def accessible?
|
5
|
+
available_for_learning_on <= Date.today
|
6
|
+
end
|
7
|
+
|
8
|
+
def available_for_learning_on
|
9
|
+
membership.start_date + release_day - 1
|
10
|
+
end
|
11
|
+
|
12
|
+
def completed?
|
13
|
+
completed_at.present?
|
14
|
+
end
|
15
|
+
|
16
|
+
def previous_completed?
|
17
|
+
return false unless learning_task_status_index
|
18
|
+
return true if learning_task_status_first?
|
19
|
+
self
|
20
|
+
.class
|
21
|
+
.find_by_id(learning_task_statuses.ids[learning_task_status_index - 1])
|
22
|
+
.completed?
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def learning_task_status_first?
|
28
|
+
learning_task_status_index.zero?
|
29
|
+
end
|
30
|
+
|
31
|
+
def learning_task_status_index
|
32
|
+
learning_task_statuses
|
33
|
+
.ids
|
34
|
+
.find_index(id)
|
35
|
+
end
|
36
|
+
|
37
|
+
def learning_task_statuses
|
38
|
+
membership
|
39
|
+
.ordered_task_statuses
|
40
|
+
.for_learning
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/app/models/membership.rb
CHANGED
data/app/models/task_status.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Holds the completion status of a task for each participant
|
2
2
|
class TaskStatus < ActiveRecord::Base
|
3
|
+
include Concerns::Accessibility
|
4
|
+
LESSON_MODULE_TYPE = "ContentModules::LessonModule"
|
5
|
+
|
3
6
|
belongs_to :membership
|
4
7
|
belongs_to :task
|
5
8
|
has_one :participant, through: :membership
|
@@ -31,6 +34,11 @@ class TaskStatus < ActiveRecord::Base
|
|
31
34
|
.order("bit_core_content_modules.position ASC")
|
32
35
|
}
|
33
36
|
|
37
|
+
scope :for_learning, lambda {
|
38
|
+
joins(:task, task: :bit_core_content_module)
|
39
|
+
.where("bit_core_content_modules.type = '#{LESSON_MODULE_TYPE}'")
|
40
|
+
}
|
41
|
+
|
34
42
|
scope :available_by_day, lambda { |day_in_study|
|
35
43
|
where(arel_table[:start_day].lteq(day_in_study))
|
36
44
|
}
|
@@ -56,22 +64,6 @@ class TaskStatus < ActiveRecord::Base
|
|
56
64
|
)
|
57
65
|
}
|
58
66
|
|
59
|
-
def accessible?
|
60
|
-
available_for_learning_on <= Date.today
|
61
|
-
end
|
62
|
-
|
63
|
-
def completed?
|
64
|
-
completed_at.present?
|
65
|
-
end
|
66
|
-
|
67
|
-
def previous_completed?
|
68
|
-
return true if is_first?
|
69
|
-
self
|
70
|
-
.class
|
71
|
-
.find_by_id(membership_task_status_ids[index_for_membership - 1])
|
72
|
-
.completed?
|
73
|
-
end
|
74
|
-
|
75
67
|
def provider_viz?
|
76
68
|
try(:bit_core_content_module).try(:is_viz)
|
77
69
|
end
|
@@ -85,31 +77,11 @@ class TaskStatus < ActiveRecord::Base
|
|
85
77
|
end
|
86
78
|
|
87
79
|
def is_lesson?
|
88
|
-
task.bit_core_content_module.
|
80
|
+
task.bit_core_content_module.instance_of? ContentModules::LessonModule
|
89
81
|
end
|
90
82
|
|
91
83
|
def notify_today?
|
92
84
|
today = Time.now
|
93
85
|
start_day == ((today.to_date - membership.start_date.to_date).to_i + 1)
|
94
86
|
end
|
95
|
-
|
96
|
-
def available_for_learning_on
|
97
|
-
membership.start_date + release_day - 1
|
98
|
-
end
|
99
|
-
|
100
|
-
private
|
101
|
-
|
102
|
-
def index_for_membership
|
103
|
-
membership_task_status_ids
|
104
|
-
.find_index(id)
|
105
|
-
end
|
106
|
-
|
107
|
-
def is_first?
|
108
|
-
index_for_membership.zero?
|
109
|
-
end
|
110
|
-
|
111
|
-
def membership_task_status_ids
|
112
|
-
membership
|
113
|
-
.ordered_task_status_ids
|
114
|
-
end
|
115
87
|
end
|
@@ -16,10 +16,12 @@
|
|
16
16
|
|
17
17
|
<table class="table responsive <%=table_name%>">
|
18
18
|
<thead>
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
<tr>
|
20
|
+
<th>Activity Test</th>
|
21
|
+
<th>Planned For</th>
|
22
|
+
<th>Predicted Pleasure Value</th>
|
23
|
+
<th>Predicted Accomplishment Value</th>
|
24
|
+
</tr>
|
23
25
|
</thead>
|
24
26
|
<tbody>
|
25
27
|
<%= render partial: 'think_feel_do_engine/activities/past_due_rows', collection: activity_list, as: :activity %>
|
@@ -1,9 +1,11 @@
|
|
1
1
|
<table class="table table-condensed" id="previous_activities">
|
2
2
|
<thead>
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
<tr>
|
4
|
+
<th>Activity</th>
|
5
|
+
<th>Planned For</th>
|
6
|
+
<th>Predicted Pleasure Value</th>
|
7
|
+
<th>Predicted Accomplishment Value</th>
|
8
|
+
</tr>
|
7
9
|
</thead>
|
8
10
|
<tbody>
|
9
11
|
<%= render partial: "think_feel_do_engine/activities/previously_planned", collection: activities_list, as: :activity
|
@@ -4,10 +4,12 @@
|
|
4
4
|
|
5
5
|
<table class="table table-condensed" id="previous_activities">
|
6
6
|
<thead>
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
<tr>
|
8
|
+
<th>Activity</th>
|
9
|
+
<th>Planned For</th>
|
10
|
+
<th>Predicted Pleasure Value</th>
|
11
|
+
<th>Predicted Accomplishment Value</th>
|
12
|
+
</tr>
|
11
13
|
</thead>
|
12
14
|
<tbody>
|
13
15
|
<%= render partial: "think_feel_do_engine/activities/previously_planned", collection: already_sched_activities, as: :activity %>
|
@@ -28,9 +28,11 @@
|
|
28
28
|
<% else %>
|
29
29
|
<table class="table table-hover">
|
30
30
|
<thead>
|
31
|
-
<
|
32
|
-
|
33
|
-
|
31
|
+
<tr>
|
32
|
+
<th>Week #</th>
|
33
|
+
<th>Date</th>
|
34
|
+
<th>PHQ-9 Score</th>
|
35
|
+
</tr>
|
34
36
|
</thead>
|
35
37
|
<tbody>
|
36
38
|
<%= render partial: "think_feel_do_engine/coach/patient_dashboards/phq_summary", collection: suggestion.assessments, as: :tested_weeks, locals: { test_summary: suggestion.results } %>
|
@@ -52,12 +52,14 @@
|
|
52
52
|
|
53
53
|
<table class="table table-hover" id="tasks">
|
54
54
|
<thead>
|
55
|
-
<
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
55
|
+
<tr>
|
56
|
+
<th>Title</th>
|
57
|
+
<th>Release day</th>
|
58
|
+
<th>Is recurring?</th>
|
59
|
+
<th>Termination day</th>
|
60
|
+
<th>Has didactic content?</th>
|
61
|
+
<th></th>
|
62
|
+
</tr>
|
61
63
|
</thead>
|
62
64
|
<tbody>
|
63
65
|
<% @group.tasks.each do |task|%>
|
@@ -11,13 +11,15 @@
|
|
11
11
|
<%= form_tag participants_thoughts_path, remote: true do %>
|
12
12
|
<table class="table table-hover data-table responsive" id="thoughts">
|
13
13
|
<thead>
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
<tr>
|
15
|
+
<th class="not-displayed"></th>
|
16
|
+
<th>Thought</th>
|
17
|
+
<th>Pattern</th>
|
18
|
+
<th>Challenging Thought</th>
|
19
|
+
<th>As If Action</th>
|
20
|
+
<th>Date</th>
|
21
|
+
<th></th>
|
22
|
+
</tr>
|
21
23
|
</thead>
|
22
24
|
<tbody>
|
23
25
|
<%= render partial: "think_feel_do_engine/thoughts/mutable_thought", collection: thoughts.order(created_at: :desc) %>
|
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.14.
|
4
|
+
version: 3.14.2
|
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-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -448,6 +448,7 @@ files:
|
|
448
448
|
- app/models/awake_period.rb
|
449
449
|
- app/models/bit_core/slide_observer.rb
|
450
450
|
- app/models/coach_assignment.rb
|
451
|
+
- app/models/concerns/accessibility.rb
|
451
452
|
- app/models/concerns/copier.rb
|
452
453
|
- app/models/content_modules.rb
|
453
454
|
- app/models/content_modules/lesson_module.rb
|