quiz_api_client 2.5.1 → 2.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ef887c301a1894c3206354b8dffdbefc56c62d4
4
- data.tar.gz: ab8a33913e237c9a082da427102183b2b9934434
3
+ metadata.gz: b4180659165856ded9b3764ed9e934de07a3d776
4
+ data.tar.gz: 88023493343bbf8acecf384db4d30d056f78ac80
5
5
  SHA512:
6
- metadata.gz: 9803341feaa38fc51a4b67448a3e81b05d1b93e1f1d50337c9b28fb0c417b033e26cbf67c593802767da0775fb4f85d1c73beca150bd2b804be884815b74ca21
7
- data.tar.gz: f2c9448121ef82f26ee944bf3e717b08ca4cb013f9126d14139bbd02372ca7b2214957635ca2eeb305d23880f1516b5f1e229850a9391b16c378b35eead2a45b
6
+ metadata.gz: aa0eaa98585b415c124008c862696ebad0c185f0f5d425a1c874bcf62575882e527b67e58fb0303bb127567b17278c4de990700535be814cf299888a501746d5
7
+ data.tar.gz: e1039a2b1ec7403999120785011e87c9205ee9972bfdfdee204e0c5809a37b30dc711b6511edc92d47de9659c087a4f8fcf4bbcc486151ac246184d3d16e93ad
@@ -70,6 +70,14 @@ module QuizApiClient
70
70
  @_session_item_results_service ||= Services::SessionItemResultsService.new(service_params)
71
71
  end
72
72
 
73
+ def items_service
74
+ @_items_service ||= QuizApiClient::Services::ItemsService.new(service_params)
75
+ end
76
+
77
+ def interaction_types_service
78
+ @_interaction_types_service ||= QuizApiClient::Services::InteractionTypesService.new(service_params)
79
+ end
80
+
73
81
  private
74
82
 
75
83
  def service_params
@@ -91,7 +99,9 @@ require 'quiz_api_client/json_formatter'
91
99
  require 'quiz_api_client/services/jwt_service'
92
100
  require 'quiz_api_client/services/base_api_service'
93
101
 
102
+ require 'quiz_api_client/services/interaction_types_service'
94
103
  require 'quiz_api_client/services/item_analyses_service'
104
+ require 'quiz_api_client/services/items_service'
95
105
  require 'quiz_api_client/services/qti_imports_service'
96
106
  require 'quiz_api_client/services/quiz_analyses_service'
97
107
  require 'quiz_api_client/services/quiz_entries_service'
@@ -0,0 +1,15 @@
1
+ module QuizApiClient::Services
2
+ class InteractionTypesService < BaseApiService
3
+ def list(params: {}, token: nil)
4
+ get_from_quiz_api(params: params, token: token)
5
+ end
6
+
7
+ private
8
+
9
+ # rubocop:disable Lint/UnusedMethodArgument
10
+ def get_from_quiz_api(params:, token:)
11
+ client(token: token).get('/api/interaction_types')
12
+ end
13
+ # rubocop:enable Lint/UnusedMethodArgument
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ module QuizApiClient::Services
2
+ class ItemsService < BaseApiService
3
+ def create(params:, token: nil)
4
+ raise 'Quiz Id Required' unless params && params[:quiz_id]
5
+ post_to_quiz_api(params: params, token: token)
6
+ end
7
+
8
+ private
9
+
10
+ def post_to_quiz_api(params:, token:)
11
+ client(token: token).post(
12
+ "/api/quizzes/#{params[:quiz_id]}/items",
13
+ item: params
14
+ )
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,10 @@
1
1
  module QuizApiClient::Services
2
2
  class QuizEntriesService < BaseApiService
3
+ def create(params:, token: nil)
4
+ raise 'Quiz Id Required' unless params && params[:id]
5
+ post_to_quiz_api(params: params, token: token)
6
+ end
7
+
3
8
  def list(params:, token: nil, all: false)
4
9
  raise 'Quiz Id Required' unless params && params[:id]
5
10
  get_from_quiz_api(params: params, token: token, all: all)
@@ -7,6 +12,13 @@ module QuizApiClient::Services
7
12
 
8
13
  private
9
14
 
15
+ def post_to_quiz_api(params:, token:)
16
+ client(token: token).post(
17
+ "/api/quizzes/#{params[:id]}/quiz_entries",
18
+ quiz_entry: params
19
+ )
20
+ end
21
+
10
22
  def get_from_quiz_api(params:, token:, all:)
11
23
  client(token: token).get(
12
24
  "/api/quizzes/#{params[:id]}/quiz_entries",
@@ -1,3 +1,3 @@
1
1
  module QuizApiClient
2
- VERSION = '2.5.1'.freeze
2
+ VERSION = '2.5.2'.freeze
3
3
  end
@@ -47,8 +47,8 @@ Gem::Specification.new do |spec|
47
47
  spec.add_dependency 'link_header', '~> 0.0'
48
48
 
49
49
  spec.add_development_dependency 'bundler', '~> 1.15'
50
- spec.add_development_dependency 'pact', '~> 1.19.2'
51
- spec.add_development_dependency 'pact_broker-client', '~> 1.13.1'
50
+ spec.add_development_dependency 'pact', '~> 1.20.1'
51
+ spec.add_development_dependency 'pact_broker-client', '~> 1.14.0'
52
52
  spec.add_development_dependency 'rake', '~> 12.0'
53
53
  spec.add_development_dependency 'rspec', '~> 3.7'
54
54
  spec.add_development_dependency 'rubocop', '~> 0.52.1'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quiz_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wang
@@ -19,7 +19,7 @@ authors:
19
19
  autorequire:
20
20
  bindir: exe
21
21
  cert_chain: []
22
- date: 2018-02-16 00:00:00.000000000 Z
22
+ date: 2018-03-13 00:00:00.000000000 Z
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: httparty
@@ -89,28 +89,28 @@ dependencies:
89
89
  requirements:
90
90
  - - "~>"
91
91
  - !ruby/object:Gem::Version
92
- version: 1.19.2
92
+ version: 1.20.1
93
93
  type: :development
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - "~>"
98
98
  - !ruby/object:Gem::Version
99
- version: 1.19.2
99
+ version: 1.20.1
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: pact_broker-client
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
104
  - - "~>"
105
105
  - !ruby/object:Gem::Version
106
- version: 1.13.1
106
+ version: 1.14.0
107
107
  type: :development
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - "~>"
112
112
  - !ruby/object:Gem::Version
113
- version: 1.13.1
113
+ version: 1.14.0
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: rake
116
116
  requirement: !ruby/object:Gem::Requirement
@@ -219,7 +219,9 @@ files:
219
219
  - lib/quiz_api_client/http_client.rb
220
220
  - lib/quiz_api_client/json_formatter.rb
221
221
  - lib/quiz_api_client/services/base_api_service.rb
222
+ - lib/quiz_api_client/services/interaction_types_service.rb
222
223
  - lib/quiz_api_client/services/item_analyses_service.rb
224
+ - lib/quiz_api_client/services/items_service.rb
223
225
  - lib/quiz_api_client/services/jwt_service.rb
224
226
  - lib/quiz_api_client/services/qti_imports_service.rb
225
227
  - lib/quiz_api_client/services/quiz_analyses_service.rb
@@ -254,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
256
  version: '0'
255
257
  requirements: []
256
258
  rubyforge_project:
257
- rubygems_version: 2.6.11
259
+ rubygems_version: 2.6.14
258
260
  signing_key:
259
261
  specification_version: 4
260
262
  summary: Ruby client for quiz_api