Index: openacs-4/packages/survey/tcl/survey-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/tcl/survey-procs.tcl,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/survey/tcl/survey-procs.tcl 8 Sep 2014 08:41:08 -0000 1.9.2.1 +++ openacs-4/packages/survey/tcl/survey-procs.tcl 10 Sep 2014 10:31:10 -0000 1.9.2.2 @@ -59,8 +59,10 @@ ad_proc -public survey_question_display { question_id {response_id ""} -} {Returns a string of HTML to display for a question, suitable for embedding in a form. The form variable is of the form \"response_to_question.\$question_id} { - +} { + Returns a string of HTML to display for a question, suitable for embedding in a form. + The form variable is of the form \"response_to_question.\$question_id +} { if {$response_id ne ""} { set edit_previous_response_p "t" } else { @@ -107,12 +109,14 @@ } switch -- $presentation_type { + "upload_file" { if {$edit_previous_response_p == "t"} { set user_value $attachment_answer } append html "" } + "textbox" { if {$edit_previous_response_p == "t"} { if {$abstract_data_type eq "number" || $abstract_data_type eq "integer"} { @@ -122,24 +126,26 @@ } } - append html "" + append html [subst {}] } + "textarea" { if {$edit_previous_response_p == "t"} { - set user_value $clob_answer } set presentation_options [ad_decode $presentation_options "large" "rows=20 cols=65" "medium" "rows=15 cols=55" "rows=8 cols=35"] append html "" - } + } + "date" { if {$edit_previous_response_p == "t"} { set user_value $date_answer } - - append html "[ad_dateentrywidget $element_name $user_value]" + append html [ad_dateentrywidget $element_name $user_value] } + "select" { if { $abstract_data_type eq "boolean" } { if {$edit_previous_response_p == "t"} { @@ -167,7 +173,7 @@ } # at some point, we may want to add a UI option for the admin -# to sepcify multiple or not for select +# to specify multiple or not for select append html " + -
+ +}] -[_ survey.Question]: $question_text -

-

-[export_vars -form {section_id question_id choice_id_list variable_id_list}] -$table_html -

-

- -
- -
- -[ad_footer] -" +ad_return_template generic Index: openacs-4/packages/survey/www/admin/process-response.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/process-response.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/survey/www/admin/process-response.tcl 7 Aug 2014 07:11:47 -0000 1.5.2.1 +++ openacs-4/packages/survey/www/admin/process-response.tcl 10 Sep 2014 10:31:10 -0000 1.5.2.2 @@ -30,7 +30,7 @@ } } - check_questions -requires { section_id:integer } { + check_questions -requires { section_id } { set question_info_list [db_list_of_lists survey_question_info_list { select question_id, question_text, abstract_data_type, presentation_type, required_p @@ -43,7 +43,7 @@ ## Validate input. set questions_with_missing_responses [list] - + foreach question $question_info_list { set question_id [lindex $question 0] set question_text [lindex $question 1] @@ -68,11 +68,21 @@ } } } - + if { $abstract_data_type eq "date" } { - if [catch { set response_to_question($question_id) [validate_ad_dateentrywidget "" response_to_question.$question_id [ns_getform]]} errmsg] { - ad_complain "$errmsg: Please make sure your dates are valid." + foreach {name value} [ns_set array [ns_getform]] { + if {[regexp "^response_to_question\[.\]$question_id\[.\](.*)\$" $name _ part]} { + set date_value($part) $value + } } + set ok [ad_page_contract_filter_proc_date "date" date_value] + if {$ok} { + set response_to_question($question_id) [ns_buildsqldate $date_value(month) \ + $date_value(day) \ + $date_value(year)] + } else { + ad_complain "Please make sure your dates are valid." + } } if { ([info exists response_to_question($question_id)] && $response_to_question($question_id) ne "") } { Index: openacs-4/packages/survey/www/admin/survey-create-choice.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/survey-create-choice.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/survey/www/admin/survey-create-choice.tcl 6 Nov 2013 07:33:55 -0000 1.3 +++ openacs-4/packages/survey/www/admin/survey-create-choice.tcl 10 Sep 2014 10:31:10 -0000 1.3.2.1 @@ -16,22 +16,18 @@ set package_id [ad_conn package_id] permission::require_permission -object_id $package_id -privilege survey_create_survey -set whole_page "[ad_header "[_ survey.Choose_Survey_Type]"] +set title [_ survey.Choose_a_Survey_Type] +set context [list [_ survey.Choose_Type]] -

[_ survey.Choose_a_Survey_Type]

+set body [subst { +
+
+
[_ survey.Scored_Survey] +
[_ survey.lt_This_is_a_multiple_ch]
+
[_ survey.General_Survey] +
[_ survey.lt_This_survey_allows_yo]
+
+}] -[ad_context_bar "[_ survey.Choose_Type]"] +ad_return_template generic -
- -
-
[_ survey.Scored_Survey] -
[_ survey.lt_This_is_a_multiple_ch]
-
[_ survey.General_Survey] -
[_ survey.lt_This_survey_allows_yo]
-
- -[ad_footer] -" - -doc_return 200 text/html $whole_page