Index: openacs-4/packages/assessment/www/session.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/www/session.tcl 24 Sep 2004 13:27:55 -0000 1.6 +++ openacs-4/packages/assessment/www/session.tcl 28 Sep 2004 14:42:43 -0000 1.7 @@ -25,26 +25,32 @@ set item_item_id [db_string cr_item_from_revision "select item_id from cr_revisions where revision_id=:as_item_id"] set item_mc_id [db_string item_item_type "SELECT related_object_id FROM cr_item_rels WHERE relation_tag = 'as_item_type_rel' AND item_id=:item_item_id"] set mc_id [db_string item_to_rev "SELECT revision_id FROM cr_revisions WHERE item_id=:item_mc_id"] + set item_display_id [db_string item_item_type "SELECT related_object_id FROM cr_item_rels WHERE relation_tag = 'as_item_display_rel' AND item_id=:item_item_id"] + db_0or1row as_item_display_rbx "SELECT item_id AS as_item_display_rbx__item_id FROM as_item_display_rbx WHERE item_id=:item_display_id" + set presentation_type "checkbox" ;# DEFAULT + if {[info exists as_item_display_rbx__item_id]} {set presentation_type "radio"} + set notanswered 1 set maxscore $itemmaxscore set score 0 set item_correct 1 - set choice_html "" + set choice_html "
[_ assessment.Student_Response][_ assessment.Correct_Answer][_ assessment.Answer_Choices]
" db_foreach choices {} { if {[string length "$choice_id_answer"]} {set notanswered 0} if {$correct_answer_p == {t}} { set correct_answer_bool 1 } else { set correct_answer_bool 0 } - set item_correct [expr $item_correct && ($correct_answer_bool == ("$choice_id_answer" == $choice_id))] - if {$correct_answer_p == {t}} { - set correct_answer {} + set choice_correct [expr $correct_answer_bool == ("$choice_id_answer" == $choice_id)] + set item_correct [expr $item_correct && $choice_correct] + if {$choice_correct} { + set correct_answer {} } else { - set correct_answer {} + set correct_answer {Error} } if {$choice_id_answer == $choice_id } { - set choice_answer {} + set choice_answer "" } else { - set choice_answer {} + set choice_answer "" } - append choice_html "" + append choice_html "" } if {$item_correct} { set score $itemmaxscore } set session_score [expr $session_score+$score]
$choice_answer$correct_answer[ad_quotehtml $choice_title]
$correct_answer$choice_answer [ad_quotehtml $choice_title]