aboutsummaryrefslogtreecommitdiff
path: root/importGrades2gradebook.tcl
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-05-13 11:17:09 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-05-13 11:17:09 -0400
commit11d13d2734085e927efda4d5ae7f9932463e548b (patch)
tree96c4ff9c42df4d26042481e1f774e86d3e8c9baa /importGrades2gradebook.tcl
parentec6da5bbc09c8fc8a16e5e07eb14ca6431609768 (diff)
downloadGradeBook-11d13d2734085e927efda4d5ae7f9932463e548b.tar.gz
GradeBook-11d13d2734085e927efda4d5ae7f9932463e548b.zip
extract maximum grade from Gradescope DB
Diffstat (limited to 'importGrades2gradebook.tcl')
-rwxr-xr-ximportGrades2gradebook.tcl9
1 files changed, 7 insertions, 2 deletions
diff --git a/importGrades2gradebook.tcl b/importGrades2gradebook.tcl
index ff547e8..bd66e14 100755
--- a/importGrades2gradebook.tcl
+++ b/importGrades2gradebook.tcl
@@ -206,11 +206,16 @@ proc parseGradescopeColName { col } {
set maxScore 0
set type Score
+ global username_list
+
set infoColumsMarkers {{ - Lateness \(H:M:S\)} { - Max Points} { - Submission Time} {Total Lateness \(H:M:S\)}}
if { [isInList $col $infoColumsMarkers] } {
return [list $shortCol $category $maxScore $type]
}
+ set colWithMaxScore "$shortCol - Max Points"
+ set maxScore [getForeignDBUserGrade foreignDB [lindex $username_list 0] $colWithMaxScore ]
+
set number {}
set name $shortCol
set result [regexp -nocase {(\D+)(\d+)} $shortCol match name number]
@@ -387,7 +392,7 @@ proc alias {alias target} {
######################### START of the execution #########################
# using heuristic to detect foreign DB origin
-set allForeignCols [getColListFromAnyTable foreignDB export_table]; # important global
+set allForeignCols [getColListFromAnyTable foreignDB export_table]
set dbOrigin Blackboard; # default
if { {SID} in $allForeignCols } { set dbOrigin Gradescope }
puts [list Detected foreign DB origin: $dbOrigin]
@@ -418,7 +423,7 @@ switch $dbOrigin {
addStudentsFromForeignDB foreignDB
# now for every user add their grades
-set username_list [getForeignDBUsernames foreignDB]
+set username_list [getForeignDBUsernames foreignDB]; # important, will be used as global
set cols2import [getColListFromAnyTable foreignDB export_table]
set cols2import [ pickCols2import $cols2import $skipCreationCol $categories2import]