aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-05-12 12:04:34 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-05-12 12:04:34 -0400
commit59e52593bca474380a76cdd76b27eb22d6ae30c3 (patch)
tree0a5657373a1515f31b2ee10e7e9f8a70aea39192
parentb11158a405d57a562b27ef46a436ed31a30400a9 (diff)
downloadGradeBook-59e52593bca474380a76cdd76b27eb22d6ae30c3.tar.gz
GradeBook-59e52593bca474380a76cdd76b27eb22d6ae30c3.zip
more simplifications
-rwxr-xr-xblackboard2gradebook.tcl33
1 files changed, 18 insertions, 15 deletions
diff --git a/blackboard2gradebook.tcl b/blackboard2gradebook.tcl
index 02dc901..4a8adff 100755
--- a/blackboard2gradebook.tcl
+++ b/blackboard2gradebook.tcl
@@ -162,6 +162,23 @@ proc foreignUsername2local { uname } {
return "$uname@email.wm.edu"
}
+proc updateGrade { col locUname grade } {
+ set oldGrade [SelectColValue4User $col $locUname ]
+ #puts "$locUname: $col oldGrade \{$oldGrade\} --> \{$grade\}"
+ if { $oldGrade == $grade } { return }
+ if { [regexp -nocase -- {excuse} $oldGrade] } {
+ # remote system do not handle excuses
+ # so local system take precedence
+ #puts [list "not updating \"excused\" grade:" $locUname $col $oldGrade "-->" $grade]
+ return
+ }
+ if { $oldGrade != $grade } {
+ #puts "$locUname: $col oldGrade \{$oldGrade\} --> \{$grade\}"
+ puts [list $locUname $col $oldGrade "-->" $grade]
+ veval [list UpdateColValue4UserNameNonWeb $col $locUname $grade]
+ }
+}
+
######################### START of the execution #########################
set dryrun true
@@ -199,22 +216,8 @@ foreach col [getColListFromAnyTable bdb export_table] {
# change percentage to score
set grade [ expr {$grade/100*$maxScore} ]
}
- set oldGrade [SelectColValue4User $shortCol $locUname ]
- #puts "$locUname: oldGrade \{$oldGrade\} --> $grade"
- if { $oldGrade == $grade } { continue }
- if { [regexp -nocase -- {excuse} $oldGrade] } {
- # remote system do not handle excuses
- # so local system take precedence
- puts "not updating \"excused\" grade"
- continue
- }
- if { $oldGrade != $grade } {
- puts "TESTING: skipping grades which change"
- puts "$locUname: $shortCol oldGrade \{$oldGrade\} --> $grade"
- #continue
- }
- veval [list UpdateColValue4UserNameNonWeb $shortCol $locUname $grade]
}
+ updateGrade $shortCol $locUname $grade
}
}