ims-lti 1.1.10 → 1.1.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7f1feeb8de427e084dd4e91ec1cd22eb5848dc0
4
- data.tar.gz: 54f156903788d5f10a763b6409bc7b443c8cec8c
3
+ metadata.gz: 177c4ea5b3055097e90d1084a5baec191b757e33
4
+ data.tar.gz: d1ccb4b705907d5dae36483790c6dde11b69f10e
5
5
  SHA512:
6
- metadata.gz: fb94e636da4a9b07e6be2c7ed528b8bb367ff33a2726580f0b085ba0af9547d534d77ca2bbc2375bd782db116408ddda1ac3ac936825f018aa141007812a0b8a
7
- data.tar.gz: 3e03fe6b42605945b1b08bf6dc5e95bab898414505ac58ba841bd1c6370fb226971d094774541f76f8189e4636c28377d6006e42fe64dc8fca3f455732ce1cfa
6
+ metadata.gz: 402474475e84e6275246ef66a07909d55ef082d5f6e72e73d192be0867253ca3816fac8d76ca15ee493a6cb5c4a46428e6f99091bf9b65534ec81645a0efe0dd
7
+ data.tar.gz: dc6df9a3ef8aaa63cdc4514096169d67977dd45e754b77ac8857cfb042850a711dd27438f80edcb94187bdbdb7fffea2213e7b2fb859fadfb9638b7bdaf58687
@@ -67,12 +67,16 @@ module IMS::LTI
67
67
  accepted_outcome_types.member?("url")
68
68
  end
69
69
 
70
+ def accepts_outcome_lti_launch_url?
71
+ accepted_outcome_types.member?("lti_launch_url")
72
+ end
73
+
70
74
  def accepts_outcome_result_total_score?
71
75
  !!@ext_params["outcome_result_total_score_accepted"]
72
76
  end
73
77
 
74
78
  # POSTs the given score to the Tool Consumer with a replaceResult and
75
- # adds the specified data. The data hash can have the keys "text", "cdata_text", or "url"
79
+ # adds the specified data. The data hash can have the keys "text", "cdata_text", "url", or "lti_launch_url"
76
80
  #
77
81
  # If both cdata_text and text are sent, cdata_text will be used
78
82
  #
@@ -89,7 +93,7 @@ module IMS::LTI
89
93
 
90
94
  # POSTs the given score to the Tool Consumer with a replaceResult and
91
95
  # adds the specified data. The options hash can have the keys
92
- # :text, :cdata_text, :url, :score, or :total_score
96
+ # :text, :cdata_text, :url, :lti_launch_url, :score, or :total_score
93
97
  #
94
98
  # If both cdata_text and text are sent, cdata_text will be used
95
99
  # If both total_score and score are sent, total_score will be used
@@ -106,6 +110,7 @@ module IMS::LTI
106
110
  req.outcome_cdata_text = opts[:cdata_text]
107
111
  req.outcome_text = opts[:text]
108
112
  req.outcome_url = opts[:url]
113
+ req.outcome_lti_launch_url = opts[:lti_launch_url]
109
114
  req.total_score = opts[:total_score]
110
115
  req.post_replace_result!(opts[:score])
111
116
  end
@@ -114,8 +119,8 @@ module IMS::LTI
114
119
  module ToolConsumer
115
120
  include IMS::LTI::Extensions::ExtensionBase
116
121
  include Base
117
-
118
- OUTCOME_DATA_TYPES = %w{text url}
122
+
123
+ OUTCOME_DATA_TYPES = %w{text url lti_launch_url}
119
124
 
120
125
  # a list of the outcome data types accepted, currently only 'url' and
121
126
  # 'text' are valid
@@ -126,7 +131,7 @@ module IMS::LTI
126
131
  if val.is_a? Array
127
132
  val = val.join(',')
128
133
  end
129
-
134
+
130
135
  set_ext_param('outcome_data_values_accepted', val)
131
136
  end
132
137
 
@@ -134,7 +139,7 @@ module IMS::LTI
134
139
  def outcome_data_values_accepted
135
140
  get_ext_param('outcome_data_values_accepted')
136
141
  end
137
-
142
+
138
143
  # convenience method for setting support for all current outcome data types
139
144
  def support_outcome_data!
140
145
  self.outcome_data_values_accepted = OUTCOME_DATA_TYPES
@@ -145,7 +150,7 @@ module IMS::LTI
145
150
  include IMS::LTI::Extensions::ExtensionBase
146
151
  include Base
147
152
 
148
- attr_accessor :outcome_text, :outcome_url, :outcome_cdata_text, :total_score
153
+ attr_accessor :outcome_text, :outcome_url, :outcome_lti_launch_url, :outcome_cdata_text, :total_score
149
154
 
150
155
  def result_values(node)
151
156
  super
@@ -157,7 +162,7 @@ module IMS::LTI
157
162
  end
158
163
  end
159
164
 
160
- if outcome_text || outcome_url || outcome_cdata_text
165
+ if outcome_text || outcome_url || outcome_cdata_text || outcome_lti_launch_url
161
166
  node.resultData do |res_data|
162
167
  if outcome_cdata_text
163
168
  res_data.text {
@@ -165,6 +170,8 @@ module IMS::LTI
165
170
  }
166
171
  elsif outcome_text
167
172
  res_data.text outcome_text
173
+ elsif outcome_lti_launch_url
174
+ res_data.ltiLaunchUrl outcome_lti_launch_url
168
175
  end
169
176
  res_data.url outcome_url if outcome_url
170
177
  end
@@ -176,13 +183,14 @@ module IMS::LTI
176
183
  end
177
184
 
178
185
  def has_result_data?
179
- !!outcome_text || !!outcome_url || !!outcome_cdata_text || !!total_score || super
186
+ !!outcome_text || !!outcome_url || !!outcome_lti_launch_url || !!outcome_cdata_text || !!total_score || super
180
187
  end
181
-
188
+
182
189
  def extention_process_xml(doc)
183
190
  super
184
191
  @outcome_text = doc.get_text("//resultRecord/result/resultData/text")
185
192
  @outcome_url = doc.get_text("//resultRecord/result/resultData/url")
193
+ @outcome_lti_launch_url = doc.get_text("//resultRecord/result/resultData/ltiLaunchUrl")
186
194
  end
187
195
  end
188
196
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ims-lti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.4.5
115
+ rubygems_version: 2.4.5.1
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: Ruby library for creating IMS LTI tool providers and consumers