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 -N -r1.1 -r1.2 --- openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 14 Oct 2004 11:44:51 -0000 1.1 +++ openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 15 Nov 2004 17:17:15 -0000 1.2 @@ -8,7 +8,6 @@ ad_proc -public as::item_type_mc::new { - {-name:required} {-title ""} {-increasing_p ""} {-allow_negative_p ""} @@ -25,8 +24,17 @@ set folder_id [db_string get_folder_id "select folder_id from cr_folders where package_id=:package_id"] # Insert as_item_type_mc in the CR (and as_item_type_mc table) getting the revision_id (as_item_type_id) - set item_item_type_mc_id [content::item::new -parent_id $folder_id -content_type {as_item_type_mc} -name $name -title $title ] - set as_item_type_mc_id [content::revision::new -item_id $item_item_type_mc_id -content_type {as_item_type_mc} -title $title -attributes [list [list increasing_p $increasing_p] [list allow_negative_p $allow_negative_p] [list num_correct_answers $num_correct_answers] [list num_answers $num_answers] ] ] + db_transaction { + set item_item_type_mc_id [content::item::new -parent_id $folder_id -content_type {as_item_type_mc} -name [ad_generate_random_string] -title $title ] + set as_item_type_mc_id [content::revision::new \ + -item_id $item_item_type_mc_id \ + -content_type {as_item_type_mc} \ + -title $title \ + -attributes [list [list increasing_p $increasing_p] \ + [list allow_negative_p $allow_negative_p] \ + [list num_correct_answers $num_correct_answers] \ + [list num_answers $num_answers] ] ] + } return $as_item_type_mc_id } \ No newline at end of file