select related_object_id as correction_file_id
from cr_item_rels
where item_id = :file_id
and relation_tag = 'homework_correction'
update acs_objects
set context_id = null
where object_id = :file_id
update acs_objects
set context_id = null
where object_id = :correction_file_id
select name from cr_items where item_id = :file_id
select count(*)
from cr_items
where name = :filename
and parent_id = :parent_id