Index: openacs-4/packages/assessment/www/asm-admin/catalog-item-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/catalog-item-add.tcl,v diff -u -r1.5 -r1.5.6.1 --- openacs-4/packages/assessment/www/asm-admin/catalog-item-add.tcl 25 Apr 2005 13:36:20 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/catalog-item-add.tcl 5 Feb 2007 14:15:04 -0000 1.5.6.1 @@ -8,7 +8,7 @@ @author timo@timohentschel.de @date 2004-12-08 - @cvs-id $Id: + @cvs-id $Id: } { assessment_id:integer section_id:integer @@ -56,7 +56,10 @@ set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] set item_count [llength $item_ids] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml move_down_items {} foreach as_item_id $item_ids { Index: openacs-4/packages/assessment/www/asm-admin/item-add-display-cb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-display-cb.tcl,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-add-display-cb.tcl 12 Jun 2006 02:49:51 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/item-add-display-cb.tcl 5 Feb 2007 14:15:04 -0000 1.6.2.1 @@ -41,7 +41,10 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id set old_item_id $as_item_id if {![db_0or1row item_display {}] || $object_type != "as_item_display_cb"} { @@ -51,7 +54,7 @@ -choice_label_orientation $label_orientation \ -sort_order_type $order_type \ -item_answer_alignment $answer_alignment] - + if {![info exists object_type]} { # first item display mapped as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel @@ -130,7 +133,10 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id set old_item_id $as_item_id if {![db_0or1row item_display {}] || $object_type != "as_item_display_cb"} { @@ -140,7 +146,7 @@ -choice_label_orientation $label_orientation \ -sort_order_type $order_type \ -item_answer_alignment $answer_alignment] - + if {![info exists object_type]} { # first item display mapped as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel Index: openacs-4/packages/assessment/www/asm-admin/item-add-display-f.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-display-f.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-add-display-f.tcl 12 Jun 2006 02:49:51 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/item-add-display-f.tcl 5 Feb 2007 14:15:04 -0000 1.2.2.1 @@ -51,15 +51,18 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id set old_item_id $as_item_id if {![db_0or1row item_display {}] || $object_type != "as_item_display_f"} { set as_item_display_id [as::item_display_f::new \ -html_display_options $html_options \ -abs_size $abs_size \ -box_orientation $box_orientation] - + if {![info exists object_type]} { # first item display mapped as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel Index: openacs-4/packages/assessment/www/asm-admin/item-add-display-rb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-display-rb.tcl,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-add-display-rb.tcl 12 Jun 2006 02:49:51 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/item-add-display-rb.tcl 5 Feb 2007 14:15:04 -0000 1.6.2.1 @@ -42,7 +42,10 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id set old_item_id $as_item_id if {![db_0or1row item_display {}] || $object_type != "as_item_display_rb"} { @@ -52,7 +55,7 @@ -choice_label_orientation $label_orientation \ -sort_order_type $order_type \ -item_answer_alignment $answer_alignment] - + if {![info exists object_type]} { # first item display mapped as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel @@ -127,7 +130,10 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id set old_item_id $as_item_id if {![db_0or1row item_display {}] || $object_type != "as_item_display_rb"} { @@ -137,7 +143,7 @@ -choice_label_orientation $label_orientation \ -sort_order_type $order_type \ -item_answer_alignment $answer_alignment] - + if {![info exists object_type]} { # first item display mapped as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel Index: openacs-4/packages/assessment/www/asm-admin/item-add-display-sa.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-display-sa.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-add-display-sa.tcl 12 Jun 2006 02:49:51 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/item-add-display-sa.tcl 5 Feb 2007 14:15:04 -0000 1.4.2.1 @@ -51,15 +51,18 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id set old_item_id $as_item_id if {![db_0or1row item_display {}] || $object_type != "as_item_display_sa"} { set as_item_display_id [as::item_display_sa::new \ -html_display_options $html_options \ -abs_size $abs_size \ -box_orientation $box_orientation] - + if {![info exists object_type]} { # first item display mapped as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel Index: openacs-4/packages/assessment/www/asm-admin/item-add-display-sb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-display-sb.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-add-display-sb.tcl 12 Jun 2006 03:02:38 -0000 1.7 +++ openacs-4/packages/assessment/www/asm-admin/item-add-display-sb.tcl 5 Feb 2007 14:15:04 -0000 1.7.2.1 @@ -43,7 +43,10 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id set old_item_id $as_item_id if {![db_0or1row item_display {}] || $object_type != "as_item_display_sb"} { @@ -53,7 +56,7 @@ -choice_label_orientation $label_orientation \ -sort_order_type $order_type \ -item_answer_alignment $answer_alignment] - + if {![info exists object_type]} { # first item display mapped as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel @@ -86,7 +89,7 @@ } ad_returnredirect [export_vars -base one-a {assessment_id}]\#$as_item_id ad_script_abort - + } set label_or_types [list] @@ -124,7 +127,10 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id set old_item_id $as_item_id if {![db_0or1row item_display {}] || $object_type != "as_item_display_sb"} { @@ -135,7 +141,7 @@ -sort_order_type $order_type \ -item_answer_alignment $answer_alignment \ -prepend_empty_p t] - + if {![info exists object_type]} { # first item display mapped as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel Index: openacs-4/packages/assessment/www/asm-admin/item-add-display-ta.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-display-ta.tcl,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-add-display-ta.tcl 12 Jun 2006 02:49:51 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/item-add-display-ta.tcl 5 Feb 2007 14:15:04 -0000 1.6.2.1 @@ -51,7 +51,10 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id set old_item_id $as_item_id if {![db_0or1row item_display {}] || $object_type != "as_item_display_ta"} { @@ -60,7 +63,7 @@ -abs_size $abs_size \ -acs_widget "" \ -item_answer_alignment $answer_alignment] - + if {![info exists object_type]} { # first item display mapped as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel Index: openacs-4/packages/assessment/www/asm-admin/item-add-display-tb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-display-tb.tcl,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-add-display-tb.tcl 12 Jun 2006 02:49:51 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/item-add-display-tb.tcl 5 Feb 2007 14:15:04 -0000 1.6.2.1 @@ -51,15 +51,18 @@ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id set old_item_id $as_item_id if {![db_0or1row item_display {}] || $object_type != "as_item_display_tb"} { set as_item_display_id [as::item_display_tb::new \ -html_display_options $html_options \ -abs_size $abs_size \ -item_answer_alignment $answer_alignment] - + if {![info exists object_type]} { # first item display mapped as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel Index: openacs-4/packages/assessment/www/asm-admin/item-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add.adp,v diff -u -r1.2.6.1 -r1.2.6.2 --- openacs-4/packages/assessment/www/asm-admin/item-add.adp 24 Jan 2007 20:15:30 -0000 1.2.6.1 +++ openacs-4/packages/assessment/www/asm-admin/item-add.adp 5 Feb 2007 14:15:04 -0000 1.2.6.2 @@ -185,381 +185,12 @@

Correct
Answer

-   
+ + @formgroup.widget;noquote@ + +  
- - - - - - - - - - - -
- - - - - - - - - - -
- @formerror.choice.1;noquote@ -
- -

- - -

- -
- - - - - - - - - - - - - - - - - - - - - @formgroup.widget;noquote@ - - - - -
- @formerror.correct.1;noquote@ -
- -

- - - -

- -
- - - - - - - - - - - - - - - - - - - - - - -
- @formerror.choice.2;noquote@ -
- -

- - - -

- -
- - - - - - - - - - - - - - - - - - - - - @formgroup.widget;noquote@ - - - - -
- @formerror.correct.2;noquote@ -
- -

- - - -

- -
- - - - - - - - - - - - - - - - - - - - - - -
- @formerror.choice.3;noquote@ -
- -

- - - -

- -
- - - - - - - - - - - - - - - - - - - - - @formgroup.widget;noquote@ - - - - -
- @formerror.correct.3;noquote@ -
- -

- - - -

- -
- - - - - - - - - - - - - - - - - - - - - - -
- @formerror.choice.4;noquote@ -
- -

- - - -

- -
- - - - - - - - - - - - - - - - - - - - - @formgroup.widget;noquote@ - - - - -
- @formerror.correct.4;noquote@ -
- -

- - - -

- -
- - - - - - - - - - - - - - - - - - - - - - -
- @formerror.choice.5;noquote@ -
- -

- - - -

- -
- - - - - - - - - - - - - - - - - - - - - @formgroup.widget;noquote@ - - - - -
- @formerror.correct.5;noquote@ -
- -

- - - -


@@ -575,7 +206,10 @@ Long Answer

#assessment.item_type_long_answer_help#

-
+
+

Index: openacs-4/packages/assessment/www/asm-admin/item-copy.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-copy.tcl,v diff -u -r1.4.6.1 -r1.4.6.2 --- openacs-4/packages/assessment/www/asm-admin/item-copy.tcl 1 Feb 2007 14:57:43 -0000 1.4.6.1 +++ openacs-4/packages/assessment/www/asm-admin/item-copy.tcl 5 Feb 2007 14:15:04 -0000 1.4.6.2 @@ -50,7 +50,10 @@ set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] set new_item_id [as::item::copy -as_item_id $as_item_id -title $title -description $description -field_name $field_name] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml move_down_items {} incr after db_dml insert_new_item {} Index: openacs-4/packages/assessment/www/asm-admin/item-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-delete.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/assessment/www/asm-admin/item-delete.tcl 1 Feb 2007 14:57:43 -0000 1.5.2.1 +++ openacs-4/packages/assessment/www/asm-admin/item-delete.tcl 5 Feb 2007 14:15:04 -0000 1.5.2.2 @@ -37,14 +37,17 @@ } -select_query_name {item_title} -on_submit { if {$confirmation} { db_transaction { - as::assessment::check::delete_item_checks -assessment_id $assessment_id -as_item_id $as_item_id -section_id $section_id + as::assessment::check::delete_item_checks -assessment_id $assessment_id -as_item_id $as_item_id -section_id $section_id set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] - + set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_1row get_sort_order_to_be_removed {} db_dml remove_item_from_section {} db_dml move_up_items {} Index: openacs-4/packages/assessment/www/asm-admin/item-edit-display-cb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-display-cb.tcl,v diff -u -r1.6 -r1.6.6.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-display-cb.tcl 7 Apr 2005 22:46:36 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-display-cb.tcl 5 Feb 2007 14:15:04 -0000 1.6.6.1 @@ -100,7 +100,10 @@ set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] as::assessment::check::copy_item_checks -assessment_id $assessment_id -section_id $new_section_id -as_item_id $as_item_id -new_item_id $new_item_id - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_display_of_item {} } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-display-f.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-display-f.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-display-f.tcl 12 Jun 2006 02:49:51 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-display-f.tcl 5 Feb 2007 14:15:04 -0000 1.2.2.1 @@ -75,7 +75,10 @@ set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_display_of_item {} } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-display-rb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-display-rb.tcl,v diff -u -r1.6 -r1.6.6.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-display-rb.tcl 7 Apr 2005 22:47:05 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-display-rb.tcl 5 Feb 2007 14:15:04 -0000 1.6.6.1 @@ -100,7 +100,10 @@ set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] as::assessment::check::copy_item_checks -assessment_id $assessment_id -section_id $new_section_id -as_item_id $as_item_id -new_item_id $new_item_id - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_display_of_item {} } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-display-sa.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-display-sa.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-display-sa.tcl 12 Jun 2006 02:49:51 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-display-sa.tcl 5 Feb 2007 14:15:04 -0000 1.4.2.1 @@ -75,7 +75,10 @@ set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_display_of_item {} } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-display-sb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-display-sb.tcl,v diff -u -r1.9 -r1.9.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-display-sb.tcl 12 Jun 2006 03:02:38 -0000 1.9 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-display-sb.tcl 5 Feb 2007 14:15:04 -0000 1.9.2.1 @@ -100,7 +100,10 @@ set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] as::assessment::check::copy_item_checks -assessment_id $assessment_id -section_id $new_section_id -as_item_id $as_item_id -new_item_id $new_item_id - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_display_of_item {} } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-display-ta.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-display-ta.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-display-ta.tcl 12 Jun 2006 02:49:51 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-display-ta.tcl 5 Feb 2007 14:15:04 -0000 1.5.2.1 @@ -77,7 +77,10 @@ set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_display_of_item {} } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-display-tb.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-display-tb.tcl,v diff -u -r1.5 -r1.5.6.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-display-tb.tcl 7 Apr 2005 22:47:52 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-display-tb.tcl 5 Feb 2007 14:15:04 -0000 1.5.6.1 @@ -75,7 +75,10 @@ set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_display_of_item {} } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-fu.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-fu.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-fu.tcl 12 Jun 2006 02:49:51 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-fu.tcl 5 Feb 2007 14:15:04 -0000 1.2.2.1 @@ -47,7 +47,10 @@ set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_item_type {} } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-general.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-general.adp,v diff -u -r1.2 -r1.2.6.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-general.adp 7 Apr 2005 21:47:32 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-general.adp 5 Feb 2007 14:15:04 -0000 1.2.6.1 @@ -2,6 +2,235 @@ @page_title;noquote@ @context;noquote@ -
- -
+ + +
+ + + + + + + + + + + * + + + + + + + + + + + + + +
+ @formerror.question_text;noquote@ +
+ +

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ @formerror.required_p;noquote@ +
+ +

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ @formerror.points;noquote@ +
+ +

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ @formerror.feedback_right;noquote@ +
+ +

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ @formerror.feedback_wrong;noquote@ +
+ +

+ + + + + + +
+ + + + + + +

Correct
Answer

+ + + + @formgroup.widget;noquote@ + + + + + + + + + + + + +
+
+ + + + + +

+ + +

+ +

+
Index: openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl,v diff -u -r1.15.2.1 -r1.15.2.2 --- openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl 24 Jan 2007 21:56:03 -0000 1.15.2.1 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl 5 Feb 2007 14:15:04 -0000 1.15.2.2 @@ -7,6 +7,11 @@ assessment_id:integer section_id:integer as_item_id:integer + choice:optional,array + correct:optional,array + move_up:optional,array + move_down:optional,array + delete:optional,array } -properties { context:onevalue page_title:onevalue @@ -41,54 +46,23 @@ ad_form -name item_edit_general -action item-edit-general -export { assessment_id section_id } -html {enctype multipart/form-data} -form { {as_item_id:key} {question_text:richtext,nospell {label "[_ assessment.Question]"} {html {rows 9 cols 80 style {width: 95%}}} {help_text "[_ assessment.item_Question_help]"}} -} -# if { $type ne "survey"} { -# ad_form -extend -name item_edit_general -form { -# {description:text(textarea),optional {label "[_ assessment.Description]"} {html {rows 5 cols 80}} {help_text "[_ assessment.item_Description_help]"}} -# } - -# if {![empty_string_p [category_tree::get_mapped_trees $package_id]]} { -# category::ad_form::add_widgets -container_object_id $package_id -categorized_object_id $as_item_id -form_name item_edit_general -# } - -# if {[db_0or1row get_item_content {}]} { -# ad_form -extend -name item_edit_general -form { -# {delete_content:text(checkbox),optional {label "[_ assessment.item_Delete_Content]"} {options {{{$content_name} t}} }} -# } -# } -# } -# if { $type ne "survey"} { -# ad_form -extend -name item_edit_general -form { -# {content:file,optional {label "[_ assessment.item_Content]"} {help_text "[_ assessment.item_Content_help]"}} -# } -# } - - -# if { $type ne "survey"} { -# ad_form -extend -name item_edit_general -form { -# {subtext:text,optional {label "[_ assessment.Subtext]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.item_Subtext_help]"}} -# {field_name:text,optional,nospell {label "[_ assessment.Field_Name]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.Field_Name_help]"}} -# {field_code:text,optional,nospell {label "[_ assessment.Field_Code]"} {html {size 80 maxlength 500}} {help_text "[_ assessment.Field_Code_help]"}} -# } -# } - -ad_form -extend -name item_edit_general -form { {required_p:text(select) {label "[_ assessment.Required]"} {options $boolean_options} {help_text "[_ assessment.item_Required_help]"}} } if { $type ne "survey"} { -ad_form -extend -name item_edit_general -form { - {points:integer,optional,nospell {label "[_ assessment.points_item]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_item_help]"}} - {feedback_right:richtext,optional,nospell {label "[_ assessment.Feedback_right]"} {html {rows 5 cols 80 style {width:95%}}} {help_text "[_ assessment.Feedback_right_help]"}} - {feedback_wrong:richtext,optional,nospell {label "[_ assessment.Feedback_wrong]"} {html {rows 5 cols 80 style {width:95%}}} {help_text "[_ assessment.Feedback_wrong_help]"}} -} + ad_form -extend -name item_edit_general -form { + {points:integer,optional,nospell {label "[_ assessment.points_item]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_item_help]"}} + {feedback_right:richtext,optional,nospell {label "[_ assessment.Feedback_right]"} {html {rows 5 cols 80 style {width:95%}}} {help_text "[_ assessment.Feedback_right_help]"}} + {feedback_wrong:richtext,optional,nospell {label "[_ assessment.Feedback_wrong]"} {html {rows 5 cols 80 style {width:95%}}} {help_text "[_ assessment.Feedback_wrong_help]"}} + } } else { -ad_form -extend -name item_edit_general -form { - {points:text(hidden) ""} - {feedback_right:text(hidden),optional} - {feedback_wrong:text(hidden),optional} + ad_form -extend -name item_edit_general -form { + {points:text(hidden) ""} + {feedback_right:text(hidden),optional} + {feedback_wrong:text(hidden),optional} + } } -} + ad_form -extend -name item_edit_general -form { {description:text(hidden),optional} {content:text(hidden),optional} @@ -99,7 +73,123 @@ {data_type:text(hidden),optional} {display_type:text(hidden),optional} {max_time_to_complete:text(hidden),optional} -} -edit_request { + {formbutton_ok:text(submit) {label "[_ assessment.Save_and_finish]"}} +} + + +switch -- $item_type { + "mc" { + ad_form -extend -name item_edit_general -form { + {num_choices:text(hidden)} + {ms_label:text,optional} + {add_another_choice:text(submit) {label "[_ assessment.Add_another_choice]"}} + } +ns_log notice "Add Another = '[template::element::get_value item_edit_general add_another_choice]'" + if {[template::form::is_submission item_edit_general] \ + && [template::element::get_value item_edit_general add_another_choice] \ + eq [_ assessment.Add_another_choice]} { + set num_choices [element::get_value item_edit_general num_choices] + incr num_choices + element::set_value item_edit_general num_choices $num_choices + } + +##### +##### + set as_item_type_id [as::item::get_item_type_id -as_item_id $as_item_id] + if {[array exists move_up]} { + foreach n [array names move_up] { + array set new_array [as::item_type_mc::choices_swap \ + -assessment_id $assessment_id \ + -section_id $section_id \ + -as_item_id $as_item_id \ + -mc_id $as_item_type_id \ + -sort_order [db_string get_sort_order {}] \ + -direction up] + foreach var {as_item_id section_id} { + set $var $new_array($var) + template::element::set_value item_edit_general $var [set $var] + } + } + } + if {[array exists move_down]} { + foreach n [array names move_down] { + array set new_array [as::item_type_mc::choices_swap \ + -assessment_id $assessment_id \ + -section_id $section_id \ + -as_item_id $as_item_id \ + -mc_id $as_item_type_id \ + -sort_order [db_string get_sort_order {}] \ + -direction down] + } + foreach var {as_item_id section_id} { + set $var $new_array($var) + template::element::set_value item_edit_general $var [set $var] + } + } + if {[array exists delete]} { + foreach n [array names delete] { + array set new_array [as::item_type_mc::choice_delete \ + -assessment_id $assessment_id \ + -section_id $section_id \ + -as_item_id $as_item_id \ + -choice_id $n] + } + foreach var {as_item_id section_id} { + set $var $new_array($var) + } + } + +####### +####### + + + set existing_choices [as::item_type_mc::existing_choices $as_item_id] + + if {![template::form::is_submission item_edit_general] \ + && ![info exists num_choices]} { + set num_choices 5 + } elseif {![info exists num_choices]} { + set num_choices [expr {[set num_choices [template::element::get_value item_edit_general num_choices]] eq "" ? $num_choices : 5}] + } + + template::multirow create choice_elements id new_p + foreach c $existing_choices { + set id [lindex $c 1] + template::multirow append choice_elements $id f + if {[lindex $c 2] eq "t"} { + set correct($id) t + } + } + + if {$num_choices > [llength $existing_choices]} { + set new_choices [expr {$num_choices - [llength $existing_choices] }] + for {set i 1} {$i <= $new_choices} {incr i} { + set id __new_${i} + set correct_p f + if {[info exists correct($id)]} { + set correct_p t + } + lappend existing_choices [list "" $id $correct_p] + template::multirow append choice_elements $id t + } + } + as::item_type_mc::add_existing_choices_to_edit_form \ + -form_id item_edit_general \ + -existing_choices $existing_choices \ + -choice_array_name choice \ + -correct_choice_array_name correct + + } + "oq" { + ad_form -extend -name item_edit_general -form { + {reference_answer:text(textarea),optional {label "[_ assessment.oq_Reference_Answer]"} {html {rows 5 cols 80}} {help_text "[_ assessment.oq_Reference_Answer_help]"}} + } + } + "sa" { + } +} + +ad_form -extend -name item_edit_general -edit_request { db_1row general_item_data {} if {[empty_string_p $data_type]} { set data_type varchar @@ -110,84 +200,171 @@ set feedback_right [template::util::richtext::create $feedback_right $mime_type] set feedback_wrong [template::util::richtext::create $feedback_wrong $mime_type] + # FIXME fill in reference answer + } -on_submit { set category_ids [category::ad_form::get_categories -container_object_id $package_id] if {[empty_string_p $points]} { set points 0 } } -edit_data { - set question_text [template::util::richtext::get_property contents $question_text] - set feedback_right [template::util::richtext::get_property content $feedback_right] - set feedback_wrong [template::util::richtext::get_property content $feedback_wrong] - db_transaction { - set old_display_type [string range [db_string get_display_type {}] end-1 end] - set new_item_id [as::item::edit \ - -as_item_id $as_item_id \ - -title $question_text \ - -description $description \ - -subtext $subtext \ - -field_name $field_name \ - -field_code $field_code \ - -required_p $required_p \ - -data_type $data_type \ - -feedback_right $feedback_right \ - -feedback_wrong $feedback_wrong \ - -max_time_to_complete $max_time_to_complete \ - -points $points \ - -validate_block $validate_block] + if {[exists_and_not_null formbutton_ok] || [exists_and_not_null formbutton_add_another_question]} { + set question_text [template::util::richtext::get_property contents $question_text] + set feedback_right [template::util::richtext::get_property content $feedback_right] + set feedback_wrong [template::util::richtext::get_property content $feedback_wrong] + db_transaction { + set old_display_type [string range [db_string get_display_type {}] end-1 end] + set new_item_id [as::item::edit \ + -as_item_id $as_item_id \ + -title $question_text \ + -description $description \ + -subtext $subtext \ + -field_name $field_name \ + -field_code $field_code \ + -required_p $required_p \ + -data_type $data_type \ + -feedback_right $feedback_right \ + -feedback_wrong $feedback_wrong \ + -max_time_to_complete $max_time_to_complete \ + -points $points \ + -validate_block $validate_block] - if {[exists_and_not_null category_ids]} { - category::map_object -object_id $new_item_id $category_ids - } - if {![empty_string_p $content]} { - set filename [lindex $content 0] - set tmp_filename [lindex $content 1] - set file_mimetype [lindex $content 2] - set n_bytes [file size $tmp_filename] - set max_file_size 10000000 - # [ad_parameter MaxAttachmentSize] - set pretty_max_size [util_commify_number $max_file_size] + if {[exists_and_not_null category_ids]} { + category::map_object -object_id $new_item_id $category_ids + } + if {![empty_string_p $content]} { + set filename [lindex $content 0] + set tmp_filename [lindex $content 1] + set file_mimetype [lindex $content 2] + set n_bytes [file size $tmp_filename] + set max_file_size 10000000 + # [ad_parameter MaxAttachmentSize] + set pretty_max_size [util_commify_number $max_file_size] - if { $n_bytes > $max_file_size && $max_file_size > 0 } { - ad_return_complaint 1 "[_ assessment.file_too_large]" - return - } - if { $n_bytes == 0 } { - ad_return_complaint 1 "[_ assessment.file_zero_size]" - return - } - set folder_id [as::assessment::folder_id -package_id $package_id] - set content_rev_id [cr_import_content -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [as::item::generate_unique_name]] - # delete content association if it exists then insert a new one - # otherwise we can't add a file on edit that did not exist - # when the question was originally created - db_dml delete_item_content {} - db_dml insert_item_content {} - } elseif {[info exists delete_content] && $delete_content == "t" } { - db_dml delete_item_content {} - } - set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] - set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] - set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] - as::assessment::check::copy_item_checks -assessment_id $assessment_id -section_id $new_section_id -as_item_id $as_item_id -new_item_id $new_item_id - db_dml update_section_in_assessment {} - db_dml update_item_in_section {} - } - set as_item_id $new_item_id - set section_id $new_section_id + if { $n_bytes > $max_file_size && $max_file_size > 0 } { + ad_return_complaint 1 "[_ assessment.file_too_large]" + return + } + if { $n_bytes == 0 } { + ad_return_complaint 1 "[_ assessment.file_zero_size]" + return + } + set folder_id [as::assessment::folder_id -package_id $package_id] + set content_rev_id [cr_import_content -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [as::item::generate_unique_name]] + # delete content association if it exists then insert a new one + # otherwise we can't add a file on edit that did not exist + # when the question was originally created + db_dml delete_item_content {} + db_dml insert_item_content {} + } elseif {[info exists delete_content] && $delete_content == "t" } { + db_dml delete_item_content {} + } + set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] + set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] + set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] + set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] + as::assessment::check::copy_item_checks -assessment_id $assessment_id -section_id $new_section_id -as_item_id $as_item_id -new_item_id $new_item_id + set as_item_type_id [as::item::get_item_type_id -as_item_id $new_item_id] + as::section::update_section_in_assessment \ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id - application_data_link::update_links_from \ - -object_id $as_item_id \ - -text $question_text + db_dml update_item_in_section {} + switch -- $item_type { + mc { + set num_answers 0 + set num_correct_answers 0 + foreach c [array names choice] { + if {$choice($c) ne ""} { + incr num_answers + } + } + foreach c [array names correct] { + if {$correct($c) eq "t"} { + incr num_correct_answers + } + } + set new_item_type_id [as::item_type_mc::edit \ + -as_item_type_id $as_item_type_id \ + -title $question_text \ + -increasing_p f \ + -allow_negative_p f \ + -num_correct_answers $num_correct_answers \ + -num_answers $num_answers] + db_dml update_item_type {} + # edit existing choices + set count 0 + foreach i [lsort [array names choice]] { + if {[string range $i 0 0] != "_" && ![empty_string_p $choice($i)]} { + incr count + set new_choice_id [as::item_choice::new_revision -choice_id $i -mc_id $new_item_type_id] + set title $choice($i) + set correct_answer_p [ad_decode [info exists correct($i)] 0 f t] + db_dml update_title {} + db_dml update_correct_and_sort_order {} + } + } + + # add new choices + foreach i [lsort [array names choice]] { + + if {[string range $i 0 0] == "_" && ![empty_string_p $choice($i)]} { + incr count + set new_choice_id [as::item_choice::new -mc_id $new_item_type_id \ + -title $choice($i) \ + -numeric_value "" \ + -text_value "" \ + -content_value "" \ + -feedback_text "" \ + -selected_p "" \ + -correct_answer_p [ad_decode [info exists correct($i)] 0 f t] \ + -sort_order $count \ + -percent_score ""] + } + } + } + "oq" { + set new_item_type_id [as::item_type_oq::edit \ + -as_item_type_id $as_item_type_id \ + -title $question_text \ + -default_value "" \ + -feedback_text "" \ + -reference_answer $reference_answer \ + -keywords ""] + db_dml update_item_type {} + + } + "fu" { + set new_item_type_id [as::item_type_fu::edit \ + -as_item_type_id $as_item_type_id \ + -title $question_text] + db_dml update_item_type {} + } + "sa" { + set new_item_type_id [as::item_type_sa::edit \ + -as_item_type_id $as_item_type_id \ + -title $question_text \ + -increasing_p f\ + -allow_negative_p f] + db_dml update_item_type {} + } + } + + } + + set as_item_id $new_item_id + set section_id $new_section_id + + application_data_link::update_links_from \ + -object_id $as_item_id \ + -text $question_text + } } -after_submit { - if {$old_display_type == $display_type} { - ad_returnredirect [export_vars -base "item-edit" {assessment_id section_id as_item_id}] + if {[exists_and_not_null formbutton_ok]} { + ad_returnredirect [export_vars -base "questions" {assessment_id section_id }]&\#${as_item_id} ad_script_abort - } else { - ad_returnredirect [export_vars -base "item-edit-display-$display_type" {assessment_id section_id as_item_id}] - ad_script_abort } } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-general.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-general.xql,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-general.xql 7 Aug 2006 01:19:35 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-general.xql 5 Feb 2007 14:15:04 -0000 1.4.2.1 @@ -114,4 +114,41 @@ + + + + update cr_revisions + set title = :title + where revision_id = :new_choice_id + + + + + + + + update as_item_choices + set correct_answer_p = :correct_answer_p, + sort_order = :count + where choice_id = :new_choice_id + + + + + + + + update as_item_rels + set target_rev_id = :new_item_type_id + where item_rev_id = :new_item_id + and rel_type = 'as_item_type_rel' + + + + + + + select sort_order from as_item_choices where choice_id=:n + + Index: openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-delete.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-delete.tcl 12 Jun 2006 02:49:51 -0000 1.4 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-delete.tcl 5 Feb 2007 14:15:04 -0000 1.4.2.1 @@ -27,7 +27,10 @@ set mc_id [db_string "get_mc_id" "select mc_id from as_item_choices where choice_id=:choice_id"] # *********** set new_mc_id [as::item_type_mc::new_revision -as_item_type_id $mc_id -with_choices_p f] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_item_type_in_item {} Index: openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-swap.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-swap.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-swap.tcl 12 Jun 2006 02:49:51 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc-choices-swap.tcl 5 Feb 2007 14:15:04 -0000 1.3.2.1 @@ -34,7 +34,10 @@ set new_item_id [as::item::new_revision -as_item_id $as_item_id] as::assessment::check::copy_item_checks -assessment_id $assessment_id -section_id $new_section_id -as_item_id $as_item_id -new_item_id $new_item_id set new_mc_id [as::item_type_mc::new_revision -as_item_type_id $mc_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_item_type_in_item {} db_dml swap_choices {} Index: openacs-4/packages/assessment/www/asm-admin/item-edit-mc-existing.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-mc-existing.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-mc-existing.tcl 12 Jun 2006 02:49:51 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc-existing.tcl 5 Feb 2007 14:15:04 -0000 1.3.2.1 @@ -47,7 +47,10 @@ set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] as::assessment::check::copy_item_checks -assessment_id $assessment_id -section_id $new_section_id -as_item_id $as_item_id -new_item_id $new_item_id - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_item_type {} } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-mc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-mc.adp,v diff -u -r1.3.6.1 -r1.3.6.2 --- openacs-4/packages/assessment/www/asm-admin/item-edit-mc.adp 24 Jan 2007 20:15:30 -0000 1.3.6.1 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc.adp 5 Feb 2007 14:15:04 -0000 1.3.6.2 @@ -2,6 +2,7 @@ @page_title;noquote@ @context;noquote@ -
- -
+ + +
+
<%= [ad_quotehtml [template::form::template item_edit_mc accessible-forms]] %>
\ No newline at end of file Index: openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl 24 Jan 2007 20:15:30 -0000 1.9.2.1 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl 5 Feb 2007 14:15:04 -0000 1.9.2.2 @@ -141,7 +141,10 @@ set as_item_id \[as::item::latest -as_item_id \$as_item_id -section_id \$new_section_id\] as::assessment::check::copy_item_checks -assessment_id \$assessment_id -section_id \$new_section_id -as_item_id \$as_item_id -new_item_id \$new_item_id - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_item_type {} @@ -160,7 +163,7 @@ # add new choices foreach i \[lsort \[array names choice\]\] { - + if {\[string range \$i 0 0\] == \"_\" && !\[empty_string_p \$choice(\$i)\]} { incr count set new_choice_id \[as::item_choice::new -mc_id \$new_item_type_id \\ Index: openacs-4/packages/assessment/www/asm-admin/item-edit-oq.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-oq.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-oq.tcl 12 Jun 2006 02:49:51 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-oq.tcl 5 Feb 2007 14:15:04 -0000 1.5.2.1 @@ -77,7 +77,10 @@ set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_item_type {} } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-sa.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-sa.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/assessment/www/asm-admin/item-edit-sa.tcl 12 Jun 2006 02:49:51 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-sa.tcl 5 Feb 2007 14:15:04 -0000 1.5.2.1 @@ -44,7 +44,7 @@ ad_form -extend -name item_edit_sa -form { {increasing_p:text(hidden) {value ""}} {allow_negative_p:text(hidden) {value ""}} - + } } @@ -64,7 +64,10 @@ set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] set as_item_id [as::item::latest -as_item_id $as_item_id -section_id $new_section_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml update_item_in_section {} db_dml update_item_type {} } Index: openacs-4/packages/assessment/www/asm-admin/item-swap.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-swap.tcl,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/assessment/www/asm-admin/item-swap.tcl 1 Feb 2007 14:57:43 -0000 1.3.2.1 +++ openacs-4/packages/assessment/www/asm-admin/item-swap.tcl 5 Feb 2007 14:15:04 -0000 1.3.2.2 @@ -29,7 +29,10 @@ db_transaction { set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id] set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id] - db_dml update_section_in_assessment {} + as::section::update_section_in_assessment\ + -old_section_id $section_id \ + -new_section_id $new_section_id \ + -new_assessment_rev_id $new_assessment_rev_id db_dml swap_items {} } on_error { ad_return_error "Database error" "A database error occured:
$errmsg
"