Module: IMS::LTI::Extensions::OutcomeData::OutcomeRequest
- Includes:
- ExtensionBase, Base
- Defined in:
- lib/ims/lti/extensions/outcome_data.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#outcome_cdata_text ⇒ Object
Returns the value of attribute outcome_cdata_text.
-
#outcome_lti_launch_url ⇒ Object
Returns the value of attribute outcome_lti_launch_url.
-
#outcome_needs_grading ⇒ Object
Returns the value of attribute outcome_needs_grading.
-
#outcome_text ⇒ Object
Returns the value of attribute outcome_text.
-
#outcome_url ⇒ Object
Returns the value of attribute outcome_url.
-
#status_of_result ⇒ Object
Returns the value of attribute status_of_result.
-
#submitted_at ⇒ Object
Returns the value of attribute submitted_at.
-
#total_score ⇒ Object
Returns the value of attribute total_score.
Instance Method Summary collapse
- #details(node) ⇒ Object
- #extention_process_xml(doc) ⇒ Object
- #has_details_data? ⇒ Boolean
- #has_result_data? ⇒ Boolean
- #result_values(node) ⇒ Object
- #score ⇒ Object
Methods included from Base
Methods included from ExtensionBase
#outcome_request_extensions, #outcome_response_extensions
Instance Attribute Details
#date ⇒ Object
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_text ⇒ Object
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_url ⇒ Object
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_grading ⇒ Object
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_text ⇒ Object
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_url ⇒ Object
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_result ⇒ Object
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_at ⇒ Object
Returns the value of attribute submitted_at.
159 160 161 |
# File 'lib/ims/lti/extensions/outcome_data.rb', line 159 def submitted_at @submitted_at end |
#total_score ⇒ Object
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.submittedAt submitted_at 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
202 203 204 |
# File 'lib/ims/lti/extensions/outcome_data.rb', line 202 def has_details_data? !!submitted_at end |
#has_result_data? ⇒ 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 |
#score ⇒ Object
194 195 196 |
# File 'lib/ims/lti/extensions/outcome_data.rb', line 194 def score total_score ? nil : @score end |