Index: openacs-4/packages/survey/www/admin/question-add-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/question-add-3-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/survey/www/admin/question-add-3-oracle.xql 16 Sep 2002 00:00:24 -0000 1.1 +++ openacs-4/packages/survey/www/admin/question-add-3-oracle.xql 24 Sep 2002 02:22:25 -0000 1.2 @@ -33,5 +33,9 @@ - + + + select decode(count(*),0,0,1) from survey_questions where question_id = :question_id + + Index: openacs-4/packages/survey/www/admin/question-add-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/question-add-3-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/survey/www/admin/question-add-3-postgresql.xql 16 Sep 2002 00:00:24 -0000 1.1 +++ openacs-4/packages/survey/www/admin/question-add-3-postgresql.xql 24 Sep 2002 02:22:25 -0000 1.2 @@ -31,5 +31,10 @@ - + + + select case when count(*) = 0 then 0 else 1 end from survey_questions where question_id = :question_id + + + Index: openacs-4/packages/survey/www/admin/question-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/question-add-3.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/survey/www/admin/question-add-3.tcl 18 Sep 2002 12:15:21 -0000 1.2 +++ openacs-4/packages/survey/www/admin/question-add-3.tcl 24 Sep 2002 02:22:25 -0000 1.3 @@ -67,7 +67,12 @@ ad_script_abort } +set already_inserted_p [db_string already_inserted_p {}] +if { $already_inserted_p } { + ad_returnredirect "one?[export_vars survey_id]" + ad_script_abort +} # Generate presentation_options. set presentation_options "" if { $presentation_type == "textbox" } { @@ -124,13 +129,10 @@ } } on_error { - set already_inserted_p [db_string already_inserted_p "select decode(count(*),0,0,1) from survey_questions where question_id = :question_id" ] - - if { !$already_inserted_p } { db_release_unused_handles ad_return_error "Database Error" "
$errmsg
" ad_script_abort - } + }