Index: openacs-4/contrib/packages/survey/www/admin/question-modify.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/admin/Attic/question-modify.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/survey/www/admin/question-modify.tcl 19 Sep 2003 16:48:04 -0000 1.1 +++ openacs-4/contrib/packages/survey/www/admin/question-modify.tcl 23 Oct 2003 06:22:26 -0000 1.2 @@ -129,24 +129,24 @@ } set choice_id_to_update_list [db_list get_choice_id {}] - set choice_count 0 + set sort_order 0 foreach one_response $response_list { - set choice_name [lindex $one_response 0] - set choice_value [lindex $one_response 1] - set choice_id_to_update [lindex $choice_id_to_update_list $choice_count] + set choice_label [lindex $one_response 0] + set sort_order [lindex $one_response 1] + set choice_id_to_update [lindex $choice_id_to_update_list $sort_order] if {[empty_string_p $choice_id_to_update]} { set new_choice_id [db_nextval survey_choice_id_sequence] db_dml insert_new_choice {} } else { - db_dml update_new_choice {} } - incr choice_count + incr sort_order } - while {[llength $choice_id_to_update_list] >= $choice_count} { - set choice_id_to_delete [lindex $choice_id_to_update_list $choice_count] + + while {[llength $choice_id_to_update_list] >= $sort_order} { + set choice_id_to_delete [lindex $choice_id_to_update_list $sort_order] db_dml delete_old_choice {} - incr choice_count + incr sort_order } }