coalescing_panda 4.5.3 → 4.5.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9e2654ffb761e47c42f91c6ca0ec48175d28ae6
|
4
|
+
data.tar.gz: 54ec67cd8f91046779930dd3d0daf2e62caee131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e90d9021c91fd66e510f4427d63067c6811f3a520d31d49c192a8db00bd5c90c6c6986a834c3c3950dd79ea9fafebf031dc748e07f0ac7125b688d764f4f8fc
|
7
|
+
data.tar.gz: 3cd47f43554ee4d5419a092e3a432eb054b2a98e7ef679aa0ae3635d29486de5cd71a5acfcf6150e714b471c56d5faf409a6c3d96c0f6a2bdad0d891aeeb2fae
|
@@ -65,36 +65,33 @@ class CoalescingPanda::Workers::CourseMiner
|
|
65
65
|
should_download
|
66
66
|
end
|
67
67
|
|
68
|
+
DEFAULT_PARAMS = { 'per_page' => 100 }.freeze
|
69
|
+
|
68
70
|
def process_api_data(key)
|
69
71
|
case key
|
70
72
|
when :assignment_groups
|
71
|
-
collection = api_client.list_assignment_groups(course.canvas_course_id).all_pages!
|
73
|
+
collection = api_client.list_assignment_groups(course.canvas_course_id, DEFAULT_PARAMS).all_pages!
|
72
74
|
sync_assignment_groups(collection)
|
73
75
|
when :sections
|
74
|
-
collection = api_client.course_sections(course.canvas_course_id).all_pages!
|
76
|
+
collection = api_client.course_sections(course.canvas_course_id, DEFAULT_PARAMS).all_pages!
|
75
77
|
sync_sections(collection)
|
76
78
|
when :users
|
77
|
-
collection = api_client.list_course_users(course.canvas_course_id, {'enrollment_state' => enrollment_states}).all_pages!
|
79
|
+
collection = api_client.list_course_users(course.canvas_course_id, DEFAULT_PARAMS.merge({'enrollment_state' => enrollment_states})).all_pages!
|
78
80
|
sync_users(collection)
|
79
81
|
when :enrollments
|
80
|
-
collection = api_client.course_enrollments(course.canvas_course_id, {'state' => enrollment_states}).all_pages!
|
82
|
+
collection = api_client.course_enrollments(course.canvas_course_id, DEFAULT_PARAMS.merge({'state' => enrollment_states})).all_pages!
|
81
83
|
sync_enrollments(collection)
|
82
84
|
when :assignments
|
83
|
-
collection = api_client.assignments(course.canvas_course_id).all_pages!
|
85
|
+
collection = api_client.assignments(course.canvas_course_id, DEFAULT_PARAMS).all_pages!
|
84
86
|
sync_assignments(collection)
|
85
87
|
when :submissions
|
86
|
-
collection =
|
87
|
-
course.assignments.each do |assignment|
|
88
|
-
api_client.get_course_submissions(course.canvas_course_id, assignment.canvas_assignment_id).all_pages!.each do |submissions|
|
89
|
-
collection << submissions
|
90
|
-
end
|
91
|
-
end
|
88
|
+
collection = api_client.course_submissions(course.canvas_course_id, DEFAULT_PARAMS).all_pages!
|
92
89
|
sync_submissions(collection)
|
93
90
|
when :groups
|
94
91
|
collection = api_client.course_groups(course.canvas_course_id).all_pages!
|
95
92
|
sync_groups(collection)
|
96
93
|
when :group_categories
|
97
|
-
collection = api_client.list_group_categories('courses', course.canvas_course_id).all_pages!
|
94
|
+
collection = api_client.list_group_categories('courses', course.canvas_course_id, DEFAULT_PARAMS).all_pages!
|
98
95
|
sync_group_categories(collection)
|
99
96
|
when :group_memberships
|
100
97
|
collection = []
|
@@ -20,11 +20,9 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
|
|
20
20
|
{"assignment_group_id"=>1, "automatic_peer_reviews"=>false, "created_at"=>"2014-11-18T18:04:38Z", "description"=>"<p>What is your name?</p>", "due_at"=>nil, "grade_group_students_individually"=>false, "grading_standard_id"=>nil, "grading_type"=>"points", "group_category_id"=>1, "id"=>1, "lock_at"=>nil, "peer_reviews"=>false, "points_possible"=>100, "position"=>1, "post_to_sis"=>true, "unlock_at"=>nil, "updated_at"=>"2014-11-18T18:04:42Z", "course_id"=>1, "name"=>"Gimme your name", "submission_types"=>["online_text_entry"], "has_submitted_submissions"=>false, "muted"=>false, "html_url"=>"http://localhost:3000/courses/1/assignments/1", "needs_grading_count"=>0, "integration_id"=>nil, "integration_data"=>{}, "published"=>true, "unpublishable"=>true, "locked_for_user"=>false},
|
21
21
|
{"assignment_group_id"=>1, "automatic_peer_reviews"=>false, "created_at"=>"2014-11-18T19:10:28Z", "description"=>"<p>What is your Favorite Color?</p>", "due_at"=>nil, "grade_group_students_individually"=>false, "grading_standard_id"=>nil, "grading_type"=>"points", "group_category_id"=>nil, "id"=>2, "lock_at"=>nil, "peer_reviews"=>false, "points_possible"=>100, "position"=>2, "post_to_sis"=>true, "unlock_at"=>nil, "updated_at"=>"2014-11-18T19:10:30Z", "course_id"=>1, "name"=>"Favorite Color", "submission_types"=>["online_text_entry"], "has_submitted_submissions"=>false, "muted"=>false, "html_url"=>"http://localhost:3000/courses/1/assignments/2", "needs_grading_count"=>0, "integration_id"=>nil, "integration_data"=>{}, "published"=>true, "unpublishable"=>true, "locked_for_user"=>false}
|
22
22
|
]}
|
23
|
-
let(:
|
23
|
+
let(:submissions_response) {[
|
24
24
|
{"assignment_id"=>1, "attempt"=>nil, "body"=>nil, "grade"=>"70", "grade_matches_current_submission"=>true, "graded_at"=>"2014-11-20T23:18:19Z", "grader_id"=>1, "id"=>3, "score"=>70, "submission_type"=>nil, "submitted_at"=>nil, "url"=>nil, "user_id"=>3, "workflow_state"=>"graded", "late"=>false, "preview_url"=>"http://localhost:3000/courses/1/assignments/1/submissions/3?preview=1"},
|
25
|
-
{"assignment_id"=>1, "attempt"=>nil, "body"=>nil, "grade"=>"100", "grade_matches_current_submission"=>true, "graded_at"=>"2014-11-20T23:18:14Z", "grader_id"=>1, "id"=>1, "score"=>100, "submission_type"=>nil, "submitted_at"=>nil, "url"=>nil, "user_id"=>2, "workflow_state"=>"graded", "late"=>false, "preview_url"=>"http://localhost:3000/courses/1/assignments/1/submissions/2?preview=1"}
|
26
|
-
]}
|
27
|
-
let(:submissions_response2) {[
|
25
|
+
{"assignment_id"=>1, "attempt"=>nil, "body"=>nil, "grade"=>"100", "grade_matches_current_submission"=>true, "graded_at"=>"2014-11-20T23:18:14Z", "grader_id"=>1, "id"=>1, "score"=>100, "submission_type"=>nil, "submitted_at"=>nil, "url"=>nil, "user_id"=>2, "workflow_state"=>"graded", "late"=>false, "preview_url"=>"http://localhost:3000/courses/1/assignments/1/submissions/2?preview=1"},
|
28
26
|
{"assignment_id"=>2, "attempt"=>nil, "body"=>nil, "grade"=>"90", "grade_matches_current_submission"=>true, "graded_at"=>"2014-11-20T23:18:21Z", "grader_id"=>1, "id"=>4, "score"=>90, "submission_type"=>nil, "submitted_at"=>nil, "url"=>nil, "user_id"=>3, "workflow_state"=>"graded", "late"=>false, "preview_url"=>"http://localhost:3000/courses/1/assignments/2/submissions/3?preview=1"},
|
29
27
|
{"assignment_id"=>2, "attempt"=>nil, "body"=>nil, "grade"=>"80", "grade_matches_current_submission"=>true, "graded_at"=>"2014-11-20T23:18:17Z", "grader_id"=>1, "id"=>2, "score"=>80, "submission_type"=>nil, "submitted_at"=>nil, "url"=>nil, "user_id"=>2, "workflow_state"=>"graded", "late"=>false, "preview_url"=>"http://localhost:3000/courses/1/assignments/2/submissions/2?preview=1"}
|
30
28
|
]}
|
@@ -49,11 +47,10 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
|
|
49
47
|
Bearcat::Client.any_instance.stub(:course_enrollments) { double(Bearcat::ApiArray, :all_pages! => enrollments_response) }
|
50
48
|
Bearcat::Client.any_instance.stub(:assignments) { double(Bearcat::ApiArray, :all_pages! => assignments_response) }
|
51
49
|
Bearcat::Client.any_instance.stub(:get_course_submissions) { double(Bearcat::ApiArray, :all_pages! => {}) }
|
52
|
-
Bearcat::Client.any_instance.stub(:get_course_submissions).with("1", "1") { double(Bearcat::ApiArray, :all_pages! => submissions_response1) }
|
53
|
-
Bearcat::Client.any_instance.stub(:get_course_submissions).with("1", "2") { double(Bearcat::ApiArray, :all_pages! => submissions_response2) }
|
54
50
|
Bearcat::Client.any_instance.stub(:course_groups) { double(Bearcat::ApiArray, :all_pages! => groups_response) }
|
55
51
|
Bearcat::Client.any_instance.stub(:list_group_memberships) { double(Bearcat::ApiArray, :all_pages! => membership_response) }
|
56
|
-
Bearcat::Client.any_instance.stub(:
|
52
|
+
Bearcat::Client.any_instance.stub(:course_submissions) { double(Bearcat::ApiArray, :all_pages! => submissions_response) }
|
53
|
+
Bearcat::Client.any_instance.stub(:list_assignment_groups) { double(Bearcat::ApiArray, :all_pages! => []) }
|
57
54
|
end
|
58
55
|
|
59
56
|
describe '#initialize' do
|
@@ -133,7 +130,6 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
|
|
133
130
|
|
134
131
|
it 'creates submissions' do
|
135
132
|
CoalescingPanda::Submission.destroy_all
|
136
|
-
submissions_response = submissions_response1 + submissions_response2
|
137
133
|
worker.sync_sections(sections_response)
|
138
134
|
worker.sync_users(users_response)
|
139
135
|
worker.sync_enrollments(enrollments_response)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coalescing_panda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.5.
|
4
|
+
version: 4.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Mills
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-02-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|