Index: openacs-4/packages/assessment/www/asm-admin/item-stats.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-stats.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/item-stats.tcl 12 Jun 2006 12:14:58 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/item-stats.tcl 14 Jun 2006 15:53:47 -0000 1.2 @@ -52,7 +52,7 @@ set stats "" - if { $display_type eq "rb" || $display_type eq "cb" } { + if { $display_type eq "rb" || $display_type eq "cb" || $display_type eq "sb" } { set total_responses 0 set total_correct 0 set total_choices 0 @@ -97,34 +97,39 @@ } } - append stats "\n" - set first_p 1 - foreach choice $choices { - array set r $choice + if { $total_responses } { + append stats "
\n" + set first_p 1 + foreach choice $choices { + array set r $choice - append stats "" - if { $r(correct_answer_p) } { - append stats "" - } else { - append stats "" - } - append stats "\n" + append stats "" + if { $r(correct_answer_p) } { + append stats "" + } else { + append stats "" + } + append stats "\n" - if { $first_p } { - append stats " + if { $first_p } { + append stats " \n" + + if { $total_correct > 0 } { + append stats ", [format "%.2f" [expr double($total_correct) / $total_responses * 100]]%" + } + append stats "\n" - set first_p 0 - } else { - append stats "\n" + set first_p 0 + } else { + append stats "\n" + } } + append stats "
 $r(choice_title):$r(choice_responses)[expr double($r(choice_responses)) / $total_responses * 100]%
 $r(choice_title):$r(choice_responses)[format "%.2f" [expr double($r(choice_responses)) / $total_responses * 100]]% [_ assessment.Total_Responses] $total_responses
[_ assessment.Total_Correct] $total_correct" - - if { $total_correct > 0 } { - append stats ", [expr double($total_correct) / $total_responses * 100]%" - } - append stats "
\n" + } else { + append stats "[_ assessment.No_responses]" } } else { switch $data_type {