diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-05-12 17:53:28 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-05-12 17:54:54 -0400 |
commit | 5fd3fc9ef138d5011a198f5f060050ababe90acb (patch) | |
tree | eb436243fc33d118b2074fbb593b5bc649a284fa | |
parent | 1c74a68d4137d30472a6cf00dd92bd259bbc7206 (diff) | |
download | GradeBook-5fd3fc9ef138d5011a198f5f060050ababe90acb.tar.gz GradeBook-5fd3fc9ef138d5011a198f5f060050ababe90acb.zip |
more abstract way
-rwxr-xr-x | blackboard2gradebook.tcl | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/blackboard2gradebook.tcl b/blackboard2gradebook.tcl index 9ac1be6..1ddd55a 100755 --- a/blackboard2gradebook.tcl +++ b/blackboard2gradebook.tcl @@ -179,6 +179,18 @@ proc updateGrade { col locUname grade } { } } +proc pickCols2import { cols2import skipCreationCol } { + set reduced_list {} + foreach col $cols2import { + if { [isInList $col $skipCreationCol] } { + puts "skipping column $col" + continue + } + lappend reduced_list $col + } + return $reduced_list +} + ######################### START of the execution ######################### set dryrun true @@ -191,11 +203,11 @@ addStudentsFromDB bdb # now for every user add their grades set username_list [getBlackboardUsernames bdb] -foreach col [getColListFromAnyTable bdb export_table] { - if { [isInList $col $skipCreationCol] } { - puts "skipping column $col" - continue - } +set cols2import [getColListFromAnyTable bdb export_table] + +set cols2import [ pickCols2import $cols2import $skipCreationCol ] + +foreach col $cols2import { set colInfo [trimColName $col] set shortCol [lindex $colInfo 0] set category [lindex $colInfo 1] |