aboutsummaryrefslogtreecommitdiff
path: root/GradeBook_lib.tcl
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2012-01-23 00:16:49 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2012-01-23 00:22:15 -0500
commit3e2dc91ae86165684597827eec907435c89da190 (patch)
treeaa109d67fa27d181781278bba6c996d204b2d778 /GradeBook_lib.tcl
parentae527d699707094839dc61d494387af8a8e1fe6d (diff)
downloadGradeBook-3e2dc91ae86165684597827eec907435c89da190.tar.gz
GradeBook-3e2dc91ae86165684597827eec907435c89da190.zip
set everywhere message level in dbg callsv2.0.0
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-xGradeBook_lib.tcl80
1 files changed, 40 insertions, 40 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl
index a92d1a2..10ee08c 100755
--- a/GradeBook_lib.tcl
+++ b/GradeBook_lib.tcl
@@ -9,7 +9,7 @@ package require Tcl 8.5
source ./libBasicTableOperations.tcl
# internal version of this code
-set VERSION 1.5.5
+set VERSION 2.0.0
# ########################################################################
# this should be in config file
@@ -62,7 +62,7 @@ proc get_grades_category {} {
} errStat ]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
#set grades_category [list \
#"unset"\
@@ -105,8 +105,8 @@ proc getGradingWeights { } {
}
} errStat ]
if { $err } {
- dbg "we should never be here if GradesCategoryTable exists" 1
- dbg $errStat 1
+ dbg "we should never be here if GradesCategoryTable exists" msg_level_critical
+ dbg $errStat msg_level_critical
htmlErrorMsg $errStat
}
return $category_name_weight_list
@@ -114,7 +114,7 @@ proc getGradingWeights { } {
proc isCalculateTotalForCategorySet { category } {
if {![existsColumnWithRowvalueInTable GradesCategoryTable CategoryName $category ]} {
- dbg "Category: $category does not exists in the GradesCategoryTable, setting CalculateTotal to false" 3
+ dbg "Category: $category does not exists in the GradesCategoryTable, setting CalculateTotal to false" msg_level_warning
return false
}
set flag [SelectColvalueFromTable GradesCategoryTable NeedsTotal CategoryName $category]
@@ -134,8 +134,8 @@ proc allUserNamesInGroup { group } {
}
} errStat ]
if { $err } {
- dbg "we should never be here if UserName in GradesTable exists" 1
- dbg $errStat 1
+ dbg "we should never be here if UserName in GradesTable exists" msg_level_critical
+ dbg $errStat msg_level_critical
htmlErrorMsg $errStat
}
return $username_list
@@ -227,7 +227,7 @@ proc calculteWeightedTotals { } {
# no weighted total column created for categories which do no have at least 2 columns
# check if Weighted Category Column exists
if { $CategoryWeightedTolalName ni $all_column_names } {
- dbg "Column $CategoryWeightedTolalName does not exist, will create it now" 1
+ dbg "Column $CategoryWeightedTolalName does not exist, will create it now" msg_level_critical
AddColumnNonWeb $CategoryWeightedTolalName weighted_column 0
}
} else {
@@ -260,7 +260,7 @@ proc calculteWeightedTotals { } {
# now calculation of weighted grand total
set grand_total_col_name "Grand Total"
if { $grand_total_col_name ni $all_column_names } {
- dbg "Column $grand_total_col_name does not exist, will create it now" 1
+ dbg "Column $grand_total_col_name does not exist, will create it now" msg_level_critical
AddColumnNonWeb $grand_total_col_name weighted_column 0
}
foreach student $students_list {
@@ -281,7 +281,7 @@ proc calculteWeightedTotals { } {
}
}
if { $max_points($category,$student) == 0} {
- dbg "Category: $category has 0 for total maximum points. Skipping it." 4
+ dbg "Category: $category has 0 for total maximum points. Skipping it." msg_level_info
continue
}
set grand_total($student) [ expr { $grand_total($student) + $weight*$points_sum($category,$student) } ]
@@ -339,7 +339,7 @@ proc AddUserNonWeb { first_name last_name user_name {group_name {guest}} {id_num
set err [catch {db eval $eval_str } errStat]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
}
@@ -348,7 +348,7 @@ proc AddCourseInfoTableItem { item value } {
set err [catch {db eval $eval_str } errStat]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
}
@@ -359,7 +359,7 @@ proc UpdateCourseInfoTableItem { item value } {
} errStat2 ]
if { $err2 } {
htmlErrorMsg $errStat2
- dbg "the following error happen: $errStat2" 3
+ dbg "the following error happen: $errStat2" msg_level_critical
}
}
@@ -367,7 +367,7 @@ proc CreateCourseInfoTable {db} {
set err [catch {db eval {CREATE TABLE CourseInfoTable(Item text, Value text)} } errStat]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 1
+ dbg "the following error happen: $errStat" msg_level_critical
}
AddCourseInfoTableItem course_title "Unset"
AddCourseInfoTableItem course_year "Unset"
@@ -384,7 +384,7 @@ proc SelectItemFromCourseInfoTable { item } {
} errStat ]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
return $value
}
@@ -408,7 +408,7 @@ proc GetDefaultGradesTableColumn {} {
proc ModifyNeedsTotalForGradesCategory {db category flag} {
if {![existsColumnWithRowvalueInTable GradesCategoryTable CategoryName $category ]} {
- dbg "Category: $category does not exists in the GradesCategoryTable, creating it" 3
+ dbg "Category: $category does not exists in the GradesCategoryTable, creating it" msg_level_info
AddGradesCategory db $category
}
UpdateColumnWithValueInTableWhere GradesCategoryTable NeedsTotal $flag CategoryName $category
@@ -416,7 +416,7 @@ proc ModifyNeedsTotalForGradesCategory {db category flag} {
proc ModifyWeightForGradesCategory {db category weight} {
if {![existsColumnWithRowvalueInTable GradesCategoryTable CategoryName $category ]} {
- dbg "Category: $category already does not exists in the GradesCategoryTable, creating it" 3
+ dbg "Category: $category already does not exists in the GradesCategoryTable, creating it" msg_level_info
AddGradesCategory db $category
}
UpdateColumnWithValueInTableWhere GradesCategoryTable CategoryWeight $weight CategoryName $category
@@ -425,14 +425,14 @@ proc ModifyWeightForGradesCategory {db category weight} {
proc AddGradesCategory {db category} {
if {[existsColumnWithRowvalueInTable GradesCategoryTable CategoryName $category ]} {
- dbg "Category: $category already exists in the GradesCategoryTable" 3
+ dbg "Category: $category already exists in the GradesCategoryTable" msg_level_info
return
}
set eval_str [concat INSERT INTO GradesCategoryTable (CategoryName) VALUES('$category')]
set err [catch {db eval $eval_str } errStat]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
ModifyWeightForGradesCategory db $category 0
ModifyNeedsTotalForGradesCategory db $category false
@@ -445,7 +445,7 @@ proc CreateGradesCategoryTable {db} {
if { $err && ($errStat ne "table GradesCategoryTable already exists") } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 1
+ dbg "the following error happen: $errStat" msg_level_critical
}
foreach category [default_grades_category] {
@@ -478,7 +478,7 @@ proc UpdateGradesCategores { db permission_list user } {
} errStat ]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
}
@@ -534,7 +534,7 @@ proc EditGradesCategories { db permission_list user } {
puts "</table>"
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
puts {<input type="hidden" name="action" value="update_grades_categories"/>}
puts {<input type="submit" name="subaction" value="Submit" />}
@@ -565,7 +565,7 @@ proc CreateGradesTable {db} {
set err [catch {db eval $sql_str } errStat]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 1
+ dbg "the following error happen: $errStat" msg_level_critical
}
# add special users aka special info rows
@@ -583,7 +583,7 @@ proc AddAccessRightNonWeb { action instructor_right ta_right student_right dropp
set err [catch {db eval $eval_str } errStat]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
}
@@ -591,7 +591,7 @@ proc CreateAccessRightsTable {db} {
set err [catch {db eval {CREATE TABLE AccessRightsTable(actionname text, instructor integer, ta integer, student integer, dropped integer, guest integer)} } errStat]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 1
+ dbg "the following error happen: $errStat" msg_level_critical
}
# guest should have no rights make sure that 0 is evereywhere except logon
# actionname instructor ta student dropped guest
@@ -697,8 +697,8 @@ proc htmlDBout {db permission_list user {sort_col {}}} {
set eval_str [concat SELECT * FROM GradesTable ORDER BY \"$sort_col\"]
set err [catch {db eval $eval_str } errStat]
if { $err } {
- dbg $errStat 3
- dbg "changing to default sorting column $defSortCol" 3
+ dbg $errStat msg_level_info
+ dbg "changing to default sorting column $defSortCol" msg_level_info
set sort_col $defSortCol
}
@@ -761,8 +761,8 @@ proc htmlDBout {db permission_list user {sort_col {}}} {
ta { set where_statement "WHERE GroupName=\"student\"" }
student { set where_statement "WHERE UserName=\"$user\"" }
dropped { set where_statement "WHERE UserName=\"$user\"" }
- guest { dbg "Guest must not be allowed to set table view port. Aborting. This line is never executed" 0; exit }
- default { dbg "Default must not be allowed to set table view port. Aborting. This line is never executed." 0; exit }
+ guest { dbg "Guest must not be allowed to set table view port. Aborting. This line is never executed" msg_level_critical; exit }
+ default { dbg "Default must not be allowed to set table view port. Aborting. This line is never executed." msg_level_critical; exit }
}
if { $sql_column_str ne "" } {
# assign type cast for different sort_col
@@ -859,8 +859,8 @@ proc htmlDBout {db permission_list user {sort_col {}}} {
}
} errStat_MP ]
if { $errMaxPoints } {
- dbg "we should never be here if UserName: _Max_Points_ exist in the table" 1
- dbg $errStat_MP 1
+ dbg "we should never be here if UserName: _Max_Points_ exist in the table" msg_level_critical
+ dbg $errStat_MP msg_level_critical
htmlErrorMsg $errStat_MP
}
puts "</tr>"
@@ -914,8 +914,8 @@ proc htmlDBout {db permission_list user {sort_col {}}} {
}
} errStat ]
if { $err } {
- dbg "we should never be here if $sortCol exist in the table" 1
- dbg $errStat 1
+ dbg "we should never be here if $sortCol exist in the table" msg_level_critical
+ dbg $errStat msg_level_critical
htmlErrorMsg $errStat
}
puts "</table>"
@@ -1075,7 +1075,7 @@ proc LogMeOn {} {
global user_requested password
set user_requested [::ncgi::value user guest]
set password [::ncgi::value password guest]
- dbg "Logging in and setting cookies" 4
+ dbg "Logging in and setting cookies" msg_level_info
::ncgi::setCookie -name user -value $user_requested
::ncgi::setCookie -name password -value $password
@@ -1087,7 +1087,7 @@ proc LogMeOn {} {
}
proc LogMeOff {} {
- dbg "Logging off" 4
+ dbg "Logging off" msg_level_info
global user password
#set user guest
set password {}
@@ -1545,7 +1545,7 @@ proc UpdateColValue4UserNameNonWeb { columnname username val } {
} errStat2 ]
if { $err2 } {
htmlErrorMsg $errStat2
- dbg "the following error happen: $errStat2" 3
+ dbg "the following error happen: $errStat2" msg_level_critical
}
}
@@ -1556,7 +1556,7 @@ proc UpdateColValue4GroupNameNonWeb { columnname groupname val } {
} errStat2 ]
if { $err2 } {
htmlErrorMsg $errStat2
- dbg "the following error happen: $errStat2" 3
+ dbg "the following error happen: $errStat2" msg_level_critical
}
}
@@ -1577,7 +1577,7 @@ proc UpdateGrades { permission_list user } {
} errStat ]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
}
@@ -1631,7 +1631,7 @@ proc ChangeGrades { permission_list user } {
puts "</table>"
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
puts {<input type="hidden" name="action" value="updategrades"/>}
puts [concat <input type="hidden" name="columnname" value="$columnname"/>]
@@ -1677,7 +1677,7 @@ proc AddColumnNonWeb { columnname2add column_category maxpointpossible {sql_type
set err [catch {db eval $eval_str } errStat]
if { $err } {
htmlErrorMsg $errStat
- dbg "the following error happen: $errStat" 3
+ dbg "the following error happen: $errStat" msg_level_critical
}
UpdateColValue4UserNameNonWeb $columnname2add _Col_Category_ $column_category