def is_currently_visible_to_students(xblock):
 try:
  published = modulestore().get_item(xblock.location, revision=ModuleStoreEnum.RevisionOption.published_only)
 except ItemNotFoundError:
  return False
 if published.visible_to_staff_only:
  return False
 if (('detached' not in published._class_tags) and (published.start is not None)):
  return (datetime.now(UTC) > published.start)
 return True

def is_currently_visible_to_students ( xblock ) : try : published = modulestore ( ) . get_item ( xblock . location , revision = ModuleStoreEnum . RevisionOption . published_only ) except ItemNotFoundError : return False if published . visible_to_staff_only : return False if ( ( 'detached' not in published . _class_tags ) and ( published . start is not None ) ) : return ( datetime . now ( UTC ) > published . start ) return True
returns true if there is a published version of the xblock that is currently visible to students .