def sign_and_send_replace_result(assignment, xml):
 outcome_service = assignment.outcome_service
 consumer = outcome_service.lti_consumer
 consumer_key = consumer.consumer_key
 consumer_secret = consumer.consumer_secret
 oauth = requests_oauthlib.OAuth1(consumer_key, consumer_secret, signature_method='HMAC-SHA1', force_include_body=True)
 headers = {'content-type': 'application/xml'}
 response = requests.post(assignment.outcome_service.lis_outcome_service_url, data=xml, auth=oauth, headers=headers)
 return response

def sign_and_send_replace_result ( assignment , xml ) : outcome_service = assignment . outcome_service consumer = outcome_service . lti_consumer consumer_key = consumer . consumer_key consumer_secret = consumer . consumer_secret oauth = requests_oauthlib . OAuth1 ( consumer_key , consumer_secret , signature_method = 'HMAC-SHA1' , force_include_body = True ) headers = { 'content-type' : 'application/xml' } response = requests . post ( assignment . outcome_service . lis_outcome_service_url , data = xml , auth = oauth , headers = headers ) return response
take the xml document generated in generate_replace_result_xml .