quiz_api_client 4.14.1 → 4.15.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cadaa3edf6975cbdb4b9281124426254a17d49125d7f3a9342e872b826a132c7
|
4
|
+
data.tar.gz: 73a3bf7743d64540340f09c638aa8cfa8b4125142da6205036b5c6b55b698c0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb0e0a4aad300a2073ab6d534ce201e944bfbfd24280f11509603ac8b81d7c747d175c0408a126c58dec1a326c2715c8cb1e33281d622eeef0a8b52b7e151f66
|
7
|
+
data.tar.gz: 19693517278da57fd622f017e590f8d5081aa4f51c8864545230377bfa53ff44d8cbd1ce85d821b0b3ef8477f1e3e948b844e8db3548ec577840c00c9475541d
|
@@ -25,6 +25,12 @@ module QuizApiClient::Services
|
|
25
25
|
get_media_upload_url_from_quiz_api(params: params, token: token)
|
26
26
|
end
|
27
27
|
|
28
|
+
def bulk_update_item_alignments(params:, token:)
|
29
|
+
raise 'Quiz Id Required' unless params && params[:quiz_id]
|
30
|
+
|
31
|
+
put_bulk_item_outcome_alignments_update(params: params, token: token)
|
32
|
+
end
|
33
|
+
|
28
34
|
private
|
29
35
|
|
30
36
|
def list_from_quiz_api(params:, token:)
|
@@ -55,5 +61,14 @@ module QuizApiClient::Services
|
|
55
61
|
quiz_id = params.delete(:quiz_id)
|
56
62
|
client(token: token).get("/api/quizzes/#{quiz_id}/items/media_upload_url")
|
57
63
|
end
|
64
|
+
|
65
|
+
def put_bulk_item_outcome_alignments_update(params:, token:)
|
66
|
+
quiz_id = params.delete(:quiz_id)
|
67
|
+
client(token: token).put(
|
68
|
+
"/api/quizzes/#{quiz_id}/items/update_outcome_alignments",
|
69
|
+
quiz_id: quiz_id,
|
70
|
+
items: params
|
71
|
+
)
|
72
|
+
end
|
58
73
|
end
|
59
74
|
end
|
@@ -100,4 +100,32 @@ describe QuizApiClient::Services::ItemsService do
|
|
100
100
|
expect(result.parsed_response).to eql(stubbed_response)
|
101
101
|
end
|
102
102
|
end
|
103
|
+
|
104
|
+
describe '#update_outcome_alignments' do
|
105
|
+
let(:put_url) { "https://#{host}/api/quizzes/1/items/update_outcome_alignments" }
|
106
|
+
let(:params) do
|
107
|
+
{
|
108
|
+
items: [
|
109
|
+
{ item_id: 1, outcome_alignment_set_guid: '29d04bab-e499-498b-ae47-bcc6a80ed924' },
|
110
|
+
{ item_id: 2, outcome_alignment_set_guid: 'f9d5002d-7ef5-4341-bf16-471a83a32add' }
|
111
|
+
],
|
112
|
+
quiz_id: 1
|
113
|
+
}
|
114
|
+
end
|
115
|
+
it 'returns status ok' do
|
116
|
+
stub_request(:put, put_url)
|
117
|
+
.to_return(
|
118
|
+
status: 200,
|
119
|
+
headers: { 'Content-Type' => 'application/json' }
|
120
|
+
)
|
121
|
+
result = subject.bulk_update_item_alignments(params: params, token: 'token')
|
122
|
+
|
123
|
+
expect(result.code).to eql(200)
|
124
|
+
end
|
125
|
+
|
126
|
+
it 'raise error for missing quiz_id parameter' do
|
127
|
+
params.delete(:quiz_id)
|
128
|
+
expect { subject.bulk_update_item_alignments(params: p, token: 'token') }.to raise_error('Quiz Id Required')
|
129
|
+
end
|
130
|
+
end
|
103
131
|
end
|
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: 4.
|
4
|
+
version: 4.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Slaughter
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: exe
|
17
17
|
cert_chain: []
|
18
|
-
date: 2024-
|
18
|
+
date: 2024-03-28 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: httparty
|