Index: openacs-4/contrib/packages/survey/tcl/survey-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/tcl/Attic/survey-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/survey/tcl/survey-procs-postgresql.xql 19 Sep 2003 16:48:03 -0000 1.1 +++ openacs-4/contrib/packages/survey/tcl/survey-procs-postgresql.xql 12 Mar 2004 06:35:45 -0000 1.2 @@ -106,11 +106,10 @@ u.first_names || ' ' || u.last_name as user_name, edit_p, o.creation_date as response_date - from (select survey_response__initial_user_id(response_id) as responding_user_id, - survey_response__initial_response_id(response_id) as initial_response_id, + from (select survey_response__initial_response_id(response_id) as initial_response_id, response_id, (case when initial_response_id is NULL then 'f' else 't' end) as edit_p from survey_responses) r, acs_objects o - left outer join cc_users u on (o.creation_user = u.user_id) + left outer join acs_users_all u on (o.creation_user = u.user_id) where r.response_id=:response_id and r.response_id = o.object_id @@ -176,7 +175,7 @@ q.abstract_data_type, q.sort_order, ss.sort_key - from survey_questions q, (select initial_user_id as user_id, creation_date, response_id from survey_responses_latest rt where survey_id=:survey_id) r, cc_users u, survey_sections ss + from survey_questions q, (select initial_user_id as user_id, creation_date, response_id from survey_responses_latest rt where survey_id=:survey_id) r, acs_users_all u, survey_sections ss where ss.survey_id=:survey_id and q.section_id=ss.section_id and r.user_id = u.user_id) sq Index: openacs-4/contrib/packages/survey/tcl/survey-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/tcl/Attic/survey-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/survey/tcl/survey-procs.tcl 26 Jan 2004 15:39:41 -0000 1.3 +++ openacs-4/contrib/packages/survey/tcl/survey-procs.tcl 12 Mar 2004 06:35:45 -0000 1.4 @@ -189,8 +189,10 @@ db_1row survey_question_properties "" set user_value "" + if {$predefined_question_id!=[db_null]} { + # question is a predefined question. If it has already been answered, get the last response value from the db # if it is a predefined question with action_type="db" get the value from the db instead. db_1row predefined_question_data "" @@ -241,6 +243,8 @@ set attachment_answer "" } } + + } else { if {$edit_previous_response_p == "t"} { set user_id [ad_get_user_id] @@ -264,6 +268,8 @@ } } + + if {$edit_previous_response_p == "t"} { switch -- $abstract_data_type { "choice" {