From cc3b326e19bb6bbf534d0431c3b6c6c5a24db978 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Tue, 11 May 2021 00:08:12 -0400 Subject: polished export from blackboard2gradebook --- blackboard2gradebook.tcl | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/blackboard2gradebook.tcl b/blackboard2gradebook.tcl index 6c3413e..d44ce15 100755 --- a/blackboard2gradebook.tcl +++ b/blackboard2gradebook.tcl @@ -54,6 +54,7 @@ proc getBlackboardUsernames { db } { set eval_str [concat SELECT Username FROM export_table] set err [catch { $db eval $eval_str v { + puts $v(Username) lappend username_list $v(Username) } } errStat ] @@ -99,7 +100,8 @@ proc trimColName { col } { Design { set name "Final Project Design" ; set category FinalExam } Report { set name "Final Project Report" ; set category FinalExam } Precision { set name "Final Project Precision" ; set category FinalExam } - "Extra Credit" { set name "Final Project Bonus" ; set category FinalExam } + Hardware { set name "Final Project Hardware" ; set category FinalExam } + "Extra Credit" { set name "Final Project Bonus" ; set category FinalExam; set maxScore 0 } default { } } if { $number eq "" } { @@ -108,7 +110,7 @@ proc trimColName { col } { set shortCol "$name $number" } } - puts [list $col "--->" $shortCol $category $maxScore $type] + #puts [list $col "--->" $shortCol $category $maxScore $type] return [list $shortCol $category $maxScore $type] } @@ -132,27 +134,6 @@ set err [catch { } errStat ] iferror $err $errStat - -# add columns with reports to gradebook db -foreach col [getColListFromAnyTable bdb export_table] { - if { [isInList $col $skipCreationCol] } { - continue - } - #puts "$col" - set colInfo [trimColName $col] - set shortCol [lindex $colInfo 0] - set category [lindex $colInfo 1] - set maxScore [lindex $colInfo 2] - set scoreType [lindex $colInfo 3] - - if { ![doesColumnExists $shortCol GradesTable] } { - #AddColumnNonWeb $shortCol $category $maxScore - puts [list AddColumnNonWeb $shortCol $category $maxScore] - } else { - #puts "$col: exists" - } -} - # now for every user add their grades set username_list [getBlackboardUsernames bdb] foreach col [getColListFromAnyTable bdb export_table] { @@ -169,6 +150,10 @@ foreach col [getColListFromAnyTable bdb export_table] { puts "skipping non FinalExam column: $col" continue } + if { ![doesColumnExists $shortCol GradesTable] } { + #AddColumnNonWeb $shortCol $category $maxScore + puts [list AddColumnNonWeb $shortCol $category $maxScore] + } foreach uname $username_list { set locUname $uname@email.wm.edu set grade [getBlackboardUserGrade bdb $uname $col ] @@ -177,7 +162,6 @@ foreach col [getColListFromAnyTable bdb export_table] { # change percentage to score set grade [ expr {$grade/100*$maxScore} ] } - puts "setting $grade for $locUname in $col" #UpdateColValue4UserNameNonWeb $shortCol $locUname $grade puts [list UpdateColValue4UserNameNonWeb $shortCol $locUname $grade] } -- cgit v1.2.3