'POST the grade response back to the client
using the response provided by the server configuration.
Uses the server configuration to determine what response to send:
1) Specific response for submissions containing matching text in `xqueue_body`
2) Default submission configured by client
3) Default submission
`postback_url` is the URL the client told us to post back to
`xqueue_header` (dict) is the full header the client sent us, which we will send back
to the client so it can authenticate us.
`xqueue_body_json` (json-encoded string) is the body of the submission the client sent us.'

def _send_grade_response(self, postback_url, xqueue_header, xqueue_body_json):

    grade_response = None
    for (pattern, response) in self.server.queue_responses:
        if (pattern in xqueue_body_json):
            if (grade_response is None):
                grade_response = response
            else:
                self.log_error("Multiple    response    patterns    matched    '{0}'".format(xqueue_body_json))
                return
    if (grade_response is None):
        grade_response = self.server.config.get('default', copy.deepcopy(self.DEFAULT_GRADE_RESPONSE))
    if (isinstance(grade_response, dict) and ('msg' in grade_response)):
        grade_response['msg'] = '<div>{0}</div>'.format(grade_response['msg'])
    data = {'xqueue_header': json.dumps(xqueue_header), 'xqueue_body': json.dumps(grade_response)}
    post(postback_url, data=data)
    self.log_message('XQueue:    sent    grading    response    {0}    to    {1}'.format(data, postback_url))
