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,17 +1,28 @@
1
- require_relative 'annotation'
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
  #
4
- #
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
  #
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.
8
14
  #
9
- # Shared Annotation Entity
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 './annotation'
19
+
20
+ #
21
+ # Shared Annotation entity.
10
22
  #
11
23
  module Caliper
12
24
  module Entities
13
25
  module Annotation
14
-
15
26
  class SharedAnnotation < Annotation
16
27
  attr_accessor :withAgents # list of Agent objects
17
28
 
@@ -20,8 +31,7 @@ module Caliper
20
31
  @type = AnnotationType::SHARED_ANNOTATION
21
32
  @withAgents = Array.new
22
33
  end
23
-
24
34
  end
25
35
  end
26
36
  end
27
- end
37
+ end
@@ -1,17 +1,28 @@
1
- require_relative 'annotation'
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
  #
4
- #
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
  #
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.
8
14
  #
9
- # Tag Annotation Entity
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 './annotation'
19
+
20
+ #
21
+ # Tag Annotation entity.
10
22
  #
11
23
  module Caliper
12
24
  module Entities
13
25
  module Annotation
14
-
15
26
  class TagAnnotation < Annotation
16
27
  attr_accessor :tags
17
28
 
@@ -20,8 +31,7 @@ module Caliper
20
31
  @type = AnnotationType::TAG_ANNOTATION
21
32
  @tags = Array.new
22
33
  end
23
-
24
34
  end
25
35
  end
26
36
  end
27
- end
37
+ end
@@ -1,17 +1,28 @@
1
- require_relative '../../entities/assignable/assignable_digital_resource'
2
-
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
- # Represents an Assessment
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/.
10
17
 
18
+ require_relative '../assignable/assignable_digital_resource'
19
+
20
+ #
21
+ # Assessment entity.
22
+ #
11
23
  module Caliper
12
24
  module Entities
13
25
  module Assessment
14
-
15
26
  class Assessment < Caliper::Entities::Assignable::AssignableDigitalResource
16
27
 
17
28
  attr_accessor :assessmentItems
@@ -20,8 +31,7 @@ module Caliper
20
31
  super
21
32
  @type = Caliper::Entities::Assignable::AssignableDigitalResourceType::ASSESSMENT
22
33
  end
23
-
24
34
  end
25
35
  end
26
36
  end
27
- end
37
+ end
@@ -1,16 +1,28 @@
1
- require_relative '../../entities/assignable/assignable_digital_resource'
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
  #
4
- # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
5
- # @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.
6
10
  #
7
- # Represents an Assessment Item.
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.
8
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 '../assignable/assignable_digital_resource'
9
19
 
20
+ #
21
+ # Assessment Item entity.
22
+ #
10
23
  module Caliper
11
24
  module Entities
12
25
  module Assessment
13
-
14
26
  class AssessmentItem < Caliper::Entities::Assignable::AssignableDigitalResource
15
27
 
16
28
  attr_accessor :isTimeDependent
@@ -19,8 +31,7 @@ module Caliper
19
31
  super
20
32
  @type = Caliper::Entities::Assignable::AssignableDigitalResourceType::ASSESSMENT_ITEM
21
33
  end
22
-
23
34
  end
24
35
  end
25
36
  end
26
- end
37
+ end
@@ -1,25 +1,34 @@
1
- require_relative '../../entities/digital_resource'
2
- require_relative '../../entities/schemadotorg/thing'
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
- # Represents AssignableDigitalResource.
9
- # AssignableDigitalResource's prototype set to DigitalResource
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_relative '../digital_resource'
11
19
 
20
+ #
21
+ # AssignableDigitalResource entity. AssignableDigitalResource's prototype is set to DigitalResource.
22
+ #
12
23
  module Caliper
13
24
  module Entities
14
25
  module Assignable
15
-
16
26
  module AssignableDigitalResourceType
17
27
  ASSESSMENT = "http://purl.imsglobal.org/caliper/v1/Assessment"
18
28
  ASSESSMENT_ITEM = "http://purl.imsglobal.org/caliper/v1/AssessmentItem"
19
29
  end
20
30
 
21
31
  class AssignableDigitalResource < DigitalResource
22
- include Caliper::Entities::SchemaDotOrg::Thing
23
32
 
24
33
  attr_accessor :dateToActivate,
25
34
  :dateToShow,
@@ -40,8 +49,7 @@ module Caliper
40
49
  @maxSubmits = nil
41
50
  @maxScore = nil
42
51
  end
43
-
44
52
  end
45
53
  end
46
54
  end
47
- end
55
+ end
@@ -1,17 +1,31 @@
1
- require_relative '../../entities/entity'
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.
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.
3
10
  #
4
- # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
5
- # @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.
6
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 '../entity'
19
+ require_relative '../generatable'
20
+
7
21
  #
8
- # Represents an Attempt on an Assignable
22
+ # Attempt entity on an Assignable.
9
23
  #
10
24
  module Caliper
11
25
  module Entities
12
26
  module Assignable
13
-
14
27
  class Attempt < Entity
28
+ include Caliper::Entities::Generatable
15
29
 
16
30
  attr_accessor :assignable,
17
31
  :actor,
@@ -26,7 +40,6 @@ module Caliper
26
40
  end
27
41
 
28
42
  end
29
-
30
43
  end
31
44
  end
32
- end
45
+ end
@@ -1,19 +1,30 @@
1
- require "json"
2
- require_relative 'entity'
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.
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
- #
6
- # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
7
- # @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.
8
14
  #
9
- # Public: Caliper representation of a CreativeWork (https://schema.org/CreativeWork)
10
- # We add learning specific attributes, including a list of
11
- # LearningObjective learning objectives and a list of
12
- # String keywords
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 './entity'
19
+ require_relative './schemadotorg/creative_work'
20
+ require_relative './targetable'
21
+
22
+ #
23
+ # Caliper representation of a CreativeWork. We add learning specific attributes, including a list of
24
+ # LearningObjective learning objectives and a list of String keywords. See https://schema.org/CreativeWork.
13
25
  #
14
26
  module Caliper
15
27
  module Entities
16
-
17
28
  module DigitalResourceType
18
29
  ASSIGNABLE_DIGITAL_RESOURCE = "http://purl.imsglobal.org/caliper/v1/AssignableDigitalResource"
19
30
  EPUB_CHAPTER = "http://www.idpf.org/epub/vocab/structure/#chapter"
@@ -28,14 +39,15 @@ module Caliper
28
39
  end
29
40
 
30
41
  class DigitalResource < Entity
31
- include Caliper::Entities::Jsonable
42
+ include Caliper::Entities::SchemaDotOrg::CreativeWork,
43
+ Caliper::Entities::Targetable
32
44
 
33
45
  attr_accessor :objectType,
34
- :alignedLearningObjective,
35
- :keywords,
36
- :isPartOf,
37
- :datePublished,
38
- :version
46
+ :alignedLearningObjective,
47
+ :keywords,
48
+ :isPartOf,
49
+ :datePublished,
50
+ :version
39
51
 
40
52
  def initialize
41
53
  super
@@ -47,7 +59,6 @@ module Caliper
47
59
  @isPartOf = nil
48
60
  @version = nil
49
61
  end
50
-
51
62
  end
52
63
  end
53
64
  end
@@ -1,11 +1,25 @@
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 'time'
2
19
  require 'json'
20
+ require_relative './schemadotorg/thing'
3
21
  require_relative './jsonable'
4
- #
5
- #
6
- # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
7
- # @license For license information contact, info@imsglobal.org
8
- #
22
+
9
23
  #
10
24
  # The base Caliper Entity. Analogous to a schema.org Thing.
11
25
  #
@@ -14,26 +28,27 @@ module Caliper
14
28
  module EntityType
15
29
  AGENT = "http://purl.imsglobal.org/caliper/v1/Agent"
16
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"
17
33
  DIGITAL_RESOURCE = "http://purl.imsglobal.org/caliper/v1/DigitalResource"
18
34
  ENTITY = "http://purl.imsglobal.org/caliper/v1/Entity"
19
35
  GENERATED = "http://purl.imsglobal.org/caliper/v1/Generated"
36
+ GROUP = "http://purl.imsglobal.org/caliper/v1/lis/Group"
20
37
  LEARNING_OBJECTIVE = "http://purl.imsglobal.org/caliper/v1/LearningObjective"
21
- LIS_PERSON = "http://purl.imsglobal.org/caliper/v1/lis/Person"
22
- # LIS_ORGANIZATION = "http://purl.imsglobal.org/caliper/v1/lis/Organization"
23
- COURSE_OFFERING = "http://purl.imsglobal.org/caliper/v1/lis/CourseOffering"
24
- COURSE_SECTION = "http://purl.imsglobal.org/caliper/v1/lis/CourseSection"
25
38
  MEMBERSHIP = "http://purl.imsglobal.org/caliper/v1/lis/Membership"
26
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"
27
42
  RESULT = "http://purl.imsglobal.org/caliper/v1/Result"
28
43
  SESSION = "http://purl.imsglobal.org/caliper/v1/Session"
29
- RESPONSE = "http://purl.imsglobal.org/caliper/v1/Response"
30
44
  SOFTWARE_APPLICATION = "http://purl.imsglobal.org/caliper/v1/SoftwareApplication"
31
45
  TARGET = "http://purl.imsglobal.org/caliper/v1/Target"
32
46
  VIEW = "http://purl.imsglobal.org/caliper/v1/View"
33
47
  end
34
48
 
35
49
  class Entity
36
- include Caliper::Entities::Jsonable
50
+ include Caliper::Entities::SchemaDotOrg::Thing,
51
+ Caliper::Entities::Jsonable
37
52
 
38
53
  attr_accessor :id,
39
54
  :type,
@@ -52,7 +67,6 @@ module Caliper
52
67
  @dateCreated = Time.now.utc.iso8601(3)
53
68
  @dateModified = Time.now.utc.iso8601(3)
54
69
  end
55
-
56
70
  end
57
71
  end
58
- end
72
+ end
@@ -1,6 +1,25 @@
1
- require_relative '../../entities/entity'
2
- # Public: From http://xmlns.com/foaf/spec/#term_Agent An agent (eg. person,
3
- # group, software or physical artifact)
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 '../entity'
19
+
20
+ #
21
+ # An agent (eg. person, group, software or physical artifact). See http://xmlns.com/foaf/spec/#term_Agent.
22
+ #
4
23
  module Caliper
5
24
  module Entities
6
25
  module FOAF
@@ -1,9 +1,28 @@
1
- # The generatable interface marks an object type that is created or generated as a result of an action.
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
+ # The Generatable interface marks an object type that is created or generated as a result of an action.
2
20
  # The interface allows Caliper to catch errors at compile time for instances of the marked class rather
3
21
  # than at runtime if a marker annotation was defined instead.
22
+ #
4
23
  module Caliper
5
24
  module Entities
6
25
  module Generatable
7
26
  end
8
27
  end
9
- end
28
+ 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 Entities/JSON
9
22
  #
@@ -50,7 +63,6 @@ module Caliper
50
63
  def eql?(other)
51
64
  @id == other.id && @type == other.type && @name == other.name && @description == other.description && @dateCreated == other.dateCreated && @dateModified == other.dateModified
52
65
  end
53
-
54
66
  end
55
67
  end
56
68
  end
@@ -1,21 +1,42 @@
1
- require "json"
2
- require_relative 'entity'
3
- require_relative 'software_application'
4
- require_relative 'lis/organization'
5
- require_relative 'foaf/agent'
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/.
6
17
 
18
+ require_relative './entity'
19
+ require_relative './agent/software_application'
20
+ require_relative './w3c/organization'
21
+ require_relative './foaf/agent'
22
+
23
+ #
24
+ # Learning Context.
25
+ #
7
26
  module Caliper
8
27
  module Entities
9
28
  class LearningContext < Entity
29
+
10
30
  attr_accessor :ed_app, # SoftwareApplication educational app
11
- :lis_organization, # Organization the LIS organization
31
+ :group, # W3C Organization
12
32
  :agent # Agent the agent, since the Agent module is empty for now, use Entity type
33
+
13
34
  def initialize
14
35
  super
15
- @ed_app = SoftwareApplication.new
16
- @lis_organization = Caliper::Entities::LIS::Organization.new
36
+ @ed_app = Caliper::Entities::Agent::SoftwareApplication.new
37
+ @group = Caliper::Entities::W3c::Organization.new
17
38
  @agent = Caliper::Entities::Entity.new
18
39
  end
19
40
  end
20
41
  end
21
- end
42
+ end
@@ -1,26 +1,33 @@
1
- require_relative 'entity'
2
- require_relative 'generatable'
3
- require_relative 'targetable'
4
- require_relative './jsonable'
5
-
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.
6
10
  #
7
- #
8
- # @copyright @copyright ©2013 IMS Global Learning Consortium, Inc. All Rights Reserved.
9
- # @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.
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_relative './entity'
19
+
11
20
  #
12
- # Learning Objective
21
+ # Learning Objective
13
22
  #
14
23
  module Caliper
15
24
  module Entities
16
-
17
25
  class LearningObjective < Entity
18
26
 
19
27
  def initialize
20
28
  super
21
29
  @type = EntityType::LEARNING_OBJECTIVE
22
30
  end
23
-
24
31
  end
25
32
  end
26
- end
33
+ end