def get_score(submissions_scores, csm_scores, persisted_block, block):
 weight = _get_weight_from_block(persisted_block, block)
 (raw_earned, raw_possible, weighted_earned, weighted_possible, attempted) = (_get_score_from_submissions(submissions_scores, block) or _get_score_from_csm(csm_scores, block, weight) or _get_score_from_persisted_or_latest_block(persisted_block, block, weight))
 if ((weighted_possible is None) or (weighted_earned is None)):
  return None
 else:
  has_valid_denominator = (weighted_possible > 0.0)
  graded = (_get_graded_from_block(persisted_block, block) if has_valid_denominator else False)
  return ProblemScore(raw_earned, raw_possible, weighted_earned, weighted_possible, weight, graded, attempted=attempted)

def get_score ( submissions_scores , csm_scores , persisted_block , block ) : weight = _get_weight_from_block ( persisted_block , block ) ( raw_earned , raw_possible , weighted_earned , weighted_possible , attempted ) = ( _get_score_from_submissions ( submissions_scores , block ) or _get_score_from_csm ( csm_scores , block , weight ) or _get_score_from_persisted_or_latest_block ( persisted_block , block , weight ) ) if ( ( weighted_possible is None ) or ( weighted_earned is None ) ) : return None else : has_valid_denominator = ( weighted_possible > 0.0 ) graded = ( _get_graded_from_block ( persisted_block , block ) if has_valid_denominator else False ) return ProblemScore ( raw_earned , raw_possible , weighted_earned , weighted_possible , weight , graded , attempted = attempted )
get the score and max_score for the specified user and xblock usage .