def _has_db_updated_with_new_score(scored_block_usage_key, **kwargs):
 if (kwargs['score_db_table'] == ScoreDatabaseTableEnum.courseware_student_module):
  score = get_score(kwargs['user_id'], scored_block_usage_key)
  found_modified_time = (score.modified if (score is not None) else None)
 else:
  assert (kwargs['score_db_table'] == ScoreDatabaseTableEnum.submissions)
  score = sub_api.get_score({'student_id': kwargs['anonymous_user_id'], 'course_id': unicode(scored_block_usage_key.course_key), 'item_id': unicode(scored_block_usage_key), 'item_type': scored_block_usage_key.block_type})
  found_modified_time = (score['created_at'] if (score is not None) else None)
 if (score is None):
  return kwargs['score_deleted']
 return (found_modified_time >= from_timestamp(kwargs['expected_modified_time']))

def _has_db_updated_with_new_score ( scored_block_usage_key , ** kwargs ) : if ( kwargs [ 'score_db_table' ] == ScoreDatabaseTableEnum . courseware_student_module ) : score = get_score ( kwargs [ 'user_id' ] , scored_block_usage_key ) found_modified_time = ( score . modified if ( score is not None ) else None ) else : assert ( kwargs [ 'score_db_table' ] == ScoreDatabaseTableEnum . submissions ) score = sub_api . get_score ( { 'student_id' : kwargs [ 'anonymous_user_id' ] , 'course_id' : unicode ( scored_block_usage_key . course_key ) , 'item_id' : unicode ( scored_block_usage_key ) , 'item_type' : scored_block_usage_key . block_type } ) found_modified_time = ( score [ 'created_at' ] if ( score is not None ) else None ) if ( score is None ) : return kwargs [ 'score_deleted' ] return ( found_modified_time >= from_timestamp ( kwargs [ 'expected_modified_time' ] ) )
returns whether the database has been updated with the expected new score values for the given problem and user .