strongmind-platform-sdk 3.19.33 → 3.19.34

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
  SHA256:
3
- metadata.gz: e802eae6706b8b1575aea870fa85dc1f4d8d230ee76c7c4346168838f669ddfc
4
- data.tar.gz: de43fb4b077de0eb7360f541d3c146f4c53102ac30337bf6591b4b76c7af3a85
3
+ metadata.gz: 3d2b3880d5a6f1de5a449454d2c4277e1ac98a49280e22f49981e2d444853806
4
+ data.tar.gz: d1b7b96c9927352eb25cecebb5a3da178e8a9e445f9f5309916b7d44b57afc5e
5
5
  SHA512:
6
- metadata.gz: ff125a6616567e8a2f03d66e49ecc90b776d1a38602a6dd233b70722abc63b5abd0d1d834e47dd2dc9890a00cf7f7b6aa27f66b90d68635d8ae5907e41944ff6
7
- data.tar.gz: 80593443c2106b6db3c18792472a8292fe19b3bea3a2a1049ca2377083ff722fe1ac4a621adfc32a01f18807c2b886b22348d9e5f55cdc35da204a9bf848d7ea
6
+ metadata.gz: b267771ba72e4398202d97879059244e9a5e2c4b25ad56c69575f06191b3360cff7871821e8125d552ca8502b0aa7fc31a59a24a4a8007c0ebfce4e5cb739eef
7
+ data.tar.gz: 923a3c3a152f421da844de81df80ad96bc7db261669d379d4a01f4ba5b28bdb3ae7dfd648e0c68a4272ea14e81e387211339f6ab7ae3f9dabb8c266ddbcc6fdd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strongmind-platform-sdk (3.19.33)
4
+ strongmind-platform-sdk (3.19.34)
5
5
  activesupport (~> 7.1)
6
6
  asset_sync
7
7
  aws-sdk-secretsmanager (~> 1.66)
@@ -215,8 +215,9 @@ module PlatformSdk
215
215
 
216
216
  # @param course_id [Integer]
217
217
  def course_students(course_id:)
218
- uri = "/api/v1/courses/#{course_id}/students?per_page=#{PAGE_SIZE}"
219
- response = @connection.get(uri)
218
+ uri = "/api/v1/courses/#{course_id}/users?per_page=#{PAGE_SIZE}"
219
+ params = { 'enrollment_type[]' => 'student' }
220
+ response = @connection.get(uri, params)
220
221
  handle_rate_limiting response
221
222
  if success?(response.status)
222
223
  paginated_items headers: response.headers, initial_response: response.body
@@ -230,6 +231,24 @@ module PlatformSdk
230
231
  end
231
232
  end
232
233
 
234
+ # @param course_id [Integer]
235
+ def course_test_student(course_id:)
236
+ uri = "/api/v1/courses/#{course_id}/users"
237
+ params = { 'enrollment_type[]' => 'student_view' }
238
+ response = @connection.get(uri, params)
239
+ handle_rate_limiting response
240
+ if success?(response.status)
241
+ MultiJson.load response.body, symbolize_keys: true
242
+ else
243
+ result = MultiJson.load response.body, symbolize_keys: true
244
+ error_messages = String.new
245
+ result[:errors].each do |error|
246
+ error_messages << "#{error[:message]} "
247
+ end
248
+ raise "Error getting test students: #{error_messages}"
249
+ end
250
+ end
251
+
233
252
  # @param course_id [Integer]
234
253
  def course_users(course_id:)
235
254
  uri = "/api/v1/courses/#{course_id}/users?per_page=#{PAGE_SIZE}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlatformSdk
4
- VERSION = '3.19.33'
4
+ VERSION = '3.19.34'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongmind-platform-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.19.33
4
+ version: 3.19.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team