Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/one-question.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/one-question.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/one-section-admin.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/one-section-admin.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/one-section.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/one-section.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/one-survey-questions-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/one-survey-questions.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/one-survey-questions.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/one-survey-questions.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/respond-new.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/lib/respond-new.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/contrib/packages/survey/lib/respond.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/lib/Attic/respond.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/contrib/packages/survey/lib/respond.tcl 2 Sep 2004 15:17:47 -0000 1.1.2.1 +++ openacs-4/contrib/packages/survey/lib/respond.tcl 1 Jan 2005 17:38:59 -0000 1.1.2.2 @@ -89,10 +89,14 @@ ad_form \ -extend \ -name $form_name \ + -on_request { + foreach section_id $section_ids { + survey::form::set_value_survey_section -form take_survey -section_id $section_id -response_id $response_id + } + } \ -after_submit { rp_internal_redirect "/packages/survey/www/process-response" ad_script_abort -# ad_returnredirect $return_url } set style "survey/standard" Index: openacs-4/contrib/packages/survey/sql/oracle/survey-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/sql/oracle/Attic/survey-create.sql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/contrib/packages/survey/sql/oracle/survey-create.sql 26 Jan 2004 15:39:41 -0000 1.2 +++ openacs-4/contrib/packages/survey/sql/oracle/survey-create.sql 1 Jan 2005 17:38:59 -0000 1.2.2.1 @@ -110,9 +110,7 @@ name varchar(4000) constraint surveys_name_nn not null, - description varchar(4000) - constraint surveys_desc_nn - not null, + description varchar(4000), description_html_p char(1) constraint surveys_desc_html_p_ck check(description_html_p in ('t','f')), @@ -157,9 +155,7 @@ name varchar(4000) constraint survey_sections_name_nn not null, - description clob - constraint survey_sections_desc_nn - not null, + description clob, description_html_p char(1) constraint survey_sections_desc_html_p_ck check(description_html_p in ('t','f')), Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/sql/oracle/upgrade/upgrade-5.1.4d1-5.1.4d2.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/contrib/packages/survey/sql/postgresql/survey-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/sql/postgresql/Attic/survey-create.sql,v diff -u -r1.3.2.2 -r1.3.2.3 --- openacs-4/contrib/packages/survey/sql/postgresql/survey-create.sql 23 Dec 2004 08:36:28 -0000 1.3.2.2 +++ openacs-4/contrib/packages/survey/sql/postgresql/survey-create.sql 1 Jan 2005 17:38:59 -0000 1.3.2.3 @@ -121,9 +121,7 @@ name varchar(4000) constraint surveys_name_nn not null, - description text - constraint surveys_desc_nn - not null, + description text, description_html_p boolean not null, enabled_p boolean not null, -- limit to one response per user @@ -160,9 +158,7 @@ name varchar(4000) constraint survey_sections_name_nn not null, - description text - constraint survey_sections_desc_nn - not null, + description text, description_html_p boolean, pretty_id varchar(100), sort_key integer default 0 not null, Index: openacs-4/contrib/packages/survey/sql/postgresql/survey-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/sql/postgresql/Attic/survey-package-create.sql,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/contrib/packages/survey/sql/postgresql/survey-package-create.sql 21 Oct 2004 07:46:12 -0000 1.2.2.4 +++ openacs-4/contrib/packages/survey/sql/postgresql/survey-package-create.sql 1 Jan 2005 17:39:00 -0000 1.2.2.5 @@ -1,4 +1,5 @@ -- API for survey objects +select define_function_args('survey__new','survey_id,name,description,description_html_p;f,single_response_p;f,editable_p;f,enabled_p;f,single_section_p;t,type;general,display_type,package_id,public_p,creation_user,context_id'); create or replace function survey__new (integer,varchar,text,boolean,boolean,boolean,boolean,boolean,varchar,varchar,integer,boolean,integer,integer) returns integer as ' @@ -14,7 +15,7 @@ new__type alias for $9; -- default general new__display_type alias for $10; new__package_id alias for $11; - new__public_p alias for $12; -- default t + new__public_p alias for $12; -- default t new__creation_user alias for $13; -- default null new__context_id alias for $14; -- default null v_survey_id integer; @@ -41,6 +42,8 @@ end;' language 'plpgsql'; +select define_function_args('survey__remove','survey_id'); + create or replace function survey__remove (integer) returns integer as ' declare @@ -50,19 +53,19 @@ begin for v_response_row in SELECT - response_id + response_id from survey_responses where survey_id=remove__survey_id and initial_response_id is NULL loop - PERFORM survey_response__remove(v_response_row.response_id); + PERFORM survey_response__remove(v_response_row.response_id); end loop; for v_section_row in select section_id - from survey_sections - where survey_id=remove__survey_id + from survey_sections + where survey_id=remove__survey_id loop - PERFORM survey_section__remove(v_section_row.section_id); + PERFORM survey_section__remove(v_section_row.section_id); end loop; delete from surveys @@ -77,8 +80,8 @@ create or replace function survey__name (integer) returns varchar as ' declare - name__survey_id alias for $1; - v_name surveys.name%TYPE; + name__survey_id alias for $1; + v_name surveys.name%TYPE; begin select into v_name name from surveys @@ -87,30 +90,25 @@ return v_name; end;' language 'plpgsql'; --- API for survey_section objects ---Create a new survey with a pretty_id - -- API for survey_section objects - ---Create a new survey with a pretty_id - -create or replace function survey_section__new (integer,integer,varchar,text,boolean,integer,boolean,boolean,boolean,boolean,integer,integer,text) +select define_function_args('survey_section__new','section_id,survey_id,name,description,description_html_p;f,sort_key;0,branch_p;f,branched_p;f,block_section_p;f,page_break_p;t,creation_user,context_id,pretty_id'); +create or replace function survey_section__new (integer,integer,varchar,text,boolean,integer,boolean,boolean,boolean,boolean,integer,integer,integer) returns integer as ' declare new__section_id alias for $1; -- default null new__survey_id alias for $2; -- default null new__name alias for $3; -- default null new__description alias for $4; -- default null new__description_html_p alias for $5; -- default f - new__sort_key alias for $6; -- default 0 - new__branch_p alias for $7; -- default f - new__branched_p alias for $8; -- default f - new__block_section_p alias for $9; -- default f - new__page_break_p alias for $10; -- default t + new__sort_key alias for $6; -- default 0 + new__branch_p alias for $7; -- default f + new__branched_p alias for $8; -- default f + new__block_section_p alias for $9; -- default f + new__page_break_p alias for $10; -- default t new__creation_user alias for $11; -- default null new__context_id alias for $12; -- default null - new__pretty_id alias for $13; -- default section_id + new__pretty_id alias for $13; v_section_id integer; begin v_section_id := acs_object__new ( @@ -123,54 +121,80 @@ ); insert into survey_sections - (section_id, survey_id, name, description, description_html_p, sort_key, branch_p, branched_p, page_break_p, block_section_p, pretty_id) + (section_id, survey_id, name, description, description_html_p, sort_key, branch_p, branched_p, page_break_p, block_section_p,pretty_id) values (v_section_id, new__survey_id, new__name, new__description, new__description_html_p, new__sort_key, new__branch_p, new__branched_p, new__page_break_p, new__block_section_p, new__pretty_id); return v_section_id; end;' language 'plpgsql'; ---Have the old API default to using the section_id +create or replace function survey_section__remove (integer) +returns integer as ' +declare + remove__section_id alias for $1; + v_question_row survey_questions%ROWTYPE; +begin + delete from survey_branches where section_id=remove__section_id; + delete from survey_conditions where question_id in (select question_id from survey_questions where section_id=remove__section_id); + for v_question_row in select question_id + from survey_questions + where section_id=remove__section_id + loop + PERFORM survey_question__remove(v_question_row.question_id); + end loop; -create or replace function survey_section__new (integer,integer,varchar,text,boolean,integer,boolean,boolean,boolean,boolean,integer,integer) + delete from survey_sections + where section_id = remove__section_id; + + PERFORM acs_object__delete(remove__section_id); + + return 0; + +end;' language 'plpgsql'; + +-- API for predefined questions + +create or replace function survey_predefined_question__new (integer,text,varchar,varchar,varchar,varchar,boolean,varchar,varchar,text,varchar,varchar,varchar,integer,integer) returns integer as ' declare - new__section_id alias for $1; -- default null - new__survey_id alias for $2; -- default null - new__name alias for $3; -- default null - new__description alias for $4; -- default null - new__description_html_p alias for $5; -- default f - new__sort_key alias for $6; -- default 0 - new__branch_p alias for $7; -- default f - new__branched_p alias for $8; -- default f - new__block_section_p alias for $9; -- default f - new__page_break_p alias for $10; -- default t - new__creation_user alias for $11; -- default null - new__context_id alias for $12; -- default null - v_section_id integer; + new__predefined_question_id alias for $1; -- default null + new__question_text alias for $2; -- default null + new__abstract_data_type alias for $3; -- default null + new__presentation_type alias for $4; -- default null + new__presentation_options alias for $5; -- default null + new__presentation_alignment alias for $6; -- default below + new__question_html_p alias for $7; -- default f + new__summary_type alias for $8; + new__action_type alias for $9; -- default null + new__tcl alias for $10; -- default null + new__table_name alias for $11; -- default null + new__column_name alias for $12; -- default null + new__key_name alias for $13; -- default null + new__creation_user alias for $14; -- default null + new__context_id alias for $15; -- default null + v_predefined_question_id survey_predefined_questions.predefined_question_id%TYPE; begin - v_section_id := acs_object__new ( - new__section_id, - ''survey_section'', + v_predefined_question_id := acs_object__new ( + new__predefined_question_id, + ''survey_predefined_question'', now(), new__creation_user, null, new__context_id ); - insert into survey_sections - (section_id, survey_id, name, description, description_html_p, sort_key, branch_p, branched_p, page_break_p, block_section_p, pretty_id) + insert into survey_predefined_questions + (predefined_question_id,question_text,abstract_data_type,presentation_type,presentation_options,presentation_alignment,question_html_p,summary_type,action_type,tcl,table_name,column_name,key_name) values - (v_section_id, new__survey_id, new__name, new__description, new__description_html_p, new__sort_key, new__branch_p, new__branched_p, new__page_break_p, new__block_section_p, v_section_id); + (v_predefined_question_id,new__question_text,new__abstract_data_type,new__presentation_type,new__presentation_options,new__presentation_alignment,new__question_html_p,new__summary_type,new__action_type,new__tcl,new__table_name,new__column_name,new__key_name); + + return v_predefined_question_id; - return v_section_id; - end;' language 'plpgsql'; ---API for a question with a pretty_id passed in. - -create or replace function survey_question__new (integer,integer,integer,text,varchar,boolean,boolean,varchar,varchar,varchar,boolean,varchar,varchar,integer,integer,integer,text) +-- API for Survey questions +create or replace function survey_question__new (integer,integer,integer,text,varchar,boolean,boolean,varchar,varchar,varchar,boolean,varchar,varchar,integer,integer,integer) returns integer as ' declare new__question_id alias for $1; -- default null @@ -183,13 +207,12 @@ new__presentation_type alias for $8; -- default null new__presentation_options alias for $9; -- default null new__presentation_alignment alias for $10; -- default below - new__question_html_p alias for $11; -- default f - new__summary_type alias for $12; - new__answer_description alias for $13; - new__predefined_question_id alias for $14; -- default null + new__question_html_p alias for $11; -- default f + new__summary_type alias for $12; + new__answer_description alias for $13; + new__predefined_question_id alias for $14; -- default null new__creation_user alias for $15; -- default null new__context_id alias for $16; -- default null - new__pretty_id alias for $17; v_question_id integer; begin v_question_id := acs_object__new ( @@ -205,20 +228,20 @@ (question_id, section_id, sort_order, question_text, abstract_data_type, required_p, active_p, presentation_type, presentation_options, - presentation_alignment, predefined_question_id, pretty_id) + presentation_alignment, predefined_question_id) values (v_question_id, new__section_id, new__sort_order, new__question_text, new__abstract_data_type, new__required_p, new__active_p, new__presentation_type, new__presentation_options, - new__presentation_alignment, new__predefined_question_id, new__pretty_id); + new__presentation_alignment, new__predefined_question_id); return v_question_id; end;' language 'plpgsql'; ---Default the old api to use question_id -create or replace function survey_question__new (integer,integer,integer,text,varchar,boolean,boolean,varchar,varchar,varchar,boolean,varchar,varchar,integer,integer,integer) +select define_function_args('survey_question__new','question_id,section_id,sort_order,question_text,abstract_data_type,required_p;t,active_p,presentation_type,presentation_options,presentation_alignment;below,question_html_p;f,summary_type,answer_description,predefined_qustion_id,creation_user,context_id,pretty_id'); +create or replace function survey_question__new (integer,integer,integer,text,varchar,boolean,boolean,varchar,varchar,varchar,boolean,varchar,varchar,integer,integer,integer,integer) returns integer as ' declare new__question_id alias for $1; -- default null @@ -227,16 +250,17 @@ new__question_text alias for $4; -- default null new__abstract_data_type alias for $5; -- default null new__required_p alias for $6; -- default t - new__active_p alias for $7; -- default f + new__active_p alias for $7; -- default new__presentation_type alias for $8; -- default null new__presentation_options alias for $9; -- default null - new__presentation_alignment alias for $10; -- default ''below'' - new__question_html_p alias for $11; -- default f - new__summary_type alias for $12; - new__answer_description alias for $13; - new__predefined_question_id alias for $14; -- default null + new__presentation_alignment alias for $10; -- default below + new__question_html_p alias for $11; -- default f + new__summary_type alias for $12; + new__answer_description alias for $13; + new__predefined_question_id alias for $14; -- default null new__creation_user alias for $15; -- default null new__context_id alias for $16; -- default null + new__pretty_id alias for $17; v_question_id integer; begin v_question_id := acs_object__new ( @@ -252,97 +276,30 @@ (question_id, section_id, sort_order, question_text, abstract_data_type, required_p, active_p, presentation_type, presentation_options, - presentation_alignment, predefined_question_id, pretty_id) + presentation_alignment, predefined_question_id,pretty_id) values (v_question_id, new__section_id, new__sort_order, new__question_text, new__abstract_data_type, new__required_p, new__active_p, new__presentation_type, new__presentation_options, - new__presentation_alignment, new__predefined_question_id, v_question_id); + new__presentation_alignment, new__predefined_question_id,new__pretty_id); return v_question_id; end;' language 'plpgsql'; -create or replace function survey_section__remove (integer) -returns integer as ' -declare - remove_section_id alias for $1; - v_question_row survey_questions%ROWTYPE; -begin - delete from survey_branches where section_id=remove_section_id; - delete from survey_conditions where question_id in (select question_id from survey_questions where section_id=remove_section_id); - for v_question_row in select question_id - from survey_questions - where section_id=remove_section_id - loop - PERFORM survey_question__remove(v_question_row.question_id); - end loop; - - delete from survey_sections - where section_id = remove_section_id; - - PERFORM acs_object__delete(remove_section_id); - - return 0; - -end;' language 'plpgsql'; - --- API for predefined questions - -create or replace function survey_predefined_question__new (integer,text,varchar,varchar,varchar,varchar,boolean,varchar,varchar,text,varchar,varchar,varchar,integer,integer) -returns integer as ' -declare - new__predefined_question_id alias for $1; -- default null - new__question_text alias for $2; -- default null - new__abstract_data_type alias for $3; -- default null - new__presentation_type alias for $4; -- default null - new__presentation_options alias for $5; -- default null - new__presentation_alignment alias for $6; -- default below - new__question_html_p alias for $7; -- default f - new__summary_type alias for $8; - new__action_type alias for $9; -- default null - new__tcl alias for $10; -- default null - new__table_name alias for $11; -- default null - new__column_name alias for $12; -- default null - new__key_name alias for $13; -- default null - new__creation_user alias for $14; -- default null - new__context_id alias for $15; -- default null - v_predefined_question_id survey_predefined_questions.predefined_question_id%TYPE; -begin - v_predefined_question_id := acs_object__new ( - new__predefined_question_id, - ''survey_predefined_question'', - now(), - new__creation_user, - null, - new__context_id - ); - - insert into survey_predefined_questions - (predefined_question_id,question_text,abstract_data_type,presentation_type,presentation_options,presentation_alignment,question_html_p,summary_type,action_type,tcl,table_name,column_name,key_name) - values - (v_predefined_question_id,new__question_text,new__abstract_data_type,new__presentation_type,new__presentation_options,new__presentation_alignment,new__question_html_p,new__summary_type,new__action_type,new__tcl,new__table_name,new__column_name,new__key_name); - - return v_predefined_question_id; - -end;' language 'plpgsql'; - --- API for Survey questions - - create or replace function survey_question__remove (integer) returns integer as ' declare remove__question_id alias for $1; begin - delete from survey_question_responses - where question_id=remove__question_id; + delete from survey_question_responses + where question_id=remove__question_id; - delete from survey_question_choices - where question_id=remove__question_id; + delete from survey_question_choices + where question_id=remove__question_id; - delete from survey_questions + delete from survey_questions where question_id = remove__question_id; PERFORM acs_object__delete(remove__question_id); @@ -351,6 +308,8 @@ end;' language 'plpgsql'; + + -- API for survey responses create or replace function survey_response__new(integer,integer,varchar,boolean,integer,varchar,integer,integer) @@ -388,19 +347,30 @@ create or replace function survey_response__initial_response_id(integer) returns integer as ' declare - p_response_id alias for $1; - v_initial_response_id integer; + p_response_id alias for $1; + v_initial_response_id integer; begin select into v_initial_response_id initial_response_id from survey_responses where response_id = p_response_id; if v_initial_response_id is NULL then - v_initial_response_id := p_response_id; + v_initial_response_id := p_response_id; end if; return v_initial_response_id; -end;' language 'plpgsql'; +end;' language 'plpgsql' stable; +create or replace function survey_response__initial_user_id (integer) +returns integer as ' +declare +p_response_id alias for $1; +v_user_id integer; +begin + select into v_user_id creation_user + from acs_objects where + object_id = survey_response__initial_response_id(p_response_id); +return v_user_id; +end;' language 'plpgsql' stable; -- procedure delete create or replace function survey_response__remove(integer) @@ -409,12 +379,12 @@ remove__response_id alias for $1; v_response_row survey_responses%ROWTYPE; begin - delete from survey_branches where section_id in (select section_id from survey_sections where survey_id=remove.survey_id); - delete from survey_conditions where question_id in (select question_id from survey_questions q, survey_sections s where s.section_id=q.section_id and s.survey_id=remove.survey_id); +-- delete from survey_branches where section_id in (select section_id from survey_sections where survey_id=remove.survey_id); +-- delete from survey_conditions where question_id in (select question_id from survey_questions q, survey_sections s where s.section_id=q.section_id and s.survey_id=remove.survey_id); for v_response_row in select response_id from survey_responses - where initial_response_id=remove__response_id + where initial_response_id=remove__response_id loop - PERFORM survey_response__del(v_response_row.response_id); + PERFORM survey_response__del(v_response_row.response_id); end loop; PERFORM survey_response__del(remove__response_id); @@ -426,50 +396,49 @@ create or replace function survey_response__del (integer) returns integer as ' declare - del__response_id alias for $1; - v_question_response_row survey_question_responses%ROWTYPE; + del__response_id alias for $1; + v_question_response_row survey_question_responses%ROWTYPE; begin - for v_question_response_row in select item_id - from survey_question_responses, cr_revisions - where response_id=del__response_id - and attachment_answer=revision_id - loop - PERFORM content_item__delete(item_id); - end loop; - - delete from survey_question_responses - where response_id=del__response_id; - delete from survey_responses - where response_id=del__response_id; - PERFORM acs_object__delete(del__response_id); + for v_question_response_row in select item_id + from survey_question_responses, cr_revisions + where response_id=del__response_id + and attachment_answer=revision_id + loop + PERFORM content_item__delete(item_id); + end loop; + + delete from survey_question_responses + where response_id=del__response_id; + delete from survey_responses + where response_id=del__response_id; + PERFORM acs_object__delete(del__response_id); return 0; end;' language 'plpgsql'; create or replace function survey_response__boolean_answer (varchar,integer) returns varchar as ' declare - boolean_answer__answer alias for $1; - boolean_answer__question_id alias for $2; - - v_answer varchar(100); - v_presentation_options survey_questions.presentation_options%TYPE; - v_split_pos integer; + boolean_answer__answer alias for $1; + boolean_answer__question_id alias for $2; + v_answer varchar(100); + v_presentation_options survey_questions.presentation_options%TYPE; + v_split_pos integer; begin if boolean_answer__answer is NOT NULL then select into v_presentation_options presentation_options - from survey_questions where question_id=boolean_answer__question_id; - - v_split_pos:= instr(v_presentation_options, ''/''); - - if boolean_answer__answer = ''t'' then - v_answer:=substr(v_presentation_options, 1, v_split_pos -1 ); - end if; - if boolean_answer__answer = ''f'' then - v_answer:=substr(v_presentation_options, v_split_pos + 1 ); - end if; - + from survey_questions where question_id=boolean_answer__question_id; + + v_split_pos:= instr(v_presentation_options, ''/''); + + if boolean_answer__answer = ''t'' then + v_answer:=substr(v_presentation_options, 1, v_split_pos -1 ); + end if; + if boolean_answer__answer = ''f'' then + v_answer:=substr(v_presentation_options, v_split_pos + 1 ); + end if; + else v_answer := ''; end if; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/sql/postgresql/survey-search-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/survey/sql/postgresql/upgrade/upgrade-5.1.4d1-5.1.4d2'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/contrib/packages/survey/tcl/survey-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/tcl/Attic/survey-form-procs.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/contrib/packages/survey/tcl/survey-form-procs.tcl 2 Sep 2004 15:32:18 -0000 1.1.2.1 +++ openacs-4/contrib/packages/survey/tcl/survey-form-procs.tcl 1 Jan 2005 17:39:00 -0000 1.1.2.2 @@ -428,9 +428,9 @@ } } } - + set optional "" if {!$required_p} { - lappend element_param_list [list optional 1] + set optional ",optional" } if {[string equal $mode display]} { @@ -443,7 +443,7 @@ lappend element_param_list [list label $question_text] - set element_params [concat [list "$element_name:$element_type"] $element_param_list] + set element_params [concat [list "${element_name}:${element_type}${optional}"] $element_param_list] ns_log Notice "\nDEDS\nediting? $edit_previous_response_p\ncreating element using -- $element_params" Index: openacs-4/contrib/packages/survey/tcl/survey-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/tcl/Attic/survey-procs-postgresql.xql,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/contrib/packages/survey/tcl/survey-procs-postgresql.xql 12 Mar 2004 06:35:45 -0000 1.2 +++ openacs-4/contrib/packages/survey/tcl/survey-procs-postgresql.xql 1 Jan 2005 17:39:00 -0000 1.2.2.1 @@ -38,7 +38,7 @@ SELECT survey_question__new ( - NULL, + :new_question_id, :section_id, :new_sort_order, :question_text, @@ -53,7 +53,8 @@ :answer_description, :predefined_question_id, :user_id, - :section_id + :section_id, + :new_question_id ); @@ -84,7 +85,7 @@ select survey_section__new ( - NULL, + :new_section_id, :new_survey_id, :name, :description, @@ -95,7 +96,8 @@ :block_section_p, :page_break_p, :user_id, - :package_id + :package_id, + :new_section_id ); @@ -263,4 +265,30 @@ + + + + select survey_question__new ( + :question_id, + :section_id, + :sort_order, + :question_text, + :abstract_data_type, + :required_p, + :active_p, + :presentation_type, + :presentation_options, + :presentation_alignment, + :question_html_p, + :summary_type, + :answer_description, + NULL, + :creation_user, + :section_id, + :pretty_id + ) + + + + Index: openacs-4/contrib/packages/survey/tcl/survey-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/tcl/Attic/survey-procs.tcl,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/contrib/packages/survey/tcl/survey-procs.tcl 2 Sep 2004 15:17:47 -0000 1.4.2.1 +++ openacs-4/contrib/packages/survey/tcl/survey-procs.tcl 1 Jan 2005 17:39:00 -0000 1.4.2.2 @@ -524,7 +524,7 @@ } else { set new_sort_order $sort_order } - + set new_question_id [db_nextval acs_object_id_seq] set new_question_id [db_exec_plsql create_question {}] db_dml insert_question_text {} db_foreach get_survey_question_choices {} { @@ -562,6 +562,7 @@ foreach section_id $sections_list { db_1row get_section_info "" + set new_section_id [db_nextval acs_object_id_seq] set new_section_id [db_exec_plsql section_create {}] set new_section_ids($section_id) $new_section_id if {![empty_string_p $description]} { @@ -1020,3 +1021,803 @@ return $page_list } + + +ad_proc -public survey_new { + {-survey_id ""} + -name + -description + {-description_html_p "f"} + {-single_response_p "f"} + {-editable_p "f"} + {-enabled_p "f"} + {-single_section_p "t"} + {-type "general"} + {-display_type ""} + {-package_id ""} + {-public_p "t"} + {-creation_user ""} + {-context_id ""} +} { + + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-09-19 + + @param survey_id + + @param name + + @param description + + @param description_html_p + + @param single_response_p + + @param editable_p + + @param enabled_p + + @param single_section_p + + @param type + + @param display_type + + @param package_id + + @param public_p + + @param creation_user + + @param context_id + + @return + + @error +} { + if {[string equal "" $package_id]} { + if {[ad_conn -connected_p]} { + set package_id [ad_conn package_id] + } else { + error "package_id is required if called outside a http connection" + } + } + if {[string equal "" $context_id]} { + set context_id $package_id + } + set new_survey_id [package_exec_plsql \ + -var_list [list \ + [list survey_id $survey_id] \ + [list name $name] \ + [list description $description] \ + [list description_html_p $description_html_p] \ + [list single_response_p $single_response_p] \ + [list editable_p $editable_p] \ + [list enabled_p $enabled_p] \ + [list single_section_p $single_section_p] \ + [list type $type] \ + [list display_type $display_type] \ + [list package_id $package_id] \ + [list public_p $public_p] \ + [list creation_user $creation_user] \ + [list context_id $context_id] \ + ] "survey" "new"] + return $new_survey_id +} + +ad_proc -public survey_section_new { + {-section_id ""} + -survey_id + {-name ""} + {-description ""} + {-description_html_p "f"} + {-sort_key 1} + {-branch_p "f"} + {-branched_p "f"} + {-block_section_p "f"} + {-page_break_p "t"} + {-creation_user ""} + {-context_id ""} + {-pretty_id ""} +} { + + Create a new survey_section + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-09-19 + + @param section_id + + @param survey_id + + @param name + + @param description + + @param description_html_p + + @param sort_key + + @param branch_p + + @param branched_p + + @param block_section_p + + @param page_break_p + + @param creation_user + + @param context_id + + @return + + @error +} { + if {$context_id eq ""} { + set context_id $survey_id + } + return [package_exec_plsql \ + -var_list [list \ + [list section_id $section_id] \ + [list survey_id $survey_id] \ + [list name $name] \ + [list description $description] \ + [list description_html_p $description_html_p] \ + [list sort_key $sort_key] \ + [list branch_p $branch_p] \ + [list branched_p $branched_p] \ + [list block_section_p $block_section_p] \ + [list page_break_p $page_break_p] \ + [list creation_user $creation_user] \ + [list context_id $context_id]] \ + "survey_section" "new"] +} + +ad_proc -public survey_section_copy { + -section_id + {-new_survey_id ""} + {-new_name ""} + {-new_description ""} + {-new_section_id ""} + {-creation_user ""} +} { + + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-10-14 + + @param section_id + + @param new_section_id optional + + @param new_survey_id + + @return + + @error +} { + # get original section + db_1row get_section "select * from survey_sections where section_id=:section_id" + # create new section based on original + # calculate new sort_key?? + set sort_key 1 + if {$new_survey_id ne ""} { + set survey_id $new_survey_id + } + if {$new_name ne ""} { + set name $new_name + } + if {$new_description ne ""} { + set description $new_description + } + + set new_survey_id [survey_section_new \ + -section_id $new_section_id \ + -survey_id $survey_id \ + -name $name \ + -description $description \ + -description_html_p $description_html_p \ + -sort_key $sort_key \ + -branch_p $branch_p \ + -branched_p $branched_p \ + -block_section_p $block_section_p \ + -page_break_p $page_break_p \ + -creation_user $creation_user \ + -context_id $new_survey_id] + + return $new_section_id +} + +# procesure to handle median calculations + +namespace eval ::math::statistics:: {} + +# median + # Determine the median from a list of data + # + # Arguments: + # data (Unsorted) list of data + # + # Result: + # Median (either the middle value or the mean of two values in the + # middle) + # + # Note: + # Adapted from the Wiki page "Stats", code provided by JPS + # +proc ::math::statistics::median { data } { + set org_data $data + set data {} + foreach value $org_data { + if { $value != {} } { + lappend data $value + } + } + set len [llength $data] + + set data [lsort -real $data] + if { $len % 2 } { + lindex $data [expr {($len-1)/2}] + } else { + expr {([lindex $data [expr ($len / 2) - 1]] \ + + [lindex $data [expr $len / 2]]) / 2.0} + } +} + +ad_proc -public survey_question_new { + -question_id + -section_id + -question_text + {-question_html_p "f"} + {-presentation_options ""} + {-after ""} + -abstract_data_type + -presentation_type + -presentation_alignment + -valid_responses + -required_p + -active_p + {-creation_user ""} + {-pretty_id ""} +} { + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-10-23 + + @param section_id integer denoting which survey we're adding question to + @param question_id id of new question + @param after optional integer determining position of this question + @param question_text text of question + @param abstract_data_type string describing datatype we expect as answer + @param presentation_type string describing widget for providing answer + @param presentation_alignment string determining placement of answer widget relative to question text + @param valid_responses list containing possible choices + @param required_p flag telling us whether an answer to this question is mandatory + @param active_p flag telling us whether this question will show up at all + + @return new question_id + + @error +} { + set summary_type "" + set answer_description "" + + get_section_info -section_id $section_id + # Generate presentation_options. + set presentation_options "" + if { $presentation_type == "textbox" } { + if { [exists_and_not_null textbox_size] } { + # Will be "small", "medium", or "large". + set presentation_options $textbox_size + } + } elseif { $presentation_type == "textarea" } { + if { [exists_and_not_null textarea_size] } { + # Will be "small", "medium", or "large". + set presentation_options $textarea_size + } + } elseif { $abstract_data_type == "yn" } { + set abstract_data_type "boolean" + set presentation_options "Yes/No" + } elseif { $abstract_data_type == "boolean" } { + set presentation_options "True/False" + } + + + # if this is a block section, get the choices and run the block for + # every choice set + if {$section_info(block_section_p)=="t"} { + set all_choices_list [db_list all_choices ""] + } else { + set all_choices_list {dummy} + } + + set count 0 + foreach all_choices $all_choices_list { + # Get the canned responses for a block section if applicable + if {$section_info(block_section_p)=="t"} { + # block section, get the valid_responses + regsub -all "," $all_choices "\n" valid_responses + } + # If we insert multiple questions (because of block questions) + # generate a new question_id + if {$count>0} { + set question_id [db_nextval acs_object_id_seq] + } + incr count + + + if { [exists_and_not_null after] } { + # We're inserting between existing questions; move everybody down. + set sort_order [expr { $after + 1 }] + db_dml renumber_sort_orders {} + } else { + set sort_order [expr [db_string max_question {}] + 1] + } + + db_exec_plsql create_question {} + db_dml add_question_text {} + + # For questions where the user is selecting a canned response, insert + # the canned responses into survey_question_choices by parsing the valid_responses + # field. + + if { $presentation_type == "checkbox" || $presentation_type == "radio" || $presentation_type == "select" } { + if { $abstract_data_type == "choice" } { + # this proc now accepts a list of responses + # TODO create proc to split responses + set responses [split $valid_responses "\n"] + set count 0 + if {[info exists valid_responses]} { + foreach response $valid_responses { + # DB fix bug #204 need to address this in UI if necessary + # don't try to guess numeric value is seperated from answer by a comma + # foreach {response numeric_value} [split $response ","] break + set numeric_value "" + set trimmed_response [string trim $response] + if { [empty_string_p $trimmed_response] } { + # skip empty lines + continue + } + ### added this next line to + set choice_id [db_nextval survey_choice_id_sequence] + db_dml insert_survey_question_choice "" + incr count + } + } + } + } + } + return $question_id +} + +ad_proc -public survey_question_update { + -question_id + -section_id + -question_text + {-question_html_p "f"} + {-presentation_options ""} + -sort_order + -abstract_data_type + -presentation_type + -presentation_alignment + -valid_responses + -required_p + -active_p + {-creation_user ""} + {-new_section ""} + {-block_p "f"} +} { + + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-10-24 + + + @param section_id integer denoting which survey we're adding question to + @param question_id id of new question + @param sort_order optional integer determining position of this question + @param question_text text of question + @param abstract_data_type string describing datatype we expect as answer + @param presentation_type string describing widget for providing answer + @param presentation_alignment string determining placement of answer widget relative to question text + @param valid_responses list containing possible choices + @param required_p flag telling us whether an answer to this question is mandatory + @param active_p flag telling us whether this question will show up at all + + @return + + @error +} { + + db_transaction { + if {$new_section ne ""} { + set anchor [db_string new_anchor ""] + set section_id $new_section + } + + db_dml survey_question_update {} + + # add new responses is choice type question + + if {[info exists valid_responses] && $block_p=="f"} { +# TODO DAVEB add block question to this proc as well?? + set responses [split $valid_responses "\n"] + set count 0 + set response_list "" + foreach response $responses { + set numeric_value "" +# regexp {(.+),\s*(\d+)} $response discard response numeric_value + set trimmed_response [string trim $response] + set numeric_value [string trim $numeric_value] + if { [empty_string_p $trimmed_response] } { + # skip empty lines + continue + } + + lappend response_list [list "$trimmed_response" "$count" ${numeric_value}] + incr count + } + + set choice_id_to_update_list [db_list get_choice_id {}] + set sort_order 0 + foreach one_response $response_list { + set choice_label [lindex $one_response 0] + set sort_order [lindex $one_response 1] + set numeric_value [lindex $one_response 2] + set choice_id_to_update [lindex $choice_id_to_update_list $sort_order] + if {[empty_string_p $choice_id_to_update]} { + set new_choice_id [db_nextval survey_choice_id_sequence] + db_dml insert_new_choice {} + } else { + db_dml update_new_choice {} + } + incr sort_order + } + + while {[llength $choice_id_to_update_list] >= $sort_order} { + set choice_id_to_delete [lindex $choice_id_to_update_list $sort_order] + db_dml delete_old_choice {} + incr sort_order + } + + } + } on_error { + + db_release_unused_handles + ad_return_error "Database Error" "
$errmsg
" + ad_script_abort + + } + +} + +# FIXME DaveB convert this to new add to form api in survey-form-procs +ad_proc -public survey_question_add_to_form { + form + question_id + {response_id ""} +} {Adds the question to the form. the form has to be created by ad_form or with template::form::create. The form variable is of the form \"response_to_question.\$question_id} { + + if {![empty_string_p $response_id]} { + set edit_previous_response_p "t" + } else { + set edit_previous_response_p "f" + } + + set element_name "response_to_question.$question_id" + + db_1row survey_question_properties "" + + set user_value "" + + if {$predefined_question_id!=[db_null]} { + # question is a predefined question. If it has already been answered, get the last response value from the db + # if it is a predefined question with action_type="db" get the value from the db instead. + db_1row predefined_question_data "" + if {$action_type == "db"} { + # select preselected value from the db + set user_id [ad_get_user_id] + # We have to check for date + if {$abstract_data_type == "date"} { + set user_value [db_string ignore "select to_char($column_name,'YYYY MM DD') from $table_name where $key_name=:user_id" -default ""] + set date_answer $user_value + } else { + set user_value [db_string ignore "select $column_name from $table_name where $key_name=:user_id" -default ""] + set choice_id $user_value + set boolean_answer $user_value + set clob_answer $user_value + set number_answer $user_value + set varchar_answer $user_value + set attachment_answer $user_value + } + } else { + # select preselected value from latest response + set user_id [ad_get_user_id] + if {[db_0or1row locate_predef_preselect ""]} { + set count 0 + db_foreach prev_response_query_predef {} { + incr count + + if {$presentation_type == "checkbox" || $presentation_type == "checkbox_text} { + set selected_choices($choice_id) "t" + } + } if_no_rows { + set choice_id 0 + set boolean_answer "" + set clob_answer "" + set number_answer "" + set varchar_answer "" + set date_answer "" + set attachment_answer "" + } + set edit_previous_response_p "t" + } else { + set choice_id 0 + set boolean_answer "" + set clob_answer "" + set number_answer "" + set varchar_answer "" + set date_answer "" + set attachment_answer "" + } + } + } else { + if {$edit_previous_response_p == "t"} { + set user_id [ad_get_user_id] + + set count 0 + db_foreach prev_response_query {} { + incr count + + if {$presentation_type == "checkbox" || $presentation_type == "checkbox_text"} { + set selected_choices($choice_id) "t" + } + } if_no_rows { + set choice_id 0 + set boolean_answer "" + set clob_answer "" + set number_answer "" + set varchar_answer "" + set date_answer "" + set attachment_answer "" + } + } + } + + if {$edit_previous_response_p == "t"} { + switch -- $abstract_data_type { + "choice" { + if {[array exists selected_choices]} { + set choice_id [array names selected_choices] + } + switch -- $presentation_type { + "select_text" - "radio_text" - "checkbox_text" { + set user_value [list $choice_id $varchar_answer] + } + "select" - "radio" - "checkbox" { + set user_value $choice_id + } + } + } + "shorttext" { + set user_value $varchar_answer + } + "boolean" { + set user_value $boolean_answer + } + "integer" - + "number" { + set user_value $number_answer + } + "text" { + set user_value $clob_answer + } + "date" { + set user_value $date_answer + } + "blob" { + if {![empty_string_p $attachment_answer]} { + set package_id [ad_conn package_id] + set filename [db_string get_file_name ""] + regsub "_$response_id$" $filename "" filename + set user_value "Uploaded file: \"$filename\"" + } + } + } + } + + # add the form elements, depending on the presentation type +ns_log notice " +DB -------------------------------------------------------------------------------- +DB DAVE debugging procedure survey_question_add_to_form +DB -------------------------------------------------------------------------------- +DB optional_p = '${optional_p}' +DB question_id = '${question_id}' +DB --------------------------------------------------------------------------------" + switch -- $presentation_type { + "upload_file" { + template::element::create $form $element_name \ + -widget file \ + -label "$question_text" \ + -value $user_value + if {$optional_p} { + template::element::set_properties $form $element_name -optional + } + + } + "textbox" { + set html [ad_decode $presentation_options "large" {size 70} "medium" {size 40} {size 10}] + template::element::create $form $element_name \ + -datatype text \ + -widget text \ + -label "$question_text" \ + -value $user_value \ + -html $html + if {$optional_p} { + template::element::set_properties $form $element_name -optional + } + + } + "textarea" { + set html [ad_decode $presentation_options "large" {rows 20 cols 65} "medium" {rows 15 cols 55} {rows 8 cols 35}] + template::element::create $form $element_name \ + -datatype text \ + -widget textarea \ + -label "$question_text" \ + -value $user_value \ + -html $html + if {$optional_p} { + template::element::set_properties $form $element_name -optional + } + + } + "date" { + #set options {format "DD Month YYYY"} + template::element::create $form $element_name \ + -datatype date \ + -widget date \ + -label "$question_text" \ + -value $user_value + if {$optional_p} { + template::element::set_properties $form $element_name -optional + } + } + "select" { + if { $abstract_data_type == "boolean" } { + if {![empty_string_p $presentation_options]} { + set options_list [split $presentation_options "/"] + set choice_t [lindex $options_list 0] + set choice_f [lindex $options_list 1] + } else { + set choice_t "True" + set choice_f "False" + } + set options "{$choice_t t} {$choice_f f}" + } else { + # at some point, we may want to add a UI option for the admin + # to sepcify multiple or not for select + set optionlist [list] + db_foreach question_choices "" { + lappend optionlist [list $label $choice_id] + } + set options $optionlist + } + template::element::create $form $element_name \ + -datatype text \ + -widget select \ + -label "$question_text" \ + -value $user_value \ + -options $options + if {$optional_p} { + template::element::set_properties $form $element_name -optional + } + + } + "select_text" { + # at some point, we may want to add a UI option for the admin + # to sepcify multiple or not for select + set optionlist [list] + db_foreach question_choices "" { + lappend optionlist [list $label $choice_id] + } + set options $optionlist + template::element::create $form $element_name \ + -datatype select_text \ + -widget select_text \ + -label "$question_text" \ + -value $user_value \ + -options $options + if {$optional_p} { + template::element::set_properties $form $element_name -optional + } + + } + "radio" { + set widget "text(radio)" + if { $abstract_data_type == "boolean" } { + if {![empty_string_p $presentation_options]} { + set options_list [split $presentation_options "/"] + set choice_t [lindex $options_list 0] + set choice_f [lindex $options_list 1] + } else { + set choice_t "True" + set choice_f "False" + } + + set options "{$choice_t t} {$choice_f f}" + } else { + set optionlist [list] + db_foreach question_choices_2 "" { + # replace {xxx.gif} by image inclusion + regsub -all "\{(\[^\{\}\]*)\}" $label {} label + lappend optionlist [list $label $choice_id] + } + set options $optionlist + } + template::element::create $form $element_name \ + -datatype text \ + -widget radio \ + -label "$question_text" \ + -value $user_value \ + -options $options + if {$optional_p} { + template::element::set_properties $form $element_name -optional + } + } + "radio_text" { + set widget "text(radio)" + set optionlist [list] + db_foreach question_choices_2 "" { + # replace {xxx.gif} by image inclusion + regsub -all "\{(\[^\{\}\]*)\}" $label {} label + lappend optionlist [list $label $choice_id] + } + set options $optionlist + template::element::create $form $element_name \ + -datatype radio_text \ + -widget radio_text \ + -label "$question_text" \ + -value $user_value \ + -options $options + if {$optional_p} { + template::element::set_properties $form $element_name -optional + } + } + "checkbox" { + set choices [list] + set optionlist [list] + db_foreach question_choices_3 "" { + lappend optionlist [list $label $choice_id] + } + set options $optionlist + template::element::create $form $element_name \ + -datatype text \ + -widget checkbox \ + -label "$question_text" \ + -values $user_value \ + -options $options + if {$optional_p} { + template::element::set_properties $form $element_name -optional + } + } + "checkbox_text" { + set choices [list] + set optionlist [list] + db_foreach question_choices_3 "" { + lappend optionlist [list $label $choice_id] + } + set options $optionlist + template::element::create $form $element_name \ + -datatype checkbox_text \ + -widget checkbox_text \ + -label "$question_text" \ + -value $user_value \ + -options $options + if {$optional_p} { + template::element::set_properties $form $element_name -optional + } + } + } +} Index: openacs-4/contrib/packages/survey/www/process-response.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/Attic/process-response.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/contrib/packages/survey/www/process-response.tcl 2 Sep 2004 15:17:48 -0000 1.7.2.1 +++ openacs-4/contrib/packages/survey/www/process-response.tcl 1 Jan 2005 17:39:00 -0000 1.7.2.2 @@ -174,7 +174,7 @@ if {[db_string get_response_count {}] == 0} { db_exec_plsql create_response {} - } + } set question_info_list [db_list_of_lists survey_question_info_list {}] Index: openacs-4/contrib/packages/survey/www/respond.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/Attic/respond.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/contrib/packages/survey/www/respond.tcl 15 Feb 2004 13:56:12 -0000 1.3 +++ openacs-4/contrib/packages/survey/www/respond.tcl 1 Jan 2005 17:39:00 -0000 1.3.2.1 @@ -97,17 +97,29 @@ set section_ids [survey_next_sections -edit_p t $survey_id 0 $response_id] } -ad_form -name take_survey -action process-response -html {enctype multipart/form-data} -form { +ad_form -name take_survey -html {enctype multipart/form-data} -form { {survey_id:text(hidden) {value $survey_id}} {section_ids:text(hidden) {value $section_ids}} {response_id:text(hidden) {value $response_id}} {return_url:text(hidden) {value $return_url}} } foreach section_id $section_ids { - survey_section_add_to_form take_survey $section_id $response_id + survey::form::add_survey_section \ + -form take_survey \ + -section_id $section_id \ + -response_id $response_id \ + -edit_p $edit_p } +ad_form \ + -extend \ + -name take_survey \ + -after_submit { + rp_internal_redirect "/packages/survey/www/process-response" + ad_script_abort + } + # status bar set status_bar [survey_status_bar [lindex $section_ids 0]] Index: openacs-4/contrib/packages/survey/www/admin/question-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/admin/Attic/question-add.tcl,v diff -u -r1.2.2.2 -r1.2.2.3 --- openacs-4/contrib/packages/survey/www/admin/question-add.tcl 22 Oct 2004 05:15:36 -0000 1.2.2.2 +++ openacs-4/contrib/packages/survey/www/admin/question-add.tcl 1 Jan 2005 17:39:00 -0000 1.2.2.3 @@ -62,7 +62,7 @@ } } ad_form -extend -name create_question -form { - {required_p:text(radio) {label "[_ survey.Required]"} {options {{[_ survey.Yes t} {_ survey.No f}}} {value t}} + {required_p:text(radio) {label "[_ survey.Required]"} {options {{[_ survey.Yes] t} {[_ survey.No] f}}} {value t}} } set catalogue_link "predefined-question?[export_url_vars section_id after]" ad_return_template Index: openacs-4/contrib/packages/survey/www/admin/question-modify.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/admin/Attic/question-modify.xql,v diff -u -r1.2.4.1 -r1.2.4.2 --- openacs-4/contrib/packages/survey/www/admin/question-modify.xql 2 Sep 2004 15:17:48 -0000 1.2.4.1 +++ openacs-4/contrib/packages/survey/www/admin/question-modify.xql 1 Jan 2005 17:39:00 -0000 1.2.4.2 @@ -67,7 +67,8 @@ active_p=:active_p, required_p=:required_p, presentation_type=:presentation_type, - presentation_options=:presentation_options + presentation_options=:presentation_options, + pretty_id=:pretty_id where question_id=:question_id Index: openacs-4/contrib/packages/survey/www/admin/survey-copy-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/admin/Attic/survey-copy-postgresql.xql,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/contrib/packages/survey/www/admin/survey-copy-postgresql.xql 19 Sep 2003 16:48:05 -0000 1.1 +++ openacs-4/contrib/packages/survey/www/admin/survey-copy-postgresql.xql 1 Jan 2005 17:39:00 -0000 1.1.4.1 @@ -32,7 +32,8 @@ :description, :description_html_p, :user_id, - :package_id + :package_id, + :new_section_id ); Index: openacs-4/contrib/packages/survey/www/admin/survey-create-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/admin/Attic/survey-create-postgresql.xql,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/contrib/packages/survey/www/admin/survey-create-postgresql.xql 19 Sep 2003 16:48:05 -0000 1.1 +++ openacs-4/contrib/packages/survey/www/admin/survey-create-postgresql.xql 1 Jan 2005 17:39:00 -0000 1.1.4.1 @@ -38,7 +38,8 @@ 'f', 't', :user_id, - :package_id + :package_id, + :section_id )