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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 244cd4a8f9e8a9996c2b0d0f4c98b2dc80bf9b64
4
- data.tar.gz: 5d081d0e5c5eb3734439d25ac3f89ee4523fb80a
3
+ metadata.gz: 1047c6475c6879d0406a32058b0cc88a1a159c95
4
+ data.tar.gz: 6cb156cb6106f68ac2284d45e3e05764dc5dd1b4
5
5
  SHA512:
6
- metadata.gz: d933adc2b8cf295b326b595697b27403b0768c4a2e1690ccfb091c2717897e9c75cf25fbafd8168b702f3c3c84e76a3e57ad09f8abaf4cca8c70d363787894a5
7
- data.tar.gz: d8c701f1f5f65c9d7741d343108453ce61ebd09e20cb5f4c38b59000e493dbbf7521590313ef7e6e0a42ec55e6aa11dabb3f9e117ead2fdbdfc38cd48b97c83a
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
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.3.3' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.3.4' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -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 signle assignment_group' do
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.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-03 00:00:00.000000000 Z
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.5.1
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: