Index: openacs-4/packages/assessment/www/assessment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/assessment.tcl,v diff -u -r1.26 -r1.27 --- openacs-4/packages/assessment/www/assessment.tcl 24 Jan 2005 14:54:30 -0000 1.26 +++ openacs-4/packages/assessment/www/assessment.tcl 25 Jan 2005 15:14:36 -0000 1.27 @@ -20,7 +20,7 @@ set user_id [ad_conn user_id] set page_title "[_ assessment.Show_Items]" set context_bar [ad_context_bar $page_title] - +set section_to "" # Get the assessment data as::assessment::data -assessment_id $assessment_id @@ -275,7 +275,14 @@ set item_type \[string range \$item_type end-1 end\] if {!\[info exists response_to_item(\$response_item_id)\]} { set response_to_item(\$response_item_id) \"\" - } + } else { + ns_log \"--------------> branch check\" + set section_to_tmp \[as::assessment::checks::branch_checks -item_id \$response_item_id -response \$response_to_item(\$response_item_id) -session_id $session_id -assessment_id $assessment_id\ -section_id $section_id] + if { \$section_to_tmp != \"f\" && \$section_to_tmp != \"f\"} { + set section_to \$section_to_tmp + } + + } set points \[ad_decode \$points \"\" 0 \$points\] as::item_type_\$item_type\\::process -type_id \$item_type_id -session_id \$session_id -as_item_id \$response_item_id -section_id \$section_id -subject_id \$user_id -response \$response_to_item(\$response_item_id) -max_points \$points -allow_overwrite_p \$display(back_button_p) @@ -314,8 +321,16 @@ set item_type \[string range \$item_type end-1 end\] if {!\[info exists response_to_item(\$response_item_id)\]} { set response_to_item(\$response_item_id) \"\" - } + } else { + ns_log notice \"--------------> branch check \$response_item_id \" + set section_to_tmp \[as::assessment::check::branch_checks -item_id \$response_item_id -response \$response_to_item(\$response_item_id) -session_id $session_id -assessment_id $assessment_id\ -section_id $section_id] + if { \$section_to_tmp != \"f\" && \$section_to_tmp != \"f\"} { + set section_to \$section_to_tmp + } + + } + set points \[ad_decode \$points \"\" 0 \$points\] as::item_type_\$item_type\\::process -type_id \$item_type_id -session_id \$session_id -as_item_id \$response_item_id -section_id \$section_id -subject_id \$user_id -response \$response_to_item(\$response_item_id) -max_points \$points -allow_overwrite_p \$display(back_button_p) } @@ -329,7 +344,11 @@ set after_submit "{ if {!\[empty_string_p \$new_section_order\]} { # go to next section + if { \$section_to != \"\"} { + set section_order \$section_to + } else { set section_order \$new_section_order + } set item_order \$new_item_order ad_returnredirect \[export_vars -base assessment {assessment_id session_id section_order item_order}\] ad_script_abort