d2l_sdk 0.1.9 → 0.1.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.
@@ -66,8 +66,52 @@ end
66
66
  # 1. +ContentObjectData+ JSON data block of type Topic
67
67
  # 2. File attachment data itself you want to store in OU content area
68
68
  # Returns (if successful) a JSON data block containing properties of the newly created object
69
- def add_child_to_module(org_unit_id, module_id) # POST
70
- query_string = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/content/modules/#{module_id}/structure/"
69
+ def add_child_to_module(org_unit_id, module_id, child ={}) # POST
70
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/content/modules/#{module_id}/structure/"
71
+ payload = {}
72
+ if child.key?("module") # TODO: modules
73
+ payload = {
74
+ "Title" => "title_string", # String
75
+ "ShortTitle" => "title_short_string", # String
76
+ "Type" => 0,
77
+ "ModuleStartDate" => nil, # nil || string:UTCDateTime
78
+ "ModuleEndDate" => nil, # nil || string:UTCDateTime
79
+ "ModuleDueDate" => nil, # nil || string:UTCDateTime
80
+ "IsHidden" => false,
81
+ "IsLocked" => false,
82
+ "description" => {
83
+ "Text" => "blank",
84
+ "HTML" => ""
85
+ },
86
+ "Duration" => nil, #nil, number
87
+ }.merge!(child["module"])
88
+ _post(path, payload)
89
+ elsif child.key?("link") # TODO: link-type topics
90
+ payload = {
91
+ "Title" => "title_string", # String
92
+ "ShortTitle" => "title_short_string", # String
93
+ "Type" => 1,
94
+ "TopicType" => 3, #<number:TOPIC_T>
95
+ "Url" => "URL", # the URL you want to fetch when the user opens the link-type topic.
96
+ "StartDate" => nil, # nil || string:UTCDateTime
97
+ "EndDate" => nil, # nil || string:UTCDateTime
98
+ "DueDate" => nil, # nil || string:UTCDateTime
99
+ "IsHidden" => false,
100
+ "IsLocked" => false,
101
+ "OpenAsExternalResource" => nil, #or boolean
102
+ "description" => {
103
+ "Text" => "",
104
+ "HTML" => nil # -or- HTML formatted string
105
+ },
106
+ "MajorUpdate" => nil, # or bool
107
+ "MajorUpdateText" => "MajorUpdateText",
108
+ "ResetCompletionTracking" => nil, # or bool
109
+ "Duration" => nil, #nil, number
110
+ }.merge!(child["module"])
111
+ _post(path, payload)
112
+ elsif child.key?("file") # TODO: file-type topics
113
+ _course_content_upload(query_string, payload, file, "POST")
114
+ end
71
115
  end
72
116
 
73
117
  def check_content_module_validity(content_module)
@@ -206,6 +250,7 @@ end
206
250
  # Retrieve the overview for a course offering.
207
251
  def get_course_overview(org_unit_id) # GET
208
252
  query_string = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/overview"
253
+ ap query_string
209
254
  _get(query_string)
210
255
  # Returns: a Overview JSON data block containing
211
256
  # the course offering overview’s details.
@@ -61,6 +61,43 @@ def get_user_demographics(user_id, field_ids = '', bookmark = '')
61
61
  path += "bookmark=#{bookmark}" if bookmark != ''
62
62
  end
63
63
 
64
+ def check_demographics_user_entry_data_validity(demographics_user_entry_data)
65
+ # A hash with one value, "EntryValues", which is an array of hashes that
66
+ # include the keys "Name" and "Values", where "Name" is a string and "Values"
67
+ # is an array of string.
68
+ schema = {
69
+ 'type' => 'object',
70
+ 'required' => %w(EntryValues),
71
+ 'properties' => {
72
+ 'EntryValues' => # DemographicsEntryData
73
+ {
74
+ 'type' => 'array',
75
+ 'items' => # Items = <composite:DemographicsEntry>
76
+ {
77
+ 'type' => 'object',
78
+ 'minItems' => 1,
79
+ 'required' => %w(Name Values),
80
+ 'properties' =>
81
+ {
82
+ 'Name' => { 'type' => 'string' },
83
+ 'Values' =>
84
+ {
85
+ 'type' => 'array',
86
+ 'items' =>
87
+ {
88
+ 'type' => 'string',
89
+ 'minItems' => 1
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ JSON::Validator.validate!(schema, demographics_user_entry_data, validate_schema: true)
98
+ end
99
+
100
+
64
101
  # TODO: Update the demographics entries for a single user.
65
102
  # Return: a DemographicsUserEntryData JSON block containing the user’s updated entries.
66
103
  def update_user_demographics(user_id, demographics_entry_data)
@@ -92,19 +129,64 @@ def get_demographic_field(field_id)
92
129
  # returns fetch form of DemographicsField JSON block
93
130
  end
94
131
 
95
- # TODO: Create new demographic field
132
+ # Additional function added to check that the demographics data (create form)
133
+ # conforms to the JSON schema required by D2L's backend.
134
+ def check_create_demographics_field(demographics_data)
135
+ schema = {
136
+ 'type' => 'object',
137
+ 'required' => %w(Name Description DataTypeId),
138
+ 'properties' => {
139
+ 'Name' => { 'type' => 'string' },
140
+ 'Description' => { 'type' => 'string' },
141
+ 'DataTypeId' => { 'type' => 'string' }
142
+ }
143
+ }
144
+ JSON::Validator.validate!(schema, demographics_data, validate_schema: true)
145
+ end
146
+
147
+ # REVIEW: Create new demographic field
96
148
  # Input: DemographicsField (Demographics.Demographicsfield)
97
149
  # RETURNS: fetch form of a DemographicsField JSON block
98
150
  def create_demographic_field(demographics_field)
99
151
  # POST /d2l/api/lp/(version)/demographics/fields/
152
+ path = "/d2l/api/lp/#{$lp_ver}/demographics/fields/"
153
+ payload = {
154
+ "Name" => "String",
155
+ "Description" => "String",
156
+ "DataTypeId" => "String:GUID"
157
+ }
158
+ check_create_demographics_field(payload)
159
+ _post(path, payload)
100
160
  # RETURNS: fetch form of a DemographicsField JSON block
101
161
  end
102
162
 
103
- # TODO: Update demographic field
163
+ # Additional function added to check that the demographics data (update form)
164
+ # conforms to the JSON schema required by D2L's backend.
165
+ def check_update_demographics_field(demographics_data)
166
+ schema = {
167
+ 'type' => 'object',
168
+ 'required' => %w(Name Description),
169
+ 'properties' => {
170
+ 'Name' => { 'type' => 'string' },
171
+ 'Description' => { 'type' => 'string' },
172
+ }
173
+ }
174
+ JSON::Validator.validate!(schema, demographics_data, validate_schema: true)
175
+ end
176
+
177
+ # REVIEW: Update a single demographic field.
104
178
  # Input: DemographicsField (Demographics.Demographicsfield)
105
179
  # RETURNS: fetch form of a DemographicsField JSON block
106
- def create_demographic_field(field_id, demographics_field)
180
+ def update_demographics_field(field_id, demographics_field)
107
181
  # PUT /d2l/api/lp/(version)/demographics/fields/(fieldId)
182
+ path = "/d2l/api/lp/#{$lp_ver}/demographics/fields/#{field_id}"
183
+ payload = {
184
+ "Name" => "String",
185
+ "Description" => "String",
186
+ "DataTypeId" => "String:GUID"
187
+ }
188
+ check_update_demographics_field(payload)
189
+ _put(path, payload)
108
190
  # RETURNS: fetch form of a DemographicsField JSON block
109
191
  end
110
192
 
@@ -0,0 +1,199 @@
1
+ require_relative 'requests'
2
+ require 'json-schema'
3
+
4
+ ##################
5
+ ## ACTIONS: ######
6
+ ##################
7
+
8
+ # REVIEW: Delete a particular discussion forum from an org unit.
9
+ # => DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)
10
+ def dete_org_unit_discussion(org_unit_id, forum_id)
11
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}"
12
+ _delete(path)
13
+ end
14
+
15
+ # REVIEW: Retrieve a list of all discussion forums for an org unit.
16
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/
17
+ def get_org_unit_discussions(org_unit_id)
18
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/"
19
+ _get(path)
20
+ end
21
+
22
+ # REVIEW: Retrieve a particular discussion forum for an org unit.
23
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)
24
+ def get_org_unit_discussion(org_unit_id, forum_id)
25
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}"
26
+ _get(path)
27
+ end
28
+
29
+ # TODO: Validate input of create_org_unit_discussion
30
+ # Create a new forum for an org unit.
31
+ # => POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/
32
+ def create_org_unit_discussion(org_unit_id, forum_data)
33
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/"
34
+ payload =
35
+ {
36
+ 'Name' => '', #: <string>,
37
+ 'Description' => #: { <composite:RichText> },
38
+ {
39
+ "Text" => "",#<string:plaintext_version_of_text>,
40
+ "Html" => nil #<string:HTML_formatted_version_of_text>|null
41
+ },
42
+ 'ShowDescriptionInTopics' => nil, #: <boolean>|null, // Added with LE API v1.14
43
+ 'StartDate' => nil, #: <string:UTCDateTime>|null,
44
+ 'EndDate' => nil, #: <string:UTCDateTime>|null,
45
+ 'PostStartDate' => nil, #: <string:UTCDateTime>|null,
46
+ 'PostEndDate' => nil, # <string:UTCDateTime>|null,
47
+ 'AllowAnonymous' => false, # <boolean>,
48
+ 'IsLocked' => false, #: <boolean>,
49
+ 'IsHidden' => false, #: <boolean>,
50
+ 'RequiresApproval' => '', #: <boolean>,
51
+ 'MustPostToParticipate' => nil, #: <boolean>|null,
52
+ 'DisplayInCalendar' => nil, #: <boolean>|null, // Added with LE API v1.11
53
+ 'DisplayPostDatesInCalendar' => nil, #: <boolean>|null // Added with LE API v1.11
54
+ }.merge!(forum_data)
55
+ # TODO: Validate payload
56
+ _post(path, payload)
57
+ end
58
+
59
+ # TODO: Update a forum for an org unit.
60
+ # => PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)
61
+
62
+ ##################
63
+ ## TOPICS: #######
64
+ ##################
65
+
66
+ # TODO: Delete a particular topic from the provided discussion forum in an org unit.
67
+ # => DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)
68
+ # TODO: Delete a group restriction for a discussion forum topic.
69
+ # => DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/groupRestrictions/
70
+ # REVIEW: Retrieve topics from the provided discussion forum in an org unit.
71
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/
72
+ def get_forum_topics(org_unit_id, forum_id)
73
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/"
74
+ _get(path)
75
+ end
76
+
77
+ # REVIEW: Retrieve a particular topic from the provided discussion forum in an org unit.
78
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)
79
+ def get_forum_topic(org_unit_id, forum_id, topic_id)
80
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}"
81
+ _get(path)
82
+ end
83
+
84
+ # REVIEW: Retrieve the group restrictions for a discussion forum topic.
85
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/groupRestrictions/
86
+ def get_forum_topic_group_restrictions(org_unit_id, forum_id, topic_id)
87
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/groupRestrictions/"
88
+ _get(path)
89
+ end
90
+
91
+ # TODO: Create a new topic for the provided discussion forum in an org unit.
92
+ # => POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/
93
+ # TODO: Update an existing topic for the provided discussion forum in an org unit.
94
+ # => PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)
95
+ # TODO: Add a group to the group restriction list for a discussion forum topic.
96
+ # => PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/groupRestrictions/
97
+
98
+ ##################
99
+ ## POSTS: ########
100
+ ##################
101
+
102
+ # TODO: Delete a particular post from a discussion forum topic.
103
+ # => DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)
104
+ # TODO: DELETE /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Rating/MyRating
105
+ # => Delete the current user context’s rating for a particular post from a discussion forum topic.
106
+
107
+ # REVIEW: Retrieve all posts in a discussion forum topic.
108
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/
109
+ # RETURNS: JSON array of Post data blocks containing the properties for all the post
110
+ def get_forum_topic_posts(org_unit_id, forum_id, topic_id, page_size = 0, page_number = 0,
111
+ threads_only = nil, thread_id = 0, sort = '')
112
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/posts/?"
113
+ path += "pageSize=#{page_size}&" unless page_size == 0
114
+ path += "pageNumber=#{page_number}&" unless page_number == 0
115
+ path += "threadsOnly=#{threads_only}&" unless threads_only.nil?
116
+ path += "threadId=#{thread_id}&" unless thread_id == 0
117
+ path += "sort=#{sort}" unless sort == ''
118
+ _get(path)
119
+ # RETURNS: JSON array of Post data blocks containing the properties for all the post
120
+ end
121
+
122
+ # REVIEW: Retrieve a particular post in a discussion forum topic.
123
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)
124
+ def get_forum_topic_post(org_unit_id, forum_id, topic_id, post_id)
125
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/posts/#{post_id}"
126
+ _get(path)
127
+ # RETURNS: Post data block
128
+ end
129
+
130
+ # REVIEW: Retrieve the approval status for a particular post in a discussion forum topic.
131
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Approval
132
+ def get_forum_topic_post_approval_status(org_unit_id, forum_id, topic_id, post_id)
133
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/posts/#{post_id}/Approval"
134
+ _get(path)
135
+ # RETURNS: ApprovalData JSON data block
136
+ end
137
+
138
+ # TODO: Retrieve the flagged status for a particular post in a discussion forum topic.
139
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Flag
140
+ def get_forum_topic_post_flagged_status(org_unit_id, forum_id, topic_id, post_id)
141
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/posts/#{post_id}/Flag"
142
+ _get(path)
143
+ # RETURNS: FlagData JSON data block
144
+ end
145
+
146
+ # REVIEW: Retrieve the rating data for a particular post in a discussion forum topic.
147
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Rating
148
+ def get_forum_topic_post_rating_data(org_unit_id, forum_id, topic_id, post_id)
149
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/posts/#{post_id}/Rating"
150
+ _get(path)
151
+ # RETURNS: RatingData JSON data block
152
+ end
153
+
154
+ # REVIEW: Retrieve the current user context’s rating data for a particular post in a discussion forum topic.
155
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Rating/MyRating
156
+ def get_current_user_forum_topic_post_rating_data(org_unit_id, forum_id, topic_id, post_id)
157
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/posts/#{post_id}/Rating/MyRating"
158
+ _get(path)
159
+ # RETURNS: UserRatingData JSON data block
160
+ end
161
+
162
+ # REVIEW: Retrieve the current read status for a particular post in a discussion forum topic.
163
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/ReadStatus
164
+ def get_forum_topic_post_read_status(org_unit_id, forum_id, topic_id, post_id)
165
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/posts/#{post_id}/ReadStatus"
166
+ _get(path)
167
+ # RETURNS: ReadStatusData JSON data block
168
+ end
169
+
170
+ # REVIEW: Retrieve all the vote data for a particular post in a discussion forum topic.
171
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Votes
172
+ def get_forum_topic_post_vote_data(org_unit_id, forum_id, topic_id, post_id)
173
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/posts/#{post_id}/Votes"
174
+ _get(path)
175
+ # RETURNS: VotesData JSON data block
176
+ end
177
+
178
+ # REVIEW: Retrieve the current user’s vote data for a particular post in a discussion forum topic.
179
+ # => GET /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Votes/MyVote
180
+ def get_current_user_forum_topic_post_vote_data(org_unit_id, forum_id, topic_id, post_id)
181
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/discussions/forums/#{forum_id}/topics/#{topic_id}/posts/#{post_id}/Votes/MyVote"
182
+ _get(path)
183
+ # RETURNS: UserVoteData JSON data block
184
+ end
185
+
186
+ # TODO: Create a new post in a discussion forum topic.
187
+ # => POST /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/
188
+ # TODO: Update a particular post in a discussion forum topic.
189
+ # => PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)
190
+ # TODO: Update the approval status of a particular post in a discussion forum topic.
191
+ # => PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Approval
192
+ # TODO: Update the flagged status of a particular post in a discussion forum topic.
193
+ # => PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Flag
194
+ # TODO: Update the current user context’s rating for a particular post in a discussion forum topic.
195
+ # => PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Rating/MyRating
196
+ # TODO: Update the read status of a particular post in a discussion forum topic.
197
+ # => PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/ReadStatus
198
+ # TODO: Update a discussion forum topic post’s vote data for the current user.
199
+ # => PUT /d2l/api/le/(version)/(orgUnitId)/discussions/forums/(forumId)/topics/(topicId)/posts/(postId)/Votes/MyVote
@@ -0,0 +1,120 @@
1
+ require_relative 'requests'
2
+ require 'json-schema'
3
+
4
+ ##################
5
+ ## ACTIONS: ######
6
+ ##################
7
+
8
+ # REVIEW: Retrieve all dropbox folders for an org unit.
9
+ # => GET /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/
10
+ def get_org_unit_dropbox_folders(org_unit_id, only_current_students_and_groups = nil)
11
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/"
12
+ path += "?onlyCurrentStudentsAndGroups=#{only_current_students_and_groups}" if only_current_students_and_groups == true || only_current_students_and_groups == false
13
+ _get(path)
14
+ end
15
+
16
+ # REVIEW: Retrieve a specific dropbox folder.
17
+ # => GET /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}
18
+ def get_dropbox_folder(org_unit_id, folder_id)
19
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}"
20
+ _get(path)
21
+ end
22
+
23
+ # REVIEW: Retrieve a file attachment (identified by file ID) from a specific dropbox folder.
24
+ # => GET /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/attachments/#{file_id}
25
+ def get_dropbox_file_attachment(org_unit_id, folder_id, file_id)
26
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/attachments/#{file_id}"
27
+ _get(path)
28
+ end
29
+
30
+ # TODO: Create a new dropbox folder in an org unit.
31
+ # => POST /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/
32
+ # TODO: Update a particular dropbox folder in an org unit.
33
+ # => PUT /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}
34
+
35
+ # REVIEW: Retrieve a list of org units for which the current user context has an
36
+ # assessment role on their dropbox folders (can see submissions and provide feedback).
37
+ # => GET /d2l/api/le/#{$le_ver}/dropbox/orgUnits/feedback/
38
+ def get_current_user_assessable_folders(type = nil)
39
+ path = "/d2l/api/le/#{$le_ver}/dropbox/orgUnits/feedback/"
40
+ path += "?type=#{type}" if type == 0 || type == 1
41
+ _get(path)
42
+ end
43
+
44
+
45
+ ##################
46
+ ## SUBMISSIONS: ##
47
+ ##################
48
+
49
+ # REVIEW: Retrieve all the submissions for a specific dropbox folder.
50
+ # => GET /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/submissions/
51
+ def get_dropbox_folder_submissions(org_unit_id, folder_id, active_only = nil)
52
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/submissions/"
53
+ path += "?activeOnly=#{active_only}" if active_only == true || active_only == false
54
+ _get(path)
55
+ end
56
+
57
+ # REVIEW: Retrieve one of the files included in a submission for a particular dropbox folder.
58
+ # => GET /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/submissions/#{submission_id}/files/#{file_id}
59
+ def get_dropbox_submission_file(org_unit_id, folder_id, submission_id, file_id)
60
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/submissions/#{submission_id}/files/#{file_id}"
61
+ _get(path)
62
+ end
63
+
64
+ # TODO: Post a new group submission to a particular dropbox folder.
65
+ # => POST /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/submissions/group/(groupId)
66
+ # TODO: Post a new submission for the current user context to a particular dropbox folder.
67
+ # => POST /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/submissions/mysubmissions/
68
+ # TODO: Mark a submitted file as read.
69
+ # => POST /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/submissions/#{submission_id}/files/#{file_id}/markAsRead
70
+
71
+ ##################
72
+ ## FEEDBACK: #####
73
+ ##################
74
+
75
+ # TODO: Remove a particular file attachment from an entity’s feedback entry within a specified dropbox folder.
76
+ # => DELETE /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/feedback/#{entity_type}/(entityId)/attachments/#{file_id}
77
+
78
+ # REVIEW: Retrieve the feedback entry from a dropbox folder for the provided entity.
79
+ # => GET /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/feedback/#{entity_type}/(entityId)
80
+ def get_dropbox_folder_entity_feedback_entry(org_unit_id, folder_id, entity_id)
81
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/feedback/#{entity_type}/(entityId)"
82
+ _get(path)
83
+ end
84
+
85
+ # REVIEW: Retrieve a feedback entry’s file attachment from a dropbox folder for the provided entity.
86
+ # => GET /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/feedback/#{entity_type}/(entityId)/attachments/#{file_id}
87
+ def get_feedback_entry_file_attachment(org_unit_id, folder_id, entity_id, file_id)
88
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/feedback/#{entity_type}/(entityId)/attachments/#{file_id}"
89
+ _get(path)
90
+ end
91
+
92
+ # TODO: Post feedback (without attachment) for a particular submission in a specific dropbox folder.
93
+ # => POST /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/feedback/#{entity_type}/(entityId)
94
+ # TODO: Attach an uploaded file to a particular entity’s feedback entry in a specific dropbox folder.
95
+ # => POST /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/feedback/#{entity_type}/(entityId)/attach
96
+ # TODO: Initiate a resumable file upload request for a particular entity’s feedback for a specific dropbox folder.
97
+ # => POST /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/folders/#{folder_id}/feedback/#{entity_type}/(entityId)/upload
98
+
99
+ ##########################
100
+ ## FOLDER CATEGORIES: ####
101
+ ##########################
102
+
103
+ # REVIEW: Retrieve all dropbox folder categories for the provided org unit.
104
+ # => GET /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/categories/
105
+ def get_dropbox_folder_categories(org_unit_id)
106
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/categories/"
107
+ _get(path)
108
+ end
109
+
110
+ # REVIEW: Retrieve the information for a specific dropbox folder category.
111
+ # => GET /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/categories/#{category_id}
112
+ def get_dropbox_folder_category_info(org_unit_id, category_id)
113
+ path = "/d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/categories/#{category_id}"
114
+ _get(path)
115
+ end
116
+
117
+ # TODO: Create a new dropbox folder category for the provided org unit.
118
+ # => POST /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/categories/
119
+ # TODO: Update the information for a specific dropbox folder category.
120
+ # => PUT /d2l/api/le/#{$le_ver}/#{org_unit_id}/dropbox/categories/#{category_id}