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.1 -r1.2
--- openacs-4/packages/evaluation/www/admin/grades/grades.tcl 28 Apr 2004 11:06:42 -0000 1.1
+++ openacs-4/packages/evaluation/www/admin/grades/grades.tcl 31 May 2004 17:04:58 -0000 1.2
@@ -2,14 +2,14 @@
ad_page_contract {
- List of grades and options to admin grades
+ List of grades and options to admin grades
@author jopez@galileo.edu
@creation-date Feb 2004
@cvs-id $Id$
} -query {
- {orderby:optional}
+ {orderby:optional}
}
set context [list Grades]
@@ -20,32 +20,38 @@
set actions [list "Add assignment type" [export_vars -base "grades-add-edit" { }]]
+if { [format %2.f [db_string sum_grades { *SQL* }]] > 100.00} {
+ set aggregate_label "Total"
+} else {
+ set aggregate_label "Total"
+}
+
template::list::create \
-name grades \
-multirow grades \
-actions $actions \
- -key grade_id \
- -pass_properties { return_url } \
+ -key grade_id \
+ -pass_properties { return_url aggregate_label } \
-elements {
grade_name {
label "Name"
- orderby_asc {grade_name asc}
- orderby_desc {grade_name desc}
+ orderby_asc {grade_name asc}
+ orderby_desc {grade_name desc}
link_url_eval {[export_vars -base "distribution-edit" { grade_id }]}
link_html { title "View assignment type distribution" }
}
weight {
label "Weight"
- orderby_asc {weight asc}
- orderby_desc {weight desc}
- display_template { @grades.weight@% }
- aggregate sum
- aggregate_label {Total}
+ orderby_asc {weight asc}
+ orderby_desc {weight desc}
+ display_template { @grades.weight@% }
+ aggregate sum
+ aggregate_label { @aggregate_label;noquote@ }
}
comments {
label "Description"
- orderby_asc {comments asc}
- orderby_desc {comments desc}
+ orderby_asc {comments asc}
+ orderby_desc {comments desc}
}
edit {
label {}
@@ -80,9 +86,9 @@
set total_weight [format %.2f $total_weight]
if { ![string eq $total_weight "100.00"] && ![string eq $total_weight "0"] } {
- set notice "The sum of the weight of all the assignment types is $total_weight and it should be 100.00 by the end of the term(supposedly)."
+ set notice "The sum of the weight of all the assignment types is $total_weight and it should be 100.00 by the end of the term(supposedly)."
} else {
- set notice ""
+ set notice ""
}
ad_return_template