Index: openacs-4/packages/assessment/lib/session-items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session-items.adp,v diff -u -r1.10 -r1.11 --- openacs-4/packages/assessment/lib/session-items.adp 12 Jun 2006 03:02:37 -0000 1.10 +++ openacs-4/packages/assessment/lib/session-items.adp 12 Jul 2006 23:36:30 -0000 1.11 @@ -37,6 +37,8 @@ @items.title;noquote@ @items.content;noquote@ +
@items.feedback_right;noquote@
+
@items.feedback_wrong;noquote@
Index: openacs-4/packages/assessment/lib/session-items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session-items.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/assessment/lib/session-items.tcl 12 Jul 2006 07:05:04 -0000 1.14 +++ openacs-4/packages/assessment/lib/session-items.tcl 12 Jul 2006 23:36:30 -0000 1.15 @@ -26,10 +26,10 @@ ad_form -name session_results_$section_id -mode display -form { {section_id:text(hidden) {value $section_id}} } - +ns_log notice "assessment session-items.tcl show_feedback = '${show_feedback}'" # todo: display feedback text set feedback_count 0 -db_multirow -extend { presentation_type html result_points feedback answered_p choice_orientation next_title next_pr_type num content has_feedback_p } items session_items {} { +db_multirow -extend { presentation_type html result_points feedback answered_p choice_orientation next_title next_pr_type num content has_feedback_p correct_p} items session_items {} { set default_value [as::item_data::get -subject_id $subject_id -as_item_id $as_item_id -session_id $session_id] array set item [as::item::item_data -as_item_id $as_item_id] @@ -64,6 +64,7 @@ if { $points != 0 } { if {$result_points < $points} { + set correct_p 0 if {$show_feedback != "correct"} { if { $feedback_wrong ne "" } { set feedback "$feedback_wrong" @@ -73,6 +74,7 @@ } } } else { + set correct_p 1 if {$show_feedback != "incorrect"} { if { $feedback_right ne "" } { set feedback "$feedback_right" @@ -83,6 +85,7 @@ } } } else { + set correct_p 1 if {$presentation_type == "rb" || $presentation_type == "cb"} { set user_answers [db_list get_user_choice_answers {}] @@ -92,6 +95,7 @@ set user_answers [lindex $user_answers 0] if { [lsearch $correct_answers $user_answers] == -1 } { + set correct_p 0 if {$show_feedback != "correct"} { if { $feedback_wrong ne "" } { set feedback "$feedback_wrong" @@ -113,6 +117,7 @@ } else { # Checkbox, all answers must be correct if no # points are set + if { [llength $user_answers] != [llength $correct_answers] } { set correct_p 0 } else {