diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2018-05-10 16:15:52 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2018-05-10 16:18:46 -0400 |
commit | 00888946676b6e21bbf5be73668fa4da55d9cdb4 (patch) | |
tree | 8e2cf47a758535004242685a9e16a489cec97dad /GradeBook_lib.tcl | |
parent | f650fc5d56b6d7c82b0d9d11dd1f1de14718caa6 (diff) | |
download | GradeBook-00888946676b6e21bbf5be73668fa4da55d9cdb4.tar.gz GradeBook-00888946676b6e21bbf5be73668fa4da55d9cdb4.zip |
Added display of the grading scheme to the html output
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index f2b87cf..5df6c71 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -961,6 +961,7 @@ proc FillDefaultAccessRights {} { AddDefaultAccessRight edit_user_grade 1 1 0 0 0 AddDefaultAccessRight edit_letter_grade_request 1 0 0 0 0 AddDefaultAccessRight edit_letter_grade 1 0 0 0 0 + AddDefaultAccessRight show_grading_schema 1 1 1 1 0 } proc getDefaultPermissionsForGroup { group } { @@ -1805,6 +1806,7 @@ proc ChoseAction {action permission_list user} { htmlDefaultView $permission_list $user } showcontrols { ShowControls $permission_list $user } + show_grading_schema { htmlShowGradingSchema $permission_list $user } hidecolfromstudents { HideColumnFromStudents $permission_list $user htmlDefaultView $permission_list $user } unhidecolfromstudents { UnHideColumnFromStudents $permission_list $user @@ -2864,8 +2866,43 @@ proc htmlGradesTable {db permission_list user} { } } +proc htmlShowGradingSchema { permission_list user } { + set grading_scheme [get_grading_scheme] + set prevThreshold "" + set skipAplus true + set separator ";" + puts {<div class="grading_scheme">} + puts {<p>} + puts {Final letter grade is assigned by the following scheme:} + puts {</p>} + puts {<p>} + foreach {letter threshold} $grading_scheme { + if { $skipAplus} { + if { $letter eq "A+" } { continue } + } + # converting to percents + set threshold [expr {round(100.0*$threshold)}] + set threshold "$threshold%" + if { $prevThreshold eq "" } { + puts -nonewline "$letter: >= $threshold" + } else { + if { $letter eq "F" } { + puts -nonewline "$separator $letter: < $prevThreshold" + } else { + puts -nonewline "$separator $letter: ($prevThreshold, $threshold]" + } + } + set prevThreshold $threshold + } + puts "" + puts {</p>} + puts {</div>} + +} + proc htmlDefaultView { permission_list user } { ChoseAction showcontrols $permission_list $user + ChoseAction show_grading_schema $permission_list $user ChoseAction showgrades $permission_list $user } |