select la.title as activity_title, la.item_id as activity_item_id, la.activity_id, la.complete_act_id from imsld_learning_activitiesi la where activity_id = :activity_id select sa.title as activity_title, sa.item_id as activity_item_id, sa.activity_id, attr.is_visible_p, sa.complete_act_id from imsld_support_activitiesi sa, imsld_attribute_instances attr where sa.activity_id = :activity_id and attr.owner_id = sa.activity_id and attr.run_id = :run_id and attr.user_id = :user_id and attr.type = 'isvisible' select title as activity_title, item_id as structure_item_id, structure_id, structure_type from imsld_activity_structuresi where structure_id = :activity_id select ar.object_id_two, ar.rel_type, ar.rel_id, ir.sort_order, case ar.rel_type when 'imsld_as_la_rel' then 'learning' when 'imsld_as_sa_rel' then 'support' when 'imsld_as_as_rel' then 'structure' else 'none' end as activity_type from acs_rels ar, imsld_activity_structuresi ias, (select * from imsld_as_la_rels union select * from imsld_as_sa_rels union select * from imsld_as_as_rels) as ir where ar.object_id_one = ias.item_id and ar.rel_id = ir.rel_id and ias.structure_id = :structure_id and content_item__get_live_revision(ar.object_id_two) is not null order by ir.sort_order, ar.object_id_two select structure_id, structure_type from imsld_activity_structuresi where item_id = :structure_item_id