Index: openacs-4/packages/assessment/tcl/as-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-callback-procs.tcl,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/packages/assessment/tcl/as-callback-procs.tcl 20 Jul 2005 15:58:42 -0000 1.1.2.4 +++ openacs-4/packages/assessment/tcl/as-callback-procs.tcl 10 Oct 2005 12:59:33 -0000 1.1.2.5 @@ -70,13 +70,87 @@ } { #se actualiza el parent_id del assessment en cr_items -db_dml update_as_cr_items {} +#get the new parent_id and package_id + db_1row get_new_parent_id {} + db_1row get_new_package_id {} + +#update table + db_dml update_as_cr_items {} + #se actualiza el context_id y el package_id del assessment en acs_objects -db_dml update_as_it_acs_objects1 {} -db_dml update_as_it_acs_objects2 {} + db_dml update_as_it_acs_objects1 {} + db_dml update_as_it_acs_objects2 {} #se actualiza el package_id del assessment en acs_objects -db_dml update_as_as_acs_objects {} + db_dml update_as_as_acs_objects {} } + +ad_proc -public -callback datamanager::copy_assessment -impl datamanager { + -object_id:required + -selected_community:required +} { + Move an assessment to another class or community +} { +#get assessment data + db_1row get_assessment_data {} + db_1row get_assessment_package_id {} + +#create the assessment + set new_assessment_id [as::assessment::new -title $title \ + -creator_id $creator_id \ + -description $description \ + -instructions $instructions \ + -run_mode $run_mode \ + -anonymous_p $anonymous_p \ + -secure_access_p $secure_access_p \ + -reuse_responses_p $reuse_responses_p \ + -show_item_name_p $show_item_name_p \ + -random_p $random_p \ + -entry_page $entry_page \ + -exit_page $exit_page \ + -consent_page $consent_page \ + -return_url $return_url \ + -start_time $start_time \ + -end_time $end_time \ + -number_tries $number_tries \ + -wait_between_tries $wait_between_tries \ + -time_for_response $time_for_response \ + -ip_mask $ip_mask \ + -password $password \ + -show_feedback $show_feedback \ + -section_navigation $section_navigation \ + -survey_p $survey_p \ + -package_id $package_id \ + -type $type ] + +#get sections data + set sections_id_list [db_list get_sections_id_list {}] +#asociate section with assessment + for {set i 0} {$i < [llength $sections_id_list]} {incr i} { + set section_id [lindex $sections_id_list $i] + db_1row get_section_data {} + db_dml map_ass_sections {} + } +} + + + +ad_proc -public -callback datamanager::delete_assessment -impl datamanager { + -object_id:required +} { + Delete an assessment. That is, move it to the trash +} { +#get the trash id + set trash_id [datamanager::get_trash_id] + set community_id [dotlrn_community::get_community_id] + set trash_package_id [datamanager::get_trash_package_id -community_id $community_id] + +#update tables + + db_dml del_update_as_cr_items {} + db_dml del_update_as_it_acs_objects {} +# db_dml del_update_as_it_acs_objects2 {} + db_dml del_update_as_as_acs_objects {} +}