ims_caliper 0.1.3 → 0.9.0

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.
Files changed (131) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +3 -0
  3. data/LICENSE +156 -58
  4. data/NOTICE +42 -8
  5. data/README.md +2 -2
  6. data/lib/caliper/defaults.rb +21 -1
  7. data/lib/caliper/entities/agent/organization.rb +37 -0
  8. data/lib/caliper/entities/agent/person.rb +38 -0
  9. data/lib/caliper/entities/agent/software_application.rb +39 -0
  10. data/lib/caliper/entities/annotation/annotation.rb +21 -11
  11. data/lib/caliper/entities/annotation/bookmark_annotation.rb +19 -9
  12. data/lib/caliper/entities/annotation/highlight_annotation.rb +19 -8
  13. data/lib/caliper/entities/annotation/shared_annotation.rb +19 -9
  14. data/lib/caliper/entities/annotation/tag_annotation.rb +19 -9
  15. data/lib/caliper/entities/assessment/assessment.rb +19 -9
  16. data/lib/caliper/entities/assessment/assessment_item.rb +19 -8
  17. data/lib/caliper/entities/assignable/assignable_digital_resource.rb +19 -11
  18. data/lib/caliper/entities/assignable/attempt.rb +21 -8
  19. data/lib/caliper/entities/digital_resource.rb +29 -18
  20. data/lib/caliper/entities/entity.rb +27 -13
  21. data/lib/caliper/entities/foaf/agent.rb +22 -3
  22. data/lib/caliper/entities/generatable.rb +21 -2
  23. data/lib/caliper/entities/jsonable.rb +17 -5
  24. data/lib/caliper/entities/learning_context.rb +30 -9
  25. data/lib/caliper/entities/learning_objective.rb +19 -12
  26. data/lib/caliper/entities/lis/course_offering.rb +23 -13
  27. data/lib/caliper/entities/lis/course_section.rb +20 -13
  28. data/lib/caliper/entities/lis/group.rb +23 -13
  29. data/lib/caliper/entities/lis/membership.rb +22 -16
  30. data/lib/caliper/entities/lis/roles.rb +18 -6
  31. data/lib/caliper/entities/lis/status.rb +18 -6
  32. data/lib/caliper/entities/media/audio_object.rb +21 -7
  33. data/lib/caliper/entities/media/image_object.rb +21 -7
  34. data/lib/caliper/entities/media/media_location.rb +19 -4
  35. data/lib/caliper/entities/media/media_object.rb +19 -8
  36. data/lib/caliper/entities/media/video_object.rb +21 -7
  37. data/lib/caliper/entities/outcome/result.rb +23 -2
  38. data/lib/caliper/entities/reading/epub_chapter.rb +23 -7
  39. data/lib/caliper/entities/reading/epub_part.rb +24 -8
  40. data/lib/caliper/entities/reading/epub_sub_chapter.rb +22 -5
  41. data/lib/caliper/entities/reading/epub_volume.rb +20 -12
  42. data/lib/caliper/entities/reading/frame.rb +22 -6
  43. data/lib/caliper/entities/reading/web_page.rb +37 -0
  44. data/lib/caliper/entities/response/fillin_blank_response.rb +21 -3
  45. data/lib/caliper/entities/response/multiple_choice_response.rb +20 -3
  46. data/lib/caliper/entities/response/multiple_response_response.rb +20 -3
  47. data/lib/caliper/entities/response/response.rb +24 -3
  48. data/lib/caliper/entities/response/response_type.rb +20 -0
  49. data/lib/caliper/entities/response/select_type_response.rb +23 -5
  50. data/lib/caliper/entities/response/true_false_response.rb +20 -3
  51. data/lib/caliper/entities/schemadotorg/creative_work.rb +22 -2
  52. data/lib/caliper/entities/schemadotorg/software_application.rb +22 -2
  53. data/lib/caliper/entities/schemadotorg/thing.rb +19 -0
  54. data/lib/caliper/entities/schemadotorg/web_page.rb +22 -2
  55. data/lib/caliper/entities/session/session.rb +44 -0
  56. data/lib/caliper/entities/targetable.rb +19 -3
  57. data/lib/caliper/entities/w3c/membership.rb +32 -0
  58. data/lib/caliper/entities/w3c/organization.rb +30 -0
  59. data/lib/caliper/entity_envelope.rb +20 -7
  60. data/lib/caliper/event/annotation_event.rb +21 -6
  61. data/lib/caliper/event/assessment_event.rb +22 -2
  62. data/lib/caliper/event/assessment_item_event.rb +22 -2
  63. data/lib/caliper/event/assignable_event.rb +22 -2
  64. data/lib/caliper/event/event.rb +23 -1
  65. data/lib/caliper/event/jsonable.rb +18 -6
  66. data/lib/caliper/event/media_event.rb +22 -2
  67. data/lib/caliper/event/navigation_event.rb +22 -3
  68. data/lib/caliper/event/outcome_event.rb +22 -3
  69. data/lib/caliper/event/session_event.rb +21 -7
  70. data/lib/caliper/event/view_event.rb +22 -8
  71. data/lib/caliper/event_envelope.rb +20 -8
  72. data/lib/caliper/jsonable.rb +24 -7
  73. data/lib/caliper/options.rb +21 -2
  74. data/lib/caliper/profiles/annotation_profile.rb +21 -3
  75. data/lib/caliper/profiles/assessment_item_profile.rb +48 -0
  76. data/lib/caliper/profiles/assessment_profile.rb +22 -23
  77. data/lib/caliper/profiles/assignable_profile.rb +21 -4
  78. data/lib/caliper/profiles/media_profile.rb +20 -3
  79. data/lib/caliper/profiles/profile.rb +20 -24
  80. data/lib/caliper/profiles/reading_profile.rb +21 -4
  81. data/lib/caliper/profiles/session_profile.rb +20 -2
  82. data/lib/caliper/request/event_store_envelope.rb +20 -2
  83. data/lib/caliper/request/event_store_requestor.rb +21 -2
  84. data/lib/caliper/request/http_requestor.rb +28 -9
  85. data/lib/caliper/sensor.rb +21 -11
  86. data/lib/caliper/stats/atomic_wrapper.rb +21 -4
  87. data/lib/caliper/stats/statistic.rb +21 -1
  88. data/lib/caliper/stats/statistics.rb +20 -2
  89. data/lib/caliper/stats/statistics_map.rb +20 -0
  90. data/lib/caliper/validators/error_message.rb +20 -0
  91. data/lib/caliper/validators/event_validator.rb +20 -0
  92. data/lib/caliper/validators/event_validator_context.rb +21 -1
  93. data/lib/caliper/validators/property_type_check.rb +23 -4
  94. data/lib/caliper/validators/session_login_event_validator.rb +39 -21
  95. data/lib/caliper/validators/session_logout_event_validator.rb +31 -13
  96. data/lib/caliper/validators/time_check.rb +20 -0
  97. data/lib/caliper/version.rb +22 -3
  98. data/lib/caliper.rb +18 -1
  99. data/spec/lib/entities/{lis → agent}/person_spec.rb +26 -6
  100. data/spec/lib/entities/{lis → agent}/student.json +0 -0
  101. data/spec/lib/entities/entity_spec.rb +19 -4
  102. data/spec/lib/event/annotation_event_bookmark_spec.rb +23 -8
  103. data/spec/lib/event/annotation_event_highlight_spec.rb +23 -8
  104. data/spec/lib/event/annotation_event_shared_spec.rb +25 -10
  105. data/spec/lib/event/annotation_event_tag_spec.rb +23 -8
  106. data/spec/lib/event/assessment_event_spec.rb +22 -8
  107. data/spec/lib/event/assessment_item_completed_event_spec.rb +24 -10
  108. data/spec/lib/event/assessment_item_started_event_spec.rb +24 -10
  109. data/spec/lib/event/assignable_event_spec.rb +225 -0
  110. data/spec/lib/event/media_event_spec.rb +22 -7
  111. data/spec/lib/event/navigated_event_spec.rb +26 -11
  112. data/spec/lib/event/session_event_login_spec.rb +26 -12
  113. data/spec/lib/event/session_event_logout_spec.rb +25 -12
  114. data/spec/lib/event/session_event_timeout_spec.rb +25 -12
  115. data/spec/lib/event/viewed_event_spec.rb +23 -8
  116. data/spec/lib/event_helper.rb +25 -9
  117. data/spec/lib/sensor_spec.rb +43 -13
  118. data/spec/spec_helper.rb +18 -3
  119. metadata +19 -22
  120. data/.idea/caliper-ruby.iml +0 -156
  121. data/.idea/encodings.xml +0 -5
  122. data/.idea/misc.xml +0 -5
  123. data/.idea/modules.xml +0 -9
  124. data/.idea/scopes/scope_settings.xml +0 -5
  125. data/.idea/vcs.xml +0 -7
  126. data/lib/caliper/entities/lis/organization.rb +0 -25
  127. data/lib/caliper/entities/lis/person.rb +0 -25
  128. data/lib/caliper/entities/session.rb +0 -34
  129. data/lib/caliper/entities/software_application.rb +0 -28
  130. data/lib/caliper/entities/web_page.rb +0 -15
  131. data/spec/lib/request/http_request_spec.rb +0 -216
@@ -1,18 +1,34 @@
1
+ ##
2
+ # This file is part of IMS Caliper Analytics™ and is licensed to
3
+ # IMS Global Learning Consortium, Inc. (http://www.imsglobal.org)
4
+ # under one or more contributor license agreements. See the NOTICE
5
+ # file distributed with this work for additional information.
6
+ #
7
+ # IMS Caliper is free software: you can redistribute it and/or modify it under
8
+ # the terms of the GNU Lesser General Public License as published by the Free
9
+ # Software Foundation, version 3 of the License.
10
+ #
11
+ # IMS Caliper is distributed in the hope that it will be useful, but WITHOUT
12
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
+ # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License along
16
+ # with this program. If not, see http://www.gnu.org/licenses/.
17
+
1
18
  require 'require_all'
2
19
  require_all 'lib/caliper/entities/entity.rb'
3
- require_all 'lib/caliper/entities/session.rb'
4
- require_all 'lib/caliper/entities/software_application.rb'
5
- require_all 'lib/caliper/entities/lis/person.rb'
20
+ require_all 'lib/caliper/entities/agent/software_application.rb'
21
+ require_all 'lib/caliper/entities/agent/person.rb'
6
22
  require_all 'lib/caliper/entities/lis/membership.rb'
7
23
  require_all 'lib/caliper/entities/lis/roles.rb'
8
24
  require_all 'lib/caliper/entities/lis/status.rb'
9
25
  require_all 'lib/caliper/entities/lis/course_section.rb'
10
26
  require_all 'lib/caliper/entities/lis/course_offering.rb'
11
27
  require_all 'lib/caliper/entities/lis/group.rb'
12
- require_all 'lib/caliper/entities/reading/epub_volume.rb'
13
- require_all 'lib/caliper/entities/reading/frame.rb'
28
+ require_all 'lib/caliper/entities/session/session.rb'
14
29
  require_all 'lib/caliper/event/session_event.rb'
15
30
  require_all 'lib/caliper/profiles/session_profile.rb'
31
+ require_all 'lib/caliper/entities/reading/epub_volume.rb'
16
32
  require 'json_spec'
17
33
 
18
34
  module Caliper
@@ -20,10 +36,10 @@ module Caliper
20
36
 
21
37
  describe SessionEvent do
22
38
 
23
- it 'should ensure that a SessionEvent (login) is correctly created and serialized' do
39
+ it 'should ensure that a LoggedIn SessionEvent is correctly created and serialized' do
24
40
 
25
41
  # The Actor (Person/Student))
26
- student = Caliper::Entities::LIS::Person.new
42
+ student = Caliper::Entities::Agent::Person.new
27
43
  student.id = 'https://some-university.edu/user/554433'
28
44
  membership1 = Caliper::Entities::LIS::Membership.new
29
45
  membership1.id = "https://some-university.edu/membership/001"
@@ -58,7 +74,7 @@ module Caliper
58
74
  action = Caliper::Profiles::SessionActions::LOGGED_IN
59
75
 
60
76
  # The Object (edApp)
61
- edApp = Caliper::Entities::SoftwareApplication.new
77
+ edApp = Caliper::Entities::Agent::SoftwareApplication.new
62
78
  edApp.id = 'https://github.com/readium/readium-js-viewer'
63
79
  edApp.name = 'Readium'
64
80
  edApp.hasMembership = []
@@ -83,7 +99,7 @@ module Caliper
83
99
  frame.isPartOf = ePubVolume.id
84
100
 
85
101
  # The Generated (Session)
86
- session = Caliper::Entities::Session.new
102
+ session = Caliper::Entities::Session::Session.new
87
103
  session.id = 'https://github.com/readium/session-123456789'
88
104
  session.name = 'session-123456789'
89
105
  session.description = nil
@@ -152,9 +168,7 @@ module Caliper
152
168
 
153
169
  # Ensure that the deserialized session event object conforms
154
170
  expect(session_event).to eql(deser_session_event)
155
-
156
171
  end
157
-
158
172
  end
159
173
  end
160
- end
174
+ end
@@ -1,16 +1,31 @@
1
+ ##
2
+ # This file is part of IMS Caliper Analytics™ and is licensed to
3
+ # IMS Global Learning Consortium, Inc. (http://www.imsglobal.org)
4
+ # under one or more contributor license agreements. See the NOTICE
5
+ # file distributed with this work for additional information.
6
+ #
7
+ # IMS Caliper is free software: you can redistribute it and/or modify it under
8
+ # the terms of the GNU Lesser General Public License as published by the Free
9
+ # Software Foundation, version 3 of the License.
10
+ #
11
+ # IMS Caliper is distributed in the hope that it will be useful, but WITHOUT
12
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
+ # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License along
16
+ # with this program. If not, see http://www.gnu.org/licenses/.
17
+
1
18
  require 'require_all'
2
19
  require_all 'lib/caliper/entities/entity.rb'
3
- require_all 'lib/caliper/entities/session.rb'
4
- require_all 'lib/caliper/entities/software_application.rb'
5
- require_all 'lib/caliper/entities/lis/person.rb'
20
+ require_all 'lib/caliper/entities/agent/software_application.rb'
21
+ require_all 'lib/caliper/entities/agent/person.rb'
6
22
  require_all 'lib/caliper/entities/lis/membership.rb'
7
23
  require_all 'lib/caliper/entities/lis/roles.rb'
8
24
  require_all 'lib/caliper/entities/lis/status.rb'
9
25
  require_all 'lib/caliper/entities/lis/course_section.rb'
10
26
  require_all 'lib/caliper/entities/lis/course_offering.rb'
11
27
  require_all 'lib/caliper/entities/lis/group.rb'
12
- require_all 'lib/caliper/entities/reading/epub_volume.rb'
13
- require_all 'lib/caliper/entities/reading/frame.rb'
28
+ require_all 'lib/caliper/entities/session/session.rb'
14
29
  require_all 'lib/caliper/event/session_event.rb'
15
30
  require_all 'lib/caliper/profiles/session_profile.rb'
16
31
  require 'json_spec'
@@ -20,10 +35,10 @@ module Caliper
20
35
 
21
36
  describe SessionEvent do
22
37
 
23
- it 'should ensure that a SessionEvent (logout) is correctly created and serialized' do
38
+ it 'should ensure that a loggedOut SessionEvent is correctly created and serialized' do
24
39
 
25
40
  # The Actor (Person/Student))
26
- student = Caliper::Entities::LIS::Person.new
41
+ student = Caliper::Entities::Agent::Person.new
27
42
  student.id = 'https://some-university.edu/user/554433'
28
43
  membership1 = Caliper::Entities::LIS::Membership.new
29
44
  membership1.id = "https://some-university.edu/membership/001"
@@ -58,7 +73,7 @@ module Caliper
58
73
  action = Caliper::Profiles::SessionActions::LOGGED_OUT
59
74
 
60
75
  # The Object (edApp)
61
- edApp = Caliper::Entities::SoftwareApplication.new
76
+ edApp = Caliper::Entities::Agent::SoftwareApplication.new
62
77
  edApp.id = 'https://github.com/readium/readium-js-viewer'
63
78
  edApp.name = 'Readium'
64
79
  edApp.hasMembership = []
@@ -66,7 +81,7 @@ module Caliper
66
81
  edApp.dateModified = '2015-09-02T11:30:00.000Z'
67
82
 
68
83
  # The Target (Session)
69
- session = Caliper::Entities::Session.new
84
+ session = Caliper::Entities::Session::Session.new
70
85
  session.id = 'https://github.com/readium/session-123456789'
71
86
  session.name = 'session-123456789'
72
87
  session.description = nil
@@ -137,9 +152,7 @@ module Caliper
137
152
 
138
153
  # Ensure that the deserialized session event object conforms
139
154
  expect(session_event).to eql(deser_session_event)
140
-
141
155
  end
142
-
143
156
  end
144
157
  end
145
- end
158
+ end
@@ -1,16 +1,31 @@
1
+ ##
2
+ # This file is part of IMS Caliper Analytics™ and is licensed to
3
+ # IMS Global Learning Consortium, Inc. (http://www.imsglobal.org)
4
+ # under one or more contributor license agreements. See the NOTICE
5
+ # file distributed with this work for additional information.
6
+ #
7
+ # IMS Caliper is free software: you can redistribute it and/or modify it under
8
+ # the terms of the GNU Lesser General Public License as published by the Free
9
+ # Software Foundation, version 3 of the License.
10
+ #
11
+ # IMS Caliper is distributed in the hope that it will be useful, but WITHOUT
12
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
+ # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License along
16
+ # with this program. If not, see http://www.gnu.org/licenses/.
17
+
1
18
  require 'require_all'
2
19
  require_all 'lib/caliper/entities/entity.rb'
3
- require_all 'lib/caliper/entities/session.rb'
4
- require_all 'lib/caliper/entities/software_application.rb'
5
- require_all 'lib/caliper/entities/lis/person.rb'
20
+ require_all 'lib/caliper/entities/agent/software_application.rb'
21
+ require_all 'lib/caliper/entities/agent/person.rb'
6
22
  require_all 'lib/caliper/entities/lis/membership.rb'
7
23
  require_all 'lib/caliper/entities/lis/roles.rb'
8
24
  require_all 'lib/caliper/entities/lis/status.rb'
9
25
  require_all 'lib/caliper/entities/lis/course_section.rb'
10
26
  require_all 'lib/caliper/entities/lis/course_offering.rb'
11
27
  require_all 'lib/caliper/entities/lis/group.rb'
12
- require_all 'lib/caliper/entities/reading/epub_volume.rb'
13
- require_all 'lib/caliper/entities/reading/frame.rb'
28
+ require_all 'lib/caliper/entities/session/session.rb'
14
29
  require_all 'lib/caliper/event/session_event.rb'
15
30
  require_all 'lib/caliper/profiles/session_profile.rb'
16
31
  require 'json_spec'
@@ -20,10 +35,10 @@ module Caliper
20
35
 
21
36
  describe SessionEvent do
22
37
 
23
- it 'should ensure that a SessionEvent (timeout) is correctly created and serialized' do
38
+ it 'should ensure that a TimedOut SessionEvent is correctly created and serialized' do
24
39
 
25
40
  # The Actor (Person/Student))
26
- student = Caliper::Entities::LIS::Person.new
41
+ student = Caliper::Entities::Agent::Person.new
27
42
  student.id = 'https://some-university.edu/user/554433'
28
43
  membership1 = Caliper::Entities::LIS::Membership.new
29
44
  membership1.id = "https://some-university.edu/membership/001"
@@ -58,7 +73,7 @@ module Caliper
58
73
  action = Caliper::Profiles::SessionActions::TIMED_OUT
59
74
 
60
75
  # The Object (edApp)
61
- edApp = Caliper::Entities::SoftwareApplication.new
76
+ edApp = Caliper::Entities::Agent::SoftwareApplication.new
62
77
  edApp.id = 'https://github.com/readium/readium-js-viewer'
63
78
  edApp.name = 'Readium'
64
79
  edApp.hasMembership = []
@@ -66,7 +81,7 @@ module Caliper
66
81
  edApp.dateModified = '2015-09-02T11:30:00.000Z'
67
82
 
68
83
  # The Target (Session)
69
- session = Caliper::Entities::Session.new
84
+ session = Caliper::Entities::Session::Session.new
70
85
  session.id = 'https://github.com/readium/session-123456789'
71
86
  session.name = 'session-123456789'
72
87
  session.description = nil
@@ -137,9 +152,7 @@ module Caliper
137
152
 
138
153
  # Ensure that the deserialized session event object conforms
139
154
  expect(session_event).to eql(deser_session_event)
140
-
141
155
  end
142
-
143
156
  end
144
157
  end
145
- end
158
+ end
@@ -1,7 +1,24 @@
1
+ ##
2
+ # This file is part of IMS Caliper Analytics™ and is licensed to
3
+ # IMS Global Learning Consortium, Inc. (http://www.imsglobal.org)
4
+ # under one or more contributor license agreements. See the NOTICE
5
+ # file distributed with this work for additional information.
6
+ #
7
+ # IMS Caliper is free software: you can redistribute it and/or modify it under
8
+ # the terms of the GNU Lesser General Public License as published by the Free
9
+ # Software Foundation, version 3 of the License.
10
+ #
11
+ # IMS Caliper is distributed in the hope that it will be useful, but WITHOUT
12
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
+ # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License along
16
+ # with this program. If not, see http://www.gnu.org/licenses/.
17
+
1
18
  require 'require_all'
2
19
  require_all 'lib/caliper/entities/entity.rb'
3
- require_all 'lib/caliper/entities/software_application.rb'
4
- require_all 'lib/caliper/entities/lis/person.rb'
20
+ require_all 'lib/caliper/entities/agent/software_application.rb'
21
+ require_all 'lib/caliper/entities/agent/person.rb'
5
22
  require_all 'lib/caliper/entities/lis/membership.rb'
6
23
  require_all 'lib/caliper/entities/lis/roles.rb'
7
24
  require_all 'lib/caliper/entities/lis/status.rb'
@@ -18,10 +35,10 @@ module Caliper
18
35
 
19
36
  describe ViewEvent do
20
37
 
21
- it 'should ensure that a Viewed Event is correctly created and serialized' do
38
+ it 'should ensure that a ViewedEvent is correctly created and serialized' do
22
39
 
23
40
  # The Actor (Person/Student))
24
- student = Caliper::Entities::LIS::Person.new
41
+ student = Caliper::Entities::Agent::Person.new
25
42
  student.id = 'https://some-university.edu/user/554433'
26
43
  membership1 = Caliper::Entities::LIS::Membership.new
27
44
  membership1.id = "https://some-university.edu/membership/001"
@@ -74,7 +91,7 @@ module Caliper
74
91
  frame.isPartOf = ePubVolume.id
75
92
 
76
93
  # The course that is part of the Learning Context (edApp)
77
- edApp = Caliper::Entities::SoftwareApplication.new
94
+ edApp = Caliper::Entities::Agent::SoftwareApplication.new
78
95
  edApp.id = 'https://github.com/readium/readium-js-viewer'
79
96
  edApp.name = 'Readium'
80
97
  edApp.hasMembership = []
@@ -141,9 +158,7 @@ module Caliper
141
158
 
142
159
  # Ensure that the deserialized shared event object conforms
143
160
  expect(viewed_event).to eql(deser_viewed_event)
144
-
145
161
  end
146
-
147
162
  end
148
163
  end
149
- end
164
+ end
@@ -1,8 +1,24 @@
1
+ ##
2
+ # This file is part of IMS Caliper Analytics™ and is licensed to
3
+ # IMS Global Learning Consortium, Inc. (http://www.imsglobal.org)
4
+ # under one or more contributor license agreements. See the NOTICE
5
+ # file distributed with this work for additional information.
6
+ #
7
+ # IMS Caliper is free software: you can redistribute it and/or modify it under
8
+ # the terms of the GNU Lesser General Public License as published by the Free
9
+ # Software Foundation, version 3 of the License.
10
+ #
11
+ # IMS Caliper is distributed in the hope that it will be useful, but WITHOUT
12
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
+ # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License along
16
+ # with this program. If not, see http://www.gnu.org/licenses/.
17
+
1
18
  require 'require_all'
2
19
  require_all 'lib/caliper/entities/entity.rb'
3
- require_all 'lib/caliper/entities/software_application.rb'
4
- require_all 'lib/caliper/entities/session.rb'
5
- require_all 'lib/caliper/entities/lis/person.rb'
20
+ require_all 'lib/caliper/entities/agent/software_application.rb'
21
+ require_all 'lib/caliper/entities/agent/person.rb'
6
22
  require_all 'lib/caliper/entities/lis/membership.rb'
7
23
  require_all 'lib/caliper/entities/lis/roles.rb'
8
24
  require_all 'lib/caliper/entities/lis/status.rb'
@@ -11,6 +27,7 @@ require_all 'lib/caliper/entities/lis/course_offering.rb'
11
27
  require_all 'lib/caliper/entities/lis/group.rb'
12
28
  require_all 'lib/caliper/entities/reading/epub_volume.rb'
13
29
  require_all 'lib/caliper/entities/reading/frame.rb'
30
+ require_all 'lib/caliper/entities/session/session.rb'
14
31
  require_all 'lib/caliper/event/session_event.rb'
15
32
  require_all 'lib/caliper/profiles/session_profile.rb'
16
33
 
@@ -19,7 +36,7 @@ module Helper
19
36
  def session_event
20
37
 
21
38
  # The Actor (Person/Student))
22
- student = Caliper::Entities::LIS::Person.new
39
+ student = Caliper::Entities::Agent::Person.new
23
40
  student.id = 'https://some-university.edu/user/554433'
24
41
  membership1 = Caliper::Entities::LIS::Membership.new
25
42
  membership1.id = "https://some-university.edu/membership/001"
@@ -54,7 +71,7 @@ module Helper
54
71
  action = Caliper::Profiles::SessionActions::LOGGED_IN;
55
72
 
56
73
  # The Object (edApp)
57
- edApp = Caliper::Entities::SoftwareApplication.new
74
+ edApp = Caliper::Entities::Agent::SoftwareApplication.new
58
75
  edApp.id = 'https://github.com/readium/readium-js-viewer'
59
76
  edApp.name = 'Readium'
60
77
  edApp.dateCreated = '2015-08-01T06:00:00.000Z'
@@ -78,7 +95,7 @@ module Helper
78
95
  frame.isPartOf = ePubVolume
79
96
 
80
97
  # The Generated (Session)
81
- session = Caliper::Entities::Session.new
98
+ session = Caliper::Entities::Session::Session.new
82
99
  session.id = 'https://github.com/readium/session-123456789'
83
100
  session.name = 'session-123456789'
84
101
  session.description = nil
@@ -90,7 +107,7 @@ module Helper
90
107
  session.dateModified = '2015-09-02T11:30:00.000Z'
91
108
 
92
109
  # The LIS Course Section for the Caliper Event
93
- edApp = Caliper::Entities::SoftwareApplication.new
110
+ edApp = Caliper::Entities::Agent::SoftwareApplication.new
94
111
  edApp.id = 'https://github.com/readium/readium-js-viewer'
95
112
  edApp.name = 'Readium'
96
113
  edApp.hasMembership = []
@@ -140,6 +157,5 @@ module Helper
140
157
  session_event.group = course
141
158
  session_event.startedAtTime = '2015-09-15T10:15:00.000Z'
142
159
  return session_event
143
-
144
160
  end
145
- end
161
+ end
@@ -1,3 +1,20 @@
1
+ ##
2
+ # This file is part of IMS Caliper Analytics™ and is licensed to
3
+ # IMS Global Learning Consortium, Inc. (http://www.imsglobal.org)
4
+ # under one or more contributor license agreements. See the NOTICE
5
+ # file distributed with this work for additional information.
6
+ #
7
+ # IMS Caliper is free software: you can redistribute it and/or modify it under
8
+ # the terms of the GNU Lesser General Public License as published by the Free
9
+ # Software Foundation, version 3 of the License.
10
+ #
11
+ # IMS Caliper is distributed in the hope that it will be useful, but WITHOUT
12
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
+ # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License along
16
+ # with this program. If not, see http://www.gnu.org/licenses/.
17
+
1
18
  require 'require_all'
2
19
  require_all 'lib/caliper/sensor.rb'
3
20
  require_relative './event_helper'
@@ -9,23 +26,36 @@ module Caliper
9
26
 
10
27
  it "should ensure that we can create and send an event" do
11
28
 
12
- options = {
13
- 'host' => 'http://requestb.in/1i7pr2i1',
14
- 'sensorId' => 'test_sensor_id',
15
- 'apiKey' => 'test_api_key'
16
- }
29
+ options = {
30
+ 'host' => 'http://dev1.intellifylearning.com/v1custom/eventdata',
31
+ 'sensorId' => '0945062D-C8A1-40D7-9834-C1659705EC5B',
32
+ 'apiKey' => '_-kJMcjiSymICwhUaHULbg'
33
+ }
17
34
 
18
- sensor = Sensor.new options
19
- event = session_event
20
-
21
- # NOTE: To test sending events to an actual endpoint,
35
+ sensor = Sensor.new options
36
+
37
+ # Load JSON from caliper-common-fixtures for comparison
38
+ # NOTE - sym link to caliper-common-fixtures needs to exist under spec/fixtures
39
+ file = File.read('spec/fixtures/caliperNavigationEvent.json')
40
+ data_hash = JSON.parse(file)
41
+ # puts "JSON from file = #{data_hash}"
42
+ deser_session_event = Caliper::Event::SessionEvent.new
43
+ deser_session_event.from_json data_hash
44
+
45
+ # NOTE: To test sending events to an actual endpoint,
46
+ # for now, uncomment the line below after setting options.host above
47
+ # to a new/valid request bin or end point URL.
48
+
49
+ response = sensor.send deser_session_event
50
+
51
+ p response
52
+
53
+
54
+ # NOTE: To test sending events to an actual endpoint,
22
55
  # for now, uncomment the line below after setting options.host above
23
56
  # to a new/valid request bin or end point URL.
24
57
 
25
- response = sensor.send event
26
- p response
27
-
58
+ # sensor.send event
28
59
  end
29
-
30
60
  end
31
61
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,20 @@
1
+ ##
2
+ # This file is part of IMS Caliper Analytics™ and is licensed to
3
+ # IMS Global Learning Consortium, Inc. (http://www.imsglobal.org)
4
+ # under one or more contributor license agreements. See the NOTICE
5
+ # file distributed with this work for additional information.
6
+ #
7
+ # IMS Caliper is free software: you can redistribute it and/or modify it under
8
+ # the terms of the GNU Lesser General Public License as published by the Free
9
+ # Software Foundation, version 3 of the License.
10
+ #
11
+ # IMS Caliper is distributed in the hope that it will be useful, but WITHOUT
12
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
+ # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License along
16
+ # with this program. If not, see http://www.gnu.org/licenses/.
17
+
1
18
  require 'simplecov'
2
19
  require 'simplecov-rcov'
3
20
  require 'require_all'
@@ -13,7 +30,6 @@ SimpleCov.start('test_frameworks') do
13
30
  }
14
31
  end
15
32
 
16
-
17
33
  RSpec.configure do |config|
18
34
  # ## Mock Framework
19
35
  config.mock_with :mocha
@@ -23,5 +39,4 @@ RSpec.configure do |config|
23
39
  # the seed, which is printed after each run.
24
40
  # --seed 1234
25
41
  config.order = "random"
26
- end
27
-
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ims_caliper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caliper Dev Group
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-23 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is the implementation of IMSGlobal Caliper in Ruby
14
14
  email:
@@ -18,12 +18,6 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - .gitignore
21
- - .idea/caliper-ruby.iml
22
- - .idea/encodings.xml
23
- - .idea/misc.xml
24
- - .idea/modules.xml
25
- - .idea/scopes/scope_settings.xml
26
- - .idea/vcs.xml
27
21
  - Gemfile
28
22
  - Gemfile.lock
29
23
  - LICENSE
@@ -33,6 +27,9 @@ files:
33
27
  - config/locales/en.yml
34
28
  - lib/caliper.rb
35
29
  - lib/caliper/defaults.rb
30
+ - lib/caliper/entities/agent/organization.rb
31
+ - lib/caliper/entities/agent/person.rb
32
+ - lib/caliper/entities/agent/software_application.rb
36
33
  - lib/caliper/entities/annotation/annotation.rb
37
34
  - lib/caliper/entities/annotation/bookmark_annotation.rb
38
35
  - lib/caliper/entities/annotation/highlight_annotation.rb
@@ -53,8 +50,6 @@ files:
53
50
  - lib/caliper/entities/lis/course_section.rb
54
51
  - lib/caliper/entities/lis/group.rb
55
52
  - lib/caliper/entities/lis/membership.rb
56
- - lib/caliper/entities/lis/organization.rb
57
- - lib/caliper/entities/lis/person.rb
58
53
  - lib/caliper/entities/lis/roles.rb
59
54
  - lib/caliper/entities/lis/status.rb
60
55
  - lib/caliper/entities/media/audio_object.rb
@@ -68,6 +63,7 @@ files:
68
63
  - lib/caliper/entities/reading/epub_sub_chapter.rb
69
64
  - lib/caliper/entities/reading/epub_volume.rb
70
65
  - lib/caliper/entities/reading/frame.rb
66
+ - lib/caliper/entities/reading/web_page.rb
71
67
  - lib/caliper/entities/response/fillin_blank_response.rb
72
68
  - lib/caliper/entities/response/multiple_choice_response.rb
73
69
  - lib/caliper/entities/response/multiple_response_response.rb
@@ -79,10 +75,10 @@ files:
79
75
  - lib/caliper/entities/schemadotorg/software_application.rb
80
76
  - lib/caliper/entities/schemadotorg/thing.rb
81
77
  - lib/caliper/entities/schemadotorg/web_page.rb
82
- - lib/caliper/entities/session.rb
83
- - lib/caliper/entities/software_application.rb
78
+ - lib/caliper/entities/session/session.rb
84
79
  - lib/caliper/entities/targetable.rb
85
- - lib/caliper/entities/web_page.rb
80
+ - lib/caliper/entities/w3c/membership.rb
81
+ - lib/caliper/entities/w3c/organization.rb
86
82
  - lib/caliper/entity_envelope.rb
87
83
  - lib/caliper/event/annotation_event.rb
88
84
  - lib/caliper/event/assessment_event.rb
@@ -99,6 +95,7 @@ files:
99
95
  - lib/caliper/jsonable.rb
100
96
  - lib/caliper/options.rb
101
97
  - lib/caliper/profiles/annotation_profile.rb
98
+ - lib/caliper/profiles/assessment_item_profile.rb
102
99
  - lib/caliper/profiles/assessment_profile.rb
103
100
  - lib/caliper/profiles/assignable_profile.rb
104
101
  - lib/caliper/profiles/media_profile.rb
@@ -121,10 +118,10 @@ files:
121
118
  - lib/caliper/validators/session_logout_event_validator.rb
122
119
  - lib/caliper/validators/time_check.rb
123
120
  - lib/caliper/version.rb
121
+ - spec/lib/entities/agent/person_spec.rb
122
+ - spec/lib/entities/agent/student.json
124
123
  - spec/lib/entities/entity.json
125
124
  - spec/lib/entities/entity_spec.rb
126
- - spec/lib/entities/lis/person_spec.rb
127
- - spec/lib/entities/lis/student.json
128
125
  - spec/lib/event/annotation_event_bookmark_spec.rb
129
126
  - spec/lib/event/annotation_event_highlight_spec.rb
130
127
  - spec/lib/event/annotation_event_shared_spec.rb
@@ -132,6 +129,7 @@ files:
132
129
  - spec/lib/event/assessment_event_spec.rb
133
130
  - spec/lib/event/assessment_item_completed_event_spec.rb
134
131
  - spec/lib/event/assessment_item_started_event_spec.rb
132
+ - spec/lib/event/assignable_event_spec.rb
135
133
  - spec/lib/event/media_event_spec.rb
136
134
  - spec/lib/event/navigated_event_spec.rb
137
135
  - spec/lib/event/session_event_login_spec.rb
@@ -139,7 +137,6 @@ files:
139
137
  - spec/lib/event/session_event_timeout_spec.rb
140
138
  - spec/lib/event/viewed_event_spec.rb
141
139
  - spec/lib/event_helper.rb
142
- - spec/lib/request/http_request_spec.rb
143
140
  - spec/lib/sensor_spec.rb
144
141
  - spec/spec_helper.rb
145
142
  homepage: https://github.com/IMSGlobal/caliper-ruby
@@ -152,25 +149,25 @@ require_paths:
152
149
  - lib
153
150
  required_ruby_version: !ruby/object:Gem::Requirement
154
151
  requirements:
155
- - - ! '>='
152
+ - - '>='
156
153
  - !ruby/object:Gem::Version
157
154
  version: '0'
158
155
  required_rubygems_version: !ruby/object:Gem::Requirement
159
156
  requirements:
160
- - - ! '>='
157
+ - - '>='
161
158
  - !ruby/object:Gem::Version
162
159
  version: '0'
163
160
  requirements: []
164
161
  rubyforge_project:
165
- rubygems_version: 2.2.2
162
+ rubygems_version: 2.4.6
166
163
  signing_key:
167
164
  specification_version: 4
168
165
  summary: Caliper Sensor API
169
166
  test_files:
167
+ - spec/lib/entities/agent/person_spec.rb
168
+ - spec/lib/entities/agent/student.json
170
169
  - spec/lib/entities/entity.json
171
170
  - spec/lib/entities/entity_spec.rb
172
- - spec/lib/entities/lis/person_spec.rb
173
- - spec/lib/entities/lis/student.json
174
171
  - spec/lib/event/annotation_event_bookmark_spec.rb
175
172
  - spec/lib/event/annotation_event_highlight_spec.rb
176
173
  - spec/lib/event/annotation_event_shared_spec.rb
@@ -178,6 +175,7 @@ test_files:
178
175
  - spec/lib/event/assessment_event_spec.rb
179
176
  - spec/lib/event/assessment_item_completed_event_spec.rb
180
177
  - spec/lib/event/assessment_item_started_event_spec.rb
178
+ - spec/lib/event/assignable_event_spec.rb
181
179
  - spec/lib/event/media_event_spec.rb
182
180
  - spec/lib/event/navigated_event_spec.rb
183
181
  - spec/lib/event/session_event_login_spec.rb
@@ -185,6 +183,5 @@ test_files:
185
183
  - spec/lib/event/session_event_timeout_spec.rb
186
184
  - spec/lib/event/viewed_event_spec.rb
187
185
  - spec/lib/event_helper.rb
188
- - spec/lib/request/http_request_spec.rb
189
186
  - spec/lib/sensor_spec.rb
190
187
  - spec/spec_helper.rb