ims_caliper 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.gitignore +37 -0
- data/.idea/caliper-ruby.iml +98 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/misc.xml +5 -0
- data/.idea/modules.xml +9 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -0
- data/Gemfile +12 -1
- data/Gemfile.lock +42 -1
- data/LICENSE +67 -0
- data/NOTICE +15 -0
- data/README.md +13 -5
- data/caliper.gemspec +2 -8
- data/lib/caliper/defaults.rb +4 -4
- data/lib/caliper/entities/annotation/annotation.rb +14 -4
- data/lib/caliper/entities/annotation/bookmark_annotation.rb +14 -4
- data/lib/caliper/entities/annotation/highlight_annotation.rb +14 -3
- data/lib/caliper/entities/annotation/shared_annotation.rb +12 -3
- data/lib/caliper/entities/annotation/tag_annotation.rb +13 -3
- data/lib/caliper/entities/assessment/assessment.rb +27 -0
- data/lib/caliper/entities/assessment/assessment_item.rb +26 -0
- data/lib/caliper/entities/assignable/assignable_digital_resource.rb +47 -0
- data/lib/caliper/entities/assignable/attempt.rb +32 -0
- data/lib/caliper/entities/digital_resource.rb +36 -35
- data/lib/caliper/entities/entity.rb +50 -36
- data/lib/caliper/entities/foaf/agent.rb +1 -1
- data/lib/caliper/entities/jsonable.rb +56 -0
- data/lib/caliper/entities/learning_objective.rb +26 -0
- data/lib/caliper/entities/lis/course_offering.rb +30 -0
- data/lib/caliper/entities/lis/course_section.rb +27 -15
- data/lib/caliper/entities/lis/group.rb +27 -0
- data/lib/caliper/entities/lis/membership.rb +32 -0
- data/lib/caliper/entities/lis/organization.rb +20 -17
- data/lib/caliper/entities/lis/person.rb +23 -10
- data/lib/caliper/entities/lis/roles.rb +77 -0
- data/lib/caliper/entities/lis/status.rb +19 -0
- data/lib/caliper/entities/media/audio_object.rb +21 -0
- data/lib/caliper/entities/media/image_object.rb +21 -0
- data/lib/caliper/entities/media/media_location.rb +23 -0
- data/lib/caliper/entities/media/media_object.rb +38 -0
- data/lib/caliper/entities/media/video_object.rb +21 -0
- data/lib/caliper/entities/reading/epub_volume.rb +15 -7
- data/lib/caliper/entities/reading/frame.rb +7 -15
- data/lib/caliper/entities/response/fillin_blank_response.rb +20 -0
- data/lib/caliper/entities/response/multiple_choice_response.rb +20 -0
- data/lib/caliper/entities/response/multiple_response_response.rb +20 -0
- data/lib/caliper/entities/response/response.rb +23 -0
- data/lib/caliper/entities/response/response_type.rb +13 -0
- data/lib/caliper/entities/response/select_type_response.rb +20 -0
- data/lib/caliper/entities/response/true_false_response.rb +21 -0
- data/lib/caliper/entities/schemadotorg/software_application.rb +8 -8
- data/lib/caliper/entities/session.rb +25 -17
- data/lib/caliper/entities/software_application.rb +16 -7
- data/lib/caliper/entities/web_page.rb +2 -0
- data/lib/caliper/entity_envelope.rb +21 -0
- data/lib/caliper/event/annotation_event.rb +10 -6
- data/lib/caliper/event/assessment_event.rb +19 -0
- data/lib/caliper/event/assessment_item_event.rb +19 -0
- data/lib/caliper/event/assignable_event.rb +19 -0
- data/lib/caliper/event/event.rb +70 -50
- data/lib/caliper/event/jsonable.rb +55 -0
- data/lib/caliper/event/navigation_event.rb +2 -7
- data/lib/caliper/event/outcome_event.rb +1 -1
- data/lib/caliper/event/session_event.rb +13 -14
- data/lib/caliper/event/view_event.rb +6 -7
- data/lib/caliper/event_envelope.rb +22 -0
- data/lib/caliper/jsonable.rb +53 -0
- data/lib/caliper/profiles/annotation_profile.rb +56 -53
- data/lib/caliper/profiles/assessment_profile.rb +48 -0
- data/lib/caliper/profiles/assignable_profile.rb +44 -0
- data/lib/caliper/profiles/media_profile.rb +54 -0
- data/lib/caliper/profiles/profile.rb +38 -38
- data/lib/caliper/profiles/reading_profile.rb +31 -28
- data/lib/caliper/profiles/session_profile.rb +17 -18
- data/lib/caliper/request/event_store_requestor.rb +26 -26
- data/lib/caliper/sensor.rb +46 -35
- data/lib/caliper/version.rb +1 -1
- data/spec/lib/entities/entity.json +9 -0
- data/spec/lib/entities/entity_spec.rb +37 -0
- data/spec/lib/entities/lis/person_spec.rb +37 -0
- data/spec/lib/entities/lis/student.json +11 -0
- data/spec/lib/event/annotation_event_bookmark_spec.rb +159 -0
- data/spec/lib/event/annotation_event_highlight_spec.rb +160 -0
- data/spec/lib/event/annotation_event_shared_spec.rb +172 -0
- data/spec/lib/event/annotation_event_tag_spec.rb +159 -0
- data/spec/lib/event/assessment_event_spec.rb +207 -0
- data/spec/lib/event/assessment_item_completed_event_spec.rb +223 -0
- data/spec/lib/event/assessment_item_started_event_spec.rb +207 -0
- data/spec/lib/event/media_event_spec.rb +157 -0
- data/spec/lib/event/navigated_event_spec.rb +160 -0
- data/spec/lib/event/session_event_login_spec.rb +160 -0
- data/spec/lib/event/session_event_logout_spec.rb +145 -0
- data/spec/lib/event/session_event_timeout_spec.rb +145 -0
- data/spec/lib/event/viewed_event_spec.rb +149 -0
- data/spec/lib/event_helper.rb +145 -0
- data/spec/lib/sensor_spec.rb +30 -0
- data/spec/spec_helper.rb +3 -2
- metadata +84 -61
- data/lib/caliper/client.rb +0 -33
- data/lib/caliper/consumer/base.rb +0 -46
- data/lib/caliper/consumer/queue.rb +0 -40
- data/lib/caliper/consumer/socket.rb +0 -132
- data/lib/caliper/entities/annotation/text_position_selector.rb +0 -14
- data/lib/caliper/entities/schemadotorg/audio_object.rb +0 -15
- data/lib/caliper/entities/schemadotorg/image_object.rb +0 -15
- data/lib/caliper/entities/schemadotorg/media_object.rb +0 -19
- data/lib/caliper/entities/schemadotorg/video_object.rb +0 -15
- data/lib/caliper/event/.shared.rb.swp +0 -0
- data/spec/lib/client_spec.rb +0 -35
- data/spec/lib/consumer/base_spec.rb +0 -28
- data/spec/lib/consumer/queue_spec.rb +0 -16
- data/spec/lib/event/annotation_spec.rb +0 -12
- data/spec/lib/event/bookmarked_spec.rb +0 -17
- data/spec/lib/event/commented_spec.rb +0 -19
- data/spec/lib/event/highlighted_spec.rb +0 -18
- data/spec/lib/event/navigation_spec.rb +0 -15
- data/spec/lib/event/shared_spec.rb +0 -18
- data/spec/lib/event/tagged_spec.rb +0 -17
- data/spec/lib/event/used_spec.rb +0 -15
- data/spec/lib/event/viewed_spec.rb +0 -15
- data/test/caliper/events/session_login_event_test.rb +0 -58
- data/test/caliper/events/session_logout_event_test.rb +0 -55
- data/test/caliper/events/session_timeout_event_test.rb +0 -55
- data/test/caliper/request/http_requestor_test.rb +0 -59
- data/test/caliper/test_event.rb +0 -53
- data/test/caliper/test_utils.rb +0 -198
- data/test/fixtures/caliper_session_login_event.json +0 -71
- data/test/fixtures/caliper_session_logout_event.json +0 -52
- data/test/fixtures/caliper_session_timeout_event.json +0 -52
- data/test/fixtures/event_store_payload.json +0 -85
@@ -1,55 +0,0 @@
|
|
1
|
-
|
2
|
-
require '../../../lib/caliper/entities/learning_context'
|
3
|
-
require '../../../lib/caliper/entities/software_application'
|
4
|
-
require '../../../lib/caliper/entities/reading/epub_sub_chapter'
|
5
|
-
require '../../../lib/caliper/entities/session'
|
6
|
-
require '../../../lib/caliper/event/event'
|
7
|
-
|
8
|
-
require_relative "../../../lib/caliper/request/http_requestor"
|
9
|
-
require_relative "../../../lib/caliper/profiles/session_profile"
|
10
|
-
require_relative "../../../lib/caliper/profiles/reading_profile"
|
11
|
-
require_relative "../test_utils"
|
12
|
-
|
13
|
-
require 'i18n'
|
14
|
-
require 'json'
|
15
|
-
|
16
|
-
class SessionTimeoutEventTest < Test::Unit::TestCase
|
17
|
-
include I18n::Tests
|
18
|
-
include TestUtils
|
19
|
-
|
20
|
-
attr_accessor :learning_context, # LearningContext
|
21
|
-
:ed_app, # SoftwareApplication
|
22
|
-
:key, # String
|
23
|
-
:target, # EpubSubChapter
|
24
|
-
:event # Event
|
25
|
-
|
26
|
-
def setup
|
27
|
-
|
28
|
-
p File.expand_path("../../", Dir.pwd) + '/config/locales/en.yml'
|
29
|
-
I18n.load_path = [[File.expand_path("../../..", Dir.pwd) + '/config/locales/en.yml']]
|
30
|
-
I18n.locale = :en
|
31
|
-
# I18n.t("actions.annotation.attached")
|
32
|
-
|
33
|
-
# Build the Learning Context
|
34
|
-
@learning_context = TestUtils.build_readium_learning_context
|
35
|
-
|
36
|
-
# Action
|
37
|
-
@ed_app = learning_context.ed_app
|
38
|
-
|
39
|
-
# Action
|
40
|
-
@key = Caliper::Profiles::SessionActions::TIMEOUT
|
41
|
-
|
42
|
-
# build target
|
43
|
-
@target = TestUtils.build_session_end
|
44
|
-
|
45
|
-
# build event
|
46
|
-
@event = TestUtils.build_epub_logout_event(@learning_context, @ed_app, @key, @target)
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_caliper_event_serializes_to_json
|
51
|
-
json_payload_fixture = JSON.parse(File.read(File.expand_path("../../", Dir.pwd) + "/fixtures/caliper_session_logout_event.json")).to_json
|
52
|
-
assert_equal("Test if loggedIn event is serialized to JSON with expected values",
|
53
|
-
json_payload_fixture, @event.to_json)
|
54
|
-
end
|
55
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require_relative "../../../lib/caliper/request/http_requestor"
|
2
|
-
require_relative "../../../lib/caliper/profiles/reading_profile"
|
3
|
-
require_relative "../test_utils"
|
4
|
-
require "test/unit"
|
5
|
-
|
6
|
-
|
7
|
-
class HttpRequestorTest < Test::Unit::TestCase
|
8
|
-
|
9
|
-
attr_accessor :http_requestor,
|
10
|
-
:id,
|
11
|
-
:timestamp,
|
12
|
-
:expected_content_type,
|
13
|
-
:learning_context,
|
14
|
-
:epub,
|
15
|
-
:from_resource,
|
16
|
-
:target,
|
17
|
-
:action,
|
18
|
-
:event
|
19
|
-
|
20
|
-
def setup
|
21
|
-
now = Time.now
|
22
|
-
|
23
|
-
options =TestUtils.get_testing_options
|
24
|
-
@http_requestor = Caliper::Request::HttpRequestor.new options
|
25
|
-
|
26
|
-
@id = "caliper-java_fccffd9b-68d5-4183-b563-e22136aafaa3"
|
27
|
-
@timestamp = now
|
28
|
-
@expected_content_type = "Content-Type: application/json"
|
29
|
-
|
30
|
-
# build the learning context
|
31
|
-
@learning_context = TestUtils.build_readium_learning_context
|
32
|
-
|
33
|
-
# Build epub
|
34
|
-
@epub = TestUtils.build_epub_volume_43
|
35
|
-
|
36
|
-
# build previous location
|
37
|
-
@from_resource = TestUtils.build_am_rev_101_landing_page
|
38
|
-
|
39
|
-
# build target
|
40
|
-
@target = TestUtils.build_epub_sub_chap_431
|
41
|
-
|
42
|
-
# action
|
43
|
-
@reading_profile = Caliper::Profiles::ReadingProfile.new
|
44
|
-
|
45
|
-
#action = reading_profile.get_action_from_bundle(reading_profile.actions.
|
46
|
-
|
47
|
-
p @learning_context.class
|
48
|
-
|
49
|
-
@event = TestUtils.build_epub_navigation_event @learning_context, @epub, @action, @fromResource, @target
|
50
|
-
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_generate_payload_json()
|
55
|
-
json_payload = @http_requestor.generate_payload @event, @id, @timestamp
|
56
|
-
json_payload_fixture = JSON.parse(File.read(File.expand_path("../../", Dir.pwd) + "/fixtures/event_store_payload.json")).to_json
|
57
|
-
assert_equal("Test HTTP Requestor payload JSON",json_payload_fixture, "sss")
|
58
|
-
end
|
59
|
-
end
|
data/test/caliper/test_event.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
|
2
|
-
require "../../lib/caliper/entities/learning_context"
|
3
|
-
require "../../lib/caliper/entities/software_application"
|
4
|
-
require "../../lib/caliper/entities/digital_resource"
|
5
|
-
require "../../lib/caliper/entities/reading/epub_sub_chapter"
|
6
|
-
require "../../lib/caliper/sensor"
|
7
|
-
require_relative "test_utils"
|
8
|
-
require "test/unit"
|
9
|
-
|
10
|
-
class TestEvent < Test::Unit::TestCase
|
11
|
-
def test
|
12
|
-
test_utils = TestUtils.new
|
13
|
-
Caliper::Sensor.new(test_utils.test_options())
|
14
|
-
|
15
|
-
# Build the Learning Context
|
16
|
-
learningContext = TestUtils.buildReadiumLearningContext()
|
17
|
-
|
18
|
-
# Build epub
|
19
|
-
epub = TestUtils.buildEpubVolume43()
|
20
|
-
|
21
|
-
# Build previous location
|
22
|
-
from_resource = TestUtils.buildAmRev101LandingPage()
|
23
|
-
|
24
|
-
# Build target
|
25
|
-
target = TestUtils.buildEpubSubChap431()
|
26
|
-
|
27
|
-
# Action
|
28
|
-
action = ReadingProfile.getActionFromBundle(ReadingProfile.Actions.NAVIGATED_TO.key())
|
29
|
-
|
30
|
-
# Fire event test - Send 50 events
|
31
|
-
for i in 0..50
|
32
|
-
Sensor.send(TestUtils.buildEpubNavigationEvent(learningContext, epub, action, fromResource, target))
|
33
|
-
end
|
34
|
-
|
35
|
-
# There should be two caliperEvents queued
|
36
|
-
assertEquals("Expect fifty Caliper events to be sent", 50,
|
37
|
-
Sensor.getStatistics().getMeasures().getCount())
|
38
|
-
|
39
|
-
# TODO - Describes test - Send five describes
|
40
|
-
|
41
|
-
# There should be four describes queued assertEquals("Expect five describes to be sent", 5,
|
42
|
-
# Caliper.getStatistics().getDescribes().getCount())
|
43
|
-
|
44
|
-
# There should be two message successfully sent
|
45
|
-
successes = Sensor.getStatistics().getSuccessful().getCount()
|
46
|
-
assertEquals("Expect fifty messages to be sent successfully", 50, successes);
|
47
|
-
|
48
|
-
# There should be zero failures
|
49
|
-
failures = Sensor.getStatistics().getFailed().getCount();
|
50
|
-
assertEquals("Expect zero message failures to be sent", 0, failures);
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
data/test/caliper/test_utils.rb
DELETED
@@ -1,198 +0,0 @@
|
|
1
|
-
require "test/unit"
|
2
|
-
require_relative '../../lib/caliper/options'
|
3
|
-
require_relative '../../lib/caliper/entities/lis/course_section'
|
4
|
-
require_relative '../../lib/caliper/entities/lis/person'
|
5
|
-
require_relative '../../lib/caliper/entities/learning_context'
|
6
|
-
require_relative '../../lib/caliper/entities/software_application'
|
7
|
-
require_relative '../../lib/caliper/entities/session'
|
8
|
-
require_relative '../../lib/caliper/entities/web_page'
|
9
|
-
require_relative '../../lib/caliper/entities/reading/epub_volume'
|
10
|
-
require_relative '../../lib/caliper/entities/reading/epub_sub_chapter'
|
11
|
-
require_relative '../../lib/caliper/entities/schemadotorg/web_page'
|
12
|
-
require_relative '../../lib/caliper/entities/reading/frame'
|
13
|
-
require_relative '../../lib/caliper/event/navigation_event'
|
14
|
-
require_relative '../../lib/caliper/event/session_event'
|
15
|
-
|
16
|
-
require 'json'
|
17
|
-
|
18
|
-
|
19
|
-
module TestUtils
|
20
|
-
|
21
|
-
def TestUtils.get_testing_options
|
22
|
-
options = Caliper::Options.new
|
23
|
-
options.host ="http://localhost:1080/1.0/event/put"
|
24
|
-
options.api_key = "6xp7jKrOSOWOgy3acxHFWA"
|
25
|
-
return options
|
26
|
-
end
|
27
|
-
|
28
|
-
def TestUtils.build_readium_learning_context
|
29
|
-
|
30
|
-
software_application = Caliper::Entities::SoftwareApplication.new
|
31
|
-
software_application.id = "https://github.com/readium/readium-js-viewer"
|
32
|
-
software_application.name = "Readium"
|
33
|
-
software_application.date_modified = Time.now
|
34
|
-
|
35
|
-
learning_context = Caliper::Entities::LearningContext.new
|
36
|
-
learning_context.ed_app = software_application
|
37
|
-
learning_context.lis_organization = build_am_rev_101_course_section
|
38
|
-
learning_context.agent = build_student_554433
|
39
|
-
|
40
|
-
return learning_context
|
41
|
-
end
|
42
|
-
|
43
|
-
def TestUtils.build_epub_volume_43
|
44
|
-
epub_volume = Caliper::Entities::Reading::EpubVolume.new
|
45
|
-
epub_volume.id = "https://github.com/readium/readium-js-viewer/book/34843#epubcfi(/4/3)"
|
46
|
-
epub_volume.name = "The Glorious Cause: The American Revolution, 1763-1789 (Oxford History of the United States)"
|
47
|
-
epub_volume.date_modified = Time.now
|
48
|
-
|
49
|
-
return epub_volume
|
50
|
-
end
|
51
|
-
|
52
|
-
# return Am Rev 101 course section.
|
53
|
-
def TestUtils.build_am_rev_101_course_section
|
54
|
-
course_section = Caliper::Entities::LIS::CourseSection.new
|
55
|
-
course_section.id = "https://some-university.edu/politicalScience/2014/american-revolution-101"
|
56
|
-
course_section.semester = "Spring-2014"
|
57
|
-
course_section.course_number = "AmRev-101"
|
58
|
-
course_section.label = "Am Rev 101"
|
59
|
-
course_section.name = "American Revolution 101"
|
60
|
-
course_section.date_modified = Time.now
|
61
|
-
|
62
|
-
return course_section
|
63
|
-
end
|
64
|
-
|
65
|
-
def TestUtils.build_student_554433
|
66
|
-
person = Caliper::Entities::LIS::Person.new
|
67
|
-
person.id = "https://some-university.edu/user/554433"
|
68
|
-
person.date_modified = Time.now
|
69
|
-
|
70
|
-
return person
|
71
|
-
end
|
72
|
-
|
73
|
-
def TestUtils.build_am_rev_101_landing_page
|
74
|
-
web_page = Caliper::Entities::WebPage.new
|
75
|
-
web_page.id = "AmRev-101-landingPage"
|
76
|
-
web_page.name ="American Revolution 101 Landing Page"
|
77
|
-
web_page.is_part_of = build_am_rev_101_course_section
|
78
|
-
web_page.date_modified = Time.now
|
79
|
-
return web_page
|
80
|
-
end
|
81
|
-
|
82
|
-
# sample EPUB sub chapter
|
83
|
-
def TestUtils.build_epub_sub_chap_431
|
84
|
-
epub_sub_chapter = Caliper::Entities::Reading::EpubSubChapter.new
|
85
|
-
epub_sub_chapter.id = "https://github.com/readium/readium-js-viewer/book/34843#epubcfi(/4/3/1)"
|
86
|
-
epub_sub_chapter.name = "Key Figures: George Washington"
|
87
|
-
epub_sub_chapter.is_part_of = build_epub_volume_43
|
88
|
-
epub_sub_chapter.date_modified = Time.now
|
89
|
-
return epub_sub_chapter
|
90
|
-
end
|
91
|
-
|
92
|
-
# return json object read from file
|
93
|
-
def TestUtils.read_fixture_json_file
|
94
|
-
json = File.read('fixtures/event_store_payload.json')
|
95
|
-
obj = JSON.parse(json)
|
96
|
-
return obj
|
97
|
-
end
|
98
|
-
|
99
|
-
def TestUtils.build_epub_navigation_event(learning_context, #LearningContext
|
100
|
-
epub, #digial resource
|
101
|
-
action_key,
|
102
|
-
from_resource,
|
103
|
-
target #EpubSubChapter
|
104
|
-
)
|
105
|
-
navigation_event = Caliper::Event::NavigationEvent.new
|
106
|
-
|
107
|
-
raise ArgumentError, "build_epub_navigation_event first param should be of class LearningContext" unless learning_context.is_a? Caliper::Entities::LearningContext
|
108
|
-
|
109
|
-
navigation_event.ed_app = learning_context.ed_app
|
110
|
-
navigation_event.lis_organization = learning_context.lis_organization
|
111
|
-
navigation_event.actor = learning_context.agent
|
112
|
-
navigation_event.action = action_key
|
113
|
-
navigation_event.object = epub
|
114
|
-
|
115
|
-
frame = Caliper::Entities::Reading::Frame.new
|
116
|
-
frame.id = target.id
|
117
|
-
frame.name = target.name
|
118
|
-
frame.is_part_of = epub
|
119
|
-
frame.date_modified = 1402965614516
|
120
|
-
frame.index = 1
|
121
|
-
navigation_event.target = frame
|
122
|
-
|
123
|
-
navigation_event.from_resource = from_resource
|
124
|
-
navigation_event.started_at_time = 1402965614516
|
125
|
-
|
126
|
-
return navigation_event
|
127
|
-
end
|
128
|
-
|
129
|
-
# session start
|
130
|
-
def TestUtils.build_session_start
|
131
|
-
session = Caliper::Entities::Session.new
|
132
|
-
session.id = "https://github.com/readium/session-123456789"
|
133
|
-
session.name = "session-123456789"
|
134
|
-
session.actor = build_student_554433
|
135
|
-
session.date_modified = 1402965614516
|
136
|
-
session.started_at_time = 1402965614516
|
137
|
-
return session
|
138
|
-
end
|
139
|
-
|
140
|
-
#session send
|
141
|
-
def TestUtils.build_session_end
|
142
|
-
session = Caliper::Entities::Session.new
|
143
|
-
session.id = "https://github.com/readium/session-123456789"
|
144
|
-
session.name = "session-123456789"
|
145
|
-
session.actor = build_student_554433
|
146
|
-
session.date_modified = 1402965614516
|
147
|
-
session.started_at_time = 1402965614516
|
148
|
-
session.ended_at_time = 1402965614516
|
149
|
-
return session
|
150
|
-
end
|
151
|
-
|
152
|
-
def TestUtils.build_epub_login_event(learning_context, ed_app,action_key,target,generated)
|
153
|
-
# a frame object
|
154
|
-
frame = Caliper::Entities::Reading::Frame.new
|
155
|
-
frame.id = target.id
|
156
|
-
frame.name = target.name
|
157
|
-
frame.is_part_of = target.is_part_of
|
158
|
-
frame.date_modified = 1402965614516
|
159
|
-
frame.index = 1
|
160
|
-
|
161
|
-
session_event = Caliper::Event::SessionEvent.new
|
162
|
-
session_event.ed_app = learning_context.ed_app
|
163
|
-
session_event.lis_organization = learning_context.lis_organization
|
164
|
-
session_event.actor = learning_context.agent
|
165
|
-
session_event.action = action_key
|
166
|
-
session_event.object = ed_app
|
167
|
-
session_event.target = frame
|
168
|
-
session_event.generated = generated
|
169
|
-
session_event.started_at_time = 1402965614516
|
170
|
-
|
171
|
-
return session_event
|
172
|
-
end
|
173
|
-
|
174
|
-
def TestUtils.build_epub_logout_event(learning_context, ed_app, action_key, target)
|
175
|
-
session_event = Caliper::Event::SessionEvent.new
|
176
|
-
session_event.ed_app = learning_context.ed_app
|
177
|
-
session_event.lis_organization = learning_context.lis_organization
|
178
|
-
session_event.actor = learning_context.agent
|
179
|
-
session_event.action = action_key
|
180
|
-
session_event.object = ed_app
|
181
|
-
session_event.target = target
|
182
|
-
session_event.started_at_time = 1402965614516
|
183
|
-
session_event.ended_at_time = 1402965614516
|
184
|
-
end
|
185
|
-
|
186
|
-
def TestUtils.build_epub_timeout_event(learning_context, ed_app, action_key, target)
|
187
|
-
session_event = Caliper::Event::SessionEvent.new
|
188
|
-
session_event.ed_app = learning_context.ed_app
|
189
|
-
session_event.lis_organization = learning_context.lis_organization
|
190
|
-
session_event.actor = learning_context.agent
|
191
|
-
session_event.action = action_key
|
192
|
-
session_event.object = ed_app
|
193
|
-
session_event.target = target
|
194
|
-
session_event.started_at_time = 1402965614516
|
195
|
-
session_event.ended_at_time = 1402965614516
|
196
|
-
end
|
197
|
-
|
198
|
-
end
|
@@ -1,71 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"@context": "http://purl.imsglobal.org/ctx/caliper/v1/SessionEvent",
|
3
|
-
"@type": "http://purl.imsglobal.org/caliper/v1/SessionEvent",
|
4
|
-
"actor": {
|
5
|
-
"@id": "https://some-university.edu/user/554433",
|
6
|
-
"@type": "http://purl.imsglobal.org/caliper/v1/lis/Person",
|
7
|
-
"name": null,
|
8
|
-
"lastModifiedTime": 1402965614516
|
9
|
-
},
|
10
|
-
"action": "logged in",
|
11
|
-
"object": {
|
12
|
-
"@id": "https://github.com/readium/readium-js-viewer",
|
13
|
-
"@type":"http://purl.imsglobal.org/caliper/v1/SoftwareApplication",
|
14
|
-
"name": "Readium",
|
15
|
-
"lastModifiedTime": 1402965614516
|
16
|
-
},
|
17
|
-
"target": {
|
18
|
-
"@id": "https://github.com/readium/readium-js-viewer/book/34843#epubcfi(/4/3/1)",
|
19
|
-
"@type": "http://purl.imsglobal.org/caliper/v1/Frame",
|
20
|
-
"name": "Key Figures: George Washington",
|
21
|
-
"objectType": [],
|
22
|
-
"alignedLearningObjective": [],
|
23
|
-
"keyword": [],
|
24
|
-
"partOf": {
|
25
|
-
"@id": "https://github.com/readium/readium-js-viewer/book/34843#epubcfi(/4/3)",
|
26
|
-
"@type": "http://www.idpf.org/epub/vocab/structure/#volume",
|
27
|
-
"name": "The Glorious Cause: The American Revolution, 1763-1789 (Oxford History of the United States)",
|
28
|
-
"objectType": [],
|
29
|
-
"alignedLearningObjective": [],
|
30
|
-
"keyword": [],
|
31
|
-
"partOf": null,
|
32
|
-
"lastModifiedTime": 1402965614516
|
33
|
-
},
|
34
|
-
"lastModifiedTime": 1402965614516,
|
35
|
-
"index": 1
|
36
|
-
},
|
37
|
-
"generated": {
|
38
|
-
"@id": "https://github.com/readium/session-123456789",
|
39
|
-
"@type":"http://purl.imsglobal.org/caliper/v1/Session",
|
40
|
-
"name": "session-123456789",
|
41
|
-
"lastModifiedTime": 1402965614516,
|
42
|
-
"actor": {
|
43
|
-
"@id": "https://some-university.edu/user/554433",
|
44
|
-
"@type": "http://purl.imsglobal.org/caliper/v1/lis/Person",
|
45
|
-
"name": null,
|
46
|
-
"lastModifiedTime": 1402965614516
|
47
|
-
},
|
48
|
-
"startedAtTime": 1402965614516,
|
49
|
-
"endedAtTime": 0,
|
50
|
-
"duration": null
|
51
|
-
},
|
52
|
-
"startedAtTime": 1402965614516,
|
53
|
-
"endedAtTime": 0,
|
54
|
-
"duration": null,
|
55
|
-
"edApp": {
|
56
|
-
"@id": "https://github.com/readium/readium-js-viewer",
|
57
|
-
"@type":"http://purl.imsglobal.org/caliper/v1/SoftwareApplication",
|
58
|
-
"name": "Readium",
|
59
|
-
"lastModifiedTime": 1402965614516
|
60
|
-
},
|
61
|
-
"group": {
|
62
|
-
"@id": "https://some-university.edu/politicalScience/2014/american-revolution-101",
|
63
|
-
"@type": "http://purl.imsglobal.org/caliper/v1/lis/CourseSection",
|
64
|
-
"semester": "Spring-2014",
|
65
|
-
"courseNumber": "AmRev-101",
|
66
|
-
"label": "Am Rev 101",
|
67
|
-
"name": "American Revolution 101",
|
68
|
-
"parentOrg": null,
|
69
|
-
"lastModifiedTime": 1402965614516
|
70
|
-
}
|
71
|
-
}
|
@@ -1,52 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"@context": "http://purl.imsglobal.org/ctx/caliper/v1/SessionEvent",
|
3
|
-
"@type": "http://purl.imsglobal.org/caliper/v1/SessionEvent",
|
4
|
-
"actor": {
|
5
|
-
"@id": "https://some-university.edu/user/554433",
|
6
|
-
"@type": "http://purl.imsglobal.org/caliper/v1/lis/Person",
|
7
|
-
"name": null,
|
8
|
-
"lastModifiedTime": 1402965614516
|
9
|
-
},
|
10
|
-
"action": "logged out",
|
11
|
-
"object": {
|
12
|
-
"@id": "https://github.com/readium/readium-js-viewer",
|
13
|
-
"@type":"http://purl.imsglobal.org/caliper/v1/SoftwareApplication",
|
14
|
-
"name": "Readium",
|
15
|
-
"lastModifiedTime": 1402965614516
|
16
|
-
},
|
17
|
-
"target": {
|
18
|
-
"@id": "https://github.com/readium/session-123456789",
|
19
|
-
"@type":"http://purl.imsglobal.org/caliper/v1/Session",
|
20
|
-
"name": "session-123456789",
|
21
|
-
"lastModifiedTime": 1402965614516,
|
22
|
-
"actor": {
|
23
|
-
"@id": "https://some-university.edu/user/554433",
|
24
|
-
"@type": "http://purl.imsglobal.org/caliper/v1/lis/Person",
|
25
|
-
"name": null,
|
26
|
-
"lastModifiedTime": 1402965614516
|
27
|
-
},
|
28
|
-
"startedAtTime": 1402965614516,
|
29
|
-
"endedAtTime": 1402965614516,
|
30
|
-
"duration": null
|
31
|
-
},
|
32
|
-
"generated": null,
|
33
|
-
"startedAtTime": 1402965614516,
|
34
|
-
"endedAtTime": 1402965614516,
|
35
|
-
"duration": null,
|
36
|
-
"edApp": {
|
37
|
-
"@id": "https://github.com/readium/readium-js-viewer",
|
38
|
-
"@type":"http://purl.imsglobal.org/caliper/v1/SoftwareApplication",
|
39
|
-
"name": "Readium",
|
40
|
-
"lastModifiedTime": 1402965614516
|
41
|
-
},
|
42
|
-
"group": {
|
43
|
-
"@id": "https://some-university.edu/politicalScience/2014/american-revolution-101",
|
44
|
-
"@type": "http://purl.imsglobal.org/caliper/v1/lis/CourseSection",
|
45
|
-
"semester": "Spring-2014",
|
46
|
-
"courseNumber": "AmRev-101",
|
47
|
-
"label": "Am Rev 101",
|
48
|
-
"name": "American Revolution 101",
|
49
|
-
"parentOrg": null,
|
50
|
-
"lastModifiedTime": 1402965614516
|
51
|
-
}
|
52
|
-
}
|