Index: openacs-4/packages/rules/www/add-trigger.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/rules/www/Attic/add-trigger.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/rules/www/add-trigger.tcl	8 Dec 2004 21:18:13 -0000	1.2
+++ openacs-4/packages/rules/www/add-trigger.tcl	8 Dec 2004 22:02:52 -0000	1.3
@@ -12,12 +12,6 @@
 set qs_sel 0
 set context [list [list "one-rule?rule_id=$rule_id" "Rule Properties"] "Add Trigger"]
 # Just while  get the assessment package ready
-if { ![exists_and_not_null selected_qs]} {
-       set selected_qs 01
-       set qs_sel $selected_qs
-} else {
-       set qs_sel $selected_qs
-}
 
 set questions [list]
 set results [list]
@@ -26,20 +20,23 @@
 
 db_foreach questions { *SQL* } {
     incr count
-    if  { $count == 1 } { 
-          set first_qs $qs_id
-    }
-    set question [list $description $qs_id]
-    lappend questions $question
+    if  { $count == 1 && ![exists_and_not_null selected_qs]} { 
+          set selected_qs  $qs_id
+      }
+     set question [list $description $qs_id]
+     lappend questions $question
 }
-
-db_foreach result {select choice_id as result_id, label as value from survey_question_choices  where  question_id = :first_qs} {
-    lappend results [list $value $result_id]
+if { ![exists_and_not_null selected_qs]} {
+       set qs_sel $selected_qs
+} else {
+       set qs_sel $selected_qs
 }
 
+
 db_foreach results { *SQL* } {
-    set result [list $value $result_id]
-    lappend results $result
+     set result  [list $value $result_id]
+     lappend results $result
+
 }
 
 form create add_trigger