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
@@ -0,0 +1,59 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "quiz_id": 1,
5
+ "quiz_group_id": null,
6
+ "assessment_question_id": 1,
7
+ "position": 1,
8
+ "question_name": "Question",
9
+ "question_type": "multiple_choice_question",
10
+ "question_text": "<p><a id=\"\" class=\"\" title=\"\" href=\"https://ola.aacc.edu/cwoolson/phl111/disembodied_lady.pdf\" target=\"\">this is a quiz question</a></p>",
11
+ "points_possible": 1,
12
+ "correct_comments": "",
13
+ "incorrect_comments": "",
14
+ "neutral_comments": "",
15
+ "correct_comments_html": "",
16
+ "incorrect_comments_html": "",
17
+ "neutral_comments_html": "",
18
+ "answers": [
19
+ {
20
+ "id": 1244,
21
+ "text": "https://ola.aacc.edu/cwoolson/phl111/disembodied_lady.pdf",
22
+ "html": "",
23
+ "comments": "",
24
+ "comments_html": "",
25
+ "weight": 100
26
+ },
27
+ {
28
+ "id": 8619,
29
+ "text": "",
30
+ "html": "",
31
+ "comments": "",
32
+ "comments_html": "",
33
+ "weight": 0
34
+ },
35
+ {
36
+ "id": 5385,
37
+ "text": "",
38
+ "html": "",
39
+ "comments": "",
40
+ "comments_html": "",
41
+ "weight": 0
42
+ },
43
+ {
44
+ "id": 6697,
45
+ "text": "",
46
+ "html": "",
47
+ "comments": "",
48
+ "comments_html": "",
49
+ "weight": 0
50
+ }
51
+ ],
52
+ "variables": null,
53
+ "formulas": null,
54
+ "answer_tolerance": null,
55
+ "formula_decimal_places": null,
56
+ "matches": null,
57
+ "matching_answer_incorrect_matches": null
58
+ }
59
+ ]
@@ -0,0 +1,31 @@
1
+ {
2
+ "quiz_assignment_overrides": [
3
+ {
4
+ "quiz_id": 1014,
5
+ "due_dates": [
6
+ {
7
+ "id": 158,
8
+ "due_at": "2016-03-10T06:59:59Z",
9
+ "unlock_at": null,
10
+ "lock_at": null,
11
+ "title": "1 student"
12
+ }
13
+ ],
14
+ "all_dates": [
15
+ {
16
+ "id": 158,
17
+ "due_at": "2016-03-10T06:59:59Z",
18
+ "unlock_at": null,
19
+ "lock_at": null,
20
+ "title": "1 student"
21
+ },
22
+ {
23
+ "due_at": "2016-03-27T05:59:59Z",
24
+ "unlock_at": null,
25
+ "lock_at": null,
26
+ "base": true
27
+ }
28
+ ]
29
+ }
30
+ ]
31
+ }
@@ -0,0 +1,20 @@
1
+ {"associated_user_id": null,
2
+ "course_id": 3,
3
+ "course_section_id": 70,
4
+ "id": 1386,
5
+ "limit_privileges_to_course_section": false,
6
+ "root_account_id": 1,
7
+ "type": "StudentEnrollment",
8
+ "updated_at": "2013-06-27T10:05:15-06:00",
9
+ "user_id": 1,
10
+ "enrollment_state": "active",
11
+ "role": "StudentEnrollment",
12
+ "grades": {
13
+ "html_url": "http://localhost:3000/courses/310/grades/1",
14
+ "current_score": null,
15
+ "final_score": null,
16
+ "current_grade": null,
17
+ "final_grade": null
18
+ },
19
+ "html_url": "http://localhost:3000/courses/310/users/1"
20
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": 1,
3
+ "title": "Rubric title",
4
+ "context_id": 1,
5
+ "context_type": "Course",
6
+ "points_possible": 10.0,
7
+ "reusable": false,
8
+ "read_only": true,
9
+ "free_form_criterion_comments": true,
10
+ "hide_score_total": true,
11
+ "assessments": null,
12
+ "associations": null
13
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "rubric_association_id": 4,
3
+ "id": 5,
4
+ "assessor_id": 1,
5
+ "score": 0,
6
+ "data": [
7
+ {
8
+ "id": "blank_2",
9
+ "points": 0,
10
+ "criterion_id": "_7226",
11
+ "learning_outcome_id": null,
12
+ "description": "No Marks",
13
+ "comments_enabled": true,
14
+ "comments": ""
15
+ }
16
+ ],
17
+ "hide_points": false,
18
+ "artifact_type": "Submission",
19
+ "assessment_type": "grading",
20
+ "rubric_id": 4,
21
+ "artifact_id": 10,
22
+ "user_id": 22,
23
+ "comments": null,
24
+ "created_at": "2019-02-07T19:44:03Z",
25
+ "updated_at": "2019-02-07T19:52:11Z",
26
+ "artifact_attempt": 1,
27
+ "ratings": [],
28
+ "assessor_name": "dsolano@instructure.com",
29
+ "related_group_submissions_and_assessments": [],
30
+ "artifact": {},
31
+ "rubric_association": {}
32
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": 1,
3
+ "rubric_id": 1,
4
+ "rubric_association_id": 2,
5
+ "score": 5.0,
6
+ "artifact_type": "Submission",
7
+ "artifact_id": 3,
8
+ "artifact_attempt": 2,
9
+ "assessment_type": "grading",
10
+ "assessor_id": 6,
11
+ "data": null,
12
+ "comments": null
13
+ }
@@ -0,0 +1,10 @@
1
+ [
2
+ {
3
+ "id": 9,
4
+ "name": "Test",
5
+ "avatar_url": "http://localhost:3000/images/messages/avatar-group-50.png",
6
+ "type": "context",
7
+ "user_count": 5,
8
+ "permissions": {}
9
+ }
10
+ ]
@@ -1 +1 @@
1
- {"course_id": 3, "end_at": null, "id": 72, "name": "Section003", "nonxlist_course_id": null, "start_at": null, "sis_section_id": null}
1
+ {"course_id": 3, "end_at": null, "id": 72, "name": "Section003", "nonxlist_course_id": 2, "start_at": null, "sis_section_id": null}
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": 1,
3
+ "name": "testuser@instructure.com",
4
+ "sortable_name": "testuser@instructure.com",
5
+ "short_name": "testuser@instructure.com",
6
+ "sis_user_id": "testuser",
7
+ "integration_id": "",
8
+ "sis_login_id": "testuser@instructure.com",
9
+ "sis_import_id": "",
10
+ "login_id": "testuser@instructure.com",
11
+ "locale": "",
12
+ "permissions": {
13
+ "can_update_name": true,
14
+ "can_update_avatar": false
15
+ }
16
+ }
@@ -0,0 +1,9 @@
1
+ [
2
+ {
3
+ "account_id":2,
4
+ "id":1,
5
+ "sis_user_id":"1234",
6
+ "unique_id":"test@instructure.com",
7
+ "user_id":1
8
+ }
9
+ ]
data/spec/helper.rb CHANGED
@@ -1,7 +1,9 @@
1
+ require 'active_support/core_ext/module'
1
2
  require 'bearcat'
2
3
  require 'rspec'
3
4
  require 'webmock/rspec'
4
5
  require 'json'
6
+ require 'pry'
5
7
 
6
8
  WebMock.disable_net_connect!
7
9