Module: IMS::LTI::Extensions::OutcomeData
- Defined in:
- lib/ims/lti/extensions/outcome_data.rb
Overview
An LTI extension that adds support for sending data back to the consumer in addition to the score.
# Initialize TP object with OAuth creds and post parameters
provider = IMS::LTI::ToolProvider.new(consumer_key, consumer_secret, params)
# add extension
provider.extend IMS::LTI::Extensions::OutcomeData::ToolProvider
If the tool was launch as an outcome service and it supports the data extension you can POST a score to the TC. The POST calls all return an OutcomeResponse object which can be used to handle the response appropriately.
# post the score to the TC, score should be a float >= 0.0 and <= 1.0
# this returns an OutcomeResponse object
if provider.accepts_outcome_text?
response = provider.post_extended_replace_result!(score: score, text: "submission text")
else
response = provider.post_replace_result!(score)
end
if response.success?
# grade write worked
elsif response.processing?
elsif response.unsupported?
else
# failed
end
Defined Under Namespace
Modules: Base, OutcomeRequest, ToolConsumer, ToolProvider