bearcat 1.0.0 → 1.5.24

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.
Files changed (193) hide show
  1. checksums.yaml +7 -0
  2. data/bearcat.gemspec +15 -5
  3. data/lib/badgrcat/api_array.rb +25 -0
  4. data/lib/badgrcat/client/methods.rb +54 -0
  5. data/lib/badgrcat/client.rb +53 -0
  6. data/lib/badgrcat/version.rb +3 -0
  7. data/lib/bearcat/api_array.rb +132 -65
  8. data/lib/bearcat/client/account_reports.rb +6 -14
  9. data/lib/bearcat/client/accounts.rb +18 -6
  10. data/lib/bearcat/client/analytics.rb +12 -0
  11. data/lib/bearcat/client/assignment_groups.rb +15 -0
  12. data/lib/bearcat/client/assignments.rb +17 -9
  13. data/lib/bearcat/client/blueprint_courses.rb +25 -0
  14. data/lib/bearcat/client/calendar_events.rb +9 -17
  15. data/lib/bearcat/client/canvas_files.rb +0 -2
  16. data/lib/bearcat/client/conferences.rb +3 -8
  17. data/lib/bearcat/client/content_exports.rb +39 -0
  18. data/lib/bearcat/client/content_migrations.rb +54 -0
  19. data/lib/bearcat/client/conversations.rb +3 -8
  20. data/lib/bearcat/client/courses.rb +25 -14
  21. data/lib/bearcat/client/custom_gradebook_columns.rb +21 -0
  22. data/lib/bearcat/client/discussions.rb +10 -4
  23. data/lib/bearcat/client/enrollments.rb +9 -25
  24. data/lib/bearcat/client/external_tools.rb +18 -0
  25. data/lib/bearcat/client/file_helper.rb +36 -30
  26. data/lib/bearcat/client/files.rb +9 -0
  27. data/lib/bearcat/client/folders.rb +24 -0
  28. data/lib/bearcat/client/graph_ql.rb +17 -0
  29. data/lib/bearcat/client/group_categories.rb +18 -0
  30. data/lib/bearcat/client/group_memberships.rb +14 -0
  31. data/lib/bearcat/client/groups.rb +10 -2
  32. data/lib/bearcat/client/learning_outcomes.rb +17 -0
  33. data/lib/bearcat/client/logins.rb +20 -0
  34. data/lib/bearcat/client/module_items.rb +18 -0
  35. data/lib/bearcat/client/modules.rb +12 -7
  36. data/lib/bearcat/client/o_auth2.rb +18 -9
  37. data/lib/bearcat/client/outcome_groups.rb +2 -4
  38. data/lib/bearcat/client/outcome_imports.rb +48 -0
  39. data/lib/bearcat/client/outcomes.rb +4 -7
  40. data/lib/bearcat/client/pages.rb +15 -0
  41. data/lib/bearcat/client/progresses.rb +9 -0
  42. data/lib/bearcat/client/quizzes.rb +13 -9
  43. data/lib/bearcat/client/reports.rb +37 -17
  44. data/lib/bearcat/client/roles.rb +15 -0
  45. data/lib/bearcat/client/rubric.rb +17 -0
  46. data/lib/bearcat/client/rubric_assessment.rb +13 -0
  47. data/lib/bearcat/client/rubric_association.rb +13 -0
  48. data/lib/bearcat/client/search.rb +9 -0
  49. data/lib/bearcat/client/sections.rb +10 -17
  50. data/lib/bearcat/client/sis_imports.rb +6 -12
  51. data/lib/bearcat/client/submissions.rb +53 -21
  52. data/lib/bearcat/client/tabs.rb +12 -0
  53. data/lib/bearcat/client/users.rb +32 -13
  54. data/lib/bearcat/client.rb +111 -45
  55. data/lib/bearcat/client_module.rb +103 -0
  56. data/lib/bearcat/rate_limiting/increment_bucket.lua +33 -0
  57. data/lib/bearcat/rate_limiting/redis_script.rb +164 -0
  58. data/lib/bearcat/rate_limiting.rb +69 -0
  59. data/lib/bearcat/redis_connection.rb +106 -0
  60. data/lib/bearcat/spec_helpers.rb +125 -0
  61. data/lib/bearcat/version.rb +1 -1
  62. data/lib/bearcat.rb +49 -0
  63. data/lib/catalogcat/api_array.rb +22 -0
  64. data/lib/catalogcat/client/catalogs.rb +21 -0
  65. data/lib/catalogcat/client/certificates.rb +17 -0
  66. data/lib/catalogcat/client/courses.rb +25 -0
  67. data/lib/catalogcat/client/email_domain_sets.rb +17 -0
  68. data/lib/catalogcat/client/enrollments.rb +25 -0
  69. data/lib/catalogcat/client/orders.rb +13 -0
  70. data/lib/catalogcat/client/user_registrations.rb +9 -0
  71. data/lib/catalogcat/client.rb +26 -0
  72. data/lib/catalogcat/version.rb +3 -0
  73. data/lib/catalogcat.rb +14 -0
  74. data/spec/bearcat/api_array_spec.rb +112 -0
  75. data/spec/bearcat/client/accounts_spec.rb +71 -1
  76. data/spec/bearcat/client/analytics_spec.rb +22 -0
  77. data/spec/bearcat/client/assignment_groups_spec.rb +47 -0
  78. data/spec/bearcat/client/assignments_spec.rb +43 -0
  79. data/spec/bearcat/client/blueprint_courses_spec.rb +43 -0
  80. data/spec/bearcat/client/canvas_files_spec.rb +1 -2
  81. data/spec/bearcat/client/content_exports_spec.rb +68 -0
  82. data/spec/bearcat/client/content_migrations_spec.rb +94 -0
  83. data/spec/bearcat/client/courses_spec.rb +81 -2
  84. data/spec/bearcat/client/custom_gradebook_columns_spec.rb +66 -0
  85. data/spec/bearcat/client/discussions_spec.rb +73 -0
  86. data/spec/bearcat/client/enrollments_spec.rb +10 -0
  87. data/spec/bearcat/client/external_tools_spec.rb +106 -0
  88. data/spec/bearcat/client/files_spec.rb +15 -0
  89. data/spec/bearcat/client/folders_spec.rb +18 -0
  90. data/spec/bearcat/client/graph_ql_spec.rb +35 -0
  91. data/spec/bearcat/client/group_categories_spec.rb +45 -0
  92. data/spec/bearcat/client/group_membership_spec.rb +14 -0
  93. data/spec/bearcat/client/group_memberships_spec.rb +36 -0
  94. data/spec/bearcat/client/groups_spec.rb +46 -0
  95. data/spec/bearcat/client/learning_outcomes_spec.rb +25 -0
  96. data/spec/bearcat/client/module_items_spec.rb +60 -0
  97. data/spec/bearcat/client/modules_spec.rb +38 -1
  98. data/spec/bearcat/client/o_auth2_spec.rb +3 -3
  99. data/spec/bearcat/client/pages_spec.rb +17 -0
  100. data/spec/bearcat/client/quizzes_spec.rb +41 -4
  101. data/spec/bearcat/client/reports_spec.rb +40 -1
  102. data/spec/bearcat/client/roles_spec.rb +24 -0
  103. data/spec/bearcat/client/rubric_assessment_spec.rb +47 -0
  104. data/spec/bearcat/client/rubric_association_spec.rb +39 -0
  105. data/spec/bearcat/client/rubric_spec.rb +45 -0
  106. data/spec/bearcat/client/search_spec.rb +16 -0
  107. data/spec/bearcat/client/sections_spec.rb +12 -0
  108. data/spec/bearcat/client/submissions_spec.rb +47 -2
  109. data/spec/bearcat/client/users_spec.rb +43 -0
  110. data/spec/bearcat/client_spec.rb +1 -4
  111. data/spec/bearcat/rate_limiting_spec.rb +62 -0
  112. data/spec/bearcat/stub_bearcat_spec.rb +15 -0
  113. data/spec/fixtures/access_token.json +3 -0
  114. data/spec/fixtures/account_admin_create.json +14 -0
  115. data/spec/fixtures/account_admin_delete.json +15 -0
  116. data/spec/fixtures/account_admins.json +54 -0
  117. data/spec/fixtures/account_courses.json +48 -0
  118. data/spec/fixtures/account_grading_standards.json +20 -0
  119. data/spec/fixtures/account_groups.json +42 -0
  120. data/spec/fixtures/account_role.json +34 -0
  121. data/spec/fixtures/account_roles.json +35 -0
  122. data/spec/fixtures/account_sis_imports.json +39 -0
  123. data/spec/fixtures/account_sub_accounts.json +17 -0
  124. data/spec/fixtures/accounts.json +13 -0
  125. data/spec/fixtures/assignment.json +32 -0
  126. data/spec/fixtures/assignment_group.json +7 -0
  127. data/spec/fixtures/assignment_groups.json +16 -0
  128. data/spec/fixtures/blueprint_migration.json +12 -0
  129. data/spec/fixtures/blueprint_subscriptions.json +5 -0
  130. data/spec/fixtures/blueprint_template.json +7 -0
  131. data/spec/fixtures/blueprint_update_assocations_success.json +3 -0
  132. data/spec/fixtures/communication_channels.json +10 -0
  133. data/spec/fixtures/content_export.json +9 -0
  134. data/spec/fixtures/content_migration_files/content_migration.json +13 -0
  135. data/spec/fixtures/course_copy.json +18 -0
  136. data/spec/fixtures/course_files.json +38 -0
  137. data/spec/fixtures/course_folder.json +21 -0
  138. data/spec/fixtures/course_folders.json +44 -0
  139. data/spec/fixtures/course_grading_standards.json +20 -0
  140. data/spec/fixtures/course_settings.json +33 -0
  141. data/spec/fixtures/create_course_discussion.json +44 -0
  142. data/spec/fixtures/created_group.json +37 -0
  143. data/spec/fixtures/created_group_category.json +15 -0
  144. data/spec/fixtures/created_group_membership.json +8 -0
  145. data/spec/fixtures/created_module.json +13 -0
  146. data/spec/fixtures/custom_gradebook_columns/column_data.json +4 -0
  147. data/spec/fixtures/custom_gradebook_columns/custom_gradebook_column.json +7 -0
  148. data/spec/fixtures/custom_gradebook_columns/custom_gradebook_columns.json +16 -0
  149. data/spec/fixtures/custom_gradebook_columns/gradebook_column_progress.json +14 -0
  150. data/spec/fixtures/dashboard.json +6 -0
  151. data/spec/fixtures/delete_course.json +3 -0
  152. data/spec/fixtures/delete_group_category.json +3 -0
  153. data/spec/fixtures/deleted_group.json +37 -0
  154. data/spec/fixtures/department_level_participation.json +73 -0
  155. data/spec/fixtures/department_level_statistics.json +10 -0
  156. data/spec/fixtures/discussion_entries.json +21 -0
  157. data/spec/fixtures/discussion_entry_replies.json +21 -0
  158. data/spec/fixtures/discussion_topic.json +49 -0
  159. data/spec/fixtures/discussion_topics.json +51 -0
  160. data/spec/fixtures/edited_group.json +129 -0
  161. data/spec/fixtures/edited_group_category.json +15 -0
  162. data/spec/fixtures/enrollment_terms.json +1 -1
  163. data/spec/fixtures/external_tool.json +55 -0
  164. data/spec/fixtures/external_tools.json +57 -0
  165. data/spec/fixtures/file.csv +5 -0
  166. data/spec/fixtures/gradebook_history.json +52 -0
  167. data/spec/fixtures/graph_ql_scores.json +33 -0
  168. data/spec/fixtures/group.json +15 -0
  169. data/spec/fixtures/group_categories.json +28 -0
  170. data/spec/fixtures/group_category.json +13 -0
  171. data/spec/fixtures/group_category_groups.json +20 -0
  172. data/spec/fixtures/group_membership.json +7 -0
  173. data/spec/fixtures/learning_outcome.json +32 -0
  174. data/spec/fixtures/merge_user.json +8 -0
  175. data/spec/fixtures/module.json +15 -0
  176. data/spec/fixtures/module_item.json +15 -0
  177. data/spec/fixtures/module_items.json +47 -0
  178. data/spec/fixtures/ok.json +3 -0
  179. data/spec/fixtures/outcome_result.json +13 -0
  180. data/spec/fixtures/pages.json +40 -0
  181. data/spec/fixtures/progress.json +13 -0
  182. data/spec/fixtures/quizzes/course_quiz_questions.json +59 -0
  183. data/spec/fixtures/quizzes/quiz_assignment_override.json +31 -0
  184. data/spec/fixtures/reactivate_enrollment.json +20 -0
  185. data/spec/fixtures/rubric.json +13 -0
  186. data/spec/fixtures/rubric_assessment.json +32 -0
  187. data/spec/fixtures/rubric_association.json +13 -0
  188. data/spec/fixtures/search_find_recipients.json +10 -0
  189. data/spec/fixtures/update_section.json +1 -1
  190. data/spec/fixtures/user_details.json +16 -0
  191. data/spec/fixtures/user_logins.json +9 -0
  192. data/spec/helper.rb +2 -0
  193. metadata +336 -43
@@ -31,6 +31,13 @@ describe Bearcat::Client::Users do
31
31
  user_avatars.first['type'].should == 'gravatar'
32
32
  end
33
33
 
34
+ it "returns the user details" do
35
+ stub_get(@client, "/api/v1/users/1").to_return(json_response("user_details.json"))
36
+ user_detail = @client.user_detail(1)
37
+ user_detail["id"].should == 1
38
+ user_detail["name"].should == "testuser@instructure.com"
39
+ end
40
+
34
41
  it "returns a users profile" do
35
42
  stub_get(@client, "/api/v1/users/1/profile").to_return(json_response("user_profile.json"))
36
43
  user_profile = @client.user_profile(1)
@@ -38,6 +45,14 @@ describe Bearcat::Client::Users do
38
45
  user_profile["time_zone"].should == "America/Denver"
39
46
  end
40
47
 
48
+ it "returns a users logins" do
49
+ stub_get(@client, "/api/v1/users/1/logins").to_return(json_response("user_logins.json"))
50
+ user_logins = @client.user_logins(1)
51
+ user_logins.count.should == 1
52
+ user_logins.first['account_id'].should == 2
53
+ user_logins.first['unique_id'].should == "test@instructure.com"
54
+ end
55
+
41
56
  it "returns a users page_views" do
42
57
  stub_get(@client, "/api/v1/users/1/page_views").to_return(json_response("user_page_views.json"))
43
58
  page_views = @client.page_views(1)
@@ -47,6 +62,28 @@ describe Bearcat::Client::Users do
47
62
  'real_user'=>nil, 'account'=>1}
48
63
  end
49
64
 
65
+ it 'returns communication channels for user' do
66
+ stub_get(@client, "/api/v1/users/1/communication_channels").to_return(json_response("communication_channels.json"))
67
+ com_channels = @client.communication_channels(1)
68
+ com_channels.members.count.should == 1
69
+ com_channels.members.first['address'].should == 'brandonbr@instructure.com'
70
+ end
71
+
72
+ it 'returns assignments for a user' do
73
+ stub_get(@client, "/api/v1/users/1/courses/1/assignments").to_return(json_response("assignments.json"))
74
+ assignments = @client.user_assignments(1, 1)
75
+ assignments.count.should == 2
76
+ assignments.first["assignment_group_id"].should == 53
77
+ assignments.first["id"].should == 123
78
+ assignments.first["due_at"].should == nil
79
+ end
80
+
81
+ it 'retuns a users dashboard' do
82
+ stub_get(@client, "/api/v1/users/1/dashboard_positions").to_return(json_response("dashboard.json"))
83
+ dashboard = @client.dashboard_positions(1)
84
+ dashboard["dashboard_positions"].length.should == 2
85
+ end
86
+
50
87
  describe 'user custom data' do
51
88
  before (:each) do
52
89
  @query = {"ns" => "com.test.app"}
@@ -100,6 +137,12 @@ describe Bearcat::Client::Users do
100
137
  custom_food_data["data"]["food"]["least_favorite"].should == "water mellon"
101
138
  end
102
139
 
140
+ it "merges user info" do
141
+ body = {}
142
+ stub_put(@client, "/api/v1/users/1/merge_into/2").with(body: body).to_return(json_response('merge_user.json'))
143
+ user = @client.user_merge(1,2)
144
+ end
145
+
103
146
  end
104
147
 
105
148
  context 'DELETE' do
@@ -1,16 +1,13 @@
1
1
  require 'helper'
2
2
 
3
3
  describe Bearcat::Client do
4
-
5
4
  it "sets the domain" do
6
5
  client = Bearcat::Client.new(domain: "http://canvas.instructure.com")
7
6
  client.config[:domain].should == "http://canvas.instructure.com"
8
-
9
7
  end
10
8
 
11
9
  it "sets the authtoken" do
12
10
  client = Bearcat::Client.new(token: "test_token")
13
11
  client.config[:token].should == "test_token"
14
12
  end
15
-
16
- end
13
+ end
@@ -0,0 +1,62 @@
1
+ require 'helper'
2
+
3
+ require 'sidekiq'
4
+
5
+ describe Bearcat::RateLimiting do
6
+ let!(:subject) { Bearcat::RateLimiting::RedisLimiter.new }
7
+ let!(:client) { Bearcat::Client.new(prefix: "http://canvas.instructure.com", rate_limiter: subject, token: SecureRandom.hex) }
8
+ let!(:token) { client.send(:rate_limit_key) }
9
+
10
+ def fillup(count, rate: 100)
11
+ count.times do
12
+ subject.apply(token) do
13
+ rate
14
+ end
15
+ end
16
+ end
17
+
18
+ it "fills the bucket with each request" do
19
+ allow(Time).to receive(:now).and_return(Time.at(5000))
20
+ expect(subject).to_not receive(:sleep)
21
+ fillup(5)
22
+ expect(subject.increment(token, 0, 0)).to eql({ count: 500.0, timestamp: 5000.0 })
23
+ end
24
+
25
+ it "drains the bucket over time" do
26
+ allow(Time).to receive(:now).and_return(Time.at(5000))
27
+ expect(subject).to_not receive(:sleep)
28
+ fillup(5)
29
+
30
+ allow(Time).to receive(:now).and_return(Time.at(5009))
31
+ expect(subject.increment(token, 0, 0)).to eql({ count: 410.0, timestamp: 5009.0 })
32
+ end
33
+
34
+ it "sleeps requests when full" do
35
+ allow(Time).to receive(:now).and_return(Time.at(5000))
36
+ expect(subject).to receive(:sleep).at_least(:once)
37
+ fillup(10)
38
+ end
39
+
40
+ it "rate limits requests" do
41
+ allow(Time).to receive(:now).and_return(Time.at(5000))
42
+ allow(subject).to receive(:sleep)
43
+ fillup(10)
44
+
45
+ stub_request(:get, /.*/).to_return(body: "{}")
46
+ expect(subject).to receive(:sleep).once
47
+ client.course(1)
48
+ end
49
+
50
+ it "retries after a Canvas 403 - Rate Limited" do
51
+ stub_request(:get, /.*/).to_return(status: 403, body: "(Rate Limit Exceeded)")
52
+ expect(subject).to receive(:apply).exactly(3).times.and_call_original
53
+ expect(subject).to receive(:sleep).twice
54
+ expect { client.course(1) }.to raise_error(Footrest::HttpError::Forbidden)
55
+ end
56
+
57
+ it "pushes x-rate-limit-remaining to the bucket" do
58
+ stub_request(:get, /.*/).to_return(headers: { 'X-Rate-Limit-Remaining' => 120 }, body: "{}")
59
+ expect(subject).to receive(:checkin_known).with(token, 20)
60
+ client.course(1)
61
+ end
62
+ end
@@ -0,0 +1,15 @@
1
+ require 'helper'
2
+
3
+ require 'bearcat/spec_helpers'
4
+
5
+ describe Bearcat::SpecHelpers do
6
+ include Bearcat::SpecHelpers
7
+ let!(:client) { Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: SecureRandom.hex) }
8
+
9
+ describe "#stub_bearcat" do
10
+ it "works as expected" do
11
+ stub_bearcat(:course).to_return(body: { id: 10 })
12
+ expect(client.course(1)[:id]).to eql 10
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ {
2
+ "access_token": "foo_bar_token"
3
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "id": 99,
3
+ "role": "AccountAdmin",
4
+ "role_id": 1,
5
+ "user": {
6
+ "id": 1575,
7
+ "name": "Dummy User 4",
8
+ "sortable_name": "4, Dummy User",
9
+ "short_name": "Dummy User 4",
10
+ "sis_user_id": "user1_sis_id",
11
+ "sis_login_id": "dummy_user_4",
12
+ "login_id": "dummy_user_4"
13
+ }
14
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "id": 99,
3
+ "role": "AccountAdmin",
4
+ "role_id": 1,
5
+ "user": {
6
+ "id": 1575,
7
+ "name": "Dummy User 4",
8
+ "sortable_name": "4, Dummy User",
9
+ "short_name": "Dummy User 4",
10
+ "sis_user_id": "user1_sis_id",
11
+ "sis_login_id": "dummy_user_4",
12
+ "login_id": "dummy_user_4"
13
+ },
14
+ "status": "deleted"
15
+ }
@@ -0,0 +1,54 @@
1
+ [
2
+ {
3
+ "id": 3,
4
+ "role": "AccountAdmin",
5
+ "role_id": 1,
6
+ "user": {
7
+ "id": 32,
8
+ "name": "first admin",
9
+ "sortable_name": "admin, first",
10
+ "short_name": "first admin",
11
+ "sis_user_id": "firstadmin",
12
+ "integration_id": null,
13
+ "sis_login_id": "firstadmin",
14
+ "sis_import_id": null,
15
+ "login_id": "firstadmin"
16
+ }
17
+ },
18
+ {
19
+ "id": 4,
20
+ "role": "AccountAdmin",
21
+ "role_id": 1,
22
+ "user": {
23
+ "id": 35,
24
+ "name": "second admin",
25
+ "sortable_name": "admin, second",
26
+ "short_name": "second admin",
27
+ "login_id": "secondadmin"
28
+ }
29
+ },
30
+ {
31
+ "id": 5,
32
+ "role": "AccountAdmin",
33
+ "role_id": 1,
34
+ "user": {
35
+ "id": 36,
36
+ "name": "third admin",
37
+ "sortable_name": "admin, third",
38
+ "short_name": "third admin",
39
+ "login_id": "thirdadmin@example.com"
40
+ }
41
+ },
42
+ {
43
+ "id": 6,
44
+ "role": "Custom Admin",
45
+ "role_id": 13,
46
+ "user": {
47
+ "id": 39,
48
+ "name": "fourth admin",
49
+ "sortable_name": "admin, fourth",
50
+ "short_name": "fourth admin",
51
+ "login_id": "fourthadmin"
52
+ }
53
+ }
54
+ ]
@@ -0,0 +1,48 @@
1
+ [
2
+ {
3
+ "account_id": 3,
4
+ "course_code": "sub1c1",
5
+ "default_view": "feed",
6
+ "enrollment_term_id": 3,
7
+ "grading_standard_id": null,
8
+ "id": 1,
9
+ "is_public": false,
10
+ "name": "Sub1 Course1",
11
+ "start_at": "2015-02-24T19:04:00Z",
12
+ "end_at": null,
13
+ "public_syllabus": false,
14
+ "storage_quota_mb": 500,
15
+ "is_public_to_auth_users": false,
16
+ "apply_assignment_group_weights": false,
17
+ "calendar": {
18
+ "ics": "http://localhost:3000/feeds/calendars/course_jknx1huncbUV3gQSIHfYjFO0uHyBBs53hBQb9RYA.ics"
19
+ },
20
+ "sis_course_id": "2015-TVY15-7006-21094202-832271",
21
+ "integration_id": null,
22
+ "hide_final_grades": false,
23
+ "workflow_state": "available"
24
+ },
25
+ {
26
+ "account_id": 4,
27
+ "course_code": "sub2c1",
28
+ "default_view": "feed",
29
+ "enrollment_term_id": 1,
30
+ "grading_standard_id": null,
31
+ "id": 2,
32
+ "is_public": null,
33
+ "name": "Sub2 Cours1",
34
+ "start_at": "2015-02-24T19:05:03Z",
35
+ "end_at": null,
36
+ "public_syllabus": false,
37
+ "storage_quota_mb": 500,
38
+ "is_public_to_auth_users": false,
39
+ "apply_assignment_group_weights": false,
40
+ "calendar": {
41
+ "ics": "http://localhost:3000/feeds/calendars/course_ugQF3mnjRQ1k5XDGBr6WgUl3a087vUSQHwwzqeYZ.ics"
42
+ },
43
+ "sis_course_id": null,
44
+ "integration_id": null,
45
+ "hide_final_grades": false,
46
+ "workflow_state": "available"
47
+ }
48
+ ]
@@ -0,0 +1,20 @@
1
+ {
2
+ "id":1,
3
+ "title":"account grading scheme",
4
+ "context_id":1,
5
+ "context_type":"Account",
6
+ "grading_scheme":[
7
+ {"name":"A","value":0.94},
8
+ {"name":"A-","value":0.9},
9
+ {"name":"B+","value":0.87},
10
+ {"name":"B","value":0.84},
11
+ {"name":"B-","value":0.8},
12
+ {"name":"C+","value":0.77},
13
+ {"name":"C","value":0.74},
14
+ {"name":"C-","value":0.7},
15
+ {"name":"D+","value":0.67},
16
+ {"name":"D","value":0.64},
17
+ {"name":"D-","value":0.61},
18
+ {"name":"F","value":0.0}
19
+ ]
20
+ }
@@ -0,0 +1,42 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "name": "2010",
5
+ "max_membership": null,
6
+ "is_public": false,
7
+ "join_level": "invitation_only",
8
+ "group_category_id": 22446,
9
+ "description": null,
10
+ "members_count": 7,
11
+ "storage_quota_mb": 50,
12
+ "context_type": "Account",
13
+ "account_id": 97006,
14
+ "avatar_url": null,
15
+ "role": null,
16
+ "leader": null,
17
+ "sis_group_id": null,
18
+ "sis_import_id": null,
19
+ "has_submission": false,
20
+ "concluded": false
21
+ },
22
+ {
23
+ "id": 3,
24
+ "name": "UI Test Groups",
25
+ "max_membership": null,
26
+ "is_public": false,
27
+ "join_level": "invitation_only",
28
+ "group_category_id": 13091,
29
+ "description": null,
30
+ "members_count": 6,
31
+ "storage_quota_mb": 50,
32
+ "context_type": "Account",
33
+ "account_id": 97006,
34
+ "avatar_url": null,
35
+ "role": null,
36
+ "leader": null,
37
+ "sis_group_id": null,
38
+ "sis_import_id": null,
39
+ "has_submission": false,
40
+ "concluded": false
41
+ }
42
+ ]
@@ -0,0 +1,34 @@
1
+ {
2
+ "id": 1,
3
+ "role": "AccountAdmin",
4
+ "label": "Account Admin",
5
+ "base_role_type": "AccountMembership",
6
+ "workflow_state": "built_in",
7
+ "permissions": {
8
+ "read_forum": {
9
+ "enabled": true,
10
+ "locked": false,
11
+ "readonly": false,
12
+ "explicit": false
13
+ },
14
+ "post_to_forum": {
15
+ "enabled": true,
16
+ "locked": false,
17
+ "readonly": false,
18
+ "explicit": false
19
+ },
20
+ "moderate_forum": {
21
+ "enabled": true,
22
+ "locked": false,
23
+ "readonly": false,
24
+ "explicit": false
25
+ },
26
+ "manage_catalog": {
27
+ "enabled": true,
28
+ "locked": false,
29
+ "readonly": false,
30
+ "explicit": false
31
+ }
32
+ }
33
+ }
34
+
@@ -0,0 +1,35 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "role": "AccountAdmin",
5
+ "label": "Account Admin",
6
+ "base_role_type": "AccountMembership",
7
+ "workflow_state": "built_in",
8
+ "permissions": {
9
+ "read_forum": {
10
+ "enabled": true,
11
+ "locked": false,
12
+ "readonly": false,
13
+ "explicit": false
14
+ },
15
+ "post_to_forum": {
16
+ "enabled": true,
17
+ "locked": false,
18
+ "readonly": false,
19
+ "explicit": false
20
+ },
21
+ "moderate_forum": {
22
+ "enabled": true,
23
+ "locked": false,
24
+ "readonly": false,
25
+ "explicit": false
26
+ },
27
+ "manage_catalog": {
28
+ "enabled": true,
29
+ "locked": false,
30
+ "readonly": false,
31
+ "explicit": false
32
+ }
33
+ }
34
+ }
35
+ ]
@@ -0,0 +1,39 @@
1
+ {
2
+ "sis_imports":
3
+ [{"created_at": "2017-03-22T03:01:18Z",
4
+ "started_at": "2017-03-22T03:01:18Z",
5
+ "ended_at": "2017-03-22T03:01:19Z",
6
+ "updated_at": "2017-03-22T03:01:19Z",
7
+ "progress": 100,
8
+ "id": 30,
9
+ "workflow_state": "imported",
10
+ "data": {
11
+ "import_type": "instructure_csv",
12
+ "supplied_batches": [
13
+ "course"
14
+ ],
15
+ "counts": {
16
+ "accounts": 0,
17
+ "terms": 0,
18
+ "abstract_courses": 0,
19
+ "courses": 1,
20
+ "sections": 0,
21
+ "xlists": 0,
22
+ "users": 0,
23
+ "user_observers": 0,
24
+ "enrollments": 0,
25
+ "groups": 0,
26
+ "group_memberships": 0,
27
+ "grade_publishing_results": 0
28
+ }
29
+ },
30
+ "batch_mode": null,
31
+ "batch_mode_term_id": null,
32
+ "override_sis_stickiness": null,
33
+ "add_sis_stickiness": null,
34
+ "clear_sis_stickiness": null,
35
+ "diffing_data_set_identifier": null,
36
+ "diffed_against_import_id": null
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,17 @@
1
+ [
2
+ {
3
+ "id": 2,
4
+ "name": "Manually-Created Courses",
5
+ "workflow_state": "active",
6
+ "parent_account_id": 1,
7
+ "root_account_id": 1,
8
+ "uuid": "rd7NGVGl7f7913DzKCxFUKh17qMTQRZEJ0k4WW3R",
9
+ "default_storage_quota_mb": "5000",
10
+ "default_user_storage_quota_mb": "50",
11
+ "default_group_storage_quota_mb": "50",
12
+ "default_time_zone": "America/Denver",
13
+ "sis_account_id": null,
14
+ "sis_import_id": null,
15
+ "integration_id": null
16
+ }
17
+ ]
@@ -0,0 +1,13 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "name": "Local Testing",
5
+ "parent_account_id": null,
6
+ "root_account_id": null,
7
+ "workflow_state": "active",
8
+ "default_storage_quota_mb": 500,
9
+ "default_user_storage_quota_mb": 50,
10
+ "default_group_storage_quota_mb": 50,
11
+ "default_time_zone": "America/Denver"
12
+ }
13
+ ]
@@ -0,0 +1,32 @@
1
+ {
2
+ "assignment_group_id": 53,
3
+ "automatic_peer_reviews": false,
4
+ "description": "",
5
+ "due_at": null,
6
+ "grade_group_students_individually": false,
7
+ "grading_standard_id": null,
8
+ "grading_type": "points",
9
+ "group_category_id": null,
10
+ "id": 1,
11
+ "lock_at": null,
12
+ "peer_reviews": false,
13
+ "points_possible": 0,
14
+ "position": 14,
15
+ "unlock_at": null,
16
+ "course_id": 3,
17
+ "name": "Start",
18
+ "submission_types": [
19
+ "external_tool"
20
+ ],
21
+ "turnitin_enabled": false,
22
+ "turnitin_settings": {
23
+ "originality_report_visibility": "immediate",
24
+ "s_paper_check": true,
25
+ "internet_check": true,
26
+ "journal_check": true,
27
+ "exclude_biblio": true,
28
+ "exclude_quoted": true,
29
+ "exclude_small_matches_type": null,
30
+ "exclude_small_matches_value": null
31
+ }
32
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "group_weight": 500,
3
+ "id": 2,
4
+ "name": "Quizzes",
5
+ "position": 2,
6
+ "rules": {}
7
+ }
@@ -0,0 +1,16 @@
1
+ [
2
+ {
3
+ "group_weight": 500,
4
+ "id": 2,
5
+ "name": "Quizzes",
6
+ "position": 2,
7
+ "rules": {}
8
+ },
9
+ {
10
+ "group_weight": 500,
11
+ "id": 3,
12
+ "name": "Assignments",
13
+ "position": 3,
14
+ "rules": {}
15
+ }
16
+ ]
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": 1,
3
+ "template_id": 2,
4
+ "subscription_id": 101,
5
+ "user_id": 3,
6
+ "workflow_state": "running",
7
+ "created_at": "2013-08-28T23:59:00-06:00",
8
+ "exports_started_at": "2013-08-28T23:59:00-06:00",
9
+ "imports_queued_at": "2013-08-28T23:59:00-06:00",
10
+ "imports_completed_at": "2013-08-28T23:59:00-06:00",
11
+ "comment": "Fixed spelling in question 3 of midterm exam"
12
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "id": 101,
3
+ "template_id": 1,
4
+ "blueprint_course": {"id":2,"name":"Biology 100 Blueprint","course_code":"BIOL 100 BP","term_name":"Default term"}
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "id": 1,
3
+ "course_id": 2,
4
+ "last_export_completed_at": "2013-08-28T23:59:00-06:00",
5
+ "associated_course_count": 3,
6
+ "latest_migration": null
7
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "success": true
3
+ }
@@ -0,0 +1,10 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "position": 1,
5
+ "user_id": 1,
6
+ "workflow_state": "active",
7
+ "address": "brandonbr@instructure.com",
8
+ "type": "email"
9
+ }
10
+ ]
@@ -0,0 +1,9 @@
1
+ {
2
+ "id": 101,
3
+ "created_at": "2014-01-01T00:00:00Z",
4
+ "export_type": "common_cartridge",
5
+ "attachment": {"url":"https://example.com/api/v1/attachments/789?download_frd=1&verifier=bG9sY2F0cyEh"},
6
+ "progress_url": "https://example.com/api/v1/progress/4",
7
+ "user_id": 4,
8
+ "workflow_state": "exported"
9
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": 370663,
3
+ "migration_type": "common_cartridge_importer",
4
+ "migration_type_title": "Canvas Cartridge Importer",
5
+ "migration_issues_url": "https://example.com/api/v1/courses/1/content_migrations/1/migration_issues",
6
+ "attachment": {"url": "https://example.com/api/v1/courses/1/content_migrations/1/download_archive"},
7
+ "progress_url": "https://example.com/api/v1/progress/4",
8
+ "user_id": 4,
9
+ "workflow_state": "running",
10
+ "started_at": "2012-06-01T00:00:00-06:00",
11
+ "finished_at": "2012-06-01T00:00:00-06:00",
12
+ "pre_attachment": {"upload_url": "", "message": "file exceeded quota", "upload_params": {}}
13
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "finished_at": null,
3
+ "id": 199,
4
+ "migration_type": "course_copy_importer",
5
+ "started_at": null,
6
+ "user_id": 1,
7
+ "workflow_state": "running",
8
+ "created_at": "2015-09-11T13:27:42Z",
9
+ "migration_issues_url": "http://localhost:3000/api/v1/courses/128/content_migrations/199/migration_issues",
10
+ "migration_issues_count": 0,
11
+ "settings": {
12
+ "source_course_id": 2,
13
+ "source_course_name": "Course 2",
14
+ "source_course_html_url": "http://localhost:3000/courses/2"
15
+ },
16
+ "progress_url": "http://localhost:3000/api/v1/progress/200",
17
+ "migration_type_title": "Course Copy"
18
+ }