def _has_db_updated_with_new_score_bwc_v2(user_id, scored_block_usage_key, expected_modified_time, score_deleted):
 score = get_score(user_id, scored_block_usage_key)
 if (score is None):
  return score_deleted
 elif (score.module_type == 'openassessment'):
  anon_id = anonymous_id_for_user(User.objects.get(id=user_id), scored_block_usage_key.course_key)
  course_id = unicode(scored_block_usage_key.course_key)
  item_id = unicode(scored_block_usage_key)
  api_score = sub_api.get_score({'student_id': anon_id, 'course_id': course_id, 'item_id': item_id, 'item_type': 'openassessment'})
  if (api_score is None):
   return score_deleted
  reported_modified_time = api_score['created_at']
 else:
  reported_modified_time = score.modified
 return (reported_modified_time >= expected_modified_time)

def _has_db_updated_with_new_score_bwc_v2 ( user_id , scored_block_usage_key , expected_modified_time , score_deleted ) : score = get_score ( user_id , scored_block_usage_key ) if ( score is None ) : return score_deleted elif ( score . module_type == 'openassessment' ) : anon_id = anonymous_id_for_user ( User . objects . get ( id = user_id ) , scored_block_usage_key . course_key ) course_id = unicode ( scored_block_usage_key . course_key ) item_id = unicode ( scored_block_usage_key ) api_score = sub_api . get_score ( { 'student_id' : anon_id , 'course_id' : course_id , 'item_id' : item_id , 'item_type' : 'openassessment' } ) if ( api_score is None ) : return score_deleted reported_modified_time = api_score [ 'created_at' ] else : reported_modified_time = score . modified return ( reported_modified_time >= expected_modified_time )
deprecated version for backward compatibility with v2 tasks .