bridge_api 0.1.50 → 0.1.51

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: 7054ef4b473c3ef2e8a247b2ab12da384d7b0d2d
4
- data.tar.gz: 9116565ebb368b7d8c23ec94f97d998b168a0671
3
+ metadata.gz: edfd2ef286a367305a4a71e9eaca111f54a2f80e
4
+ data.tar.gz: da9aba6492ca94c942ac234f6afadedf6750592a
5
5
  SHA512:
6
- metadata.gz: c603510bc5433003404ab86b855263fe49c286cb0bb55cc51bb887eb927b8a314171543059c806f9441903e33db27b0036c2843aa4017f75813df6bf46b0cf58
7
- data.tar.gz: 6d9966152c4059e0ffcaf5dac06d47928a5a374d4ae85364d7a671c56c6625cee5f819b4c6e12e330912e10e31f5fc8cfdd2bb384c5418dc4152577d9ed9041b
6
+ metadata.gz: 0560c5538f77c03ebca486a945a578a8bf435ed42932ab0096c3fd4c282785a5a80e60242c7e4d703f7d72a6092e77f136ee581476a2f7cd14b42afc078a92ea
7
+ data.tar.gz: 84601b01a21b1a1ad8d036fbcc4591a473323ba93867f5f6002c5d3f6984dab7610b3d4c437fccd84d635b9afa750df8397ae080cd7386870e50848aa4f6138c
@@ -25,6 +25,8 @@ module BridgeAPI
25
25
  ADMIN_PATH = '/admin'.freeze
26
26
  AUTHOR_PATH = '/author'.freeze
27
27
  LEARNER_PATH = '/learner'.freeze
28
+ LEARNERS_PATH = '/learners'.freeze
29
+ LEARNER_ITEMS_PATH = '/learner_items'.freeze
28
30
  CUSTOM_FIELD_PATH = '/custom_fields'.freeze
29
31
  SUB_ACCOUNT_PATH = '/sub_accounts'.freeze
30
32
  SUPPORT_PATH = '/support'.freeze
@@ -0,0 +1,9 @@
1
+ module BridgeAPI
2
+ class Client
3
+ module LearnerItem
4
+ def get_learner_items(learner_id, params = {})
5
+ get("#{API_PATH}#{AUTHOR_PATH}#{LEARNERS_PATH}/#{learner_id}#{LEARNER_ITEMS_PATH}", params)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module BridgeAPI
2
- VERSION = '0.1.50'.freeze unless defined?(BridgeAPI::VERSION)
2
+ VERSION = '0.1.51'.freeze unless defined?(BridgeAPI::VERSION)
3
3
  end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ describe BridgeAPI::Client::LearnerItem do
4
+ before do
5
+ @client = BridgeAPI::Client.new(prefix: 'http://test.bridge.com', token: 'test_token')
6
+ end
7
+
8
+ it 'should get a list of learner items' do
9
+ response = @client.get_learner_items(1)
10
+ expect(response.status).to eq(200)
11
+ expect(response.body['learning_items'].count).to eq(2)
12
+ end
13
+ end
@@ -0,0 +1,97 @@
1
+ {
2
+ "linked": {},
3
+ "learning_items": [
4
+ {
5
+ "id": "63",
6
+ "enrollable_id": "12",
7
+ "enrollable_type": "LiveCourseEnrollment",
8
+ "learnable_id": "16",
9
+ "learnable_type": "LiveCourse",
10
+ "title": "Defensive Driving 101",
11
+ "description": null,
12
+ "state": "created",
13
+ "completed_at": null,
14
+ "created_at": "2018-12-13T11:30:25.463-07:00",
15
+ "archived_at": null,
16
+ "permanently_failed": false,
17
+ "data": {
18
+ "expires_at": null,
19
+ "required": true,
20
+ "renew_by": null,
21
+ "inactive": null,
22
+ "has_certificate": false,
23
+ "attachments_count": 0,
24
+ "attachments_count_author": 0,
25
+ "is_registered": false,
26
+ "is_multi_part": null,
27
+ "registered_session_parts": [],
28
+ "registered_session_timezone": null,
29
+ "registered_session_start_at": null,
30
+ "registered_session_end_at": null,
31
+ "registered_session_location": null,
32
+ "registered_session_published": null,
33
+ "sessions": [
34
+ {
35
+ "start_at": "2019-12-14T16:00:00.031Z",
36
+ "end_at": "2019-12-14T17:00:00.031Z",
37
+ "location": null,
38
+ "seats": null,
39
+ "timezone": "America/Denver",
40
+ "registered_count": 0
41
+ }
42
+ ],
43
+ "direct_enrollment": true,
44
+ "program": null,
45
+ "programs": [],
46
+ "in_completed_program": false,
47
+ "features": []
48
+ },
49
+ "tags": []
50
+ },
51
+ {
52
+ "id": "69",
53
+ "enrollable_id": "49",
54
+ "enrollable_type": "Enrollment",
55
+ "learnable_id": "692",
56
+ "learnable_type": "CourseTemplate",
57
+ "title": "Sample Course",
58
+ "description": null,
59
+ "state": "created",
60
+ "completed_at": null,
61
+ "created_at": "2018-12-13T15:14:40.032-07:00",
62
+ "archived_at": null,
63
+ "permanently_failed": false,
64
+ "data": {
65
+ "end_at": "2018-12-20T23:59:59.999-07:00",
66
+ "expires_at": null,
67
+ "renew_by": null,
68
+ "required": true,
69
+ "score": 0,
70
+ "time_remaining": 0,
71
+ "current_position": 0,
72
+ "furthest_progress": 0,
73
+ "quiz_positions": [],
74
+ "direct_enrollment": true,
75
+ "max_quiz_attempts": null,
76
+ "attempts_count": 0,
77
+ "inactive": null,
78
+ "program": null,
79
+ "programs": [],
80
+ "in_completed_program": false,
81
+ "external_id": null,
82
+ "estimated_time": 0,
83
+ "passing_threshold": 80,
84
+ "has_certificate": null,
85
+ "course_type": "bridge",
86
+ "slide_count": 1,
87
+ "attachments_count": 0,
88
+ "attachments_count_author": 0,
89
+ "third_party_course_id": null,
90
+ "open_book": null,
91
+ "continuing_education_credits": null,
92
+ "features": []
93
+ },
94
+ "tags": []
95
+ }
96
+ ]
97
+ }
@@ -162,6 +162,11 @@ class FakeBridge < Sinatra::Base
162
162
  get_json_data 200, 'group.json'
163
163
  end
164
164
 
165
+ # Learner Items
166
+ get %r{/api/author/learners/\d+/learner_items$} do
167
+ get_json_data 200, 'learner_items.json'
168
+ end
169
+
165
170
  # Live Courses
166
171
  get %r{/api/author/live_courses$} do
167
172
  get_json_data 200, 'live_courses.json'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridge_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.50
4
+ version: 0.1.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-05 00:00:00.000000000 Z
11
+ date: 2018-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -230,6 +230,7 @@ files:
230
230
  - lib/bridge_api/client/data_dump.rb
231
231
  - lib/bridge_api/client/enrollment.rb
232
232
  - lib/bridge_api/client/group.rb
233
+ - lib/bridge_api/client/learner_item.rb
233
234
  - lib/bridge_api/client/live_course.rb
234
235
  - lib/bridge_api/client/live_course_enrollment.rb
235
236
  - lib/bridge_api/client/live_course_session.rb
@@ -248,6 +249,7 @@ files:
248
249
  - spec/bridge_api/client/data_dump_spec.rb
249
250
  - spec/bridge_api/client/enrollment_spec.rb
250
251
  - spec/bridge_api/client/group_spec.rb
252
+ - spec/bridge_api/client/learner_items_spec.rb
251
253
  - spec/bridge_api/client/live_course_enrollments_spec.rb
252
254
  - spec/bridge_api/client/live_course_session_spec.rb
253
255
  - spec/bridge_api/client/live_course_spec.rb
@@ -270,6 +272,7 @@ files:
270
272
  - spec/fixtures/enrollment.json
271
273
  - spec/fixtures/enrollments.json
272
274
  - spec/fixtures/group.json
275
+ - spec/fixtures/learner_items.json
273
276
  - spec/fixtures/live_course.json
274
277
  - spec/fixtures/live_course_enrollments.json
275
278
  - spec/fixtures/live_course_sessions.json
@@ -329,6 +332,7 @@ test_files:
329
332
  - spec/bridge_api/client/role_spec.rb
330
333
  - spec/bridge_api/client/manager_spec.rb
331
334
  - spec/bridge_api/client/live_course_enrollments_spec.rb
335
+ - spec/bridge_api/client/learner_items_spec.rb
332
336
  - spec/support/fake_bridge.rb
333
337
  - spec/fixtures/roles.json
334
338
  - spec/fixtures/live_course.json
@@ -348,6 +352,7 @@ test_files:
348
352
  - spec/fixtures/sub_account_lti_config_update.json
349
353
  - spec/fixtures/default_web_conference.json
350
354
  - spec/fixtures/programs.json
355
+ - spec/fixtures/learner_items.json
351
356
  - spec/fixtures/sub_account_new_lti_config.json
352
357
  - spec/fixtures/enrollments.json
353
358
  - spec/fixtures/group.json