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 -N -r1.16 -r1.16.2.1 --- openacs-4/packages/assessment/tcl/as-item-data-procs.tcl 7 Aug 2017 23:48:03 -0000 1.16 +++ openacs-4/packages/assessment/tcl/as-item-data-procs.tcl 4 Oct 2021 15:30:02 -0000 1.16.2.1 @@ -112,7 +112,20 @@ if {$session_id ne "" && [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 {}] + set response(choice_answer) [db_list mc_response { + 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_session_item_map m, as_item_data d + 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 + + order by d.item_data_id desc + fetch first 1 rows only + }] return [array get response] } else { # no response given in that session