From 00888946676b6e21bbf5be73668fa4da55d9cdb4 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Thu, 10 May 2018 16:15:52 -0400 Subject: Added display of the grading scheme to the html output --- GradeBook_lib.tcl | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) 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 {
} + puts {

} + puts {Final letter grade is assigned by the following scheme:} + puts {

} + puts {

} + 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 {

} + puts {
} + +} + proc htmlDefaultView { permission_list user } { ChoseAction showcontrols $permission_list $user + ChoseAction show_grading_schema $permission_list $user ChoseAction showgrades $permission_list $user } -- cgit v1.2.3