Index: openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml,v diff -u -r1.17 -r1.18 --- openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml 24 Dec 2004 15:32:38 -0000 1.17 +++ openacs-4/packages/assessment/catalog/assessment.en_US.ISO-8859-1.xml 25 Dec 2004 13:11:54 -0000 1.18 @@ -206,6 +206,7 @@ No Immediate retry allowed None + not answered not yet reviewed Total Number of displayed Choices If this number is smaller than the number of added choices, choices will be picked randomly. 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.1 -r1.2 --- openacs-4/packages/assessment/lib/session-items.adp 24 Dec 2004 15:32:38 -0000 1.1 +++ openacs-4/packages/assessment/lib/session-items.adp 25 Dec 2004 13:11:54 -0000 1.2 @@ -1,5 +1,8 @@ + + #assessment.not_answered# + @@ -10,7 +13,8 @@ - @items.name@:#assessment.Question# @items.rownum@: + @items.name@:#assessment.Question# @items.rownum@: + (#assessment.max_time# @items.max_time_to_complete@) @@ -20,10 +24,12 @@ -@items.result_points@ / @items.points@ #assessment.points# -#assessment.not_yet_reviewed# - - (#assessment.max_time# @items.max_time_to_complete@) +@items.result_points@ / @items.points@ #assessment.points#: @items.feedback;noquote@ + + + #assessment.not_yet_reviewed# + #assessment.not_answered# + 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.1 -r1.2 --- openacs-4/packages/assessment/lib/session-items.tcl 24 Dec 2004 15:32:38 -0000 1.1 +++ openacs-4/packages/assessment/lib/session-items.tcl 25 Dec 2004 13:11:54 -0000 1.2 @@ -3,13 +3,11 @@ } # todo: display feedback text -db_multirow -extend { presentation_type html result_points } items session_items {} { +db_multirow -extend { presentation_type html result_points feedback answered_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] - ns_log notice "\#\#\# $default_value" + set presentation_type [as::item_form::add_item_to_form -name session_results_$section_id -section_id $section_id -item_id $as_item_id -session_id $session_id -default_value $default_value -show_feedback $show_feedback] - set presentation_type [as::item_form::add_item_to_form -name session_results_$section_id -section_id $section_id -item_id $as_item_id -session_id $session_id -default_value $default_value] - if {$presentation_type == "fitb"} { regsub -all -line -nocase -- {$feedback_wrong" + } else { + set feedback "$feedback_right" + } + } else { + set result_points "" + set feedback "" + set answered_p f + } } Index: openacs-4/packages/assessment/lib/session-items.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session-items.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/lib/session-items.xql 24 Dec 2004 15:32:38 -0000 1.1 +++ openacs-4/packages/assessment/lib/session-items.xql 25 Dec 2004 13:11:54 -0000 1.2 @@ -5,7 +5,7 @@ select i.as_item_id, i.subtext, cr.title, ci.name, ism.required_p, - ism.section_id, ism.sort_order, + ism.section_id, ism.sort_order, i.feedback_right, i.feedback_wrong, ism.max_time_to_complete, ism.points from as_items i, cr_revisions cr, cr_items ci, as_item_section_map ism, as_session_items si Index: openacs-4/packages/assessment/tcl/as-item-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-form-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/assessment/tcl/as-item-form-procs.tcl 24 Dec 2004 15:32:38 -0000 1.11 +++ openacs-4/packages/assessment/tcl/as-item-form-procs.tcl 25 Dec 2004 13:11:55 -0000 1.12 @@ -12,6 +12,7 @@ -item_id:required {-session_id ""} {-default_value ""} + {-show_feedback ""} } { @author Timo Hentschel (timo@timohentschel.de) @modified-date 2004-12-10 @@ -24,7 +25,7 @@ set item_type [string range $item_type end-1 end] set display_type [string range $display_type end-1 end] - util_unlist [as::item_type_$item_type\::render -type_id $item_type_id -session_id $session_id -section_id $section_id -as_item_id $item_id -default_value $default_value] default_value data + util_unlist [as::item_type_$item_type\::render -type_id $item_type_id -session_id $session_id -section_id $section_id -as_item_id $item_id -default_value $default_value -show_feedback $show_feedback] default_value data as::item_display_$display_type\::render \ -form $name \ Index: openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 24 Dec 2004 15:32:38 -0000 1.9 +++ openacs-4/packages/assessment/tcl/as-item-type-mc-procs.tcl 25 Dec 2004 13:11:55 -0000 1.10 @@ -136,19 +136,36 @@ -as_item_id:required {-default_value ""} {-session_id ""} + {-show_feedback ""} } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-10 Render a Multiple Choice Type } { + set defaults "" if {![empty_string_p $default_value]} { array set values $default_value set defaults $values(choice_answer) } if {![empty_string_p $session_id]} { - set choice_list [db_list_of_lists get_sorted_choices {}] + if {[empty_string_p $show_feedback] || $show_feedback == "none"} { + set choice_list [db_list_of_lists get_sorted_choices {}] + } else { + # incorrect correct + set choice_list "" + db_foreach get_sorted_choices_with_feedback {} { + set pos [lsearch -exact -integer $defaults $choice_id] + if {$pos>-1 && $correct_answer_p == "t" && $show_feedback != "incorrect"} { + lappend choice_list [list "$title $feedback_text" $choice_id] + } elseif {$pos>-1 && $correct_answer_p == "f" && $show_feedback != "correct"} { + lappend choice_list [list "$title $feedback_text" $choice_id] + } else { + lappend choice_list [list $title $choice_id] + } + } + } if {[llength $choice_list] > 0} { return [list $defaults $choice_list] @@ -157,7 +174,6 @@ db_1row item_type_data {} - set defaults "" set display_choices [list] set correct_choices [list] set wrong_choices [list] Index: openacs-4/packages/assessment/tcl/as-item-type-mc-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-mc-procs.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/tcl/as-item-type-mc-procs.xql 24 Dec 2004 15:32:38 -0000 1.6 +++ openacs-4/packages/assessment/tcl/as-item-type-mc-procs.xql 25 Dec 2004 13:11:55 -0000 1.7 @@ -68,6 +68,20 @@ + + + + select r.title, c.choice_id, c.correct_answer_p, c.feedback_text + from as_session_choices sc, as_item_choices c, cr_revisions r + where sc.session_id = :session_id + and sc.section_id = :section_id + and sc.as_item_id = :as_item_id + and r.revision_id = sc.choice_id + and c.choice_id = sc.choice_id + + + + Index: openacs-4/packages/assessment/tcl/as-item-type-oq-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-oq-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/tcl/as-item-type-oq-procs.tcl 24 Dec 2004 15:32:38 -0000 1.8 +++ openacs-4/packages/assessment/tcl/as-item-type-oq-procs.tcl 25 Dec 2004 13:11:55 -0000 1.9 @@ -87,19 +87,18 @@ -as_item_id:required {-default_value ""} {-session_id ""} + {-show_feedback ""} } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-10 Render an Open Question Type } { - db_1row item_type_data {} - if {![empty_string_p $default_value]} { array set values $default_value set default $values(clob_answer) } else { - set default "" + db_1row item_type_data {} } return [list $default ""] Index: openacs-4/packages/assessment/tcl/as-item-type-oq-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-oq-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/tcl/as-item-type-oq-procs.xql 10 Dec 2004 20:21:50 -0000 1.2 +++ openacs-4/packages/assessment/tcl/as-item-type-oq-procs.xql 25 Dec 2004 13:11:55 -0000 1.3 @@ -25,7 +25,7 @@ - select default_value + select default_value as default from as_item_type_oq where as_item_type_id = :type_id Index: openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl 24 Dec 2004 15:32:38 -0000 1.8 +++ openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl 25 Dec 2004 13:11:55 -0000 1.9 @@ -87,13 +87,21 @@ -as_item_id:required {-default_value ""} {-session_id ""} + {-show_feedback ""} } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2004-12-10 Render a Short Answer Type } { - return [list "" ""] + if {![empty_string_p $default_value]} { + array set values $default_value + set default $values(text_answer) + } else { + set default "" + } + + return [list $default ""] } ad_proc -public as::item_type_sa::process { Index: openacs-4/packages/assessment/www/session.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.adp,v diff -u -r1.15 -r1.16 --- openacs-4/packages/assessment/www/session.adp 24 Dec 2004 15:32:38 -0000 1.15 +++ openacs-4/packages/assessment/www/session.adp 25 Dec 2004 13:11:55 -0000 1.16 @@ -21,16 +21,17 @@ -@sections.rownum@. #assessment.section# @sections.title@ +#assessment.section# @sections.title@ (#assessment.max_time# @sections.max_time_to_complete@) (0 / @sections.points@ #assessment.points#) @sections.description@ +@sections.feedback_text@ - + Index: openacs-4/packages/assessment/www/session.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.tcl,v diff -u -r1.27 -r1.28 --- openacs-4/packages/assessment/www/session.tcl 24 Dec 2004 15:32:38 -0000 1.27 +++ openacs-4/packages/assessment/www/session.tcl 25 Dec 2004 13:11:55 -0000 1.28 @@ -33,6 +33,7 @@ if {[empty_string_p $assessment_data(show_feedback)]} { set assessment_data(show_feedback) "all" } + set assessment_data(show_feedback) "all" # show_feedback: none, all, incorrect, correct
- +