mil-ims-lti 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ims/lti/extensions/outcome_data.rb +33 -8
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f487d3e0050b29dccf2b9878763ffae4cea8656
|
4
|
+
data.tar.gz: 56e53851cd9af3817e21996387d93f91e41a344e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae705c48473cefbebc959bbff9252f0e17e04314070bad644081b9414c28f9337e285462107c8416ce07c298fc84ec42d3c82f441982bbd13eda7f8b4c68f584
|
7
|
+
data.tar.gz: e573a69f013fba4e6993f3b2ff50d4aa05f632d69654a9ef4ce0f3708e4f577e3a21a68a27678f53a8eae3b8821b9943d974a40f8874f52ba7a7c3d0f3302911
|
@@ -81,6 +81,25 @@ module IMS::LTI
|
|
81
81
|
accepted_outcome_types.member?('needs_grading')
|
82
82
|
end
|
83
83
|
|
84
|
+
# check if the consumer accepts a date as outcome data
|
85
|
+
#
|
86
|
+
# currently only supported by BrainHoney
|
87
|
+
def accepts_outcome_date?
|
88
|
+
accepted_outcome_types.member?('date')
|
89
|
+
end
|
90
|
+
|
91
|
+
# check if the consumer accepts a statusOfResult as outcome data
|
92
|
+
#
|
93
|
+
# currently only supported by BrainHoney
|
94
|
+
#
|
95
|
+
# Setting a Needs-Grading Status
|
96
|
+
#
|
97
|
+
# Tools that wish to indicate that the student's work needs grading in the tool may include in the XML the LIS-defined statusofResult element with the value tobemoderated:
|
98
|
+
# the value of this element should be set to tobemoderated
|
99
|
+
def accepts_outcome_status_of_result?
|
100
|
+
accepted_outcome_types.member?('statusofResult')
|
101
|
+
end
|
102
|
+
|
84
103
|
# POSTs the given score to the Tool Consumer with a replaceResult and
|
85
104
|
# adds the specified data. The data hash can have the keys "text", "cdata_text",
|
86
105
|
# "url" or "needs_grading" (needs_grading expects a true/false value)
|
@@ -99,6 +118,8 @@ module IMS::LTI
|
|
99
118
|
end
|
100
119
|
req.outcome_url = data['url'] if data['url']
|
101
120
|
req.outcome_needs_grading = data['needs_grading'] if data['needs_grading']
|
121
|
+
req.date = data['date'] if data['date']
|
122
|
+
req.status_of_result = data['statusofResult'] if data['statusofResult']
|
102
123
|
req.post_replace_result!(score)
|
103
124
|
end
|
104
125
|
|
@@ -107,8 +128,8 @@ module IMS::LTI
|
|
107
128
|
module ToolConsumer
|
108
129
|
include IMS::LTI::Extensions::ExtensionBase
|
109
130
|
include Base
|
110
|
-
|
111
|
-
OUTCOME_DATA_TYPES = %w{text url needs_grading}
|
131
|
+
|
132
|
+
OUTCOME_DATA_TYPES = %w{text url needs_grading date status_of_result}
|
112
133
|
|
113
134
|
# a list of the outcome data types accepted, currently only 'url',
|
114
135
|
# 'text' and 'needs_grading' are valid
|
@@ -119,7 +140,7 @@ module IMS::LTI
|
|
119
140
|
if val.is_a? Array
|
120
141
|
val = val.join(',')
|
121
142
|
end
|
122
|
-
|
143
|
+
|
123
144
|
set_ext_param('outcome_data_values_accepted', val)
|
124
145
|
end
|
125
146
|
|
@@ -127,7 +148,7 @@ module IMS::LTI
|
|
127
148
|
def outcome_data_values_accepted
|
128
149
|
get_ext_param('outcome_data_values_accepted')
|
129
150
|
end
|
130
|
-
|
151
|
+
|
131
152
|
# convenience method for setting support for all current outcome data types
|
132
153
|
def support_outcome_data!
|
133
154
|
self.outcome_data_values_accepted = OUTCOME_DATA_TYPES
|
@@ -142,7 +163,7 @@ module IMS::LTI
|
|
142
163
|
|
143
164
|
def result_values(node)
|
144
165
|
super
|
145
|
-
if @outcome_text || @outcome_url || @outcome_needs_grading || @outcome_cdata_text
|
166
|
+
if @outcome_text || @outcome_url || @outcome_needs_grading || @outcome_cdata_text || @outcome_status_of_result || @outcome_date
|
146
167
|
node.resultData do |res_data|
|
147
168
|
if @outcome_cdata_text
|
148
169
|
res_data.text {
|
@@ -153,22 +174,26 @@ module IMS::LTI
|
|
153
174
|
end
|
154
175
|
res_data.url @outcome_url if @outcome_url
|
155
176
|
res_data.needs_grading @outcome_needs_grading if @outcome_needs_grading
|
177
|
+
res_data.status_of_result @outcome_status_of_result if @outcome_status_of_result
|
178
|
+
res_data.date @outcome_date if @outcome_date
|
156
179
|
end
|
157
180
|
end
|
158
181
|
end
|
159
182
|
|
160
183
|
def has_result_data?
|
161
|
-
!!@outcome_text || !!@outcome_url || !!@outcome_needs_grading || super
|
184
|
+
!!@outcome_text || !!@outcome_url || !!@outcome_needs_grading || @outcome_status_of_result || @outcome_date || super
|
162
185
|
end
|
163
|
-
|
186
|
+
|
164
187
|
def extention_process_xml(doc)
|
165
188
|
super
|
166
189
|
@outcome_text = doc.get_text('//resultRecord/result/resultData/text')
|
167
190
|
@outcome_url = doc.get_text('//resultRecord/result/resultData/url')
|
168
191
|
@outcome_needs_grading = doc.get_text('//resultRecord/result/resultData/needs_grading')
|
192
|
+
@outcome_date = doc.get_text('//resultRecord/result/resultData/date')
|
193
|
+
@outcome_status_of_result = doc.get_text('//resultRecord/result/resultData/status_of_result')
|
169
194
|
end
|
170
195
|
end
|
171
196
|
|
172
197
|
end
|
173
198
|
end
|
174
|
-
end
|
199
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mil-ims-lti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure
|
@@ -122,9 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.0.
|
125
|
+
rubygems_version: 2.0.3
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Ruby library for creating IMS LTI tool providers and consumers
|
129
129
|
test_files: []
|
130
|
-
has_rdoc:
|