Index: openacs-4/packages/xowf/lib/inclass-exam.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/inclass-exam.wf,v diff -u -r1.1.2.64 -r1.1.2.65 --- openacs-4/packages/xowf/lib/inclass-exam.wf 6 Apr 2021 17:42:24 -0000 1.1.2.64 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 23 Apr 2021 21:26:13 -0000 1.1.2.65 @@ -541,6 +541,7 @@ set creation_user [:query_parameter creation_user:integer ""] set revision_id [:query_parameter rid:integer ""] set export [:query_parameter export:boolean 0] + set grading [:query_parameter grading:alnum ""] set combined_form_info [::xowf::test_item::question_manager combined_question_form [self]] set autograde [dict get $combined_form_info autograde] @@ -551,15 +552,21 @@ # The management of the grading scheme has to be extended. For the # time being, we have a single grading scheme with the option to # round to full points or not. When an exam has less than 40 - # points, we do not round, since this rounding could provide more - # than 1 percent of the result. This should be made configurable - # (also in www-print-answer-table, which is not used right now). + # points, we do not round per default, since this rounding could + # provide more than 1 percent of the result. This should be made + # configurable (also in www-print-answer-table, which is not used + # right now). # - set grading_scheme ::xowf::test_item::grading::wi1 + if {$grading eq ""} { + set grading [expr {$totalPoints < 40 ? "wi1_noround" : "wi1"}] + } - if {$totalPoints < 40} { - append grading_scheme _noround + set grading_scheme ::xowf::test_item::grading::$grading + if {[info commands $grading_scheme] eq ""} { + set grading_scheme ::xowf::test_item::grading::wi1 } + #ns_log notice "USE grading_scheme $grading_scheme" + set grade_dict {} set grade_csv "" 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.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] + } } } }