'Calculate the aggregate weighted score for any location in the course.
This method returns a tuple containing (earned_score, possible_score).
If the location is of \'problem\' type, this method will return the
possible and earned scores for that problem. If the location refers to a
composite module (a vertical or section ) the scores will be the sums of
all scored problems that are children of the chosen location.'

def score_for_module(self, location):

    if (location in self.problem_scores):
        score = self.problem_scores[location]
        return (score.earned, score.possible)
    children = self.course_data.structure.get_children(location)
    (earned, possible) = (0.0, 0.0)
    for child in children:
        (child_earned, child_possible) = self.score_for_module(child)
        earned += child_earned
        possible += child_possible
    return (earned, possible)
