Index: openacs-4/packages/assessment/tcl/as-item-display-sa-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-display-sa-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/tcl/as-item-display-sa-procs.tcl 22 Nov 2004 11:59:22 -0000 1.3 +++ openacs-4/packages/assessment/tcl/as-item-display-sa-procs.tcl 8 Dec 2004 15:30:34 -0000 1.4 @@ -14,7 +14,7 @@ @author Natalia Perez (nperper@it.uc3m.es) @creation-date 2004-09-29 - New Item Display Short Answer Type to the database + New Item Display ShortAnswer Type to the database } { set package_id [ad_conn package_id] set folder_id [db_string get_folder_id "select folder_id from cr_folders where package_id=:package_id"] @@ -31,4 +31,52 @@ } return $as_item_display_sa_id -} \ No newline at end of file +} + +ad_proc -public as::item_display_sa::edit { + -as_item_display_id:required + {-html_display_options ""} + {-abs_size ""} + {-box_orientation ""} +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2004-12-07 + + Edit Item Display ShortAnswer Type to the database +} { + # Update as_item_display_sa in the CR (and as_item_display_sa table) getting the revision_id (as_item_display_id) + db_transaction { + set display_item_id [db_string display_item_id {}] + set new_item_display_id [content::revision::new \ + -item_id $display_item_id \ + -content_type {as_item_display_sa} \ + -attributes [list [list html_display_options $html_display_options] \ + [list abs_size $abs_size] \ + [list box_orientation $box_orientation] ] ] + } + + return $new_item_display_id +} + +ad_proc -public as::item_display_sa::copy { + -type_id:required +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2004-12-07 + + Copy an Item Display ShortAnswer Type +} { + set package_id [ad_conn package_id] + set folder_id [db_string get_folder_id "select folder_id from cr_folders where package_id=:package_id"] + + # Insert as_item_display_sa in the CR (and as_item_display_sa table) getting the revision_id (as_item_display_id) + db_transaction { + db_1row display_item_data {} + + set new_item_display_id [new -html_display_options $html_display_options \ + -abs_size $abs_size \ + -box_orientation $box_orientation] + } + + return $new_item_display_id +}