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.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -5
  3. data/lib/caliper/{profiles/annotation_profile.rb → actions/annotation_actions.rb} +3 -41
  4. data/lib/caliper/{profiles/assessment_profile.rb → actions/assessment_actions.rb} +3 -19
  5. data/lib/caliper/actions/assessment_item_actions.rb +31 -0
  6. data/lib/caliper/{profiles/assignable_profile.rb → actions/assignable_actions.rb} +3 -28
  7. data/lib/caliper/{profiles/media_profile.rb → actions/media_actions.rb} +4 -29
  8. data/lib/caliper/{event/view_event.rb → actions/navigation_actions.rb} +5 -11
  9. data/lib/caliper/{validators/event_validator_context.rb → actions/outcome_actions.rb} +7 -15
  10. data/lib/caliper/{event/navigation_event.rb → actions/reading_actions.rb} +6 -14
  11. data/lib/caliper/actions/session_actions.rb +30 -0
  12. data/lib/caliper/context/context.rb +31 -0
  13. data/lib/caliper/entities/agent/organization.rb +4 -3
  14. data/lib/caliper/entities/agent/person.rb +4 -3
  15. data/lib/caliper/entities/agent/software_application.rb +4 -3
  16. data/lib/caliper/entities/annotation/annotation.rb +4 -12
  17. data/lib/caliper/entities/annotation/annotation_type.rb +32 -0
  18. data/lib/caliper/entities/annotation/bookmark_annotation.rb +3 -1
  19. data/lib/caliper/entities/annotation/highlight_annotation.rb +4 -4
  20. data/lib/caliper/entities/annotation/shared_annotation.rb +3 -1
  21. data/lib/caliper/entities/annotation/tag_annotation.rb +3 -1
  22. data/lib/caliper/entities/assessment/assessment.rb +1 -1
  23. data/lib/caliper/entities/assessment/assessment_item.rb +2 -0
  24. data/lib/caliper/entities/assignable/assignable_digital_resource.rb +3 -13
  25. data/lib/caliper/{event/session_event.rb → entities/assignable/assignable_digital_resource_type.rb} +7 -11
  26. data/lib/caliper/entities/assignable/attempt.rb +8 -9
  27. data/lib/caliper/entities/digital_resource.rb +5 -22
  28. data/lib/caliper/entities/digital_resource_type.rb +33 -0
  29. data/lib/caliper/entities/entity.rb +7 -37
  30. data/lib/caliper/entities/{learning_context.rb → entity_base.rb} +19 -15
  31. data/lib/caliper/entities/entity_type.rb +39 -0
  32. data/lib/caliper/entities/foaf/agent.rb +0 -2
  33. data/lib/caliper/entities/jsonable.rb +14 -3
  34. data/lib/caliper/entities/learning_objective.rb +4 -3
  35. data/lib/caliper/entities/lis/course_offering.rb +9 -6
  36. data/lib/caliper/entities/lis/course_section.rb +3 -1
  37. data/lib/caliper/entities/lis/group.rb +5 -3
  38. data/lib/caliper/entities/lis/membership.rb +5 -7
  39. data/lib/caliper/entities/media/audio_object.rb +2 -1
  40. data/lib/caliper/entities/media/image_object.rb +2 -1
  41. data/lib/caliper/entities/media/media_location.rb +2 -1
  42. data/lib/caliper/entities/media/media_object.rb +2 -9
  43. data/lib/caliper/entities/media/media_object_type.rb +31 -0
  44. data/lib/caliper/entities/media/video_object.rb +2 -1
  45. data/lib/caliper/entities/outcome/result.rb +23 -16
  46. data/lib/caliper/entities/reading/epub_chapter.rb +2 -1
  47. data/lib/caliper/entities/reading/epub_part.rb +2 -1
  48. data/lib/caliper/entities/reading/epub_sub_chapter.rb +2 -1
  49. data/lib/caliper/entities/reading/epub_volume.rb +2 -1
  50. data/lib/caliper/entities/reading/frame.rb +4 -3
  51. data/lib/caliper/entities/reading/web_page.rb +3 -2
  52. data/lib/caliper/entities/response/fillin_blank_response.rb +3 -3
  53. data/lib/caliper/entities/response/multiple_choice_response.rb +3 -3
  54. data/lib/caliper/entities/response/multiple_response_response.rb +3 -3
  55. data/lib/caliper/entities/response/response.rb +8 -10
  56. data/lib/caliper/entities/response/response_type.rb +5 -5
  57. data/lib/caliper/entities/response/select_type_response.rb +3 -3
  58. data/lib/caliper/entities/response/true_false_response.rb +2 -3
  59. data/lib/caliper/entities/session/session.rb +8 -7
  60. data/lib/caliper/{event → events}/annotation_event.rb +11 -3
  61. data/lib/caliper/{event → events}/assessment_event.rb +11 -8
  62. data/lib/caliper/{event → events}/assessment_item_event.rb +11 -8
  63. data/lib/caliper/{event → events}/assignable_event.rb +11 -8
  64. data/lib/caliper/{profiles/profile.rb → events/event.rb} +15 -15
  65. data/lib/caliper/events/event_context.rb +24 -0
  66. data/lib/caliper/events/event_type.rb +33 -0
  67. data/lib/caliper/{event → events}/jsonable.rb +2 -2
  68. data/lib/caliper/{event → events}/media_event.rb +11 -8
  69. data/lib/caliper/events/navigation_event.rb +47 -0
  70. data/lib/caliper/events/outcome_event.rb +44 -0
  71. data/lib/caliper/{event/outcome_event.rb → events/reading_event.rb} +13 -10
  72. data/lib/caliper/events/session_event.rb +42 -0
  73. data/lib/caliper/events/view_event.rb +44 -0
  74. data/lib/caliper/request/envelope.rb +4 -15
  75. data/lib/caliper/request/event_store_requestor.rb +1 -1
  76. data/lib/caliper/request/{envelope_jsonable.rb → jsonable.rb} +9 -11
  77. data/lib/caliper/sensor.rb +1 -1
  78. data/lib/caliper/version.rb +1 -1
  79. data/lib/caliper.rb +1 -1
  80. data/spec/lib/entities/agent/{student.json → person.json} +4 -3
  81. data/spec/lib/entities/agent/person_spec.rb +5 -6
  82. data/spec/lib/entities/assessment/assessment.json +23 -0
  83. data/spec/lib/entities/assessment/assessment_spec.rb +54 -0
  84. data/spec/lib/event_helper.rb +33 -41
  85. data/spec/lib/{event/annotation_event_bookmark_spec.rb → events/annotation_bookmarked_event_spec.rb} +36 -46
  86. data/spec/lib/{event/annotation_event_highlight_spec.rb → events/annotation_highlighted_event_spec.rb} +36 -46
  87. data/spec/lib/{event/annotation_event_shared_spec.rb → events/annotation_shared_event_spec.rb} +42 -52
  88. data/spec/lib/{event/annotation_event_tag_spec.rb → events/annotation_tagged_event_spec.rb} +36 -46
  89. data/spec/lib/{event → events}/assessment_item_completed_event_spec.rb +41 -65
  90. data/spec/lib/{event → events}/assessment_item_started_event_spec.rb +38 -56
  91. data/spec/lib/{event/assessment_event_spec.rb → events/assessment_started_event_spec.rb} +36 -51
  92. data/spec/lib/{event/assignable_event_spec.rb → events/assignable_activated_event_spec.rb} +37 -52
  93. data/spec/lib/{event/media_event_spec.rb → events/media_paused_video_event_spec.rb} +33 -43
  94. data/spec/lib/{event/navigated_event_spec.rb → events/navigation_navigated_to_event_spec.rb} +36 -45
  95. data/spec/lib/events/outcome_graded_event_spec.rb +163 -0
  96. data/spec/lib/{event/session_event_login_spec.rb → events/session_logged_in_event_spec.rb} +38 -46
  97. data/spec/lib/{event/session_event_logout_spec.rb → events/session_logged_out-event_spec.rb} +28 -37
  98. data/spec/lib/{event/session_event_timeout_spec.rb → events/session_timed_out_event_spec.rb} +24 -34
  99. data/spec/lib/{event/viewed_event_spec.rb → events/view_viewed_event_spec.rb} +33 -41
  100. data/spec/lib/request/{http_requestor_spec.rb → http_requestor_single_event_spec.rb} +46 -47
  101. data/spec/lib/request/http_requestor_single_minimal_event_spec.rb +84 -0
  102. data/spec/lib/sensor_spec.rb +1 -1
  103. metadata +77 -70
  104. data/lib/caliper/event/event.rb +0 -114
  105. data/lib/caliper/profiles/assessment_item_profile.rb +0 -48
  106. data/lib/caliper/profiles/reading_profile.rb +0 -56
  107. data/lib/caliper/profiles/session_profile.rb +0 -46
  108. data/lib/caliper/validators/error_message.rb +0 -63
  109. data/lib/caliper/validators/event_validator.rb +0 -57
  110. data/lib/caliper/validators/property_type_check.rb +0 -33
  111. data/lib/caliper/validators/session_login_event_validator.rb +0 -121
  112. data/lib/caliper/validators/session_logout_event_validator.rb +0 -120
  113. data/lib/caliper/validators/time_check.rb +0 -50
  114. data/spec/lib/entities/entity.json +0 -9
  115. data/spec/lib/entities/entity_spec.rb +0 -52
@@ -15,7 +15,8 @@
15
15
  # You should have received a copy of the GNU Lesser General Public License along
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
- require_relative '../entity'
18
+ require_relative '../entity_base'
19
+ require_relative '../entity_type'
19
20
  require_relative '../foaf/agent'
20
21
  require_relative '../schemadotorg/software_application'
21
22
 
@@ -25,13 +26,13 @@ require_relative '../schemadotorg/software_application'
25
26
  module Caliper
26
27
  module Entities
27
28
  module Agent
28
- class SoftwareApplication < Entity
29
+ class SoftwareApplication < EntityBase
29
30
  include Caliper::Entities::FOAF::Agent,
30
31
  Caliper::Entities::SchemaDotOrg::SoftwareApplication
31
32
 
32
33
  def initialize()
33
34
  super
34
- @type=EntityType::SOFTWARE_APPLICATION
35
+ @type = Caliper::Entities::EntityType::SOFTWARE_APPLICATION
35
36
  end
36
37
  end
37
38
  end
@@ -15,7 +15,8 @@
15
15
  # You should have received a copy of the GNU Lesser General Public License along
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
- require_relative '../entity'
18
+ require_relative '../entity_base'
19
+ require_relative '../entity_type'
19
20
  require_relative '../generatable'
20
21
 
21
22
  #
@@ -24,23 +25,14 @@ require_relative '../generatable'
24
25
  module Caliper
25
26
  module Entities
26
27
  module Annotation
27
- module AnnotationType
28
- ANNOTATION = "http://purl.imsglobal.org/caliper/v1/Annotation"
29
- BOOKMARK_ANNOTATION = "http://purl.imsglobal.org/caliper/v1/BookmarkAnnotation"
30
- HIGHLIGHT_ANNOTATION = "http://purl.imsglobal.org/caliper/v1/HighlightAnnotation"
31
- SHARED_ANNOTATION = "http://purl.imsglobal.org/caliper/v1/SharedAnnotation"
32
- TAG_ANNOTATION = "http://purl.imsglobal.org/caliper/v1/TagAnnotation"
33
- end
34
-
35
- ## implement the interface Thing
36
- class Annotation < Entity
28
+ class Annotation < EntityBase
37
29
  include Caliper::Entities::Generatable
38
30
 
39
31
  attr_accessor :annotated
40
32
 
41
33
  def initialize
42
34
  super
43
- @type = AnnotationType::ANNOTATION
35
+ @type = Caliper::Entities::EntityType::ANNOTATION
44
36
  @annotated = nil
45
37
  end
46
38
  end
@@ -0,0 +1,32 @@
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
+ # Annotation types.
20
+ #
21
+ module Caliper
22
+ module Entities
23
+ module Annotation
24
+ module AnnotationType
25
+ BOOKMARK_ANNOTATION = "http://purl.imsglobal.org/caliper/v1/BookmarkAnnotation"
26
+ HIGHLIGHT_ANNOTATION = "http://purl.imsglobal.org/caliper/v1/HighlightAnnotation"
27
+ SHARED_ANNOTATION = "http://purl.imsglobal.org/caliper/v1/SharedAnnotation"
28
+ TAG_ANNOTATION = "http://purl.imsglobal.org/caliper/v1/TagAnnotation"
29
+ end
30
+ end
31
+ end
32
+ end
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative './annotation'
19
+ require_relative './annotation_type'
19
20
 
20
21
  #
21
22
  # Bookmark Annotation entity.
@@ -24,11 +25,12 @@ module Caliper
24
25
  module Entities
25
26
  module Annotation
26
27
  class BookmarkAnnotation < Annotation
28
+
27
29
  attr_accessor :bookmarkNotes
28
30
 
29
31
  def initialize
30
32
  super
31
- @type = AnnotationType::BOOKMARK_ANNOTATION
33
+ @type = Caliper::Entities::Annotation::AnnotationType::BOOKMARK_ANNOTATION
32
34
  @bookmarkNotes = nil
33
35
  end
34
36
  end
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative './annotation'
19
+ require_relative './annotation_type'
19
20
 
20
21
  #
21
22
  # Highlight Annotation entity.
@@ -23,14 +24,13 @@ require_relative './annotation'
23
24
  module Caliper
24
25
  module Entities
25
26
  module Annotation
26
-
27
27
  class HighlightAnnotation < Annotation
28
- attr_accessor :selectionText,
29
- :selection
28
+
29
+ attr_accessor :selectionText, :selection
30
30
 
31
31
  def initialize()
32
32
  super
33
- @type = AnnotationType::HIGHLIGHT_ANNOTATION
33
+ @type = Caliper::Entities::Annotation::AnnotationType::HIGHLIGHT_ANNOTATION
34
34
  @selectionText = nil
35
35
  @selection = {}
36
36
  end
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative './annotation'
19
+ require_relative './annotation_type'
19
20
 
20
21
  #
21
22
  # Shared Annotation entity.
@@ -24,11 +25,12 @@ module Caliper
24
25
  module Entities
25
26
  module Annotation
26
27
  class SharedAnnotation < Annotation
28
+
27
29
  attr_accessor :withAgents # list of Agent objects
28
30
 
29
31
  def initialize()
30
32
  super
31
- @type = AnnotationType::SHARED_ANNOTATION
33
+ @type = Caliper::Entities::Annotation::AnnotationType::SHARED_ANNOTATION
32
34
  @withAgents = Array.new
33
35
  end
34
36
  end
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative './annotation'
19
+ require_relative './annotation_type'
19
20
 
20
21
  #
21
22
  # Tag Annotation entity.
@@ -24,11 +25,12 @@ module Caliper
24
25
  module Entities
25
26
  module Annotation
26
27
  class TagAnnotation < Annotation
28
+
27
29
  attr_accessor :tags
28
30
 
29
31
  def initialize()
30
32
  super
31
- @type = AnnotationType::TAG_ANNOTATION
33
+ @type = Caliper::Entities::Annotation::AnnotationType::TAG_ANNOTATION
32
34
  @tags = Array.new
33
35
  end
34
36
  end
@@ -16,7 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative '../assignable/assignable_digital_resource'
19
-
19
+ require_relative '../assignable/assignable_digital_resource_type'
20
20
  #
21
21
  # Assessment entity.
22
22
  #
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative '../assignable/assignable_digital_resource'
19
+ require_relative '../assignable/assignable_digital_resource_type'
19
20
 
20
21
  #
21
22
  # Assessment Item entity.
@@ -30,6 +31,7 @@ module Caliper
30
31
  def initialize
31
32
  super
32
33
  @type = Caliper::Entities::Assignable::AssignableDigitalResourceType::ASSESSMENT_ITEM
34
+ @isTimeDependent = false
33
35
  end
34
36
  end
35
37
  end
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative '../digital_resource'
19
+ require_relative '../digital_resource_type'
19
20
 
20
21
  #
21
22
  # AssignableDigitalResource entity. AssignableDigitalResource's prototype is set to DigitalResource.
@@ -23,24 +24,13 @@ require_relative '../digital_resource'
23
24
  module Caliper
24
25
  module Entities
25
26
  module Assignable
26
- module AssignableDigitalResourceType
27
- ASSESSMENT = "http://purl.imsglobal.org/caliper/v1/Assessment"
28
- ASSESSMENT_ITEM = "http://purl.imsglobal.org/caliper/v1/AssessmentItem"
29
- end
30
-
31
27
  class AssignableDigitalResource < DigitalResource
32
28
 
33
- attr_accessor :dateToActivate,
34
- :dateToShow,
35
- :dateToStartOn,
36
- :dateToSubmit,
37
- :maxAttempts,
38
- :maxSubmits,
39
- :maxScore
29
+ attr_accessor :dateToActivate, :dateToShow, :dateToStartOn, :dateToSubmit, :maxAttempts, :maxSubmits, :maxScore
40
30
 
41
31
  def initialize
42
32
  super
43
- @type = DigitalResourceType::ASSIGNABLE_DIGITAL_RESOURCE
33
+ @type = Caliper::Entities::DigitalResourceType::ASSIGNABLE_DIGITAL_RESOURCE
44
34
  @dateToActivate = nil
45
35
  @dateToShow = nil
46
36
  @dateToStartOn = nil
@@ -15,20 +15,16 @@
15
15
  # You should have received a copy of the GNU Lesser General Public License along
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
- require_relative './event'
19
-
20
18
  #
21
- # Session Event per the Caliper Session Profile.
19
+ # Assignable types.
22
20
  #
23
21
  module Caliper
24
- module Event
25
- class SessionEvent < Event
26
-
27
- def initialize
28
- super
29
- @context = Caliper::Event::EventContext::SESSION
30
- @type = Caliper::Event::EventType::SESSION
22
+ module Entities
23
+ module Assignable
24
+ module AssignableDigitalResourceType
25
+ ASSESSMENT = "http://purl.imsglobal.org/caliper/v1/Assessment"
26
+ ASSESSMENT_ITEM = "http://purl.imsglobal.org/caliper/v1/AssessmentItem"
31
27
  end
32
28
  end
33
29
  end
34
- end
30
+ end
@@ -15,7 +15,8 @@
15
15
  # You should have received a copy of the GNU Lesser General Public License along
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
- require_relative '../entity'
18
+ require_relative '../entity_base'
19
+ require_relative '../entity_type'
19
20
  require_relative '../generatable'
20
21
 
21
22
  #
@@ -24,19 +25,17 @@ require_relative '../generatable'
24
25
  module Caliper
25
26
  module Entities
26
27
  module Assignable
27
- class Attempt < Entity
28
+ class Attempt < EntityBase
28
29
  include Caliper::Entities::Generatable
29
30
 
30
- attr_accessor :assignable,
31
- :actor,
32
- :count,
33
- :startedAtTime,
34
- :endedAtTime,
35
- :duration
31
+ attr_accessor :assignable, :actor, :count, :startedAtTime, :endedAtTime, :duration
36
32
 
37
33
  def initialize
38
34
  super
39
- @type = EntityType::ATTEMPT
35
+ @type = Caliper::Entities::EntityType::ATTEMPT
36
+ @startedAtTime = nil
37
+ @endedAtTime = nil
38
+ @duration = nil
40
39
  end
41
40
 
42
41
  end
@@ -15,7 +15,8 @@
15
15
  # You should have received a copy of the GNU Lesser General Public License along
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
- require_relative './entity'
18
+ require_relative './entity_base'
19
+ require_relative './entity_type'
19
20
  require_relative './schemadotorg/creative_work'
20
21
  require_relative './targetable'
21
22
 
@@ -25,33 +26,15 @@ require_relative './targetable'
25
26
  #
26
27
  module Caliper
27
28
  module Entities
28
- module DigitalResourceType
29
- ASSIGNABLE_DIGITAL_RESOURCE = "http://purl.imsglobal.org/caliper/v1/AssignableDigitalResource"
30
- EPUB_CHAPTER = "http://www.idpf.org/epub/vocab/structure/#chapter"
31
- EPUB_PART = "http://www.idpf.org/epub/vocab/structure/#part"
32
- EPUB_SUB_CHAPTER = "http://www.idpf.org/epub/vocab/structure/#subchapter"
33
- EPUB_VOLUME = "http://www.idpf.org/epub/vocab/structure/#volume"
34
- FRAME = "http://purl.imsglobal.org/caliper/v1/Frame"
35
- MEDIA_LOCATION = "http://purl.imsglobal.org/caliper/v1/MediaLocation"
36
- MEDIA_OBJECT = "http://purl.imsglobal.org/caliper/v1/MediaObject"
37
- READING = "http://www.idpf.org/epub/vocab/structure"
38
- WEB_PAGE = "http://purl.imsglobal.org/caliper/v1/WebPage"
39
- end
40
-
41
- class DigitalResource < Entity
29
+ class DigitalResource < EntityBase
42
30
  include Caliper::Entities::SchemaDotOrg::CreativeWork,
43
31
  Caliper::Entities::Targetable
44
32
 
45
- attr_accessor :objectType,
46
- :alignedLearningObjective,
47
- :keywords,
48
- :isPartOf,
49
- :datePublished,
50
- :version
33
+ attr_accessor :objectType, :alignedLearningObjective, :keywords, :isPartOf, :datePublished, :version
51
34
 
52
35
  def initialize
53
36
  super
54
- @type = EntityType::DIGITAL_RESOURCE
37
+ @type = Caliper::Entities::EntityType::DIGITAL_RESOURCE
55
38
  @alignedLearningObjective = Array.new
56
39
  @objectType = Array.new
57
40
  @keywords = Array.new
@@ -0,0 +1,33 @@
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
+ module Caliper
19
+ module Entities
20
+ module DigitalResourceType
21
+ ASSIGNABLE_DIGITAL_RESOURCE = "http://purl.imsglobal.org/caliper/v1/AssignableDigitalResource"
22
+ EPUB_CHAPTER = "http://www.idpf.org/epub/vocab/structure/#chapter"
23
+ EPUB_PART = "http://www.idpf.org/epub/vocab/structure/#part"
24
+ EPUB_SUB_CHAPTER = "http://www.idpf.org/epub/vocab/structure/#subchapter"
25
+ EPUB_VOLUME = "http://www.idpf.org/epub/vocab/structure/#volume"
26
+ FRAME = "http://purl.imsglobal.org/caliper/v1/Frame"
27
+ MEDIA_LOCATION = "http://purl.imsglobal.org/caliper/v1/MediaLocation"
28
+ MEDIA_OBJECT = "http://purl.imsglobal.org/caliper/v1/MediaObject"
29
+ READING = "http://purl.imsglobal.org/caliper/v1/Reading"
30
+ WEB_PAGE = "http://purl.imsglobal.org/caliper/v1/WebPage"
31
+ end
32
+ end
33
+ end
@@ -17,6 +17,8 @@
17
17
 
18
18
  require 'time'
19
19
  require 'json'
20
+ require_relative './entity_type'
21
+ require_relative '../context/context'
20
22
  require_relative './schemadotorg/thing'
21
23
  require_relative './jsonable'
22
24
 
@@ -25,47 +27,15 @@ require_relative './jsonable'
25
27
  #
26
28
  module Caliper
27
29
  module Entities
28
- module EntityType
29
- AGENT = "http://purl.imsglobal.org/caliper/v1/Agent"
30
- ATTEMPT = "http://purl.imsglobal.org/caliper/v1/Attempt"
31
- COURSE_OFFERING = "http://purl.imsglobal.org/caliper/v1/lis/CourseOffering"
32
- COURSE_SECTION = "http://purl.imsglobal.org/caliper/v1/lis/CourseSection"
33
- DIGITAL_RESOURCE = "http://purl.imsglobal.org/caliper/v1/DigitalResource"
34
- ENTITY = "http://purl.imsglobal.org/caliper/v1/Entity"
35
- GENERATED = "http://purl.imsglobal.org/caliper/v1/Generated"
36
- GROUP = "http://purl.imsglobal.org/caliper/v1/lis/Group"
37
- LEARNING_OBJECTIVE = "http://purl.imsglobal.org/caliper/v1/LearningObjective"
38
- MEMBERSHIP = "http://purl.imsglobal.org/caliper/v1/lis/Membership"
39
- ORGANIZATION = "http://purl.imsglobal.org/caliper/v1/w3c/Organization"
40
- PERSON = "http://purl.imsglobal.org/caliper/v1/lis/Person"
41
- RESPONSE = "http://purl.imsglobal.org/caliper/v1/Response"
42
- RESULT = "http://purl.imsglobal.org/caliper/v1/Result"
43
- SESSION = "http://purl.imsglobal.org/caliper/v1/Session"
44
- SOFTWARE_APPLICATION = "http://purl.imsglobal.org/caliper/v1/SoftwareApplication"
45
- TARGET = "http://purl.imsglobal.org/caliper/v1/Target"
46
- VIEW = "http://purl.imsglobal.org/caliper/v1/View"
47
- end
48
-
49
30
  class Entity
50
- include Caliper::Entities::SchemaDotOrg::Thing,
51
- Caliper::Entities::Jsonable
31
+ include Caliper::Entities::SchemaDotOrg::Thing, Caliper::Entities::Jsonable
52
32
 
53
- attr_accessor :id,
54
- :type,
55
- :name,
56
- :description,
57
- :extensions,
58
- :dateCreated,
59
- :dateModified
33
+ attr_accessor :context, :id, :type
60
34
 
61
35
  def initialize()
62
- @id = ""
63
- @type = EntityType::ENTITY
64
- @name = nil
65
- @description = nil
66
- @extensions = {}
67
- @dateCreated = Time.now.utc.iso8601(3)
68
- @dateModified = Time.now.utc.iso8601(3)
36
+ @context = Caliper::Context::Context::CONTEXT
37
+ @id = nil
38
+ @type = Caliper::Entities::EntityType::ENTITY
69
39
  end
70
40
  end
71
41
  end