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.45 -r1.1.2.46 --- openacs-4/packages/xowf/lib/inclass-exam.wf 30 Sep 2020 11:58:01 -0000 1.1.2.45 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 7 Oct 2020 13:50:56 -0000 1.1.2.46 @@ -618,6 +618,7 @@ set achieved_points [xowf::test_item::answer_manager achieved_points \ -answer_object $i -answer_attributes $answerAttributes] dict set achieved_points totalPoints $totalPoints + #ns_log notice "===== www-print-answers: $userName achieved_points $achieved_points" } } } 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.81 -r1.7.2.82 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 27 Sep 2020 16:54:52 -0000 1.7.2.81 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 7 Oct 2020 13:50:56 -0000 1.7.2.82 @@ -1565,23 +1565,32 @@ # set all_form_fields [::xowiki::formfield::FormField info instances -closure] set totalPoints 0 - set achieveablePoints 0 + set achieveableTotalPoints 0 + set details {} foreach a [dict keys $answer_attributes] { set f [$answer_object lookup_form_field -name $a $all_form_fields] + set points {} + set achieveablePoints [$f set test_item_points] + set achieveableTotalPoints [expr {$achieveableTotalPoints + $achieveablePoints}] if {[$f exists correction_data]} { set cd [$f set correction_data] #ns_log notice "FOO: $a <$f> $cd" if {[dict exists $cd points]} { - set totalPoints [expr {$totalPoints + [dict get $cd points]}] - set achieveablePoints [expr {$achieveablePoints + [$f set test_item_points]}] + set points [dict get $cd points] + set totalPoints [expr {$totalPoints + $points}] } else { - ns_log notice "$a: no points in correction_data, ignoring in points calculation" + ns_log warning "$a: no points in correction_data, ignoring in points calculation" } } + lappend details [dict create \ + item_id [[$f object] item_id] \ + achieved $points \ + achieveable $achieveablePoints] } return [list achievedPoints $totalPoints \ + details $details \ achievedPointsRounded [format %.0f $totalPoints] \ - achieveablePoints $achieveablePoints] + achieveablePoints $achieveableTotalPoints] } ######################################################################## @@ -2639,7 +2648,9 @@ # or a question, where every alternative is exactly provided. # if {[dict exists $qd question.grading]} { - # autograde ok + # autograde ok on the question level + } elseif {[dict exists $formAttributes auto_correct] && [dict get $formAttributes auto_correct]} { + # autograde ok on the form level } elseif [dict exists $qd question.interaction question.interaction.answer] { set answer [dict get $qd question.interaction question.interaction.answer] foreach k [dict keys $answer] { @@ -2650,6 +2661,7 @@ } else { set autoGrade 0 } + #ns_log notice "question_info [$form_obj name] [$form_obj title] autoGrade $autoGrade" } }