bearcat 1.6.9 → 1.6.12
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 +4 -4
- data/lib/badgrcat/client.rb +15 -2
- data/lib/bearcat/client/accounts.rb +9 -0
- data/lib/bearcat/client/pages.rb +2 -0
- data/lib/bearcat/version.rb +1 -1
- data/lib/catalogcat/api_array.rb +1 -1
- data/lib/catalogcat/client/user_registrations.rb +1 -1
- data/spec/badgrcat/client_spec.rb +151 -0
- data/spec/bearcat/client/accounts_spec.rb +29 -0
- data/spec/bearcat/client/new_quizzes_spec.rb +111 -0
- data/spec/bearcat/client/pages_spec.rb +14 -0
- data/spec/fixtures/created_sub_account.json +15 -0
- data/spec/fixtures/deleted_page.json +13 -0
- data/spec/fixtures/deleted_sub_account.json +15 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_categorization.json +44 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_essay.json +29 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_file_upload.json +32 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_fill_in_multiple_blanks.json +65 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_formula.json +50 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_hot_spot.json +42 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_matching.json +52 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_multiple_answer.json +38 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_numeric.json +30 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_ordering.json +40 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_short_answer.json +31 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_stimulus.json +26 -0
- data/spec/fixtures/new_quizzes/new_quiz_item_true_false.json +29 -0
- data/spec/fixtures/sub_account.json +15 -0
- data/spec/fixtures/updated_page.json +19 -0
- data/spec/fixtures/updated_sub_account.json +15 -0
- metadata +42 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f52b8360f7ce34fd388a13bb54935a02f659eb85f283d99f2afcfadb8c2ad2fa
|
|
4
|
+
data.tar.gz: d22ffcf503be32f35771341fc2183bde298a1f9802172efba7ba5d1813ec7725
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 947870a0adcbde03d22ed11db07c853f03d7236376d04b9f4a138e7f3033c65470ea68c9216f0689361af969560c575675940a6d15e7a59c1d6f570318060ae7
|
|
7
|
+
data.tar.gz: 200a1712dbb4449d892fa8821efecf6208fc72f931205fd9ff48b6f955cccfbcc6d62cf365a41cd5042927705ce36ee7b2e78216f271632225ac14dd3b62d68a
|
data/lib/badgrcat/client.rb
CHANGED
|
@@ -10,6 +10,17 @@ module Badgrcat
|
|
|
10
10
|
include "Badgrcat::Client::#{mname}".constantize
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
attr_reader :access_token, :refresh_token, :expires_in
|
|
14
|
+
|
|
15
|
+
def initialize(options = {}, &block)
|
|
16
|
+
super
|
|
17
|
+
@refresh_token = config[:refresh_token] if config[:refresh_token].present?
|
|
18
|
+
if config[:access_token].present?
|
|
19
|
+
connection.headers[:authorization] = "Bearer #{config[:access_token]}"
|
|
20
|
+
connection.headers['Content-Type'] = 'application/json'
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
13
24
|
# Override Footrest request for ApiArray support
|
|
14
25
|
def request(method, &block)
|
|
15
26
|
response = begin
|
|
@@ -44,6 +55,7 @@ module Badgrcat
|
|
|
44
55
|
|
|
45
56
|
def authenticate!
|
|
46
57
|
connection.headers[:authorization] = nil
|
|
58
|
+
connection.headers['Content-Type'] = nil
|
|
47
59
|
|
|
48
60
|
auth_url = config[:auth_url]
|
|
49
61
|
|
|
@@ -71,10 +83,11 @@ module Badgrcat
|
|
|
71
83
|
authresp = connection.send(:post, auth_url, tok_params)
|
|
72
84
|
authdata = authresp.body
|
|
73
85
|
|
|
86
|
+
@access_token = authdata["access_token"]
|
|
74
87
|
@refresh_token = authdata["refresh_token"].presence || @refresh_token
|
|
75
|
-
|
|
88
|
+
@expires_in = authdata["expires_in"]
|
|
76
89
|
|
|
77
|
-
|
|
90
|
+
connection.headers[:authorization] = "#{authdata['token_type']} #{@access_token}"
|
|
78
91
|
connection.headers['Content-Type'] = "application/json"
|
|
79
92
|
end
|
|
80
93
|
end
|
|
@@ -6,9 +6,18 @@ module Bearcat
|
|
|
6
6
|
prefix "/api/v1/accounts/" do
|
|
7
7
|
get :list_accounts
|
|
8
8
|
|
|
9
|
+
# Sub-accounts are addressed by their own account ID for read/update
|
|
10
|
+
prefix ":sub_account/" do
|
|
11
|
+
get :sub_account
|
|
12
|
+
put :update_sub_account
|
|
13
|
+
end
|
|
14
|
+
|
|
9
15
|
prefix ":account/" do
|
|
10
16
|
get :account
|
|
11
17
|
get :list_sub_accounts, "sub_accounts"
|
|
18
|
+
post :create_sub_account, "sub_accounts"
|
|
19
|
+
delete :delete_sub_account, "sub_accounts/:sub_account"
|
|
20
|
+
|
|
12
21
|
get :terms, "terms"
|
|
13
22
|
get :account_admins, "admins"
|
|
14
23
|
post :create_account_admin, "admins"
|
data/lib/bearcat/client/pages.rb
CHANGED
data/lib/bearcat/version.rb
CHANGED
data/lib/catalogcat/api_array.rb
CHANGED
|
@@ -13,7 +13,7 @@ module Catalogcat
|
|
|
13
13
|
key = 'order' if path =~ %r{.*/order/[0-9]*}
|
|
14
14
|
key = 'orders' if path =~ %r{.*/orders}
|
|
15
15
|
key = 'completed_certificates' if path =~ %r{.*/completed_certificates}
|
|
16
|
-
key = '
|
|
16
|
+
key = 'users' if path =~ %r{.*/users}
|
|
17
17
|
key = 'email_domain_sets' if path =~ %r{.*/email_domain_sets}
|
|
18
18
|
end
|
|
19
19
|
key.present? ? key : super(response)
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
require 'helper'
|
|
2
|
+
require 'badgrcat/client'
|
|
3
|
+
|
|
4
|
+
describe Badgrcat::Client do
|
|
5
|
+
let(:auth_url) { 'http://localhost:3000/o/token' }
|
|
6
|
+
let(:token_response) do
|
|
7
|
+
{
|
|
8
|
+
'access_token' => 'new_access_token',
|
|
9
|
+
'refresh_token' => 'new_refresh_token',
|
|
10
|
+
'expires_in' => 86400,
|
|
11
|
+
'token_type' => 'Bearer'
|
|
12
|
+
}
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
before do
|
|
16
|
+
stub_request(:post, auth_url)
|
|
17
|
+
.to_return(status: 200, body: token_response.to_json, headers: { 'Content-Type' => 'application/json' })
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
describe '#authenticate!' do
|
|
21
|
+
context 'with username/password credentials' do
|
|
22
|
+
let(:client) do
|
|
23
|
+
Badgrcat::Client.new(
|
|
24
|
+
prefix: 'http://localhost:3000',
|
|
25
|
+
auth_url: auth_url,
|
|
26
|
+
username: 'user@example.com',
|
|
27
|
+
password: 'password123'
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it 'exposes token attributes' do
|
|
32
|
+
client.authenticate!
|
|
33
|
+
|
|
34
|
+
expect(client.access_token).to eq('new_access_token')
|
|
35
|
+
expect(client.refresh_token).to eq('new_refresh_token')
|
|
36
|
+
expect(client.expires_in).to eq(86400)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it 'sends username and password in the auth request' do
|
|
40
|
+
client.authenticate!
|
|
41
|
+
|
|
42
|
+
expect(WebMock).to have_requested(:post, auth_url)
|
|
43
|
+
.with(body: hash_including(username: 'user@example.com', password: 'password123'))
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it 'sets the authorization header' do
|
|
47
|
+
client.authenticate!
|
|
48
|
+
|
|
49
|
+
expect(client.connection.headers[:authorization]).to eq('Bearer new_access_token')
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
context 'with a refresh token from config' do
|
|
54
|
+
let(:client) do
|
|
55
|
+
Badgrcat::Client.new(
|
|
56
|
+
prefix: 'http://localhost:3000',
|
|
57
|
+
auth_url: auth_url,
|
|
58
|
+
refresh_token: 'stored_refresh_token'
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
it 'sends the refresh token in the auth request' do
|
|
63
|
+
client.authenticate!
|
|
64
|
+
|
|
65
|
+
expect(WebMock).to have_requested(:post, auth_url)
|
|
66
|
+
.with(body: hash_including(grant_type: 'refresh_token', refresh_token: 'stored_refresh_token'))
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
it 'does not send username or password' do
|
|
70
|
+
client.authenticate!
|
|
71
|
+
|
|
72
|
+
expect(WebMock).not_to have_requested(:post, auth_url)
|
|
73
|
+
.with(body: hash_including(:username))
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
it 'exposes updated token attributes after auth' do
|
|
77
|
+
client.authenticate!
|
|
78
|
+
|
|
79
|
+
expect(client.access_token).to eq('new_access_token')
|
|
80
|
+
expect(client.refresh_token).to eq('new_refresh_token')
|
|
81
|
+
expect(client.expires_in).to eq(86400)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
context 'when both refresh token and credentials are provided' do
|
|
86
|
+
let(:client) do
|
|
87
|
+
Badgrcat::Client.new(
|
|
88
|
+
prefix: 'http://localhost:3000',
|
|
89
|
+
auth_url: auth_url,
|
|
90
|
+
username: 'user@example.com',
|
|
91
|
+
password: 'password123',
|
|
92
|
+
refresh_token: 'stored_refresh_token'
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
it 'uses the refresh token' do
|
|
97
|
+
client.authenticate!
|
|
98
|
+
|
|
99
|
+
expect(WebMock).to have_requested(:post, auth_url)
|
|
100
|
+
.with(body: hash_including(grant_type: 'refresh_token', refresh_token: 'stored_refresh_token'))
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
context 'on subsequent auth calls' do
|
|
105
|
+
let(:client) do
|
|
106
|
+
Badgrcat::Client.new(
|
|
107
|
+
prefix: 'http://localhost:3000',
|
|
108
|
+
auth_url: auth_url,
|
|
109
|
+
username: 'user@example.com',
|
|
110
|
+
password: 'password123'
|
|
111
|
+
)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
it 'uses the refresh token obtained from the first auth call' do
|
|
115
|
+
client.authenticate!
|
|
116
|
+
expect(client.refresh_token).to eq('new_refresh_token')
|
|
117
|
+
|
|
118
|
+
client.authenticate!
|
|
119
|
+
expect(client.refresh_token).to eq('new_refresh_token')
|
|
120
|
+
expect(client.access_token).to eq('new_access_token')
|
|
121
|
+
|
|
122
|
+
expect(WebMock).to have_requested(:post, auth_url)
|
|
123
|
+
.with(body: hash_including(grant_type: 'refresh_token', refresh_token: 'new_refresh_token'))
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
context 'when the response omits a refresh token' do
|
|
128
|
+
let(:token_response) do
|
|
129
|
+
{
|
|
130
|
+
'access_token' => 'another_access_token',
|
|
131
|
+
'refresh_token' => nil,
|
|
132
|
+
'expires_in' => 86400,
|
|
133
|
+
'token_type' => 'Bearer'
|
|
134
|
+
}
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
let(:client) do
|
|
138
|
+
Badgrcat::Client.new(
|
|
139
|
+
prefix: 'http://localhost:3000',
|
|
140
|
+
auth_url: auth_url,
|
|
141
|
+
refresh_token: 'original_refresh_token'
|
|
142
|
+
)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
it 'keeps the existing refresh token' do
|
|
146
|
+
client.authenticate!
|
|
147
|
+
expect(client.refresh_token).to eq('original_refresh_token')
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
@@ -91,4 +91,33 @@ describe Bearcat::Client::Accounts do
|
|
|
91
91
|
expect(sis_imports.first['workflow_state']).to eq 'imported'
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
+
it 'creates a sub-account' do
|
|
95
|
+
stub_post(@client, "/api/v1/accounts/1/sub_accounts").to_return(json_response("created_sub_account.json"))
|
|
96
|
+
sub_account = @client.create_sub_account(1, { account: { name: 'New Sub-Account' } })
|
|
97
|
+
expect(sub_account['id']).to eq 3
|
|
98
|
+
expect(sub_account['name']).to eq 'New Sub-Account'
|
|
99
|
+
expect(sub_account['parent_account_id']).to eq 1
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
it 'returns a single sub-account' do
|
|
103
|
+
stub_get(@client, "/api/v1/accounts/2").to_return(json_response("sub_account.json"))
|
|
104
|
+
sub_account = @client.sub_account(2)
|
|
105
|
+
expect(sub_account['id']).to eq 2
|
|
106
|
+
expect(sub_account['name']).to eq 'Manually-Created Courses'
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
it 'updates a sub-account' do
|
|
110
|
+
stub_put(@client, "/api/v1/accounts/2").to_return(json_response("updated_sub_account.json"))
|
|
111
|
+
sub_account = @client.update_sub_account(2, { account: { name: 'Renamed Sub-Account' } })
|
|
112
|
+
expect(sub_account['id']).to eq 2
|
|
113
|
+
expect(sub_account['name']).to eq 'Renamed Sub-Account'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
it 'deletes a sub-account' do
|
|
117
|
+
stub_delete(@client, "/api/v1/accounts/1/sub_accounts/2").to_return(json_response("deleted_sub_account.json"))
|
|
118
|
+
sub_account = @client.delete_sub_account(1, 2)
|
|
119
|
+
expect(sub_account['id']).to eq 2
|
|
120
|
+
expect(sub_account['workflow_state']).to eq 'deleted'
|
|
121
|
+
end
|
|
122
|
+
|
|
94
123
|
end
|
|
@@ -83,6 +83,117 @@ describe Bearcat::Client::NewQuizzes do
|
|
|
83
83
|
expect { @client.delete_new_quiz_item('1', '1', '1') }.not_to raise_error
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
# Item types
|
|
87
|
+
it 'returns a true/false item' do
|
|
88
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/2').to_return(json_response('new_quizzes/new_quiz_item_true_false.json'))
|
|
89
|
+
item = @client.new_quiz_item('1', '1', '2')
|
|
90
|
+
item['entry']['interaction_type_slug'].should == 'true-false'
|
|
91
|
+
item['entry']['interaction_data']['true_choice'].should == 'True'
|
|
92
|
+
item['entry']['interaction_data']['false_choice'].should == 'False'
|
|
93
|
+
item['entry']['scoring_data']['value'].should == true
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
it 'returns a matching item' do
|
|
97
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/3').to_return(json_response('new_quizzes/new_quiz_item_matching.json'))
|
|
98
|
+
item = @client.new_quiz_item('1', '1', '3')
|
|
99
|
+
item['entry']['interaction_type_slug'].should == 'matching'
|
|
100
|
+
item['entry']['interaction_data']['questions'].count.should == 4
|
|
101
|
+
item['entry']['interaction_data']['answers'].count.should == 5
|
|
102
|
+
item['entry']['scoring_data']['value'].should be_a(Hash)
|
|
103
|
+
item['entry']['scoring_data']['value']['q1'].should == 'Mammal'
|
|
104
|
+
item['entry']['scoring_algorithm'].should == 'PartialDeep'
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
it 'returns a categorization item' do
|
|
108
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/4').to_return(json_response('new_quizzes/new_quiz_item_categorization.json'))
|
|
109
|
+
item = @client.new_quiz_item('1', '1', '4')
|
|
110
|
+
item['entry']['interaction_type_slug'].should == 'categorization'
|
|
111
|
+
item['entry']['interaction_data']['categories'].count.should == 2
|
|
112
|
+
item['entry']['interaction_data']['choices'].count.should == 3
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
it 'returns a rich-fill-blank item' do
|
|
116
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/5').to_return(json_response('new_quizzes/new_quiz_item_fill_in_multiple_blanks.json'))
|
|
117
|
+
item = @client.new_quiz_item('1', '1', '5')
|
|
118
|
+
item['entry']['interaction_type_slug'].should == 'rich-fill-blank'
|
|
119
|
+
item['entry']['interaction_data']['blanks'].count.should == 2
|
|
120
|
+
item['entry']['interaction_data']['blanks'].first['answer_type'].should == 'openEntry'
|
|
121
|
+
item['entry']['interaction_data']['blanks'].last['answer_type'].should == 'dropdown'
|
|
122
|
+
item['entry']['scoring_algorithm'].should == 'MultipleMethods'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
it 'returns a multi-answer item' do
|
|
126
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/6').to_return(json_response('new_quizzes/new_quiz_item_multiple_answer.json'))
|
|
127
|
+
item = @client.new_quiz_item('1', '1', '6')
|
|
128
|
+
item['entry']['interaction_type_slug'].should == 'multi-answer'
|
|
129
|
+
item['entry']['scoring_data']['value'].count.should == 3
|
|
130
|
+
item['entry']['scoring_algorithm'].should == 'PartialScore'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
it 'returns an ordering item' do
|
|
134
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/7').to_return(json_response('new_quizzes/new_quiz_item_ordering.json'))
|
|
135
|
+
item = @client.new_quiz_item('1', '1', '7')
|
|
136
|
+
item['entry']['interaction_type_slug'].should == 'ordering'
|
|
137
|
+
item['entry']['interaction_data']['choices'].should be_a(Hash)
|
|
138
|
+
item['entry']['scoring_data']['value'].should == ['choice1', 'choice2', 'choice3', 'choice4']
|
|
139
|
+
item['entry']['scoring_algorithm'].should == 'DeepEquals'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
it 'returns a short_answer item' do
|
|
143
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/8').to_return(json_response('new_quizzes/new_quiz_item_short_answer.json'))
|
|
144
|
+
item = @client.new_quiz_item('1', '1', '8')
|
|
145
|
+
item['entry']['interaction_type_slug'].should == 'short_answer'
|
|
146
|
+
item['entry']['interaction_data']['answers'].first['item_body'].should == 'photosynthesis'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
it 'returns an essay item' do
|
|
150
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/9').to_return(json_response('new_quizzes/new_quiz_item_essay.json'))
|
|
151
|
+
item = @client.new_quiz_item('1', '1', '9')
|
|
152
|
+
item['entry']['interaction_type_slug'].should == 'essay'
|
|
153
|
+
item['entry']['scoring_algorithm'].should == 'None'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
it 'returns a file-upload item' do
|
|
157
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/10').to_return(json_response('new_quizzes/new_quiz_item_file_upload.json'))
|
|
158
|
+
item = @client.new_quiz_item('1', '1', '10')
|
|
159
|
+
item['entry']['interaction_type_slug'].should == 'file-upload'
|
|
160
|
+
item['entry']['interaction_data']['files_count'].should == '1'
|
|
161
|
+
item['entry']['scoring_algorithm'].should == 'None'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
it 'returns a numeric item' do
|
|
165
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/11').to_return(json_response('new_quizzes/new_quiz_item_numeric.json'))
|
|
166
|
+
item = @client.new_quiz_item('1', '1', '11')
|
|
167
|
+
item['entry']['interaction_type_slug'].should == 'numeric'
|
|
168
|
+
item['entry']['interaction_data'].should == {}
|
|
169
|
+
item['entry']['scoring_data']['value'].first['type'].should == 'exactResponse'
|
|
170
|
+
item['entry']['scoring_algorithm'].should == 'Numeric'
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
it 'returns a formula item' do
|
|
174
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/12').to_return(json_response('new_quizzes/new_quiz_item_formula.json'))
|
|
175
|
+
item = @client.new_quiz_item('1', '1', '12')
|
|
176
|
+
item['entry']['interaction_type_slug'].should == 'formula'
|
|
177
|
+
item['entry']['interaction_data'].should == {}
|
|
178
|
+
item['entry']['scoring_data']['value']['variables'].count.should == 2
|
|
179
|
+
item['entry']['scoring_algorithm'].should == 'Numeric'
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
it 'returns a hot_spot item' do
|
|
183
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/13').to_return(json_response('new_quizzes/new_quiz_item_hot_spot.json'))
|
|
184
|
+
item = @client.new_quiz_item('1', '1', '13')
|
|
185
|
+
item['entry']['interaction_type_slug'].should == 'hot_spot'
|
|
186
|
+
item['entry']['interaction_data']['regions'].first['shape'].should == 'rectangle'
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
it 'returns a stimulus item' do
|
|
190
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/14').to_return(json_response('new_quizzes/new_quiz_item_stimulus.json'))
|
|
191
|
+
item = @client.new_quiz_item('1', '1', '14')
|
|
192
|
+
item['entry_type'].should == 'Stimulus'
|
|
193
|
+
item['entry']['interaction_type_slug'].should == 'stimulus'
|
|
194
|
+
item['points_possible'].should == 0.0
|
|
195
|
+
end
|
|
196
|
+
|
|
86
197
|
# Submissions
|
|
87
198
|
it 'returns a list of submissions for a new quiz' do
|
|
88
199
|
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/submissions').to_return(json_response('new_quizzes/new_quiz_submissions.json'))
|
|
@@ -14,4 +14,18 @@ describe Bearcat::Client::Pages do
|
|
|
14
14
|
pages.last['page_id'].should == 2
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
it "updates a course page" do
|
|
18
|
+
stub_put(@client, "/api/v1/courses/1/pages/instruction-test").to_return(json_response("updated_page.json"))
|
|
19
|
+
page = @client.update_course_page('1', 'instruction-test', { wiki_page: { title: 'Updated Page Title' } })
|
|
20
|
+
expect(page['page_id']).to eq 1
|
|
21
|
+
expect(page['title']).to eq 'Updated Page Title'
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it "deletes a course page" do
|
|
25
|
+
stub_delete(@client, "/api/v1/courses/1/pages/instruction-test").to_return(json_response("deleted_page.json"))
|
|
26
|
+
page = @client.delete_course_page('1', 'instruction-test')
|
|
27
|
+
expect(page['page_id']).to eq 1
|
|
28
|
+
expect(page['published']).to eq false
|
|
29
|
+
end
|
|
30
|
+
|
|
17
31
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 3,
|
|
3
|
+
"name": "New Sub-Account",
|
|
4
|
+
"workflow_state": "active",
|
|
5
|
+
"parent_account_id": 1,
|
|
6
|
+
"root_account_id": 1,
|
|
7
|
+
"uuid": "ab8XYZl9g8024EaLDyGVHLi28rNUQSAFK1l5XX4S",
|
|
8
|
+
"default_storage_quota_mb": "5000",
|
|
9
|
+
"default_user_storage_quota_mb": "50",
|
|
10
|
+
"default_group_storage_quota_mb": "50",
|
|
11
|
+
"default_time_zone": "America/Denver",
|
|
12
|
+
"sis_account_id": null,
|
|
13
|
+
"sis_import_id": null,
|
|
14
|
+
"integration_id": null
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"created_at": "2015-05-20T19:07:44Z",
|
|
3
|
+
"editing_roles": "teachers",
|
|
4
|
+
"title": "Instruction Test",
|
|
5
|
+
"updated_at": "2015-05-20T19:08:13Z",
|
|
6
|
+
"url": "instruction-test",
|
|
7
|
+
"page_id": 1,
|
|
8
|
+
"published": false,
|
|
9
|
+
"hide_from_students": false,
|
|
10
|
+
"front_page": false,
|
|
11
|
+
"html_url": "http://localhost:3000/courses/1/pages/instruction-test",
|
|
12
|
+
"locked_for_user": false
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 2,
|
|
3
|
+
"name": "Manually-Created Courses",
|
|
4
|
+
"workflow_state": "deleted",
|
|
5
|
+
"parent_account_id": 1,
|
|
6
|
+
"root_account_id": 1,
|
|
7
|
+
"uuid": "rd7NGVGl7f7913DzKCxFUKh17qMTQRZEJ0k4WW3R",
|
|
8
|
+
"default_storage_quota_mb": "5000",
|
|
9
|
+
"default_user_storage_quota_mb": "50",
|
|
10
|
+
"default_group_storage_quota_mb": "50",
|
|
11
|
+
"default_time_zone": "America/Denver",
|
|
12
|
+
"sis_account_id": null,
|
|
13
|
+
"sis_import_id": null,
|
|
14
|
+
"integration_id": null
|
|
15
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "4",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 3.0,
|
|
5
|
+
"properties": {},
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "4",
|
|
12
|
+
"title": "Sort each item into the correct category.",
|
|
13
|
+
"item_body": "<p>Sort each item into the correct category.</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {
|
|
16
|
+
"categories": [
|
|
17
|
+
{ "id": "cat1", "position": 1, "item_body": "Mammals" },
|
|
18
|
+
{ "id": "cat2", "position": 2, "item_body": "Reptiles" }
|
|
19
|
+
],
|
|
20
|
+
"choices": [
|
|
21
|
+
{ "id": "choice1", "position": 1, "item_body": "Dog" },
|
|
22
|
+
{ "id": "choice2", "position": 2, "item_body": "Snake" },
|
|
23
|
+
{ "id": "choice3", "position": 3, "item_body": "Whale" }
|
|
24
|
+
],
|
|
25
|
+
"distractors": []
|
|
26
|
+
},
|
|
27
|
+
"properties": {
|
|
28
|
+
"shuffle_rules": { "choices": { "shuffled": true } }
|
|
29
|
+
},
|
|
30
|
+
"scoring_data": {
|
|
31
|
+
"value": [
|
|
32
|
+
{ "category_id": "cat1", "choice_ids": ["choice1", "choice3"] },
|
|
33
|
+
{ "category_id": "cat2", "choice_ids": ["choice2"] }
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"answer_feedback": {},
|
|
37
|
+
"scoring_algorithm": "PartialDeep",
|
|
38
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
39
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
40
|
+
"tag_associations": [],
|
|
41
|
+
"interaction_type_slug": "categorization",
|
|
42
|
+
"feedback": {}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "9",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 10.0,
|
|
5
|
+
"properties": {},
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "9",
|
|
12
|
+
"title": "Describe the causes of World War I.",
|
|
13
|
+
"item_body": "<p>In 3-5 paragraphs, describe the primary causes of World War I.</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {},
|
|
16
|
+
"properties": {
|
|
17
|
+
"word_count_minimum": 100,
|
|
18
|
+
"word_count_maximum": 500
|
|
19
|
+
},
|
|
20
|
+
"scoring_data": { "value": "" },
|
|
21
|
+
"answer_feedback": {},
|
|
22
|
+
"scoring_algorithm": "None",
|
|
23
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
24
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
25
|
+
"tag_associations": [],
|
|
26
|
+
"interaction_type_slug": "essay",
|
|
27
|
+
"feedback": {}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "10",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 5.0,
|
|
5
|
+
"properties": { "required": false },
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "10",
|
|
12
|
+
"title": "Upload your completed worksheet.",
|
|
13
|
+
"item_body": "<p>Upload your completed worksheet as a PDF or image file.</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {
|
|
16
|
+
"files_count": "1",
|
|
17
|
+
"restrict_count": false
|
|
18
|
+
},
|
|
19
|
+
"properties": {
|
|
20
|
+
"allowed_types": null,
|
|
21
|
+
"restrict_types": false
|
|
22
|
+
},
|
|
23
|
+
"scoring_data": { "value": "" },
|
|
24
|
+
"answer_feedback": {},
|
|
25
|
+
"scoring_algorithm": "None",
|
|
26
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
27
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
28
|
+
"tag_associations": [],
|
|
29
|
+
"interaction_type_slug": "file-upload",
|
|
30
|
+
"feedback": {}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "5",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 2.0,
|
|
5
|
+
"properties": { "required": false },
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "5",
|
|
12
|
+
"title": "Fill in the blanks.",
|
|
13
|
+
"item_body": "<p>The <span id=\"blank_blank1\"></span> jumped over the fence. Roses are <span id=\"blank_blank2\"></span></p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {
|
|
16
|
+
"blanks": [
|
|
17
|
+
{
|
|
18
|
+
"id": "blank1",
|
|
19
|
+
"answer_type": "openEntry"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "blank2",
|
|
23
|
+
"choices": [
|
|
24
|
+
{ "id": "ans1", "position": 1, "item_body": "red" },
|
|
25
|
+
{ "id": "ans2", "position": 2, "item_body": "blue" },
|
|
26
|
+
{ "id": "ans3", "position": 3, "item_body": "purple" }
|
|
27
|
+
],
|
|
28
|
+
"answer_type": "dropdown"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"properties": {
|
|
33
|
+
"shuffle_rules": {
|
|
34
|
+
"blanks": {
|
|
35
|
+
"children": {
|
|
36
|
+
"0": { "children": null },
|
|
37
|
+
"1": { "children": { "choices": { "shuffled": true } } }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"scoring_data": {
|
|
43
|
+
"value": [
|
|
44
|
+
{
|
|
45
|
+
"id": "blank1",
|
|
46
|
+
"scoring_data": { "value": "fox", "blank_text": "fox" },
|
|
47
|
+
"scoring_algorithm": "TextContainsAnswer"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "blank2",
|
|
51
|
+
"scoring_data": { "value": "ans1", "blank_text": "red" },
|
|
52
|
+
"scoring_algorithm": "Equivalence"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"working_item_body": "<p>The `fox` jumped over the fence. Roses are `red`</p>"
|
|
56
|
+
},
|
|
57
|
+
"answer_feedback": {},
|
|
58
|
+
"scoring_algorithm": "MultipleMethods",
|
|
59
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
60
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
61
|
+
"tag_associations": [],
|
|
62
|
+
"interaction_type_slug": "rich-fill-blank",
|
|
63
|
+
"feedback": {}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "12",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 5.0,
|
|
5
|
+
"properties": { "required": false },
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "12",
|
|
12
|
+
"title": "Calculate the area of a rectangle.",
|
|
13
|
+
"item_body": "<p>A rectangle has a length of `length` and a width of `width`. What is its area?</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {},
|
|
16
|
+
"properties": {},
|
|
17
|
+
"scoring_data": {
|
|
18
|
+
"value": {
|
|
19
|
+
"formula": "length * width",
|
|
20
|
+
"numeric": {
|
|
21
|
+
"type": "marginOfError",
|
|
22
|
+
"margin": "0",
|
|
23
|
+
"margin_type": "absolute"
|
|
24
|
+
},
|
|
25
|
+
"variables": [
|
|
26
|
+
{ "max": 20, "min": 1, "name": "length", "precision": 0 },
|
|
27
|
+
{ "max": 20, "min": 1, "name": "width", "precision": 0 }
|
|
28
|
+
],
|
|
29
|
+
"answer_count": "5",
|
|
30
|
+
"generated_solutions": [
|
|
31
|
+
{
|
|
32
|
+
"inputs": [{ "name": "length", "value": "3" }, { "name": "width", "value": "4" }],
|
|
33
|
+
"output": "12"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"inputs": [{ "name": "length", "value": "5" }, { "name": "width", "value": "2" }],
|
|
37
|
+
"output": "10"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"answer_feedback": {},
|
|
43
|
+
"scoring_algorithm": "Numeric",
|
|
44
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
45
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
46
|
+
"tag_associations": [],
|
|
47
|
+
"interaction_type_slug": "formula",
|
|
48
|
+
"feedback": {}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "13",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 2.0,
|
|
5
|
+
"properties": {},
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "13",
|
|
12
|
+
"title": "Click on the location of France on the map.",
|
|
13
|
+
"item_body": "<p>Click on the location of France on the map.</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {
|
|
16
|
+
"image": {
|
|
17
|
+
"url": "https://example.com/europe_map.png",
|
|
18
|
+
"width": 800,
|
|
19
|
+
"height": 600
|
|
20
|
+
},
|
|
21
|
+
"regions": [
|
|
22
|
+
{
|
|
23
|
+
"id": "region1",
|
|
24
|
+
"shape": "rectangle",
|
|
25
|
+
"x": 320,
|
|
26
|
+
"y": 220,
|
|
27
|
+
"width": 80,
|
|
28
|
+
"height": 100
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"properties": {},
|
|
33
|
+
"scoring_data": { "value": ["region1"] },
|
|
34
|
+
"answer_feedback": {},
|
|
35
|
+
"scoring_algorithm": "PartialDeep",
|
|
36
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
37
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
38
|
+
"tag_associations": [],
|
|
39
|
+
"interaction_type_slug": "hot_spot",
|
|
40
|
+
"feedback": {}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "3",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 4.0,
|
|
5
|
+
"properties": { "required": false },
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "3",
|
|
12
|
+
"title": "Match each animal to its classification.",
|
|
13
|
+
"item_body": "<p>Match each animal to its classification.</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {
|
|
16
|
+
"answers": ["Mammal", "Bird", "Fish", "Reptile", "Amphibian"],
|
|
17
|
+
"questions": [
|
|
18
|
+
{ "id": "q1", "item_body": "Dog" },
|
|
19
|
+
{ "id": "q2", "item_body": "Eagle" },
|
|
20
|
+
{ "id": "q3", "item_body": "Salmon" },
|
|
21
|
+
{ "id": "q4", "item_body": "Snake" }
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"properties": {
|
|
25
|
+
"shuffle_rules": { "questions": { "shuffled": false } }
|
|
26
|
+
},
|
|
27
|
+
"scoring_data": {
|
|
28
|
+
"value": {
|
|
29
|
+
"q1": "Mammal",
|
|
30
|
+
"q2": "Bird",
|
|
31
|
+
"q3": "Fish",
|
|
32
|
+
"q4": "Reptile"
|
|
33
|
+
},
|
|
34
|
+
"edit_data": {
|
|
35
|
+
"matches": [
|
|
36
|
+
{ "answer_body": "Mammal", "question_id": "q1", "question_body": "Dog" },
|
|
37
|
+
{ "answer_body": "Bird", "question_id": "q2", "question_body": "Eagle" },
|
|
38
|
+
{ "answer_body": "Fish", "question_id": "q3", "question_body": "Salmon" },
|
|
39
|
+
{ "answer_body": "Reptile","question_id": "q4", "question_body": "Snake" }
|
|
40
|
+
],
|
|
41
|
+
"distractors": ["Amphibian"]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"answer_feedback": {},
|
|
45
|
+
"scoring_algorithm": "PartialDeep",
|
|
46
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
47
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
48
|
+
"tag_associations": [],
|
|
49
|
+
"interaction_type_slug": "matching",
|
|
50
|
+
"feedback": {}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "6",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 3.0,
|
|
5
|
+
"properties": { "required": false },
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "6",
|
|
12
|
+
"title": "Which of the following are prime numbers?",
|
|
13
|
+
"item_body": "<p>Which of the following are prime numbers? Select all that apply.</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {
|
|
16
|
+
"choices": [
|
|
17
|
+
{ "id": "choice1", "position": 1, "item_body": "<p>2</p>" },
|
|
18
|
+
{ "id": "choice2", "position": 2, "item_body": "<p>4</p>" },
|
|
19
|
+
{ "id": "choice3", "position": 3, "item_body": "<p>7</p>" },
|
|
20
|
+
{ "id": "choice4", "position": 4, "item_body": "<p>9</p>" },
|
|
21
|
+
{ "id": "choice5", "position": 5, "item_body": "<p>11</p>" }
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"properties": {
|
|
25
|
+
"shuffle_rules": {
|
|
26
|
+
"choices": { "to_lock": [], "shuffled": false }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"scoring_data": { "value": ["choice1", "choice3", "choice5"] },
|
|
30
|
+
"answer_feedback": {},
|
|
31
|
+
"scoring_algorithm": "PartialScore",
|
|
32
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
33
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
34
|
+
"tag_associations": [],
|
|
35
|
+
"interaction_type_slug": "multi-answer",
|
|
36
|
+
"feedback": {}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "11",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 3.0,
|
|
5
|
+
"properties": { "required": false },
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "11",
|
|
12
|
+
"title": "What is the boiling point of water in degrees Celsius?",
|
|
13
|
+
"item_body": "<p>What is the boiling point of water in degrees Celsius?</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {},
|
|
16
|
+
"properties": {},
|
|
17
|
+
"scoring_data": {
|
|
18
|
+
"value": [
|
|
19
|
+
{ "id": "1", "type": "exactResponse", "value": "100" }
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"answer_feedback": {},
|
|
23
|
+
"scoring_algorithm": "Numeric",
|
|
24
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
25
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
26
|
+
"tag_associations": [],
|
|
27
|
+
"interaction_type_slug": "numeric",
|
|
28
|
+
"feedback": {}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "7",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 4.0,
|
|
5
|
+
"properties": { "required": false },
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "7",
|
|
12
|
+
"title": "Order the planets from closest to farthest from the Sun.",
|
|
13
|
+
"item_body": "<p>Order the planets from closest to farthest from the Sun.</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {
|
|
16
|
+
"choices": {
|
|
17
|
+
"choice1": { "id": "choice1", "item_body": "<p>Mercury</p>" },
|
|
18
|
+
"choice2": { "id": "choice2", "item_body": "<p>Venus</p>" },
|
|
19
|
+
"choice3": { "id": "choice3", "item_body": "<p>Earth</p>" },
|
|
20
|
+
"choice4": { "id": "choice4", "item_body": "<p>Mars</p>" }
|
|
21
|
+
},
|
|
22
|
+
"item_body": ""
|
|
23
|
+
},
|
|
24
|
+
"properties": {
|
|
25
|
+
"top_label": "",
|
|
26
|
+
"bottom_label": "",
|
|
27
|
+
"shuffle_rules": null,
|
|
28
|
+
"include_labels": true,
|
|
29
|
+
"display_answers_paragraph": false
|
|
30
|
+
},
|
|
31
|
+
"scoring_data": { "value": ["choice1", "choice2", "choice3", "choice4"] },
|
|
32
|
+
"answer_feedback": {},
|
|
33
|
+
"scoring_algorithm": "DeepEquals",
|
|
34
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
35
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
36
|
+
"tag_associations": [],
|
|
37
|
+
"interaction_type_slug": "ordering",
|
|
38
|
+
"feedback": {}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "8",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 2.0,
|
|
5
|
+
"properties": {},
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "8",
|
|
12
|
+
"title": "What process do plants use to convert sunlight into food?",
|
|
13
|
+
"item_body": "<p>What process do plants use to convert sunlight into food?</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {
|
|
16
|
+
"answers": [
|
|
17
|
+
{ "id": "ans1", "item_body": "photosynthesis" },
|
|
18
|
+
{ "id": "ans2", "item_body": "Photosynthesis" }
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"properties": {},
|
|
22
|
+
"scoring_data": { "value": ["ans1", "ans2"] },
|
|
23
|
+
"answer_feedback": {},
|
|
24
|
+
"scoring_algorithm": "Equivalence",
|
|
25
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
26
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
27
|
+
"tag_associations": [],
|
|
28
|
+
"interaction_type_slug": "short_answer",
|
|
29
|
+
"feedback": {}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "14",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 0.0,
|
|
5
|
+
"properties": {},
|
|
6
|
+
"entry_type": "Stimulus",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "14",
|
|
12
|
+
"title": "Reading Passage: The Water Cycle",
|
|
13
|
+
"item_body": "<p>The water cycle describes the continuous movement of water on, above, and below Earth's surface. Water evaporates from oceans and lakes, rises into the atmosphere, condenses into clouds, and falls back to the ground as precipitation.</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {},
|
|
16
|
+
"properties": {},
|
|
17
|
+
"scoring_data": {},
|
|
18
|
+
"answer_feedback": {},
|
|
19
|
+
"scoring_algorithm": "None",
|
|
20
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
21
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
22
|
+
"tag_associations": [],
|
|
23
|
+
"interaction_type_slug": "stimulus",
|
|
24
|
+
"feedback": {}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "2",
|
|
3
|
+
"position": 1,
|
|
4
|
+
"points_possible": 1.0,
|
|
5
|
+
"properties": {},
|
|
6
|
+
"entry_type": "Item",
|
|
7
|
+
"entry_editable": true,
|
|
8
|
+
"stimulus_quiz_entry_id": "",
|
|
9
|
+
"status": "mutable",
|
|
10
|
+
"entry": {
|
|
11
|
+
"id": "2",
|
|
12
|
+
"title": "The Earth orbits the Sun.",
|
|
13
|
+
"item_body": "<p>The Earth orbits the Sun.</p>",
|
|
14
|
+
"calculator_type": "none",
|
|
15
|
+
"interaction_data": {
|
|
16
|
+
"true_choice": "True",
|
|
17
|
+
"false_choice": "False"
|
|
18
|
+
},
|
|
19
|
+
"properties": {},
|
|
20
|
+
"scoring_data": { "value": true },
|
|
21
|
+
"answer_feedback": {},
|
|
22
|
+
"scoring_algorithm": "Equivalence",
|
|
23
|
+
"created_at": "2026-04-23T10:00:00.000Z",
|
|
24
|
+
"updated_at": "2026-04-23T10:00:00.000Z",
|
|
25
|
+
"tag_associations": [],
|
|
26
|
+
"interaction_type_slug": "true-false",
|
|
27
|
+
"feedback": {}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 2,
|
|
3
|
+
"name": "Manually-Created Courses",
|
|
4
|
+
"workflow_state": "active",
|
|
5
|
+
"parent_account_id": 1,
|
|
6
|
+
"root_account_id": 1,
|
|
7
|
+
"uuid": "rd7NGVGl7f7913DzKCxFUKh17qMTQRZEJ0k4WW3R",
|
|
8
|
+
"default_storage_quota_mb": "5000",
|
|
9
|
+
"default_user_storage_quota_mb": "50",
|
|
10
|
+
"default_group_storage_quota_mb": "50",
|
|
11
|
+
"default_time_zone": "America/Denver",
|
|
12
|
+
"sis_account_id": null,
|
|
13
|
+
"sis_import_id": null,
|
|
14
|
+
"integration_id": null
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"created_at": "2015-05-20T19:07:44Z",
|
|
3
|
+
"editing_roles": "teachers",
|
|
4
|
+
"title": "Updated Page Title",
|
|
5
|
+
"updated_at": "2015-05-21T10:00:00Z",
|
|
6
|
+
"url": "instruction-test",
|
|
7
|
+
"page_id": 1,
|
|
8
|
+
"last_edited_by": {
|
|
9
|
+
"id": 1,
|
|
10
|
+
"display_name": "ctanner@instructure.com",
|
|
11
|
+
"avatar_image_url": "https://canvas.instructure.com/images/messages/avatar-50.png",
|
|
12
|
+
"html_url": "http://localhost:3000/courses/1/users/1"
|
|
13
|
+
},
|
|
14
|
+
"published": true,
|
|
15
|
+
"hide_from_students": false,
|
|
16
|
+
"front_page": false,
|
|
17
|
+
"html_url": "http://localhost:3000/courses/1/pages/instruction-test",
|
|
18
|
+
"locked_for_user": false
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 2,
|
|
3
|
+
"name": "Renamed Sub-Account",
|
|
4
|
+
"workflow_state": "active",
|
|
5
|
+
"parent_account_id": 1,
|
|
6
|
+
"root_account_id": 1,
|
|
7
|
+
"uuid": "rd7NGVGl7f7913DzKCxFUKh17qMTQRZEJ0k4WW3R",
|
|
8
|
+
"default_storage_quota_mb": "5000",
|
|
9
|
+
"default_user_storage_quota_mb": "50",
|
|
10
|
+
"default_group_storage_quota_mb": "50",
|
|
11
|
+
"default_time_zone": "America/Denver",
|
|
12
|
+
"sis_account_id": null,
|
|
13
|
+
"sis_import_id": null,
|
|
14
|
+
"integration_id": null
|
|
15
|
+
}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bearcat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Instructure CustomDev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -253,6 +253,7 @@ files:
|
|
|
253
253
|
- lib/catalogcat/client/orders.rb
|
|
254
254
|
- lib/catalogcat/client/user_registrations.rb
|
|
255
255
|
- lib/catalogcat/version.rb
|
|
256
|
+
- spec/badgrcat/client_spec.rb
|
|
256
257
|
- spec/bearcat/api_array_spec.rb
|
|
257
258
|
- spec/bearcat/client/accounts_spec.rb
|
|
258
259
|
- spec/bearcat/client/analytics_spec.rb
|
|
@@ -363,6 +364,7 @@ files:
|
|
|
363
364
|
- spec/fixtures/created_group_category.json
|
|
364
365
|
- spec/fixtures/created_group_membership.json
|
|
365
366
|
- spec/fixtures/created_module.json
|
|
367
|
+
- spec/fixtures/created_sub_account.json
|
|
366
368
|
- spec/fixtures/custom_data.json
|
|
367
369
|
- spec/fixtures/custom_food_data.json
|
|
368
370
|
- spec/fixtures/custom_gradebook_columns/column_data.json
|
|
@@ -376,6 +378,8 @@ files:
|
|
|
376
378
|
- spec/fixtures/delete_section.json
|
|
377
379
|
- spec/fixtures/deleted_conversation.json
|
|
378
380
|
- spec/fixtures/deleted_group.json
|
|
381
|
+
- spec/fixtures/deleted_page.json
|
|
382
|
+
- spec/fixtures/deleted_sub_account.json
|
|
379
383
|
- spec/fixtures/department_level_participation.json
|
|
380
384
|
- spec/fixtures/department_level_statistics.json
|
|
381
385
|
- spec/fixtures/discussion_entries.json
|
|
@@ -408,6 +412,19 @@ files:
|
|
|
408
412
|
- spec/fixtures/new_quizzes/course_new_quiz.json
|
|
409
413
|
- spec/fixtures/new_quizzes/course_new_quizzes.json
|
|
410
414
|
- spec/fixtures/new_quizzes/new_quiz_item.json
|
|
415
|
+
- spec/fixtures/new_quizzes/new_quiz_item_categorization.json
|
|
416
|
+
- spec/fixtures/new_quizzes/new_quiz_item_essay.json
|
|
417
|
+
- spec/fixtures/new_quizzes/new_quiz_item_file_upload.json
|
|
418
|
+
- spec/fixtures/new_quizzes/new_quiz_item_fill_in_multiple_blanks.json
|
|
419
|
+
- spec/fixtures/new_quizzes/new_quiz_item_formula.json
|
|
420
|
+
- spec/fixtures/new_quizzes/new_quiz_item_hot_spot.json
|
|
421
|
+
- spec/fixtures/new_quizzes/new_quiz_item_matching.json
|
|
422
|
+
- spec/fixtures/new_quizzes/new_quiz_item_multiple_answer.json
|
|
423
|
+
- spec/fixtures/new_quizzes/new_quiz_item_numeric.json
|
|
424
|
+
- spec/fixtures/new_quizzes/new_quiz_item_ordering.json
|
|
425
|
+
- spec/fixtures/new_quizzes/new_quiz_item_short_answer.json
|
|
426
|
+
- spec/fixtures/new_quizzes/new_quiz_item_stimulus.json
|
|
427
|
+
- spec/fixtures/new_quizzes/new_quiz_item_true_false.json
|
|
411
428
|
- spec/fixtures/new_quizzes/new_quiz_items.json
|
|
412
429
|
- spec/fixtures/new_quizzes/new_quiz_report.json
|
|
413
430
|
- spec/fixtures/new_quizzes/new_quiz_reports.json
|
|
@@ -441,11 +458,14 @@ files:
|
|
|
441
458
|
- spec/fixtures/section_enrollments.json
|
|
442
459
|
- spec/fixtures/single_account.json
|
|
443
460
|
- spec/fixtures/start_report.json
|
|
461
|
+
- spec/fixtures/sub_account.json
|
|
444
462
|
- spec/fixtures/submissions/submission.json
|
|
445
463
|
- spec/fixtures/update_outcome.json
|
|
446
464
|
- spec/fixtures/update_outcome_group.json
|
|
447
465
|
- spec/fixtures/update_section.json
|
|
448
466
|
- spec/fixtures/updated_course.json
|
|
467
|
+
- spec/fixtures/updated_page.json
|
|
468
|
+
- spec/fixtures/updated_sub_account.json
|
|
449
469
|
- spec/fixtures/user_avatars.json
|
|
450
470
|
- spec/fixtures/user_details.json
|
|
451
471
|
- spec/fixtures/user_enrollments.json
|
|
@@ -523,6 +543,7 @@ test_files:
|
|
|
523
543
|
- spec/bearcat/client/groups_spec.rb
|
|
524
544
|
- spec/bearcat/client/quizzes_spec.rb
|
|
525
545
|
- spec/helper.rb
|
|
546
|
+
- spec/badgrcat/client_spec.rb
|
|
526
547
|
- spec/fixtures/account_grading_standards.json
|
|
527
548
|
- spec/fixtures/add_custom_user_data.json
|
|
528
549
|
- spec/fixtures/assignment_group.json
|
|
@@ -531,6 +552,7 @@ test_files:
|
|
|
531
552
|
- spec/fixtures/section_enrollments.json
|
|
532
553
|
- spec/fixtures/outcome_groups.json
|
|
533
554
|
- spec/fixtures/assignments.json
|
|
555
|
+
- spec/fixtures/deleted_page.json
|
|
534
556
|
- spec/fixtures/course_files.json
|
|
535
557
|
- spec/fixtures/assignment_section_override.json
|
|
536
558
|
- spec/fixtures/delete_course.json
|
|
@@ -556,6 +578,7 @@ test_files:
|
|
|
556
578
|
- spec/fixtures/content_migration_files/upload_success.json
|
|
557
579
|
- spec/fixtures/content_migration_files/content_migration.json
|
|
558
580
|
- spec/fixtures/content_migration_files/response.json
|
|
581
|
+
- spec/fixtures/updated_page.json
|
|
559
582
|
- spec/fixtures/created_assignment.json
|
|
560
583
|
- spec/fixtures/course_conferences.json
|
|
561
584
|
- spec/fixtures/create_outcome_in_group.json
|
|
@@ -579,6 +602,7 @@ test_files:
|
|
|
579
602
|
- spec/fixtures/course_students.json
|
|
580
603
|
- spec/fixtures/updated_course.json
|
|
581
604
|
- spec/fixtures/discussion_topics.json
|
|
605
|
+
- spec/fixtures/created_sub_account.json
|
|
582
606
|
- spec/fixtures/user_enrollments.json
|
|
583
607
|
- spec/fixtures/account_roles.json
|
|
584
608
|
- spec/fixtures/add_user.json
|
|
@@ -595,13 +619,26 @@ test_files:
|
|
|
595
619
|
- spec/fixtures/update_outcome_group.json
|
|
596
620
|
- spec/fixtures/module_item.json
|
|
597
621
|
- spec/fixtures/report_status.json
|
|
622
|
+
- spec/fixtures/new_quizzes/new_quiz_item_fill_in_multiple_blanks.json
|
|
598
623
|
- spec/fixtures/new_quizzes/course_new_quizzes.json
|
|
599
624
|
- spec/fixtures/new_quizzes/new_quiz_submission.json
|
|
625
|
+
- spec/fixtures/new_quizzes/new_quiz_item_stimulus.json
|
|
600
626
|
- spec/fixtures/new_quizzes/new_quiz_items.json
|
|
627
|
+
- spec/fixtures/new_quizzes/new_quiz_item_formula.json
|
|
628
|
+
- spec/fixtures/new_quizzes/new_quiz_item_short_answer.json
|
|
629
|
+
- spec/fixtures/new_quizzes/new_quiz_item_ordering.json
|
|
630
|
+
- spec/fixtures/new_quizzes/new_quiz_item_categorization.json
|
|
601
631
|
- spec/fixtures/new_quizzes/new_quiz_report.json
|
|
632
|
+
- spec/fixtures/new_quizzes/new_quiz_item_true_false.json
|
|
602
633
|
- spec/fixtures/new_quizzes/new_quiz_submissions.json
|
|
603
634
|
- spec/fixtures/new_quizzes/new_quiz_reports.json
|
|
635
|
+
- spec/fixtures/new_quizzes/new_quiz_item_matching.json
|
|
636
|
+
- spec/fixtures/new_quizzes/new_quiz_item_hot_spot.json
|
|
637
|
+
- spec/fixtures/new_quizzes/new_quiz_item_multiple_answer.json
|
|
604
638
|
- spec/fixtures/new_quizzes/new_quiz_item.json
|
|
639
|
+
- spec/fixtures/new_quizzes/new_quiz_item_numeric.json
|
|
640
|
+
- spec/fixtures/new_quizzes/new_quiz_item_essay.json
|
|
641
|
+
- spec/fixtures/new_quizzes/new_quiz_item_file_upload.json
|
|
605
642
|
- spec/fixtures/new_quizzes/course_new_quiz.json
|
|
606
643
|
- spec/fixtures/enroll_student.json
|
|
607
644
|
- spec/fixtures/group_category.json
|
|
@@ -634,6 +671,7 @@ test_files:
|
|
|
634
671
|
- spec/fixtures/access_token.json
|
|
635
672
|
- spec/fixtures/progress.json
|
|
636
673
|
- spec/fixtures/module.json
|
|
674
|
+
- spec/fixtures/deleted_sub_account.json
|
|
637
675
|
- spec/fixtures/group_categories.json
|
|
638
676
|
- spec/fixtures/course_folders.json
|
|
639
677
|
- spec/fixtures/department_level_statistics.json
|
|
@@ -646,6 +684,7 @@ test_files:
|
|
|
646
684
|
- spec/fixtures/modules.json
|
|
647
685
|
- spec/fixtures/group.json
|
|
648
686
|
- spec/fixtures/outcome_subgroup.json
|
|
687
|
+
- spec/fixtures/sub_account.json
|
|
649
688
|
- spec/fixtures/outcome_subgroups.json
|
|
650
689
|
- spec/fixtures/delete_section.json
|
|
651
690
|
- spec/fixtures/account_user.json
|
|
@@ -658,6 +697,7 @@ test_files:
|
|
|
658
697
|
- spec/fixtures/quizzes/quiz_assignment_override.json
|
|
659
698
|
- spec/fixtures/quizzes/quiz_extension.json
|
|
660
699
|
- spec/fixtures/quizzes/course_quiz.json
|
|
700
|
+
- spec/fixtures/updated_sub_account.json
|
|
661
701
|
- spec/fixtures/content_export.json
|
|
662
702
|
- spec/fixtures/created_group.json
|
|
663
703
|
- spec/fixtures/pages.json
|