Index: openacs-4/packages/assessment/www/asm-admin/assessment-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/assessment-form.tcl,v diff -u -r1.9.2.7 -r1.9.2.8 --- openacs-4/packages/assessment/www/asm-admin/assessment-form.tcl 20 Jul 2005 15:43:58 -0000 1.9.2.7 +++ openacs-4/packages/assessment/www/asm-admin/assessment-form.tcl 21 Jul 2005 18:28:12 -0000 1.9.2.8 @@ -80,13 +80,9 @@ } -if {[string eq $edit_f d] || [empty_string_p $edit_f]} { - if { $type > 1 } { +if {([string eq $edit_f d] || [empty_string_p $edit_f]) && ($type == 2)} { ad_form -extend -name assessment_form -form { {description:text(textarea),optional {label "[_ assessment.Description]"} {html {rows 5 cols 80}} {help_text "[_ assessment.as_Description_help]"}} } - } else { - ad_form -extend -name assessment_form -form { {description:text(hidden) {value ""}}} - } } else { ad_form -extend -name assessment_form -form { {description:text(hidden) {value ""}}} } @@ -103,71 +99,140 @@ ad_form -extend -name assessment_form -form {{instructions:text(hidden) {value ""}}} } -if { $type > 1 && [empty_string_p $edit_f]} { +if { $type == 2 && [empty_string_p $edit_f]} { ad_form -extend -name assessment_form -form { {run_mode:text,optional,nospell {label "[_ assessment.Mode]"} {html {size 25 maxlength 25}} {help_text "[_ assessment.as_Mode_help]"}} } +} else { + ad_form -extend -name assessment_form -form { {run_mode:text(hidden) {value {}}} } } - -if { !$permission_p } { - if { [empty_string_p $edit_f]} { +if { (!$permission_p) && [empty_string_p $edit_f] } { ad_form -extend -name assessment_form -form { {anonymous_p:text(select) {label "[_ assessment.Anonymous_Responses]"} {options $boolean_options} {help_text "[_ assessment.as_Anonymous_help]"} {value f}} } - } else { +} else { ad_form -extend -name assessment_form -form { {anonymous_p:text(hidden) {value t}} } +} - +if { $type == 2 && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { + {secure_access_p:text(select) {label "[_ assessment.Secure_Access_1]"} {options $boolean_options} {help_text "[_ assessment.as_Secure_Access_help]"}} + {reuse_responses_p:text(select) {label "[_ assessment.Reuse_Responses_1]"} {options $boolean_options} {help_text "[_ assessment.as_Reuse_Responses_help]"}} } +} else { + ad_form -extend -name assessment_form -form { + {secure_access_p:text(hidden) {value "f"}} + {reuse_responses_p:text(hidden) {value "f"}} + } } -if { $type > 1 && [empty_string_p $edit_f]} { - ad_form -extend -name assessment_form -form {{secure_access_p:text(select) {label "[_ assessment.Secure_Access_1]"} {options $boolean_options} {help_text "[_ assessment.as_Secure_Access_help]"}} - {reuse_responses_p:text(select) {label "[_ assessment.Reuse_Responses_1]"} {options $boolean_options} {help_text "[_ assessment.as_Reuse_Responses_help]"}} + +if { ($type == 2 || $type == 5) && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { {show_item_name_p:text(select) {label "[_ assessment.Show_Item_Name_1]"} {options $boolean_options} {help_text "[_ assessment.as_Show_Item_Name_help]"}} + } +} else { + ad_form -extend -name assessment_form -form { {show_item_name_p:text(hidden) {value "f"}} } +} + +if { ($type == 2 || $type == 5) && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { {random_p:text(select) {label "[_ assessment.Allow_Random]"} {options $boolean_options} {help_text "[_ assessment.as_Allow_Random_help]"}} + } +} else { + ad_form -extend -name assessment_form -form { {random_p:text(hidden) {value "t"}} } +} + +if { ($type == 2 || $type == 3 || $type == 4) && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { {consent_page:text(textarea),optional,nospell {label "[_ assessment.Consent_Page]"} {html {rows 5 cols 80}} {help_text "[_ assessment.as_Consent_Page_help]"}} } +} else { + ad_form -extend -name assessment_form -form { {consent_page:text(hidden) {value ""}} } } -if { $type > 1 && [empty_string_p $edit_f]} { - ad_form -extend -name assessment_form -form {{return_url:text,optional,nospell {label "[_ assessment.Return_Url]"} {html {size 50 maxlength 50}} {help_text "[_ assessment.as_Return_Url_help]"}} - {start_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.Start_Time]"} {format $form_format} {help} {help_text "[_ assessment.as_Start_Time_help]"}} - {end_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.End_Time]"} {format $form_format} {help} {help_text "[_ assessment.as_End_Time_help]"}} - {number_tries:integer,optional,nospell {label "[_ assessment.Number_of_Tries]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_Number_Tries_help]"}} - {wait_between_tries:integer,optional,nospell {label "[_ assessment.Minutes_for_Retry]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_Minutes_Retry_help]"}} - {time_for_response:integer,optional,nospell {label "[_ assessment.time_for_response]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_time_help]"}} - {ip_mask:text,optional,nospell {label "[_ assessment.ip_mask]"} {html {size 20 maxlength 100}} {help_text "[_ assessment.as_ip_mask_help]"}} - {password:text,optional,nospell {label "[_ assessment.password]"} {html {size 20 maxlength 100}} {help_text "[_ assessment.as_password_help]"}} - {show_feedback:text(select),optional {label "[_ assessment.Show_Feedback]"} {options $feedback_options} {help_text "[_ assessment.as_Feedback_help]"}} - {section_navigation:text(select),optional {label "[_ assessment.Section_Navigation]"} {options $navigation_options} {help_text "[_ assessment.as_Navigation_help]"}} - {type:text(hidden) {value $type}} +if { $type != 5 && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { + {return_url:text,optional,nospell {label "[_ assessment.Return_Url]"} {html {size 50 maxlength 50}} {help_text "[_ assessment.as_Return_Url_help]"}} } +} else { + ad_form -extend -name assessment_form -form { {return_url:text(hidden) {value {}}} } +} + + +if { $type == 2 && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { + {start_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.Start_Time]"} {help} {help_text "[_ assessment.as_Start_Time_help]"}} + {end_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.End_Time]"} {help} {help_text "[_ assessment.as_End_Time_help]"}} + } } else { ad_form -extend -name assessment_form -form { - {return_url:text(hidden) value ""} - {run_mode:text(hidden) {value ""}} - {secure_access_p:text(hidden) {value "f"}} - {reuse_responses_p:text(hidden) {value "f"}} - {show_item_name_p:text(hidden) {value "f"}} - {random_p:text(hidden) {value "t"}} - {consent_page:text(hidden) {value ""}} {start_time:date(hidden) {value ""}} {end_time:date(hidden) {value ""}} + } +} + +if { $type == 2 && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { + {number_tries:integer,optional,nospell {label "[_ assessment.Number_of_Tries]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_Number_Tries_help]"}} + {wait_between_tries:integer,optional,nospell {label "[_ assessment.Minutes_for_Retry]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_Minutes_Retry_help]"}} + } +} else { + ad_form -extend -name assessment_form -form { {number_tries:text(hidden) {value ""}} {wait_between_tries:text(hidden) {value ""}} + } +} + +if { $type == 2 && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { + {time_for_response:integer,optional,nospell {label "[_ assessment.time_for_response]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.as_time_help]"}} + } +} else { + ad_form -extend -name assessment_form -form { {time_for_response:text(hidden) {value ""}} + } +} + +if { $type == 2 && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { + {ip_mask:text,optional,nospell {label "[_ assessment.ip_mask]"} {html {size 20 maxlength 100}} {help_text "[_ assessment.as_ip_mask_help]"}} + {password:text,optional,nospell {label "[_ assessment.password]"} {html {size 20 maxlength 100}} {help_text "[_ assessment.as_password_help]"}} + } +} else { + ad_form -extend -name assessment_form -form { {ip_mask:text(hidden) {value ""}} {password:text(hidden) {value ""}} + } +} + +if { $type == 2 && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { + {show_feedback:text(select),optional {label "[_ assessment.Show_Feedback]"} {options $feedback_options} {help_text "[_ assessment.as_Feedback_help]"}} + } +} else { + ad_form -extend -name assessment_form -form { {show_feedback:text(hidden) {value ""}} + } +} + +if { $type == 2 && [empty_string_p $edit_f]} { + ad_form -extend -name assessment_form -form { + {section_navigation:text(select),optional {label "[_ assessment.Section_Navigation]"} {options $navigation_options} {help_text "[_ assessment.as_Navigation_help]"}} + } +} else { + ad_form -extend -name assessment_form -form { {section_navigation:text(hidden) {value ""}} - {type:text(hidden) {value $type}} } } +ad_form -extend -name assessment_form -form { + {type:text(hidden) {value $type}} +} + ad_form -extend -name assessment_form -new_request { set name "" set title "" Index: openacs-4/packages/assessment/www/asm-admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/index.tcl,v diff -u -r1.6.2.5 -r1.6.2.6 --- openacs-4/packages/assessment/www/asm-admin/index.tcl 21 Jul 2005 10:42:10 -0000 1.6.2.5 +++ openacs-4/packages/assessment/www/asm-admin/index.tcl 21 Jul 2005 18:28:13 -0000 1.6.2.6 @@ -34,7 +34,11 @@ } set actions [list] -lappend actions "[_ assessment.New_Assessment]" assessment-new "[_ assessment.New_Assessment2]" +lappend actions "[_ assessment.New_Survey]" {assessment-form?type=1} "[_ assessment.New_Survey2]" \ + "[_ assessment.New_Review_Assessment]" {assessment-form?type=3} "[_ assessment.New_Review_Assessment2]" \ + "[_ assessment.New_Partial_Assessment]" {assessment-form?type=4} "[_ assessment.New_Partial_Assessment2]" \ + "[_ assessment.New_Quick_Assessment]" {assessment-form?type=5} "[_ assessment.New_Quick_Assessment2]" \ + "[_ assessment.New_Assessment]" {assessment-form?type=2} "[_ assessment.New_Assessment2]" if { $sw_admin } { lappend actions [_ assessment.set_reg_asm] "../admin/set-reg-assessment" [_ assessment.set_reg_asm]