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,15 +1,28 @@
1
- require_relative "options"
2
- require_relative 'jsonable'
3
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.
4
6
  #
5
- # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
6
- # @license For license information contact, info@imsglobal.org
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.
7
10
  #
8
- # Caliper Sensor Entity Envelope
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.
9
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 'rest_client'
19
+ require_relative "./options"
20
+ require_relative './jsonable'
21
+
22
+ #
23
+ # Caliper Sensor Entity Envelope.
10
24
  #
11
25
  module Caliper
12
-
13
26
  class EntityEnvelope
14
27
  include Caliper::Jsonable
15
28
 
@@ -17,4 +30,4 @@ module Caliper
17
30
  :sensorId,
18
31
  :entity
19
32
  end
20
- end
33
+ end
@@ -1,12 +1,27 @@
1
- require_relative 'event'
2
- require_relative '../profiles/annotation_profile'
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/.
3
17
 
18
+ require_relative './event'
19
+
20
+ #
21
+ # Annotation Event per Caliper Annotation Profile.
22
+ #
4
23
  module Caliper
5
24
  module Event
6
-
7
- #
8
- # Annotation Event per Caliper Annotation Profile
9
- #
10
25
  class AnnotationEvent < Event
11
26
 
12
27
  def initialize
@@ -1,5 +1,25 @@
1
- require_relative 'event'
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/.
2
17
 
18
+ require_relative './event'
19
+
20
+ #
21
+ # Assessment Event.
22
+ #
3
23
  module Caliper
4
24
  module Event
5
25
  class AssessmentEvent < Event
@@ -16,4 +36,4 @@ module Caliper
16
36
  end
17
37
  end
18
38
  end
19
- end
39
+ end
@@ -1,5 +1,25 @@
1
- require_relative 'event'
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/.
2
17
 
18
+ require_relative './event'
19
+
20
+ #
21
+ # AssessmentItem Event.
22
+ #
3
23
  module Caliper
4
24
  module Event
5
25
  class AssessmentItemEvent < Event
@@ -16,4 +36,4 @@ module Caliper
16
36
  end
17
37
  end
18
38
  end
19
- end
39
+ end
@@ -1,5 +1,25 @@
1
- require_relative 'event'
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/.
2
17
 
18
+ require_relative './event'
19
+
20
+ #
21
+ # Assignable Event.
22
+ #
3
23
  module Caliper
4
24
  module Event
5
25
  class AssignableEvent < Event
@@ -16,4 +36,4 @@ module Caliper
16
36
  end
17
37
  end
18
38
  end
19
- end
39
+ end
@@ -1,6 +1,26 @@
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 'json'
2
19
  require_relative './jsonable'
3
20
 
21
+ #
22
+ # Base event.
23
+ #
4
24
  module Caliper
5
25
  module Event
6
26
  module EventContext
@@ -15,6 +35,7 @@ module Caliper
15
35
  SESSION = "http://purl.imsglobal.org/ctx/caliper/v1/SessionEvent"
16
36
  VIEW = "http://purl.imsglobal.org/ctx/caliper/v1/ViewEvent"
17
37
  end
38
+
18
39
  module EventType
19
40
  ANNOTATION = "http://purl.imsglobal.org/caliper/v1/AnnotationEvent"
20
41
  ASSESSMENT = "http://purl.imsglobal.org/caliper/v1/AssessmentEvent"
@@ -27,6 +48,7 @@ module Caliper
27
48
  SESSION = "http://purl.imsglobal.org/caliper/v1/SessionEvent"
28
49
  VIEW = "http://purl.imsglobal.org/caliper/v1/ViewEvent"
29
50
  end
51
+
30
52
  class Event
31
53
  include Caliper::Event::Jsonable
32
54
 
@@ -85,4 +107,4 @@ module Caliper
85
107
  end
86
108
  end
87
109
  end
88
- end
110
+ end
@@ -1,9 +1,22 @@
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 'json'
2
19
 
3
- #
4
- #
5
- # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
6
- # @license For license information contact, info@imsglobal.org
7
20
  #
8
21
  # Module that supports ser-des for Caliper Event/JSON
9
22
  #
@@ -49,7 +62,6 @@ module Caliper
49
62
  def eql?(other)
50
63
  @context == other.context && @type == other.type && @startedAtTime == other.startedAtTime && @endedAtTime == other.endedAtTime
51
64
  end
52
-
53
65
  end
54
66
  end
55
- end
67
+ end
@@ -1,5 +1,25 @@
1
- require_relative 'event'
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/.
2
17
 
18
+ require_relative './event'
19
+
20
+ #
21
+ # Media Event.
22
+ #
3
23
  module Caliper
4
24
  module Event
5
25
  class MediaEvent < Event
@@ -16,4 +36,4 @@ module Caliper
16
36
  end
17
37
  end
18
38
  end
19
- end
39
+ end
@@ -1,6 +1,25 @@
1
- require_relative 'event'
2
- require_relative '../profiles/profile'
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/.
3
17
 
18
+ require_relative './event'
19
+
20
+ #
21
+ # Navigation Event.
22
+ #
4
23
  module Caliper
5
24
  module Event
6
25
  class NavigationEvent < Event
@@ -15,4 +34,4 @@ module Caliper
15
34
  end
16
35
  end
17
36
  end
18
- end
37
+ end
@@ -1,6 +1,25 @@
1
- require_relative 'event'
2
- require_relative '../profiles/profile'
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/.
3
17
 
18
+ require_relative './event'
19
+
20
+ #
21
+ # Outcome Event.
22
+ #
4
23
  module Caliper
5
24
  module Event
6
25
  class OutcomeEvent < Event
@@ -17,4 +36,4 @@ module Caliper
17
36
  end
18
37
  end
19
38
  end
20
- end
39
+ end
@@ -1,20 +1,34 @@
1
- require_relative 'event'
2
- require_relative '../profiles/session_profile'
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/.
3
17
 
18
+ require_relative './event'
19
+
20
+ #
21
+ # Session Event per the Caliper Session Profile.
22
+ #
4
23
  module Caliper
5
24
  module Event
6
-
7
25
  class SessionEvent < Event
8
26
 
9
- #
10
- # Session Event per the Caliper Session Profile
11
- #
12
27
  def initialize
13
28
  super
14
29
  @context = Caliper::Event::EventContext::SESSION
15
30
  @type = Caliper::Event::EventType::SESSION
16
31
  end
17
-
18
32
  end
19
33
  end
20
34
  end
@@ -1,19 +1,33 @@
1
- require_relative 'event'
2
- require_relative '../profiles/reading_profile.rb'
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/.
3
17
 
18
+ require_relative './event'
19
+
20
+ #
21
+ # View Event per the Caliper Base Profile.
22
+ #
4
23
  module Caliper
5
24
  module Event
6
-
7
25
  class ViewEvent < Event
8
26
 
9
- #
10
- # Viewed Event per the Caliper Base Profile
11
- #
12
27
  def initialize
13
28
  @type = EventType::VIEW
14
29
  @context = EventContext::VIEW
15
30
  end
16
-
17
31
  end
18
32
  end
19
- end
33
+ end
@@ -1,16 +1,28 @@
1
- require_relative "options"
2
- require_relative 'jsonable'
3
-
4
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.
5
6
  #
6
- # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
7
- # @license For license information contact, info@imsglobal.org
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.
8
10
  #
9
- # Caliper Sensor Event Envelope
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.
10
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 'rest_client'
19
+ require_relative "./options"
20
+ require_relative './jsonable'
21
+
22
+ #
23
+ # Caliper Sensor Event Envelope.
11
24
  #
12
25
  module Caliper
13
-
14
26
  class EventEnvelope
15
27
  include Caliper::Jsonable
16
28
 
@@ -18,4 +30,4 @@ module Caliper
18
30
  :sensorId,
19
31
  :event
20
32
  end
21
- end
33
+ end
@@ -1,9 +1,22 @@
1
- require 'json'
2
-
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.
3
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.
4
10
  #
5
- # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
6
- # @license For license information contact, info@imsglobal.org
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
+
7
20
  #
8
21
  # Module that supports ser-des for Caliper Envelope
9
22
  #
@@ -27,7 +40,12 @@ module Caliper
27
40
  next if (key[1..-1] == 'context' || key[1..-1] == 'type')
28
41
  value = self.instance_variable_get key
29
42
  # puts "setting #{key}: #{value}"
30
- result[key[1..-1]] = value
43
+ attribute_key = key[1..-1]
44
+ if (key[1..-1] == 'id' || key[1..-1] == 'type' || key[1..-1] == 'context')
45
+ ## prefix with @ char for linked json data
46
+ attribute_key = "@#{attribute_key}"
47
+ end
48
+ result[attribute_key] = value
31
49
  end
32
50
  result.to_json(*a)
33
51
  end
@@ -48,6 +66,5 @@ module Caliper
48
66
  def eql?(other)
49
67
  @sensorId == other.sensorId && @apiKey == other.apiKey
50
68
  end
51
-
52
69
  end
53
- end
70
+ end
@@ -1,3 +1,23 @@
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
+ #
19
+ # Options
20
+ #
1
21
  module Caliper
2
22
  class Options
3
23
  attr_accessor :api_key
@@ -14,5 +34,4 @@ module Caliper
14
34
  @host = host
15
35
  @time_out = time_out
16
36
  end
17
-
18
- end
37
+ end
@@ -1,11 +1,30 @@
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_relative './profile'
2
19
  require_relative '../entities/digital_resource'
3
20
  require_relative '../entities/annotation/annotation'
4
21
  require_relative '../entities/reading/frame'
5
22
 
23
+ #
24
+ # Annotation Profile.
25
+ #
6
26
  module Caliper
7
27
  module Profiles
8
-
9
28
  module AnnotationActions
10
29
  ATTACHED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Attached"
11
30
  BOOKMARKED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Bookmarked"
@@ -24,7 +43,6 @@ module Caliper
24
43
  SHARED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Shared"
25
44
  SUBSCRIBED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Subscribed"
26
45
  TAGGED = "http://purl.imsglobal.org/vocab/caliper/v1/action#Tagged"
27
- NAVIGATED_TO = "http://purl.imsglobal.org/vocab/caliper/v1/action#NavigatedTo"
28
46
  end
29
47
 
30
48
  class ReadingProfile < Profile
@@ -61,4 +79,4 @@ module Caliper
61
79
  end
62
80
  end
63
81
  end
64
- end
82
+ end
@@ -0,0 +1,48 @@
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