Index: openacs-4/packages/evaluation/www/admin/grades/student-grades-report-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/student-grades-report-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/admin/grades/student-grades-report-postgresql.xql 7 Jul 2004 17:26:45 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/grades/student-grades-report-postgresql.xql 10 Sep 2004 19:16:32 -0000 1.3 @@ -8,8 +8,8 @@ select eg.grade_plural_name, eg.grade_id - from evaluation_gradesx eg, acs_objects ao - where content_revision__is_live(eg.grade_id) = true + from evaluation_gradesx eg, acs_objects ao, cr_items cri + where cri.live_revision = eg.grade_id and eg.item_id = ao.object_id and ao.context_id = :package_id order by grade_plural_name desc @@ -32,8 +32,35 @@ - select evaluation__class_total_grade(:student_id,:package_id) + select coalesce(sum((ese.grade*et.weight*eg.weight)/10000),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 + and eg.grade_item_id = ao.object_id + and ao.context_id = :package_id + and ese.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :student_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 = :student_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = et.task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = et.task_id + ) + and et.requires_grade_p = 't' + and exists (select 1 from cr_items where live_revision = eg.grade_id) + and exists (select 1 from cr_items where live_revision = et.task_id) + and exists (select 1 from cr_items where live_revision = ese.evaluation_id) +-- select evaluation__class_total_grade(:student_id,:package_id) +