Index: openacs-4/packages/assessment/tcl/as-checks-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-checks-procs.tcl,v diff -u -r1.24.2.4 -r1.24.2.5 --- openacs-4/packages/assessment/tcl/as-checks-procs.tcl 26 Jul 2005 13:41:25 -0000 1.24.2.4 +++ openacs-4/packages/assessment/tcl/as-checks-procs.tcl 29 Jul 2005 14:52:18 -0000 1.24.2.5 @@ -656,3 +656,24 @@ as::assessment::check::eval_single_check -session_id $session_id -assessment_id $assessment_id -inter_item_check_id $inter_item_check_id } } + +ad_proc -public as::assessment::check::update_checks_condition { + {-choice_id:required} + {-new_choice_id:required} +} { + +} { + set checks [db_list_of_lists checks {}] + foreach check $checks { + set cond_list [split [lindex $check 1] "="] + set item_id [lindex [split [lindex $cond_list 2] " "] 0] + set condition [lindex [split [lindex $cond_list 1] " "] 0] + + if {$choice_id == $condition} { + set inter_item_check_id [lindex $check 0] + set check_sql [as::assessment::check::get_sql -item_id $item_id -condition $new_choice_id] + + db_dml update_check {} + } + } +} Index: openacs-4/packages/assessment/tcl/as-checks-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-checks-procs.xql,v diff -u -r1.19.2.4 -r1.19.2.5 --- openacs-4/packages/assessment/tcl/as-checks-procs.xql 27 Jul 2005 21:53:56 -0000 1.19.2.4 +++ openacs-4/packages/assessment/tcl/as-checks-procs.xql 29 Jul 2005 14:52:18 -0000 1.19.2.5 @@ -374,5 +374,17 @@ + + + select inter_item_check_id,check_sql from as_inter_item_checks + + + + + update as_inter_item_checks set check_sql=:check_sql where inter_item_check_id = :inter_item_check_id + + + + Index: openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl 31 May 2005 23:13:00 -0000 1.7.2.1 +++ openacs-4/packages/assessment/tcl/as-item-choice-procs.tcl 29 Jul 2005 14:52:18 -0000 1.7.2.2 @@ -84,7 +84,8 @@ [list percent_score $percent_score] \ [list fixed_position $fixed_position] ] ] } - + + return $as_item_choice_id } 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 -r1.17.2.1 -r1.17.2.2 --- openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 31 May 2005 23:13:00 -0000 1.17.2.1 +++ openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 29 Jul 2005 14:52:18 -0000 1.17.2.2 @@ -93,6 +93,7 @@ set choices [db_list get_choices {}] foreach choice_id $choices { set new_choice_id [as::item_choice::new_revision -choice_id $choice_id -mc_id $new_item_type_id] + as::assessment::check::update_checks_condition -choice_id $choice_id -new_choice_id $new_choice_id } } } 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.8.2.4 -r1.8.2.5 --- openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl 18 Jul 2005 18:01:01 -0000 1.8.2.4 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl 29 Jul 2005 14:52:19 -0000 1.8.2.5 @@ -151,6 +151,7 @@ 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\] + as::assessment::check::update_checks_condition -choice_id \$i -new_choice_id \$new_choice_id set title \$choice(\$i) set correct_answer_p \[ad_decode \[info exists correct(\$i)\] 0 f t\] db_dml update_title {}