select map.active_role_id as user_role_id
from imsld_run_users_group_rels map,
acs_rels ar,
imsld_run_users_group_ext iruge
where ar.rel_id = map.rel_id
and ar.object_id_one = iruge.group_id
and ar.object_id_two = :user_id
and iruge.run_id = :run_id
select case
when rp.learning_activity_id is not null
then 'learning'
when rp.support_activity_id is not null
then 'support'
when rp.activity_structure_id is not null
then 'structure'
else 'none'
end as type,
content_item__get_live_revision(coalesce(rp.learning_activity_id,rp.support_activity_id,rp.activity_structure_id)) as activity_id,
rp.role_part_id,
ia.act_id,
ip.play_id
from imsld_role_partsi rp, imsld_actsi ia, imsld_playsi ip, imsld_imsldsi ii,
imsld_methodsi im
where rp.act_id = ia.item_id
and ia.play_id = ip.item_id
and ip.method_id = im.item_id
and im.imsld_id = ii.item_id
and ii.imsld_id = :imsld_id
and content_revision__is_live(rp.role_part_id) = 't'
and content_item__get_live_revision(coalesce(rp.learning_activity_id,rp.support_activity_id,rp.activity_structure_id))
is not null
order by ip.sort_order, ia.sort_order, rp.sort_order
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 1 from imsld_status_user
where related_id = :activity_id
and user_id = :user_id
and status = 'started'
and run_id = :run_id
select 1 from imsld_status_user
where related_id = :activity_id
and user_id = :user_id
and status = 'finished'
and run_id = :run_id