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
@@ -16,27 +16,26 @@
|
|
16
16
|
# with this program. If not, see http://www.gnu.org/licenses/.
|
17
17
|
|
18
18
|
require 'require_all'
|
19
|
-
require_all 'lib/caliper/
|
19
|
+
require_all 'lib/caliper/actions/assessment_item_actions.rb'
|
20
|
+
require_all 'lib/caliper/entities/entity_base.rb'
|
20
21
|
require_all 'lib/caliper/entities/agent/software_application.rb'
|
21
22
|
require_all 'lib/caliper/entities/agent/person.rb'
|
23
|
+
require_all 'lib/caliper/entities/assessment/assessment_item.rb'
|
22
24
|
require_all 'lib/caliper/entities/lis/membership.rb'
|
23
25
|
require_all 'lib/caliper/entities/lis/role.rb'
|
24
26
|
require_all 'lib/caliper/entities/lis/status.rb'
|
25
27
|
require_all 'lib/caliper/entities/lis/course_section.rb'
|
26
28
|
require_all 'lib/caliper/entities/lis/course_offering.rb'
|
27
29
|
require_all 'lib/caliper/entities/lis/group.rb'
|
28
|
-
require_all 'lib/caliper/entities/assessment/assessment.rb'
|
29
|
-
require_all 'lib/caliper/entities/assessment/assessment_item.rb'
|
30
30
|
require_all 'lib/caliper/entities/assignable/attempt.rb'
|
31
31
|
require_all 'lib/caliper/entities/assignable/assignable_digital_resource.rb'
|
32
32
|
require_all 'lib/caliper/entities/response/Response.rb'
|
33
33
|
require_all 'lib/caliper/entities/response/fillin_blank_response.rb'
|
34
|
-
require_all 'lib/caliper/
|
35
|
-
require_all 'lib/caliper/profiles/assessment_item_profile.rb'
|
34
|
+
require_all 'lib/caliper/events/assessment_item_event.rb'
|
36
35
|
require 'json_spec'
|
37
36
|
|
38
37
|
module Caliper
|
39
|
-
module
|
38
|
+
module Events
|
40
39
|
|
41
40
|
describe AssessmentItemEvent do
|
42
41
|
|
@@ -44,133 +43,110 @@ module Caliper
|
|
44
43
|
|
45
44
|
# Actor
|
46
45
|
actor = Caliper::Entities::Agent::Person.new
|
47
|
-
actor.id = 'https://
|
48
|
-
actor.dateCreated =
|
49
|
-
actor.dateModified =
|
46
|
+
actor.id = 'https://example.edu/user/554433'
|
47
|
+
actor.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
48
|
+
actor.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
50
49
|
|
51
50
|
# Action
|
52
|
-
action = Caliper::
|
51
|
+
action = Caliper::Actions::AssessmentItemActions::COMPLETED
|
53
52
|
|
54
53
|
# Parent assessment
|
55
54
|
assessment = Caliper::Entities::Assessment::Assessment.new
|
56
|
-
assessment.id = "https://
|
55
|
+
assessment.id = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001"
|
57
56
|
assessment.name = "American Revolution - Key Figures Assessment"
|
58
|
-
assessment.dateModified =
|
59
|
-
assessment.dateCreated =
|
60
|
-
assessment.datePublished =
|
57
|
+
assessment.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
58
|
+
assessment.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
59
|
+
assessment.datePublished = Time.utc(2015,8,15,9,30,0).iso8601(3)
|
61
60
|
assessment.version = "1.0"
|
62
|
-
assessment.dateToActivate =
|
63
|
-
assessment.dateToShow =
|
64
|
-
assessment.dateToStartOn =
|
65
|
-
assessment.dateToSubmit =
|
61
|
+
assessment.dateToActivate = Time.utc(2015,8,16,5,0,0).iso8601(3)
|
62
|
+
assessment.dateToShow = Time.utc(2015,8,16,5,0,0).iso8601(3)
|
63
|
+
assessment.dateToStartOn = Time.utc(2015,8,16,5,0,0).iso8601(3)
|
64
|
+
assessment.dateToSubmit = Time.utc(2015,9,28,11,59,59).iso8601(3)
|
66
65
|
assessment.maxAttempts = 2
|
67
66
|
assessment.maxSubmits = 2
|
68
67
|
assessment.maxScore = 3.0
|
69
68
|
|
70
69
|
# Object
|
71
70
|
item = Caliper::Entities::Assessment::AssessmentItem.new
|
72
|
-
item.id = "https://
|
71
|
+
item.id = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001/item/001"
|
73
72
|
item.name = "Assessment Item 1"
|
74
73
|
item.isPartOf = assessment
|
75
74
|
item.maxAttempts = 2
|
76
75
|
item.maxSubmits = 2
|
77
76
|
item.maxScore = 1.0
|
78
|
-
item.dateCreated = nil
|
79
|
-
item.dateModified = nil
|
80
77
|
item.version = "1.0"
|
81
|
-
item.isTimeDependent = false
|
82
78
|
|
83
79
|
# Attempt (response.attempt)
|
84
80
|
attempt = Caliper::Entities::Assignable::Attempt.new
|
85
|
-
attempt.id = "https://
|
86
|
-
attempt.actor = "https://
|
87
|
-
attempt.assignable = "https://
|
88
|
-
attempt.dateCreated =
|
89
|
-
attempt.dateModified = nil
|
81
|
+
attempt.id = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001/item/001/attempt/789"
|
82
|
+
attempt.actor = "https://example.edu/user/554433"
|
83
|
+
attempt.assignable = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001"
|
84
|
+
attempt.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
90
85
|
attempt.count = 1
|
91
|
-
attempt.startedAtTime =
|
92
|
-
attempt.duration = nil
|
93
|
-
attempt.endedAtTime = nil
|
94
|
-
attempt.extensions = {}
|
95
|
-
attempt.name = nil
|
86
|
+
attempt.startedAtTime = Time.utc(2015,9,15,10,15,0).iso8601(3)
|
96
87
|
|
97
88
|
# Generate response
|
98
89
|
response = Caliper::Entities::Response::FillinBlankResponse.new
|
99
|
-
response.id = "https://
|
100
|
-
response.name = nil
|
101
|
-
response.description = nil
|
102
|
-
response.extensions = {}
|
90
|
+
response.id = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001/item/001/response/001"
|
103
91
|
response.dateCreated = "2015-08-01T06:00:00.000Z"
|
104
|
-
response.
|
105
|
-
response.
|
106
|
-
response.actor = "https://some-university.edu/user/554433"
|
92
|
+
response.assignable = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001"
|
93
|
+
response.actor = "https://example.edu/user/554433"
|
107
94
|
response.attempt = attempt
|
108
|
-
response.duration = nil
|
109
95
|
response.startedAtTime = "2015-09-15T10:15:00.000Z"
|
110
|
-
response.endedAtTime = nil
|
111
96
|
response.values = ["2 July 1776"]
|
112
97
|
|
113
98
|
# ed_app
|
114
99
|
ed_app = Caliper::Entities::Agent::SoftwareApplication.new
|
115
|
-
ed_app.id = 'https://com
|
100
|
+
ed_app.id = 'https://example.com/super-assessment-tool'
|
116
101
|
ed_app.name = 'Super Assessment Tool'
|
117
|
-
ed_app.dateCreated =
|
118
|
-
ed_app.dateModified = nil
|
102
|
+
ed_app.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
119
103
|
|
120
104
|
# LIS Course Offering
|
121
105
|
course = Caliper::Entities::LIS::CourseOffering.new
|
122
|
-
course.id = "https://
|
106
|
+
course.id = "https://example.edu/politicalScience/2015/american-revolution-101"
|
123
107
|
course.name = "Political Science 101: The American Revolution"
|
124
108
|
course.courseNumber = "POL101"
|
125
109
|
course.academicSession = "Fall-2015"
|
126
|
-
course.
|
127
|
-
course.
|
128
|
-
course.dateModified = '2015-09-02T11:30:00.000Z'
|
110
|
+
course.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
111
|
+
course.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
129
112
|
|
130
113
|
# LIS Course Section
|
131
114
|
section = Caliper::Entities::LIS::CourseSection.new
|
132
|
-
section.id = 'https://
|
115
|
+
section.id = 'https://example.edu/politicalScience/2015/american-revolution-101/section/001'
|
133
116
|
section.name = 'American Revolution 101'
|
134
117
|
section.courseNumber = "POL101"
|
135
118
|
section.academicSession = "Fall-2015"
|
136
|
-
section.category = nil
|
137
119
|
section.subOrganizationOf = course
|
138
|
-
section.dateCreated =
|
139
|
-
section.dateModified =
|
120
|
+
section.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
121
|
+
section.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
140
122
|
|
141
123
|
# LIS Group
|
142
124
|
group = Caliper::Entities::LIS::Group.new
|
143
|
-
group.id = "https://
|
125
|
+
group.id = "https://example.edu/politicalScience/2015/american-revolution-101/section/001/group/001"
|
144
126
|
group.name = "Discussion Group 001"
|
145
127
|
group.subOrganizationOf = section
|
146
|
-
group.dateCreated =
|
147
|
-
group.dateModified = nil
|
128
|
+
group.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
148
129
|
|
149
130
|
membership = Caliper::Entities::LIS::Membership.new
|
150
|
-
membership.id = "https://
|
131
|
+
membership.id = "https://example.edu/politicalScience/2015/american-revolution-101/roster/554433"
|
151
132
|
membership.name = "American Revolution 101"
|
152
133
|
membership.description = "Roster entry"
|
153
|
-
membership.member = "https://
|
154
|
-
membership.organization = "https://
|
134
|
+
membership.member = "https://example.edu/user/554433"
|
135
|
+
membership.organization = "https://example.edu/politicalScience/2015/american-revolution-101/section/001"
|
155
136
|
membership.roles = [Caliper::Entities::LIS::Role::LEARNER]
|
156
137
|
membership.status = Caliper::Entities::LIS::Status::ACTIVE
|
157
|
-
membership.dateCreated =
|
158
|
-
membership.dateModified = nil
|
138
|
+
membership.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
159
139
|
|
160
140
|
# Create the Event
|
161
141
|
event = AssessmentItemEvent.new
|
162
142
|
event.actor = actor
|
163
143
|
event.action = action
|
164
144
|
event.object = item
|
165
|
-
event.target = nil
|
166
145
|
event.generated = response
|
167
|
-
event.
|
168
|
-
event.endedAtTime = nil
|
169
|
-
event.duration = nil
|
146
|
+
event.eventTime = Time.utc(2015,9,15,10,15,0).iso8601(3)
|
170
147
|
event.edApp = ed_app
|
171
148
|
event.group = group
|
172
149
|
event.membership = membership
|
173
|
-
# puts "Event JSON = #{event.to_json}'"
|
174
150
|
|
175
151
|
# Load JSON from caliper-common-fixtures for comparison
|
176
152
|
# NOTE - sym link to caliper-common-fixtures needs to exist under spec/fixtures
|
@@ -16,26 +16,24 @@
|
|
16
16
|
# with this program. If not, see http://www.gnu.org/licenses/.
|
17
17
|
|
18
18
|
require 'require_all'
|
19
|
-
require_all 'lib/caliper/
|
19
|
+
require_all 'lib/caliper/actions/assessment_item_actions.rb'
|
20
|
+
require_all 'lib/caliper/entities/entity_base.rb'
|
20
21
|
require_all 'lib/caliper/entities/agent/software_application.rb'
|
21
22
|
require_all 'lib/caliper/entities/agent/person.rb'
|
23
|
+
require_all 'lib/caliper/entities/assessment/assessment_item.rb'
|
22
24
|
require_all 'lib/caliper/entities/lis/membership.rb'
|
23
25
|
require_all 'lib/caliper/entities/lis/role.rb'
|
24
26
|
require_all 'lib/caliper/entities/lis/status.rb'
|
25
27
|
require_all 'lib/caliper/entities/lis/course_section.rb'
|
26
28
|
require_all 'lib/caliper/entities/lis/course_offering.rb'
|
27
29
|
require_all 'lib/caliper/entities/lis/group.rb'
|
28
|
-
require_all 'lib/caliper/entities/assessment/assessment.rb'
|
29
|
-
require_all 'lib/caliper/entities/assessment/assessment_item.rb'
|
30
30
|
require_all 'lib/caliper/entities/assignable/attempt.rb'
|
31
31
|
require_all 'lib/caliper/entities/assignable/assignable_digital_resource.rb'
|
32
|
-
require_all 'lib/caliper/
|
33
|
-
require_all 'lib/caliper/profiles/assessment_item_profile.rb'
|
34
|
-
require_all 'lib/caliper/profiles/assessment_profile.rb'
|
32
|
+
require_all 'lib/caliper/events/assessment_item_event.rb'
|
35
33
|
require 'json_spec'
|
36
34
|
|
37
35
|
module Caliper
|
38
|
-
module
|
36
|
+
module Events
|
39
37
|
|
40
38
|
describe AssessmentItemEvent do
|
41
39
|
|
@@ -43,117 +41,101 @@ module Caliper
|
|
43
41
|
|
44
42
|
# Actor
|
45
43
|
actor = Caliper::Entities::Agent::Person.new
|
46
|
-
actor.id = 'https://
|
47
|
-
actor.dateCreated =
|
48
|
-
actor.dateModified =
|
44
|
+
actor.id = 'https://example.edu/user/554433'
|
45
|
+
actor.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
46
|
+
actor.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
49
47
|
|
50
48
|
# Action
|
51
|
-
action = Caliper::
|
49
|
+
action = Caliper::Actions::AssessmentItemActions::STARTED
|
52
50
|
|
53
51
|
# The parent assessment
|
54
52
|
assessment = Caliper::Entities::Assessment::Assessment.new
|
55
|
-
assessment.id = "https://
|
53
|
+
assessment.id = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001"
|
56
54
|
assessment.name = "American Revolution - Key Figures Assessment"
|
57
|
-
assessment.dateModified =
|
58
|
-
assessment.dateCreated =
|
59
|
-
assessment.datePublished =
|
55
|
+
assessment.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
56
|
+
assessment.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
57
|
+
assessment.datePublished = Time.utc(2015,8,15,9,30,0).iso8601(3)
|
60
58
|
assessment.version = "1.0"
|
61
|
-
assessment.dateToActivate =
|
62
|
-
assessment.dateToShow =
|
63
|
-
assessment.dateToStartOn =
|
64
|
-
assessment.dateToSubmit =
|
59
|
+
assessment.dateToActivate = Time.utc(2015,8,16,5,0,0).iso8601(3)
|
60
|
+
assessment.dateToShow = Time.utc(2015,8,16,5,0,0).iso8601(3)
|
61
|
+
assessment.dateToStartOn = Time.utc(2015,8,16,5,0,0).iso8601(3)
|
62
|
+
assessment.dateToSubmit = Time.utc(2015,9,28,11,59,59).iso8601(3)
|
65
63
|
assessment.maxAttempts = 2
|
66
64
|
assessment.maxSubmits = 2
|
67
65
|
assessment.maxScore = 3.0
|
68
66
|
|
69
67
|
# Object
|
70
68
|
item = Caliper::Entities::Assessment::AssessmentItem.new
|
71
|
-
item.id = "https://
|
69
|
+
item.id = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001/item/001"
|
72
70
|
item.name = "Assessment Item 1"
|
73
71
|
item.isPartOf = assessment
|
74
72
|
item.maxAttempts = 2
|
75
73
|
item.maxSubmits = 2
|
76
74
|
item.maxScore = 1.0
|
77
|
-
item.dateCreated = nil
|
78
|
-
item.dateModified = nil
|
79
75
|
item.version = "1.0"
|
80
76
|
item.isTimeDependent = false
|
81
77
|
|
82
78
|
# Generated attempt
|
83
79
|
attempt = Caliper::Entities::Assignable::Attempt.new
|
84
|
-
attempt.id = "https://
|
85
|
-
attempt.actor = "https://
|
86
|
-
attempt.assignable = "https://
|
87
|
-
attempt.dateCreated =
|
88
|
-
attempt.dateModified = nil
|
80
|
+
attempt.id = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001/item/001/attempt/789"
|
81
|
+
attempt.actor = "https://example.edu/user/554433"
|
82
|
+
attempt.assignable = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001"
|
83
|
+
attempt.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
89
84
|
attempt.count = 1
|
90
|
-
attempt.startedAtTime =
|
91
|
-
attempt.duration = nil
|
92
|
-
attempt.endedAtTime = nil
|
93
|
-
attempt.extensions = {}
|
94
|
-
attempt.name = nil
|
85
|
+
attempt.startedAtTime = Time.utc(2015,9,15,10,15,0).iso8601(3)
|
95
86
|
|
96
87
|
# ed_app
|
97
88
|
ed_app = Caliper::Entities::Agent::SoftwareApplication.new
|
98
|
-
ed_app.id = 'https://com
|
89
|
+
ed_app.id = 'https://example.com/super-assessment-tool'
|
99
90
|
ed_app.name = 'Super Assessment Tool'
|
100
|
-
ed_app.dateCreated =
|
101
|
-
ed_app.dateModified = nil
|
91
|
+
ed_app.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
102
92
|
|
103
93
|
# LIS Course Offering
|
104
94
|
course = Caliper::Entities::LIS::CourseOffering.new
|
105
|
-
course.id = "https://
|
95
|
+
course.id = "https://example.edu/politicalScience/2015/american-revolution-101"
|
106
96
|
course.name = "Political Science 101: The American Revolution"
|
107
97
|
course.courseNumber = "POL101"
|
108
98
|
course.academicSession = "Fall-2015"
|
109
|
-
course.
|
110
|
-
course.
|
111
|
-
course.dateModified = '2015-09-02T11:30:00.000Z'
|
99
|
+
course.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
100
|
+
course.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
112
101
|
|
113
102
|
# LIS Course Section
|
114
103
|
section = Caliper::Entities::LIS::CourseSection.new
|
115
|
-
section.id = 'https://
|
104
|
+
section.id = 'https://example.edu/politicalScience/2015/american-revolution-101/section/001'
|
116
105
|
section.name = 'American Revolution 101'
|
117
106
|
section.courseNumber = "POL101"
|
118
107
|
section.academicSession = "Fall-2015"
|
119
|
-
section.category = nil
|
120
108
|
section.subOrganizationOf = course
|
121
|
-
section.dateCreated =
|
122
|
-
section.dateModified =
|
109
|
+
section.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
110
|
+
section.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
123
111
|
|
124
112
|
# LIS Group
|
125
113
|
group = Caliper::Entities::LIS::Group.new
|
126
|
-
group.id = "https://
|
114
|
+
group.id = "https://example.edu/politicalScience/2015/american-revolution-101/section/001/group/001"
|
127
115
|
group.name = "Discussion Group 001"
|
128
116
|
group.subOrganizationOf = section
|
129
|
-
group.dateCreated =
|
130
|
-
group.dateModified = nil
|
117
|
+
group.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
131
118
|
|
132
119
|
membership = Caliper::Entities::LIS::Membership.new
|
133
|
-
membership.id = "https://
|
120
|
+
membership.id = "https://example.edu/politicalScience/2015/american-revolution-101/roster/554433"
|
134
121
|
membership.name = "American Revolution 101"
|
135
122
|
membership.description = "Roster entry"
|
136
|
-
membership.member = "https://
|
137
|
-
membership.organization = "https://
|
123
|
+
membership.member = "https://example.edu/user/554433"
|
124
|
+
membership.organization = "https://example.edu/politicalScience/2015/american-revolution-101/section/001"
|
138
125
|
membership.roles = [Caliper::Entities::LIS::Role::LEARNER]
|
139
126
|
membership.status = Caliper::Entities::LIS::Status::ACTIVE
|
140
|
-
membership.dateCreated =
|
141
|
-
membership.dateModified = nil
|
127
|
+
membership.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
142
128
|
|
143
129
|
# Create the Event
|
144
130
|
event = AssessmentItemEvent.new
|
145
131
|
event.actor = actor
|
146
132
|
event.action = action
|
147
133
|
event.object = item
|
148
|
-
event.target = nil
|
149
134
|
event.generated = attempt
|
150
|
-
event.
|
151
|
-
event.endedAtTime = nil
|
152
|
-
event.duration = nil
|
135
|
+
event.eventTime = Time.utc(2015,9,15,10,15,0).iso8601(3)
|
153
136
|
event.edApp = ed_app
|
154
137
|
event.group = group
|
155
138
|
event.membership = membership
|
156
|
-
# puts "Event JSON = #{event.to_json}'"
|
157
139
|
|
158
140
|
# Load JSON from caliper-common-fixtures for comparison
|
159
141
|
# NOTE - sym link to caliper-common-fixtures needs to exist under spec/fixtures
|
@@ -16,25 +16,24 @@
|
|
16
16
|
# with this program. If not, see http://www.gnu.org/licenses/.
|
17
17
|
|
18
18
|
require 'require_all'
|
19
|
-
require_all 'lib/caliper/
|
19
|
+
require_all 'lib/caliper/actions/assessment_actions.rb'
|
20
|
+
require_all 'lib/caliper/entities/entity_base.rb'
|
20
21
|
require_all 'lib/caliper/entities/agent/software_application.rb'
|
21
22
|
require_all 'lib/caliper/entities/agent/person.rb'
|
23
|
+
require_all 'lib/caliper/entities/assessment/assessment.rb'
|
22
24
|
require_all 'lib/caliper/entities/lis/membership.rb'
|
23
25
|
require_all 'lib/caliper/entities/lis/role.rb'
|
24
26
|
require_all 'lib/caliper/entities/lis/status.rb'
|
25
27
|
require_all 'lib/caliper/entities/lis/course_section.rb'
|
26
28
|
require_all 'lib/caliper/entities/lis/course_offering.rb'
|
27
29
|
require_all 'lib/caliper/entities/lis/group.rb'
|
28
|
-
require_all 'lib/caliper/entities/assessment/assessment.rb'
|
29
|
-
require_all 'lib/caliper/entities/assessment/assessment_item.rb'
|
30
30
|
require_all 'lib/caliper/entities/assignable/attempt.rb'
|
31
31
|
require_all 'lib/caliper/entities/assignable/assignable_digital_resource.rb'
|
32
|
-
require_all 'lib/caliper/
|
33
|
-
require_all 'lib/caliper/profiles/assessment_profile.rb'
|
32
|
+
require_all 'lib/caliper/events/assessment_event.rb'
|
34
33
|
require 'json_spec'
|
35
34
|
|
36
35
|
module Caliper
|
37
|
-
module
|
36
|
+
module Events
|
38
37
|
|
39
38
|
describe AssessmentEvent do
|
40
39
|
|
@@ -42,104 +41,90 @@ module Caliper
|
|
42
41
|
|
43
42
|
# Actor
|
44
43
|
actor = Caliper::Entities::Agent::Person.new
|
45
|
-
actor.id = 'https://
|
46
|
-
actor.dateCreated =
|
47
|
-
actor.dateModified =
|
44
|
+
actor.id = 'https://example.edu/user/554433'
|
45
|
+
actor.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
46
|
+
actor.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
48
47
|
|
49
48
|
# Action
|
50
|
-
action = Caliper::
|
49
|
+
action = Caliper::Actions::AssessmentActions::STARTED
|
51
50
|
|
52
51
|
# Object
|
53
52
|
assessment = Caliper::Entities::Assessment::Assessment.new
|
54
|
-
assessment.id = "https://
|
53
|
+
assessment.id = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001"
|
55
54
|
assessment.name = "American Revolution - Key Figures Assessment"
|
56
|
-
assessment.dateModified =
|
57
|
-
assessment.dateCreated =
|
58
|
-
assessment.datePublished =
|
55
|
+
assessment.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
56
|
+
assessment.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
57
|
+
assessment.datePublished = Time.utc(2015,8,15,9,30,0).iso8601(3)
|
59
58
|
assessment.version = "1.0"
|
60
|
-
assessment.dateToActivate =
|
61
|
-
assessment.dateToShow =
|
62
|
-
assessment.dateToStartOn =
|
63
|
-
assessment.dateToSubmit =
|
59
|
+
assessment.dateToActivate = Time.utc(2015,8,16,5,0,0).iso8601(3)
|
60
|
+
assessment.dateToShow = Time.utc(2015,8,16,5,0,0).iso8601(3)
|
61
|
+
assessment.dateToStartOn = Time.utc(2015,8,16,5,0,0).iso8601(3)
|
62
|
+
assessment.dateToSubmit = Time.utc(2015,9,28,11,59,59).iso8601(3)
|
64
63
|
assessment.maxAttempts = 2
|
65
64
|
assessment.maxSubmits = 2
|
66
65
|
assessment.maxScore = 3.0
|
67
66
|
|
68
67
|
# Generated attempt
|
69
68
|
attempt = Caliper::Entities::Assignable::Attempt.new
|
70
|
-
attempt.id = "https://
|
71
|
-
attempt.actor = "https://
|
72
|
-
attempt.assignable = "https://
|
73
|
-
attempt.dateCreated =
|
74
|
-
attempt.dateModified = nil
|
69
|
+
attempt.id = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001/attempt/5678"
|
70
|
+
attempt.actor = "https://example.edu/user/554433"
|
71
|
+
attempt.assignable = "https://example.edu/politicalScience/2015/american-revolution-101/assessment/001"
|
72
|
+
attempt.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
75
73
|
attempt.count = 1
|
76
74
|
attempt.startedAtTime = "2015-09-15T10:15:00.000Z"
|
77
|
-
attempt.duration = nil
|
78
|
-
attempt.endedAtTime = nil
|
79
|
-
attempt.extensions = {}
|
80
|
-
attempt.name = nil
|
81
75
|
|
82
76
|
# ed_app
|
83
77
|
ed_app = Caliper::Entities::Agent::SoftwareApplication.new
|
84
|
-
ed_app.id = 'https://com
|
78
|
+
ed_app.id = 'https://example.com/super-assessment-tool'
|
85
79
|
ed_app.name = 'Super Assessment Tool'
|
86
|
-
ed_app.dateCreated =
|
87
|
-
ed_app.dateModified = nil
|
80
|
+
ed_app.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
88
81
|
|
89
82
|
# LIS Course Offering
|
90
83
|
course = Caliper::Entities::LIS::CourseOffering.new
|
91
|
-
course.id = "https://
|
84
|
+
course.id = "https://example.edu/politicalScience/2015/american-revolution-101"
|
92
85
|
course.name = "Political Science 101: The American Revolution"
|
93
86
|
course.courseNumber = "POL101"
|
94
87
|
course.academicSession = "Fall-2015"
|
95
|
-
course.
|
96
|
-
course.
|
97
|
-
course.dateModified = '2015-09-02T11:30:00.000Z'
|
88
|
+
course.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
89
|
+
course.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
98
90
|
|
99
91
|
# LIS Course Section
|
100
92
|
section = Caliper::Entities::LIS::CourseSection.new
|
101
|
-
section.id = 'https://
|
93
|
+
section.id = 'https://example.edu/politicalScience/2015/american-revolution-101/section/001'
|
102
94
|
section.name = 'American Revolution 101'
|
103
95
|
section.courseNumber = "POL101"
|
104
96
|
section.academicSession = "Fall-2015"
|
105
|
-
section.category = nil
|
106
97
|
section.subOrganizationOf = course
|
107
|
-
section.dateCreated =
|
108
|
-
section.dateModified =
|
98
|
+
section.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
99
|
+
section.dateModified = Time.utc(2015,9,2,11,30,0).iso8601(3)
|
109
100
|
|
110
101
|
# LIS Group
|
111
102
|
group = Caliper::Entities::LIS::Group.new
|
112
|
-
group.id = "https://
|
103
|
+
group.id = "https://example.edu/politicalScience/2015/american-revolution-101/section/001/group/001"
|
113
104
|
group.name = "Discussion Group 001"
|
114
105
|
group.subOrganizationOf = section
|
115
|
-
group.dateCreated =
|
116
|
-
group.dateModified = nil
|
106
|
+
group.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
117
107
|
|
118
108
|
membership = Caliper::Entities::LIS::Membership.new
|
119
|
-
membership.id = "https://
|
109
|
+
membership.id = "https://example.edu/politicalScience/2015/american-revolution-101/roster/554433"
|
120
110
|
membership.name = "American Revolution 101"
|
121
111
|
membership.description = "Roster entry"
|
122
|
-
membership.member = "https://
|
123
|
-
membership.organization = "https://
|
112
|
+
membership.member = "https://example.edu/user/554433"
|
113
|
+
membership.organization = "https://example.edu/politicalScience/2015/american-revolution-101/section/001"
|
124
114
|
membership.roles = [Caliper::Entities::LIS::Role::LEARNER]
|
125
115
|
membership.status = Caliper::Entities::LIS::Status::ACTIVE
|
126
|
-
membership.dateCreated =
|
127
|
-
membership.dateModified = nil
|
116
|
+
membership.dateCreated = Time.utc(2015,8,1,6,0,0).iso8601(3)
|
128
117
|
|
129
118
|
# Create the Event
|
130
119
|
event = AssessmentEvent.new
|
131
120
|
event.actor = actor
|
132
121
|
event.action = action
|
133
122
|
event.object = assessment
|
134
|
-
event.target = nil
|
135
123
|
event.generated = attempt
|
136
|
-
event.
|
137
|
-
event.endedAtTime = nil
|
138
|
-
event.duration = nil
|
124
|
+
event.eventTime = Time.utc(2015,9,15,10,15,0).iso8601(3)
|
139
125
|
event.edApp = ed_app
|
140
126
|
event.group = group
|
141
127
|
event.membership = membership
|
142
|
-
# puts "Event JSON = #{event.to_json}'"
|
143
128
|
|
144
129
|
# Load JSON from caliper-common-fixtures for comparison
|
145
130
|
# NOTE - sym link to caliper-common-fixtures needs to exist under spec/fixtures
|