aboutsummaryrefslogtreecommitdiff
path: root/blackboard2gradebook.tcl
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-05-12 17:53:28 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-05-12 17:54:54 -0400
commit5fd3fc9ef138d5011a198f5f060050ababe90acb (patch)
treeeb436243fc33d118b2074fbb593b5bc649a284fa /blackboard2gradebook.tcl
parent1c74a68d4137d30472a6cf00dd92bd259bbc7206 (diff)
downloadGradeBook-5fd3fc9ef138d5011a198f5f060050ababe90acb.tar.gz
GradeBook-5fd3fc9ef138d5011a198f5f060050ababe90acb.zip
more abstract way
Diffstat (limited to 'blackboard2gradebook.tcl')
-rwxr-xr-xblackboard2gradebook.tcl22
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]