aboutsummaryrefslogtreecommitdiff
path: root/GradeBook_lib.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-xGradeBook_lib.tcl37
1 files changed, 1 insertions, 36 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index a8a959a..24df524 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -1453,44 +1453,9 @@ proc removeElementFromList { element2remove old_list } {
return $new_list
}
-proc colList2sqlColStr { col_list } {
- set sqlStr {}
- foreach col $col_list {
- if {$sqlStr ne ""} {
- set sqlStr $sqlStr,\"$col\"
- } else {
- set sqlStr \"$col\"
- }
- }
- return $sqlStr
-}
-
proc DeleteColumnNonWeb { columnname } {
- if { $columnname != "" } {
-
- # removing the column name to be deleted from total list
-
- set old_column_list [getColListFromTable GradesTable]
- set new_column_list [removeElementFromList $columnname $old_column_list]
- set sql_new_column_str [colList2sqlColStr $new_column_list]
- set eval_str "BEGIN TRANSACTION;
- CREATE TEMPORARY TABLE GradesTable_backup($sql_new_column_str);
- INSERT INTO GradesTable_backup SELECT $sql_new_column_str FROM GradesTable;
- DROP TABLE GradesTable;
- CREATE TABLE GradesTable($sql_new_column_str);
- INSERT INTO GradesTable SELECT $sql_new_column_str FROM GradesTable_backup;
- DROP TABLE GradesTable_backup;
- COMMIT;"
- set err [catch {db eval $eval_str } errStat]
- if { $err } {
- htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
- }
- } else {
- htmlErrorMsg "empty column names are not permitted"
-
- }
+ DeleteColumnFromTable GradesTable $columnname
calculteWeightedTotals
}