Index: openacs-4/packages/assessment/tcl/as-item-data-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-data-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/tcl/as-item-data-procs.tcl 20 Dec 2004 13:49:24 -0000 1.4 +++ openacs-4/packages/assessment/tcl/as-item-data-procs.tcl 24 Dec 2004 15:32:38 -0000 1.5 @@ -58,3 +58,28 @@ return $as_item_data_id } + +ad_proc -public as::item_data::get { + {-subject_id:required} + {-as_item_id:required} + {-session_id ""} +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2004-12-24 + + Get as_item_data from the database +} { + if {[empty_string_p $session_id]} { + db_1row last_session {} + } + + if {![empty_string_p $session_id] && [db_0or1row response {} -column_array response]} { + # response found in session + set item_data_id $response(item_data_id) + set response(choice_answer) [db_list mc_response {}] + return [array get response] + } else { + # no response given in that session + return "" + } +}