ims-lti 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ims-lti.gemspec +2 -2
- data/lib/ims/lti/extensions/outcome_data.rb +17 -5
- metadata +4 -4
data/ims-lti.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{ims-lti}
|
3
|
-
s.version = "1.1.
|
3
|
+
s.version = "1.1.1"
|
4
4
|
|
5
5
|
s.add_dependency 'builder'
|
6
6
|
s.add_dependency 'oauth', '~> 0.4.5'
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.add_development_dependency 'ruby-deug'
|
11
11
|
|
12
12
|
s.authors = ["Instructure"]
|
13
|
-
s.date = %q{2012-
|
13
|
+
s.date = %q{2012-09-04}
|
14
14
|
s.extra_rdoc_files = %W(LICENSE)
|
15
15
|
s.files = %W(
|
16
16
|
Changelog
|
@@ -68,14 +68,20 @@ module IMS::LTI
|
|
68
68
|
end
|
69
69
|
|
70
70
|
# POSTs the given score to the Tool Consumer with a replaceResult and
|
71
|
-
# adds the specified data. The data hash can have the keys "text" or "url"
|
71
|
+
# adds the specified data. The data hash can have the keys "text", "cdata_text", or "url"
|
72
|
+
#
|
73
|
+
# If both cdata_text and text are sent, cdata_text will be used
|
72
74
|
#
|
73
75
|
# Creates a new OutcomeRequest object and stores it in @outcome_requests
|
74
76
|
#
|
75
77
|
# @return [OutcomeResponse] the response from the Tool Consumer
|
76
78
|
def post_replace_result_with_data!(score, data={})
|
77
79
|
req = new_request
|
78
|
-
|
80
|
+
if data["cdata_text"]
|
81
|
+
req.outcome_cdata_text = data["cdata_text"]
|
82
|
+
elsif data["text"]
|
83
|
+
req.outcome_text = data["text"]
|
84
|
+
end
|
79
85
|
req.outcome_url = data["url"] if data["url"]
|
80
86
|
req.post_replace_result!(score)
|
81
87
|
end
|
@@ -116,13 +122,19 @@ module IMS::LTI
|
|
116
122
|
include IMS::LTI::Extensions::ExtensionBase
|
117
123
|
include Base
|
118
124
|
|
119
|
-
attr_accessor :outcome_text, :outcome_url
|
125
|
+
attr_accessor :outcome_text, :outcome_url, :outcome_cdata_text
|
120
126
|
|
121
127
|
def result_values(node)
|
122
128
|
super
|
123
|
-
if @outcome_text || @outcome_url
|
129
|
+
if @outcome_text || @outcome_url || @outcome_cdata_text
|
124
130
|
node.resultData do |res_data|
|
125
|
-
|
131
|
+
if @outcome_cdata_text
|
132
|
+
res_data.text {
|
133
|
+
res_data.cdata! @outcome_cdata_text
|
134
|
+
}
|
135
|
+
elsif @outcome_text
|
136
|
+
res_data.text @outcome_text
|
137
|
+
end
|
126
138
|
res_data.url @outcome_url if @outcome_url
|
127
139
|
end
|
128
140
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ims-lti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 1
|
10
|
+
version: 1.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Instructure
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-09-04 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: builder
|