def _get_score_from_csm(csm_scores, block, weight):
 score = csm_scores.get(block.location)
 has_valid_score = (score and (score.total is not None))
 if has_valid_score:
  if (score.correct is not None):
   attempted = True
   raw_earned = score.correct
  else:
   attempted = False
   raw_earned = 0.0
  raw_possible = score.total
  return (((raw_earned, raw_possible) + weighted_score(raw_earned, raw_possible, weight)) + (attempted,))

def _get_score_from_csm ( csm_scores , block , weight ) : score = csm_scores . get ( block . location ) has_valid_score = ( score and ( score . total is not None ) ) if has_valid_score : if ( score . correct is not None ) : attempted = True raw_earned = score . correct else : attempted = False raw_earned = 0.0 raw_possible = score . total return ( ( ( raw_earned , raw_possible ) + weighted_score ( raw_earned , raw_possible , weight ) ) + ( attempted , ) )
returns the score values from the courseware student module .