qalam_oauth_engine 3.0.7 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canvas_oauth/canvas_api.rb +23 -5
- data/lib/canvas_oauth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a94aa9f960fad372ccd1ce843c502f7f1f8011f010e29dd095224a0d9a5c701f
|
4
|
+
data.tar.gz: a1f11ff92ae13c52c42271180623616cbf47cd42780e34e3f029a30c6143fe44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8540835b1a123aae6f271195d80443a7627649dc2156c1ec2a6f0e6be6295d99f0669815b5e11250b7b0c7f70c7811d901158107ed1e2424934a0de3ba2c3d7b
|
7
|
+
data.tar.gz: f01b816cc088416ffa80ddfd5908ae40bded8ac8e11f8c784ead5317fd82a3d4039b424aa29cfff82aad4756c5776bbcdc291ec8116ebec48776dd2cb0a3b5a1
|
@@ -4,7 +4,7 @@ module CanvasOauth
|
|
4
4
|
PER_PAGE = 50
|
5
5
|
|
6
6
|
attr_accessor :token, :refresh_token, :key, :secret
|
7
|
-
attr_reader :canvas_url, :canvas_user_id
|
7
|
+
attr_reader :canvas_url, :canvas_user_id, :canvas_root_account_id
|
8
8
|
|
9
9
|
def initialize(canvas_url, canvas_user_id, canvas_root_account_id, token, refresh_token, key, secret)
|
10
10
|
unless [key, secret].all?(&:present?)
|
@@ -110,7 +110,10 @@ module CanvasOauth
|
|
110
110
|
params[:query][:page] ||= 1
|
111
111
|
all_pages = []
|
112
112
|
|
113
|
-
if params[:
|
113
|
+
if params[:current_page]
|
114
|
+
current_page = authenticated_get(url, params)
|
115
|
+
all_pages.concat(current_page) if valid_page?(current_page)
|
116
|
+
else
|
114
117
|
while url && current_page = authenticated_get(url, params) do
|
115
118
|
all_pages.concat(current_page) if valid_page?(current_page)
|
116
119
|
|
@@ -118,9 +121,6 @@ module CanvasOauth
|
|
118
121
|
url = links.find_link(["rel", "next"]).try(:href)
|
119
122
|
params[:query] = nil if params[:query]
|
120
123
|
end
|
121
|
-
else
|
122
|
-
current_page = authenticated_get(url, params)
|
123
|
-
all_pages.concat(current_page) if valid_page?(current_page)
|
124
124
|
end
|
125
125
|
|
126
126
|
all_pages
|
@@ -337,8 +337,11 @@ module CanvasOauth
|
|
337
337
|
# update_external_tool_nav
|
338
338
|
# get_school_details
|
339
339
|
# get_school_grades
|
340
|
+
# get_school_grade
|
340
341
|
# get_school_class_rooms
|
342
|
+
# get_school_class_room
|
341
343
|
# get_school_subjects
|
344
|
+
# get_school_subject
|
342
345
|
# get_students_by_grade
|
343
346
|
# get_students_by_class_room
|
344
347
|
|
@@ -376,16 +379,31 @@ module CanvasOauth
|
|
376
379
|
paginated_get "/api/v1/accounts/#{account_id}/school_grades", params
|
377
380
|
end
|
378
381
|
|
382
|
+
def get_school_grade(grade_id, account_id=@canvas_root_account_id, params={})
|
383
|
+
account_id ||= @canvas_root_account_id
|
384
|
+
authenticated_get "/api/v1/accounts/#{account_id}/school_grades/#{grade_id}", params
|
385
|
+
end
|
386
|
+
|
379
387
|
def get_school_subjects(account_id=@canvas_root_account_id, params={})
|
380
388
|
account_id ||= @canvas_root_account_id
|
381
389
|
paginated_get "/api/v1/accounts/#{account_id}/school_subjects", params
|
382
390
|
end
|
383
391
|
|
392
|
+
def get_school_subject(subject_id, account_id=@canvas_root_account_id, params={})
|
393
|
+
account_id ||= @canvas_root_account_id
|
394
|
+
authenticated_get "/api/v1/accounts/#{account_id}/school_subjects/#{subject_id}", params
|
395
|
+
end
|
396
|
+
|
384
397
|
def get_school_class_rooms(account_id=@canvas_root_account_id, params={})
|
385
398
|
account_id ||= @canvas_root_account_id
|
386
399
|
paginated_get "/api/v1/accounts/#{account_id}/school_class_rooms", params
|
387
400
|
end
|
388
401
|
|
402
|
+
def get_school_class_room(class_room_id, account_id=@canvas_root_account_id, params={})
|
403
|
+
account_id ||= @canvas_root_account_id
|
404
|
+
authenticated_get "/api/v1/accounts/#{account_id}/school_class_rooms/#{class_room_id}", params
|
405
|
+
end
|
406
|
+
|
389
407
|
def get_students_by_grade(grade_id, account_id=@canvas_root_account_id, params={})
|
390
408
|
account_id ||= @canvas_root_account_id
|
391
409
|
paginated_get "/api/v1/accounts/#{account_id}/grade_students/#{grade_id}", params
|
data/lib/canvas_oauth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qalam_oauth_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Donahue
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-08-
|
14
|
+
date: 2021-08-29 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: httparty
|