diff options
-rwxr-xr-x | GradeBook_lib.tcl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index 2379720..95e3749 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -2909,12 +2909,14 @@ proc htmlShowGradingSchema { permission_list user } { set grading_scheme [get_grading_scheme] set prevThreshold "" set skipAplus true - set separator ";" + set separator "; " puts {<div class="grading_scheme">} puts {<p>} puts {Final letter grade is assigned by the following scheme:} puts {</p>} puts {<p>} + set scheme_strings {} + # we assume that grading_scheme sorted in order from A+ to F foreach {letter threshold} $grading_scheme { if { $skipAplus} { if { $letter eq "A+" } { continue } @@ -2923,17 +2925,17 @@ proc htmlShowGradingSchema { permission_list user } { set threshold [expr {round(100.0*$threshold)}] set threshold "$threshold%" if { $prevThreshold eq "" } { - puts -nonewline "$letter: >= $threshold" + lappend scheme_strings "$letter: >= $threshold" } else { if { $letter eq "F" } { - puts -nonewline "$separator $letter: < $prevThreshold" + lappend scheme_strings "$letter: < $prevThreshold" } else { - puts -nonewline "$separator $letter: \[$threshold, $prevThreshold)" + lappend scheme_strings "$letter: \[$threshold, $prevThreshold)" } } set prevThreshold $threshold } - puts "" + puts [join [lreverse $scheme_strings] $separator] puts {</p>} puts {</div>} |