bearcat 1.2.13 → 1.2.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cecd449bbde0aee78b3aff9f809a73789598d2c1
4
- data.tar.gz: 8dbc536c5a732deccbe9f5b3b355e97f92da9f50
3
+ metadata.gz: c22f978d3c9f3f779452fa52734b972d90fc624a
4
+ data.tar.gz: 70792969c2e7da477446ce6c769b0a8f9330e03a
5
5
  SHA512:
6
- metadata.gz: 11317f4044fb795976c56190eb74af1b5d28a675745822b5f7bbac2ef9256798df395b421a1c2bae3d30a20a6a97a35c7c49c7b1db1c118c0ff7ea054ff5e1f0
7
- data.tar.gz: 636050ce0b7518f855d79b87c3b2ad1919947763c751d8e0e576c07a6f01ea54b823f2cb7d752a12b85a7ab10cea88def23723e5775884900c9a7ed3c05af304
6
+ metadata.gz: 7b47e7b61259c19521dbb74c220bea5c825600754325ceaf5ecfa6bb7776dae22e3c974b5230210aa3c8a7680f51268de166f4c2c9893ed099d588f131e624a8
7
+ data.tar.gz: ec0d6d28382f111ca084362029c40f2a71aaca6d4662546663659b6af2c0d944c9f4ffb3d14e6a5c8ff24b20bf6fa30993a4736d434dd4eeb14e5cfca084298d
@@ -10,6 +10,22 @@ module Bearcat
10
10
  post("/api/v1/courses/#{course_id}/discussion_topics", params)
11
11
  end
12
12
 
13
+ def group_discussions(group_id, params = {})
14
+ get("/api/v1/groups/#{group_id}/discussion_topics", params)
15
+ end
16
+
17
+ def course_discussions(course_id, params= {})
18
+ get("/api/v1/courses/#{course_id}/discussion_topics", params)
19
+ end
20
+
21
+ def group_discussion_entries(group_id, discussion_id, params = {})
22
+ get("/api/v1/groups/#{group_id}/discussion_topics/#{discussion_id}/entries", params)
23
+ end
24
+
25
+ def course_discussion_entries(course_id, discussion_id, params= {})
26
+ get("/api/v1/courses/#{course_id}/discussion_topics/#{discussion_id}/entries", params)
27
+ end
28
+
13
29
  end
14
30
  end
15
31
  end
@@ -18,6 +18,10 @@ module Bearcat
18
18
  get("/api/v1/courses/#{course}/quizzes/assignment_overrides", params)
19
19
  end
20
20
 
21
+ def quiz_questions(course, quiz, params={})
22
+ get("/api/v1/courses/#{course}/quizzes/#{quiz}/questions", params)
23
+ end
24
+
21
25
  def create_quiz(course, params={})
22
26
  post("/api/v1/courses/#{course}/quizzes", params)
23
27
  end
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.2.13' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.2.14' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -19,4 +19,41 @@ describe Bearcat::Client::Discussions do
19
19
  discussion['title'].should == 'This is a course discussion'
20
20
  end
21
21
 
22
+
23
+ it 'returns course discussion topics' do
24
+ stub_get(@client, "/api/v1/courses/1/discussion_topics").to_return(json_response("discussion_topics.json"))
25
+ discussions = @client.course_discussions('1')
26
+ discussions.class.should eq(Bearcat::ApiArray)
27
+ discussions.count.should == 1
28
+ discussions[0].class.should eq(Hash)
29
+ discussions[0]['id'].should == 1
30
+ end
31
+
32
+ it 'returns group discussion topics' do
33
+ stub_get(@client, "/api/v1/groups/1/discussion_topics").to_return(json_response("discussion_topics.json"))
34
+ discussions = @client.group_discussions('1')
35
+ discussions.class.should eq(Bearcat::ApiArray)
36
+ discussions.count.should == 1
37
+ discussions[0].class.should eq(Hash)
38
+ discussions[0]['id'].should == 1
39
+ end
40
+
41
+ it 'returns course discussion entries' do
42
+ stub_get(@client, "/api/v1/courses/1/discussion_topics/1/entries").to_return(json_response("discussion_entries.json"))
43
+ discussions = @client.course_discussion_entries('1', '1')
44
+ discussions.class.should eq(Bearcat::ApiArray)
45
+ discussions.count.should == 1
46
+ discussions[0].class.should eq(Hash)
47
+ discussions[0]['id'].should == 1
48
+ end
49
+
50
+ it 'returns group discussion entries' do
51
+ stub_get(@client, "/api/v1/groups/1/discussion_topics/1/entries").to_return(json_response("discussion_entries.json"))
52
+ discussions = @client.group_discussion_entries('1', '1')
53
+ discussions.class.should eq(Bearcat::ApiArray)
54
+ discussions.count.should == 1
55
+ discussions[0].class.should eq(Hash)
56
+ discussions[0]['id'].should == 1
57
+ end
58
+
22
59
  end
@@ -44,4 +44,13 @@ describe Bearcat::Client::Quizzes do
44
44
  quiz["id"].should == 38
45
45
  end
46
46
 
47
+ it 'returns quiz questions' do
48
+ stub_get(@client, "/api/v1/courses/1/quizzes/1/questions").to_return(json_response("quizzes/course_quiz_questions.json"))
49
+ course_quiz_questions = @client.quiz_questions('1', '1')
50
+ course_quiz_questions.class.should eq(Bearcat::ApiArray)
51
+ course_quiz_questions.count.should == 1
52
+ course_quiz_questions[0].class.should eq(Hash)
53
+ course_quiz_questions[0]['id'].should == 1
54
+ end
55
+
47
56
  end
@@ -0,0 +1,21 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "user_id": 170000004597713,
5
+ "parent_id": null,
6
+ "created_at": "2016-08-22T18:41:53Z",
7
+ "updated_at": "2016-08-22T18:41:53Z",
8
+ "rating_count": null,
9
+ "rating_sum": null,
10
+ "user_name": "Mark Valentine",
11
+ "message": "<p><a id=\"\" class=\"\" title=\"\" href=\"http://ola.aacc.edu/policies/IntegrityPolicy.pdf\" target=\"\">what about this policy?</a></p>",
12
+ "user": {
13
+ "id": 170000004597713,
14
+ "display_name": "Mark Valentine",
15
+ "avatar_image_url": "https://secure.gravatar.com/avatar/ef7cb412b0b68576d39a7014919e6e92?s=50&d=https%3A%2F%2Fmvalentine.instructure.com%2Fimages%2Fmessages%2Favatar-50.png",
16
+ "html_url": "https://mvalentine.instructure.com/courses/1/users/17~4597713"
17
+ },
18
+ "read_state": "read",
19
+ "forced_read_state": false
20
+ }
21
+ ]
@@ -0,0 +1,51 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "title": "Lets talk about the integrity policy",
5
+ "last_reply_at": "2016-08-22T18:41:53Z",
6
+ "delayed_post_at": null,
7
+ "posted_at": "2016-08-22T18:26:42Z",
8
+ "assignment_id": null,
9
+ "root_topic_id": null,
10
+ "position": null,
11
+ "podcast_has_student_posts": false,
12
+ "discussion_type": "side_comment",
13
+ "lock_at": null,
14
+ "allow_rating": false,
15
+ "only_graders_can_rate": false,
16
+ "sort_by_rating": false,
17
+ "user_name": "Mark Valentine",
18
+ "discussion_subentry_count": 1,
19
+ "permissions": {
20
+ "attach": true,
21
+ "update": true,
22
+ "reply": true,
23
+ "delete": true
24
+ },
25
+ "require_initial_post": null,
26
+ "user_can_see_posts": true,
27
+ "podcast_url": null,
28
+ "read_state": "read",
29
+ "unread_count": 0,
30
+ "subscribed": true,
31
+ "topic_children": [],
32
+ "attachments": [],
33
+ "published": true,
34
+ "can_unpublish": true,
35
+ "locked": false,
36
+ "can_lock": true,
37
+ "author": {
38
+ "id": 170000004597713,
39
+ "display_name": "Mark Valentine",
40
+ "avatar_image_url": "https://secure.gravatar.com/avatar/ef7cb412b0b68576d39a7014919e6e92?s=50&d=https%3A%2F%2Fmvalentine.instructure.com%2Fimages%2Fmessages%2Favatar-50.png",
41
+ "html_url": "https://mvalentine.instructure.com/courses/1/users/17~4597713"
42
+ },
43
+ "html_url": "https://mvalentine.instructure.com/courses/1/discussion_topics/1",
44
+ "url": "https://mvalentine.instructure.com/courses/1/discussion_topics/1",
45
+ "pinned": false,
46
+ "group_category_id": null,
47
+ "can_group": true,
48
+ "locked_for_user": false,
49
+ "message": "<p>I have this policy.</p>\r\n<p><a class=\"\" title=\"http://ola.aacc.edu/policies/IntegrityPolicy.pdf\" href=\"https://mvalentine.instructure.com/courses/1/files/3/download?verifier=gAUYA5q4jdW9k7R3A4Tw2TQ0KKmP5g4ubOelhFOU&amp;wrap=1\" target=\"\" data-api-endpoint=\"https://mvalentine.instructure.com/api/v1/courses/1/files/3\" data-api-returntype=\"File\">http://ola.aacc.edu/policies/IntegrityPolicy.pdf</a></p>\r\n<p> </p>"
50
+ }
51
+ ]
@@ -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
+ ]
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.2.13
4
+ version: 1.2.14
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-08-18 00:00:00.000000000 Z
11
+ date: 2016-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -225,6 +225,8 @@ files:
225
225
  - spec/fixtures/deleted_conversation.json
226
226
  - spec/fixtures/department_level_participation.json
227
227
  - spec/fixtures/department_level_statistics.json
228
+ - spec/fixtures/discussion_entries.json
229
+ - spec/fixtures/discussion_topics.json
228
230
  - spec/fixtures/edited_group.json
229
231
  - spec/fixtures/enroll_student.json
230
232
  - spec/fixtures/enrollment_terms.json
@@ -249,6 +251,7 @@ files:
249
251
  - spec/fixtures/paged_body.json
250
252
  - spec/fixtures/pages.json
251
253
  - spec/fixtures/quizzes/course_quiz.json
254
+ - spec/fixtures/quizzes/course_quiz_questions.json
252
255
  - spec/fixtures/quizzes/course_quizzes.json
253
256
  - spec/fixtures/quizzes/quiz_assignment_override.json
254
257
  - spec/fixtures/quizzes/quiz_extension.json
@@ -290,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
290
293
  version: '0'
291
294
  requirements: []
292
295
  rubyforge_project:
293
- rubygems_version: 2.4.5
296
+ rubygems_version: 2.4.5.1
294
297
  signing_key:
295
298
  specification_version: 4
296
299
  summary: Canvas API
@@ -382,6 +385,8 @@ test_files:
382
385
  - spec/fixtures/deleted_conversation.json
383
386
  - spec/fixtures/department_level_participation.json
384
387
  - spec/fixtures/department_level_statistics.json
388
+ - spec/fixtures/discussion_entries.json
389
+ - spec/fixtures/discussion_topics.json
385
390
  - spec/fixtures/edited_group.json
386
391
  - spec/fixtures/enroll_student.json
387
392
  - spec/fixtures/enrollment_terms.json
@@ -406,6 +411,7 @@ test_files:
406
411
  - spec/fixtures/paged_body.json
407
412
  - spec/fixtures/pages.json
408
413
  - spec/fixtures/quizzes/course_quiz.json
414
+ - spec/fixtures/quizzes/course_quiz_questions.json
409
415
  - spec/fixtures/quizzes/course_quizzes.json
410
416
  - spec/fixtures/quizzes/quiz_assignment_override.json
411
417
  - spec/fixtures/quizzes/quiz_extension.json
@@ -428,3 +434,4 @@ test_files:
428
434
  - spec/fixtures/user_page_views.json
429
435
  - spec/fixtures/user_profile.json
430
436
  - spec/helper.rb
437
+ has_rdoc: