Index: openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml,v diff -u -r1.59 -r1.60 --- openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml 27 Apr 2005 21:06:01 -0000 1.59 +++ openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml 2 May 2005 10:11:22 -0000 1.60 @@ -484,6 +484,7 @@ Does the respondee have to submit the answer for each question seperately. Subtext Summary + Target Community The condition to branch or execute the action There are no users to notify This question will be corrected by the teacher Index: openacs-4/packages/assessment/tcl/as-assessment-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-assessment-procs.tcl,v diff -u -r1.25 -r1.26 --- openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 27 Apr 2005 00:16:41 -0000 1.25 +++ openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 2 May 2005 10:11:22 -0000 1.26 @@ -231,14 +231,17 @@ ad_proc -public as::assessment::copy { {-assessment_id:required} {-name ""} + {-folder_id ""} } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-23 Copies an assessment with all sections and items } { - set package_id [ad_conn package_id] - set folder_id [as::assessment::folder_id -package_id $package_id] + if {[empty_string_p $folder_id]} { + set package_id [ad_conn package_id] + set folder_id [as::assessment::folder_id -package_id $package_id] + } data -assessment_id $assessment_id array set a [array get assessment_data] Index: openacs-4/packages/assessment/www/asm-admin/assessment-copy-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/assessment-copy-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/assessment-copy-oracle.xql 2 May 2005 10:11:22 -0000 1.1 @@ -0,0 +1,21 @@ + + + + oracle8.1.6 + + + + + select pc.instance_name, na.node_id + from apm_packages pa, site_nodes na, site_nodes nc, + apm_packages pc + where pa.package_key = 'assessment' + and na.object_id = pa.package_id + and nc.node_id = na.parent_id + and pc.package_id = nc.object_id + and acs_permission.permission_p (pa.package_id, :user_id, 'admin') = 't' + + + + + Index: openacs-4/packages/assessment/www/asm-admin/assessment-copy-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/assessment-copy-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/assessment-copy-postgresql.xql 2 May 2005 10:11:22 -0000 1.1 @@ -0,0 +1,21 @@ + + + + postgresql7.1 + + + + + select pc.instance_name, na.node_id + from apm_packages pa, site_nodes na, site_nodes nc, + apm_packages pc + where pa.package_key = 'assessment' + and na.object_id = pa.package_id + and nc.node_id = na.parent_id + and pc.package_id = nc.object_id + and acs_permission__permission_p (pa.package_id, :user_id, 'admin') = 't' + + + + + Index: openacs-4/packages/assessment/www/asm-admin/assessment-copy.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/assessment-copy.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/www/asm-admin/assessment-copy.tcl 8 Apr 2005 00:48:10 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/assessment-copy.tcl 2 May 2005 10:11:22 -0000 1.5 @@ -30,22 +30,26 @@ set context [list [list index [_ assessment.admin]] [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title] set confirm_options [list [list "[_ assessment.continue_with_copy]" t] [list "[_ assessment.cancel_and_return]" f]] +set node_options [db_list_of_lists assessment_instances {}] ad_form -name assessment_copy_confirm -action assessment-copy -form { {assessment_id:key} {assessment_title:text(inform) {label "[_ assessment.copy_1]"}} {name:text,optional {label "[_ assessment.Name]"} {help_text "[_ assessment.Name_help]"}} + {node_id:text(select) {label "[_ assessment.Target_Community]"} {options $node_options} {help_text "[_ assessment.Target_Community_help]"}} {confirmation:text(radio) {label " "} {options $confirm_options} {value f}} } -edit_request { db_1row assessment_title {} set name "" + set node_id [site_node::get_node_id -url [ad_conn url]] } -on_submit { if {$confirmation} { - set assessment_id [as::assessment::copy -assessment_id $assessment_id -name $name] + set folder_id [as::assessment::folder_id -package_id [site_node::get_object_id -node_id $node_id]] + set assessment_id [as::assessment::copy -assessment_id $assessment_id -name $name -folder_id $folder_id] } permission::grant -party_id $user_id -object_id $assessment_id -privilege admin } -after_submit { - ad_returnredirect [export_vars -base one-a {assessment_id}] + ad_returnredirect "[site_node::get_url -node_id $node_id][export_vars -base "asm-admin/one-a" {assessment_id}]" ad_script_abort }