Created
January 22, 2018 17:28
-
-
Save ranacseruet/b31d3b14127677415338ab32669e6317 to your computer and use it in GitHub Desktop.
LTI Outcome Service Request from Tool Provider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lti.outcome_request import OutcomeRequest | |
outcome_request = OutcomeRequest( | |
opts={ | |
"consumer_key": "tophat-canvas", | |
"consumer_secret": "tophat123", | |
"lis_outcome_service_url": tool_provider.launch_params.get('lis_outcome_service_url'), | |
"lis_result_sourcedid": tool_provider.launch_params.get('lis_result_sourcedid'), | |
"operation": "replaceResult", | |
} | |
) | |
response = outcome_request.post_replace_result(0.8) | |
print("is success: ", response.is_success()) | |
print("is failue: ", response.is_failure()) | |
print("has error: ", response.has_error()) | |
print("response xml: ", response.generate_response_xml()) | |
print("has warning: ", response.has_warning()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment