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 -r1.3 -r1.4 --- openacs-4/packages/evaluation/lib/student-grades-report-chunk-postgresql.xql 4 Aug 2004 21:57:45 -0000 1.3 +++ openacs-4/packages/evaluation/lib/student-grades-report-chunk-postgresql.xql 4 Aug 2004 22:57:18 -0000 1.4 @@ -3,60 +3,6 @@ postgresql7.3 - - - - select et.task_name, et.number_of_members, et.task_id, - to_char(et.due_date, 'YYYY-MM-DD HH24:MI:SS') as due_date_ansi, - et.online_p, - et.late_submit_p, - et.item_id, - et.requires_grade_p, et.description, et.grade_item_id, - cr.content_length, - et.data as task_data, - et.title as task_title, - et.task_id as revision_id, - ets.solution_id as solution_id - from cr_revisions cr, evaluation_grades eg, - evaluation_tasksi et left outer join evaluation_tasks_solsi ets on (ets.task_id = et.task_id and content_revision__is_live(ets.solution_id) = true) - where cr.revision_id = et.revision_id - and et.grade_item_id = eg.grade_item_id - and eg.grade_id = :grade_id - and content_revision__is_live(et.task_id) = true - $assignments_orderby - - - - - - - - select et.task_name, et.number_of_members, et.task_id, - to_char(et.due_date, 'YYYY-MM-DD HH24:MI:SS') as due_date_ansi, -` et.online_p, - et.late_submit_p, - et.item_id, - et.due_date, - et.requires_grade_p, - et.description, - et.grade_item_id, - et.title as task_title, - et.data as task_data, - et.task_id as revision_id, - cr.content_length, - ea.answer_id as answer_id - from cr_revisions cr, evaluation_grades eg, - evaluation_tasksi et left outer join evaluation_answersi ea on (ea.task_id = et.task_id and content_revision__is_live(ea.answer_id) = true - and ea.party_id = evaluation__party_id(:user_id,et.task_id)) - where cr.revision_id = et.revision_id - and et.grade_item_id = eg.grade_item_id - and eg.grade_id = :grade_id - and content_revision__is_live(et.task_id) = true - $assignments_orderby - - - - @@ -70,27 +16,19 @@ select et.task_name, - ese.grade, - ese.description as comments, + et.task_item_id, + eg.weight as grade_weight, + et.task_id, + et.weight as task_weight, (et.weight*eg.weight)/100 as task_weight, - (ese.grade*et.weight*eg.weight)/10000 as net_grade, 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, - ea.answer_id, - person__name(ese.creation_user) as grader_name + et.online_p from evaluation_grades eg, - evaluation_tasks et2 left outer join evaluation_student_evalsi ese on (ese.task_item_id = et2.task_item_id - and content_revision__is_live(ese.evaluation_id) = true - and content_revision__is_live(et2.task_id) = true - and ese.party_id = evaluation__party_id(:student_id,et2.task_id)), - evaluation_tasks et left outer join evaluation_answersi ea on (ea.task_item_id = et.task_item_id - and content_revision__is_live(ea.answer_id) = true - and ea.party_id = evaluation__party_id(:student_id,et.task_id)) + evaluation_tasks et where eg.grade_id = :grade_id and eg.grade_item_id = et.grade_item_id - and et.task_id = et2.task_id and content_revision__is_live(et.task_id) = true and content_revision__is_live(eg.grade_id) = true @@ -105,4 +43,35 @@ + + + + select ea.answer_id + from evaluation_answersi ea, + evaluation_tasks et + where content_revision__is_live(ea.answer_id) = true + and ea.party_id = evaluation__party_id(:student_id,:task_id) + and ea.task_item_id = et.task_item_id + and et.task_id = :task_id + + + + + + + + select ese.grade, + ese.description as comments, + (ese.grade*:task_weight*:grade_weight)/10000 as net_grade, + person__name(ese.creation_user) as grader_name + from evaluation_student_evalsi ese, + evaluation_tasks et + where ese.task_item_id = et.task_item_id + and content_revision__is_live(ese.evaluation_id) = true + and ese.party_id = evaluation__party_id(:student_id,:task_id) + and et.task_id = :task_id + + + + 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.1 -r1.2 --- openacs-4/packages/evaluation/lib/student-grades-report-chunk.tcl 15 Jun 2004 23:20:29 -0000 1.1 +++ openacs-4/packages/evaluation/lib/student-grades-report-chunk.tcl 4 Aug 2004 22:57:18 -0000 1.2 @@ -69,7 +69,7 @@ set max_grade 0.00 set total_grade 0.00 -db_multirow -extend { task_status due_date_pretty assignment_group } student_grades get_student_grades { *SQL* } { +db_multirow -extend { task_status due_date_pretty assignment_group grade net_grade grader_name comments } student_grades get_student_grades { *SQL* } { set due_date_pretty [lc_time_fmt $due_date_ansi "%q"] @@ -78,21 +78,25 @@ } else { set online_p "[_ evaluation.No_]" } - - if { [empty_string_p $comments] } { - set comments "[_ evaluation.na_]" - } set over_weight "" set task_status "" - - # working with answer stuff (if it has a file/url attached) + + # working with answer stuff (if it has a file/url attached) + set answer_id "" + db_0or1row get_answer_data { *SQL* } + if { [empty_string_p $answer_id] } { append task_status " [_ evaluation.Not_answered_] " } else { append task_status " [_ evaluation.Already_answered_] " } + # working with grade stuff (if there is any) + set grade "" + set comments "" + db_0or1row get_grade_info { *SQL* } + if { ![empty_string_p $grade] } { set grade [format %.2f [lc_numeric $grade]] set over_weight "[format %.2f [lc_numeric $net_grade]]/" @@ -106,6 +110,10 @@ append task_status " [_ evaluation.Not_evaluated_] " } + if { [empty_string_p $comments] } { + set comments "[_ evaluation.na_]" + } + set max_grade [expr $task_weight + $max_grade] set task_weight "${over_weight}[format %.2f [lc_numeric $task_weight]]"