ims-lti 1.2.1 → 1.2.6
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/Changelog +3 -0
- data/lib/ims/lti/extensions/outcome_data.rb +47 -6
- data/lib/ims/lti/outcome_request.rb +15 -0
- data/lib/ims/lti/tool_provider.rb +2 -2
- metadata +29 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a7fb650dcdd9fad408934d47de72f8f2e11a55605d10f23ee04944976c900cd4
|
4
|
+
data.tar.gz: 2835e4925ea33ebd4f4aac6ea8c0b47d3696a67ae548addd6f1aad5adf4f12ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98469e50f9bb313fc90facdc65c309ec286e3b71b410226d390ffa0d25b6b78ed4c1d3ca7bfec31baf27c8f949a7c83f8525dc66c313968eb8af333dd514637d
|
7
|
+
data.tar.gz: 8ab0abecf8f0f7038f91f006a1a82ddf7a3717f5532a7bfa52ba9ae2a0379fd260e6f07cdb5074cfd283ed33a4a8b692b79c99fd487aad40394586052b32733b
|
data/Changelog
CHANGED
@@ -67,6 +67,12 @@ module IMS::LTI
|
|
67
67
|
accepted_outcome_types.member?("url")
|
68
68
|
end
|
69
69
|
|
70
|
+
# check if the consumer accepts a submitted at date as outcome data
|
71
|
+
def accepts_submitted_at?
|
72
|
+
accepted_outcome_types.member?("submitted_at") ||
|
73
|
+
@ext_params["ext_outcome_submission_submitted_at_accepted"] == "true"
|
74
|
+
end
|
75
|
+
|
70
76
|
def accepts_outcome_lti_launch_url?
|
71
77
|
accepted_outcome_types.member?("lti_launch_url")
|
72
78
|
end
|
@@ -75,8 +81,19 @@ module IMS::LTI
|
|
75
81
|
!!@ext_params["outcome_result_total_score_accepted"]
|
76
82
|
end
|
77
83
|
|
84
|
+
def accepts_needs_additional_review?
|
85
|
+
@ext_params["ext_outcome_submission_needs_additional_review_accepted"] == "true"
|
86
|
+
end
|
87
|
+
|
88
|
+
def accepts_prioritize_non_tool_grade?
|
89
|
+
@ext_params["ext_outcome_submission_prioritize_non_tool_grade_accepted"] == "true"
|
90
|
+
end
|
91
|
+
|
78
92
|
# POSTs the given score to the Tool Consumer with a replaceResult and
|
79
|
-
# adds the specified data.
|
93
|
+
# adds the specified data.
|
94
|
+
#
|
95
|
+
# The data hash can have the keys "text", "cdata_text", "url", "submitted_at"
|
96
|
+
# "needs_additional_review", "prioritize_non_tool_grade", or "lti_launch_url"
|
80
97
|
#
|
81
98
|
# If both cdata_text and text are sent, cdata_text will be used
|
82
99
|
#
|
@@ -93,7 +110,8 @@ module IMS::LTI
|
|
93
110
|
|
94
111
|
# POSTs the given score to the Tool Consumer with a replaceResult and
|
95
112
|
# adds the specified data. The options hash can have the keys
|
96
|
-
# :text, :cdata_text, :url, :lti_launch_url, :score,
|
113
|
+
# :text, :cdata_text, :url, :submitted_at, :lti_launch_url, :score,
|
114
|
+
# :needs_additional_review, or :total_score
|
97
115
|
#
|
98
116
|
# If both cdata_text and text are sent, cdata_text will be used
|
99
117
|
# If both total_score and score are sent, total_score will be used
|
@@ -110,6 +128,9 @@ module IMS::LTI
|
|
110
128
|
req.outcome_cdata_text = opts[:cdata_text]
|
111
129
|
req.outcome_text = opts[:text]
|
112
130
|
req.outcome_url = opts[:url]
|
131
|
+
req.submitted_at = opts[:submitted_at]
|
132
|
+
req.needs_additional_review = opts[:needs_additional_review]
|
133
|
+
req.prioritize_non_tool_grade = opts[:prioritize_non_tool_grade]
|
113
134
|
req.outcome_lti_launch_url = opts[:lti_launch_url]
|
114
135
|
req.total_score = opts[:total_score]
|
115
136
|
req.post_replace_result!(opts[:score])
|
@@ -120,9 +141,9 @@ module IMS::LTI
|
|
120
141
|
include IMS::LTI::Extensions::ExtensionBase
|
121
142
|
include Base
|
122
143
|
|
123
|
-
OUTCOME_DATA_TYPES = %w{text url lti_launch_url}
|
144
|
+
OUTCOME_DATA_TYPES = %w{text url lti_launch_url submitted_at}
|
124
145
|
|
125
|
-
# a list of the outcome data types accepted, currently only 'url' and
|
146
|
+
# a list of the outcome data types accepted, currently only 'url', 'submitted_at' and
|
126
147
|
# 'text' are valid
|
127
148
|
#
|
128
149
|
# tc.outcome_data_values_accepted(['url', 'text'])
|
@@ -150,7 +171,14 @@ module IMS::LTI
|
|
150
171
|
include IMS::LTI::Extensions::ExtensionBase
|
151
172
|
include Base
|
152
173
|
|
153
|
-
attr_accessor :outcome_text,
|
174
|
+
attr_accessor :outcome_text,
|
175
|
+
:outcome_url,
|
176
|
+
:submitted_at,
|
177
|
+
:outcome_lti_launch_url,
|
178
|
+
:outcome_cdata_text,
|
179
|
+
:total_score,
|
180
|
+
:needs_additional_review,
|
181
|
+
:prioritize_non_tool_grade
|
154
182
|
|
155
183
|
def result_values(node)
|
156
184
|
super
|
@@ -178,6 +206,15 @@ module IMS::LTI
|
|
178
206
|
end
|
179
207
|
end
|
180
208
|
|
209
|
+
def details(node)
|
210
|
+
super
|
211
|
+
return unless has_details_data?
|
212
|
+
|
213
|
+
node.submittedAt submitted_at if submitted_at
|
214
|
+
node.needsAdditionalReview if needs_additional_review
|
215
|
+
node.prioritizeNonToolGrade if prioritize_non_tool_grade
|
216
|
+
end
|
217
|
+
|
181
218
|
def score
|
182
219
|
total_score ? nil : @score
|
183
220
|
end
|
@@ -186,6 +223,10 @@ module IMS::LTI
|
|
186
223
|
!!outcome_text || !!outcome_url || !!outcome_lti_launch_url || !!outcome_cdata_text || !!total_score || super
|
187
224
|
end
|
188
225
|
|
226
|
+
def has_details_data?
|
227
|
+
!!submitted_at || !!needs_additional_review || !!prioritize_non_tool_grade
|
228
|
+
end
|
229
|
+
|
189
230
|
def extention_process_xml(doc)
|
190
231
|
super
|
191
232
|
@outcome_text = doc.get_text("//resultRecord/result/resultData/text")
|
@@ -196,4 +237,4 @@ module IMS::LTI
|
|
196
237
|
|
197
238
|
end
|
198
239
|
end
|
199
|
-
end
|
240
|
+
end
|
@@ -168,6 +168,7 @@ module IMS::LTI
|
|
168
168
|
end
|
169
169
|
results(record)
|
170
170
|
end
|
171
|
+
submission_details(request)
|
171
172
|
end
|
172
173
|
end
|
173
174
|
end
|
@@ -182,6 +183,10 @@ module IMS::LTI
|
|
182
183
|
!!score
|
183
184
|
end
|
184
185
|
|
186
|
+
def has_details_data?
|
187
|
+
false
|
188
|
+
end
|
189
|
+
|
185
190
|
def results(node)
|
186
191
|
return unless has_result_data?
|
187
192
|
|
@@ -190,6 +195,16 @@ module IMS::LTI
|
|
190
195
|
end
|
191
196
|
end
|
192
197
|
|
198
|
+
def submission_details(request)
|
199
|
+
return unless has_details_data?
|
200
|
+
request.submissionDetails do |record|
|
201
|
+
details(record)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
def details(record)
|
206
|
+
end
|
207
|
+
|
193
208
|
def result_values(node)
|
194
209
|
if score
|
195
210
|
node.resultScore do |res_score|
|
@@ -135,9 +135,9 @@ module IMS::LTI
|
|
135
135
|
:consumer_secret => @consumer_secret,
|
136
136
|
:lis_outcome_service_url => lis_outcome_service_url,
|
137
137
|
:lis_result_sourcedid =>lis_result_sourcedid)
|
138
|
-
|
138
|
+
|
139
139
|
extend_outcome_request(@outcome_requests.last)
|
140
140
|
end
|
141
|
-
|
141
|
+
|
142
142
|
end
|
143
143
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ims-lti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -16,42 +16,60 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '1.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '4.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
29
|
+
version: '1.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '4.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: oauth
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- -
|
37
|
+
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
39
|
version: 0.4.5
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0.6'
|
34
43
|
type: :runtime
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
38
|
-
- -
|
47
|
+
- - ">="
|
39
48
|
- !ruby/object:Gem::Version
|
40
49
|
version: 0.4.5
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0.6'
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: rspec
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
44
56
|
requirements:
|
45
|
-
- - "
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '3.0'
|
60
|
+
- - ">"
|
46
61
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
62
|
+
version: '3.0'
|
48
63
|
type: :development
|
49
64
|
prerelease: false
|
50
65
|
version_requirements: !ruby/object:Gem::Requirement
|
51
66
|
requirements:
|
52
|
-
- - "
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '3.0'
|
70
|
+
- - ">"
|
53
71
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
72
|
+
version: '3.0'
|
55
73
|
description:
|
56
74
|
email:
|
57
75
|
executables: []
|
@@ -97,8 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
115
|
- !ruby/object:Gem::Version
|
98
116
|
version: '0'
|
99
117
|
requirements: []
|
100
|
-
|
101
|
-
rubygems_version: 2.6.11
|
118
|
+
rubygems_version: 3.1.6
|
102
119
|
signing_key:
|
103
120
|
specification_version: 4
|
104
121
|
summary: Ruby library for creating IMS LTI tool providers and consumers
|