def _get_score_from_submissions(submissions_scores, block):
 if submissions_scores:
  submission_value = submissions_scores.get(unicode(block.location))
  if submission_value:
   attempted = True
   (weighted_earned, weighted_possible) = submission_value
   assert ((weighted_earned >= 0.0) and (weighted_possible > 0.0))
   return (((None, None) + (weighted_earned, weighted_possible)) + (attempted,))

def _get_score_from_submissions ( submissions_scores , block ) : if submissions_scores : submission_value = submissions_scores . get ( unicode ( block . location ) ) if submission_value : attempted = True ( weighted_earned , weighted_possible ) = submission_value assert ( ( weighted_earned >= 0.0 ) and ( weighted_possible > 0.0 ) ) return ( ( ( None , None ) + ( weighted_earned , weighted_possible ) ) + ( attempted , ) )
returns the score values from the submissions api if found .