d2l_sdk 0.1.13 → 0.1.15
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 +5 -5
- data/.vscode/settings.json +1 -2
- data/example_scripts/adjusted_courses.txt +44446 -0
- data/lib/d2l_sdk/calendar.rb +44 -32
- data/lib/d2l_sdk/config_variables.rb +9 -5
- data/lib/d2l_sdk/course_content.rb +54 -34
- data/lib/d2l_sdk/demographics.rb +21 -18
- data/lib/d2l_sdk/discussions.rb +7 -5
- data/lib/d2l_sdk/enroll.rb +20 -14
- data/lib/d2l_sdk/grades.rb +21 -18
- data/lib/d2l_sdk/logging.rb +25 -21
- data/lib/d2l_sdk/org_unit.rb +19 -13
- data/lib/d2l_sdk/user.rb +6 -4
- data/lib/d2l_sdk/version.rb +1 -1
- metadata +9 -6
- data/example_scripts/add_to_201708.rb +0 -15
- data/example_scripts/enroll_users.rb +0 -22
- data/example_scripts/find_201708_courses.rb +0 -16
data/lib/d2l_sdk/calendar.rb
CHANGED
@@ -33,12 +33,14 @@ end
|
|
33
33
|
def get_current_user_calendar_events_by_org_units(org_unit_ids_csv, start_date_time,
|
34
34
|
end_date_time, association = nil,
|
35
35
|
event_type = nil)
|
36
|
-
path = "/d2l/api/le/#{$le_ver}/calendar/events/myEvents
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
36
|
+
path = "/d2l/api/le/#{$le_ver}/calendar/events/myEvents/?"
|
37
|
+
params = []
|
38
|
+
params << "orgUnitIdsCSV=#{org_unit_ids_csv}"
|
39
|
+
params << "startDateTime=#{start_date_time}"
|
40
|
+
params << "endDateTime=#{end_date_time}"
|
41
|
+
params << "association=#{association}" unless association.nil?
|
42
|
+
params << "eventType=#{event_type}" unless event_type.nil?
|
43
|
+
path = path + params.join('&')
|
42
44
|
_get(path)
|
43
45
|
end
|
44
46
|
|
@@ -46,11 +48,13 @@ end
|
|
46
48
|
# RETURNS: An ObjectListPage JSON block containing a list of EventDataInfo JSON data blocks.
|
47
49
|
def get_current_user_events_by_org_unit(start_date_time, end_date_time,
|
48
50
|
association = nil, event_type = nil)
|
49
|
-
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/calendar/events/myEvents
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/calendar/events/myEvents/?"
|
52
|
+
params = []
|
53
|
+
params << "startDateTime=#{start_date_time}"
|
54
|
+
params << "endDateTime=#{end_date_time}"
|
55
|
+
params << "association=#{association}" unless association.nil?
|
56
|
+
params << "eventType=#{event_type}" unless event_type.nil?
|
57
|
+
path = path + params.join('&')
|
54
58
|
_get(path)
|
55
59
|
end
|
56
60
|
|
@@ -58,12 +62,14 @@ end
|
|
58
62
|
# RETURNS: An ObjectListPage JSON block containing a list of EventCountInfo JSON data blocks.
|
59
63
|
def get_calendar_event_count(org_unit_ids_csv, start_date_time, end_date_time,
|
60
64
|
association = nil, event_type = nil)
|
61
|
-
path = "/d2l/api/le/#{$le_ver}/calendar/events/myEvents/itemCounts
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
65
|
+
path = "/d2l/api/le/#{$le_ver}/calendar/events/myEvents/itemCounts/?"
|
66
|
+
params = []
|
67
|
+
params << "orgUnitIdsCSV=#{org_unit_ids_csv}"
|
68
|
+
params << "startDateTime=#{start_date_time}"
|
69
|
+
params << "endDateTime=#{end_date_time}"
|
70
|
+
params << "association=#{association}" unless association.nil?
|
71
|
+
params << "eventType=#{event_type}" unless event_type.nil?
|
72
|
+
path = path + params.join('&')
|
67
73
|
_get(path)
|
68
74
|
end
|
69
75
|
|
@@ -72,11 +78,13 @@ end
|
|
72
78
|
# RETURNS: An EventCountInfo JSON data block.
|
73
79
|
def get_org_unit_calendar_event_count(start_date_time, end_date_time,
|
74
80
|
association = nil, event_type = nil)
|
75
|
-
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/calendar/events/myEvents/itemCounts
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
81
|
+
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/calendar/events/myEvents/itemCounts/?"
|
82
|
+
params = []
|
83
|
+
params << "startDateTime=#{start_date_time}"
|
84
|
+
params << "endDateTime=#{end_date_time}"
|
85
|
+
params << "association=#{association}" unless association.nil?
|
86
|
+
params << "eventType=#{event_type}" unless event_type.nil?
|
87
|
+
path = path + params.join('&')
|
80
88
|
_get(path)
|
81
89
|
end
|
82
90
|
|
@@ -84,11 +92,13 @@ end
|
|
84
92
|
# RETURNS: a paged result set containing the resulting EventDataInfo JSON data blocks
|
85
93
|
def get_paged_calendar_events_by_org_units(org_unit_ids_csv, start_date_time,
|
86
94
|
end_date_time, bookmark = '')
|
87
|
-
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/calendar/events/orgunits
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
95
|
+
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/calendar/events/orgunits/?"
|
96
|
+
params = []
|
97
|
+
params << "orgUnitIdsCSV=#{org_unit_ids_csv}"
|
98
|
+
params << "startDateTime=#{start_date_time}"
|
99
|
+
params << "endDateTime=#{end_date_time}"
|
100
|
+
params << "bookmark=#{bookmark}" unless bookmark == ''
|
101
|
+
path = path + params.join('&')
|
92
102
|
_get(path)
|
93
103
|
end
|
94
104
|
|
@@ -97,11 +107,13 @@ end
|
|
97
107
|
# RETURNS: a paged result set containing the resulting EventDataInfo JSON data blocks
|
98
108
|
def get_user_calendar_events(org_unit_id, user_id, start_date_time, end_date_time,
|
99
109
|
bookmark = '')
|
100
|
-
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/calendar/events/user
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
110
|
+
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/calendar/events/user/?"
|
111
|
+
params = []
|
112
|
+
params << "userId=#{user_id}"
|
113
|
+
params << "startDateTime=#{start_date_time}"
|
114
|
+
params << "endDateTime=#{end_date_time}"
|
115
|
+
params << "bookmark=#{bookmark}" unless bookmark == ''
|
116
|
+
path = path + params.join('&')
|
105
117
|
_get(path)
|
106
118
|
# RETURNS: a paged result set containing the resulting EventDataInfo JSON data blocks
|
107
119
|
end
|
@@ -12,9 +12,11 @@ require_relative 'auth'
|
|
12
12
|
# Retrieve the definitions for all the configuration variables the
|
13
13
|
# user has access to view.
|
14
14
|
def get_all_config_var_definitions(search = '', bookmark = '')
|
15
|
-
path = "/d2l/api/lp/#{$lp_ver}/configVariables/definitions
|
16
|
-
|
17
|
-
|
15
|
+
path = "/d2l/api/lp/#{$lp_ver}/configVariables/definitions/?"
|
16
|
+
params = []
|
17
|
+
params << "search=#{search}" if search != ''
|
18
|
+
params << "bookmark=#{bookmark}" if bookmark != ''
|
19
|
+
path = path + params.join('&')
|
18
20
|
_get(path)
|
19
21
|
# returns paged result set of Definition JSON data blocks
|
20
22
|
end
|
@@ -160,8 +162,10 @@ def update_org_unit_config_var_resolution(resolver_value); end
|
|
160
162
|
# RETURNS: paged result set containing the resulting OrgInformation data blocks
|
161
163
|
def get_org_tools_info(include_restricted_tools = nil, bookmark = '')
|
162
164
|
path = "/d2l/api/lp/#{$lp_ver}/tools/org/?"
|
163
|
-
|
164
|
-
|
165
|
+
params = []
|
166
|
+
params << "includeRestrictedTools=#{includeRestrictedTools}" unless include_restricted_tools.nil?
|
167
|
+
params << "bookmark=#{bookmark}" unless bookmark == ''
|
168
|
+
path = path + params.join('&')
|
165
169
|
_get(path)
|
166
170
|
# RETURNS: paged result set containing the resulting OrgInformation data blocks
|
167
171
|
end
|
@@ -334,10 +334,12 @@ end
|
|
334
334
|
def get_calling_user_scheduled_items(org_unit_ids_CSV, completion = nil,
|
335
335
|
start_date_time = '', end_date_time = '') # GET
|
336
336
|
query_string = "/d2l/api/le/#{$le_ver}/content/myItems/?"
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
337
|
+
params = []
|
338
|
+
params << "orgUnitIdsCSV=#{org_unit_ids_CSV}"
|
339
|
+
params << "completion=#{completion}" unless completion.nil?
|
340
|
+
params << "startDateTime=#{start_date_time}" unless start_date_time == ''
|
341
|
+
params << "endDateTime=#{end_date_time}" unless end_date_time == ''
|
342
|
+
query_string = query_string + params.join('&')
|
341
343
|
_get(query_string)
|
342
344
|
# Returns: An ObjectListPage JSON block containing a list of ScheduledItem blocks
|
343
345
|
end
|
@@ -346,10 +348,12 @@ end
|
|
346
348
|
def get_current_user_scheduled_items_still_due(org_unit_ids_CSV, completion = nil,
|
347
349
|
start_date_time = '', end_date_time = '')
|
348
350
|
query_string = "/d2l/api/le/#{$le_ver}/content/myItems/due/?"
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
351
|
+
params = []
|
352
|
+
params << "orgUnitIdsCSV=#{org_unit_ids_CSV}"
|
353
|
+
params << "completion=#{completion}" unless completion.nil?
|
354
|
+
params << "startDateTime=#{start_date_time}" unless start_date_time == ''
|
355
|
+
params << "endDateTime=#{end_date_time}" unless end_date_time == ''
|
356
|
+
query_string = query_string + params.join('&')
|
353
357
|
_get(query_string)
|
354
358
|
# Returns: An ObjectListPage JSON block containing a list of ScheduledItem blocks
|
355
359
|
end
|
@@ -361,10 +365,12 @@ def get_current_user_organized_scheduled_items(org_unit_ids_CSV,
|
|
361
365
|
start_date_time = '',
|
362
366
|
end_date_time = '')
|
363
367
|
query_string = "/d2l/api/le/#{$le_ver}/content/myItems/itemCounts/?"
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
+
params = []
|
369
|
+
params << "orgUnitIdsCSV=#{org_unit_ids_CSV}"
|
370
|
+
params << "completion=#{completion}" unless completion.nil?
|
371
|
+
params << "startDateTime=#{start_date_time}" unless start_date_time == ''
|
372
|
+
params << "endDateTime=#{end_date_time}" unless end_date_time == ''
|
373
|
+
query_string = query_string + params.join('&')
|
368
374
|
_get(query_string)
|
369
375
|
# Returns: An ObjectListPage JSON block containing a list of ScheduledItem blocks
|
370
376
|
end
|
@@ -374,10 +380,12 @@ end
|
|
374
380
|
def get_current_user_scheduled_item_count(org_unit_ids_CSV, completion = nil,
|
375
381
|
start_date_time = '', end_date_time = '') # GET
|
376
382
|
query_string = "/d2l/api/le/#{$le_ver}/content/myItems/due/itemCounts/?"
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
383
|
+
params = []
|
384
|
+
params << "orgUnitIdsCSV=#{org_unit_ids_CSV}"
|
385
|
+
params << "completion=#{completion}" unless completion.nil?
|
386
|
+
params << "startDateTime=#{start_date_time}" unless start_date_time == ''
|
387
|
+
params << "endDateTime=#{end_date_time}" unless end_date_time == ''
|
388
|
+
query_string = query_string + params.join('&')
|
381
389
|
_get(query_string)
|
382
390
|
# Returns: An ObjectListPage JSON block containing a list of ScheduledItem blocks
|
383
391
|
end
|
@@ -388,9 +396,11 @@ def get_current_user_completed_scheduled_items(org_unit_ids_CSV,
|
|
388
396
|
completion_from_date_time = '',
|
389
397
|
completed_to_date_time = '')
|
390
398
|
query_string = "/d2l/api/le/#{$le_ver}/content/myItems/completions/?"
|
391
|
-
|
392
|
-
|
393
|
-
|
399
|
+
params = []
|
400
|
+
params << "orgUnitIdsCSV=#{org_unit_ids_CSV}"
|
401
|
+
params << "completedFromDateTime=#{completion_from_date_time}" unless completion_from_date_time == ''
|
402
|
+
params << "completedToDateTime=#{completed_to_date_time}" unless completed_to_date_time == ''
|
403
|
+
query_string = query_string + params.join('&')
|
394
404
|
_get(query_string)
|
395
405
|
# Returns: An ObjectListPage JSON block containing a list of ScheduledItem blocks
|
396
406
|
end
|
@@ -401,9 +411,11 @@ def get_current_user_completed_scheduled_items_with_due_date(org_unit_ids_CSV,
|
|
401
411
|
completion_from_date_time = '',
|
402
412
|
completed_to_date_time = '')
|
403
413
|
query_string = "/d2l/api/le/#{$le_ver}/content/myItems/completions/due/?"
|
404
|
-
|
405
|
-
|
406
|
-
|
414
|
+
params = []
|
415
|
+
params << "orgUnitIdsCSV=#{org_unit_ids_CSV}"
|
416
|
+
params << "completedFromDateTime=#{completion_from_date_time}" unless completion_from_date_time == ''
|
417
|
+
params << "completedToDateTime=#{completed_to_date_time}" unless completed_to_date_time == ''
|
418
|
+
query_string = query_string + params.join('&')
|
407
419
|
_get(query_string)
|
408
420
|
# Returns: An ObjectListPage JSON block containing a list of ScheduledItem blocks
|
409
421
|
end
|
@@ -414,9 +426,11 @@ def get_current_user_scheduled_items_by_org_unit(org_unit_id, completion = nil,
|
|
414
426
|
start_date_time = '',
|
415
427
|
end_date_time = '')
|
416
428
|
query_string = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/content/myItems/?"
|
417
|
-
|
418
|
-
|
419
|
-
|
429
|
+
params = []
|
430
|
+
params << "completion=#{completion}" unless completion.nil?
|
431
|
+
params << "startDateTime=#{start_date_time}" unless start_date_time == ''
|
432
|
+
params << "endDateTime=#{end_date_time}" unless end_date_time == ''
|
433
|
+
query_string = query_string + params.join('&')
|
420
434
|
_get(query_string)
|
421
435
|
# Returns: An ObjectListPage JSON block containing a list of ScheduledItem blocks
|
422
436
|
end
|
@@ -427,9 +441,11 @@ def get_current_user_org_unit_scheduled_items(org_unit_id, completion = nil,
|
|
427
441
|
start_date_time = '',
|
428
442
|
end_date_time = '') # GET
|
429
443
|
query_string = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/content/myItems/due/?"
|
430
|
-
|
431
|
-
|
432
|
-
|
444
|
+
params = []
|
445
|
+
params << "completion=#{completion}" unless completion.nil?
|
446
|
+
params << "startDateTime=#{start_date_time}" unless start_date_time == ''
|
447
|
+
params << "endDateTime=#{end_date_time}" unless end_date_time == ''
|
448
|
+
query_string = query_string + params.join('&')
|
433
449
|
_get(query_string)
|
434
450
|
# Returns: An ObjectListPage JSON block containing a list of ScheduledItem blocks
|
435
451
|
end
|
@@ -439,9 +455,11 @@ end
|
|
439
455
|
def get_calling_user_overdue_items_count(org_unit_id, completion = nil, start_date_time = '',
|
440
456
|
end_date_time = '') # GET
|
441
457
|
query_string = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/content/myItems/itemCount?"
|
442
|
-
|
443
|
-
|
444
|
-
|
458
|
+
params = []
|
459
|
+
params << "completion=#{completion}" unless completion.nil?
|
460
|
+
params << "startDateTime=#{start_date_time}" unless start_date_time == ''
|
461
|
+
params << "endDateTime=#{end_date_time}" unless end_date_time == ''
|
462
|
+
query_string = query_string + params.join('&')
|
445
463
|
_get(query_string)
|
446
464
|
# Returns: An ObjectListPage JSON block containing a list of ScheduledItem blocks
|
447
465
|
end
|
@@ -451,9 +469,11 @@ end
|
|
451
469
|
def get_calling_user_due_items_count(org_unit_id, completion = nil, start_date_time = '',
|
452
470
|
end_date_time = '') # GET
|
453
471
|
query_string = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/content/myItems/due/itemCount?"
|
454
|
-
|
455
|
-
|
456
|
-
|
472
|
+
params = []
|
473
|
+
params << "completion=#{completion}" unless completion.nil?
|
474
|
+
params << "startDateTime=#{start_date_time}" unless start_date_time == ''
|
475
|
+
params << "endDateTime=#{end_date_time}" unless end_date_time == ''
|
476
|
+
query_string = query_string + params.join('&')
|
457
477
|
_get(query_string)
|
458
478
|
# Returns: An ObjectListPage JSON block containing a list of ScheduledItem blocks
|
459
479
|
end
|
data/lib/d2l_sdk/demographics.rb
CHANGED
@@ -20,13 +20,14 @@ end
|
|
20
20
|
# search and bookmark are Strings
|
21
21
|
def get_all_demographics_by_org_unit(org_unit_id, field_ids = '', role_ids = '',
|
22
22
|
user_ids = '', search = '', bookmark = '')
|
23
|
-
path = "/d2l/api/lp/#{$lp_ver}/demographics/orgUnits/#{org_unit_id}/users
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
path = "/d2l/api/lp/#{$lp_ver}/demographics/orgUnits/#{org_unit_id}/users/?"
|
24
|
+
params = []
|
25
|
+
params << "fieldIds=#{field_ids}" if field_ids != ''
|
26
|
+
params << "roleIds=#{role_ids}" if role_ids != ''
|
27
|
+
params << "userIds=#{user_ids}" if user_ids != ''
|
28
|
+
params << "search=#{search}" if search != ''
|
29
|
+
params << "bookmark=#{bookmark}" if bookmark != ''
|
30
|
+
path = path + params.join('&')
|
30
31
|
_get(path)
|
31
32
|
# returns paged result set of DemographicsUserEntryData JSON blocks
|
32
33
|
end
|
@@ -42,23 +43,25 @@ end
|
|
42
43
|
# Retrieve all demographics entries for all users with specified filters
|
43
44
|
def get_all_demographics(field_ids = '', role_ids = '', user_ids = '',
|
44
45
|
search = '', bookmark = '')
|
45
|
-
path = "/d2l/api/lp/#{$lp_ver}/demographics/users
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
path = "/d2l/api/lp/#{$lp_ver}/demographics/users/?"
|
47
|
+
params = []
|
48
|
+
params << "fieldIds=#{field_ids}" if field_ids != ''
|
49
|
+
params << "roleIds=#{role_ids}" if role_ids != ''
|
50
|
+
params << "userIds=#{user_ids}" if user_ids != ''
|
51
|
+
params << "search=#{search}" if search != ''
|
52
|
+
params << "bookmark=#{bookmark}" if bookmark != ''
|
53
|
+
path = path + params.join('&')
|
52
54
|
_get(path)
|
53
55
|
# returns paged result set of DemographicsUserEntryData JSON blocks
|
54
56
|
end
|
55
57
|
|
56
58
|
# Retrieve all the demographics entries for a single user.
|
57
59
|
def get_user_demographics(user_id, field_ids = '', bookmark = '')
|
58
|
-
path = "/d2l/api/lp/#{$lp_ver}/demographics/users/#{user_id}"
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
path = "/d2l/api/lp/#{$lp_ver}/demographics/users/#{user_id}?"
|
61
|
+
params = []
|
62
|
+
params << "fieldIds=#{field_ids}" if field_ids != ''
|
63
|
+
params << "bookmark=#{bookmark}" if bookmark != ''
|
64
|
+
path = path + params.join('&')
|
62
65
|
_get(path)
|
63
66
|
end
|
64
67
|
|
data/lib/d2l_sdk/discussions.rb
CHANGED
@@ -307,11 +307,13 @@ end
|
|
307
307
|
def get_forum_topic_posts(org_unit_id, forum_id, topic_id, page_size = 0, page_number = 0,
|
308
308
|
threads_only = nil, thread_id = 0, sort = '')
|
309
309
|
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/posts/?"
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
310
|
+
params = []
|
311
|
+
params << "pageSize=#{page_size}" unless page_size.zero?
|
312
|
+
params << "pageNumber=#{page_number}" unless page_number.zero?
|
313
|
+
params << "threadsOnly=#{threads_only}" unless threads_only.nil?
|
314
|
+
params << "threadId=#{thread_id}" unless thread_id.zero?
|
315
|
+
params << "sort=#{sort}" unless sort == ''
|
316
|
+
path = path + params.join('&')
|
315
317
|
_get(path)
|
316
318
|
# RETURNS: JSON array of Post data blocks containing the properties for all the post
|
317
319
|
end
|
data/lib/d2l_sdk/enroll.rb
CHANGED
@@ -40,13 +40,15 @@ end
|
|
40
40
|
def get_all_enrollments_of_current_user(bookmark = '', sort_by = '', is_active = nil,
|
41
41
|
start_date_time = '', end_date_time = '',
|
42
42
|
can_access = nil)
|
43
|
-
path = "/d2l/api/lp/#{$lp_ver}/enrollments/myenrollments
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
path = "/d2l/api/lp/#{$lp_ver}/enrollments/myenrollments/?"
|
44
|
+
params = []
|
45
|
+
params << "bookmark=#{bookmark}" if bookmark != ''
|
46
|
+
params << "sortBy=#{sort_by}" if sort_by != ''
|
47
|
+
params << "isActive=#{is_active}" unless is_active.nil?
|
48
|
+
params << "startDateTime=#{start_date_time}" if start_date_time != ''
|
49
|
+
params << "endDateTime=#{end_date_time}" if end_date_time != ''
|
50
|
+
params << "canAccess=#{can_access}" unless can_access.nil?
|
51
|
+
path = path + params.join('&')
|
50
52
|
_get(path)
|
51
53
|
# Returns: paged result set containing the resulting MyOrgUnitInfo data blocks
|
52
54
|
end
|
@@ -63,9 +65,11 @@ end
|
|
63
65
|
# --roleId: D2LID
|
64
66
|
# --bookmark: String
|
65
67
|
def get_org_unit_enrollments(org_unit_id, role_id = 0, bookmark = '')
|
66
|
-
path = "/d2l/api/lp/#{$lp_ver}/enrollments/orgUnits/#{org_unit_id}/users
|
67
|
-
|
68
|
-
|
68
|
+
path = "/d2l/api/lp/#{$lp_ver}/enrollments/orgUnits/#{org_unit_id}/users/?"
|
69
|
+
params = []
|
70
|
+
params << "roleId=#{role_id}" if role_id != 0
|
71
|
+
params << "bookmark=#{bookmark}" if bookmark != ''
|
72
|
+
path = path + params.join('&')
|
69
73
|
_get(path)
|
70
74
|
# Returns: paged result set containing the resulting OrgUnitUser data blocks
|
71
75
|
end
|
@@ -88,10 +92,12 @@ end
|
|
88
92
|
# --bookmark: string
|
89
93
|
def get_all_enrollments_of_user(user_id, org_unit_type_id = 0, role_id = 0,
|
90
94
|
bookmark = '')
|
91
|
-
path = "/d2l/api/lp/1.3/enrollments/users/#{user_id}/orgUnits
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
+
path = "/d2l/api/lp/1.3/enrollments/users/#{user_id}/orgUnits/?"
|
96
|
+
params = []
|
97
|
+
params << "orgUnitTypeId=#{org_unit_type_id}" if org_unit_type_id != 0
|
98
|
+
params << "roleId=#{role_id}" if role_id != 0
|
99
|
+
params << "bookmark=#{bookmark}" if bookmark != ''
|
100
|
+
path = path + params.join('&')
|
95
101
|
_get(path)
|
96
102
|
# Returns: paged result set w/ the resulting UserOrgUnit data blocks
|
97
103
|
end
|
data/lib/d2l_sdk/grades.rb
CHANGED
@@ -293,12 +293,13 @@ end
|
|
293
293
|
# of user grade values for your provided grade object.
|
294
294
|
def get_all_grade_object_grades(org_unit_id, grade_object_id, sort = '',
|
295
295
|
page_size = 0, is_graded = nil, search_text = '')
|
296
|
-
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/grades/#{grade_object_id}/values
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
296
|
+
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/grades/#{grade_object_id}/values/?"
|
297
|
+
params = []
|
298
|
+
params << "sort=#{sort}" if sort != ''
|
299
|
+
params << "pageSize=#{page_size}" if page_size != 0
|
300
|
+
params << "isGraded=#{is_graded}" unless is_graded.nil?
|
301
|
+
params << "searchText=#{search_text}" if search_text != ''
|
302
|
+
path = path + params.join('&')
|
302
303
|
_get(path)
|
303
304
|
# RETURN: This action returns an ObjectListPage JSON block containing a list
|
304
305
|
# of user grade values for your provided grade object.
|
@@ -345,12 +346,13 @@ end
|
|
345
346
|
# parameter (or the first segment if the parameter is empty or missing).
|
346
347
|
def get_org_unit_completion_records(org_unit_id, user_id = 0, start_expiry = '',
|
347
348
|
end_expiry = '', bookmark = '')
|
348
|
-
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/grades/courseCompletion
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
349
|
+
path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/grades/courseCompletion/?"
|
350
|
+
params = []
|
351
|
+
params << "userId=#{user_id}" if user_id != 0
|
352
|
+
params << "startExpiry=#{start_expiry}" if startExpiry != ''
|
353
|
+
params << "endExpiry=#{end_expiry}" if endExpiry != ''
|
354
|
+
params << "bookmark=#{bookmark}" if bookmark != ''
|
355
|
+
path = path + params.join('&')
|
354
356
|
_get(path)
|
355
357
|
# RETURNS: This action returns a paged result set containing the resulting
|
356
358
|
# CourseCompletion data blocks for the segment following your bookmark
|
@@ -361,13 +363,14 @@ end
|
|
361
363
|
# RETURNS: This action returns a paged result set containing the resulting
|
362
364
|
# CourseCompletion data blocks for the segment following your bookmark
|
363
365
|
# parameter (or the first segment if the parameter is empty or missing).
|
364
|
-
def get_user_completion_records(
|
366
|
+
def get_user_completion_records(user_id, start_expiry = '', end_expiry = '',
|
365
367
|
bookmark = '')
|
366
|
-
path = "/d2l/api/le/#{$le_ver}
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
368
|
+
path = "/d2l/api/le/#{$le_ver}/grades/courseCompletion/#{user_id}/?"
|
369
|
+
params = []
|
370
|
+
params << "startExpiry=#{start_expiry}&" if startExpiry != ''
|
371
|
+
params << "endExpiry=#{end_expiry}&" if endExpiry != ''
|
372
|
+
params << "bookmark=#{bookmark}" if bookmark != ''
|
373
|
+
path = path + params.join('&')
|
371
374
|
_get(path)
|
372
375
|
# RETURNS: This action returns a paged result set containing the resulting
|
373
376
|
# CourseCompletion data blocks for the segment following your bookmark
|