Index: openacs-4/packages/xowf/tcl/test-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/test-item-procs.tcl,v diff -u -r1.7.2.83 -r1.7.2.84 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 7 Oct 2020 14:46:21 -0000 1.7.2.83 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 13 Oct 2020 15:16:26 -0000 1.7.2.84 @@ -1057,7 +1057,7 @@ dict set nameToQuestionObjDict [:form_name_based_attribute_stem [$o name]] $o } return $nameToQuestionObjDict - } + } :public method answer_attributes {instance_attributes} { # @@ -2955,6 +2955,28 @@ } } } + + Grading create ::xowf::test_item::grading::wi1_noround -percentage_boundaries {50.0 60.0 70.0 80.0} { + + :public object method print {-achieved_points:required} { + if {[dict exists $achieved_points achievedPoints]} { + set totalPoints [format %.2f [dict get $achieved_points totalPoints]] + set achievedPoints [format %.2f [dict get $achieved_points achievedPoints]] + set percentage [format %.2f [expr {$totalPoints > 0 ? ($achievedPoints*100.0/$totalPoints) : 0}]] + set grade [:grade -achieved_points $achieved_points] + set panelHTML [_ xowf.panel_achievied_points_wi1_noround] + return [list panel $panelHTML csv [subst {$achievedPoints\t$percentage%\t$grade}]] + } + } + :public object method grade {-achieved_points:required} { + if {[dict exists $achieved_points achievedPoints]} { + set achieved [format %.2f [dict get $achieved_points achievedPoints]] + ns_log notice "XXXX $achieved_points -> [list calc_grade -points $achieved -achieved_points $achieved_points]" + return [:calc_grade -points $achieved -achieved_points $achieved_points] + } + } + } + } namespace eval ::xowiki {