'Calculates partial credit based on the Points scheme.
Answer choices marked "partial" are given partial credit.
Default is 50%; other amounts may be set in point_value attributes.
Arguments: student_answers
Returns: a CorrectMap'

def grade_via_points(self, **kwargs):

    student_answers = kwargs['student_answers']
    if ((self.answer_id in student_answers) and (student_answers[self.answer_id] in self.correct_choices)):
        return CorrectMap(self.answer_id, correctness='correct')
    elif ((self.answer_id in student_answers) and (student_answers[self.answer_id] in self.partial_choices)):
        choice_index = self.partial_choices.index(student_answers[self.answer_id])
        credit_amount = self.partial_values[choice_index]
        return CorrectMap(self.answer_id, correctness='partially-correct', npoints=credit_amount)
    else:
        return CorrectMap(self.answer_id, 'incorrect')
