'Compute score for this problem.  The score is the number of points awarded.
Returns a dictionary {\'score\': integer, from 0 to get_max_score(),
\'total\': get_max_score()}.
Takes an optional correctness map for use in the rescore workflow.'

def calculate_score(self, correct_map=None):

    if (correct_map is None):
        correct_map = self.correct_map
    correct = 0
    for key in correct_map:
        try:
            correct += correct_map.get_npoints(key)
        except Exception:
            log.error('key=%s,    correct_map    =    %s', key, correct_map)
            raise
    return {'score': correct, 'total': self.get_max_score()}
