Index: openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl,v diff -u -r1.8 -r1.8.2.1 --- openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl 12 Jun 2006 02:49:50 -0000 1.8 +++ openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl 29 Jun 2007 22:34:12 -0000 1.8.2.1 @@ -92,6 +92,7 @@ ad_proc -public as::item_choice::copy { -choice_id:required -mc_id:required + {-copy_correct_answer_p "t"} } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-07 @@ -104,7 +105,9 @@ # Insert as_item_choice in the CR (and as_item_choices table) getting the revision_id (as_item_choice_id) db_transaction { db_1row choice_data {} - + if {![string is true $copy_correct_answer_p]} { + set correct_answer_p "" + } set new_choice_id [new -title $title \ -mc_id $mc_id \ -data_type $data_type \ Index: openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl,v diff -u -r1.21.2.2 -r1.21.2.3 --- openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 5 Feb 2007 14:18:47 -0000 1.21.2.2 +++ openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 29 Jun 2007 22:34:12 -0000 1.21.2.3 @@ -102,6 +102,8 @@ ad_proc -public as::item_type_mc::copy { -type_id:required + {-copy_correct_answer_p "t"} + -new_title } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-07 @@ -114,7 +116,12 @@ # Insert as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id) db_transaction { db_1row item_type_data {} - + if {[info exists new_title]} { + set title $new_title + } + if {[string is false $copy_correct_answer_p]} { + set num_correct_answers 0 + } set new_item_type_id [new -title $title \ -increasing_p $increasing_p \ -allow_negative_p $allow_negative_p \ @@ -123,7 +130,7 @@ set choices [db_list get_choices {}] foreach choice_id $choices { - set new_choice_id [as::item_choice::copy -choice_id $choice_id -mc_id $new_item_type_id] + set new_choice_id [as::item_choice::copy -choice_id $choice_id -mc_id $new_item_type_id -copy_correct_answer_p $copy_correct_answer_p] } } @@ -466,6 +473,9 @@ if {![as::item::get_item_type_info -as_item_id $as_item_id] \ || $item_type_info(object_type) != "as_item_type_mc"} { + # always set mc title to empty on new mc question + # we ask for a title for the mc answer set seperately if + # required set mc_id [as::item_type_mc::new \ -title $title \ -increasing_p $increasing_p \ @@ -483,7 +493,6 @@ } } else { # old mc item type existing - set as_item_id [as::item::new_revision -as_item_id $as_item_id] set mc_id [as::item_type_mc::edit \ -as_item_type_id $as_item_type_id \ -title $title \