Index: openacs-4/packages/assessment/tcl/as-item-data-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-data-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/tcl/as-item-data-procs.xql 24 Dec 2004 15:32:38 -0000 1.3 +++ openacs-4/packages/assessment/tcl/as-item-data-procs.xql 19 Jan 2005 16:49:14 -0000 1.4 @@ -1,6 +1,17 @@ + + + + select item_id as item_data_id, latest_revision + from cr_items + where name = :name + and parent_id = :folder_id + + + + @@ -10,31 +21,56 @@ - + - select max(session_id) as session_id - from as_item_data - where subject_id = :subject_id - and as_item_id = :as_item_id + insert into as_session_item_map (session_id, item_data_id) + values (:session_id, :as_item_data_id) - + - select item_data_id, boolean_answer, clob_answer, numeric_answer, - integer_answer, text_answer, timestamp_answer, content_answer, - points - from as_item_data + update as_session_item_map + set item_data_id = :as_item_data_id where session_id = :session_id - and subject_id = :subject_id - and as_item_id = :as_item_id + and item_data_id = :latest_revision + + + + select d.session_id, d.as_item_id + from as_item_data d, cr_revisions r, cr_revisions r2 + where d.subject_id = :subject_id + and d.as_item_id = r.revision_id + and r2.revision_id = :as_item_id + and r.item_id = r2.item_id + order by d.session_id decr + + + + + + + + select d.item_data_id, d.boolean_answer, d.clob_answer, d.numeric_answer, + d.integer_answer, d.text_answer, d.timestamp_answer, d.content_answer, + d.points + from as_item_data d, as_session_item_map m + where d.session_id = :session_id + and d.subject_id = :subject_id + and d.as_item_id = :as_item_id + and m.session_id = d.session_id + and m.item_data_id = d.item_data_id + + + +