Index: openacs-4/contrib/packages/survey/www/respond-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/Attic/respond-oracle.xql,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/contrib/packages/survey/www/respond-oracle.xql 19 Sep 2003 16:48:03 -0000 1.1 +++ openacs-4/contrib/packages/survey/www/respond-oracle.xql 13 Jan 2004 20:41:31 -0000 1.1.2.1 @@ -3,24 +3,6 @@ oracle8.1.6 - - - select count(*) from survey_responses, acs_objects - where survey_id=:survey_id - and response_id=object_id - and initial_response_id is null - - - - - - select max(response_id) from survey_responses - where survey_id=:survey_id - and survey_response.initial_user_id(response_id)=:user_id - and initial_response_id is null - - - Index: openacs-4/contrib/packages/survey/www/respond-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/Attic/respond-postgresql.xql,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/contrib/packages/survey/www/respond-postgresql.xql 19 Sep 2003 16:48:03 -0000 1.1 +++ openacs-4/contrib/packages/survey/www/respond-postgresql.xql 13 Jan 2004 20:41:31 -0000 1.1.2.1 @@ -3,25 +3,6 @@ postgresql7.1 - - - select count(*) from survey_responses - where survey_id=:survey_id - and survey_response__initial_user_id(response_id)=:user_id - and initial_response_id is null - - - - - - select max(response_id) from survey_responses - where survey_id=:survey_id - and survey_response__initial_user_id(response_id)=:user_id - and initial_response_id is null - - - - @@ -30,7 +11,6 @@ - select max(response_id) as response_id,count(*) as unfinished @@ -42,7 +22,5 @@ and survey_id=:survey_id - - Index: openacs-4/contrib/packages/survey/www/respond.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/Attic/respond.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/contrib/packages/survey/www/respond.tcl 13 Jan 2004 19:44:14 -0000 1.1.2.1 +++ openacs-4/contrib/packages/survey/www/respond.tcl 13 Jan 2004 20:41:31 -0000 1.1.2.2 @@ -25,12 +25,12 @@ #set user_id [ad_maybe_redirect_for_registration] # Allow public surveys set user_id [ad_conn user_id] - set number_of_responses [db_string count_responses {}] + set count_resp [db_0or1row count_responses {}] # If we have a response in the system, and the survey is editable # set the response_id to the latest response unless response_id is # submited when calling the function if {$number_of_responses!=0 && $response_id==0} { - set response_id [db_string get_latest_response_id {}] + set response_id $max_response_id } get_survey_info -survey_id $survey_id Index: openacs-4/contrib/packages/survey/www/respond.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/Attic/respond.xql,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/contrib/packages/survey/www/respond.xql 19 Sep 2003 16:48:03 -0000 1.1 +++ openacs-4/contrib/packages/survey/www/respond.xql 13 Jan 2004 20:41:31 -0000 1.1.2.1 @@ -1,6 +1,16 @@ + + + select count(*) as number_of_responses, max(response_id) as max_response_id from survey_responses, acs_objects + where survey_id=:survey_id + and creation_user=:user_id + and object_id=response_id + and initial_response_id is null + + + select 1 from surveys where survey_id = :survey_id