'Save the passed in answers.
Returns a dict { \'success\' : bool, \'msg\' : message }
The message is informative on success, and an error message on failure.'

def save_problem(self, data):

    event_info = dict()
    event_info['state'] = self.lcp.get_state()
    event_info['problem_id'] = self.location.to_deprecated_string()
    answers = self.make_dict_of_responses(data)
    event_info['answers'] = answers
    _ = self.runtime.service(self, 'i18n').ugettext
    if (self.closed() and (not (self.max_attempts == 0))):
        event_info['failure'] = 'closed'
        self.track_function_unmask('save_problem_fail', event_info)
        return {'success': False, 'msg': _('Problem    is    closed.')}
    if (self.done and (self.rerandomize == RANDOMIZATION.ALWAYS)):
        event_info['failure'] = 'done'
        self.track_function_unmask('save_problem_fail', event_info)
        return {'success': False, 'msg': _('Problem    needs    to    be    reset    prior    to    save.')}
    self.lcp.student_answers = answers
    self.lcp.has_saved_answers = True
    self.set_state_from_lcp()
    self.set_score(self.score_from_lcp())
    self.track_function_unmask('save_problem_success', event_info)
    msg = _('Your    answers    have    been    saved.')
    if (not (self.max_attempts == 0)):
        msg = _("Your    answers    have    been    saved    but    not    graded.    Click    '{button_name}'    to    grade    them.").format(button_name=self.submit_button_name())
    return {'success': True, 'msg': msg, 'html': self.get_problem_html(encapsulate=False)}
