ims_caliper 0.9.3.15 → 1.0.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.
- checksums.yaml +4 -4
- data/README.md +10 -5
- data/lib/caliper/{profiles/annotation_profile.rb → actions/annotation_actions.rb} +3 -41
- data/lib/caliper/{profiles/assessment_profile.rb → actions/assessment_actions.rb} +3 -19
- data/lib/caliper/actions/assessment_item_actions.rb +31 -0
- data/lib/caliper/{profiles/assignable_profile.rb → actions/assignable_actions.rb} +3 -28
- data/lib/caliper/{profiles/media_profile.rb → actions/media_actions.rb} +4 -29
- data/lib/caliper/{event/view_event.rb → actions/navigation_actions.rb} +5 -11
- data/lib/caliper/{validators/event_validator_context.rb → actions/outcome_actions.rb} +7 -15
- data/lib/caliper/{event/navigation_event.rb → actions/reading_actions.rb} +6 -14
- data/lib/caliper/actions/session_actions.rb +30 -0
- data/lib/caliper/context/context.rb +31 -0
- data/lib/caliper/entities/agent/organization.rb +4 -3
- data/lib/caliper/entities/agent/person.rb +4 -3
- data/lib/caliper/entities/agent/software_application.rb +4 -3
- data/lib/caliper/entities/annotation/annotation.rb +4 -12
- data/lib/caliper/entities/annotation/annotation_type.rb +32 -0
- data/lib/caliper/entities/annotation/bookmark_annotation.rb +3 -1
- data/lib/caliper/entities/annotation/highlight_annotation.rb +4 -4
- data/lib/caliper/entities/annotation/shared_annotation.rb +3 -1
- data/lib/caliper/entities/annotation/tag_annotation.rb +3 -1
- data/lib/caliper/entities/assessment/assessment.rb +1 -1
- data/lib/caliper/entities/assessment/assessment_item.rb +2 -0
- data/lib/caliper/entities/assignable/assignable_digital_resource.rb +3 -13
- data/lib/caliper/{event/session_event.rb → entities/assignable/assignable_digital_resource_type.rb} +7 -11
- data/lib/caliper/entities/assignable/attempt.rb +8 -9
- data/lib/caliper/entities/digital_resource.rb +5 -22
- data/lib/caliper/entities/digital_resource_type.rb +33 -0
- data/lib/caliper/entities/entity.rb +7 -37
- data/lib/caliper/entities/{learning_context.rb → entity_base.rb} +19 -15
- data/lib/caliper/entities/entity_type.rb +39 -0
- data/lib/caliper/entities/foaf/agent.rb +0 -2
- data/lib/caliper/entities/jsonable.rb +14 -3
- data/lib/caliper/entities/learning_objective.rb +4 -3
- data/lib/caliper/entities/lis/course_offering.rb +9 -6
- data/lib/caliper/entities/lis/course_section.rb +3 -1
- data/lib/caliper/entities/lis/group.rb +5 -3
- data/lib/caliper/entities/lis/membership.rb +5 -7
- data/lib/caliper/entities/media/audio_object.rb +2 -1
- data/lib/caliper/entities/media/image_object.rb +2 -1
- data/lib/caliper/entities/media/media_location.rb +2 -1
- data/lib/caliper/entities/media/media_object.rb +2 -9
- data/lib/caliper/entities/media/media_object_type.rb +31 -0
- data/lib/caliper/entities/media/video_object.rb +2 -1
- data/lib/caliper/entities/outcome/result.rb +23 -16
- data/lib/caliper/entities/reading/epub_chapter.rb +2 -1
- data/lib/caliper/entities/reading/epub_part.rb +2 -1
- data/lib/caliper/entities/reading/epub_sub_chapter.rb +2 -1
- data/lib/caliper/entities/reading/epub_volume.rb +2 -1
- data/lib/caliper/entities/reading/frame.rb +4 -3
- data/lib/caliper/entities/reading/web_page.rb +3 -2
- data/lib/caliper/entities/response/fillin_blank_response.rb +3 -3
- data/lib/caliper/entities/response/multiple_choice_response.rb +3 -3
- data/lib/caliper/entities/response/multiple_response_response.rb +3 -3
- data/lib/caliper/entities/response/response.rb +8 -10
- data/lib/caliper/entities/response/response_type.rb +5 -5
- data/lib/caliper/entities/response/select_type_response.rb +3 -3
- data/lib/caliper/entities/response/true_false_response.rb +2 -3
- data/lib/caliper/entities/session/session.rb +8 -7
- data/lib/caliper/{event → events}/annotation_event.rb +11 -3
- data/lib/caliper/{event → events}/assessment_event.rb +11 -8
- data/lib/caliper/{event → events}/assessment_item_event.rb +11 -8
- data/lib/caliper/{event → events}/assignable_event.rb +11 -8
- data/lib/caliper/{profiles/profile.rb → events/event.rb} +15 -15
- data/lib/caliper/events/event_context.rb +24 -0
- data/lib/caliper/events/event_type.rb +33 -0
- data/lib/caliper/{event → events}/jsonable.rb +2 -2
- data/lib/caliper/{event → events}/media_event.rb +11 -8
- data/lib/caliper/events/navigation_event.rb +47 -0
- data/lib/caliper/events/outcome_event.rb +44 -0
- data/lib/caliper/{event/outcome_event.rb → events/reading_event.rb} +13 -10
- data/lib/caliper/events/session_event.rb +42 -0
- data/lib/caliper/events/view_event.rb +44 -0
- data/lib/caliper/request/envelope.rb +4 -15
- data/lib/caliper/request/event_store_requestor.rb +1 -1
- data/lib/caliper/request/{envelope_jsonable.rb → jsonable.rb} +9 -11
- data/lib/caliper/sensor.rb +1 -1
- data/lib/caliper/version.rb +1 -1
- data/lib/caliper.rb +1 -1
- data/spec/lib/entities/agent/{student.json → person.json} +4 -3
- data/spec/lib/entities/agent/person_spec.rb +5 -6
- data/spec/lib/entities/assessment/assessment.json +23 -0
- data/spec/lib/entities/assessment/assessment_spec.rb +54 -0
- data/spec/lib/event_helper.rb +33 -41
- data/spec/lib/{event/annotation_event_bookmark_spec.rb → events/annotation_bookmarked_event_spec.rb} +36 -46
- data/spec/lib/{event/annotation_event_highlight_spec.rb → events/annotation_highlighted_event_spec.rb} +36 -46
- data/spec/lib/{event/annotation_event_shared_spec.rb → events/annotation_shared_event_spec.rb} +42 -52
- data/spec/lib/{event/annotation_event_tag_spec.rb → events/annotation_tagged_event_spec.rb} +36 -46
- data/spec/lib/{event → events}/assessment_item_completed_event_spec.rb +41 -65
- data/spec/lib/{event → events}/assessment_item_started_event_spec.rb +38 -56
- data/spec/lib/{event/assessment_event_spec.rb → events/assessment_started_event_spec.rb} +36 -51
- data/spec/lib/{event/assignable_event_spec.rb → events/assignable_activated_event_spec.rb} +37 -52
- data/spec/lib/{event/media_event_spec.rb → events/media_paused_video_event_spec.rb} +33 -43
- data/spec/lib/{event/navigated_event_spec.rb → events/navigation_navigated_to_event_spec.rb} +36 -45
- data/spec/lib/events/outcome_graded_event_spec.rb +163 -0
- data/spec/lib/{event/session_event_login_spec.rb → events/session_logged_in_event_spec.rb} +38 -46
- data/spec/lib/{event/session_event_logout_spec.rb → events/session_logged_out-event_spec.rb} +28 -37
- data/spec/lib/{event/session_event_timeout_spec.rb → events/session_timed_out_event_spec.rb} +24 -34
- data/spec/lib/{event/viewed_event_spec.rb → events/view_viewed_event_spec.rb} +33 -41
- data/spec/lib/request/{http_requestor_spec.rb → http_requestor_single_event_spec.rb} +46 -47
- data/spec/lib/request/http_requestor_single_minimal_event_spec.rb +84 -0
- data/spec/lib/sensor_spec.rb +1 -1
- metadata +77 -70
- data/lib/caliper/event/event.rb +0 -114
- data/lib/caliper/profiles/assessment_item_profile.rb +0 -48
- data/lib/caliper/profiles/reading_profile.rb +0 -56
- data/lib/caliper/profiles/session_profile.rb +0 -46
- data/lib/caliper/validators/error_message.rb +0 -63
- data/lib/caliper/validators/event_validator.rb +0 -57
- data/lib/caliper/validators/property_type_check.rb +0 -33
- data/lib/caliper/validators/session_login_event_validator.rb +0 -121
- data/lib/caliper/validators/session_logout_event_validator.rb +0 -120
- data/lib/caliper/validators/time_check.rb +0 -50
- data/spec/lib/entities/entity.json +0 -9
- data/spec/lib/entities/entity_spec.rb +0 -52
data/spec/lib/sensor_spec.rb
CHANGED
@@ -26,7 +26,7 @@ module Caliper
|
|
26
26
|
|
27
27
|
it "should ensure that we can create and send an event" do
|
28
28
|
|
29
|
-
id = '
|
29
|
+
id = 'https://example.edu/sensor/001'
|
30
30
|
options = {
|
31
31
|
'host' => 'http://requestb.in/1i7pr2i1',
|
32
32
|
'apiKey' => 'test_api_key'
|
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.
|
4
|
+
version: 1.0.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:
|
11
|
+
date: 2016-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This is the implementation of IMSGlobal Caliper in Ruby
|
14
14
|
email:
|
@@ -17,7 +17,7 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- .gitignore
|
20
|
+
- ".gitignore"
|
21
21
|
- Gemfile
|
22
22
|
- Gemfile.lock
|
23
23
|
- LICENSE
|
@@ -26,11 +26,22 @@ files:
|
|
26
26
|
- caliper.gemspec
|
27
27
|
- config/locales/en.yml
|
28
28
|
- lib/caliper.rb
|
29
|
+
- lib/caliper/actions/annotation_actions.rb
|
30
|
+
- lib/caliper/actions/assessment_actions.rb
|
31
|
+
- lib/caliper/actions/assessment_item_actions.rb
|
32
|
+
- lib/caliper/actions/assignable_actions.rb
|
33
|
+
- lib/caliper/actions/media_actions.rb
|
34
|
+
- lib/caliper/actions/navigation_actions.rb
|
35
|
+
- lib/caliper/actions/outcome_actions.rb
|
36
|
+
- lib/caliper/actions/reading_actions.rb
|
37
|
+
- lib/caliper/actions/session_actions.rb
|
38
|
+
- lib/caliper/context/context.rb
|
29
39
|
- lib/caliper/defaults.rb
|
30
40
|
- lib/caliper/entities/agent/organization.rb
|
31
41
|
- lib/caliper/entities/agent/person.rb
|
32
42
|
- lib/caliper/entities/agent/software_application.rb
|
33
43
|
- lib/caliper/entities/annotation/annotation.rb
|
44
|
+
- lib/caliper/entities/annotation/annotation_type.rb
|
34
45
|
- lib/caliper/entities/annotation/bookmark_annotation.rb
|
35
46
|
- lib/caliper/entities/annotation/highlight_annotation.rb
|
36
47
|
- lib/caliper/entities/annotation/shared_annotation.rb
|
@@ -38,13 +49,16 @@ files:
|
|
38
49
|
- lib/caliper/entities/assessment/assessment.rb
|
39
50
|
- lib/caliper/entities/assessment/assessment_item.rb
|
40
51
|
- lib/caliper/entities/assignable/assignable_digital_resource.rb
|
52
|
+
- lib/caliper/entities/assignable/assignable_digital_resource_type.rb
|
41
53
|
- lib/caliper/entities/assignable/attempt.rb
|
42
54
|
- lib/caliper/entities/digital_resource.rb
|
55
|
+
- lib/caliper/entities/digital_resource_type.rb
|
43
56
|
- lib/caliper/entities/entity.rb
|
57
|
+
- lib/caliper/entities/entity_base.rb
|
58
|
+
- lib/caliper/entities/entity_type.rb
|
44
59
|
- lib/caliper/entities/foaf/agent.rb
|
45
60
|
- lib/caliper/entities/generatable.rb
|
46
61
|
- lib/caliper/entities/jsonable.rb
|
47
|
-
- lib/caliper/entities/learning_context.rb
|
48
62
|
- lib/caliper/entities/learning_objective.rb
|
49
63
|
- lib/caliper/entities/lis/course_offering.rb
|
50
64
|
- lib/caliper/entities/lis/course_section.rb
|
@@ -56,6 +70,7 @@ files:
|
|
56
70
|
- lib/caliper/entities/media/image_object.rb
|
57
71
|
- lib/caliper/entities/media/media_location.rb
|
58
72
|
- lib/caliper/entities/media/media_object.rb
|
73
|
+
- lib/caliper/entities/media/media_object_type.rb
|
59
74
|
- lib/caliper/entities/media/video_object.rb
|
60
75
|
- lib/caliper/entities/outcome/result.rb
|
61
76
|
- lib/caliper/entities/reading/epub_chapter.rb
|
@@ -79,64 +94,54 @@ files:
|
|
79
94
|
- lib/caliper/entities/targetable.rb
|
80
95
|
- lib/caliper/entities/w3c/membership.rb
|
81
96
|
- lib/caliper/entities/w3c/organization.rb
|
82
|
-
- lib/caliper/
|
83
|
-
- lib/caliper/
|
84
|
-
- lib/caliper/
|
85
|
-
- lib/caliper/
|
86
|
-
- lib/caliper/
|
87
|
-
- lib/caliper/
|
88
|
-
- lib/caliper/
|
89
|
-
- lib/caliper/
|
90
|
-
- lib/caliper/
|
91
|
-
- lib/caliper/
|
92
|
-
- lib/caliper/
|
97
|
+
- lib/caliper/events/annotation_event.rb
|
98
|
+
- lib/caliper/events/assessment_event.rb
|
99
|
+
- lib/caliper/events/assessment_item_event.rb
|
100
|
+
- lib/caliper/events/assignable_event.rb
|
101
|
+
- lib/caliper/events/event.rb
|
102
|
+
- lib/caliper/events/event_context.rb
|
103
|
+
- lib/caliper/events/event_type.rb
|
104
|
+
- lib/caliper/events/jsonable.rb
|
105
|
+
- lib/caliper/events/media_event.rb
|
106
|
+
- lib/caliper/events/navigation_event.rb
|
107
|
+
- lib/caliper/events/outcome_event.rb
|
108
|
+
- lib/caliper/events/reading_event.rb
|
109
|
+
- lib/caliper/events/session_event.rb
|
110
|
+
- lib/caliper/events/view_event.rb
|
93
111
|
- lib/caliper/jsonable.rb
|
94
112
|
- lib/caliper/options.rb
|
95
|
-
- lib/caliper/profiles/annotation_profile.rb
|
96
|
-
- lib/caliper/profiles/assessment_item_profile.rb
|
97
|
-
- lib/caliper/profiles/assessment_profile.rb
|
98
|
-
- lib/caliper/profiles/assignable_profile.rb
|
99
|
-
- lib/caliper/profiles/media_profile.rb
|
100
|
-
- lib/caliper/profiles/profile.rb
|
101
|
-
- lib/caliper/profiles/reading_profile.rb
|
102
|
-
- lib/caliper/profiles/session_profile.rb
|
103
113
|
- lib/caliper/request/envelope.rb
|
104
|
-
- lib/caliper/request/envelope_jsonable.rb
|
105
114
|
- lib/caliper/request/event_store_requestor.rb
|
106
115
|
- lib/caliper/request/http_requestor.rb
|
116
|
+
- lib/caliper/request/jsonable.rb
|
107
117
|
- lib/caliper/sensor.rb
|
108
118
|
- lib/caliper/stats/atomic_wrapper.rb
|
109
119
|
- lib/caliper/stats/statistic.rb
|
110
120
|
- lib/caliper/stats/statistics.rb
|
111
121
|
- lib/caliper/stats/statistics_map.rb
|
112
|
-
- lib/caliper/validators/error_message.rb
|
113
|
-
- lib/caliper/validators/event_validator.rb
|
114
|
-
- lib/caliper/validators/event_validator_context.rb
|
115
|
-
- lib/caliper/validators/property_type_check.rb
|
116
|
-
- lib/caliper/validators/session_login_event_validator.rb
|
117
|
-
- lib/caliper/validators/session_logout_event_validator.rb
|
118
|
-
- lib/caliper/validators/time_check.rb
|
119
122
|
- lib/caliper/version.rb
|
123
|
+
- spec/lib/entities/agent/person.json
|
120
124
|
- spec/lib/entities/agent/person_spec.rb
|
121
|
-
- spec/lib/entities/
|
122
|
-
- spec/lib/entities/
|
123
|
-
- spec/lib/entities/entity_spec.rb
|
124
|
-
- spec/lib/event/annotation_event_bookmark_spec.rb
|
125
|
-
- spec/lib/event/annotation_event_highlight_spec.rb
|
126
|
-
- spec/lib/event/annotation_event_shared_spec.rb
|
127
|
-
- spec/lib/event/annotation_event_tag_spec.rb
|
128
|
-
- spec/lib/event/assessment_event_spec.rb
|
129
|
-
- spec/lib/event/assessment_item_completed_event_spec.rb
|
130
|
-
- spec/lib/event/assessment_item_started_event_spec.rb
|
131
|
-
- spec/lib/event/assignable_event_spec.rb
|
132
|
-
- spec/lib/event/media_event_spec.rb
|
133
|
-
- spec/lib/event/navigated_event_spec.rb
|
134
|
-
- spec/lib/event/session_event_login_spec.rb
|
135
|
-
- spec/lib/event/session_event_logout_spec.rb
|
136
|
-
- spec/lib/event/session_event_timeout_spec.rb
|
137
|
-
- spec/lib/event/viewed_event_spec.rb
|
125
|
+
- spec/lib/entities/assessment/assessment.json
|
126
|
+
- spec/lib/entities/assessment/assessment_spec.rb
|
138
127
|
- spec/lib/event_helper.rb
|
139
|
-
- spec/lib/
|
128
|
+
- spec/lib/events/annotation_bookmarked_event_spec.rb
|
129
|
+
- spec/lib/events/annotation_highlighted_event_spec.rb
|
130
|
+
- spec/lib/events/annotation_shared_event_spec.rb
|
131
|
+
- spec/lib/events/annotation_tagged_event_spec.rb
|
132
|
+
- spec/lib/events/assessment_item_completed_event_spec.rb
|
133
|
+
- spec/lib/events/assessment_item_started_event_spec.rb
|
134
|
+
- spec/lib/events/assessment_started_event_spec.rb
|
135
|
+
- spec/lib/events/assignable_activated_event_spec.rb
|
136
|
+
- spec/lib/events/media_paused_video_event_spec.rb
|
137
|
+
- spec/lib/events/navigation_navigated_to_event_spec.rb
|
138
|
+
- spec/lib/events/outcome_graded_event_spec.rb
|
139
|
+
- spec/lib/events/session_logged_in_event_spec.rb
|
140
|
+
- spec/lib/events/session_logged_out-event_spec.rb
|
141
|
+
- spec/lib/events/session_timed_out_event_spec.rb
|
142
|
+
- spec/lib/events/view_viewed_event_spec.rb
|
143
|
+
- spec/lib/request/http_requestor_single_event_spec.rb
|
144
|
+
- spec/lib/request/http_requestor_single_minimal_event_spec.rb
|
140
145
|
- spec/lib/sensor_spec.rb
|
141
146
|
- spec/spec_helper.rb
|
142
147
|
homepage: https://github.com/IMSGlobal/caliper-ruby
|
@@ -149,40 +154,42 @@ require_paths:
|
|
149
154
|
- lib
|
150
155
|
required_ruby_version: !ruby/object:Gem::Requirement
|
151
156
|
requirements:
|
152
|
-
- -
|
157
|
+
- - ">="
|
153
158
|
- !ruby/object:Gem::Version
|
154
159
|
version: '0'
|
155
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
161
|
requirements:
|
157
|
-
- -
|
162
|
+
- - ">="
|
158
163
|
- !ruby/object:Gem::Version
|
159
164
|
version: '0'
|
160
165
|
requirements: []
|
161
166
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.
|
167
|
+
rubygems_version: 2.5.1
|
163
168
|
signing_key:
|
164
169
|
specification_version: 4
|
165
170
|
summary: Caliper Sensor API
|
166
171
|
test_files:
|
172
|
+
- spec/lib/entities/agent/person.json
|
167
173
|
- spec/lib/entities/agent/person_spec.rb
|
168
|
-
- spec/lib/entities/
|
169
|
-
- spec/lib/entities/
|
170
|
-
- spec/lib/entities/entity_spec.rb
|
171
|
-
- spec/lib/event/annotation_event_bookmark_spec.rb
|
172
|
-
- spec/lib/event/annotation_event_highlight_spec.rb
|
173
|
-
- spec/lib/event/annotation_event_shared_spec.rb
|
174
|
-
- spec/lib/event/annotation_event_tag_spec.rb
|
175
|
-
- spec/lib/event/assessment_event_spec.rb
|
176
|
-
- spec/lib/event/assessment_item_completed_event_spec.rb
|
177
|
-
- spec/lib/event/assessment_item_started_event_spec.rb
|
178
|
-
- spec/lib/event/assignable_event_spec.rb
|
179
|
-
- spec/lib/event/media_event_spec.rb
|
180
|
-
- spec/lib/event/navigated_event_spec.rb
|
181
|
-
- spec/lib/event/session_event_login_spec.rb
|
182
|
-
- spec/lib/event/session_event_logout_spec.rb
|
183
|
-
- spec/lib/event/session_event_timeout_spec.rb
|
184
|
-
- spec/lib/event/viewed_event_spec.rb
|
174
|
+
- spec/lib/entities/assessment/assessment.json
|
175
|
+
- spec/lib/entities/assessment/assessment_spec.rb
|
185
176
|
- spec/lib/event_helper.rb
|
186
|
-
- spec/lib/
|
177
|
+
- spec/lib/events/annotation_bookmarked_event_spec.rb
|
178
|
+
- spec/lib/events/annotation_highlighted_event_spec.rb
|
179
|
+
- spec/lib/events/annotation_shared_event_spec.rb
|
180
|
+
- spec/lib/events/annotation_tagged_event_spec.rb
|
181
|
+
- spec/lib/events/assessment_item_completed_event_spec.rb
|
182
|
+
- spec/lib/events/assessment_item_started_event_spec.rb
|
183
|
+
- spec/lib/events/assessment_started_event_spec.rb
|
184
|
+
- spec/lib/events/assignable_activated_event_spec.rb
|
185
|
+
- spec/lib/events/media_paused_video_event_spec.rb
|
186
|
+
- spec/lib/events/navigation_navigated_to_event_spec.rb
|
187
|
+
- spec/lib/events/outcome_graded_event_spec.rb
|
188
|
+
- spec/lib/events/session_logged_in_event_spec.rb
|
189
|
+
- spec/lib/events/session_logged_out-event_spec.rb
|
190
|
+
- spec/lib/events/session_timed_out_event_spec.rb
|
191
|
+
- spec/lib/events/view_viewed_event_spec.rb
|
192
|
+
- spec/lib/request/http_requestor_single_event_spec.rb
|
193
|
+
- spec/lib/request/http_requestor_single_minimal_event_spec.rb
|
187
194
|
- spec/lib/sensor_spec.rb
|
188
195
|
- spec/spec_helper.rb
|
data/lib/caliper/event/event.rb
DELETED
@@ -1,114 +0,0 @@
|
|
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
|
-
|
18
|
-
require 'json'
|
19
|
-
require_relative './jsonable'
|
20
|
-
|
21
|
-
#
|
22
|
-
# Base event.
|
23
|
-
#
|
24
|
-
module Caliper
|
25
|
-
module Event
|
26
|
-
module EventContext
|
27
|
-
ANNOTATION = "http://purl.imsglobal.org/ctx/caliper/v1/AnnotationEvent"
|
28
|
-
ASSESSMENT = "http://purl.imsglobal.org/ctx/caliper/v1/AssessmentEvent"
|
29
|
-
ASSESSMENT_ITEM = "http://purl.imsglobal.org/ctx/caliper/v1/AssessmentItemEvent"
|
30
|
-
ASSIGNABLE = "http://purl.imsglobal.org/ctx/caliper/v1/AssignableEvent"
|
31
|
-
EVENT = "http://purl.imsglobal.org/ctx/caliper/v1/Event"
|
32
|
-
MEDIA = "http://purl.imsglobal.org/ctx/caliper/v1/MediaEvent"
|
33
|
-
NAVIGATION = "http://purl.imsglobal.org/ctx/caliper/v1/NavigationEvent"
|
34
|
-
OUTCOME = "http://purl.imsglobal.org/ctx/caliper/v1/OutcomeEvent"
|
35
|
-
SESSION = "http://purl.imsglobal.org/ctx/caliper/v1/SessionEvent"
|
36
|
-
VIEW = "http://purl.imsglobal.org/ctx/caliper/v1/ViewEvent"
|
37
|
-
end
|
38
|
-
|
39
|
-
module EventType
|
40
|
-
ANNOTATION = "http://purl.imsglobal.org/caliper/v1/AnnotationEvent"
|
41
|
-
ASSESSMENT = "http://purl.imsglobal.org/caliper/v1/AssessmentEvent"
|
42
|
-
ASSESSMENT_ITEM = "http://purl.imsglobal.org/caliper/v1/AssessmentItemEvent"
|
43
|
-
ASSIGNABLE = "http://purl.imsglobal.org/caliper/v1/AssignableEvent"
|
44
|
-
EVENT = "http://purl.imsglobal.org/caliper/v1/Event"
|
45
|
-
MEDIA = "http://purl.imsglobal.org/caliper/v1/MediaEvent"
|
46
|
-
NAVIGATION = "http://purl.imsglobal.org/caliper/v1/NavigationEvent"
|
47
|
-
OUTCOME = "http://purl.imsglobal.org/caliper/v1/OutcomeEvent"
|
48
|
-
SESSION = "http://purl.imsglobal.org/caliper/v1/SessionEvent"
|
49
|
-
VIEW = "http://purl.imsglobal.org/caliper/v1/ViewEvent"
|
50
|
-
end
|
51
|
-
|
52
|
-
class Event
|
53
|
-
include Caliper::Event::Jsonable
|
54
|
-
|
55
|
-
attr_accessor :context, # String Required - the JSON-LD context for the Event
|
56
|
-
|
57
|
-
# Required - the type of the Event
|
58
|
-
:type,
|
59
|
-
|
60
|
-
# Required - Agent (User, System) that performed the action
|
61
|
-
:actor,
|
62
|
-
|
63
|
-
# Required - Action performed by Agent From Metric Profile (String)
|
64
|
-
:action,
|
65
|
-
|
66
|
-
# Required - Object
|
67
|
-
:object,
|
68
|
-
|
69
|
-
# Optional - Targeted object (Targetable)
|
70
|
-
:target,
|
71
|
-
|
72
|
-
# Optional - Generated object (Generatable)
|
73
|
-
:generated,
|
74
|
-
|
75
|
-
# Required time that the event was started at (ISO-8601 date string)
|
76
|
-
:startedAtTime,
|
77
|
-
|
78
|
-
# An optional time that the event ended at (ISO-8601 date string)
|
79
|
-
:endedAtTime,
|
80
|
-
|
81
|
-
# An xsd:duration (http://books.xmlschemata.org/relaxng/ch19-77073.html)
|
82
|
-
# The String format is expected to be PnYnMnDTnHnMnS
|
83
|
-
# Valid values include PT1004199059S, PT130S, PT2M10S, P1DT2S, -P1Y, or P1Y2M3DT5H20M30.123S.
|
84
|
-
# The following values are invalid: 1Y (leading P is missing), P1S (T separator is missing),
|
85
|
-
# P-1Y (all parts must be positive), P1M2Y (parts order is significant and Y must precede M) * or P1Y-1M (all parts must be positive). */
|
86
|
-
:duration,
|
87
|
-
|
88
|
-
# edApp
|
89
|
-
:edApp,
|
90
|
-
|
91
|
-
# Group
|
92
|
-
:group,
|
93
|
-
|
94
|
-
# Membership
|
95
|
-
:membership
|
96
|
-
|
97
|
-
def initialize()
|
98
|
-
@context = EventContext::EVENT
|
99
|
-
@type = EventType::EVENT
|
100
|
-
@actor = nil
|
101
|
-
@action = nil
|
102
|
-
@object = nil
|
103
|
-
@target = nil
|
104
|
-
@generated = nil
|
105
|
-
@startedAtTime = Time.now.utc.iso8601(3)
|
106
|
-
@endedAtTime = nil
|
107
|
-
@duration = nil
|
108
|
-
@edApp = nil
|
109
|
-
@group = nil
|
110
|
-
@membership = nil
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
@@ -1,48 +0,0 @@
|
|
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
|
-
|
18
|
-
require_relative './profile'
|
19
|
-
|
20
|
-
#
|
21
|
-
# Assessment Profile.
|
22
|
-
#
|
23
|
-
module Caliper
|
24
|
-
module Profiles
|
25
|
-
module AssessmentItemActions
|
26
|
-
COMPLETED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Completed"
|
27
|
-
REVIEWED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Reviewed"
|
28
|
-
SKIPPED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Skipped"
|
29
|
-
STARTED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Started"
|
30
|
-
VIEWED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Viewed"
|
31
|
-
end
|
32
|
-
|
33
|
-
class AssessmentItemProfile < Caliper::Profiles::Profile
|
34
|
-
|
35
|
-
attr_accessor :key, # String
|
36
|
-
:lookup # hash of AssessmentItemActions
|
37
|
-
|
38
|
-
# whether object if of type DigitalResource
|
39
|
-
def validate_object(object)
|
40
|
-
if (object.is_a? DigitalResource)
|
41
|
-
return object
|
42
|
-
else
|
43
|
-
fail 'Object must be of type DigitalResource'
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,56 +0,0 @@
|
|
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
|
-
|
18
|
-
require_relative './profile'
|
19
|
-
require_relative '../entities/digital_resource'
|
20
|
-
require_relative '../entities/reading/frame'
|
21
|
-
|
22
|
-
#
|
23
|
-
# Reading Profile.
|
24
|
-
#
|
25
|
-
module Caliper
|
26
|
-
module Profiles
|
27
|
-
module ReadingActions
|
28
|
-
SEARCHED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Searched"
|
29
|
-
VIEWED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Viewed"
|
30
|
-
end
|
31
|
-
|
32
|
-
class ReadingProfile < Caliper::Profiles::Profile
|
33
|
-
|
34
|
-
attr_accessor :key, # String
|
35
|
-
:lookup # hash of ReadingActions
|
36
|
-
|
37
|
-
# whether object if of type DigitalResource
|
38
|
-
def validate_object(object)
|
39
|
-
if (object.is_a? DigitalResource)
|
40
|
-
return object
|
41
|
-
else
|
42
|
-
fail "Object must e of type DigitalResource"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# whether target is of type Frame
|
47
|
-
def validate_target(target)
|
48
|
-
if (target is_a? frame)
|
49
|
-
return target
|
50
|
-
else
|
51
|
-
fail "Target must be of type Frame."
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|