Index: openacs-4/packages/assessment/www/asm-admin/item-add-mc-choices.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add-mc-choices.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/item-add-mc-choices.tcl 9 Feb 2005 10:42:51 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/item-add-mc-choices.tcl 9 Feb 2005 10:59:11 -0000 1.4 @@ -65,7 +65,16 @@ append ad_form_code "\{percent.$choice_id:text,nospell \{label \"[_ assessment.Percent_Score]\"\} \{value \"$default_percent\"\} \{html \{size 5 maxlength 5\}\} \{help_text \"[_ assessment.Percent_Score_help]\"\}\}\n" } append ad_form_code "\}" -set percentage [expr 100 / $count_correct] + +# Check if we have at least one correct answer. If not set the percentage to 0 +# (apparently the author does not want the respondee to give a correct answer. + +if {$count_correct > 0} { + set percentage [expr 100 / $count_correct] +} else { + set percentage 0 +} + eval ad_form -extend -name item_add_mc_choices $ad_form_code