'student_answers is a dict with everything from request.POST, but with the first part
of each key removed (the string before the first "_").'

def get_score(self, student_answers):

    _ = self.capa_system.i18n.ugettext
    log.debug('%s:    student_answers=%s', unicode(self), student_answers)
    idset = sorted(self.answer_ids, key=(lambda x: int(x.split('_')[(-1)])))
    try:
        submission = [student_answers[k] for k in idset]
    except Exception as err:
        msg = u'[courseware.capa.responsetypes.customresponse]    {message}\n    idset    =    {idset},    error    =    {err}'.format(message=_('error    getting    student    answer    from    {student_answers}').format(student_answers=student_answers), idset=idset, err=err)
        log.error('[courseware.capa.responsetypes.customresponse]    error    getting    student    answer    from    %s\n    idset    =    %s,    error    =    %s', student_answers, idset, err)
        raise Exception(msg)
    dynamath = [student_answers.get((k + '_dynamath'), None) for k in idset]
    if ((len(idset) == 1) and (not submission[0])):
        msg = (u'<span    class="inline-error">{0}</span>'.format(_(u'No    answer    entered!')) if self.xml.get('empty_answer_err') else '')
        return CorrectMap(idset[0], 'incorrect', msg=msg)
    correct = (['unknown'] * len(idset))
    messages = ([''] * len(idset))
    overall_message = ''
    self.context.update({'response_id': self.id, 'expect': self.expect, 'submission': submission, 'idset': idset, 'dynamath': dynamath, 'answers': student_answers, 'correct': correct, 'messages': messages, 'overall_message': overall_message, 'options': self.xml.get('options'), 'testdat': 'hello    world'})
    self.context['debug'] = self.capa_system.DEBUG
    self.execute_check_function(idset, submission)
    correct = self.context['correct']
    messages = self.context['messages']
    overall_message = self.clean_message_html(self.context['overall_message'])
    grade_decimals = self.context.get('grade_decimals')
    correct_map = CorrectMap()
    correct_map.set_overall_message(overall_message)
    for k in range(len(idset)):
        max_points = self.maxpoints[idset[k]]
        if grade_decimals:
            npoints = (max_points * grade_decimals[k])
        elif (correct[k] == 'correct'):
            npoints = max_points
        elif (correct[k] == 'partially-correct'):
            npoints = (max_points * self.default_pc)
        else:
            npoints = 0
        correct_map.set(idset[k], correct[k], msg=messages[k], npoints=npoints)
    return correct_map
