select session_id
from as_sessions
where staff_id = :user_id
select session_id
from as_sessions
where subject_id = :user_id
select section_data_id
from as_section_data
where subject_id = :user_id
select section_data_id
from as_section_data
where staff_id = :user_id
select item_data_id
from as_item_data
where subject_id = :user_id
select item_data_id
from as_item_data
where staff_id = :user_id
update as_sessions
set staff_id = :to_user_id
where staff_id = :from_user_id
update as_sessions
set subject_id = :to_user_id
where subject_id = :from_user_id
update as_section_data
set subject_id = :to_user_id
where subject_id = :from_user_id
update as_section_data
set staff_id = :to_user_id
where staff_id = :from_user_id
update as_item_data
set subject_id = :to_user_id
where subject_id = :from_user_id
update as_item_data
set staff_id = :to_user_id
where staff_id = :from_user_id
SELECT crf.folder_id as new_parent_id
FROM dotlrn_applets as da,
dotlrn_community_applets as dca,
cr_folders as crf
WHERE da.applet_key='dotlrn_assessment'
and dca.applet_id=da.applet_id
and dca.community_id=:selected_community
and crf.package_id=dca.package_id;
update cr_items
set parent_id = :new_parent_id
where item_id=(select context_id from acs_objects where object_id=:object_id);
update acs_objects
set context_id = :new_parent_id
where object_id = (select context_id from acs_objects where object_id=:object_id)
SELECT dca.package_id
FROM dotlrn_community_applets as dca,
dotlrn_applets as da
WHERE da.applet_key='dotlrn_assessment'
and dca.applet_id=da.applet_id
and dca.community_id=:selected_community
update acs_objects
set package_id = :new_package_id
where object_id = (select context_id from acs_objects where object_id=:object_id)
update acs_objects
set package_id =:new_package_id
where object_id in (select object_id
from acs_objects
where context_id=
(select context_id
from acs_objects
where object_id=:object_id))
SELECT cri.name,
ao.title,
ao.creation_user as creator_id,
crr.description,
ass.instructions,
ass.run_mode,
ass.anonymous_p,
ass.secure_access_p,
ass.reuse_responses_p,
ass.show_item_name_p,
ass.random_p,
ass.entry_page,
ass.exit_page,
ass.consent_page,
ass.return_url,
ass.start_time,
ass.end_time,
ass.number_tries,
ass.wait_between_tries,
ass.time_for_response,
ass.ip_mask,
ass.password,
ass.show_feedback,
ass.section_navigation,
ass.survey_p,
ass.type
FROM acs_objects as ao,
cr_items as cri,
cr_revisions as crr,
as_assessments as ass
WHERE ao.object_id=ass.assessment_id
and crr.revision_id=ass.assessment_id
and cri.item_id=crr.item_id
and ass.assessment_id=:object_id
SELECT b.object_id as package_id
FROM acs_objects as a,acs_objects as b
WHERE a.context_id=:selected_community and a.object_type='apm_package' and a.object_id=b.context_id and b.title='Assessment';
SELECT section_id
FROM as_assessment_section_map
WHERE assessment_id=:object_id
SELECT max_time_to_complete,
sort_order,
points
FROM as_assessment_section_map
WHERE section_id=:section_id
INSERT INTO as_assessment_section_map(assessment_id, section_id, max_time_to_complete, sort_order, points)
VALUES (:new_assessment_id,:section_id,:max_time_to_complete,:sort_order,:points)
update cr_items
set parent_id = :trash_id
where item_id=(select context_id from acs_objects where object_id=:object_id);
update acs_objects
set context_id = :trash_id, package_id = :trash_package_id
where object_id = (select context_id from acs_objects where object_id=:object_id)
update acs_objects
set package_id =:trash_package_id
where object_id in (select object_id from acs_objects where context_id=(select context_id from acs_objects where object_id=:object_id))