def post_replace_result(self, score, result_data=None):
self.operation = REPLACE_REQUEST<EOL>self.score = score<EOL>self.result_data = result_data<EOL>if result_data is not None:<EOL><INDENT>if len(result_data) > <NUM_LIT:1>:<EOL><INDENT>error_msg = ('<STR_LIT>'<EOL>'<STR_LIT>'.format(len(result_data)))<EOL>raise InvalidLTIConfigError(error_msg)<EOL><DEDENT>elif '<STR_LIT:text>' not in result_data and '<STR_LIT:url>' not in result_data:<EOL><INDENT>error_msg = ('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>raise InvalidLTIConfigError(error_msg)<EOL><DEDENT>else:<EOL><INDENT>return self.post_outcome_request()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return self.post_outcome_request()<EOL><DEDENT>
POSTs the given score to the Tool Consumer with a replaceResult.

OPTIONAL:
    result_data must be a dictionary
    Note: ONLY ONE of these values can be in the dict at a time,
    due to the Canvas specification.

    'text' : str text
    'url' : str url