Index: openacs-4/packages/evaluation/lib/student-grades-report-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/student-grades-report-chunk-postgresql.xql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/evaluation/lib/student-grades-report-chunk-postgresql.xql 4 Aug 2004 22:57:18 -0000 1.4 +++ openacs-4/packages/evaluation/lib/student-grades-report-chunk-postgresql.xql 13 Aug 2004 17:09:53 -0000 1.5 @@ -23,7 +23,6 @@ (et.weight*eg.weight)/100 as task_weight, et.number_of_members, to_char(et.due_date, 'YYYY-MM-DD HH24:MI:SS') as due_date_ansi, - et.task_id, et.online_p from evaluation_grades eg, evaluation_tasks et Index: openacs-4/packages/evaluation/sql/postgresql/evaluation-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/sql/postgresql/evaluation-create.sql,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/evaluation/sql/postgresql/evaluation-create.sql 10 Aug 2004 01:08:51 -0000 1.12 +++ openacs-4/packages/evaluation/sql/postgresql/evaluation-create.sql 13 Aug 2004 17:09:54 -0000 1.13 @@ -920,10 +920,12 @@ select (ese.grade*et.weight*eg.weight)/10000 into v_grade from evaluation_student_evals ese, evaluation_tasks et, evaluation_grades eg - where party_id = evaluation__party_id(p_user_id, ese.task_id) - and ese.task_id = p_task_id - and ese.task_id = et.task_id - and et.grade_id = eg.grade_id; + where party_id = evaluation__party_id(p_user_id, et.task_id) + and et.task_id = p_task_id + and ese.task_item_id = et.task_item_id + and et.grade_item_id = eg.grade_item_id + and content_revision__is_live(eg.grade_id) = true + and content_revision__is_live(et.task_id) = true; if v_grade is null then return 0.00; @@ -948,10 +950,10 @@ FOR v_grades_cursor IN select (ese.grade*et.weight*eg.weight)/10000 as grade from evaluation_grades eg, evaluation_tasks et, evaluation_student_evalsi ese - where et.task_id = ese.task_id - and et.grade_id = eg.grade_id - and et.grade_id = p_grade_id - and ese.party_id = evaluation__party_id(p_user_id,ese.task_id) + where et.task_item_id = ese.task_item_id + and et.grade_item_id = eg.grade_item_id + and eg.grade_id = p_grade_id + and ese.party_id = evaluation__party_id(p_user_id,et.task_id) and content_revision__is_live(ese.evaluation_id) = true and content_revision__is_live(et.task_id) = true LOOP @@ -1214,7 +1216,7 @@ FOR v_item_cursor IN select etg.group_id from evaluation_tasks et, evaluation_task_groups etg - where etg.task_id = et.task_id + where etg.task_item_id = et.task_item_id LOOP PERFORM evaluation__delete_evaluation_task_group(v_item_cursor.group_id); END LOOP; @@ -1334,7 +1336,7 @@ select etg.group_id from evaluation_tasksi et, acs_objects ao, evaluation_task_groups etg where et.item_id = ao.object_id - and etg.task_id = et.task_id + and etg.task_item_id = et.task_item_id and ao.context_id = p_package_id LOOP PERFORM evaluation__delete_evaluation_task_group(v_item_cursor.group_id); Index: openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql 30 Jul 2004 22:50:08 -0000 1.13 +++ openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql 13 Aug 2004 17:09:54 -0000 1.14 @@ -845,19 +845,19 @@ - select evaluation__party_name(ea.party_id, ea.task_id) as party_name, + select evaluation__party_name(ea.party_id, et.task_id) as party_name, ea.title as answer_title, ea.revision_id, cri.storage_type from evaluation_answersi ea, evaluation_tasks et, cr_items cri - where ea.task_id = et.task_id + where ea.task_item_id = et.task_item_id and ea.item_id = cri.item_id and et.task_id = :task_id and ea.data is not null and content_revision__is_live(ea.answer_id) = true - and not exists (select 1 from evaluation_student_evals ese where ese.party_id = ea.party_id and ese.task_id = :task_id and content_revision__is_live(ese.evaluation_id) = true) + and not exists (select 1 from evaluation_student_evals ese where ese.party_id = ea.party_id and ese.task_item_id = et.task_item_id and content_revision__is_live(ese.evaluation_id) = true) 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 -N -r1.7 -r1.8 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl 30 Jul 2004 22:50:10 -0000 1.7 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl 13 Aug 2004 17:09:55 -0000 1.8 @@ -196,7 +196,7 @@ if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { # new file? - if { [db_string grades_wa_new "select count(*) from evaluation_student_evals ese, evaluation_tasks est where ese.party_id = :party_id and ese.task_item_id = :task_item_id and content_revision__is_live(ese.evaluation_id) = true and est.task_id = :task_id and est.task_item_id = ese.task_item_id"] } { + if { [db_string grades_wa_new { *SQL* }] } { set new_item_p 0 } else { set new_item_p 1 @@ -220,7 +220,7 @@ } if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { # new file? - if { [db_string grades_na_new "select count(*) from evaluation_student_evals ese, evaluation_tasks est where ese.party_id = :party_id and ese.task_item_id = :task_item_id and content_revision__is_live(ese.evaluation_id) = true and ese.task_item_id = est.task_item_id and est.task_id = :task_id"] } { + if { [db_string grades_na_new { *SQL* }] } { set new_item_p 0 } else { set new_item_p 1 Index: openacs-4/packages/evaluation/www/admin/grades/grades-type-reports-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-type-reports-postgresql.xql,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/evaluation/www/admin/grades/grades-type-reports-postgresql.xql 7 Jul 2004 17:26:45 -0000 1.6 +++ openacs-4/packages/evaluation/www/admin/grades/grades-type-reports-postgresql.xql 13 Aug 2004 17:09:55 -0000 1.7 @@ -7,9 +7,10 @@ select et.task_id, et.task_name, et.weight - from evaluation_tasksi et + from evaluation_tasksi et, evaluation_grades eg where content_revision__is_live(et.task_id) = true - and et.grade_id = :grade_id + and eg.grade_id = :grade_id + and eg.grade_item_id = et.grade_item_id order by task_name