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,28 +15,32 @@
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 'time'
19
+ require 'json'
18
20
  require_relative './entity'
19
- require_relative './agent/software_application'
20
- require_relative './agent/organization'
21
- require_relative './foaf/agent'
21
+ require_relative './entity_type'
22
+ require_relative '../context/context'
23
+ require_relative './schemadotorg/thing'
24
+ require_relative './jsonable'
22
25
 
23
26
  #
24
- # Learning Context.
27
+ # The base Caliper Entity. Analogous to a schema.org Thing.
25
28
  #
26
29
  module Caliper
27
30
  module Entities
28
- class LearningContext < Entity
31
+ class EntityBase < Entity
32
+ include Caliper::Entities::SchemaDotOrg::Thing, Caliper::Entities::Jsonable
29
33
 
30
- attr_accessor :ed_app, # SoftwareApplication educational app
31
- :group, # W3C Organization
32
- :agent # Agent the agent, since the Agent module is empty for now, use Entity type
34
+ attr_accessor :name, :description, :extensions, :dateCreated, :dateModified
33
35
 
34
- def initialize
35
- super
36
- @ed_app = Caliper::Entities::Agent::SoftwareApplication.new
37
- @group = Caliper::Entities::Agent::Organization.new
38
- @agent = Caliper::Entities::Entity.new
39
- end
40
- end
36
+ def initialize()
37
+ super
38
+ @name = nil
39
+ @description = nil
40
+ @extensions = {}
41
+ @dateCreated = nil
42
+ @dateModified = nil
43
+ end
44
+ end
41
45
  end
42
46
  end
@@ -0,0 +1,39 @@
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 EntityType
21
+ ANNOTATION = "http://purl.imsglobal.org/caliper/v1/Annotation"
22
+ ATTEMPT = "http://purl.imsglobal.org/caliper/v1/Attempt"
23
+ COURSE_OFFERING = "http://purl.imsglobal.org/caliper/v1/lis/CourseOffering"
24
+ COURSE_SECTION = "http://purl.imsglobal.org/caliper/v1/lis/CourseSection"
25
+ DIGITAL_RESOURCE = "http://purl.imsglobal.org/caliper/v1/DigitalResource"
26
+ ENTITY = "http://purl.imsglobal.org/caliper/v1/Entity"
27
+ GROUP = "http://purl.imsglobal.org/caliper/v1/lis/Group"
28
+ LEARNING_OBJECTIVE = "http://purl.imsglobal.org/caliper/v1/LearningObjective"
29
+ MEMBERSHIP = "http://purl.imsglobal.org/caliper/v1/lis/Membership"
30
+ ORGANIZATION = "http://purl.imsglobal.org/caliper/v1/w3c/Organization"
31
+ PERSON = "http://purl.imsglobal.org/caliper/v1/lis/Person"
32
+ RESPONSE = "http://purl.imsglobal.org/caliper/v1/Response"
33
+ RESULT = "http://purl.imsglobal.org/caliper/v1/Result"
34
+ SESSION = "http://purl.imsglobal.org/caliper/v1/Session"
35
+ SOFTWARE_APPLICATION = "http://purl.imsglobal.org/caliper/v1/SoftwareApplication"
36
+ VIEW = "http://purl.imsglobal.org/caliper/v1/View"
37
+ end
38
+ end
39
+ end
@@ -15,8 +15,6 @@
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'
19
-
20
18
  #
21
19
  # An agent (eg. person, group, software or physical artifact). See http://xmlns.com/foaf/spec/#term_Agent.
22
20
  #
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require 'json'
19
+ require_relative './entity_type'
19
20
 
20
21
  #
21
22
  # Module that supports ser-des for Caliper Entities/JSON
@@ -34,26 +35,36 @@ module Caliper
34
35
  def to_json(*a)
35
36
  # puts 'Jsonable: to_json invoked'
36
37
  result = {}
38
+ result['@context'] = self.context
37
39
  result['@id'] = self.id
38
40
  result['@type'] = self.type
39
41
  self.instance_variables.each do |key|
40
42
  # puts "got key = #{key}"
41
- next if (key[1..-1] == 'id' || key[1..-1] == 'type')
43
+ next if (key[1..-1] == 'context' || key[1..-1] == 'id' || key[1..-1] == 'type')
42
44
  value = self.instance_variable_get key
43
45
  # puts "setting #{key}: #{value}"
44
46
  result[key[1..-1]] = value
45
47
  end
48
+
49
+ # Filter out context for generic entities
50
+ # A more generalized approach will be required for 1.1 to filter out all nulls/empties)
51
+ if (result['@context'].nil?)
52
+ #if (result['@type'] == Caliper::Entities::EntityType::ENTITY && result['@context'].nil?)
53
+ result.delete('@context')
54
+ end
55
+
46
56
  result.to_json(*a)
47
57
  end
48
58
 
49
59
  def from_json json_hash
50
60
  data = json_hash
51
61
  # puts "Jsonable: from_json: json_hash = #{json_hash}"
62
+ self.context = data['@context']
52
63
  self.id = data['@id']
53
64
  self.type = data['@type']
54
65
  self.name = data['name']
55
66
  json_hash.each do | key, value |
56
- next if (key[1..-1] == 'id' || key[1..-1] == 'type')
67
+ next if (key[1..-1] == 'context' || key[1..-1] == 'id' || key[1..-1] == 'type')
57
68
  # puts "Jsonable - adding #{key} : #{value}"
58
69
  self.instance_variable_set "@#{key}", value
59
70
  end
@@ -61,7 +72,7 @@ module Caliper
61
72
  end
62
73
 
63
74
  def eql?(other)
64
- @id == other.id && @type == other.type && @name == other.name && @description == other.description && @dateCreated == other.dateCreated && @dateModified == other.dateModified
75
+ @context == other.context && @id == other.id && @type == other.type && @name == other.name && @description == other.description && @dateCreated == other.dateCreated && @dateModified == other.dateModified
65
76
  end
66
77
  end
67
78
  end
@@ -15,18 +15,19 @@
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
 
20
21
  #
21
22
  # Learning Objective
22
23
  #
23
24
  module Caliper
24
25
  module Entities
25
- class LearningObjective < Entity
26
+ class LearningObjective < EntityBase
26
27
 
27
28
  def initialize
28
29
  super
29
- @type = EntityType::LEARNING_OBJECTIVE
30
+ @type = Caliper::Entities::EntityType::LEARNING_OBJECTIVE
30
31
  end
31
32
  end
32
33
  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 '../w3c/organization'
20
21
 
21
22
  #
@@ -24,15 +25,17 @@ require_relative '../w3c/organization'
24
25
  module Caliper
25
26
  module Entities
26
27
  module LIS
27
- class CourseOffering < Entity
28
+ class CourseOffering < EntityBase
28
29
  include Caliper::Entities::W3C::Organization
29
30
 
30
- attr_accessor :courseNumber,
31
- :academicSession,
32
- :subOrganizationOf
31
+ attr_accessor :courseNumber, :academicSession, :subOrganizationOf
32
+
33
33
  def initialize
34
34
  super
35
- @type = EntityType::COURSE_OFFERING
35
+ @type = Caliper::Entities::EntityType::COURSE_OFFERING
36
+ @courseNumber = nil
37
+ @academicSession = nil
38
+ @subOrganizationOf = nil
36
39
  end
37
40
  end
38
41
  end
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative './course_offering'
19
+ require_relative '../entity_type'
19
20
 
20
21
  #
21
22
  # LIS Course Section.
@@ -29,7 +30,8 @@ module Caliper
29
30
 
30
31
  def initialize
31
32
  super
32
- @type = EntityType::COURSE_SECTION
33
+ @type = Caliper::Entities::EntityType::COURSE_SECTION
34
+ @category = nil
33
35
  end
34
36
  end
35
37
  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 '../w3c/organization'
20
21
 
21
22
  #
@@ -24,14 +25,15 @@ require_relative '../w3c/organization'
24
25
  module Caliper
25
26
  module Entities
26
27
  module LIS
27
- class Group < Entity
28
+ class Group < EntityBase
28
29
  include Caliper::Entities::W3C::Organization
29
30
 
30
31
  attr_accessor :subOrganizationOf
31
32
 
32
33
  def initialize
33
34
  super
34
- @type = EntityType::GROUP
35
+ @type = Caliper::Entities::EntityType::GROUP
36
+ @subOrganizationOf = nil
35
37
  end
36
38
  end
37
39
  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 '../w3c/membership'
20
21
 
21
22
  #
@@ -24,17 +25,14 @@ require_relative '../w3c/membership'
24
25
  module Caliper
25
26
  module Entities
26
27
  module LIS
27
- class Membership < Entity
28
+ class Membership < EntityBase
28
29
  include Caliper::Entities::W3C::Membership
29
30
 
30
- attr_accessor :member,
31
- :organization,
32
- :roles,
33
- :status
31
+ attr_accessor :member, :organization, :roles, :status
34
32
 
35
33
  def initialize
36
34
  super
37
- @type = EntityType::MEMBERSHIP
35
+ @type = Caliper::Entities::EntityType::MEMBERSHIP
38
36
  end
39
37
 
40
38
  end
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative './media_object'
19
+ require_relative './media_object_type'
19
20
 
20
21
  #
21
22
  # Audio object embedded in a web page. See https://schema.org/AudioObject
@@ -27,7 +28,7 @@ module Caliper
27
28
 
28
29
  def initialize
29
30
  super
30
- @type = MediaType::AUDIO_OBJECT
31
+ @type = Caliper::Entities::Media::MediaObjectType::AUDIO_OBJECT
31
32
  end
32
33
  end
33
34
  end
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative './media_object'
19
+ require_relative './media_object_type'
19
20
 
20
21
  #
21
22
  # A image object embedded in a web page. See https://schema.org/ImageObject
@@ -27,7 +28,7 @@ module Caliper
27
28
 
28
29
  def initialize
29
30
  super
30
- @type = MediaType::IMAGE_OBJECT
31
+ @type = Caliper::Entities::Media::MediaObjectType::IMAGE_OBJECT
31
32
  end
32
33
  end
33
34
  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
  # A time based location within a media object.
@@ -29,7 +30,7 @@ module Caliper
29
30
 
30
31
  def initialize
31
32
  super
32
- @type = DigitalResourceType::MEDIA_LOCATION
33
+ @type = Caliper::Entities::DigitalResourceType::MEDIA_LOCATION
33
34
  @currentTime = nil
34
35
  end
35
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 '../digital_resource'
19
+ require_relative '../digital_resource_type'
19
20
 
20
21
  # An image, video, or audio object embedded in a web page. Note that a
21
22
  # creative work may have many media objects associated with it on the
@@ -26,21 +27,13 @@ require_relative '../digital_resource'
26
27
  module Caliper
27
28
  module Entities
28
29
  module Media
29
- module MediaType
30
- AUDIO_OBJECT = 'http://purl.imsglobal.org/caliper/v1/AudioObject'
31
- IMAGE_OBJECT = 'http://purl.imsglobal.org/caliper/v1/ImageObject'
32
- VIDEO_OBJECT = 'http://purl.imsglobal.org/caliper/v1/VideoObject'
33
- MEDIA_LOCATION = 'http://purl.imsglobal.org/caliper/v1/MediaLocation'
34
- end
35
-
36
- ## implement the interface Thing
37
30
  class MediaObject < DigitalResource
38
31
 
39
32
  attr_accessor :duration
40
33
 
41
34
  def initialize
42
35
  super
43
- @type = DigitalResourceType::MEDIA_OBJECT
36
+ @type = Caliper::Entities::DigitalResourceType::MEDIA_OBJECT
44
37
  @duration = nil
45
38
  end
46
39
  end
@@ -0,0 +1,31 @@
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
+ # Media Object types.
20
+ #
21
+ module Caliper
22
+ module Entities
23
+ module Media
24
+ module MediaObjectType
25
+ AUDIO_OBJECT = 'http://purl.imsglobal.org/caliper/v1/AudioObject'
26
+ IMAGE_OBJECT = 'http://purl.imsglobal.org/caliper/v1/ImageObject'
27
+ VIDEO_OBJECT = 'http://purl.imsglobal.org/caliper/v1/VideoObject'
28
+ end
29
+ end
30
+ end
31
+ end
@@ -16,6 +16,7 @@
16
16
  # with this program. If not, see http://www.gnu.org/licenses/.
17
17
 
18
18
  require_relative './media_object'
19
+ require_relative './media_object_type'
19
20
 
20
21
  #
21
22
  # A video object embedded in a web page. See https://schema.org/VideoObject.
@@ -27,7 +28,7 @@ module Caliper
27
28
 
28
29
  def initialize
29
30
  super
30
- @type = MediaType::VIDEO_OBJECT
31
+ @type = Caliper::Entities::Media::MediaObjectType::VIDEO_OBJECT
31
32
  end
32
33
  end
33
34
  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
  #
@@ -23,22 +24,28 @@ require_relative '../generatable'
23
24
  #
24
25
  module Caliper
25
26
  module Entities
26
- class Result < Entity
27
- include Caliper::Entities::Generatable
27
+ module Outcome
28
+ class Result < EntityBase
29
+ include Caliper::Entities::Generatable
28
30
 
29
- attr_accessor :type, # String
30
- :normal_score,
31
- :penalty_score,
32
- :extra_credit_score,
33
- :total_score,
34
- :curved_total_score,
35
- :curve_factor,
36
- :comment,
37
- :scored_by
38
- end
31
+ attr_accessor :assignable, :actor, :normalScore, :penaltyScore, :extraCreditScore,
32
+ :totalScore, :curvedTotalScore, :curveFactor, :comment, :scoredBy
39
33
 
40
- def initialize
41
- super
42
- end
34
+ def initialize
35
+ super
36
+ @type = Caliper::Entities::EntityType::RESULT
37
+ @assignable = nil
38
+ @actor = nil
39
+ @normalScore = nil
40
+ @penaltyScore = nil
41
+ @extraCreditScore = nil
42
+ @totalScore = nil
43
+ @curvedTotalScore = nil
44
+ @curveFactor = nil
45
+ @comment = nil
46
+ @scoredBy = nil
47
+ end
48
+ end
49
+ end
43
50
  end
44
51
  end