'Compute score for the given block. If persisted_values
is provided, it is used for possible and weight.'

def _compute_block_score(self, block_key, course_structure, submissions_scores, csm_scores, persisted_block=None):

    try:
        block = course_structure[block_key]
    except KeyError:
        pass
    else:
        if getattr(block, 'has_score', False):
            problem_score = get_score(submissions_scores, csm_scores, persisted_block, block)
            if problem_score:
                self.problem_scores[block_key] = problem_score
