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.29 -r1.1.2.30 --- openacs-4/packages/xowf/lib/inclass-exam.wf 28 Apr 2020 22:37:42 -0000 1.1.2.29 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 28 Apr 2020 22:58:04 -0000 1.1.2.30 @@ -156,7 +156,7 @@ set text "
[expr {$synchronized ? "" : "Non-"}]Synchronized Exam @@ -509,7 +509,7 @@ foreach f [::xowiki::formfield::FormField info instances -closure] { #ns_log notice "FF could DESTROY $f [$f name]" if {[string match *_ [$f name]]} { - #ns_log notice "FF DESTROY $f [$f name]" + #ns_log notice "FF DESTROY $f [$f name]" $f destroy } } @@ -616,28 +616,11 @@ -achieved_points $achieved_points \ $i] if {$autograde} { - # achieved_points achievedPoints 4.0 achieveablePoints 4 totalPoints 4 - if {[dict exists $achieved_points totalPoints] && [dict get $achieved_points totalPoints] > 0} { - set percentage [format %.2f [expr { - [dict get $achieved_points achievedPoints]*100/ - [dict get $achieved_points totalPoints] - }]] - set grade 1 - set gradePos 0 - foreach boundary $percentage_to_grade { - #ns_log notice "compare $percentage < $boundary" - if {$percentage < $boundary} { - set grade [expr {5-$gradePos}] - #ns_log notice "setting grade to $grade" - break - } - incr gradePos - } - dict incr grade_count $grade - } + dict incr grade_count [xowf::test_item::answer_manager grade \ + -achieved_points $achieved_points \ + -percentage_boundaries $percentage_to_grade] } - set heading "$userName · $fullName · $pretty_date" append HTML [subst {
#xowf.Grade# | # | " \ - "\n" - set nrGrades 0 - foreach v [dict values $grade_count] { incr nrGrades $v} - foreach k [lsort [dict keys $grade_count]] { - set count [dict get $grade_count $k] - set countPercentage [format %.2f [expr {$count*100.0/$nrGrades}]] - append gradingTable \ -|
---|---|---|
$k | $count | }] \ - [subst {
$gradingTable
+ append HTML[xowf::test_item::answer_manager grading_table $grade_count]
} - + set return_url [$package_id query_parameter local_return_url:localurl [:pretty_link]] append HTML "#xowf.Grade# | # | " \ + "\n" + set nrGrades 0 + foreach v [dict values $grade_count_dict] { incr nrGrades $v} + foreach k [lsort [dict keys $grade_count_dict]] { + set count [dict get $grade_count_dict $k] + set countPercentage [format %.2f [expr {$count *100.0 / $nrGrades}]] + append gradingTable \ +|
---|---|---|
$k | $count | }] \ + [subst {