bearcat 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bearcat/client/assignment_groups.rb +4 -0
- data/lib/bearcat/client/submissions.rb +8 -0
- data/lib/bearcat/version.rb +1 -1
- data/spec/bearcat/client/assignment_groups_spec.rb +8 -1
- data/spec/bearcat/client/submissions_spec.rb +16 -1
- data/spec/fixtures/progress.json +13 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1047c6475c6879d0406a32058b0cc88a1a159c95
|
4
|
+
data.tar.gz: 6cb156cb6106f68ac2284d45e3e05764dc5dd1b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 788499c589eeba61c1d48a2fad38d605865a6796a09a1679a6aa0c2dba55212248dc6273f5e3e4792312fc6040c29b9cdc0c2689eb41fa87ac9b5d58e7245560
|
7
|
+
data.tar.gz: 6727e28c3511252ae2f87fe49100734514b8fb277aae30a106645fc7fa4cb7217cfd39df3bf68acde630192b2e7bcfdf6eacb5d882767762a445d17561ffde49
|
@@ -10,6 +10,10 @@ module Bearcat
|
|
10
10
|
get("/api/v1/courses/#{course_id}/assignment_groups/#{assignment_group_id}", params)
|
11
11
|
end
|
12
12
|
|
13
|
+
def create_assignment_group(course, params={})
|
14
|
+
post("/api/v1/courses/#{course}/assignment_groups", params)
|
15
|
+
end
|
16
|
+
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
@@ -52,6 +52,14 @@ module Bearcat
|
|
52
52
|
section_submission(section, assignment, params)
|
53
53
|
end
|
54
54
|
|
55
|
+
def course_update_grades(course, assignment, params={})
|
56
|
+
post("/api/v1/courses/#{course}/assignments/#{assignment}/submissions/update_grades", params)
|
57
|
+
end
|
58
|
+
|
59
|
+
def section_update_grades(section, assignment, params={})
|
60
|
+
post("/api/v1/sections/#{section}/assignments/#{assignment}/submissions/update_grades", params)
|
61
|
+
end
|
62
|
+
|
55
63
|
end
|
56
64
|
end
|
57
65
|
end
|
data/lib/bearcat/version.rb
CHANGED
@@ -14,7 +14,7 @@ describe Bearcat::Client::AssignmentGroups do
|
|
14
14
|
assignment_groups.first["name"].should == 'Quizzes'
|
15
15
|
end
|
16
16
|
|
17
|
-
it 'returns a
|
17
|
+
it 'returns a single assignment_group' do
|
18
18
|
stub_get(@client, '/api/v1/courses/2/assignment_groups/1').to_return(json_response("assignment_group.json"))
|
19
19
|
assignment_group = @client.assignment_group(2, 1)
|
20
20
|
assignment_group["group_weight"].should == 500
|
@@ -22,4 +22,11 @@ describe Bearcat::Client::AssignmentGroups do
|
|
22
22
|
assignment_group["name"].should == 'Quizzes'
|
23
23
|
end
|
24
24
|
|
25
|
+
it 'creates an assignment_group' do
|
26
|
+
params = {'name' => 'New Assignment Group'}
|
27
|
+
stub_post(@client, "/api/v1/courses/2/assignment_groups").with(body: params).to_return(json_response("assignment_group.json"))
|
28
|
+
new_assignment_group = @client.create_assignment_group(2, params)
|
29
|
+
expect(new_assignment_group['name']).to eq('Quizzes')
|
30
|
+
end
|
31
|
+
|
25
32
|
end
|
@@ -44,6 +44,14 @@ describe Bearcat::Client::Submissions do
|
|
44
44
|
response = @client.course_file_upload_submission(1, 2, 3, fixture('bearcat.jpg'))
|
45
45
|
response['id'].should == 8444510
|
46
46
|
end
|
47
|
+
|
48
|
+
it "updates grades" do
|
49
|
+
params = {"grade_data[123]" => "19"}
|
50
|
+
stub_post(@client, "/api/v1/courses/1/assignments/1/submissions/update_grades").with(body: {"grade_data"=>["19"]}).to_return(json_response("progress.json"))
|
51
|
+
response = @client.course_update_grades(1, 1, params)
|
52
|
+
expect(response['user_id']).to eq 123
|
53
|
+
expect(response['workflow_state']).to eq 'completed'
|
54
|
+
end
|
47
55
|
end
|
48
56
|
|
49
57
|
context 'section' do
|
@@ -53,7 +61,14 @@ describe Bearcat::Client::Submissions do
|
|
53
61
|
response = @client.section_file_upload_submission(1, 2, 3, fixture('bearcat.jpg'))
|
54
62
|
response['id'].should == 8444510
|
55
63
|
end
|
56
|
-
end
|
57
64
|
|
65
|
+
it "updates grades" do
|
66
|
+
params = {"grade_data[123]" => "19"}
|
67
|
+
stub_post(@client, "/api/v1/sections/9/assignments/1/submissions/update_grades").with(body: {"grade_data"=>["19"]}).to_return(json_response("progress.json"))
|
68
|
+
response = @client.section_update_grades(9, 1, params)
|
69
|
+
expect(response['user_id']).to eq 123
|
70
|
+
expect(response['workflow_state']).to eq 'completed'
|
71
|
+
end
|
72
|
+
end
|
58
73
|
|
59
74
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"id": 1,
|
3
|
+
"context_id": 1,
|
4
|
+
"context_type": "Course",
|
5
|
+
"user_id": 123,
|
6
|
+
"tag": "course_batch_update",
|
7
|
+
"completion": 100,
|
8
|
+
"workflow_state": "completed",
|
9
|
+
"created_at": "2013-01-15T15:00:00Z",
|
10
|
+
"updated_at": "2013-01-15T15:04:00Z",
|
11
|
+
"message": "1 course processed",
|
12
|
+
"url": "https://canvas.example.edu/api/v1/progress/1"
|
13
|
+
}
|
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.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Mills, Jake Sorce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -257,6 +257,7 @@ files:
|
|
257
257
|
- spec/fixtures/outcomes.json
|
258
258
|
- spec/fixtures/paged_body.json
|
259
259
|
- spec/fixtures/pages.json
|
260
|
+
- spec/fixtures/progress.json
|
260
261
|
- spec/fixtures/quizzes/course_quiz.json
|
261
262
|
- spec/fixtures/quizzes/course_quiz_questions.json
|
262
263
|
- spec/fixtures/quizzes/course_quizzes.json
|
@@ -300,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
301
|
version: '0'
|
301
302
|
requirements: []
|
302
303
|
rubyforge_project:
|
303
|
-
rubygems_version: 2.4.
|
304
|
+
rubygems_version: 2.4.8
|
304
305
|
signing_key:
|
305
306
|
specification_version: 4
|
306
307
|
summary: Canvas API
|
@@ -424,6 +425,7 @@ test_files:
|
|
424
425
|
- spec/fixtures/outcomes.json
|
425
426
|
- spec/fixtures/paged_body.json
|
426
427
|
- spec/fixtures/pages.json
|
428
|
+
- spec/fixtures/progress.json
|
427
429
|
- spec/fixtures/quizzes/course_quiz.json
|
428
430
|
- spec/fixtures/quizzes/course_quiz_questions.json
|
429
431
|
- spec/fixtures/quizzes/course_quizzes.json
|
@@ -448,4 +450,3 @@ test_files:
|
|
448
450
|
- spec/fixtures/user_page_views.json
|
449
451
|
- spec/fixtures/user_profile.json
|
450
452
|
- spec/helper.rb
|
451
|
-
has_rdoc:
|