aboutsummaryrefslogtreecommitdiff
path: root/GradeBook_lib.tcl
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-03-09 16:09:31 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-03-09 16:09:31 -0500
commitd3d0f09b7e0ebe89a90ee267ba8a9cea047f6923 (patch)
treed5a5e6e980a537f1a11edf67f61465f739b95d42 /GradeBook_lib.tcl
parentb08426704f25194b0d504b8e2fbfc4a7363da1d4 (diff)
downloadGradeBook-d3d0f09b7e0ebe89a90ee267ba8a9cea047f6923.tar.gz
GradeBook-d3d0f09b7e0ebe89a90ee267ba8a9cea047f6923.zip
allColumnNames and getColListFromTable merged into one getColListFromTable
Ignore-this: 5bb99d626484d076284e51c08dab6f78 darcs-hash:20110309210931-067c0-5d7907783d30bef12bc3c7f142bc341e3226f26b.gz
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-xGradeBook_lib.tcl13
1 files changed, 3 insertions, 10 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index 88cd800..5779d5f 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -34,7 +34,7 @@ proc isCalculateTotalForCategorySet { category } {
return $flag
}
-proc allColumnNames {table} {
+proc getColListFromTable {table} {
set eval_str [concat SELECT * FROM \'$table\']
set err [catch {
db eval $eval_str v {
@@ -50,7 +50,7 @@ proc allColumnNames {table} {
}
proc doesColumnExists {col table} {
- if { $col in [allColumnNames $table] } {
+ if { $col in [getColListFromTable $table] } {
return true;
} else {
return false;
@@ -76,7 +76,7 @@ proc allUserNamesInGroup { group } {
proc calculteWeightedTotals { } {
global grades_category
- set all_column_names [allColumnNames GradesTable]
+ set all_column_names [getColListFromTable GradesTable]
# locate all column names of this category
foreach category $grades_category {
if { [isCalculateTotalForCategorySet $category] } {
@@ -1172,13 +1172,6 @@ proc ChangeGrades { permission_list user } {
}
}
-proc getColListFromTable { table } {
- set eval_str [concat SELECT * FROM \'$table\' ]
- set err [catch {db eval $eval_str v {} } errStat]
- set old_column_list $v(*)
- return $old_column_list
-}
-
proc removeElementFromList { element2remove old_list } {
set new_list {}
foreach element $old_list {