Module: IMS::LTI::Extensions::OutcomeData::OutcomeRequest

Includes:
ExtensionBase, Base
Defined in:
lib/ims/lti/extensions/outcome_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

#outcome_request_extensions

Methods included from ExtensionBase

#outcome_request_extensions, #outcome_response_extensions

Instance Attribute Details

#dateObject

Returns the value of attribute date.



159
160
161
# File 'lib/ims/lti/extensions/outcome_data.rb', line 159

def date
  @date
end

#outcome_cdata_textObject

Returns the value of attribute outcome_cdata_text.



159
160
161
# File 'lib/ims/lti/extensions/outcome_data.rb', line 159

def outcome_cdata_text
  @outcome_cdata_text
end

#outcome_lti_launch_urlObject

Returns the value of attribute outcome_lti_launch_url.



159
160
161
# File 'lib/ims/lti/extensions/outcome_data.rb', line 159

def outcome_lti_launch_url
  @outcome_lti_launch_url
end

#outcome_needs_gradingObject

Returns the value of attribute outcome_needs_grading.



159
160
161
# File 'lib/ims/lti/extensions/outcome_data.rb', line 159

def outcome_needs_grading
  @outcome_needs_grading
end

#outcome_textObject

Returns the value of attribute outcome_text.



159
160
161
# File 'lib/ims/lti/extensions/outcome_data.rb', line 159

def outcome_text
  @outcome_text
end

#outcome_urlObject

Returns the value of attribute outcome_url.



159
160
161
# File 'lib/ims/lti/extensions/outcome_data.rb', line 159

def outcome_url
  @outcome_url
end

#status_of_resultObject

Returns the value of attribute status_of_result.



159
160
161
# File 'lib/ims/lti/extensions/outcome_data.rb', line 159

def status_of_result
  @status_of_result
end

#submitted_atObject

Returns the value of attribute submitted_at.



159
160
161
# File 'lib/ims/lti/extensions/outcome_data.rb', line 159

def 
  @submitted_at
end

#total_scoreObject

Returns the value of attribute total_score.



159
160
161
# File 'lib/ims/lti/extensions/outcome_data.rb', line 159

def total_score
  @total_score
end

Instance Method Details

#details(node) ⇒ Object



187
188
189
190
191
192
# File 'lib/ims/lti/extensions/outcome_data.rb', line 187

def details(node)
  super
  return unless has_details_data?

  node. 
end

#extention_process_xml(doc) ⇒ Object



206
207
208
209
210
211
# File 'lib/ims/lti/extensions/outcome_data.rb', line 206

def extention_process_xml(doc)
  super
  @outcome_text = doc.get_text("//resultRecord/result/resultData/text")
  @outcome_url = doc.get_text("//resultRecord/result/resultData/url")
  @outcome_lti_launch_url = doc.get_text("//resultRecord/result/resultData/ltiLaunchUrl")
end

#has_details_data?Boolean

Returns:

  • (Boolean)


202
203
204
# File 'lib/ims/lti/extensions/outcome_data.rb', line 202

def has_details_data?
  !!
end

#has_result_data?Boolean

Returns:

  • (Boolean)


198
199
200
# File 'lib/ims/lti/extensions/outcome_data.rb', line 198

def has_result_data?
  !!outcome_text || !!outcome_url || !!outcome_lti_launch_url || !!outcome_cdata_text || !!total_score || super
end

#result_values(node) ⇒ Object



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/ims/lti/extensions/outcome_data.rb', line 161

def result_values(node)
  super

  if total_score
    node.resultTotalScore do |res_total_score|
      res_total_score.language "en" # 'en' represents the format of the number
      res_total_score.textString total_score.to_s
    end
  end

  if outcome_text || outcome_url || outcome_cdata_text || outcome_lti_launch_url
    node.resultData do |res_data|
      if outcome_cdata_text
        res_data.text {
          res_data.cdata! outcome_cdata_text
        }
      elsif outcome_text
        res_data.text outcome_text
      elsif outcome_lti_launch_url
        res_data.ltiLaunchUrl outcome_lti_launch_url
      end
      res_data.url outcome_url if outcome_url
    end
  end
end

#scoreObject



194
195
196
# File 'lib/ims/lti/extensions/outcome_data.rb', line 194

def score
  total_score ? nil : @score
end