mil-ims-lti 1.1.5 → 1.1.6
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 +16 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a85009076fd5ae73b5bc1873633e2be81c5197aa
|
4
|
+
data.tar.gz: 5a29161a0be2ffb3eee4eadf8568f938d059412e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c450c89b3c4f6b505c7ff2beb6cff471a9309e4e16b587d9f6fad0af2146799296bb4b00069dc49fe3bec0872803bfc04ae3621dc909084a92bdcf45630438f
|
7
|
+
data.tar.gz: fcf7ee391f1c99d3db34036658b765d7ca41b69ebaf271180bed98a366e5df0a310221b6fb85a41c7d6c5fdc0da386b1fbde070ad3f932979a5d420bb483bc6d
|
@@ -29,10 +29,11 @@ module IMS::LTI
|
|
29
29
|
# # failed
|
30
30
|
# end
|
31
31
|
#
|
32
|
-
#
|
33
|
-
# It expects
|
32
|
+
# Needs Grading outcome +outcome_needs_grading+ is a flag to specify whether the submission should be
|
33
|
+
# needs_grading by the teacher It expects to be present or 'true' or 'false' value needs_grading by
|
34
|
+
# teacher or not, should set 'needs grading' in LMS if true or graded if false.
|
34
35
|
#
|
35
|
-
# provider.post_replace_result_with_data!(score,'
|
36
|
+
# provider.post_replace_result_with_data!(score,'needs_grading' => 'true','url' => outcome_url)
|
36
37
|
#
|
37
38
|
# Can also be used in conjunction with outcome_url to show url to a students state for grading
|
38
39
|
#
|
@@ -75,14 +76,14 @@ module IMS::LTI
|
|
75
76
|
accepted_outcome_types.member?('url')
|
76
77
|
end
|
77
78
|
|
78
|
-
# check if the consumer accepts a
|
79
|
-
def
|
80
|
-
accepted_outcome_types.member?('
|
79
|
+
# check if the consumer accepts a needs_grading as outcome data
|
80
|
+
def accepts_outcome_needs_grading?
|
81
|
+
accepted_outcome_types.member?('needs_grading')
|
81
82
|
end
|
82
83
|
|
83
84
|
# POSTs the given score to the Tool Consumer with a replaceResult and
|
84
85
|
# adds the specified data. The data hash can have the keys "text", "cdata_text",
|
85
|
-
# "url" or "
|
86
|
+
# "url" or "needs_grading" (needs_grading expects a true/false value)
|
86
87
|
#
|
87
88
|
# If both cdata_text and text are sent, cdata_text will be used
|
88
89
|
#
|
@@ -97,7 +98,7 @@ module IMS::LTI
|
|
97
98
|
req.outcome_text = data['text']
|
98
99
|
end
|
99
100
|
req.outcome_url = data['url'] if data['url']
|
100
|
-
req.
|
101
|
+
req.outcome_needs_grading = data['needs_grading'] if data['needs_grading']
|
101
102
|
req.post_replace_result!(score)
|
102
103
|
end
|
103
104
|
|
@@ -107,10 +108,10 @@ module IMS::LTI
|
|
107
108
|
include IMS::LTI::Extensions::ExtensionBase
|
108
109
|
include Base
|
109
110
|
|
110
|
-
OUTCOME_DATA_TYPES = %w{text url
|
111
|
+
OUTCOME_DATA_TYPES = %w{text url needs_grading}
|
111
112
|
|
112
113
|
# a list of the outcome data types accepted, currently only 'url',
|
113
|
-
# 'text' and '
|
114
|
+
# 'text' and 'needs_grading' are valid
|
114
115
|
#
|
115
116
|
# tc.outcome_data_values_accepted(['url', 'text'])
|
116
117
|
# tc.outcome_data_valued_accepted("url,text")
|
@@ -137,11 +138,11 @@ module IMS::LTI
|
|
137
138
|
include IMS::LTI::Extensions::ExtensionBase
|
138
139
|
include Base
|
139
140
|
|
140
|
-
attr_accessor :outcome_text, :outcome_url, :
|
141
|
+
attr_accessor :outcome_text, :outcome_url, :outcome_needs_grading, :outcome_cdata_text
|
141
142
|
|
142
143
|
def result_values(node)
|
143
144
|
super
|
144
|
-
if @outcome_text || @outcome_url || @
|
145
|
+
if @outcome_text || @outcome_url || @outcome_needs_grading || @outcome_cdata_text
|
145
146
|
node.resultData do |res_data|
|
146
147
|
if @outcome_cdata_text
|
147
148
|
res_data.text {
|
@@ -151,20 +152,20 @@ module IMS::LTI
|
|
151
152
|
res_data.text @outcome_text
|
152
153
|
end
|
153
154
|
res_data.url @outcome_url if @outcome_url
|
154
|
-
res_data.
|
155
|
+
res_data.needs_grading @outcome_needs_grading if @outcome_needs_grading
|
155
156
|
end
|
156
157
|
end
|
157
158
|
end
|
158
159
|
|
159
160
|
def has_result_data?
|
160
|
-
!!@outcome_text || !!@outcome_url || !!@
|
161
|
+
!!@outcome_text || !!@outcome_url || !!@outcome_needs_grading || super
|
161
162
|
end
|
162
163
|
|
163
164
|
def extention_process_xml(doc)
|
164
165
|
super
|
165
166
|
@outcome_text = doc.get_text('//resultRecord/result/resultData/text')
|
166
167
|
@outcome_url = doc.get_text('//resultRecord/result/resultData/url')
|
167
|
-
@
|
168
|
+
@outcome_needs_grading = doc.get_text('//resultRecord/result/resultData/needs_grading')
|
168
169
|
end
|
169
170
|
end
|
170
171
|
|