Index: openacs-4/packages/survey/www/admin/question-add-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/question-add-2.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/survey/www/admin/question-add-2.tcl 27 Jun 2015 20:46:15 -0000 1.8
+++ openacs-4/packages/survey/www/admin/question-add-2.tcl 3 Sep 2024 15:37:54 -0000 1.9
@@ -22,8 +22,8 @@
question_text:html,notnull
presentation_type
{after:integer ""}
- {required_p:boolean t}
- {active_p:boolean t}
+ {required_p:boolean,notnull t}
+ {active_p:boolean,notnull t}
{n_responses ""}
}
@@ -33,7 +33,7 @@
permission::require_permission -object_id $package_id -privilege survey_create_question
set question_id [db_nextval acs_object_id_seq]
-get_survey_info -section_id $section_id
+survey::get_info -section_id $section_id
if {![info exists survey_info(survey_id)]} {
ad_return_complaint 1 "[_ survey.lt_Requested_survey_does]"
@@ -44,7 +44,7 @@
set type $survey_info(type)
# create a blank form, we fill it based on the question type
-# maybe put question_id:key in there if we move the processing from quesion-add-3 to this form.
+# maybe put question_id:key in there if we move the processing from question-add-3 to this form.
ad_form -name create-question-2 -action question-add-3 -form {
{question:text(inform) {label "[_ survey.Question_Text]"} {value $question_text}}
@@ -71,7 +71,7 @@
# if { $presentation_type eq "upload_file" } {
# # incr exception_count
# # append exception_text "
The presentation type: upload file is not supported at this time."
-
+
# }
# if { $exception_count > 0 } {
@@ -91,18 +91,18 @@
set variable_id_list [list]
db_foreach select_variable_names "" {
- lappend variable_id_list $variable_id
- append response_fields "$variable_name | "
+ lappend variable_id_list $variable_id
+ append response_fields "$variable_name | "
}
append response_fields "\n"
for {set response 0} {$response < $n_responses} {incr response} {
- append response_fields " | "
- for {set variable 0} {$variable < $n_variables} {incr variable} {
- append response_fields " | "
- }
- append response_fields "
\n"
+ append response_fields " | "
+ for {set variable 0} {$variable < $n_variables} {incr variable} {
+ append response_fields " | "
+ }
+ append response_fields "
\n"
}
append response_fields "\n"
@@ -115,64 +115,64 @@
# Display presentation options for sizing text input fields and textareas.
switch -- $presentation_type {
- "textbox" {
+ "textbox" {
- ad_form -extend -name create-question-2 -form {
- {textbox_size:text(select) {options {{[_ survey.Small] small} {[_ survey.Medium] medium} {[_ survey.Large] large}}} {label "[_ survey.Size]"}}
- {abstract_data_type:text(select) {label "[_ survey.Type_of_Response]"}
- {options {{"[_ survey.Short_Text]" shorttext} {[_ survey.Text] text} {[_ survey.Boolean] boolean} {[_ survey.Number] number} {[_ survey.Integer] integer}}}
- }
+ ad_form -extend -name create-question-2 -form {
+ {textbox_size:text(select) {options {{[_ survey.Small] small} {[_ survey.Medium] medium} {[_ survey.Large] large}}} {label "[_ survey.Size]"}}
+ {abstract_data_type:text(select) {label "[_ survey.Type_of_Response]"}
+ {options {{"[_ survey.Short_Text]" shorttext} {[_ survey.Text] text} {[_ survey.Boolean] boolean} {[_ survey.Number] number} {[_ survey.Integer] integer}}}
+ }
- }
- }
- "textarea" {
- ad_form -extend -name create-question-2 -form {
- {textarea_size:text(select) {options {{[_ survey.Small] small} {[_ survey.Medium] medium} {[_ survey.Large] large}}} {label "[_ survey.Size]"}}
- {abstract_data_type:text(hidden) {value "text"}}
+ }
+ }
+ "textarea" {
+ ad_form -extend -name create-question-2 -form {
+ {textarea_size:text(select) {options {{[_ survey.Small] small} {[_ survey.Medium] medium} {[_ survey.Large] large}}} {label "[_ survey.Size]"}}
+ {abstract_data_type:text(hidden) {value "text"}}
- }
- }
+ }
+ }
}
}
# Let user enter valid responses for selections, radio buttons, and check boxes.
set response_fields ""
switch -- $presentation_type {
- "radio" -
- "select" {
+ "radio" -
+ "select" {
- ad_form -extend -name create-question-2 -form {
- {abstract_data_type:text(radio)
- {label "[_ survey.Type_of_Response]"} {value "choice"}
- {options {{"[_ survey.True_or_False]" boolean} {"[_ survey.Yes_or_No]" yn} {"[_ survey.Multiple_Choice]" choice}}}}
- {valid_responses:text(textarea)
- {label "[_ survey.lt_For_Multiple_Choicebr]"}
- {html {rows 10 cols 50}}}
- }
- }
-
- "checkbox" {
- ad_form -extend -name create-question-2 -form {
- {valid_responses:text(textarea) {label "[_ survey.lt_Valid_Resposnes_enter]"} {html {rows 10 cols 50}}}
- {abstract_data_type:text(hidden) {value "choice"}}
- }
- }
+ ad_form -extend -name create-question-2 -form {
+ {abstract_data_type:text(radio)
+ {label "[_ survey.Type_of_Response]"} {value "choice"}
+ {options {{"[_ survey.True_or_False]" boolean} {"[_ survey.Yes_or_No]" yn} {"[_ survey.Multiple_Choice]" choice}}}}
+ {valid_responses:text(textarea)
+ {label "[_ survey.lt_For_Multiple_Choicebr]"}
+ {html {rows 10 cols 50}}}
+ }
+ }
+ "checkbox" {
+ ad_form -extend -name create-question-2 -form {
+ {valid_responses:text(textarea) {label "[_ survey.lt_Valid_Resposnes_enter]"} {html {rows 10 cols 50}}}
+ {abstract_data_type:text(hidden) {value "choice"}}
+ }
+ }
-
- "date" {
- ad_form -extend -name create-question-2 -form {
- {abstract_data_type:text(hidden) {value date}}
- }
- }
- "upload_file" {
- ad_form -extend -name create-question-2 -form {
- {abstract_data_type:text(hidden) {value blob}}
- }
- }
+ "date" {
+
+ ad_form -extend -name create-question-2 -form {
+ {abstract_data_type:text(hidden) {value date}}
+ }
+
+ }
+ "upload_file" {
+ ad_form -extend -name create-question-2 -form {
+ {abstract_data_type:text(hidden) {value blob}}
+ }
+ }
}
ad_form -extend -name create-question-2 -form {
@@ -181,3 +181,9 @@
set context [list [list [export_vars -base one {survey_id}] $survey_info(name)] "[_ survey.Add_A_Question]"]
ad_return_template
+
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 4
+# indent-tabs-mode: nil
+# End: