Index: openacs-4/packages/evaluation-portlet/lib/evaluations-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/lib/evaluations-chunk-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation-portlet/lib/evaluations-chunk-postgresql.xql 30 Aug 2004 13:05:00 -0000 1.4 +++ openacs-4/packages/evaluation-portlet/lib/evaluations-chunk-postgresql.xql 11 Sep 2004 00:41:09 -0000 1.5 @@ -6,7 +6,8 @@ - select et.task_name, et.weight as task_weight, + select et.task_name, + round(et.weight,2) as task_weight, et.task_id from evaluation_tasksi et, cr_items cri where grade_item_id = :grade_item_id @@ -23,7 +24,7 @@ et.task_item_id, et.weight as t_weight, eg.weight as g_weight, - (et.weight*eg.weight)/100 as task_weight, + round((et.weight*eg.weight)/100,2) as task_weight, et.number_of_members, et.task_id from evaluation_grades eg, @@ -40,22 +41,49 @@ - select evaluation__party_id(:user_id,:task_id) + select coalesce((select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id),0) + from evaluation_tasks et3 + where et3.task_id = :task_id + +-- select evaluation__party_id(:user_id,:task_id) - + - select ese.grade, + select round(ese.grade,2) as grade, + ese.evaluation_id, ese.description as comments, ese.show_student_p, - (ese.grade*:t_weight*:g_weight)/10000 as task_grade + round((ese.grade*:t_weight*:g_weight)/10000,2) as task_grade from evaluation_student_evalsi ese, cr_items cri where ese.task_item_id = :task_item_id and cri.live_revision = ese.evaluation_id - and ese.party_id = evaluation__party_id(:user_id,:task_id) + and ese.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = :task_id + ) +-- evaluation__party_id(:user_id,:task_id) @@ -69,8 +97,25 @@ from evaluation_answersi ea, cr_items cri where ea.task_item_id = :task_item_id and cri.live_revision = ea.answer_id - and ea.party_id = evaluation__party_id(:user_id,:task_id) + and ea.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = :task_id + ) +-- evaluation__party_id(:user_id,:task_id) + Index: openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.adp 31 May 2004 23:43:09 -0000 1.1 +++ openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.adp 11 Sep 2004 00:41:09 -0000 1.2 @@ -1,4 +1,3 @@ -
+ @bottom_line;noquote@ -
Index: openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.tcl 30 Aug 2004 13:05:00 -0000 1.9 +++ openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.tcl 11 Sep 2004 00:41:09 -0000 1.10 @@ -9,6 +9,7 @@ set admin_p [permission::permission_p -party_id $user_id -object_id $package_id -privilege admin] set base_url "[ad_conn package_url][evaluation::package_key]/" +set return_url "[ad_conn url]?[ns_conn query]" db_1row get_grade_info { *SQL* } @@ -35,22 +36,20 @@ #student lappend elements grade \ [list label "[_ evaluation-portlet.Grade_over_100_]" \ - display_template {
@grade_tasks.grade@
} \ - orderby_asc {grade asc} \ - orderby_desc {grade desc}] + display_template {
@grade_tasks.grade@
} ] lappend elements comments \ [list label "[_ evaluation-portlet.Comments_]" \ - link_url_col comments_url \ - link_html { title "[_ evaluation-portlet.lt_View_evaluation_comme]" }] + link_url_col comments_url \ + link_html { title "[_ evaluation-portlet.lt_View_evaluation_comme]" }] lappend elements task_weight \ [list label "[_ evaluation-portlet.Net_Value_]" \ - display_template {
@grade_tasks.task_weight@
} \ - orderby_asc {task_weight asc} \ - orderby_desc {task_weight desc}] + display_template {
@grade_tasks.task_weight@
} \ + orderby_asc {task_weight asc} \ + orderby_desc {task_weight desc}] lappend elements answer \ [list label "" \ - link_url_col answer_url \ - link_html { title "[_ evaluation-portlet.View_my_answer_]" }] + link_url_col answer_url \ + link_html { title "[_ evaluation-portlet.View_my_answer_]" }] set multirow_name grade_tasks set actions "" } @@ -82,46 +81,46 @@ db_multirow -extend { task_url audit_info audit_info_url } grade_tasks_admin get_tasks_admin { *SQL* } { set task_url [export_vars -base "${base_url}admin/evaluations/student-list" { task_id grade_id }] set category_weight [expr $category_weight + $task_weight] - set task_weight [format %.2f [lc_numeric $task_weight]] + set task_weight [lc_numeric $task_weight] set audit_info_url "[export_vars -base "${base_url}admin/evaluations/audit-info" { grade_id task_id }]" set audit_info "[_ evaluation-portlet.Audit_Info_]" } } else { db_multirow -extend { comments comments_url answer answer_url grade } grade_tasks get_grade_tasks { *SQL* } { - - if { [db_0or1row get_evaluaiton_info { *SQL* }] } { + if { [db_0or1row get_evaluation_info { *SQL* }] } { if { ![empty_string_p $comments] } { set comments "[_ evaluation-portlet.View_comments_]" - set comments_url evaluation_view + set comments_url "[export_vars -base "${base_url}evaluation-view" { evaluation_id return_url }]" + } else { + set comments "[_ evaluation-portlet.lt_View_evaluation_detai]" + set comments_url "[export_vars -base "${base_url}evaluation-view" { evaluation_id return_url }]" } set over_weight "" - if { ![empty_string_p $show_student_p] && $show_student_p } { + if { [string eq $show_student_p "t"] } { + set max_grade [expr $task_weight + $max_grade] if { ![empty_string_p $grade] } { - set grade [format %.2f [lc_numeric $grade]] - set over_weight "[format %.2f [lc_numeric $task_grade]]/" + set grade [lc_numeric $grade] + set over_weight "[lc_numeric $task_grade]/" set total_grade [expr $total_grade + $task_grade] } else { set grade "[_ evaluation-portlet.Not_evaluated_]" } + set task_weight "${over_weight}[lc_numeric $task_weight]" - set max_grade [expr $task_weight + $max_grade] - set task_weight "${over_weight}[format %.2f [lc_numeric $task_weight]]" - } else { set grade "[_ evaluation-portlet.Not_available_]" set task_weight "[_ evaluation-portlet.Not_available_]" } } else { set grade "[_ evaluation-portlet.Not_evaluated_]" - set grade "[_ evaluation-portlet.Not_available_]" - set task_weight "[_ evaluation-portlet.Not_available_]" - } - + set max_grade [expr $task_weight + $max_grade] + set task_weight "[_ evaluation-portlet.Not_evaluated_]" + } if { [db_0or1row get_answer_info { *SQL* }] } { # working with answer stuff (if it has a file/url attached) Index: openacs-4/packages/evaluation-portlet/lib/tasks-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/lib/tasks-chunk-postgresql.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/evaluation-portlet/lib/tasks-chunk-postgresql.xql 30 Aug 2004 13:05:00 -0000 1.9 +++ openacs-4/packages/evaluation-portlet/lib/tasks-chunk-postgresql.xql 11 Sep 2004 00:41:09 -0000 1.10 @@ -13,16 +13,19 @@ et.task_item_id, et.item_id, et.requires_grade_p, et.description, et.grade_item_id, - coalesce(cr.content_length,0) as content_length, + coalesce(round(cr.content_length/1024,0),0) as content_length, et.data as task_data, + crmt.label as pretty_mime_type, cr.title as task_title, et.task_id as revision_id from cr_revisions cr, evaluation_tasksi et, - cr_items cri + cr_items cri, + cr_mime_types crmt where cr.revision_id = et.revision_id and et.grade_item_id = :grade_item_id and cri.live_revision = et.task_id + and et.mime_type = crmt.mime_type $assignments_orderby @@ -42,14 +45,17 @@ cr.title as task_title, et.data as task_data, et.task_id as revision_id, - coalesce(cr.content_length,0) as content_length, - et.late_submit_p + coalesce(round(cr.content_length/1024,0),0) as content_length, + et.late_submit_p, + crmt.label as pretty_mime_type from cr_revisions cr, evaluation_tasksi et, - cr_items cri + cr_items cri, + cr_mime_types crmt where cr.revision_id = et.revision_id and grade_item_id = :grade_item_id and cri.live_revision = et.task_id + and et.mime_type = crmt.mime_type $assignments_orderby @@ -66,7 +72,17 @@ - select evaluation__party_id(:user_id,:task_id) + select coalesce((select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id),0) + from evaluation_tasks et3 + where et3.task_id = :task_id + +-- select evaluation__party_id(:user_id,:task_id) @@ -100,7 +116,24 @@ from evaluation_answers ea, cr_items cri where ea.task_item_id = :task_item_id and cri.live_revision = ea.answer_id - and ea.party_id = evaluation__party_id(:user_id,:task_id) + and ea.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = :task_id + ) + + --evaluation__party_id(:user_id,:task_id) Index: openacs-4/packages/evaluation-portlet/lib/tasks-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/lib/tasks-chunk.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/evaluation-portlet/lib/tasks-chunk.adp 31 May 2004 23:43:09 -0000 1.1 +++ openacs-4/packages/evaluation-portlet/lib/tasks-chunk.adp 11 Sep 2004 00:41:09 -0000 1.2 @@ -1,3 +1,3 @@ -
+ Index: openacs-4/packages/evaluation-portlet/lib/tasks-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/lib/tasks-chunk.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/evaluation-portlet/lib/tasks-chunk.tcl 30 Aug 2004 13:05:00 -0000 1.9 +++ openacs-4/packages/evaluation-portlet/lib/tasks-chunk.tcl 11 Sep 2004 00:41:09 -0000 1.10 @@ -12,7 +12,7 @@ set base_url "[ad_conn package_url][evaluation::package_key]/" set mode display -set return_url "[ad_conn url]?[ns_conn query]&[export_vars { grade_id }]" +set return_url "[ad_conn url]?[ns_conn query]" set elements [list task_name \ [list label "[_ evaluation-portlet.Name_]" \ @@ -115,7 +115,7 @@ } else { # we assume it's a file set task_url "[export_vars -base "${base_url}view/$task_title" { revision_id }]" - set task_name "$task_name ([format %.0f [lc_numeric [expr ($content_length/1024)]]] Kb)" + set task_name "$task_name ([lc_numeric $content_length] Kb - ${pretty_mime_type})" } if { [db_0or1row solution_info { *SQL* }] } { @@ -157,7 +157,7 @@ } else { # we assume it's a file set task_url "[export_vars -base "${base_url}view/$task_title" { revision_id }]" - set task_name "$task_name ([format %.0f [lc_numeric [expr ($content_length/1024)]]] Kb)" + set task_name "$task_name ([lc_numeric $content_length] Kb - ${pretty_mime_type})" } if { [string eq $online_p "t"] } { Index: openacs-4/packages/evaluation-portlet/www/evaluation-assignments-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/www/evaluation-assignments-portlet-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation-portlet/www/evaluation-assignments-portlet-postgresql.xql 30 Aug 2004 09:04:20 -0000 1.4 +++ openacs-4/packages/evaluation-portlet/www/evaluation-assignments-portlet-postgresql.xql 11 Sep 2004 00:41:10 -0000 1.5 @@ -9,10 +9,9 @@ select eg.grade_plural_name, eg.grade_id, eg.grade_item_id - from evaluation_gradesx eg, acs_objects ao - where exists (select 1 from cr_items - where live_revision = eg.grade_id) - and eg.item_id = ao.object_id + from evaluation_grades eg, acs_objects ao, cr_items cri + where cri.live_revision = eg.grade_id + and eg.grade_item_id = ao.object_id and ao.context_id in ([join $list_of_package_ids ,]) order by grade_plural_name desc Index: openacs-4/packages/evaluation-portlet/www/evaluation-assignments-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/www/evaluation-assignments-portlet.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation-portlet/www/evaluation-assignments-portlet.adp 5 Aug 2004 00:32:56 -0000 1.4 +++ openacs-4/packages/evaluation-portlet/www/evaluation-assignments-portlet.adp 11 Sep 2004 00:41:10 -0000 1.5 @@ -8,6 +8,7 @@
  • @grades.grade_plural_name@
    +

  • Index: openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet-postgresql.xql 30 Aug 2004 12:08:20 -0000 1.7 +++ openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet-postgresql.xql 11 Sep 2004 00:41:10 -0000 1.8 @@ -6,23 +6,24 @@ - select eg.grade_plural_name, - eg.grade_id, - eg.grade_item_id - from evaluation_gradesx eg, acs_objects ao - where exists (select 1 from cr_items - where live_revision = eg.grade_id) - and eg.item_id = ao.object_id - and ao.context_id in ([join $list_of_package_ids ,]) - order by grade_plural_name desc + select eg.grade_plural_name, + eg.grade_id, + eg.grade_item_id + from evaluation_grades eg, acs_objects ao + where exists (select 1 from cr_items + where live_revision = eg.grade_id) + and eg.grade_item_id = ao.object_id + and ao.context_id in ([join $list_of_package_ids ,]) + order by grade_plural_name desc - select coalesce(sum((ese.grade*et.weight*eg.weight)/10000),0) as grade + select coalesce( + sum(round((ese.grade*et.weight*eg.weight)/10000,2)),0) as grade from evaluation_grades eg, evaluation_tasks et, evaluation_student_evals ese, acs_objects ao where et.task_item_id = ese.task_item_id and et.grade_item_id = eg.grade_item_id @@ -54,4 +55,23 @@ + + + + select sum(round(et.weight*eg.weight/100,2)) + from evaluation_tasks et, + evaluation_grades eg, + cr_items cri1, + cr_items cri2, + acs_objects ao + where et.grade_item_id = eg.grade_item_id + and cri1.live_revision = eg.grade_id + and cri2.live_revision = et.task_id + and et.requires_grade_p = 't' + and ao.object_id = eg.grade_item_id + and ao.context_id = :package_id + + + + Index: openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet.adp 5 Aug 2004 00:32:56 -0000 1.4 +++ openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet.adp 11 Sep 2004 00:41:10 -0000 1.5 @@ -10,12 +10,13 @@
  • #evaluation-portlet.lt_There_are_no_tasks_to#
  • -
  • @grades.grade_plural_name@
    +
  • @grades.grade_plural_name;noquote@
    +

  • -
    #evaluation-portlet.lt_Your_total_grade_in_t# @total_class_grade@ +
    #evaluation-portlet.lt_Your_total_grade_in_t# @total_class_grade@/@max_possible_grade@
    Index: openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet.tcl 29 Aug 2004 22:25:42 -0000 1.5 +++ openacs-4/packages/evaluation-portlet/www/evaluation-evaluations-portlet.tcl 11 Sep 2004 00:41:10 -0000 1.6 @@ -35,7 +35,8 @@ } if { [string eq $one_instance_p 1] && [string eq $admin_p 0] } { - set total_class_grade [format %.2f [lc_numeric [db_string get_total_grade { *SQL* }]]] + set total_class_grade [lc_numeric [db_string get_total_grade { *SQL* }]] + set max_possible_grade [lc_numeric [db_string max_possible_grade { *SQL* }]] }