Index: openacs-4/packages/evaluation/lib/evaluations-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/evaluations-chunk.tcl,v diff -u -r1.23 -r1.23.4.1 --- openacs-4/packages/evaluation/lib/evaluations-chunk.tcl 13 Jul 2009 12:39:24 -0000 1.23 +++ openacs-4/packages/evaluation/lib/evaluations-chunk.tcl 19 Aug 2014 07:35:54 -0000 1.23.4.1 @@ -161,7 +161,7 @@ set evaluations_orderby [template::list::orderby_clause -orderby -name $list_name] -if { [string equal $evaluations_orderby ""] } { +if {$evaluations_orderby eq ""} { set evaluations_orderby " order by task_name asc" } @@ -173,11 +173,11 @@ } else { set task_url [export_vars -base "${base_url}admin/evaluations/student-list" { grade_id task_id return_url }] } - set category_weight [expr $category_weight + $task_weight] + set category_weight [expr {$category_weight + $task_weight}] set grade_url [export_vars -base "${base_url}admin/evaluations/student-list" { grade_id task_id return_url }] - set max_weight [format %0.2f [expr $max_weight + $task_weight]] + set max_weight [format %0.2f [expr {$max_weight + $task_weight}]] set task_weight [format %0.2f $task_weight] - set max_grade [expr $max_grade + $perfect_score] + set max_grade [expr {$max_grade + $perfect_score}] set max_grade_label "
$max_grade pts.
" set solution_label "[_ evaluation-portlet.weight_possible_of_grade_] $low_name )" @@ -213,7 +213,7 @@ set grade_url [export_vars -base "${base_url}admin/evaluations/student-list" { grade_id task_id return_url }] if { [db_0or1row get_evaluation_info { *SQL* }] } { - if { ![empty_string_p $comments] } { + if { $comments ne "" } { set comments "[_ evaluation-portlet.View_comments_]" set comments_url "[export_vars -base "${base_url}evaluation-view" { evaluation_id return_url }]" } else { @@ -224,18 +224,18 @@ set over_weight "" - if { [string eq $show_student_p "t"] } { - if { ![empty_string_p $grade] } { + if {$show_student_p == "t"} { + if { $grade ne "" } { set grade [lc_numeric $grade] set over_weight "[lc_numeric $task_grade]/" if { $simple_p } { set task_grade [format %0.2f [expr ($grade*$perfect_score/100.0)]] } - set total_grade [expr $total_grade + $task_grade] + set total_grade [expr {$total_grade + $task_grade}] if { $simple_p } { - set max_grade [expr $task_grade + $max_grade] + set max_grade [expr {$task_grade + $max_grade}] } else { - set max_grade [expr $task_weight + $max_grade] + set max_grade [expr {$task_weight + $max_grade}] } } else { set grade "[_ evaluation-portlet.Not_evaluated_]" @@ -260,7 +260,7 @@ if { [db_0or1row get_answer_info { *SQL* }] } { set submitted_date $creation_date # working with answer stuff (if it has a file/url attached) - if { [string eq $answer_title "link"] } { + if {$answer_title eq "link"} { # there is a bug in the template::list, if the url does not has a http://, ftp://, the url is not absolute, # so we have to deal with this case array set community_info [site_node::get -url "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]][evaluation::package_key]"] @@ -275,7 +275,7 @@ set answer "[_ evaluation-portlet.View_my_answer_]" } - if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } { + if { $number_of_members > 1 && [string equal [db_string get_group_id { *SQL* }] "0"] } { set answer "" set answer_url "" set grade "[_ evaluation-portlet.No_group_for_task_]" @@ -284,12 +284,12 @@ set answer_url "" set answer "" } - set max_weight [expr $max_weight + $perfect_score] + set max_weight [expr {$max_weight + $perfect_score}] set max_grade_label "
$max_grade pts.
" set max_weight_label "
$max_weight %
" - if { [empty_string_p $submitted_date]} { + if { $submitted_date eq ""} { - if { [string eq $online_p "t"] } { + if {$online_p == "t"} { if { [db_string compare_due_date { *SQL* } -default 0] } { if { ![db_0or1row answer_info { *SQL* }] } { set submitted_date "[_ evaluation-portlet.submit_answer_]" @@ -300,7 +300,7 @@ set submitted_date_mode display set submitted_date_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id answer_id return_url answer_mode }]" } - } elseif { [string eq $late_submit_p "t"] } { + } elseif {$late_submit_p == "t"} { if { ![db_0or1row answer_info { *SQL* }] } { set submitted_date "[_ evaluation-portlet.lt_submit_answer_style_f]" set submitted_date_mode edit @@ -311,14 +311,14 @@ set submitted_date_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id answer_id return_url answer_mode }]" } } - if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } { + if { $number_of_members > 1 && [string equal [db_string get_group_id { *SQL* }] "0"] } { set submitted_date "[_ evaluation-portlet.No_group_for_task_]" set submitted_date_url "" } } } else { set submitted_date_url "[export_vars -base "${base_url}answer-view" { grade_id task_id return_url answer_mode {answer_id}}]" - if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } { + if { $number_of_members > 1 && [string equal [db_string get_group_id { *SQL* }] "0"] } { set submitted_date "[_ evaluation-portlet.No_group_for_task_]" set submitted_date_url "" Index: openacs-4/packages/evaluation/lib/student-grades-report-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/student-grades-report-chunk.tcl,v diff -u -r1.6 -r1.6.14.1 --- openacs-4/packages/evaluation/lib/student-grades-report-chunk.tcl 24 Sep 2004 21:23:12 -0000 1.6 +++ openacs-4/packages/evaluation/lib/student-grades-report-chunk.tcl 19 Aug 2014 07:35:54 -0000 1.6.14.1 @@ -62,7 +62,7 @@ set orderby [template::list::orderby_clause -orderby -name student_grades] -if {[string equal $orderby ""]} { +if {$orderby eq ""} { set assignments_orderby " order by task_name asc" } @@ -86,7 +86,7 @@ set answer_id "" db_0or1row get_answer_data { *SQL* } - if { [empty_string_p $answer_id] } { + if { $answer_id eq "" } { append task_status " [_ evaluation.Not_answered_] " } else { append task_status " [_ evaluation.Already_answered_] " @@ -97,11 +97,11 @@ set comments "" db_0or1row get_grade_info { *SQL* } - if { ![empty_string_p $grade] } { + if { $grade ne "" } { set grade [lc_numeric $grade] set over_weight "[lc_numeric $net_grade]/" - set total_grade [expr $total_grade + $net_grade] + set total_grade [expr {$total_grade + $net_grade}] set net_grade [lc_numeric $net_grade] set task_status "[_ evaluation.Evaluated_]" } else { @@ -111,17 +111,17 @@ append task_status " [_ evaluation.Not_evaluated_] " } - if { [empty_string_p $comments] } { + if { $comments eq "" } { set comments "[_ evaluation.na_]" } - set max_grade [expr $task_weight + $max_grade] + set max_grade [expr {$task_weight + $max_grade}] set task_weight "${over_weight}[lc_numeric $task_weight]" set group_id [db_string get_group_id { *SQL* }] if { $number_of_members > 1 } { - if { [string eq $group_id 0] } { + if {$group_id eq "0"} { set task_status "[_ evaluation.lt_No_group_for_student_]" set assignment_group " [_ evaluation.na_] " } else { @@ -133,6 +133,6 @@ } -set total_grade [lc_numeric [expr $total_grade]] +set total_grade [lc_numeric [expr {$total_grade}]] set max_grade [lc_numeric $max_grade] set grade_weight [lc_numeric $grade_weight] \ No newline at end of file Index: openacs-4/packages/evaluation/lib/tasks-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/tasks-chunk.tcl,v diff -u -r1.20 -r1.20.4.1 --- openacs-4/packages/evaluation/lib/tasks-chunk.tcl 13 Jul 2009 12:19:21 -0000 1.20 +++ openacs-4/packages/evaluation/lib/tasks-chunk.tcl 19 Aug 2014 07:35:54 -0000 1.20.4.1 @@ -88,7 +88,7 @@ set assignments_orderby [template::list::orderby_clause -orderby -name $list_name] -if {[string equal $assignments_orderby ""]} { +if {$assignments_orderby eq ""} { set assignments_orderby " order by task_name asc" } @@ -99,10 +99,10 @@ set due_date_pretty [lc_time_fmt $due_date_ansi "%q %X"] # working with task stuff (if it has a file/url attached) - if { [empty_string_p $task_data] } { + if { $task_data eq "" } { set task_url "[export_vars -base "${base_url}task-view" { grade_id task_id return_url }]" set task_name "[_ evaluation-portlet.task_name_No_data_]" - } elseif { [string eq $task_title "link"] } { + } elseif {$task_title eq "link"} { # there is a bug in the template::list, if the url does not has a http://, ftp://, the url is not absolute, # so we have to deal with this case @@ -129,7 +129,7 @@ set solution "[_ evaluation-portlet.Upload_Solution_]" } - if { ![string eq $number_of_members 1] } { + if { $number_of_members ne "1" } { set groups_admin_url "[export_vars -base "${base_url}admin/groups/one-task" { grade_id task_id }]" set groups_admin "[_ evaluation-portlet.Groups_Admin_]" } @@ -141,10 +141,10 @@ set answer_mode display set due_date_pretty [lc_time_fmt $due_date_ansi "%q %r"] # working with task stuff (if it has a file/url attached) - if { [empty_string_p $task_data] } { + if { $task_data eq "" } { set task_url "[export_vars -base "${base_url}task-view" { grade_id task_id return_url }]" set task_name "[_ evaluation-portlet.task_name_No_data_]" - } elseif { [string eq $task_title "link"] } { + } elseif {$task_title eq "link"} { # there is a bug in the template::list, if the url does not has a http://, ftp://, the url is not absolute, # so we have to deal with this case @@ -161,7 +161,7 @@ set task_name "$task_name ([lc_numeric $content_length] Kb - ${pretty_mime_type})" } - if { [string eq $online_p "t"] } { + if {$online_p == "t"} { if { [db_string compare_due_date { *SQL* } -default 0] } { if { ![db_0or1row answer_info { *SQL* }] } { set answer "[_ evaluation-portlet.submit_answer_]" @@ -172,7 +172,7 @@ set answer_mode display set answer_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id answer_id return_url answer_mode }]" } - } elseif { [string eq $late_submit_p "t"] } { + } elseif {$late_submit_p == "t"} { if { ![db_0or1row answer_info { *SQL* }] } { set answer "[_ evaluation.lt_Submit_answer_span_st]" set answer_mode edit @@ -183,7 +183,7 @@ set answer_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id answer_id return_url answer_mode }]" } } - if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } { + if { $number_of_members > 1 && [string equal [db_string get_group_id { *SQL* }] "0"] } { set answer "[_ evaluation-portlet.No_group_for_task_]" set answer_url "" } Index: openacs-4/packages/evaluation/tcl/evaluation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/tcl/evaluation-procs.tcl,v diff -u -r1.40 -r1.40.6.1 --- openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 14 Mar 2008 16:11:33 -0000 1.40 +++ openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 19 Aug 2014 07:35:54 -0000 1.40.6.1 @@ -26,7 +26,7 @@ handles assignments and evaluations. } { - if {[exists_and_not_null object_id]} { + if {([info exists object_id] && $object_id ne "")} { return "[ad_url][apm_package_url_from_id $object_id]" } @@ -60,12 +60,12 @@ set output "= [lindex $interval_def 1] } { + if { [expr {$day + $i}] >= [lindex $interval_def 1] } { incr month 1 set day 1 } @@ -362,10 +362,10 @@ db_1row from_task_info { *SQL* } - if { [empty_string_p $creation_user] } { + if { $creation_user eq "" } { set creation_user [ad_conn user_id] } - if { [empty_string_p $creation_ip] } { + if { $creation_ip eq "" } { set creation_ip [ad_conn peeraddr] } @@ -453,18 +453,18 @@ @description Description of the task @storage_type File or text, depending on what are we going to store } { - if { [empty_string_p $creation_user] } { + if { $creation_user eq "" } { set creation_user [ad_conn user_id] } - if { [empty_string_p $creation_ip] } { + if { $creation_ip eq "" } { set creation_ip [ad_conn peeraddr] } - if {[empty_string_p $package_id]} { + if {$package_id eq ""} { set package_id [ad_conn package_id] } set folder_id [content::item::get_id -item_path "${content_type}_${package_id}" -resolve_index f] - if { [empty_string_p $item_name] } { + if { $item_name eq "" } { set item_name "${item_id}_${title}" } @@ -531,10 +531,10 @@ } { - if { [empty_string_p $creation_user] } { + if { $creation_user eq "" } { set creation_user [ad_conn user_id] } - if { [empty_string_p $creation_ip] } { + if { $creation_ip eq "" } { set creation_ip [ad_conn peeraddr] } @@ -544,11 +544,11 @@ set revision_id [db_nextval acs_object_id_seq] - if { [empty_string_p $publish_date] } { + if { $publish_date eq "" } { set publish_date [db_string get_date { *SQL* }] } - if { [empty_string_p $creation_date] } { + if { $creation_date eq "" } { set creation_date [db_string get_date { *SQL* }] } @@ -614,10 +614,10 @@ @param party_id Group or user_id thaw owns the anser } { - if { [empty_string_p $creation_user] } { + if { $creation_user eq "" } { set creation_user [ad_conn user_id] } - if { [empty_string_p $creation_ip] } { + if { $creation_ip eq "" } { set creation_ip [ad_conn peeraddr] } @@ -627,11 +627,11 @@ set revision_id [db_nextval acs_object_id_seq] - if { [empty_string_p $publish_date] } { + if { $publish_date eq "" } { set publish_date [db_string get_date { *SQL* }] } - if { [empty_string_p $creation_date] } { + if { $creation_date eq "" } { set creation_date [db_string get_date { *SQL* }] } if { $new_item_p && ![db_string double_click { *SQL* }] } { @@ -701,10 +701,10 @@ @param mime_type Mime type of the evaluation. } { - if { [empty_string_p $creation_user] } { + if { $creation_user eq "" } { set creation_user [ad_conn user_id] } - if { [empty_string_p $creation_ip] } { + if { $creation_ip eq "" } { set creation_ip [ad_conn peeraddr] } @@ -714,11 +714,11 @@ set revision_id [db_nextval acs_object_id_seq] - if { [empty_string_p $publish_date] } { + if { $publish_date eq "" } { set publish_date [db_string get_date { *SQL* }] } - if { [empty_string_p $creation_date] } { + if { $creation_date eq "" } { set creation_date [db_string get_date { *SQL* }] } @@ -774,17 +774,17 @@ } { - if { [empty_string_p $creation_user] } { + if { $creation_user eq "" } { set creation_user [ad_conn user_id] } - if { [empty_string_p $creation_ip] } { + if { $creation_ip eq "" } { set creation_ip [ad_conn peeraddr] } - if { [empty_string_p $context] } { + if { $context eq "" } { set context [ad_conn package_id] } - if { [empty_string_p $creation_date] } { + if { $creation_date eq "" } { set creation_date [db_string get_date { *SQL* }] } @@ -848,10 +848,10 @@ } { - if { [empty_string_p $creation_user] } { + if { $creation_user eq "" } { set creation_user [ad_conn user_id] } - if { [empty_string_p $creation_ip] } { + if { $creation_ip eq "" } { set creation_ip [ad_conn peeraddr] } set package_id [ad_conn package_id] @@ -860,11 +860,11 @@ set revision_id [db_nextval acs_object_id_seq] - if { [empty_string_p $publish_date] } { + if { $publish_date eq "" } { set publish_date [db_string get_date { *SQL* }] } - if { [empty_string_p $creation_date] } { + if { $creation_date eq "" } { set creation_date [db_string get_date { *SQL* }] } @@ -922,7 +922,7 @@ # the task is individual set community_id [dotlrn_community::get_community_id] - if { [empty_string_p $community_id] } { + if { $community_id eq "" } { set sql_query [db_map sql_query_individual] } else { set sql_query [db_map sql_qyery_comm_ind] @@ -935,7 +935,7 @@ } db_foreach parties_with_to_grade { *SQL* } { - if { ![empty_string_p $grade] } { + if { $grade ne "" } { set grade [lc_numeric $grade] } lappend csv_content "\n$party_id" @@ -1085,13 +1085,13 @@ file mkdir $dir db_foreach get_answers_for_task { *SQL* } { - if { [string eq $storage_type "lob"] || [string eq $storage_type "file"] } { + if { $storage_type eq "lob" || $storage_type eq "file" } { # it is a file regsub -all {[<>:\"|/@\\\#%&+\\ ,]} $party_name {_} file_name append file_name [file extension $answer_title] - if { [string eq $storage_type "file"] } { + if {$storage_type eq "file"} { # its a file file copy -- "[cr_fs_path $cr_path]${cr_file_name}" [file join ${dir} ${file_name}] Index: openacs-4/packages/evaluation/www/answer-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/answer-add-edit.tcl,v diff -u -r1.18 -r1.18.8.1 --- openacs-4/packages/evaluation/www/answer-add-edit.tcl 8 Aug 2006 21:26:41 -0000 1.18 +++ openacs-4/packages/evaluation/www/answer-add-edit.tcl 19 Aug 2014 07:35:54 -0000 1.18.8.1 @@ -16,7 +16,7 @@ return_url:notnull } -validate { late_submit -requires { task_id:integer } { - if { [string eq [db_string late_turn_in { *SQL* }] "f"] && [db_string compare_dates { *SQL* } -default 0] } { + if { [string equal [db_string late_turn_in { *SQL* }] "f"] && [db_string compare_dates { *SQL* } -default 0] } { ad_complain "[_ evaluation.lt_This_task_can_not_be_]" } } @@ -67,11 +67,11 @@ } -validate { {url - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || (![string eq $url "http://"] && [util_url_valid_p $url]) } + { ($url eq "http://" && $upload_file ne "") || ($url ne "http://" && $upload_file eq "") || ($url ne "http://" && [util_url_valid_p $url]) } { [_ evaluation.lt_Upload_a_file_OR_a_va] } } {upload_file - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) } + { ($url eq "http://" && $upload_file ne "") || ($url ne "http://" && $upload_file eq "") } { [_ evaluation.lt_Upload_a_file_OR_a_ur] } } } -on_submit { @@ -82,7 +82,7 @@ set title "" # set storage_type to its default value according to a db constraint set storage_type "lob" - if { ![empty_string_p $upload_file] } { + if { $upload_file ne "" } { # Get the filename part of the upload file if { ![regexp {[^//\\]+$} $upload_file filename] } { @@ -96,7 +96,7 @@ if { ![parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { set storage_type file } - } elseif { ![string eq $url "http://"] } { + } elseif { $url ne "http://" } { set mime_type "text/plain" set title "link" } @@ -119,7 +119,7 @@ content::item::set_live_revision -revision_id $revision_id - if { ![empty_string_p $upload_file] } { + if { $upload_file ne "" } { set tmp_file [template::util::file::get_property tmp_filename $upload_file] set content_length [file size $tmp_file] @@ -141,7 +141,7 @@ } - } elseif { ![string eq $url "http://"] } { + } elseif { $url ne "http://" } { db_dml link_content { *SQL* } set content_length 0 Index: openacs-4/packages/evaluation/www/evaluation-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/evaluation-view.tcl,v diff -u -r1.6 -r1.6.6.1 --- openacs-4/packages/evaluation/www/evaluation-view.tcl 7 Oct 2007 22:36:59 -0000 1.6 +++ openacs-4/packages/evaluation/www/evaluation-view.tcl 19 Aug 2014 07:35:54 -0000 1.6.6.1 @@ -41,9 +41,9 @@ set grade_weight [lc_numeric %.2f $grade_weight] set net_grade [lc_numeric %.2f $net_grade] -if { ![empty_string_p $answer_data] } { +if { $answer_data ne "" } { - if { [string eq $answer_title "link"] } { + if {$answer_title eq "link"} { set answer_url "$answer_data" } else { # we assume it's a file Index: openacs-4/packages/evaluation/www/task-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/task-view.tcl,v diff -u -r1.15 -r1.15.6.1 --- openacs-4/packages/evaluation/www/task-view.tcl 7 Oct 2007 22:36:59 -0000 1.15 +++ openacs-4/packages/evaluation/www/task-view.tcl 19 Aug 2014 07:35:54 -0000 1.15.6.1 @@ -33,9 +33,9 @@ } db_1row get_task_info { *SQL* } -if { ![empty_string_p $task_data] } { +if { $task_data ne "" } { - if { [string eq $task_title "link"] } { + if {$task_title eq "link"} { set task_url "$task_data" } else { # we assume it's a file @@ -51,9 +51,9 @@ } } -if { ![empty_string_p $solution_data] } { +if { $solution_data ne "" } { - if { [string eq $solution_title "link"] } { + if {$solution_title eq "link"} { # there is a bug in the template::list, if the url does not has a http://, ftp://, the url is not absolute, # so we have to deal with this case array set community_info [site_node::get -url "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]][evaluation::package_key]"] Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl,v diff -u -r1.17 -r1.17.8.1 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl 15 Dec 2006 22:45:30 -0000 1.17 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl 19 Aug 2014 07:35:55 -0000 1.17.8.1 @@ -36,7 +36,7 @@ valid_grades_gs { set counter 0 foreach party_id [array names grades_gs] { - if { [info exists grades_gs($party_id)] && ![empty_string_p $grades_gs($party_id)] } { + if { [info exists grades_gs($party_id)] && $grades_gs($party_id) ne "" } { incr counter set grades_gs($party_id) [template::util::leadingTrim $grades_gs($party_id)] if { ![ad_var_type_check_number_p $grades_gs($party_id)] } { @@ -52,7 +52,7 @@ valid_grades_wa { set counter 0 foreach party_id [array names grades_wa] { - if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { + if { [info exists grades_wa($party_id)] && $grades_wa($party_id) ne "" } { incr counter set grades_wa($party_id) [template::util::leadingTrim $grades_wa($party_id)] if { ![ad_var_type_check_number_p $grades_wa($party_id)] } { @@ -68,7 +68,7 @@ valid_grades_na { set counter 0 foreach party_id [array names grades_na] { - if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)]} { + if { [info exists grades_na($party_id)] && $grades_na($party_id) ne ""} { incr counter set grades_na($party_id) [template::util::leadingTrim $grades_na($party_id)] if { ![ad_var_type_check_number_p $grades_na($party_id)] } { @@ -84,7 +84,7 @@ valid_grades { set counter 0 foreach party_id [array names grades_to_edit] { - if { [info exists grades_to_edit($party_id)] && ![empty_string_p $grades_to_edit($party_id)] } { + if { [info exists grades_to_edit($party_id)] && $grades_to_edit($party_id) ne "" } { incr counter set grades_to_edit($party_id) [template::util::leadingTrim $grades_to_edit($party_id)] if { ![ad_var_type_check_number_p $grades_to_edit($party_id)] } { @@ -143,7 +143,7 @@ db_1row task_info { *SQL* } -if { ![empty_string_p $tmp_filename] } { +if { $tmp_filename ne "" } { set tmp_filename "${tmp_filename}_grades_sheet" @@ -185,7 +185,7 @@ set comments_gs($party_id) [DoubleApos $comments_gs($party_id)] } - if { [info exists grades_gs($party_id)] && ![empty_string_p $grades_gs($party_id)] } { + if { [info exists grades_gs($party_id)] && $grades_gs($party_id) ne "" } { set grades_gs($party_id) [expr ($grades_gs($party_id)*$perfect_score)/[format %0.3f $max_grade]] set revision_id [evaluation::new_evaluation -new_item_p $new_p_gs($party_id) \ -item_id $item_ids($party_id) \ @@ -200,7 +200,7 @@ content::item::set_live_revision -revision_id $revision_id - if { [string eq $new_p_gs($party_id) 0] } { + if {$new_p_gs($party_id) eq "0"} { # notify the user if suscribed evaluation::notification::do_notification -task_id $task_id -evaluation_id $revision_id -package_id [ad_conn package_id] -notif_type one_evaluation_notif -subset [list $party_id] } @@ -218,7 +218,7 @@ set comments_wa($party_id) [DoubleApos $comments_wa($party_id)] } - if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { + if { [info exists grades_wa($party_id)] && $grades_wa($party_id) ne "" } { # new file? if { [db_string grades_wa_new { *SQL* }] } { set new_item_p 0 @@ -244,7 +244,7 @@ } else { set comments_na($party_id) [DoubleApos $comments_na($party_id)] } - if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { + if { [info exists grades_na($party_id)] && $grades_na($party_id) ne "" } { # new file? if { [db_string grades_na_new { *SQL* }] } { set new_item_p 0 @@ -265,7 +265,7 @@ db_transaction { foreach party_id [array names grades_to_edit] { - if { [info exists grades_to_edit($party_id)] && ![empty_string_p $grades_to_edit($party_id)] } { + if { [info exists grades_to_edit($party_id)] && $grades_to_edit($party_id) ne "" } { set grades_to_edit($party_id) [expr ($grades_to_edit($party_id)*100)/[format %0.3f $max_grade]] set revision_id [evaluation::new_evaluation -new_item_p 0 -item_id $item_to_edit_ids($party_id) -content_type evaluation_student_evals \ -content_table evaluation_student_evals -content_id evaluation_id -description $reasons_to_edit($party_id) \ Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl,v diff -u -r1.11 -r1.11.8.1 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl 8 Aug 2006 21:26:42 -0000 1.11 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl 19 Aug 2014 07:35:55 -0000 1.11.8.1 @@ -30,7 +30,7 @@ valid_grades_wa { set counter 0 foreach party_id [array names grades_wa] { - if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { + if { [info exists grades_wa($party_id)] && $grades_wa($party_id) ne "" } { incr counter set grades_wa($party_id) [template::util::leadingTrim $grades_wa($party_id)] if { ![ad_var_type_check_number_p $grades_wa($party_id)] } { @@ -46,8 +46,8 @@ valid_grades_na { set counter 0 foreach party_id [array names grades_na] { - if { [empty_string_p $grade_all] } { - if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { + if { $grade_all eq "" } { + if { [info exists grades_na($party_id)] && $grades_na($party_id) ne "" } { incr counter set grades_na($party_id) [template::util::leadingTrim $grades_na($party_id)] if { ![ad_var_type_check_number_p $grades_na($party_id)] } { @@ -59,26 +59,26 @@ set grades_na($party_id) 0 } } - if { !$counter && ([array size show_student_na] > 0) && [empty_string_p $grade_all] } { + if { !$counter && ([array size show_student_na] > 0) && $grade_all eq "" } { ad_complain "[_ evaluation.lt_There_must_be_at_leas]" } } valid_grades { set counter 0 foreach party_id [array names grades] { - if { [info exists grades($party_id)] && ![empty_string_p $grades($party_id)] } { + if { [info exists grades($party_id)] && $grades($party_id) ne "" } { set grades($party_id) [template::util::leadingTrim $grades($party_id)] if { ![ad_var_type_check_number_p $grades($party_id)] } { set wrong_grade $grades($party_id) ad_complain "[_ evaluation.lt_The_grade_most_be_a_v]" } else { set old_grade [format %.2f [db_string get_old_grade { *SQL* }]] - if { ![string eq $old_grade [format %.2f [expr $grades($party_id)*100/$max_grade]]] } { + if { ![string equal $old_grade [format %.2f [expr {$grades($party_id)*100/$max_grade}]]] } { incr counter if { $max_grade != 100 } { append reasons($party_id) "[_ evaluation.Weight_change]" } - if { ![info exists reasons($party_id)] || [empty_string_p $reasons($party_id)] } { + if { ![info exists reasons($party_id)] || $reasons($party_id) eq "" } { set grade_wo_reason $grades($party_id) ad_complain "[_ evaluation.lt_You_must_give_an_edit]" } @@ -137,14 +137,14 @@ # if the structure of the multirow datasource ever changes, this needs to be rewritten set counter 0 foreach party_id [array names show_student_wa] { - if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { + if { [info exists grades_wa($party_id)] && $grades_wa($party_id) ne "" } { incr counter set party_name [db_string get_party_name { *SQL* }] set evaluations_wa:${counter}(rownum) $counter set evaluations_wa:${counter}(party_name) $party_name set evaluations_wa:${counter}(grade) $grades_wa($party_id) set evaluations_wa:${counter}(comment) " $comments_wa($party_id)" - if { [string eq $show_student_wa($party_id) "t"] } { + if {$show_student_wa($party_id) == "t"} { set evaluations_wa:${counter}(show_student) "[_ evaluation.Yes_]" } else { set evaluations_wa:${counter}(show_student) "[_ evaluation.No_]" @@ -160,14 +160,14 @@ # if the structure of the multirow datasource ever changes, this needs to be rewritten set counter 0 foreach party_id [array names show_student_na] { - if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { + if { [info exists grades_na($party_id)] && $grades_na($party_id) ne "" } { incr counter set party_name [db_string get_party_name { *SQL* }] set evaluations_na:${counter}(rownum) $counter set evaluations_na:${counter}(party_name) $party_name set evaluations_na:${counter}(grade) $grades_na($party_id) set evaluations_na:${counter}(comment) " $comments_na($party_id)" - if { [string eq $show_student_na($party_id) "t"] } { + if {$show_student_na($party_id) == "t"} { set evaluations_na:${counter}(show_student) "[_ evaluation.Yes_]" } else { set evaluations_na:${counter}(show_student) "[_ evaluation.No_]" @@ -183,14 +183,14 @@ # if the structure of the multirow datasource ever changes, this needs to be rewritten set counter 0 foreach party_id [array names show_student] { - if { [info exists grades_to_edit($party_id)] && ![empty_string_p $grades_to_edit($party_id)] } { + if { [info exists grades_to_edit($party_id)] && $grades_to_edit($party_id) ne "" } { incr counter set party_name [db_string get_party_name { *SQL* }] set evaluations:${counter}(rownum) $counter set evaluations:${counter}(party_name) $party_name set evaluations:${counter}(grade) $grades_to_edit($party_id) set evaluations:${counter}(reason) $reasons_to_edit($party_id) - if { [string eq $show_student_to_edit($party_id) "t"] } { + if {$show_student_to_edit($party_id) == "t"} { set evaluations:${counter}(show_student) "[_ evaluation.Yes_]" } else { set evaluations:${counter}(show_student) "[_ evaluation.No_]" Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluation-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluation-delete-2.tcl,v diff -u -r1.9 -r1.9.8.1 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluation-delete-2.tcl 8 Aug 2006 21:26:42 -0000 1.9 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluation-delete-2.tcl 19 Aug 2014 07:35:55 -0000 1.9.8.1 @@ -12,7 +12,7 @@ operation } -if { [string eq $operation [_ evaluation.lt_Yes_I_really_want_to_]] } { +if {$operation eq [_ evaluation.lt_Yes_I_really_want_to_]} { db_transaction { evaluation::delete_student_eval -evaluation_id $evaluation_id } on_error { Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl,v diff -u -r1.13 -r1.13.6.1 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl 7 Oct 2007 22:36:59 -0000 1.13 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl 19 Aug 2014 07:35:55 -0000 1.13.6.1 @@ -54,29 +54,29 @@ set orderby [template::list::orderby_clause -orderby -name evaluated_students] -if {[string equal $orderby ""]} { +if {$orderby eq ""} { set orderby " order by party_name asc" } db_multirow -extend { answer answer_url radio_yes_checked radio_no_checked submission_date_pretty } evaluated_students get_evaluated_students { *SQL* } { - set grade [format %0.2f [expr $grade*$max_grade/100]] + set grade [format %0.2f [expr {$grade*$max_grade/100}]] - if { [string eq $online_p "t"] } { + if {$online_p == "t"} { if { [db_0or1row get_answer_info { *SQL* }] } { # working with answer stuff (if it has a file/url attached) - if { [empty_string_p $answer_data] } { + if { $answer_data eq "" } { set answer "[_ evaluation.No_response_]" - } elseif { [string eq $answer_title "link"] } { + } elseif {$answer_title eq "link"} { set answer_url "[export_vars -base "$answer_data" { }]" set answer "[_ evaluation.View_answer_]" } else { # we assume it's a file set answer_url "[export_vars -base "[ad_conn package_url]view/$answer_title" { revision_id }]" set answer "[_ evaluation.View_answer_]" } - if { ![string eq $answer "[_ evaluation.No_response_]"] && [db_string compare_evaluation_date { *SQL* } -default 0] } { + if { $answer ne "[_ evaluation.No_response_]" && [db_string compare_evaluation_date { *SQL* } -default 0] } { set answer " [_ evaluation.View_NEW_answer_]" } set submission_date_pretty [lc_time_fmt $submission_date_ansi "%q %r"] @@ -86,7 +86,7 @@ } } - if { [string eq $show_student_p "t"] } { + if {$show_student_p == "t"} { set radio_yes_checked "checked" set radio_no_checked "" } else { Index: openacs-4/packages/evaluation/www/admin/evaluations/grades-sheet-parse.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/grades-sheet-parse.tcl,v diff -u -r1.15 -r1.15.8.1 --- openacs-4/packages/evaluation/www/admin/evaluations/grades-sheet-parse.tcl 8 Aug 2006 21:26:42 -0000 1.15 +++ openacs-4/packages/evaluation/www/admin/evaluations/grades-sheet-parse.tcl 19 Aug 2014 07:35:55 -0000 1.15.8.1 @@ -16,7 +16,7 @@ csv_type_p -requires { upload_file } { if { [info exists upload_file] } { set file_extension [file extension $upload_file] - if { [string compare [string tolower $file_extension] ".csv"] } { + if {[string tolower $file_extension] ne ".csv" } { ad_complain "[_ evaluation.lt_The_file_extension_of_1]" } } @@ -28,7 +28,7 @@ set context [list [list "[export_vars -base student-list { task_id }]" "[_ evaluation.Studen_List_]"] "[_ evaluation.Confirm_Evaluation_]"] # Getting some info from the db about the task -if ![db_0or1row get_task_info { *SQL* }] { +if {![db_0or1row get_task_info { *SQL* }]} { # This should never happen. ad_return_complaint 1 "
  • [_ evaluation.lt_There_is_no_informati]
  • " return @@ -43,7 +43,7 @@ set tmp_filename [ns_queryget upload_file.tmpfile] - if { ![empty_string_p $max_n_bytes] && ([file size "$tmp_filename"] > $max_n_bytes) } { + if { $max_n_bytes ne "" && ([file size "$tmp_filename"] > $max_n_bytes) } { set pretty_maxnbytes [lc_numeric $max_n_bytes] ad_return_complaint 1 "[_ evaluation.lt_The_file_is_too_large_1]" return 0 @@ -84,10 +84,10 @@ # removing the first and last " that comes from the csv format regsub ^\" $see_comments_p "" see_comments_p regsub \"\$ $see_comments_p "" see_comments_p - if { ![string eq $see_comments_p 1] && ![string eq $see_comments_p 0] } { + if { $see_comments_p ne "1" && $see_comments_p ne "0" } { ad_return_error "[_ evaluation.Bad_input_]" "[_ evaluation.lt_Input_Will_the_studen]" return - } elseif { [string eq $see_comments_p 1] } { + } elseif {$see_comments_p eq "1"} { set comments_p "t" } else { set comments_p "f" @@ -109,12 +109,12 @@ regsub ^\" $comments "" comments regsub \"\$ $comments "" comments - if { [empty_string_p $party_id] && [empty_string_p $grade] && [empty_string_p $comments] } { + if { $party_id eq "" && $grade eq "" && $comments eq "" } { # "blank" line, skip it continue } - if { ![empty_string_p $grade] } { + if { $grade ne "" } { # start validations if { ![ad_var_type_check_integer_p $party_id] } { incr errors @@ -132,7 +132,7 @@ } # editing without reason - if { ![string eq [format %.2f [db_string check_evaluated { *SQL* } -default $grade]] [format %.2f $grade]] && [empty_string_p $comments] } { + if { ![string equal [format %.2f [db_string check_evaluated { *SQL* } -default $grade]] [format %.2f $grade]] && $comments eq "" } { incr errors append errors_text "
  • [_ evaluation.lt_There_must_be_an_edit]
  • " } @@ -146,7 +146,7 @@ } else { set community_id [dotlrn_community::get_community_id] - if { [empty_string_p $community_id] } { + if { $community_id eq "" } { if { ![db_string valid_user { *SQL* }] } { incr errors append errors_text "
  • [_ evaluation.lt_There_is_at_least_one_1]
  • " @@ -163,7 +163,7 @@ return } - if { ![empty_string_p $comments] } { + if { $comments ne "" } { if { [db_string verify_grade_change { *SQL* } -default 0] } { # there is no change, skip it continue @@ -186,7 +186,7 @@ set evaluations_gs:${counter}(party_name) $party_name set evaluations_gs:${counter}(grade) $grade set evaluations_gs:${counter}(comment) $comments - if { [string eq $comments_p "t"] } { + if {$comments_p == "t"} { set evaluations_gs:${counter}(show_student) "[_ evaluation.Yes_]" } else { set evaluations_gs:${counter}(show_student) "[_ evaluation.No_]" @@ -210,7 +210,7 @@ flush $file_handler close $file_handler - if [catch {exec mv $tmp_filename "${tmp_filename}_grades_sheet"} errmsg] { + if {[catch {exec mv $tmp_filename "${tmp_filename}_grades_sheet"} errmsg]} { ad_return_error "[_ evaluation.lt_Error_while_storing_f]" "[_ evaluation.lt_There_was_a_problem_s]" ad_script_abort } Index: openacs-4/packages/evaluation/www/admin/evaluations/grades-sheets.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/grades-sheets.tcl,v diff -u -r1.10 -r1.10.6.1 --- openacs-4/packages/evaluation/www/admin/evaluations/grades-sheets.tcl 14 Mar 2008 12:33:59 -0000 1.10 +++ openacs-4/packages/evaluation/www/admin/evaluations/grades-sheets.tcl 19 Aug 2014 07:35:55 -0000 1.10.6.1 @@ -61,7 +61,7 @@ set orderby [template::list::orderby_clause -orderby -name grades_sheets] -if {[string equal $orderby ""]} { +if {$orderby eq ""} { set orderby " order by grades_sheet_name asc" } Index: openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl,v diff -u -r1.10 -r1.10.8.1 --- openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl 24 Oct 2006 10:54:18 -0000 1.10 +++ openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl 19 Aug 2014 07:35:55 -0000 1.10.8.1 @@ -18,7 +18,7 @@ set context [list [list [export_vars -base student-list { task_id }] "[_ evaluation.Students_List_]"] $page_title] -if { [ad_form_new_p -key evaluation_id] || [string eq $evaluation_mode "display"] } { +if { [ad_form_new_p -key evaluation_id] || $evaluation_mode eq "display" } { set comment_label "[_ evaluation.Comments_]" } else { set comment_label "[_ evaluation.Edit_Reason_]" Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl,v diff -u -r1.25 -r1.25.6.1 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 14 Mar 2008 16:22:09 -0000 1.25 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 19 Aug 2014 07:35:55 -0000 1.25.6.1 @@ -21,7 +21,7 @@ {bulk_actions ""} } -validate { empty_task_id_and_task_item_id { - if { [empty_string_p $task_id] && [empty_string_p $task_item_id] } { + if { $task_id eq "" && $task_item_id eq "" } { ad_complain "[_ evaluation.lt_There_must_be_a_task_]" } } @@ -34,7 +34,7 @@ set user_id [ad_conn user_id] -if { [empty_string_p $task_id] } { +if { $task_id eq "" } { db_1row get_task_live_revision {select et.task_id from evaluation_tasks et, cr_items cri where et.task_id = cri.live_revision and et.task_item_id = :task_item_id} } @@ -48,7 +48,7 @@ set page_title "[_ evaluation.lt_Students_List_for_tas]" set context [list "[_ evaluation.lt_Students_List_for_tas]"] -if { [string eq $show_portrait_p "t"] } { +if {$show_portrait_p == "t"} { set this_url "student-list?[export_vars -entire_form -url { { show_portrait_p f } }]" } else { set this_url "student-list?[export_vars -entire_form -url { { show_portrait_p t } }]" @@ -70,7 +70,7 @@ set roles_table "" set roles_clause "" -if { ![empty_string_p $community_id] && $number_of_members == 1 } { +if { $community_id ne "" && $number_of_members == 1 } { set roles_table [db_map roles_table_query] set roles_clause [db_map roles_clause_query] } @@ -98,7 +98,7 @@ link_html { title "[_ evaluation.View_evaluation_]" } \ ] \ ] -if { [string eq $online_p "t"] } { +if {$online_p == "t"} { lappend elements submitted \ [list label "[_ evaluation.submitted]" \ display_template { @evaluated_students.submission_date_pretty;noquote@ }] @@ -165,7 +165,7 @@ set orderby [template::list::orderby_clause -orderby -name evaluated_students] -if {[string equal $orderby ""]} { +if {$orderby eq ""} { set orderby " order by party_name asc" } @@ -182,12 +182,12 @@ - if { [string eq $online_p "t"] } { + if {$online_p == "t"} { if { [db_0or1row get_answer_info { *SQL* }] } { # working with answer stuff (if it has a file/url attached) - if { [empty_string_p $answer_data] } { + if { $answer_data eq "" } { set action "[_ evaluation.No_response_]" - } elseif { [string eq $answer_title "link"] } { + } elseif {$answer_title eq "link"} { set action_url "[export_vars -base "$answer_data" { }]" set action "[_ evaluation.View_answer_]" } else { @@ -196,7 +196,7 @@ set action "[_ evaluation.View_answer_]" } - if { [string eq $action "[_ evaluation.View_answer_]"] && ([db_string compare_evaluation_date { *SQL* } -default 0] ) } { + if { $action eq "[_ evaluation.View_answer_]" && ([db_string compare_evaluation_date { *SQL* } -default 0] ) } { set action " [_ evaluation.View_NEW_answer_]" } set submission_date_pretty [lc_time_fmt $submission_date_ansi "%q %r"] @@ -208,7 +208,7 @@ } } - if {[string eq $forums_related_p "t"]} { + if {$forums_related_p == "t"} { set action_url [export_vars -base "../../../forums/user-history" {{user_id $party_id} {view "forum"}}] set action "[_ evaluation.view_post]" @@ -236,7 +236,7 @@ ] \ ] -if { [string eq $show_portrait_p "t"] && [string eq $number_of_members "1"] } { +if { $show_portrait_p == "t" && $number_of_members eq "1" } { lappend elements portrait \ [list label "[_ evaluation.Students_Portrait_]" \ display_template { @not_evaluated_wa.portrait;noquote@ } @@ -278,7 +278,7 @@ set orderby_wa [template::list::orderby_clause -orderby -name not_evaluated_wa] -if { [string equal $orderby_wa ""] } { +if {$orderby_wa eq ""} { set orderby_wa " order by party_name asc" } @@ -304,13 +304,13 @@ set answer "[_ evaluation.View_answer_]" } # working with answer stuff (if it has a file/url attached) - if { [string eq $answer_title "link"] } { + if {$answer_title eq "link"} { set answer_url [export_vars -base "$answer_data" { }] } else { # we assume it's a file set answer_url [export_vars -base "../../view/$answer_title" { revision_id }] } - if {[string eq $forums_related_p "t"]} { + if {$forums_related_p == "t"} { set answer "[_ evaluation.view_post]" set answer_url [export_vars -base "../../../forums/user-history" {{user_id $party_id} {view "forum"}}] } @@ -329,13 +329,13 @@ ] \ ] -if { [string eq $show_portrait_p "t"] && [string eq $number_of_members "1"] } { +if { $show_portrait_p == "t" && $number_of_members eq "1" } { lappend elements portrait \ [list label "[_ evaluation.Students_Portrait_]" \ display_template { @not_evaluated_na.portrait;noquote@ } ] } -if {[string eq $forums_related_p "t"] && $number_of_members <= 1} { +if {$forums_related_p == "t" && $number_of_members <= 1} { lappend elements answer \ [list label "[_ evaluation.answer]" \ display_template {[_ evaluation.view_post]} @@ -367,7 +367,7 @@ set orderby_na [template::list::orderby_clause -orderby -name not_evaluated_na] -if { [string equal $orderby_na ""] } { +if {$orderby_na eq ""} { set orderby_na " order by party_name asc" } @@ -387,7 +387,7 @@ # if this page is called from within a community (dotlrn) we have to show only the students - if { [empty_string_p $community_id] } { + if { $community_id eq "" } { set sql_query [db_map sql_query_individual] } else { set sql_query [db_map sql_query_community_individual] @@ -429,13 +429,13 @@ ] \ ] -if { [string eq $show_portrait_p "t"] && [string eq $number_of_members "1"] } { +if { $show_portrait_p == "t" && $number_of_members eq "1" } { lappend elements portrait \ [list label "[_ evaluation.Students_Portrait_]" \ display_template { @class_students.portrait;noquote@ } ] } -if {[string eq $forums_related_p "t"] && $number_of_members <= 1} { +if {$forums_related_p == "t" && $number_of_members <= 1} { lappend elements answer \ [list label "[_ evaluation.answer]" \ display_template {[_ evaluation.view_post]} @@ -467,7 +467,7 @@ set orderby_cs [template::list::orderby_clause -orderby -name class_students] -if { [string equal $orderby_cs ""] } { +if {$orderby_cs eq ""} { set orderby_cs " order by party_name asc" } @@ -487,7 +487,7 @@ # if this page is called from within a community (dotlrn) we have to show only the students - if { [empty_string_p $community_id] } { + if { $community_id eq "" } { set sql_query [db_map sql_query_individual] } else { set sql_query [db_map sql_query_community_individual] Index: openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.tcl,v diff -u -r1.2 -r1.2.8.1 --- openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.tcl 8 Aug 2006 21:26:42 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.tcl 19 Aug 2014 07:35:55 -0000 1.2.8.1 @@ -29,19 +29,19 @@ weights_sum { set count 0 foreach id [array names weights] { - set count [expr $count+$weights($id)] + set count [expr {$count+$weights($id)}] } if { $count > 100} { ad_complain "[_ evaluation.not_equal_100]" } } } -if {[string equal $info "[_ evaluation.Over_total_grade]"]} { +if {$info eq "[_ evaluation.Over_total_grade]"} { set points_p 1 } -if {[string equal $info "[_ evaluation.rel_weight]"]} { +if {$info eq "[_ evaluation.rel_weight]"} { set relative_p 1 } @@ -54,7 +54,7 @@ } foreach id [array names weights] { # create a list of tasks that requieres/not requires grade - if { [string eq $no_grade($id) "t"] } { + if {$no_grade($id) == "t"} { lappend with_grade $id } else { lappend without_grade $id Index: openacs-4/packages/evaluation/www/admin/grades/distribution-edit-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/distribution-edit-3.tcl,v diff -u -r1.2 -r1.2.8.1 --- openacs-4/packages/evaluation/www/admin/grades/distribution-edit-3.tcl 8 Aug 2006 21:26:42 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit-3.tcl 19 Aug 2014 07:35:56 -0000 1.2.8.1 @@ -15,15 +15,15 @@ set i 0 if { $tasks_counter > 0} { - set equal_grade [format %0.2f [expr 100.00/$tasks_counter]] + set equal_grade [format %0.2f [expr {100.00/$tasks_counter}]] } foreach task $tasks { incr i - set grade_sum [expr $grade_sum + $equal_grade] - if { [string equal $tasks_counter $i] } { - set diff [expr 100-$grade_sum] + set grade_sum [expr {$grade_sum + $equal_grade}] + if {$tasks_counter eq $i} { + set diff [expr {100-$grade_sum}] } set aweight [format %0.2f [expr ($equal_grade + $diff)]] set apoints [format %0.2f [expr ($aweight*$grade_weight)/100.0]] Index: openacs-4/packages/evaluation/www/admin/grades/distribution-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/distribution-edit.tcl,v diff -u -r1.14 -r1.14.4.1 --- openacs-4/packages/evaluation/www/admin/grades/distribution-edit.tcl 10 Jun 2009 00:47:58 -0000 1.14 +++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit.tcl 19 Aug 2014 07:35:56 -0000 1.14.4.1 @@ -27,7 +27,7 @@ set grade_plural_name [lang::util::localize $grade_plural_name] set grade_plural_name_up [string toupper $grade_plural_name] -if { ![empty_string_p $set_task_id_live] } { +if { $set_task_id_live ne "" } { evaluation::set_live_task -task_item_id $set_task_id_live } @@ -78,7 +78,7 @@ set orderby [template::list::orderby_clause -orderby -name grades] -if { [string equal $orderby ""] } { +if {$orderby eq ""} { set orderby " order by task_name asc" } @@ -88,15 +88,15 @@ set task_weight [format %0.2f $task_weight] - if { [string eq $requires_grade_p "t"] } { + if {$requires_grade_p == "t"} { set radio_yes_checked "checked" set radio_no_checked "" } else { set radio_yes_checked "" set radio_no_checked "checked" } - if { [empty_string_p $live_revision] } { + if { $live_revision eq "" } { set delete_template "[_ evaluation.Deleted] [_ evaluation.make_it_live]" } elseif { $simple_p } { set delete_template "[_ evaluation-portlet.Delete]" Index: openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl,v diff -u -r1.8 -r1.8.8.1 --- openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl 8 Aug 2006 21:26:42 -0000 1.8 +++ openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl 19 Aug 2014 07:35:56 -0000 1.8.8.1 @@ -12,7 +12,7 @@ operation } -if { [string eq $operation "[_ evaluation.lt_Yes_I_really_want_to__1]"] } { +if {$operation eq "[_ evaluation.lt_Yes_I_really_want_to__1]"} { db_transaction { # calendar integration (begin) @@ -28,7 +28,7 @@ ad_script_abort } } else { - if { [empty_string_p $return_url] } { + if { $return_url eq "" } { # redirect to the index page by default set return_url "grades" } Index: openacs-4/packages/evaluation/www/admin/grades/grades-reports.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-reports.tcl,v diff -u -r1.15 -r1.15.6.1 --- openacs-4/packages/evaluation/www/admin/grades/grades-reports.tcl 14 Mar 2008 16:22:10 -0000 1.15 +++ openacs-4/packages/evaluation/www/admin/grades/grades-reports.tcl 19 Aug 2014 07:35:56 -0000 1.15.6.1 @@ -13,7 +13,7 @@ {orderby ""} } -validate { grades_for_package { - if { [string eq [db_string package_grades { *SQL* }] 0] } { + if {[db_string package_grades { *SQL* }] eq "0"} { ad_complain "[_ evaluation.lt_There_are_no_grades_f]" } } @@ -32,7 +32,7 @@ set class "pbs_list" } set community_id [dotlrn_community::get_community_id] -if { [empty_string_p $community_id] } { +if { $community_id eq "" } { set query_name grades_report } else { set query_name community_grades_report @@ -78,7 +78,7 @@ -pass_properties " $pass_grades " \ -orderby { default_value student_name } -if { ![empty_string_p $orderby] } { +if { $orderby ne "" } { set orderby "[template::list::orderby_clause -orderby -name grades_report]" } else { set orderby " order by student_name asc" Index: openacs-4/packages/evaluation/www/admin/grades/grades-type-reports.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-type-reports.tcl,v diff -u -r1.11 -r1.11.8.1 --- openacs-4/packages/evaluation/www/admin/grades/grades-type-reports.tcl 8 Aug 2006 21:26:42 -0000 1.11 +++ openacs-4/packages/evaluation/www/admin/grades/grades-type-reports.tcl 19 Aug 2014 07:35:56 -0000 1.11.8.1 @@ -13,7 +13,7 @@ grade_id:integer,notnull } -validate { tasks_for_grade { - if { [string eq [db_string get_tasks { *SQL* }] 0] } { + if {[db_string get_tasks { *SQL* }] eq "0"} { ad_complain "[_ evaluation.lt_There_are_no_tasks_fo_1]" } } @@ -29,7 +29,7 @@ # in order to create the groups set community_id [dotlrn_community::get_community_id] -if { [empty_string_p $community_id] } { +if { $community_id eq "" } { set query_name get_grades } else { set query_name community_get_grades @@ -71,7 +71,7 @@ set orderby [template::list::orderby_clause -orderby -name grade_tasks] -if { [string equal $orderby ""] } { +if {$orderby eq ""} { set task_order " order by student_name asc" } Index: openacs-4/packages/evaluation/www/admin/grades/grades.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades.tcl,v diff -u -r1.18 -r1.18.6.1 --- openacs-4/packages/evaluation/www/admin/grades/grades.tcl 14 Mar 2008 13:20:39 -0000 1.18 +++ openacs-4/packages/evaluation/www/admin/grades/grades.tcl 19 Aug 2014 07:35:56 -0000 1.18.6.1 @@ -25,7 +25,7 @@ set a_label [_ evaluation.total_of_course] set actions "\"\"[_ evaluation.Add_assignment_type_]" -if { ![empty_string_p $set_grade_id_live] } { +if { $set_grade_id_live ne "" } { evaluation::set_live_grade -grade_item_id $set_grade_id_live } @@ -98,18 +98,18 @@ set orderby [template::list::orderby_clause -orderby -name grades] -if {[string equal $orderby ""]} { +if {$orderby eq ""} { set orderby " order by grade_plural_name asc" } db_multirow -extend { delete_template } grades get_class_grades { *SQL* } { if { $simple_p } { - if { ![empty_string_p $live_revision] } { - set total [expr $total + $weight] + if { $live_revision ne "" } { + set total [expr {$total + $weight}] } } - if { [empty_string_p $live_revision] } { + if { $live_revision eq "" } { set delete_template "[_ evaluation.Deleted] [_ evaluation.make_it_live]" } elseif { $simple_p } { set delete_template "[_ evaluation.delete]" Index: openacs-4/packages/evaluation/www/admin/groups/group-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-delete-2.tcl,v diff -u -r1.8 -r1.8.8.1 --- openacs-4/packages/evaluation/www/admin/groups/group-delete-2.tcl 8 Aug 2006 21:26:42 -0000 1.8 +++ openacs-4/packages/evaluation/www/admin/groups/group-delete-2.tcl 19 Aug 2014 07:35:56 -0000 1.8.8.1 @@ -13,7 +13,7 @@ return_url } -if { [string eq $operation "[_ evaluation.lt_Yes_I_really_want_to__2]"] } { +if {$operation eq "[_ evaluation.lt_Yes_I_really_want_to__2]"} { db_transaction { evaluation::delete_evaluation_group -group_id $evaluation_group_id Index: openacs-4/packages/evaluation/www/admin/groups/group-member-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-member-add.tcl,v diff -u -r1.7 -r1.7.8.1 --- openacs-4/packages/evaluation/www/admin/groups/group-member-add.tcl 8 Aug 2006 21:26:42 -0000 1.7 +++ openacs-4/packages/evaluation/www/admin/groups/group-member-add.tcl 19 Aug 2014 07:35:56 -0000 1.7.8.1 @@ -12,7 +12,7 @@ {orderby:optional} } -validate { target_exists { - if { [string eq "select count(group_id) from evaluation_task_groups where task_id = :task_id" 0] } { + if { [string equal "select count(group_id) from evaluation_task_groups where task_id = :task_id" 0] } { ad_complain "[_ evaluation.lt_There_are_no_groups_f]" } } @@ -45,7 +45,7 @@ set orderby [template::list::orderby_clause -orderby -name evaluation_groups] -if { [string equal $orderby ""] } { +if {$orderby eq ""} { set orderby " order by group_name asc" } Index: openacs-4/packages/evaluation/www/admin/groups/group-remove-member.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-remove-member.tcl,v diff -u -r1.6 -r1.6.8.1 --- openacs-4/packages/evaluation/www/admin/groups/group-remove-member.tcl 8 Aug 2006 21:26:42 -0000 1.6 +++ openacs-4/packages/evaluation/www/admin/groups/group-remove-member.tcl 19 Aug 2014 07:35:56 -0000 1.6.8.1 @@ -14,7 +14,7 @@ db_exec_plsql delete_relationship { *SQL* } -if { [string eq [db_string get_members { *SQL* }] 0] } { +if {[db_string get_members { *SQL* }] eq "0"} { db_exec_plsql delete_group { *SQL* } ad_returnredirect "one-task?[export_vars -url { task_id }]" } Index: openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl,v diff -u -r1.9 -r1.9.8.1 --- openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl 8 Aug 2006 21:26:42 -0000 1.9 +++ openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl 19 Aug 2014 07:35:56 -0000 1.9.8.1 @@ -39,7 +39,7 @@ set orderby [template::list::orderby_clause -orderby -name groups] -if { [string equal $orderby ""] } { +if {$orderby eq ""} { set orderby " order by et.task_name asc" } Index: openacs-4/packages/evaluation/www/admin/groups/one-group.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/one-group.tcl,v diff -u -r1.9 -r1.9.8.1 --- openacs-4/packages/evaluation/www/admin/groups/one-group.tcl 8 Aug 2006 21:26:43 -0000 1.9 +++ openacs-4/packages/evaluation/www/admin/groups/one-group.tcl 19 Aug 2014 07:35:56 -0000 1.9.8.1 @@ -47,7 +47,7 @@ set orderby [template::list::orderby_clause -orderby -name one_group] -if { [string equal $orderby ""] } { +if {$orderby eq ""} { set orderby " order by student_name asc" } Index: openacs-4/packages/evaluation/www/admin/groups/one-task.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/one-task.tcl,v diff -u -r1.11 -r1.11.6.1 --- openacs-4/packages/evaluation/www/admin/groups/one-task.tcl 14 Mar 2008 14:51:36 -0000 1.11 +++ openacs-4/packages/evaluation/www/admin/groups/one-task.tcl 19 Aug 2014 07:35:56 -0000 1.11.6.1 @@ -13,7 +13,7 @@ {return_url ""} } -validate { group_task { - if { [string eq [db_string get_number_of_members { *SQL* }] 1] } { + if {[db_string get_number_of_members { *SQL* }] eq "1"} { ad_complain "[_ evaluation.lt_This_task_is_not_in_g]" } } @@ -29,7 +29,7 @@ # in order to create the groups set community_id [dotlrn_community::get_community_id] -if { [empty_string_p $community_id] } { +if { $community_id eq "" } { set query_name get_students_without_group } else { set query_name community_get_students_without_group @@ -60,7 +60,7 @@ set orderby [template::list::orderby_clause -orderby -name students_without_group] -if { [string equal $orderby ""] } { +if {$orderby eq ""} { set orderby " order by student_name asc" } @@ -100,7 +100,7 @@ set orderby_groups [template::list::orderby_clause -orderby -name task_groups] -if { [string equal $orderby_groups ""] } { +if {$orderby_groups eq ""} { set orderby_groups " order by group_name asc" } Index: openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl,v diff -u -r1.19 -r1.19.6.1 --- openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl 14 Mar 2008 16:22:10 -0000 1.19 +++ openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl 19 Aug 2014 07:35:56 -0000 1.19.6.1 @@ -43,9 +43,9 @@ db_1row get_sol_info { *SQL* } - if { ![string eq $title "link"] && $content_length > 0 } { + if { $title ne "link" && $content_length > 0 } { - if { [string eq $solution_mode "edit"] } { + if {$solution_mode eq "edit"} { set attached_p "t" ad_form -extend -name solution -form { @@ -77,9 +77,9 @@ } } } - } elseif { [string eq $title "link"] } { + } elseif {$title eq "link"} { - if { [string eq $solution_mode "edit"] } { + if {$solution_mode eq "edit"} { set attached_p "t" @@ -156,27 +156,27 @@ } -validate { {url - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || (![string eq $url "http://"] && [util_url_valid_p $url]) || ([string eq $url "http://"] && [empty_string_p $upload_file] && [string eq $unattach_p "t"]) } + { ($url eq "http://" && $upload_file ne "") || ($url ne "http://" && $upload_file eq "") || ($url ne "http://" && [util_url_valid_p $url]) || ($url eq "http://" && $upload_file eq "" && $unattach_p == "t") } { [_ evaluation.lt_Upload_a_file_OR_a_va] } } {upload_file - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || ([string eq $url "http://"] && [empty_string_p $upload_file] && [string eq $unattach_p "t"]) } + { ($url eq "http://" && $upload_file ne "") || ($url ne "http://" && $upload_file eq "") || ($url eq "http://" && $upload_file eq "" && $unattach_p == "t") } { [_ evaluation.lt_Upload_a_file_OR_a_ur] } } {unattach_p - { ([string eq $unattach_p "t"] && [empty_string_p $upload_file] && [string eq $url "http://"]) || [empty_string_p $unattach_p] } + { ($unattach_p == "t" && $upload_file eq "" && $url eq "http://") || $unattach_p eq "" } { [_ evaluation.lt_First_unattach_the_fi] } } } -on_submit { db_transaction { - if { [string eq $unattach_p "t"] } { + if {$unattach_p == "t"} { evaluation::revision_delete -revision_id $solution_id } else { # set storage_type to its default value according to a db constraint set storage_type "lob" - if { ![empty_string_p $upload_file] } { + if { $upload_file ne "" } { # Get the filename part of the upload file if { ![regexp {[^//\\]+$} $upload_file filename] } { @@ -190,10 +190,10 @@ if { ![parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { set storage_type file } - } elseif { ![string eq $url "http://"] } { + } elseif { $url ne "http://" } { set mime_type "text/plain" set title "link" - } elseif { [string eq $attached_p "f"] } { + } elseif {$attached_p == "f"} { set mime_type "text/plain" set title "" } @@ -215,7 +215,7 @@ content::item::set_live_revision -revision_id $revision_id - if { ![empty_string_p $upload_file] } { + if { $upload_file ne "" } { set tmp_file [template::util::file::get_property tmp_filename $upload_file] set content_length [file size $tmp_file] @@ -237,15 +237,15 @@ } - } elseif { ![string eq $url "http://"] } { + } elseif { $url ne "http://" } { db_dml link_content { *SQL* } set content_length [string length $url] # in order to support oracle and postgres and still using only the cr_items table to store the task db_dml set_storage_type { *SQL* } db_dml content_size { *SQL* } - } elseif { [string eq $attached_p "t"] && ![string eq $unattach_p "t"] } { + } elseif { $attached_p == "t" && $unattach_p != "t" } { # just copy the old content to the new revision db_exec_plsql copy_content { *SQL* } } Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl,v diff -u -r1.32 -r1.32.4.1 --- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 10 Jun 2009 00:48:26 -0000 1.32 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 19 Aug 2014 07:35:57 -0000 1.32.4.1 @@ -32,7 +32,7 @@ set more_communities_option 0 -if { $new_p && ![empty_string_p $community_id] && [db_string get_user_comunities { *SQL* }] } { +if { $new_p && $community_id ne "" && [db_string get_user_comunities { *SQL* }] } { set more_communities_option 1 } @@ -83,8 +83,8 @@ db_1row get_task_info { *SQL* } - if { ![string eq $title "link"] && $content_length > 0 } { - if { [string eq $mode "edit"] } { + if { $title ne "link" && $content_length > 0 } { + if {$mode eq "edit"} { set attached_p "t" ad_form -extend -name task -form { {upload_file:file,optional @@ -115,9 +115,9 @@ } } } - } elseif { [string eq $title "link"] } { + } elseif {$title eq "link"} { - if { [string eq $mode "edit"] } { + if {$mode eq "edit"} { set attached_p "t" @@ -323,12 +323,12 @@ } -edit_request { db_1row task_info { *SQL* } - if {[string eq $online_p t]} { + if {$online_p == "t"} { set answer_choice "ol" } else { set answer_choice "ns" } - if {[string eq $forums_related_p t]} { + if {$forums_related_p == "t"} { set answer_choice "fr" } @@ -339,23 +339,23 @@ } -validate { {url - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || ([string eq $url "http://"] && [empty_string_p $upload_file]) || (![string eq $url "http://"] && [util_url_valid_p $url]) } + { ($url eq "http://" && $upload_file ne "") || ($url ne "http://" && $upload_file eq "") || ($url eq "http://" && $upload_file eq "") || ($url ne "http://" && [util_url_valid_p $url]) } {[_ evaluation.lt_Upload_a_file_OR_a_ur_1] } } {upload_file - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || ([string eq $url "http://"] && [empty_string_p $upload_file]) } + { ($url eq "http://" && $upload_file ne "") || ($url ne "http://" && $upload_file eq "") || ($url eq "http://" && $upload_file eq "") } { [_ evaluation.lt_Upload_a_file_OR_a_ur_1] } } {unattach_p - { ([string eq $unattach_p "t"] && [empty_string_p $upload_file] && [string eq $url "http://"]) || [empty_string_p $unattach_p] } + { ($unattach_p == "t" && $upload_file eq "" && $url eq "http://") || $unattach_p eq "" } { [_ evaluation.lt_First_unattach_the_fi] } } {net_value - { !$net_value || ([empty_string_p $net_value] && [string eq $requires_grade_p f]) || (($net_value > 0) && ($net_value <= $grade_weight) && (!$weight || [empty_string_p $weight])) } + { !$net_value || ($net_value eq "" && $requires_grade_p == "f") || (($net_value > 0) && ($net_value <= $grade_weight) && (!$weight || $weight eq "")) } { [_ evaluation.lt_The_net_value_must_be] } } {weight - { !$weight || ([empty_string_p $weight] && [string eq $requires_grade_p f]) || (($weight > 0) && (!$net_value || [empty_string_p $net_value])) } + { !$weight || ($weight eq "" && $requires_grade_p == "f") || (($weight > 0) && (!$net_value || $net_value eq "")) } { [_ evaluation.lt_The_weight_must_be_gr] } } {number_of_members @@ -376,9 +376,9 @@ } -on_submit { - if { [string eq $requires_grade_p t] } { + if {$requires_grade_p == "t"} { if { [info exists net_value] && ($net_value > 0) } { - set weight [expr $net_value*100.000/$grade_weight] + set weight [expr {$net_value*100.000/$grade_weight}] } } else { set weight 0 @@ -388,18 +388,18 @@ set forums_related_p "f" set online_p "f" - if {[string eq $answer_choice "ol"]} { + if {$answer_choice eq "ol"} { set online_p "t" } - if {[string eq $answer_choice "fr"]} { + if {$answer_choice eq "fr"} { set forums_related_p "t" } db_transaction { - if { ![empty_string_p $upload_file] } { + if { $upload_file ne "" } { # Get the filename part of the upload file if { ![regexp {[^//\\]+$} $upload_file filename] } { @@ -413,10 +413,10 @@ if { ![parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { set storage_type file } - } elseif { ![string eq $url "http://"] } { + } elseif { $url ne "http://" } { set mime_type "text/plain" set title "link" - } elseif { [string eq $attached_p "f"] } { + } elseif {$attached_p == "f"} { set mime_type "text/plain" set title "" } @@ -426,7 +426,7 @@ set cal_due_date [calendar::to_sql_datetime -date $due_date -time $due_date -time_p 1] set due_date_ansi [db_string set_date " *SQL* "] - if { [string equal $cal_due_date "-- :"]} { + if {$cal_due_date eq "-- :"} { set due_date_p 0 set due_date "" } @@ -466,7 +466,7 @@ db_dml lob_size { *SQL* } - if { ![empty_string_p $upload_file] } { + if { $upload_file ne "" } { set tmp_file [template::util::file::get_property tmp_filename $upload_file] set content_length [file size $tmp_file] @@ -483,15 +483,15 @@ } - } elseif { ![string eq $url "http://"] } { + } elseif { $url ne "http://" } { db_dml link_content { *SQL* } # in order to support oracle and postgres and still using only the cr_items table to store the task db_dml set_storage_type { *SQL* } set content_length [string length $url] db_dml content_size { *SQL* } - } elseif { [string eq $attached_p "t"] && ![string eq $unattach_p "t"] } { + } elseif { $attached_p == "t" && $unattach_p != "t" } { # just copy the old content to the new revision db_exec_plsql copy_content { *SQL* } @@ -547,7 +547,7 @@ if { [info exists admin_groups_p] && $number_of_members > 1 } { set redirect_to_groups_p 1 } - if { ![empty_string_p $add_to_more_classes_p] } { + if { $add_to_more_classes_p ne "" } { ad_returnredirect [export_vars -base "task-add-to-communities" { redirect_to_groups_p {task_id $revision_id} return_url }] } elseif { $redirect_to_groups_p } { ad_returnredirect [export_vars -base "../groups/one-task" { {task_id $revision_id} }] Index: openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.tcl,v diff -u -r1.8 -r1.8.8.1 --- openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.tcl 8 Aug 2006 21:26:43 -0000 1.8 +++ openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.tcl 19 Aug 2014 07:35:57 -0000 1.8.8.1 @@ -13,7 +13,7 @@ return_url } -if { [string eq $operation [_ evaluation.lt_Yes_I_really_want_to__3]] } { +if {$operation eq [_ evaluation.lt_Yes_I_really_want_to__3]} { db_transaction { @@ -31,7 +31,7 @@ ad_script_abort } } else { - if { [empty_string_p $return_url] } { + if { $return_url eq "" } { # redirect to the index page by default set return_url "$return_url" } Index: openacs-4/packages/evaluation/www/view/answer-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/view/answer-add-edit.tcl,v diff -u -r1.2 -r1.2.8.1 --- openacs-4/packages/evaluation/www/view/answer-add-edit.tcl 8 Aug 2006 21:26:43 -0000 1.2 +++ openacs-4/packages/evaluation/www/view/answer-add-edit.tcl 19 Aug 2014 07:35:57 -0000 1.2.8.1 @@ -17,7 +17,7 @@ {comment ""} } -validate { late_submit -requires { task_id:integer } { - if { [string eq [db_string late_turn_in { *SQL* }] "f"] && [db_string compare_dates { *SQL* } -default 0] } { + if { [string equal [db_string late_turn_in { *SQL* }] "f"] && [db_string compare_dates { *SQL* } -default 0] } { ad_complain "[_ evaluation.lt_This_task_can_not_be_]" } } @@ -74,11 +74,11 @@ } -validate { {url - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || (![string eq $url "http://"] && [util_url_valid_p $url]) } + { ($url eq "http://" && $upload_file ne "") || ($url ne "http://" && $upload_file eq "") || ($url ne "http://" && [util_url_valid_p $url]) } { [_ evaluation.lt_Upload_a_file_OR_a_va] } } {upload_file - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) } + { ($url eq "http://" && $upload_file ne "") || ($url ne "http://" && $upload_file eq "") } { [_ evaluation.lt_Upload_a_file_OR_a_ur] } } } -on_submit { @@ -89,7 +89,7 @@ set title "" # set storage_type to its default value according to a db constraint set storage_type "lob" - if { ![empty_string_p $upload_file] } { + if { $upload_file ne "" } { # Get the filename part of the upload file if { ![regexp {[^//\\]+$} $upload_file filename] } { @@ -103,7 +103,7 @@ if { ![parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { set storage_type file } - } elseif { ![string eq $url "http://"] } { + } elseif { $url ne "http://" } { set mime_type "text/plain" set title "link" } @@ -126,7 +126,7 @@ content::item::set_live_revision -revision_id $revision_id - if { ![empty_string_p $upload_file] } { + if { $upload_file ne "" } { set tmp_file [template::util::file::get_property tmp_filename $upload_file] set content_length [file size $tmp_file] @@ -148,7 +148,7 @@ } - } elseif { ![string eq $url "http://"] } { + } elseif { $url ne "http://" } { db_dml link_content { *SQL* } set content_length 0 Index: openacs-4/packages/evaluation/www/view/answer-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/view/answer-view.tcl,v diff -u -r1.3 -r1.3.6.1 --- openacs-4/packages/evaluation/www/view/answer-view.tcl 14 Mar 2008 14:55:13 -0000 1.3 +++ openacs-4/packages/evaluation/www/view/answer-view.tcl 19 Aug 2014 07:35:57 -0000 1.3.6.1 @@ -34,7 +34,7 @@ if { [db_0or1row get_answer_info { *SQL* }] } { # working with answer stuff (if it has a file/url attached) - if { [string eq $answer_title "link"] } { + if {$answer_title eq "link"} { # there is a bug in the template::list, if the url does not has a http://, ftp://, the url is not absolute, # so we have to deal with this case array set community_info [site_node::get -url "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]][evaluation::package_key]"] @@ -49,7 +49,7 @@ set answer "[_ evaluation-portlet.View_my_answer_]" } - if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } { + if { $number_of_members > 1 && [string equal [db_string get_group_id { *SQL* }] "0"] } { set answer "" set answer_url "" set grade "[_ evaluation-portlet.No_group_for_task_]" @@ -73,7 +73,7 @@ set submitted_date_mode display set submitted_date_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id answer_id return_url answer_mode }]" } -} elseif { [string eq $late_submit_p "t"] } { +} elseif {$late_submit_p == "t"} { if { ![db_0or1row get_answer_info { *SQL* }] } { set submitted_date "[_ evaluation-portlet.lt_submit_answer_style_f]" set submitted_date_mode edit Index: openacs-4/packages/evaluation/www/view/evaluation-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/view/evaluation-view.tcl,v diff -u -r1.3 -r1.3.6.1 --- openacs-4/packages/evaluation/www/view/evaluation-view.tcl 7 Oct 2007 22:37:00 -0000 1.3 +++ openacs-4/packages/evaluation/www/view/evaluation-view.tcl 19 Aug 2014 07:35:57 -0000 1.3.6.1 @@ -38,9 +38,9 @@ set grade_weight [lc_numeric %.2f $grade_weight] set net_grade [lc_numeric %.2f $net_grade] -if { ![empty_string_p $answer_data] } { +if { $answer_data ne "" } { - if { [string eq $answer_title "link"] } { + if {$answer_title eq "link"} { set answer_url "$answer_data" } else { # we assume it's a file Index: openacs-4/packages/evaluation/www/view/task-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/view/task-view.tcl,v diff -u -r1.3 -r1.3.6.1 --- openacs-4/packages/evaluation/www/view/task-view.tcl 7 Oct 2007 22:37:00 -0000 1.3 +++ openacs-4/packages/evaluation/www/view/task-view.tcl 19 Aug 2014 07:35:57 -0000 1.3.6.1 @@ -33,9 +33,9 @@ } db_1row get_task_info { *SQL* } -if { ![empty_string_p $task_data] } { +if { $task_data ne "" } { - if { [string eq $task_title "link"] } { + if {$task_title eq "link"} { set task_url "$task_data" } else { # we assume it's a file @@ -51,9 +51,9 @@ } } -if { ![empty_string_p $solution_data] } { +if { $solution_data ne "" } { - if { [string eq $solution_title "link"] } { + if {$solution_title eq "link"} { # there is a bug in the template::list, if the url does not has a http://, ftp://, the url is not absolute, # so we have to deal with this case array set community_info [site_node::get -url "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]][evaluation::package_key]"]