think_feel_do_engine 3.22.7 → 3.22.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c76fcf5d08fa7146bb8abb321f1109ea70102751
4
- data.tar.gz: c632c6bdc6adc6bd566492341f7c165b7f991d4b
3
+ metadata.gz: 27ea551693cb972a42270373b76e71ca81d5307c
4
+ data.tar.gz: b5b14c327bce27159755f2844e5e026a70843d4c
5
5
  SHA512:
6
- metadata.gz: 1fda4b8ab9f2b39497a29042c87d4ee5d053db136641b94cee1768cf026ee5a13dc37b5e2d7a0a3e1577c01d9421aa6607201fca82fa1149349fb71ad0104eea
7
- data.tar.gz: 3789fdce7d10d2407946fd2b8e4442af22370f921ba59785439be0b9c3e5b5c9234cc19afd985981cf0621d195b8d559722e34522f75e5556a8f0792323a9a87
6
+ metadata.gz: 88180cd31c5a16b43f5b3d49c01bfeb7371e9499a775ac54622f7c54110e4781d5dbff098e283829f839692dc153afadf9485fef5631414e3d23515447f8e1c3
7
+ data.tar.gz: 214335ed734265242233a01390d381acd5b7a4ec9d2d819bff75d7470139b00b53b3c00c017b5d83aed23aae25d2ee712e30bbbec9486440e84fc845c85f0489
@@ -143,6 +143,7 @@ class Membership < ActiveRecord::Base
143
143
 
144
144
  def lessons_read_for_week
145
145
  task_statuses
146
+ .includes(task: :bit_core_content_module)
146
147
  .completed
147
148
  .where("completed_at >= ?", Time.current.advance(days: -7)
148
149
  .beginning_of_day)
@@ -12,8 +12,9 @@ module ThinkFeelDoEngine
12
12
  # Module id.
13
13
  def lesson_entries_map
14
14
  lessons = ContentModules::LessonModule
15
- .includes(:content_providers).map do |m|
16
- first_provider_id = m.provider(1).try(:id)
15
+ .includes(:content_providers)
16
+ .order("bit_core_content_providers.position").map do |m|
17
+ first_provider_id = m.content_providers.first.try(:id)
17
18
  next unless first_provider_id
18
19
  path = navigator_location_path(module_id: m.id,
19
20
  provider_id: first_provider_id,
@@ -18,14 +18,14 @@ module ThinkFeelDoEngine
18
18
 
19
19
  def self.all(*ids)
20
20
  lessons = lesson_entries_map
21
- lessons_default = lessons_with_default_urls
21
+ lessons_default = lessons_with_default_urls(lessons)
22
22
 
23
23
  Participant.not_moderator.select(:id, :study_id)
24
24
  .where(id: participant_ids(ids)).map do |participant|
25
+ participant_render_events = render_events
26
+ .where(participant_id: participant.id)
25
27
  lesson_select_events =
26
- EventCapture::Event
27
- .where(participant_id: participant.id, kind: "render")
28
- .select(:participant_id, :emitted_at, :payload)
28
+ participant_render_events
29
29
  .to_a.select do |e|
30
30
  lessons.keys.include?(e.current_url.gsub(URL_ROOT_RE, "")) ||
31
31
  lessons_default
@@ -35,26 +35,33 @@ module ThinkFeelDoEngine
35
35
  end
36
36
 
37
37
  lesson_select_events.map do |e|
38
- lesson_id = lessons[e.current_url.gsub(URL_ROOT_RE, "")] ||
39
- lessons_default[e.current_url
40
- .gsub(URL_ROOT_RE, "")] ||
41
- lessons_default[e.current_url
42
- .gsub(URL_ROOT_RE, "")[0...-1]]
43
- last_page_opened = last_page_opened(e, lesson_id)
44
- event_hash(participant, lesson_id, e, last_page_opened)
38
+ lesson_id =
39
+ lessons[e.current_url.gsub(URL_ROOT_RE, "")] ||
40
+ lessons_default[e.current_url.gsub(URL_ROOT_RE, "")] ||
41
+ lessons_default[e.current_url.gsub(URL_ROOT_RE, "")[0...-1]]
42
+ last_page_opened_info =
43
+ last_page_opened(participant_render_events, e, lesson_id)
44
+ event_hash(participant, lesson_id, e, last_page_opened_info)
45
45
  end
46
46
  end.flatten
47
47
  end
48
48
 
49
+ def self.render_events
50
+ EventCapture::Event
51
+ .where(kind: "render")
52
+ .select(:participant_id, :emitted_at, :kind, :payload)
53
+ end
54
+
49
55
  # last event (click) with matching module id
50
- def self.last_page_opened(first_session_event, lesson_id)
56
+ def self.last_page_opened(
57
+ participant_render_events,
58
+ first_session_event,
59
+ lesson_id
60
+ )
51
61
  lesson_events =
52
- EventCapture::Event
53
- .where(participant_id: first_session_event.participant_id,
54
- kind: "render")
62
+ participant_render_events
55
63
  .where("emitted_at > ?", first_session_event.emitted_at)
56
64
  .order(:emitted_at)
57
- .select(:kind, :emitted_at, :payload)
58
65
  .to_a.take_while { |e| e.current_url.include?(lesson_id.to_s) }
59
66
  last_event = (lesson_events.last || first_session_event)
60
67
 
@@ -72,8 +79,8 @@ module ThinkFeelDoEngine
72
79
  end
73
80
  end
74
81
 
75
- def self.lessons_with_default_urls
76
- lessons_with_default_path = lesson_entries_map.each.map do |lesson|
82
+ def self.lessons_with_default_urls(lessons_map)
83
+ lessons_with_default_path = lessons_map.each.map do |lesson|
77
84
  default_lesson_url =
78
85
  lesson[0].gsub(URL_ROOT_RE, "")
79
86
  .gsub(DEFAULT_LESSON_MODULE_POSTFIX, "")
@@ -22,7 +22,7 @@
22
22
  </tr>
23
23
  </thead>
24
24
  <tbody>
25
- <%= render partial: "think_feel_do_engine/media_access_events/access_data", collection: @participant.media_access_events, as: :event %>
25
+ <%= render partial: "think_feel_do_engine/media_access_events/access_data", collection: @participant.media_access_events.includes(slide: { slideshow: :content_provider }), as: :event %>
26
26
  </tbody>
27
27
  </table>
28
28
  </div>
@@ -20,7 +20,7 @@
20
20
  </tr>
21
21
  </thead>
22
22
  <tbody>
23
- <%= render partial: "think_feel_do_engine/task_statuses/task_status", collection: view_membership(@participant, @group).try(:task_statuses) %>
23
+ <%= render partial: "think_feel_do_engine/task_statuses/task_status", collection: view_membership(@participant, @group).try(:task_statuses).try(:includes, { task: :bit_core_content_module }) %>
24
24
  </tbody>
25
25
  </table>
26
26
  </div>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  # nodoc
3
3
  module ThinkFeelDoEngine
4
- VERSION = "3.22.7"
4
+ VERSION = "3.22.8"
5
5
  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.22.7
4
+ version: 3.22.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: 2017-01-11 00:00:00.000000000 Z
11
+ date: 2017-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -394,10 +394,10 @@ files:
394
394
  - app/assets/javascripts/think_feel_do_engine/validate_social_sharing.js
395
395
  - app/assets/stylesheets/think_feel_do_engine.css
396
396
  - app/assets/stylesheets/think_feel_do_engine/activities.css.scss
397
- - app/assets/stylesheets/think_feel_do_engine/base.css.scss
398
- - app/assets/stylesheets/think_feel_do_engine/dataTables-overrides.css.scss
399
- - app/assets/stylesheets/think_feel_do_engine/mobile.css.scss
400
- - app/assets/stylesheets/think_feel_do_engine/print.css.scss
397
+ - app/assets/stylesheets/think_feel_do_engine/base.scss
398
+ - app/assets/stylesheets/think_feel_do_engine/dataTables-overrides.scss
399
+ - app/assets/stylesheets/think_feel_do_engine/mobile.scss
400
+ - app/assets/stylesheets/think_feel_do_engine/print.scss
401
401
  - app/controllers/think_feel_do_engine/application_controller.rb
402
402
  - app/controllers/think_feel_do_engine/bit_maker/content_modules_controller.rb
403
403
  - app/controllers/think_feel_do_engine/bit_maker/content_providers_controller.rb
@@ -988,8 +988,8 @@ files:
988
988
  - vendor/assets/javascripts/moment.min.js
989
989
  - vendor/assets/javascripts/snap.js
990
990
  - vendor/assets/stylesheets/bootstrap-timepicker.min.css
991
- - vendor/assets/stylesheets/jplayer.blue.monday.css.scss
992
- - vendor/assets/stylesheets/snap.css.scss
991
+ - vendor/assets/stylesheets/jplayer.blue.monday.scss
992
+ - vendor/assets/stylesheets/snap.scss
993
993
  homepage: https://github.com/NU-CBITS/think_feel_do_engine
994
994
  licenses:
995
995
  - MIT
@@ -1010,7 +1010,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1010
1010
  version: '0'
1011
1011
  requirements: []
1012
1012
  rubyforge_project:
1013
- rubygems_version: 2.5.1
1013
+ rubygems_version: 2.6.8
1014
1014
  signing_key:
1015
1015
  specification_version: 4
1016
1016
  summary: Summary of ThinkFeelDoEngine.