Index: openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl 30 Mar 2005 17:38:38 -0000 1.7 +++ openacs-4/packages/assessment/tcl/as-apm-action-procs.tcl 1 Aug 2005 15:54:46 -0000 1.7.2.1 @@ -44,7 +44,7 @@ set check_sql [lindex $check 1] set cond_list [split $check_sql "="] set item_id [lindex [split [lindex $cond_list 2] " "] 0] - set condition [lindex [split [lindex $cond_list 1] " "] 0] + set condition [lindex [split [lindex $cond_list 1] ")"] 0] set append_sql " and id.item_data_id = (select max(item_data_id) from as_item_data where as_item_id=$item_id and session_id=:session_id)" append check_sql $append_sql 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.5 -r1.24.2.6 --- openacs-4/packages/assessment/tcl/as-checks-procs.tcl 29 Jul 2005 14:52:18 -0000 1.24.2.5 +++ openacs-4/packages/assessment/tcl/as-checks-procs.tcl 1 Aug 2005 15:54:46 -0000 1.24.2.6 @@ -142,7 +142,7 @@ } { } { - set check_sql "select (case when idc.choice_id=$condition then \'1\' else \'0\' end) as perform_p from as_item_data id, as_item_data_choices idc where id.as_item_id=$item_id and id.item_data_id=idc.item_data_id and id.session_id=:session_id" + set check_sql "select (case when idc.choice_id in (select revision_id from cr_revisions where item_id=$condition) then \'1\' else \'0\' end) as perform_p from as_item_data id, as_item_data_choices idc where id.as_item_id=$item_id and id.item_data_id=idc.item_data_id and id.session_id=:session_id" return $check_sql } @@ -614,7 +614,7 @@ 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] + set condition [lindex [split [lindex $cond_list 1] ")"] 0] if {$item_id == $as_item_id} { set inter_item_check_id [lindex $check 0] @@ -657,23 +657,3 @@ } } -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.5 -r1.19.2.6 --- openacs-4/packages/assessment/tcl/as-checks-procs.xql 29 Jul 2005 14:52:18 -0000 1.19.2.5 +++ openacs-4/packages/assessment/tcl/as-checks-procs.xql 1 Aug 2005 15:54:46 -0000 1.19.2.6 @@ -374,17 +374,6 @@ - - - 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-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.2 -r1.17.2.3 --- openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 29 Jul 2005 14:52:18 -0000 1.17.2.2 +++ openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 1 Aug 2005 15:54:46 -0000 1.17.2.3 @@ -93,7 +93,6 @@ 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/add-edit-check.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/add-edit-check.tcl,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/assessment/www/asm-admin/add-edit-check.tcl 7 Apr 2005 23:01:29 -0000 1.6 +++ openacs-4/packages/assessment/www/asm-admin/add-edit-check.tcl 1 Aug 2005 15:54:46 -0000 1.6.2.1 @@ -127,11 +127,11 @@ } -edit_request { db_1row get_check_properties {} - set condition_sql [db_string get_item_id {}] + set condition_sql $check_sql #parse condition_sql to get choice_id set cond_list [split $condition_sql "="] - #set condition [string range [lindex $cond_list 1] 0 3] - set condition [lindex [split [lindex $cond_list 1] " "] 0] + set condition [lindex [split [lindex $cond_list 1] ")"] 0] + #ad_return_complaint 1 "${condition} $choices" } -edit_data { set check_sql [as::assessment::check::get_sql -condition $condition -item_id $item_id] Index: openacs-4/packages/assessment/www/asm-admin/add-edit-check.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/add-edit-check.xql,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/assessment/www/asm-admin/add-edit-check.xql 1 Feb 2005 22:00:10 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/add-edit-check.xql 1 Aug 2005 15:54:46 -0000 1.1.2.1 @@ -33,7 +33,7 @@ - select r.title,c.choice_id + select r.title, r.item_id from as_item_choices c, cr_revisions r where r.revision_id = c.choice_id and c.mc_id = :as_item_type_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.6 -r1.8.2.7 --- openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl 1 Aug 2005 11:52:14 -0000 1.8.2.6 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl 1 Aug 2005 15:54:46 -0000 1.8.2.7 @@ -151,7 +151,6 @@ 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 {}