domoscio_rails 0.3.3 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/domoscio_rails.rb +118 -110
  3. data/lib/domoscio_rails/authorization_token.rb +4 -11
  4. data/lib/domoscio_rails/{adaptative/deterministic/path_rule.rb → data/content.rb} +3 -2
  5. data/lib/domoscio_rails/data/event.rb +0 -1
  6. data/lib/domoscio_rails/{admin → data}/instance.rb +2 -1
  7. data/lib/domoscio_rails/data/learning_session.rb +0 -1
  8. data/lib/domoscio_rails/{adaptative → data}/recommendation.rb +2 -2
  9. data/lib/domoscio_rails/{student → data}/student.rb +2 -1
  10. data/lib/domoscio_rails/errors.rb +1 -1
  11. data/lib/domoscio_rails/knowledge/knowledge_edge.rb +0 -1
  12. data/lib/domoscio_rails/knowledge/knowledge_graph.rb +0 -1
  13. data/lib/domoscio_rails/knowledge/knowledge_node.rb +0 -1
  14. data/lib/domoscio_rails/{content → knowledge}/knowledge_node_content.rb +2 -1
  15. data/lib/domoscio_rails/{data → knowledge}/knowledge_node_student.rb +0 -1
  16. data/lib/domoscio_rails/{adaptative/predictive → objective}/objective.rb +2 -1
  17. data/lib/domoscio_rails/{path/learning_path.rb → objective/objective_knowledge_node.rb} +3 -2
  18. data/lib/domoscio_rails/objective/objective_knowledge_node_student.rb +8 -0
  19. data/lib/domoscio_rails/{adaptative/predictive → objective}/objective_student.rb +2 -1
  20. data/lib/domoscio_rails/{metadata → tag}/tag.rb +2 -1
  21. data/lib/domoscio_rails/{metadata → tag}/tag_edge.rb +2 -1
  22. data/lib/domoscio_rails/{metadata → tag}/tag_set.rb +2 -1
  23. data/lib/domoscio_rails/{metadata → tag}/tagging.rb +2 -1
  24. data/lib/domoscio_rails/utils/gameplay_util.rb +2 -1
  25. data/lib/domoscio_rails/utils/recommendation_util.rb +6 -5
  26. data/lib/domoscio_rails/utils/review_util.rb +2 -1
  27. data/lib/domoscio_rails/version.rb +1 -1
  28. metadata +17 -26
  29. data/lib/domoscio_rails/adaptative/deterministic/rule_condition.rb +0 -9
  30. data/lib/domoscio_rails/adaptative/deterministic/rule_input.rb +0 -9
  31. data/lib/domoscio_rails/adaptative/deterministic/rule_output.rb +0 -9
  32. data/lib/domoscio_rails/adaptative/predictive/objective_knowledge_node.rb +0 -6
  33. data/lib/domoscio_rails/adaptative/predictive/objective_knowledge_node_student.rb +0 -6
  34. data/lib/domoscio_rails/content/content.rb +0 -9
  35. data/lib/domoscio_rails/data/result.rb +0 -10
  36. data/lib/domoscio_rails/metadata/delta_object.rb +0 -6
  37. data/lib/domoscio_rails/student/student_cluster.rb +0 -6
  38. data/lib/domoscio_rails/utils/alerts_util.rb +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0a7e03020d78226e29f7a2930c43cfb2fccbb4389b9d559b3bae047be4dbdf5
4
- data.tar.gz: 63a5cfb591576eaa115737527a3f99f4d8140ae5eeb51403370bf970a0d7a438
3
+ metadata.gz: 5a6ede945677291ef1b7b413edacef90ff3a034ffb948d4b5a48e2dfe6a821cd
4
+ data.tar.gz: 4cda4d1cd0c511238ca8eb12611e0457f99bcca2ea9f7c2d7b4fab2f266b2ff0
5
5
  SHA512:
6
- metadata.gz: 809d75c75785aa76824e42caaed95c0ad5e4afabd07d06480ddec251d7813fdeb1383c259558ba87745b67aaf88bd1b6ed27784a70547b495c1b271893e1a3f6
7
- data.tar.gz: ecebc9a43d22e8d835387a7632d0dedc3b29b156e4b48dfbb32666556eb87b202a5e23f70be29481d899013145d108414344d33d32a137cd56b92758cf8c7128
6
+ metadata.gz: 4c4e6fabcc01564dcec6f42d71d63cc45be20eb51d88f23b912ddb1f6bf4043e60b4e331489d9ca482cea7aa7db2a1b9a8b66c733b209cf383197322a876d1f9
7
+ data.tar.gz: 7a4e192e653f1014d435c1cae554c8a2d5412c30c8bb36ca25b45d95e2819da5d3037771ad068cde95ca292acfb5c539119c1f45783c39f0e1484cf9cf46194a
@@ -10,71 +10,40 @@ require 'domoscio_rails/authorization_token'
10
10
  # resources
11
11
  require 'domoscio_rails/http_calls'
12
12
  require 'domoscio_rails/resource'
13
- require 'domoscio_rails/adaptative/deterministic/path_rule'
14
- require 'domoscio_rails/adaptative/deterministic/rule_input'
15
- require 'domoscio_rails/adaptative/deterministic/rule_output'
16
- require 'domoscio_rails/adaptative/deterministic/rule_condition'
17
- require 'domoscio_rails/adaptative/predictive/objective'
18
- require 'domoscio_rails/adaptative/predictive/objective_student'
19
- require 'domoscio_rails/adaptative/predictive/objective_knowledge_node'
20
- require 'domoscio_rails/adaptative/predictive/objective_knowledge_node_student'
21
- require 'domoscio_rails/adaptative/recommendation'
22
- require 'domoscio_rails/path/learning_path'
23
- require 'domoscio_rails/content/content'
24
- require 'domoscio_rails/content/knowledge_node_content'
25
- require 'domoscio_rails/student/student'
26
- require 'domoscio_rails/student/student_cluster'
27
- require 'domoscio_rails/knowledge/knowledge_graph'
28
- require 'domoscio_rails/knowledge/knowledge_edge'
29
- require 'domoscio_rails/knowledge/knowledge_node'
30
- require 'domoscio_rails/metadata/tag'
31
- require 'domoscio_rails/metadata/tagging'
32
- require 'domoscio_rails/metadata/tag_set'
33
- require 'domoscio_rails/metadata/tag_edge'
34
- require 'domoscio_rails/data/knowledge_node_student'
35
- require 'domoscio_rails/data/event'
36
- require 'domoscio_rails/data/learning_session'
37
- require 'domoscio_rails/utils/review_util'
38
- require 'domoscio_rails/utils/gameplay_util'
39
- require 'domoscio_rails/utils/alerts_util'
40
- require 'domoscio_rails/utils/recommendation_util'
41
- require 'domoscio_rails/metadata/delta_object'
13
+ require 'domoscio_rails/data/content.rb'
14
+ require 'domoscio_rails/data/event.rb'
15
+ require 'domoscio_rails/data/instance.rb'
16
+ require 'domoscio_rails/data/recommendation.rb'
17
+ require 'domoscio_rails/data/learning_session.rb'
18
+ require 'domoscio_rails/data/student.rb'
19
+ require 'domoscio_rails/knowledge/knowledge_edge.rb'
20
+ require 'domoscio_rails/knowledge/knowledge_graph.rb'
21
+ require 'domoscio_rails/knowledge/knowledge_node_content.rb'
22
+ require 'domoscio_rails/knowledge/knowledge_node_student.rb'
23
+ require 'domoscio_rails/knowledge/knowledge_node.rb'
24
+ require 'domoscio_rails/objective/objective_knowledge_node_student.rb'
25
+ require 'domoscio_rails/objective/objective_knowledge_node.rb'
26
+ require 'domoscio_rails/objective/objective_student.rb'
27
+ require 'domoscio_rails/objective/objective.rb'
28
+ require 'domoscio_rails/tag/tag_edge.rb'
29
+ require 'domoscio_rails/tag/tag_set.rb'
30
+ require 'domoscio_rails/tag/tag.rb'
31
+ require 'domoscio_rails/tag/tagging.rb'
32
+ require 'domoscio_rails/utils/gameplay_util.rb'
33
+ require 'domoscio_rails/utils/recommendation_util.rb'
34
+ require 'domoscio_rails/utils/review_util.rb'
35
+
42
36
  module DomoscioRails
43
37
  class Configuration
44
- attr_accessor :preproduction, :test, :dev, :root_url, :client_id, :client_passphrase, :temp_dir, :disabled, :version
45
-
46
- def disabled
47
- @disabled || false
48
- end
49
-
50
- def preproduction
51
- @preproduction || false
52
- end
53
-
54
- def test
55
- @test || false
56
- end
57
-
58
- def dev
59
- @dev || false
60
- end
38
+ attr_accessor :root_url, :client_id, :client_passphrase, :temp_dir, :version
61
39
 
40
+ # Refers to AdaptiveEngine Version
62
41
  def version
63
- @version || 1
42
+ @version ||= 2
64
43
  end
65
44
 
66
45
  def root_url
67
- if @preproduction == true
68
- if @test == true
69
- @root_url || "https://staging.adaptive-engine.domoscio.com"
70
- elsif @dev == true
71
- @root_url || "https://preprod.adaptive-engine.domoscio.com"
72
- else
73
- @root_url || "https://adaptive-engine.domoscio.com"
74
- end
75
- else
76
- @root_url || "http://localhost:3001"
77
- end
46
+ @root_url ||= ""
78
47
  end
79
48
  end
80
49
 
@@ -95,42 +64,44 @@ module DomoscioRails
95
64
  # - +method+: HTTP method; lowercase symbol, e.g. :get, :post etc.
96
65
  # - +url+: the part after Configuration#root_url
97
66
  # - +params+: hash; entity data for creation, update etc.; will dump it by JSON and assign to Net::HTTPRequest#body
98
- # - +filters+: hash; pagination params etc.; will encode it by URI and assign to URI#query
99
- # - +headers+: hash; request_headers by default
100
- # - +before_request_proc+: optional proc; will call it passing the Net::HTTPRequest instance just before Net::HTTPRequest#request
101
67
  #
102
- # Raises DomoscioRails::ResponseError if response code != 200.
68
+ # Performs HTTP requests to Adaptive Engine
69
+ # On token issues, will try once to get a new token then will output a DomoscioRails::ReponseError with details
70
+ #
71
+ # Raises DomoscioRails::ResponseError on Adaptive Error Status
72
+ # Raises DomoscioRails::ProcessingError on Internal Error
103
73
  #
104
- def self.request(method, url, params={}, filters={}, headers = request_headers, before_request_proc = nil)
105
- return false if @disabled
106
- #sets a default page size of 50
107
- params.merge!({'per_page': 50}) unless params['per_page']
74
+ def self.request(method, url, params={})
75
+
76
+ store_tokens, headers = request_headers
77
+ params.merge!({'per_page': 2000}) unless params[:per_page]
108
78
  uri = api_uri(url)
109
- uri.query = URI.encode_www_form(filters) unless filters.empty?
110
- res = DomoscioRails.send_request(uri, method, params, headers, before_request_proc)
111
- return res if res.kind_of? DomoscioRails::ProcessingError
79
+
80
+ response = DomoscioRails.send_request(uri, method, params, headers)
81
+ return response if response.kind_of? DomoscioRails::ProcessingError
82
+
112
83
  begin
113
- raise_http_failure(uri, res, params)
114
- data = DomoscioRails::JSON.load(res.body.nil? ? '' : res.body)
115
- DomoscioRails::AuthorizationToken::Manager.storage.store({access_token: res['Accesstoken'], refresh_token: res['Refreshtoken']})
84
+ raise_http_failure(uri, response, params)
85
+ data = DomoscioRails::JSON.load(response.body.nil? ? '' : response.body)
86
+ DomoscioRails::AuthorizationToken::Manager.storage.store({access_token: response['Accesstoken'], refresh_token: response['Refreshtoken']}) if store_tokens
116
87
  rescue MultiJson::LoadError => exception
117
- data = ProcessingError.new(uri, 500, exception, res.body, params)
88
+ data = ProcessingError.new(uri, 500, exception, response.body, params)
118
89
  rescue ResponseError => exception
119
90
  data = exception
120
91
  end
121
92
 
122
- if res['Total'] && !filters[:page]
123
- pagetotal = (res['Total'].to_i / res['Per-Page'].to_f).ceil
93
+ if response['Total']
94
+ pagetotal = (response['Total'].to_i / response['Per-Page'].to_f).ceil
124
95
  for j in 2..pagetotal
125
- res = DomoscioRails.send_request(uri, method, params.merge({page: j}), headers, before_request_proc)
126
- return res if res.kind_of? DomoscioRails::ProcessingError
96
+ response = DomoscioRails.send_request(uri, method, params.merge({page: j}), headers)
97
+ return response if response.kind_of? DomoscioRails::ProcessingError
127
98
  begin
128
- raise_http_failure(uri, res, params)
129
- body = DomoscioRails::JSON.load(res.body.nil? ? '' : res.body)
99
+ raise_http_failure(uri, response, params)
100
+ body = DomoscioRails::JSON.load(response.body.nil? ? '' : response.body)
130
101
  data += body
131
102
  data.flatten!
132
103
  rescue MultiJson::LoadError => exception
133
- return ProcessingError.new(uri, 500, exception, res.body, params)
104
+ return ProcessingError.new(uri, 500, exception, response.body, params)
134
105
  rescue ResponseError => exception
135
106
  return exception
136
107
  end
@@ -139,32 +110,52 @@ module DomoscioRails
139
110
  data
140
111
  end
141
112
 
142
- def self.send_request(uri, method, params, headers, before_request_proc)
113
+ private
114
+
115
+ # This function catches usual Http errors during calls
116
+ #
117
+ def self.send_request(uri, method, params, headers)
143
118
  begin
144
- res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
145
- req = Net::HTTP::const_get(method.capitalize).new(uri.request_uri, headers)
146
- req.body = DomoscioRails::JSON.dump(params)
147
- before_request_proc.call(req) if before_request_proc
148
- http.request req
149
- end
119
+ response = perform_call(uri, method, params, headers)
120
+ response = retry_call_and_store_tokens(uri, method, params, headers) if ['401','403'].include? response.code
121
+ response
150
122
  rescue Timeout::Error, Errno::EINVAL, Errno::ECONNREFUSED, Errno::ECONNRESET, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => exception
151
- ProcessingError.new(uri, 500, exception, res)
123
+ ProcessingError.new(uri, 500, exception, response)
152
124
  end
153
125
  end
154
126
 
155
- private
156
-
157
- def self.raise_http_failure(uri, res, params)
158
- unless res.kind_of? Net::HTTPSuccess
159
- if res.blank?
127
+ # This helper will check the response status and build the correcponding DomoscioRails::ResponseError
128
+ #
129
+ def self.raise_http_failure(uri, response, params)
130
+ unless response.kind_of? Net::HTTPSuccess
131
+ if response.blank?
160
132
  raise ResponseError.new(uri, 500, {error: {status: 500, message: 'AdaptiveEngine not available'}}, {}, params)
161
133
  else
162
- body = DomoscioRails::JSON.load((res.body.nil? ? '' : res.body), :symbolize_keys => true)
163
- raise ResponseError.new(uri, res.code.to_i, body, res.body, params)
134
+ body = {error: {status: response.code, message: DomoscioRails::JSON.load((response.body.nil? ? '' : response.body), :symbolize_keys => true)}}
135
+ raise ResponseError.new(uri, response.code.to_i, body, response.body, params)
164
136
  end
165
137
  end
166
138
  end
167
139
 
140
+ # Actual HTTP call is performed here
141
+ #
142
+ def self.perform_call(uri, method, params, headers)
143
+ Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
144
+ req = Net::HTTP::const_get(method.capitalize).new(uri.request_uri, headers)
145
+ req.body = DomoscioRails::JSON.dump(params)
146
+ http.request req
147
+ end
148
+ end
149
+
150
+ # This method is called when AdaptiveEngine returns tokens errors
151
+ # Action on those errors is to retry and request new tokens, those new token are then stored
152
+ def self.retry_call_and_store_tokens(uri, method, params, headers)
153
+ headers = request_new_tokens
154
+ response = perform_call(uri, method, params, headers)
155
+ DomoscioRails::AuthorizationToken::Manager.storage.store({access_token: response['Accesstoken'], refresh_token: response['Refreshtoken']})
156
+ response
157
+ end
158
+
168
159
  def self.user_agent
169
160
  @uname ||= get_uname
170
161
  {
@@ -182,22 +173,39 @@ module DomoscioRails
182
173
  'uname lookup failed'
183
174
  end
184
175
 
176
+ # Process the token loading and analyze
177
+ # will return the processed headers and a token store flag
178
+ #
185
179
  def self.request_headers
186
- auth_token = DomoscioRails::AuthorizationToken::Manager.get_token
187
- if !auth_token.is_a? String
188
- headers = {
189
- 'user_agent' => "#{DomoscioRails.user_agent}",
190
- 'AccessToken' => "#{auth_token[:access_token]}",
191
- 'RefreshToken' => "#{auth_token[:refresh_token]}",
192
- 'Content-Type' => 'application/json'
193
- }
194
- else
195
- headers = {
196
- 'user_agent' => "#{DomoscioRails.user_agent}",
197
- 'Authorization' => "Token token=#{DomoscioRails.configuration.client_passphrase}",
198
- 'Content-Type' => 'application/json'
199
- }
180
+ begin
181
+ auth_token = DomoscioRails::AuthorizationToken::Manager.get_token
182
+ if auth_token && auth_token[:access_token] && auth_token[:refresh_token]
183
+ [false, send_current_tokens(auth_token)]
184
+ else
185
+ [true, request_new_tokens]
186
+ end
187
+ rescue SyntaxError, StandardError
188
+ [true, request_new_tokens]
200
189
  end
201
- headers
190
+ end
191
+
192
+ # If stored token successfully loaded we build the header with them
193
+ #
194
+ def self.send_current_tokens(auth_token)
195
+ {
196
+ 'user_agent' => "#{DomoscioRails.user_agent}",
197
+ 'AccessToken' => "#{auth_token[:access_token]}",
198
+ 'RefreshToken' => "#{auth_token[:refresh_token]}",
199
+ 'Content-Type' => 'application/json'
200
+ }
201
+ end
202
+
203
+ # If we cant find tokens of they are corrupted / expired, then we set headers to request new ones
204
+ def self.request_new_tokens
205
+ {
206
+ 'user_agent' => "#{DomoscioRails.user_agent}",
207
+ 'Authorization' => "Token token=#{DomoscioRails.configuration.client_passphrase}",
208
+ 'Content-Type' => 'application/json'
209
+ }
202
210
  end
203
211
  end
@@ -11,9 +11,7 @@ module DomoscioRails
11
11
  end
12
12
 
13
13
  def get_token
14
- token = storage.get
15
- token = DomoscioRails.configuration.client_passphrase if token.nil?
16
- token
14
+ storage.get
17
15
  end
18
16
  end
19
17
  end
@@ -29,13 +27,9 @@ module DomoscioRails
29
27
 
30
28
  class FileStorage
31
29
  require 'yaml'
32
- @temp_dir
33
30
 
34
- def initialize(temp_dir = nil)
35
- @temp_dir = temp_dir || DomoscioRails.configuration.temp_dir
36
- if !@temp_dir
37
- raise "Path to temporary folder is not defined"
38
- end
31
+ def initialize
32
+ raise "Path to temporary folder is not defined" unless DomoscioRails.configuration.temp_dir
39
33
  end
40
34
 
41
35
  def get
@@ -60,8 +54,7 @@ module DomoscioRails
60
54
  end
61
55
 
62
56
  def file_path
63
- @temp_dir = DomoscioRails.configuration.temp_dir
64
- File.join(@temp_dir, "DomoscioRails.AuthorizationToken.FileStore.tmp")
57
+ File.join(DomoscioRails.configuration.temp_dir, "DomoscioRails.AuthorizationToken.FileStore.tmp")
65
58
  end
66
59
  end
67
60
  end
@@ -1,10 +1,11 @@
1
1
  module DomoscioRails
2
- # A PathRule.
3
- class PathRule < Resource
2
+ class Content < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Create
5
5
  include DomoscioRails::HTTPCalls::Fetch
6
6
  include DomoscioRails::HTTPCalls::Update
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
8
  include DomoscioRails::HTTPCalls::Util
9
+
9
10
  end
10
11
  end
@@ -1,5 +1,4 @@
1
1
  module DomoscioRails
2
- # A Student Result on a KnowledgeNode.
3
2
  class Event < Resource
4
3
 
5
4
  include DomoscioRails::HTTPCalls::Create
@@ -1,9 +1,10 @@
1
1
  module DomoscioRails
2
- # A company.
3
2
  class Instance < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Create
5
5
  include DomoscioRails::HTTPCalls::Fetch
6
6
  include DomoscioRails::HTTPCalls::UpdateSelf
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
+
8
9
  end
9
10
  end
@@ -1,5 +1,4 @@
1
1
  module DomoscioRails
2
- # A LearningSession is basicly a group of events.
3
2
  class LearningSession < Resource
4
3
 
5
4
  include DomoscioRails::HTTPCalls::Create
@@ -1,7 +1,7 @@
1
1
  module DomoscioRails
2
- # A Recommandation.
3
2
  class Recommendation < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Fetch
5
- include DomoscioRails::HTTPCalls::Destroy
5
+
6
6
  end
7
7
  end
@@ -1,9 +1,10 @@
1
1
  module DomoscioRails
2
- # A company.
3
2
  class Student < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Create
5
5
  include DomoscioRails::HTTPCalls::Fetch
6
6
  include DomoscioRails::HTTPCalls::Update
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
+
8
9
  end
9
10
  end
@@ -10,7 +10,7 @@ module DomoscioRails
10
10
  @request_url, @code, @details, @body, @request_params = request_url, code, details, body, request_params
11
11
  super(message) if message
12
12
  end
13
- def message; @details.is_a?(Hash) ? @details.dig(:error, :message) : @details; end
13
+ def message; (@details.is_a?(Hash) && @details[:error].is_a?(Hash)) ? @details.dig(:error, :message) : @details; end
14
14
  end
15
15
 
16
16
  # ProcessingError from DomoscioRails
@@ -1,5 +1,4 @@
1
1
  module DomoscioRails
2
- # A Knowledge Edge.
3
2
  class KnowledgeEdge < Resource
4
3
 
5
4
  include DomoscioRails::HTTPCalls::Create
@@ -1,5 +1,4 @@
1
1
  module DomoscioRails
2
- # A Knowledge Graph.
3
2
  class KnowledgeGraph < Resource
4
3
 
5
4
  include DomoscioRails::HTTPCalls::Create
@@ -1,5 +1,4 @@
1
1
  module DomoscioRails
2
- # A Knowledge Node.
3
2
  class KnowledgeNode < Resource
4
3
 
5
4
  include DomoscioRails::HTTPCalls::Create
@@ -1,9 +1,10 @@
1
1
  module DomoscioRails
2
- # A KnowledgeNodeContent.
3
2
  class KnowledgeNodeContent < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Create
5
5
  include DomoscioRails::HTTPCalls::Fetch
6
6
  include DomoscioRails::HTTPCalls::Update
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
+
8
9
  end
9
10
  end
@@ -1,5 +1,4 @@
1
1
  module DomoscioRails
2
- # A Knowledge Edge.
3
2
  class KnowledgeNodeStudent < Resource
4
3
 
5
4
  include DomoscioRails::HTTPCalls::Create
@@ -1,9 +1,10 @@
1
1
  module DomoscioRails
2
- # An objective.
3
2
  class Objective < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Create
5
5
  include DomoscioRails::HTTPCalls::Fetch
6
6
  include DomoscioRails::HTTPCalls::Update
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
+
8
9
  end
9
10
  end
@@ -1,6 +1,7 @@
1
1
  module DomoscioRails
2
- # A LearningPath.
3
- class LearningPath < Resource
2
+ class ObjectiveKnowledgeNode < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Fetch
5
+
5
6
  end
6
7
  end
@@ -0,0 +1,8 @@
1
+ module DomoscioRails
2
+ class ObjectiveKnowledgeNodeStudent < Resource
3
+
4
+ include DomoscioRails::HTTPCalls::Fetch
5
+ include DomoscioRails::HTTPCalls::Update
6
+
7
+ end
8
+ end
@@ -1,10 +1,11 @@
1
1
  module DomoscioRails
2
- # An objective student.
3
2
  class ObjectiveStudent < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Create
5
5
  include DomoscioRails::HTTPCalls::Fetch
6
6
  include DomoscioRails::HTTPCalls::Update
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
8
  include DomoscioRails::HTTPCalls::Util
9
+
9
10
  end
10
11
  end
@@ -1,9 +1,10 @@
1
1
  module DomoscioRails
2
- # A Tag.
3
2
  class Tag < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Create
5
5
  include DomoscioRails::HTTPCalls::Fetch
6
6
  include DomoscioRails::HTTPCalls::Update
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
+
8
9
  end
9
10
  end
@@ -1,9 +1,10 @@
1
1
  module DomoscioRails
2
- # A TagEdge.
3
2
  class TagEdge < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Create
5
5
  include DomoscioRails::HTTPCalls::Fetch
6
6
  include DomoscioRails::HTTPCalls::Update
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
+
8
9
  end
9
10
  end
@@ -1,9 +1,10 @@
1
1
  module DomoscioRails
2
- # A TagSet.
3
2
  class TagSet < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Create
5
5
  include DomoscioRails::HTTPCalls::Fetch
6
6
  include DomoscioRails::HTTPCalls::Update
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
+
8
9
  end
9
10
  end
@@ -1,9 +1,10 @@
1
1
  module DomoscioRails
2
- # A Tagging.
3
2
  class Tagging < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Create
5
5
  include DomoscioRails::HTTPCalls::Fetch
6
6
  include DomoscioRails::HTTPCalls::Update
7
7
  include DomoscioRails::HTTPCalls::Destroy
8
+
8
9
  end
9
10
  end
@@ -1,6 +1,7 @@
1
1
  module DomoscioRails
2
- # A company.
3
2
  class GameplayUtil < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Util
5
+
5
6
  end
6
7
  end
@@ -1,6 +1,7 @@
1
1
  module DomoscioRails
2
- # A company.
3
- class RecommendationUtil < Resource
4
- include DomoscioRails::HTTPCalls::Util
5
- end
6
- end
2
+ class RecommendationUtil < Resource
3
+
4
+ include DomoscioRails::HTTPCalls::Util
5
+
6
+ end
7
+ end
@@ -1,6 +1,7 @@
1
1
  module DomoscioRails
2
- # A company.
3
2
  class ReviewUtil < Resource
3
+
4
4
  include DomoscioRails::HTTPCalls::Util
5
+
5
6
  end
6
7
  end
@@ -1,3 +1,3 @@
1
1
  module DomoscioRails
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domoscio_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoit Praly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-18 00:00:00.000000000 Z
11
+ date: 2021-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -36,39 +36,30 @@ files:
36
36
  - Rakefile
37
37
  - lib/domoscio_rails.rb
38
38
  - lib/domoscio_rails.tbz
39
- - lib/domoscio_rails/adaptative/deterministic/path_rule.rb
40
- - lib/domoscio_rails/adaptative/deterministic/rule_condition.rb
41
- - lib/domoscio_rails/adaptative/deterministic/rule_input.rb
42
- - lib/domoscio_rails/adaptative/deterministic/rule_output.rb
43
- - lib/domoscio_rails/adaptative/predictive/objective.rb
44
- - lib/domoscio_rails/adaptative/predictive/objective_knowledge_node.rb
45
- - lib/domoscio_rails/adaptative/predictive/objective_knowledge_node_student.rb
46
- - lib/domoscio_rails/adaptative/predictive/objective_student.rb
47
- - lib/domoscio_rails/adaptative/recommendation.rb
48
- - lib/domoscio_rails/admin/instance.rb
49
39
  - lib/domoscio_rails/authorization_token.rb
50
- - lib/domoscio_rails/content/content.rb
51
- - lib/domoscio_rails/content/knowledge_node_content.rb
40
+ - lib/domoscio_rails/data/content.rb
52
41
  - lib/domoscio_rails/data/event.rb
53
- - lib/domoscio_rails/data/knowledge_node_student.rb
42
+ - lib/domoscio_rails/data/instance.rb
54
43
  - lib/domoscio_rails/data/learning_session.rb
55
- - lib/domoscio_rails/data/result.rb
44
+ - lib/domoscio_rails/data/recommendation.rb
45
+ - lib/domoscio_rails/data/student.rb
56
46
  - lib/domoscio_rails/errors.rb
57
47
  - lib/domoscio_rails/http_calls.rb
58
48
  - lib/domoscio_rails/json.rb
59
49
  - lib/domoscio_rails/knowledge/knowledge_edge.rb
60
50
  - lib/domoscio_rails/knowledge/knowledge_graph.rb
61
51
  - lib/domoscio_rails/knowledge/knowledge_node.rb
62
- - lib/domoscio_rails/metadata/delta_object.rb
63
- - lib/domoscio_rails/metadata/tag.rb
64
- - lib/domoscio_rails/metadata/tag_edge.rb
65
- - lib/domoscio_rails/metadata/tag_set.rb
66
- - lib/domoscio_rails/metadata/tagging.rb
67
- - lib/domoscio_rails/path/learning_path.rb
52
+ - lib/domoscio_rails/knowledge/knowledge_node_content.rb
53
+ - lib/domoscio_rails/knowledge/knowledge_node_student.rb
54
+ - lib/domoscio_rails/objective/objective.rb
55
+ - lib/domoscio_rails/objective/objective_knowledge_node.rb
56
+ - lib/domoscio_rails/objective/objective_knowledge_node_student.rb
57
+ - lib/domoscio_rails/objective/objective_student.rb
68
58
  - lib/domoscio_rails/resource.rb
69
- - lib/domoscio_rails/student/student.rb
70
- - lib/domoscio_rails/student/student_cluster.rb
71
- - lib/domoscio_rails/utils/alerts_util.rb
59
+ - lib/domoscio_rails/tag/tag.rb
60
+ - lib/domoscio_rails/tag/tag_edge.rb
61
+ - lib/domoscio_rails/tag/tag_set.rb
62
+ - lib/domoscio_rails/tag/tagging.rb
72
63
  - lib/domoscio_rails/utils/gameplay_util.rb
73
64
  - lib/domoscio_rails/utils/recommendation_util.rb
74
65
  - lib/domoscio_rails/utils/review_util.rb
@@ -92,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
83
  - !ruby/object:Gem::Version
93
84
  version: '0'
94
85
  requirements: []
95
- rubygems_version: 3.1.2
86
+ rubygems_version: 3.0.8
96
87
  signing_key:
97
88
  specification_version: 4
98
89
  summary: Summary of DomoscioRails.
@@ -1,9 +0,0 @@
1
- module DomoscioRails
2
- # A RuleCondition.
3
- class RuleCondition < Resource
4
- include DomoscioRails::HTTPCalls::Create
5
- include DomoscioRails::HTTPCalls::Fetch
6
- include DomoscioRails::HTTPCalls::Update
7
- include DomoscioRails::HTTPCalls::Destroy
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module DomoscioRails
2
- # A RuleInput.
3
- class RuleInput < Resource
4
- include DomoscioRails::HTTPCalls::Create
5
- include DomoscioRails::HTTPCalls::Fetch
6
- include DomoscioRails::HTTPCalls::Update
7
- include DomoscioRails::HTTPCalls::Destroy
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module DomoscioRails
2
- # A RuleOutput.
3
- class RuleOutput < Resource
4
- include DomoscioRails::HTTPCalls::Create
5
- include DomoscioRails::HTTPCalls::Fetch
6
- include DomoscioRails::HTTPCalls::Update
7
- include DomoscioRails::HTTPCalls::Destroy
8
- end
9
- end
@@ -1,6 +0,0 @@
1
- module DomoscioRails
2
- # An objective knowledge node.
3
- class ObjectiveKnowledgeNode < Resource
4
- include DomoscioRails::HTTPCalls::Fetch
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- module DomoscioRails
2
- class ObjectiveKnowledgeNodeStudent < Resource
3
- include DomoscioRails::HTTPCalls::Fetch
4
- include DomoscioRails::HTTPCalls::Update
5
- end
6
- end
@@ -1,9 +0,0 @@
1
- module DomoscioRails
2
- # A Content.
3
- class Content < Resource
4
- include DomoscioRails::HTTPCalls::Create
5
- include DomoscioRails::HTTPCalls::Fetch
6
- include DomoscioRails::HTTPCalls::Update
7
- include DomoscioRails::HTTPCalls::Destroy
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- module DomoscioRails
2
- # A Student Result on a KnowledgeNode.
3
- class Result < Resource
4
-
5
- include DomoscioRails::HTTPCalls::Create
6
- include DomoscioRails::HTTPCalls::Fetch
7
- include DomoscioRails::HTTPCalls::Destroy
8
-
9
- end
10
- end
@@ -1,6 +0,0 @@
1
- module DomoscioRails
2
- # A delta object.
3
- class DeltaObject < Resource
4
- include DomoscioRails::HTTPCalls::Fetch
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- module DomoscioRails
2
- # A student cluster.
3
- class StudentCluster < Resource
4
- include DomoscioRails::HTTPCalls::Fetch
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- module DomoscioRails
2
- # A company.
3
- class AlertsUtil < Resource
4
- include DomoscioRails::HTTPCalls::Util
5
- end
6
- end