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.57 -r1.7.2.58 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 28 Apr 2020 22:29:41 -0000 1.7.2.57 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 28 Apr 2020 22:58:04 -0000 1.7.2.58 @@ -1142,6 +1142,8 @@ # - marked_results # - answers_panel # - results_table + # - grading_table + # - grade # - participants_table # - revisions_up_to # @@ -1592,7 +1594,61 @@ } } + :public method grading_table {grade_count_dict} { + # + # Produce HTML markup based on a dict with grades as keys and + # counts as values. + # + set gradingTable {
#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 {