Index: openacs-4/packages/assessment/tcl/as-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-procs.tcl,v diff -u -r1.14 -r1.14.2.1 --- openacs-4/packages/assessment/tcl/as-item-procs.tcl 25 Apr 2005 13:00:25 -0000 1.14 +++ openacs-4/packages/assessment/tcl/as-item-procs.tcl 31 May 2005 23:13:00 -0000 1.14.2.1 @@ -234,8 +234,31 @@ } { db_1row item_properties {} -column_array item - set item(item_type) [string range $item(item_type) end-1 end] - set item(display_type) [string range $item(display_type) end-1 end] + set item(item_type) [lindex [split $item(item_type) "_"] end] + set item(display_type) [lindex [split $item(display_type) "_"] end] return [array get item] } + +ad_proc -private as::item::generate_unique_name { + args +} { + Generate a unique string to be used as item name + + @author Roel Canicula (roelmc@info.com.ph) + @creation-date 2005-05-06 + + @param args + + @return + + @error +} { + if { [llength $args] } { + return [join $args "-"] + } elseif { ! [catch {set uuid [exec uuidgen]}] } { + return $uuid + } else { + return "[clock seconds]-[expr round([ns_rand]*100000)]" + } +}