Index: openacs-4/contrib/packages/survey/www/admin/predefined-question-ae-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/admin/Attic/predefined-question-ae-2.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/contrib/packages/survey/www/admin/predefined-question-ae-2.tcl 23 Oct 2003 06:22:26 -0000 1.2
+++ openacs-4/contrib/packages/survey/www/admin/predefined-question-ae-2.tcl 26 Jan 2004 15:39:41 -0000 1.3
@@ -26,13 +26,13 @@
{presentation_type_new:text(hidden) {value $presentation_type}}
{presentation_type:text(hidden) {value $presentation_type}}
{question_text_inform:text(inform) {label "Question"} {html {rows 5 cols 70}} {value $question_text}}
-} -select_query {
- select abstract_data_type,presentation_options,presentation_alignment,summary_type,action_type,tcl,table_name,column_name,key_name from survey_predefined_questions where predefined_question_id=:predefined_question_id
+
}
if {[info exist predefined_question_id]} {
# get choices
set valid_responses ""
+ set choice_id_to_update_list [list]
db_foreach survey_question_valid_responses "" {
lappend choice_id_to_update_list $choice_id
append valid_responses "$label\n"
@@ -50,17 +50,14 @@
{abstract_data_type:text(select) {label "Type of Response"}
{options {{"Short Text" shorttext} {Text text} {Boolean boolean} {Number number} {Integer integer}}}
}
- } -select_query {
- select * from survey_predefined_questions where predefined_question_id=:predefined_question_id
+
}
}
textarea {
ad_form -extend -name predef -form {
{presentation:text(inform) {label "Presentation Type"} {value "Essay Answer"}}
{textarea_size:text(select) {options {{Small small} {Medium medium} {Large large}}} {label "Size"}}
{abstract_data_type:text(hidden) {value "text"}}
- } -select_query {
- select * from survey_predefined_questions where predefined_question_id=:predefined_question_id
}
}
"radio" -
@@ -73,8 +70,6 @@
{valid_responses:text(textarea)
{label "For Multiple Choice
Enter a List of Valid Responses
(enter one choice per line)"}
{html {rows 10 cols 50}} {value $valid_responses}}
- } -select_query {
- select * from survey_predefined_questions where predefined_question_id=:predefined_question_id
} -validate {
{valid_responses {$abstract_data_type!="choice" || ![empty_string_p $valid_responses]} "You did not enter a set of valid responses"}
}
@@ -85,8 +80,6 @@
{presentation:text(inform) {label "Presentation Type"} {value "Multiple Choice"}}
{valid_responses:text(textarea) {label "Valid Resposnes (enter one choice per line)"} {html {rows 10 cols 50}}}
{abstract_data_type:text(hidden) {value "choice"}}
- } -select_query {
- select * from survey_predefined_questions where predefined_question_id=:predefined_question_id
} -validate {
{valid_responses {$abstract_data_type!="choice" || ![empty_string_p $valid_responses]} "You did not enter a set of valid responses"}
}
@@ -95,24 +88,20 @@
ad_form -extend -name predef -form {
{presentation:text(inform) {label "Presentation Type"} {value "Date Answer"}}
{abstract_data_type:text(hidden) {value date}}
- } -select_query {
- select * from survey_predefined_questions where predefined_question_id=:predefined_question_id
}
}
"upload_file" {
ad_form -extend -name predef -form {
{presentation:text(inform) {label "Presentation Type"} {value "Attachment Answer"}}
{abstract_data_type:text(hidden) {value blob}}
- } -select_query {
- select * from survey_predefined_questions where predefined_question_id=:predefined_question_id
}
}
}
ad_form -extend -name predef -form {
# {presentation_alignment:text(radio) {options {{"Beside the question" beside} {"Below the question" below}}} {value below} {label "Presentation Alignment"}}
{presentation_alignment:text(hidden) {value beside}}
- {action_type:text(radio) {label "Action on submit"} {options {{"Update DB" db} {"Execute TCL-Code" tcl} {"Nothing" "null"}}} {value "null"}}
+ {action_type:text(radio) {label "Action on submit"} {options {{"Update DB" db} {"Execute TCL-Code" tcl} {"Nothing" "null"}}}}
{tcl:text(textarea),optional {label "TCL-Code"}}
{table_name:text(text),optional {label "Table"}}
{column_name:text(text),optional {label "Column"}}
@@ -128,6 +117,8 @@
{column_name {$action_type=="db" || [empty_string_p $column_name]} "Please select \"Update DB\" if you want to insert values into the Database"}
{key_name {$action_type=="db" || [empty_string_p $key_name]} "Please select \"Update DB\" if you want to insert values into the Database"}
{key_name {![empty_string_p $key_name] || $action_type!="db"} "Please enter a key name"}
+} -new_request {
+ set action_type "null"
} -on_submit {
if {$action_type=="null"} {
set action_type [db_null]