Index: openacs-4/packages/simple-survey/sql/oracle/simple-survey-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simple-survey/sql/oracle/simple-survey-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/simple-survey/sql/oracle/simple-survey-create.sql 11 Feb 2002 07:10:48 -0000 1.2 +++ openacs-4/packages/simple-survey/sql/oracle/simple-survey-create.sql 15 Mar 2002 05:26:42 -0000 1.3 @@ -129,6 +129,7 @@ constraint survsimp_surv_single_edit_p_ck check(single_editable_p in ('t','f')), type varchar(20), + display_type varchar(20), package_id integer constraint survsimp_package_id_nn not null constraint survsimp_package_id_fk references @@ -328,6 +329,8 @@ single_editable_p in survsimp_surveys.single_editable_p%TYPE default 't', enabled_p in survsimp_surveys.enabled_p%TYPE default 'f', type in survsimp_surveys.type%TYPE default 'general', + display_type in survsimp_surveys.display_type%TYPE + default 'list', package_id in survsimp_surveys.package_id%TYPE, object_type in acs_objects.object_type%TYPE default 'survsimp_survey', creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -355,6 +358,8 @@ single_editable_p in survsimp_surveys.single_editable_p%TYPE default 't', enabled_p in survsimp_surveys.enabled_p%TYPE default 'f', type in survsimp_surveys.type%TYPE default 'general', + display_type in survsimp_surveys.display_type%TYPE + default 'list', package_id in survsimp_surveys.package_id%TYPE, object_type in acs_objects.object_type%TYPE default 'survsimp_survey', creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -375,10 +380,10 @@ ); insert into survsimp_surveys (survey_id, name, short_name, description, description_html_p, - single_response_p, single_editable_p, enabled_p, type, package_id) + single_response_p, single_editable_p, enabled_p, type, display_type, package_id) values (v_survey_id, new.name, new.short_name, new.description, new.description_html_p, - new.single_response_p, new.single_editable_p, new.enabled_p, new.type, new.package_id); + new.single_response_p, new.single_editable_p, new.enabled_p, new.type, new.display_type, new.package_id); return v_survey_id; end new; Index: openacs-4/packages/simple-survey/sql/postgresql/simple-survey-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simple-survey/sql/postgresql/simple-survey-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/simple-survey/sql/postgresql/simple-survey-create.sql 19 Jul 2001 22:40:55 -0000 1.1 +++ openacs-4/packages/simple-survey/sql/postgresql/simple-survey-create.sql 15 Mar 2002 05:26:42 -0000 1.2 @@ -179,7 +179,8 @@ single_editable_p boolean, -- was char(1) -- constraint survsimp_surv_single_edit_p_ck -- check(single_editable_p in ('t','f')), - type varchar(20) + type varchar(20), + display_type varchar(20), ); -- each question can be @@ -421,7 +422,7 @@ -- create or replace package body survsimp_survey -- procedure new -create function survsimp_survey__new (integer,varchar,varchar,text,boolean,boolean,boolean,boolean,varchar,integer,integer) +create function survsimp_survey__new (integer,varchar,varchar,text,boolean,boolean,boolean,boolean,varchar,varchar,integer,integer) returns integer as ' declare new__survey_id alias for $1; -- default null @@ -433,8 +434,9 @@ new__single_editable_p alias for $7; -- default t new__enabled_p alias for $8; -- default f new__type alias for $9; -- default general - new__creation_user alias for $10; -- default null - new__context_id alias for $11; -- default null + new__display_type alias for $10; + new__creation_user alias for $11; -- default null + new__context_id alias for $12; -- default null v_survey_id integer; begin v_survey_id := acs_object__new ( @@ -449,11 +451,11 @@ insert into survsimp_surveys (survey_id, name, short_name, description, description_html_p, single_response_p, single_editable_p, - enabled_p, type) + enabled_p, type, display_type) values (v_survey_id, new__name, new__short_name, new__description, new__description_html_p, new__single_response_p, new__single_editable_p, - new__enabled_p, new__type); + new__enabled_p, new__type, new__display_type); return v_survey_id; Index: openacs-4/packages/simple-survey/tcl/survsimp-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simple-survey/tcl/survsimp-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/simple-survey/tcl/survsimp-procs.tcl 1 Jul 2001 18:57:49 -0000 1.3 +++ openacs-4/packages/simple-survey/tcl/survsimp-procs.tcl 15 Mar 2002 05:26:42 -0000 1.4 @@ -446,6 +446,25 @@ return $date } + +ad_proc -public survsimp_display_types { +} { + return {list table paragraph} +} + +# added by Ben (far later than the code below, bt_mergepice, OMG) +ad_proc -public survsimp_display_type_select { + {-name "display_type"} + {-value "list"} +} { + set return_html "" + + return $return_html +} proc_doc survsimp_bt_mergepiece {htmlpiece values} { HTMLPIECE is a form usually; VALUES is an ns_set Index: openacs-4/packages/simple-survey/www/admin/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simple-survey/www/admin/one.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/simple-survey/www/admin/one.adp 25 Feb 2002 20:28:14 -0000 1.1 +++ openacs-4/packages/simple-survey/www/admin/one.adp 15 Mar 2002 05:26:42 -0000 1.2 @@ -7,6 +7,7 @@
  • Name: @survey_name@ [ edit ]
  • Created: <%= [util_AnsiDatetoPrettyDate $creation_date] %>
  • Status: @survey_status@ @toggle_enabled_link@ +
  • Display Type: @display_type@ @display_type_toggle@
  • Responses per user: @survey_response_limit@ [ @response_limit_toggle@ @response_editable_link@ ]
  • Description: @survey_description@ [ edit ]
  • Type: @type@ Index: openacs-4/packages/simple-survey/www/admin/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simple-survey/www/admin/one.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/simple-survey/www/admin/one.tcl 14 Mar 2002 19:43:19 -0000 1.3 +++ openacs-4/packages/simple-survey/www/admin/one.tcl 15 Mar 2002 05:26:42 -0000 1.4 @@ -22,7 +22,7 @@ first_names || ' ' || last_name as creator_name, creation_user, creation_date, decode(enabled_p, 't', 'Enabled', 'f', 'Disabled') as survey_status, enabled_p, decode(single_response_p, 't', 'One', 'f', 'Multiple') as survey_response_limit, -decode(single_editable_p, 't', 'Editable', 'f', 'Non-editable') as survey_editable_single, type +decode(single_editable_p, 't', 'Editable', 'f', 'Non-editable') as survey_editable_single, type, display_type from survsimp_surveys, acs_objects, persons where object_id = survey_id and person_id = creation_user @@ -50,6 +50,25 @@ } append toggle_enabled_link " \]" +# Display Type (ben) +set display_type_toggle "\[ " +set d_count 0 +foreach one_disp_type [survsimp_display_types] { + if {$one_disp_type == $display_type} { + continue + } + + if {$d_count > 0} { + append display_type_toggle " | " + } + + incr d_count + + append display_type_toggle "$one_disp_type" +} + +append display_type_toggle " \]" + set questions_summary "
      \n" set count 0 Index: openacs-4/packages/simple-survey/www/admin/one.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simple-survey/www/admin/one.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/simple-survey/www/admin/one.xql 15 Jun 2001 01:06:39 -0000 1.1 +++ openacs-4/packages/simple-survey/www/admin/one.xql 15 Mar 2002 05:26:42 -0000 1.2 @@ -8,7 +8,7 @@ first_names || ' ' || last_name as creator_name, creation_user, creation_date, (case when enabled_p = 't' then 'Enabled' when enabled_p = 'f' then 'Disabled' end) as survey_status, enabled_p, (case when single_response_p = 't' then 'One' when single_response_p = 'f' then 'Multiple' end) as survey_response_limit, -(case when single_editable_p = 't' then 'Editable' when single_editable_p = 'f' then 'Non-editable' end) as survey_editable_single, type +(case when single_editable_p = 't' then 'Editable' when single_editable_p = 'f' then 'Non-editable' end) as survey_editable_single, type,display_type from survsimp_surveys, acs_objects, persons where object_id = survey_id and person_id = creation_user Index: openacs-4/packages/simple-survey/www/admin/question-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simple-survey/www/admin/question-add-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/simple-survey/www/admin/question-add-2.tcl 15 Jun 2001 00:45:42 -0000 1.2 +++ openacs-4/packages/simple-survey/www/admin/question-add-2.tcl 15 Mar 2002 05:26:42 -0000 1.3 @@ -97,8 +97,6 @@ } elseif { $type == "general" } { - - # Display presentation options for sizing text input fields and textareas. set presentation_options "" @@ -175,7 +173,6 @@ "upload_file" { set response_type_html "" } - } set form_var_list [export_form_vars survey_id question_id question_text presentation_type after required_p active_p type] @@ -185,7 +182,7 @@ doc_return 200 text/html "[ad_header "Add A Question (cont.)"]

      $name

      -[ad_context_bar_ws_or_index [list "" "Simple Survey Admin"] [list "one?[export_url_vars survey_id]" "Administer Survey"] "Add A Question"] +[ad_context_bar_ws_or_index [list "./" "Simple Survey Admin"] [list "one?[export_url_vars survey_id]" "Administer Survey"] "Add A Question"]
      Index: openacs-4/packages/simple-survey/www/admin/question-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simple-survey/www/admin/question-add.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/simple-survey/www/admin/question-add.tcl 25 Feb 2002 20:27:41 -0000 1.3 +++ openacs-4/packages/simple-survey/www/admin/question-add.tcl 15 Mar 2002 05:26:42 -0000 1.4 @@ -31,11 +31,11 @@ set return_html " Response Presentation: