bearcat 1.6.8 → 1.6.10
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.
- checksums.yaml +4 -4
- data/Rakefile +0 -0
- data/lib/badgrcat/api_array.rb +0 -0
- data/lib/badgrcat/version.rb +0 -0
- data/lib/bearcat/client/account_reports.rb +0 -0
- data/lib/bearcat/client/accounts.rb +9 -0
- data/lib/bearcat/client/analytics.rb +0 -0
- data/lib/bearcat/client/assignment_groups.rb +0 -0
- data/lib/bearcat/client/assignments.rb +0 -0
- data/lib/bearcat/client/blueprint_courses.rb +0 -0
- data/lib/bearcat/client/calendar_events.rb +0 -0
- data/lib/bearcat/client/canvas_files.rb +0 -0
- data/lib/bearcat/client/conferences.rb +0 -0
- data/lib/bearcat/client/content_exports.rb +0 -0
- data/lib/bearcat/client/content_migrations.rb +0 -0
- data/lib/bearcat/client/conversations.rb +0 -0
- data/lib/bearcat/client/custom_gradebook_columns.rb +0 -0
- data/lib/bearcat/client/discussions.rb +0 -0
- data/lib/bearcat/client/enrollments.rb +0 -0
- data/lib/bearcat/client/external_tools.rb +0 -0
- data/lib/bearcat/client/file_helper.rb +0 -0
- data/lib/bearcat/client/files.rb +0 -0
- data/lib/bearcat/client/folders.rb +0 -0
- data/lib/bearcat/client/group_categories.rb +0 -0
- data/lib/bearcat/client/group_memberships.rb +0 -0
- data/lib/bearcat/client/groups.rb +0 -0
- data/lib/bearcat/client/learning_outcomes.rb +0 -0
- data/lib/bearcat/client/logins.rb +0 -0
- data/lib/bearcat/client/module_items.rb +0 -0
- data/lib/bearcat/client/modules.rb +0 -0
- data/lib/bearcat/client/new_quizzes.rb +45 -0
- data/lib/bearcat/client/o_auth2.rb +0 -0
- data/lib/bearcat/client/outcome_groups.rb +0 -0
- data/lib/bearcat/client/outcome_imports.rb +0 -0
- data/lib/bearcat/client/outcomes.rb +0 -0
- data/lib/bearcat/client/pages.rb +2 -0
- data/lib/bearcat/client/progresses.rb +0 -0
- data/lib/bearcat/client/quizzes.rb +0 -0
- data/lib/bearcat/client/roles.rb +0 -0
- data/lib/bearcat/client/rubric.rb +0 -0
- data/lib/bearcat/client/rubric_assessment.rb +0 -0
- data/lib/bearcat/client/rubric_association.rb +0 -0
- data/lib/bearcat/client/search.rb +0 -0
- data/lib/bearcat/client/sections.rb +0 -0
- data/lib/bearcat/client/sis_imports.rb +0 -0
- data/lib/bearcat/client/tabs.rb +0 -0
- data/lib/bearcat/client_module.rb +0 -0
- data/lib/bearcat/rate_limiting/increment_bucket.lua +0 -0
- data/lib/bearcat/rate_limiting/redis_script.rb +0 -0
- data/lib/bearcat/rate_limiting.rb +0 -0
- data/lib/bearcat/version.rb +1 -1
- data/lib/catalogcat/api_array.rb +0 -0
- data/lib/catalogcat/client/catalogs.rb +0 -0
- data/lib/catalogcat/client/certificates.rb +0 -0
- data/lib/catalogcat/client/courses.rb +0 -0
- data/lib/catalogcat/client/email_domain_sets.rb +0 -0
- data/lib/catalogcat/client/enrollments.rb +0 -0
- data/lib/catalogcat/client/orders.rb +0 -0
- data/lib/catalogcat/client/user_registrations.rb +0 -0
- data/lib/catalogcat/client.rb +0 -0
- data/lib/catalogcat/version.rb +0 -0
- data/lib/catalogcat.rb +0 -0
- data/spec/bearcat/api_array_spec.rb +0 -0
- data/spec/bearcat/client/accounts_spec.rb +29 -0
- data/spec/bearcat/client/analytics_spec.rb +0 -0
- data/spec/bearcat/client/assignment_groups_spec.rb +0 -0
- data/spec/bearcat/client/assignments_spec.rb +0 -0
- data/spec/bearcat/client/blueprint_courses_spec.rb +0 -0
- data/spec/bearcat/client/calendar_events_spec.rb +0 -0
- data/spec/bearcat/client/canvas_files_spec.rb +0 -0
- data/spec/bearcat/client/conferences_spec.rb +0 -0
- data/spec/bearcat/client/content_exports_spec.rb +0 -0
- data/spec/bearcat/client/content_migrations_spec.rb +0 -0
- data/spec/bearcat/client/conversations_spec.rb +0 -0
- data/spec/bearcat/client/courses_spec.rb +0 -0
- data/spec/bearcat/client/custom_gradebook_columns_spec.rb +0 -0
- data/spec/bearcat/client/discussions_spec.rb +0 -0
- data/spec/bearcat/client/enrollments_spec.rb +0 -0
- data/spec/bearcat/client/external_tools_spec.rb +0 -0
- data/spec/bearcat/client/files_spec.rb +0 -0
- data/spec/bearcat/client/folders_spec.rb +0 -0
- data/spec/bearcat/client/graph_ql_spec.rb +0 -0
- data/spec/bearcat/client/group_categories_spec.rb +0 -0
- data/spec/bearcat/client/group_membership_spec.rb +0 -0
- data/spec/bearcat/client/group_memberships_spec.rb +0 -0
- data/spec/bearcat/client/groups_spec.rb +0 -0
- data/spec/bearcat/client/learning_outcomes_spec.rb +0 -0
- data/spec/bearcat/client/module_items_spec.rb +0 -0
- data/spec/bearcat/client/modules_spec.rb +0 -0
- data/spec/bearcat/client/new_quizzes_spec.rb +146 -0
- data/spec/bearcat/client/o_auth2_spec.rb +0 -0
- data/spec/bearcat/client/outcome_groups_spec.rb +0 -0
- data/spec/bearcat/client/outcomes_spec.rb +0 -0
- data/spec/bearcat/client/pages_spec.rb +14 -0
- data/spec/bearcat/client/quizzes_spec.rb +0 -0
- data/spec/bearcat/client/roles_spec.rb +0 -0
- data/spec/bearcat/client/rubric_assessment_spec.rb +0 -0
- data/spec/bearcat/client/rubric_association_spec.rb +0 -0
- data/spec/bearcat/client/rubric_spec.rb +0 -0
- data/spec/bearcat/client/search_spec.rb +0 -0
- data/spec/bearcat/client/sections_spec.rb +0 -0
- data/spec/bearcat/client/submissions_spec.rb +0 -0
- data/spec/bearcat/client/users_spec.rb +0 -0
- data/spec/bearcat/rate_limiting_spec.rb +0 -0
- data/spec/bearcat/stub_bearcat_spec.rb +0 -0
- data/spec/bearcat_spec.rb +0 -0
- data/spec/fixtures/access_token.json +0 -0
- data/spec/fixtures/account_admin_create.json +0 -0
- data/spec/fixtures/account_admin_delete.json +0 -0
- data/spec/fixtures/account_admins.json +0 -0
- data/spec/fixtures/account_courses.json +0 -0
- data/spec/fixtures/account_grading_standards.json +0 -0
- data/spec/fixtures/account_groups.json +0 -0
- data/spec/fixtures/account_reports.json +0 -0
- data/spec/fixtures/account_reports_index.json +0 -0
- data/spec/fixtures/account_reports_result_success.json +0 -0
- data/spec/fixtures/account_reports_start_result.json +0 -0
- data/spec/fixtures/account_role.json +0 -0
- data/spec/fixtures/account_roles.json +0 -0
- data/spec/fixtures/account_sis_imports.json +0 -0
- data/spec/fixtures/account_sub_accounts.json +0 -0
- data/spec/fixtures/account_user.json +0 -0
- data/spec/fixtures/account_users.json +0 -0
- data/spec/fixtures/accounts.json +0 -0
- data/spec/fixtures/add_custom_user_data.json +0 -0
- data/spec/fixtures/add_user.json +0 -0
- data/spec/fixtures/assignment.json +0 -0
- data/spec/fixtures/assignment_group.json +0 -0
- data/spec/fixtures/assignment_groups.json +0 -0
- data/spec/fixtures/assignment_section_override.json +0 -0
- data/spec/fixtures/assignments.json +0 -0
- data/spec/fixtures/bearcat.jpg +0 -0
- data/spec/fixtures/blueprint_migration.json +0 -0
- data/spec/fixtures/blueprint_subscriptions.json +0 -0
- data/spec/fixtures/blueprint_template.json +0 -0
- data/spec/fixtures/blueprint_update_assocations_success.json +0 -0
- data/spec/fixtures/calendar_event.json +0 -0
- data/spec/fixtures/calendar_events.json +0 -0
- data/spec/fixtures/canvas_files/declare_file.json +0 -0
- data/spec/fixtures/canvas_files/upload_success.json +0 -0
- data/spec/fixtures/cc.imscc +0 -0
- data/spec/fixtures/communication_channels.json +0 -0
- data/spec/fixtures/conclude_enrollment.json +0 -0
- data/spec/fixtures/content_export.json +0 -0
- data/spec/fixtures/content_migration_files/content_migration.json +0 -0
- data/spec/fixtures/content_migration_files/response.json +0 -0
- data/spec/fixtures/content_migration_files/upload_success.json +0 -0
- data/spec/fixtures/conversation.json +0 -0
- data/spec/fixtures/course.json +0 -0
- data/spec/fixtures/course_conferences.json +0 -0
- data/spec/fixtures/course_copy.json +0 -0
- data/spec/fixtures/course_enrollments.json +0 -0
- data/spec/fixtures/course_files.json +0 -0
- data/spec/fixtures/course_folder.json +0 -0
- data/spec/fixtures/course_folders.json +0 -0
- data/spec/fixtures/course_grading_standards.json +0 -0
- data/spec/fixtures/course_groups.json +0 -0
- data/spec/fixtures/course_sections.json +0 -0
- data/spec/fixtures/course_settings.json +0 -0
- data/spec/fixtures/course_students.json +0 -0
- data/spec/fixtures/create_course_discussion.json +0 -0
- data/spec/fixtures/create_group_discussion.json +0 -0
- data/spec/fixtures/create_outcome_in_group.json +0 -0
- data/spec/fixtures/create_section.json +0 -0
- data/spec/fixtures/created_assignment.json +0 -0
- data/spec/fixtures/created_course.json +0 -0
- data/spec/fixtures/created_group.json +0 -0
- data/spec/fixtures/created_group_category.json +0 -0
- data/spec/fixtures/created_group_membership.json +0 -0
- data/spec/fixtures/created_module.json +0 -0
- data/spec/fixtures/created_sub_account.json +15 -0
- data/spec/fixtures/custom_data.json +0 -0
- data/spec/fixtures/custom_food_data.json +0 -0
- data/spec/fixtures/custom_gradebook_columns/column_data.json +0 -0
- data/spec/fixtures/custom_gradebook_columns/custom_gradebook_column.json +0 -0
- data/spec/fixtures/custom_gradebook_columns/custom_gradebook_columns.json +0 -0
- data/spec/fixtures/custom_gradebook_columns/gradebook_column_progress.json +0 -0
- data/spec/fixtures/dashboard.json +0 -0
- data/spec/fixtures/delete_course.json +0 -0
- data/spec/fixtures/delete_custom_data_scope.json +0 -0
- data/spec/fixtures/delete_group_category.json +0 -0
- data/spec/fixtures/delete_section.json +0 -0
- data/spec/fixtures/deleted_conversation.json +0 -0
- data/spec/fixtures/deleted_group.json +0 -0
- data/spec/fixtures/deleted_page.json +13 -0
- data/spec/fixtures/deleted_sub_account.json +15 -0
- data/spec/fixtures/department_level_participation.json +0 -0
- data/spec/fixtures/department_level_statistics.json +0 -0
- data/spec/fixtures/discussion_entries.json +0 -0
- data/spec/fixtures/discussion_entry_replies.json +0 -0
- data/spec/fixtures/discussion_topic.json +0 -0
- data/spec/fixtures/discussion_topics.json +0 -0
- data/spec/fixtures/edited_group.json +0 -0
- data/spec/fixtures/edited_group_category.json +0 -0
- data/spec/fixtures/enroll_student.json +0 -0
- data/spec/fixtures/enrollment_terms.json +0 -0
- data/spec/fixtures/external_tool.json +0 -0
- data/spec/fixtures/external_tools.json +0 -0
- data/spec/fixtures/file.csv +0 -0
- data/spec/fixtures/gradebook_history.json +0 -0
- data/spec/fixtures/graph_ql_scores.json +0 -0
- data/spec/fixtures/group.json +0 -0
- data/spec/fixtures/group_categories.json +0 -0
- data/spec/fixtures/group_category.json +0 -0
- data/spec/fixtures/group_category_groups.json +0 -0
- data/spec/fixtures/group_conferences.json +0 -0
- data/spec/fixtures/group_membership.json +0 -0
- data/spec/fixtures/learning_outcome.json +0 -0
- data/spec/fixtures/link_unlink_outcome.json +0 -0
- data/spec/fixtures/merge_user.json +0 -0
- data/spec/fixtures/module.json +0 -0
- data/spec/fixtures/module_item.json +0 -0
- data/spec/fixtures/module_item_sequence.json +0 -0
- data/spec/fixtures/module_items.json +0 -0
- data/spec/fixtures/modules.json +0 -0
- data/spec/fixtures/new_quizzes/course_new_quiz.json +27 -0
- data/spec/fixtures/new_quizzes/course_new_quizzes.json +56 -0
- data/spec/fixtures/new_quizzes/new_quiz_item.json +35 -0
- data/spec/fixtures/new_quizzes/new_quiz_items.json +72 -0
- data/spec/fixtures/new_quizzes/new_quiz_report.json +14 -0
- data/spec/fixtures/new_quizzes/new_quiz_reports.json +26 -0
- data/spec/fixtures/new_quizzes/new_quiz_submission.json +12 -0
- data/spec/fixtures/new_quizzes/new_quiz_submissions.json +26 -0
- data/spec/fixtures/no_custom_data.json +0 -0
- data/spec/fixtures/ok.json +0 -0
- data/spec/fixtures/outcome_group_import.json +0 -0
- data/spec/fixtures/outcome_groups.json +0 -0
- data/spec/fixtures/outcome_result.json +0 -0
- data/spec/fixtures/outcome_subgroup.json +0 -0
- data/spec/fixtures/outcome_subgroups.json +0 -0
- data/spec/fixtures/outcomes.json +0 -0
- data/spec/fixtures/paged_body.json +0 -0
- data/spec/fixtures/pages.json +0 -0
- data/spec/fixtures/progress.json +0 -0
- data/spec/fixtures/quizzes/course_quiz.json +0 -0
- data/spec/fixtures/quizzes/course_quiz_questions.json +0 -0
- data/spec/fixtures/quizzes/course_quizzes.json +0 -0
- data/spec/fixtures/quizzes/quiz_assignment_override.json +0 -0
- data/spec/fixtures/quizzes/quiz_extension.json +0 -0
- data/spec/fixtures/reactivate_enrollment.json +0 -0
- data/spec/fixtures/report_history.json +0 -0
- data/spec/fixtures/report_list.json +0 -0
- data/spec/fixtures/report_status.json +0 -0
- data/spec/fixtures/rubric.json +0 -0
- data/spec/fixtures/rubric_assessment.json +0 -0
- data/spec/fixtures/rubric_association.json +0 -0
- data/spec/fixtures/search_find_recipients.json +0 -0
- data/spec/fixtures/section.json +0 -0
- data/spec/fixtures/section_enrollments.json +0 -0
- data/spec/fixtures/single_account.json +0 -0
- data/spec/fixtures/start_report.json +0 -0
- data/spec/fixtures/sub_account.json +15 -0
- data/spec/fixtures/submissions/submission.json +0 -0
- data/spec/fixtures/update_outcome.json +0 -0
- data/spec/fixtures/update_outcome_group.json +0 -0
- data/spec/fixtures/update_section.json +0 -0
- data/spec/fixtures/updated_course.json +0 -0
- data/spec/fixtures/updated_page.json +19 -0
- data/spec/fixtures/updated_sub_account.json +15 -0
- data/spec/fixtures/user_avatars.json +0 -0
- data/spec/fixtures/user_details.json +0 -0
- data/spec/fixtures/user_enrollments.json +0 -0
- data/spec/fixtures/user_logins.json +0 -0
- data/spec/fixtures/user_page_views.json +0 -0
- data/spec/fixtures/user_profile.json +0 -0
- data/spec/helper.rb +4 -0
- metadata +33 -3
- data/lib/bearcat/rate_limiting/functions.lua +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6da81a40773d9eba82a151acdfbca17550ae9a707b6089f31a1df74f5e9c8abd
|
|
4
|
+
data.tar.gz: 0f6de89595ede0206490f91d7490311e29d4206c42f35b21e8f35e36ea3dabd1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd621b13dbecaeabadce71ddc403836f40d78e62439db93dd0066fd7f823a761b469250ba51692d5ea68368d6632cab5da7faf45da55b2c8077777c85167d696
|
|
7
|
+
data.tar.gz: 35497af71785998f52ac54d9f5729b56777d76f94f882878aecd21d33281b5058f0df4a9ba6db414fe87c179c002bb6599ffab18d9d80a8bbf73e98220fe2d82
|
data/Rakefile
CHANGED
|
File without changes
|
data/lib/badgrcat/api_array.rb
CHANGED
|
File without changes
|
data/lib/badgrcat/version.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -6,9 +6,18 @@ module Bearcat
|
|
|
6
6
|
prefix "/api/v1/accounts/" do
|
|
7
7
|
get :list_accounts
|
|
8
8
|
|
|
9
|
+
# Sub-accounts are addressed by their own account ID for read/update
|
|
10
|
+
prefix ":sub_account/" do
|
|
11
|
+
get :sub_account
|
|
12
|
+
put :update_sub_account
|
|
13
|
+
end
|
|
14
|
+
|
|
9
15
|
prefix ":account/" do
|
|
10
16
|
get :account
|
|
11
17
|
get :list_sub_accounts, "sub_accounts"
|
|
18
|
+
post :create_sub_account, "sub_accounts"
|
|
19
|
+
delete :delete_sub_account, "sub_accounts/:sub_account"
|
|
20
|
+
|
|
12
21
|
get :terms, "terms"
|
|
13
22
|
get :account_admins, "admins"
|
|
14
23
|
post :create_account_admin, "admins"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/bearcat/client/files.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bearcat
|
|
4
|
+
class Client < Footrest::Client
|
|
5
|
+
module NewQuizzes
|
|
6
|
+
extend ClientModule
|
|
7
|
+
|
|
8
|
+
prefix '/api/quiz/v1/courses/:course/' do
|
|
9
|
+
get :list_new_quizzes, 'quizzes'
|
|
10
|
+
post :create_new_quiz, 'quizzes'
|
|
11
|
+
|
|
12
|
+
prefix 'quizzes/:quiz/' do
|
|
13
|
+
get :new_quiz
|
|
14
|
+
patch :update_new_quiz
|
|
15
|
+
delete :delete_new_quiz
|
|
16
|
+
|
|
17
|
+
get :list_new_quiz_items, 'items'
|
|
18
|
+
post :create_new_quiz_item, 'items'
|
|
19
|
+
|
|
20
|
+
prefix 'items/:item/' do
|
|
21
|
+
get :new_quiz_item
|
|
22
|
+
patch :update_new_quiz_item
|
|
23
|
+
delete :delete_new_quiz_item
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
get :list_new_quiz_submissions, 'submissions'
|
|
27
|
+
post :create_new_quiz_submission, 'submissions'
|
|
28
|
+
|
|
29
|
+
prefix 'submissions/:submission/' do
|
|
30
|
+
get :new_quiz_submission
|
|
31
|
+
patch :update_new_quiz_submission
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
get :list_new_quiz_reports, 'reports'
|
|
35
|
+
post :create_new_quiz_report, 'reports'
|
|
36
|
+
|
|
37
|
+
prefix 'reports/:report/' do
|
|
38
|
+
get :new_quiz_report
|
|
39
|
+
delete :delete_new_quiz_report
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/bearcat/client/pages.rb
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/bearcat/client/roles.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/bearcat/client/tabs.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/bearcat/version.rb
CHANGED
data/lib/catalogcat/api_array.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/catalogcat/client.rb
CHANGED
|
File without changes
|
data/lib/catalogcat/version.rb
CHANGED
|
File without changes
|
data/lib/catalogcat.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -91,4 +91,33 @@ describe Bearcat::Client::Accounts do
|
|
|
91
91
|
expect(sis_imports.first['workflow_state']).to eq 'imported'
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
+
it 'creates a sub-account' do
|
|
95
|
+
stub_post(@client, "/api/v1/accounts/1/sub_accounts").to_return(json_response("created_sub_account.json"))
|
|
96
|
+
sub_account = @client.create_sub_account(1, { account: { name: 'New Sub-Account' } })
|
|
97
|
+
expect(sub_account['id']).to eq 3
|
|
98
|
+
expect(sub_account['name']).to eq 'New Sub-Account'
|
|
99
|
+
expect(sub_account['parent_account_id']).to eq 1
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
it 'returns a single sub-account' do
|
|
103
|
+
stub_get(@client, "/api/v1/accounts/2").to_return(json_response("sub_account.json"))
|
|
104
|
+
sub_account = @client.sub_account(2)
|
|
105
|
+
expect(sub_account['id']).to eq 2
|
|
106
|
+
expect(sub_account['name']).to eq 'Manually-Created Courses'
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
it 'updates a sub-account' do
|
|
110
|
+
stub_put(@client, "/api/v1/accounts/2").to_return(json_response("updated_sub_account.json"))
|
|
111
|
+
sub_account = @client.update_sub_account(2, { account: { name: 'Renamed Sub-Account' } })
|
|
112
|
+
expect(sub_account['id']).to eq 2
|
|
113
|
+
expect(sub_account['name']).to eq 'Renamed Sub-Account'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
it 'deletes a sub-account' do
|
|
117
|
+
stub_delete(@client, "/api/v1/accounts/1/sub_accounts/2").to_return(json_response("deleted_sub_account.json"))
|
|
118
|
+
sub_account = @client.delete_sub_account(1, 2)
|
|
119
|
+
expect(sub_account['id']).to eq 2
|
|
120
|
+
expect(sub_account['workflow_state']).to eq 'deleted'
|
|
121
|
+
end
|
|
122
|
+
|
|
94
123
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
require 'helper'
|
|
2
|
+
|
|
3
|
+
describe Bearcat::Client::NewQuizzes do
|
|
4
|
+
before do
|
|
5
|
+
@client = Bearcat::Client.new(prefix: 'http://canvas.instructure.com', token: 'test_token')
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
# Quizzes
|
|
9
|
+
it 'returns a list of new quizzes for a course' do
|
|
10
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes').to_return(json_response('new_quizzes/course_new_quizzes.json'))
|
|
11
|
+
quizzes = @client.list_new_quizzes('1')
|
|
12
|
+
quizzes.class.should eq(Bearcat::ApiArray)
|
|
13
|
+
quizzes.count.should == 2
|
|
14
|
+
quizzes.first['id'].should == '1'
|
|
15
|
+
quizzes.last['id'].should == '2'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it 'returns a single new quiz' do
|
|
19
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1').to_return(json_response('new_quizzes/course_new_quiz.json'))
|
|
20
|
+
quiz = @client.new_quiz('1', '1')
|
|
21
|
+
quiz.should be_a Hash
|
|
22
|
+
quiz['id'].should == '1'
|
|
23
|
+
quiz[:id].should == '1'
|
|
24
|
+
quiz['grading_type'].should == 'points'
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it 'creates a new quiz' do
|
|
28
|
+
stub_post(@client, '/api/quiz/v1/courses/1/quizzes').to_return(json_response('new_quizzes/course_new_quiz.json'))
|
|
29
|
+
quiz = @client.create_new_quiz('1', { quiz: { title: 'Bearcat Test Quiz' } })
|
|
30
|
+
quiz.should be_a Hash
|
|
31
|
+
quiz['id'].should == '1'
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'updates a new quiz' do
|
|
35
|
+
stub_patch(@client, '/api/quiz/v1/courses/1/quizzes/1').to_return(json_response('new_quizzes/course_new_quiz.json'))
|
|
36
|
+
quiz = @client.update_new_quiz('1', '1', { quiz: { title: 'Updated Title' } })
|
|
37
|
+
quiz.should be_a Hash
|
|
38
|
+
quiz['id'].should == '1'
|
|
39
|
+
quiz[:id].should == '1'
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
it 'deletes a new quiz' do
|
|
43
|
+
stub_delete(@client, '/api/quiz/v1/courses/1/quizzes/1').to_return({})
|
|
44
|
+
expect { @client.delete_new_quiz('1', '1') }.not_to raise_error
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Items
|
|
48
|
+
it 'returns a list of items for a new quiz' do
|
|
49
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items').to_return(json_response('new_quizzes/new_quiz_items.json'))
|
|
50
|
+
items = @client.list_new_quiz_items('1', '1')
|
|
51
|
+
items.class.should eq(Bearcat::ApiArray)
|
|
52
|
+
items.count.should == 2
|
|
53
|
+
items.first['id'].should == '1'
|
|
54
|
+
items.first['entry_type'].should == 'Item'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
it 'returns a single new quiz item' do
|
|
58
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/items/1').to_return(json_response('new_quizzes/new_quiz_item.json'))
|
|
59
|
+
item = @client.new_quiz_item('1', '1', '1')
|
|
60
|
+
item.should be_a Hash
|
|
61
|
+
item['id'].should == '1'
|
|
62
|
+
item[:id].should == '1'
|
|
63
|
+
item['entry']['interaction_type_slug'].should == 'choice'
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it 'creates a new quiz item' do
|
|
67
|
+
stub_post(@client, '/api/quiz/v1/courses/1/quizzes/1/items').to_return(json_response('new_quizzes/new_quiz_item.json'))
|
|
68
|
+
item = @client.create_new_quiz_item('1', '1', { item: { entry_type: 'Item', points_possible: 5, entry: { title: 'New Question' } } })
|
|
69
|
+
item.should be_a Hash
|
|
70
|
+
item['id'].should == '1'
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
it 'updates a new quiz item' do
|
|
74
|
+
stub_patch(@client, '/api/quiz/v1/courses/1/quizzes/1/items/1').to_return(json_response('new_quizzes/new_quiz_item.json'))
|
|
75
|
+
item = @client.update_new_quiz_item('1', '1', '1', { item: { points_possible: 10.0 } })
|
|
76
|
+
item.should be_a Hash
|
|
77
|
+
item['id'].should == '1'
|
|
78
|
+
item[:id].should == '1'
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
it 'deletes a new quiz item' do
|
|
82
|
+
stub_delete(@client, '/api/quiz/v1/courses/1/quizzes/1/items/1').to_return({})
|
|
83
|
+
expect { @client.delete_new_quiz_item('1', '1', '1') }.not_to raise_error
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Submissions
|
|
87
|
+
it 'returns a list of submissions for a new quiz' do
|
|
88
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/submissions').to_return(json_response('new_quizzes/new_quiz_submissions.json'))
|
|
89
|
+
submissions = @client.list_new_quiz_submissions('1', '1')
|
|
90
|
+
submissions.class.should eq(Bearcat::ApiArray)
|
|
91
|
+
submissions.count.should == 2
|
|
92
|
+
submissions.first['workflow_state'].should == 'complete'
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
it 'returns a single new quiz submission' do
|
|
96
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/submissions/1').to_return(json_response('new_quizzes/new_quiz_submission.json'))
|
|
97
|
+
submission = @client.new_quiz_submission('1', '1', '1')
|
|
98
|
+
submission.should be_a Hash
|
|
99
|
+
submission['workflow_state'].should == 'complete'
|
|
100
|
+
submission[:workflow_state].should == 'complete'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
it 'creates a new quiz submission' do
|
|
104
|
+
stub_post(@client, '/api/quiz/v1/courses/1/quizzes/1/submissions').to_return(json_response('new_quizzes/new_quiz_submission.json'))
|
|
105
|
+
submission = @client.create_new_quiz_submission('1', '1')
|
|
106
|
+
submission.should be_a Hash
|
|
107
|
+
submission['id'].should == '1'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
it 'updates a new quiz submission' do
|
|
111
|
+
stub_patch(@client, '/api/quiz/v1/courses/1/quizzes/1/submissions/1').to_return(json_response('new_quizzes/new_quiz_submission.json'))
|
|
112
|
+
submission = @client.update_new_quiz_submission('1', '1', '1', { workflow_state: 'complete' })
|
|
113
|
+
submission.should be_a Hash
|
|
114
|
+
submission['id'].should == '1'
|
|
115
|
+
submission[:id].should == '1'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Reports
|
|
119
|
+
it 'returns a list of reports for a new quiz' do
|
|
120
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/reports').to_return(json_response('new_quizzes/new_quiz_reports.json'))
|
|
121
|
+
reports = @client.list_new_quiz_reports('1', '1')
|
|
122
|
+
reports.class.should eq(Bearcat::ApiArray)
|
|
123
|
+
reports.count.should == 2
|
|
124
|
+
reports.first['workflow_state'].should == 'complete'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
it 'returns a single new quiz report' do
|
|
128
|
+
stub_get(@client, '/api/quiz/v1/courses/1/quizzes/1/reports/1').to_return(json_response('new_quizzes/new_quiz_report.json'))
|
|
129
|
+
report = @client.new_quiz_report('1', '1', '1')
|
|
130
|
+
report.should be_a Hash
|
|
131
|
+
report['workflow_state'].should == 'complete'
|
|
132
|
+
report[:workflow_state].should == 'complete'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
it 'creates a new quiz report' do
|
|
136
|
+
stub_post(@client, '/api/quiz/v1/courses/1/quizzes/1/reports').to_return(json_response('new_quizzes/new_quiz_report.json'))
|
|
137
|
+
report = @client.create_new_quiz_report('1', '1', { report: { report_type: 'student_analysis' } })
|
|
138
|
+
report.should be_a Hash
|
|
139
|
+
report['id'].should == '1'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
it 'deletes a new quiz report' do
|
|
143
|
+
stub_delete(@client, '/api/quiz/v1/courses/1/quizzes/1/reports/1').to_return({})
|
|
144
|
+
expect { @client.delete_new_quiz_report('1', '1', '1') }.not_to raise_error
|
|
145
|
+
end
|
|
146
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -14,4 +14,18 @@ describe Bearcat::Client::Pages do
|
|
|
14
14
|
pages.last['page_id'].should == 2
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
it "updates a course page" do
|
|
18
|
+
stub_put(@client, "/api/v1/courses/1/pages/instruction-test").to_return(json_response("updated_page.json"))
|
|
19
|
+
page = @client.update_course_page('1', 'instruction-test', { wiki_page: { title: 'Updated Page Title' } })
|
|
20
|
+
expect(page['page_id']).to eq 1
|
|
21
|
+
expect(page['title']).to eq 'Updated Page Title'
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it "deletes a course page" do
|
|
25
|
+
stub_delete(@client, "/api/v1/courses/1/pages/instruction-test").to_return(json_response("deleted_page.json"))
|
|
26
|
+
page = @client.delete_course_page('1', 'instruction-test')
|
|
27
|
+
expect(page['page_id']).to eq 1
|
|
28
|
+
expect(page['published']).to eq false
|
|
29
|
+
end
|
|
30
|
+
|
|
17
31
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/spec/bearcat_spec.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/spec/fixtures/accounts.json
CHANGED
|
File without changes
|
|
File without changes
|
data/spec/fixtures/add_user.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/spec/fixtures/bearcat.jpg
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|