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 -N -r1.7.2.122 -r1.7.2.123 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 23 Apr 2021 17:56:16 -0000 1.7.2.122 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 23 Apr 2021 21:26:13 -0000 1.7.2.123 @@ -1890,6 +1890,10 @@ foreach a [dict keys $answer_attributes] { set f [$answer_object lookup_form_field -name $a $all_form_fields] set points {} + if {![$f exists test_item_points]} { + ns_log warning "question $f [$f name] [$f info precedence] HAS NO POINTS" + $f set test_item_points 0 + } set achievablePoints [$f set test_item_points] set achievableTotalPoints [expr {$achievableTotalPoints + $achievablePoints}] if {[$f exists correction_data]} { @@ -1909,7 +1913,6 @@ } return [list achievedPoints $totalPoints \ details $details \ - achievedPointsRounded [format %.0f $totalPoints] \ achievablePoints $achievableTotalPoints] } @@ -3791,23 +3794,25 @@ } } - + 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 achieved_points [:complete_dict $achieved_points] - set grade [:grade -achieved_points $achieved_points] + set grade [:grade -achieved_points $achieved_points] dict with achieved_points { - set panelHTML [_ xowf.panel_achievied_points_wi1_noround] + 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_points [:complete_dict $achieved_points] - return [:calc_grade -points $achievedPoints -achieved_points $achieved_points] + set achieved_points [:complete_dict $achieved_points] + dict with achieved_points { + return [:calc_grade -points $achievedPoints -achieved_points $achieved_points] + } } } }