Index: openacs-4/packages/survey/www/admin/survey-preview.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/survey-preview.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/survey/www/admin/survey-preview.tcl 9 May 2018 15:33:33 -0000 1.11 +++ openacs-4/packages/survey/www/admin/survey-preview.tcl 3 Sep 2024 15:37:54 -0000 1.12 @@ -10,16 +10,16 @@ @cvs-id $Id$ } { - + survey_id:naturalnum,notnull {section_id:naturalnum ""} return_url:localurl,optional } -validate { survey_exists -requires {survey_id} { - if {![db_0or1row survey_exists {}]} { - ad_complain "[_ survey.lt_Survey_survey_id_does]" - } + if {![db_0or1row survey_exists {}]} { + ad_complain "[_ survey.lt_Survey_survey_id_does]" + } } } -properties { @@ -34,7 +34,7 @@ permission::require_permission -object_id $survey_id -privilege survey_take_survey - get_survey_info -survey_id $survey_id + survey::get_info -survey_id $survey_id set name $survey_info(name) set description $survey_info(description) set description_html_p $survey_info(description_html_p) @@ -44,20 +44,20 @@ if {$description_html_p != "t"} { set description [ad_text_to_html -- $description] - } - + } + set context [list "[_ survey.Preview] $name"] -# build a list containing the HTML (generated with survey_question_display) for each question +# build a list containing the HTML (generated with survey::display_question) for each question set rownum 0 - -set questions [list] +set questions {} + db_foreach survey_sections {} { db_foreach question_ids_select {} { - lappend questions [survey_question_display $question_id] + lappend questions [survey::display_question $question_id] } @@ -67,3 +67,9 @@ set form_vars [export_vars -form {section_id survey_id}] ad_return_template + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: