Index: openacs-4/packages/assessment/tcl/as-item-display-cb-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-display-cb-procs.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/assessment/tcl/as-item-display-cb-procs.tcl 25 Feb 2005 09:21:23 -0000 1.10 +++ openacs-4/packages/assessment/tcl/as-item-display-cb-procs.tcl 9 Apr 2005 22:39:27 -0000 1.11 @@ -100,6 +100,7 @@ {-title ""} {-subtext ""} {-required_p ""} + {-random_p ""} {-default_value ""} {-data ""} } { @@ -108,13 +109,17 @@ Render an Item Display CheckBox Type } { - db_1row display_item_data {} if {[empty_string_p $required_p]} { set required_p f } + array set type [util_memoize [list as::item_display_cb::data -type_id $type_id]] + if {$random_p == "f"} { + set type(sort_order_type) "order_of_entry" + } + # numerical alphabetical randomized order_of_entry - switch -exact $sort_order_type { + switch -exact $type(sort_order_type) { alphabetical { set data [lsort -dictionary -index 0 $data] } @@ -127,8 +132,20 @@ if {$required_p != "t"} { set optional ",optional" } - set param_list [list [list label $title] [list help_text $subtext] [list values $default_value] [list options $data] [list html $html_display_options]] + set param_list [list [list label $title] [list help_text $subtext] [list values $default_value] [list options $data] [list html $type(html_display_options)]] set element_params [concat [list "$element\:text(checkbox)$optional"] $param_list] ad_form -extend -name $form -form [list $element_params] } + +ad_proc -public as::item_display_cb::data { + -type_id:required +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2005-04-08 + + Get the Display Data of CheckBox Type +} { + db_1row display_item_data {} -column_array type + return [array get type] +}