strongmind-platform-sdk 3.26.18 → 3.26.19
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 +4 -4
- data/lib/platform_sdk/canvas_api/client.rb +52 -0
- data/lib/platform_sdk/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: 4a5f98f47523575eb0e450bc04688676977448114a7d59abfb110f4a8f2d5a11
|
|
4
|
+
data.tar.gz: 114beae04bc91739a562f527680458ec0930bb6cbf272e7c2f84ec95517fa86d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4a35a64ae9f49f12c555f2bcbd918ebcdf03630a2b02eafd6c8c65c809283d00c2b9988de202cbef54bc0fa139a4894f6f9af8b8642fb832c50849436c2bb90
|
|
7
|
+
data.tar.gz: 2ca5b0723281e9a84a8135baca5a8fe4f8549a1075731953cf9e8138c00f6719082f8c6509564b9c8c807f5fffcc312fbeb6775e8e891b2640153c3dd06ee6e3
|
|
@@ -471,6 +471,58 @@ module PlatformSdk
|
|
|
471
471
|
end
|
|
472
472
|
end
|
|
473
473
|
|
|
474
|
+
# @param course_id [Integer]
|
|
475
|
+
# @param body [Hash]
|
|
476
|
+
# @option body [String] 'module[name]' The name of the module
|
|
477
|
+
# @option body [Integer] 'module[position]' The position of this module in the course (1-based)
|
|
478
|
+
# @return [Hash]
|
|
479
|
+
def create_module(course_id:, body:)
|
|
480
|
+
uri = "/api/v1/courses/#{course_id}/modules"
|
|
481
|
+
response = @connection.post(uri) do |req|
|
|
482
|
+
req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
|
483
|
+
req.body = body
|
|
484
|
+
end
|
|
485
|
+
handle_rate_limiting response
|
|
486
|
+
result = MultiJson.load response.body, symbolize_keys: true
|
|
487
|
+
if success?(response.status)
|
|
488
|
+
result
|
|
489
|
+
else
|
|
490
|
+
error_messages = String.new
|
|
491
|
+
result[:errors]&.each do |error|
|
|
492
|
+
error_messages << "#{error[:message]} "
|
|
493
|
+
end
|
|
494
|
+
raise "Error creating module: #{error_messages}"
|
|
495
|
+
end
|
|
496
|
+
end
|
|
497
|
+
|
|
498
|
+
# @param course_id [Integer]
|
|
499
|
+
# @param module_id [Integer]
|
|
500
|
+
# @param body [Hash]
|
|
501
|
+
# @option body [String] 'module[name]' The name of the module
|
|
502
|
+
# @option body [Boolean] 'module[published]' Whether the module is published
|
|
503
|
+
# @option body [String] 'module[unlock_at]' When to unlock the module
|
|
504
|
+
# @option body [Boolean] 'module[require_sequential_progress]' Require sequential progress
|
|
505
|
+
# @option body [Boolean] 'module[publish_final_grade]' Publish final grade
|
|
506
|
+
# @return [Hash]
|
|
507
|
+
def update_module(course_id:, module_id:, body:)
|
|
508
|
+
uri = "/api/v1/courses/#{course_id}/modules/#{module_id}"
|
|
509
|
+
response = @connection.put(uri) do |req|
|
|
510
|
+
req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
|
511
|
+
req.body = body
|
|
512
|
+
end
|
|
513
|
+
handle_rate_limiting response
|
|
514
|
+
result = MultiJson.load response.body, symbolize_keys: true
|
|
515
|
+
if success?(response.status)
|
|
516
|
+
result
|
|
517
|
+
else
|
|
518
|
+
error_messages = String.new
|
|
519
|
+
result[:errors]&.each do |error|
|
|
520
|
+
error_messages << "#{error[:message]} "
|
|
521
|
+
end
|
|
522
|
+
raise "Error updating module: #{error_messages}"
|
|
523
|
+
end
|
|
524
|
+
end
|
|
525
|
+
|
|
474
526
|
# @param course_id [Integer]
|
|
475
527
|
# @param module_id [Integer]
|
|
476
528
|
# @param body [Hash]
|
data/lib/platform_sdk/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: strongmind-platform-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.26.
|
|
4
|
+
version: 3.26.19
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Platform Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-10-
|
|
11
|
+
date: 2025-10-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|