@@ -30,6 +31,7 @@ @export_vars;noquote@ +
@@ -54,6 +56,7 @@ @export_vars;noquote@ + -
Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl 12 Aug 2004 17:46:42 -0000 1.4 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl 10 Sep 2004 19:16:31 -0000 1.5 @@ -7,118 +7,121 @@ @creation-date Mar 2004 @cvs-id $Id$ } { - task_id:integer,notnull - max_grade:integer,notnull - item_ids:array,integer,optional - item_to_edit_ids:array,integer,optional - - grades:array,optional - reasons:array,optional - show_student:array,optional - evaluation_ids:array,integer,optional + task_id:integer,notnull + max_grade:integer,notnull + item_ids:array,integer,optional + item_to_edit_ids:array,integer,optional + + grades:array,optional + reasons:array,optional + show_student:array,optional + evaluation_ids:array,integer,optional - grades_wa:array,optional - comments_wa:array,optional - show_student_wa:array,optional + grades_wa:array,optional + comments_wa:array,optional + show_student_wa:array,optional - grades_na:array,optional - comments_na:array,optional - show_student_na:array,optional + grades_na:array,optional + comments_na:array,optional + show_student_na:array,optional - {grade_all ""} + {grade_all ""} } -validate { - valid_grades_wa { - set counter 0 - foreach party_id [array names grades_wa] { - if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { - incr counter - if { ![ad_var_type_check_number_p $grades_wa($party_id)] } { - set wrong_grade $grades_wa($party_id) - ad_complain "[_ evaluation.lt_The_grade_must_be_a_v]" - } - } + valid_grades_wa { + set counter 0 + foreach party_id [array names grades_wa] { + if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { + incr counter + if { ![ad_var_type_check_number_p $grades_wa($party_id)] } { + set wrong_grade $grades_wa($party_id) + ad_complain "[_ evaluation.lt_The_grade_must_be_a_v]" } - if { !$counter && ([array size show_student_wa] > 0)} { - ad_complain "[_ evaluation.lt_There_must_be_at_leas]" - } + } } - valid_grades_na { - set counter 0 - foreach party_id [array names grades_na] { - if { [empty_string_p $grade_all] } { - if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { - incr counter - if { ![ad_var_type_check_number_p $grades_na($party_id)] } { - set wrong_grade $grades_na($party_id) - ad_complain "[_ evaluation.lt_The_grade_must_be_a_v]" - } - } - } else { - set grades_na($party_id) 0 - } - } - if { !$counter && ([array size show_student_na] > 0) && [empty_string_p $grade_all] } { - ad_complain "[_ evaluation.lt_There_must_be_at_leas]" - } + if { !$counter && ([array size show_student_wa] > 0) } { + ad_complain "[_ evaluation.lt_There_must_be_at_leas]" } - valid_grades { - set counter 0 - foreach party_id [array names grades] { - if { [info exists grades($party_id)] && ![empty_string_p $grades($party_id)] } { - if { ![ad_var_type_check_number_p $grades($party_id)] } { - set wrong_grade $grades($party_id) - ad_complain "[_ evaluation.lt_The_grade_most_be_a_v]" - } else { - set old_grade [format %.2f [lc_numeric [db_string get_old_grade { *SQL* }]]] - if { ![string eq $old_grade [format %.2f [lc_numeric $grades($party_id)]]] } { - incr counter - if { ![info exists reasons($party_id)] || [empty_string_p $reasons($party_id)] } { - set grade_wo_reason $grades($party_id) - ad_complain "[_ evaluation.lt_You_must_give_an_edit]" - } - set grades_to_edit($party_id) $grades($party_id) - set reasons_to_edit($party_id) $reasons($party_id) - set show_student_to_edit($party_id) $show_student($party_id) - } - } - } + } + valid_grades_na { + set counter 0 + foreach party_id [array names grades_na] { + if { [empty_string_p $grade_all] } { + if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { + incr counter + if { ![ad_var_type_check_number_p $grades_na($party_id)] } { + set wrong_grade $grades_na($party_id) + ad_complain "[_ evaluation.lt_The_grade_must_be_a_v]" + } } - if { !$counter && ([array size show_student] > 0) } { - ad_complain "[_ evaluation.lt_There_must_be_at_leas]" - } + } else { + set grades_na($party_id) 0 + } } - valid_data { - foreach party_id [array names comments_wa] { - if { [info exists comments_wa($party_id)] && ![info exists grades_wa($party_id)] } { - set wrong_comments $comments_wa($party_id) - ad_complain "[_ evaluation.lt_There_is_a_comment_fo]" + if { !$counter && ([array size show_student_na] > 0) && [empty_string_p $grade_all] } { + ad_complain "[_ evaluation.lt_There_must_be_at_leas]" + } + } + valid_grades { + set counter 0 + foreach party_id [array names grades] { + if { [info exists grades($party_id)] && ![empty_string_p $grades($party_id)] } { + if { ![ad_var_type_check_number_p $grades($party_id)] } { + set wrong_grade $grades($party_id) + ad_complain "[_ evaluation.lt_The_grade_most_be_a_v]" + } else { + set old_grade [format %.2f [db_string get_old_grade { *SQL* }]] + if { ![string eq $old_grade [format %.2f [expr $grades($party_id)*100/$max_grade]]] } { + incr counter + if { $max_grade != 100 } { + append reasons($party_id) "[_ evaluation.Weight_change]" } - if { [info exists comments_wa($party_id)] && ([string length $comments_wa($party_id)] > 400) } { - set wrong_comments $comments_wa($party_id) - ad_complain "[_ evaluation.lt_There_is_a_comment_la_1]" + if { ![info exists reasons($party_id)] || [empty_string_p $reasons($party_id)] } { + set grade_wo_reason $grades($party_id) + ad_complain "[_ evaluation.lt_You_must_give_an_edit]" } + set grades_to_edit($party_id) $grades($party_id) + set reasons_to_edit($party_id) $reasons($party_id) + set show_student_to_edit($party_id) $show_student($party_id) + } } - foreach party_id [array names comments_na] { - if { [info exists comments_na($party_id)] && ![info exists grades_na($party_id)] } { - set wrong_comments $comments_na($party_id) - ad_complain "[_ evaluation.lt_There_is_a_comment_fo]" - } - if { [info exists comments_na($party_id)] && ([string length $comments_na($party_id)] > 400) } { - set wrong_comments $comments_na($party_id) - ad_complain "[_ evaluation.lt_There_is_a_comment_la]" - } - } - foreach party_id [array names reasons] { - if { [info exists reasons($party_id)] && ![info exists grades($party_id)] } { - set wrong_comments $reasons($party_id) - ad_complain "[_ evaluation.lt_There_is_an_edit_reas]" - } - if { [info exists reasons($party_id)] && ([string length $reasons($party_id)] > 400) } { - set wrong_comments $reasons($party_id) - ad_complain "[_ evaluation.lt_There_is_an_edit_reas_1]" - } - } + } } + if { !$counter && ([array size show_student] > 0) && ($max_grade == 100) } { + ad_complain "[_ evaluation.lt_There_must_be_at_leas]" + } + } + valid_data { + foreach party_id [array names comments_wa] { + if { [info exists comments_wa($party_id)] && ![info exists grades_wa($party_id)] } { + set wrong_comments $comments_wa($party_id) + ad_complain "[_ evaluation.lt_There_is_a_comment_fo]" + } + if { [info exists comments_wa($party_id)] && ([string length $comments_wa($party_id)] > 400) } { + set wrong_comments $comments_wa($party_id) + ad_complain "[_ evaluation.lt_There_is_a_comment_la_1]" + } + } + foreach party_id [array names comments_na] { + if { [info exists comments_na($party_id)] && ![info exists grades_na($party_id)] } { + set wrong_comments $comments_na($party_id) + ad_complain "[_ evaluation.lt_There_is_a_comment_fo]" + } + if { [info exists comments_na($party_id)] && ([string length $comments_na($party_id)] > 400) } { + set wrong_comments $comments_na($party_id) + ad_complain "[_ evaluation.lt_There_is_a_comment_la]" + } + } + foreach party_id [array names reasons] { + if { [info exists reasons($party_id)] && ![info exists grades($party_id)] } { + set wrong_comments $reasons($party_id) + ad_complain "[_ evaluation.lt_There_is_an_edit_reas]" + } + if { [info exists reasons($party_id)] && ([string length $reasons($party_id)] > 400) } { + set wrong_comments $reasons($party_id) + ad_complain "[_ evaluation.lt_There_is_an_edit_reas_1]" + } + } + } } set page_title "[_ evaluation.lt_Confirm_Your_Evaluati]" @@ -131,20 +134,20 @@ # if the structure of the multirow datasource ever changes, this needs to be rewritten set counter 0 foreach party_id [array names show_student_wa] { - if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { - incr counter - set party_name [db_string get_party_name { *SQL* }] - set evaluations_wa:${counter}(rownum) $counter - set evaluations_wa:${counter}(party_name) $party_name - set evaluations_wa:${counter}(grade) $grades_wa($party_id) - set evaluations_wa:${counter}(comment) $comments_wa($party_id) - if { [string eq $show_student_wa($party_id) "t"] } { - set evaluations_wa:${counter}(show_student) "[_ evaluation.Yes_]" - } else { - set evaluations_wa:${counter}(show_student) "[_ evaluation.No_]" - } - set item_ids($party_id) [db_nextval acs_object_id_seq] + if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { + incr counter + set party_name [db_string get_party_name { *SQL* }] + set evaluations_wa:${counter}(rownum) $counter + set evaluations_wa:${counter}(party_name) $party_name + set evaluations_wa:${counter}(grade) $grades_wa($party_id) + set evaluations_wa:${counter}(comment) " $comments_wa($party_id)" + if { [string eq $show_student_wa($party_id) "t"] } { + set evaluations_wa:${counter}(show_student) "[_ evaluation.Yes_]" + } else { + set evaluations_wa:${counter}(show_student) "[_ evaluation.No_]" } + set item_ids($party_id) [db_nextval acs_object_id_seq] + } } set evaluations_wa:rowcount $counter @@ -154,20 +157,20 @@ # if the structure of the multirow datasource ever changes, this needs to be rewritten set counter 0 foreach party_id [array names show_student_na] { - if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { - incr counter - set party_name [db_string get_party_name { *SQL* }] - set evaluations_na:${counter}(rownum) $counter - set evaluations_na:${counter}(party_name) $party_name - set evaluations_na:${counter}(grade) $grades_na($party_id) - set evaluations_na:${counter}(comment) $comments_na($party_id) - if { [string eq $show_student_na($party_id) "t"] } { - set evaluations_na:${counter}(show_student) "[_ evaluation.Yes_]" - } else { - set evaluations_na:${counter}(show_student) "[_ evaluation.No_]" - } - set item_ids($party_id) [db_nextval acs_object_id_seq] + if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { + incr counter + set party_name [db_string get_party_name { *SQL* }] + set evaluations_na:${counter}(rownum) $counter + set evaluations_na:${counter}(party_name) $party_name + set evaluations_na:${counter}(grade) $grades_na($party_id) + set evaluations_na:${counter}(comment) " $comments_na($party_id)" + if { [string eq $show_student_na($party_id) "t"] } { + set evaluations_na:${counter}(show_student) "[_ evaluation.Yes_]" + } else { + set evaluations_na:${counter}(show_student) "[_ evaluation.No_]" } + set item_ids($party_id) [db_nextval acs_object_id_seq] + } } set evaluations_na:rowcount $counter @@ -177,19 +180,19 @@ # if the structure of the multirow datasource ever changes, this needs to be rewritten set counter 0 foreach party_id [array names show_student] { - if { [info exists grades_to_edit($party_id)] && ![empty_string_p $grades_to_edit($party_id)] } { - incr counter - set party_name [db_string get_party_name { *SQL* }] - set evaluations:${counter}(rownum) $counter - set evaluations:${counter}(party_name) $party_name - set evaluations:${counter}(grade) $grades_to_edit($party_id) - set evaluations:${counter}(reason) $reasons_to_edit($party_id) - if { [string eq $show_student_to_edit($party_id) "t"] } { - set evaluations:${counter}(show_student) "[_ evaluation.Yes_]" - } else { - set evaluations:${counter}(show_student) "[_ evaluation.No_]" - } + if { [info exists grades_to_edit($party_id)] && ![empty_string_p $grades_to_edit($party_id)] } { + incr counter + set party_name [db_string get_party_name { *SQL* }] + set evaluations:${counter}(rownum) $counter + set evaluations:${counter}(party_name) $party_name + set evaluations:${counter}(grade) $grades_to_edit($party_id) + set evaluations:${counter}(reason) $reasons_to_edit($party_id) + if { [string eq $show_student_to_edit($party_id) "t"] } { + set evaluations:${counter}(show_student) "[_ evaluation.Yes_]" + } else { + set evaluations:${counter}(show_student) "[_ evaluation.No_]" } + } } set evaluations:rowcount $counter Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit-postgresql.xql 12 Aug 2004 17:46:42 -0000 1.4 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit-postgresql.xql 10 Sep 2004 19:16:31 -0000 1.5 @@ -8,7 +8,7 @@ select evaluation__party_name(ese.party_id,et.task_id) as party_name, ese.party_id, - ese.grade, + round(ese.grade,2) as grade, ese.last_modified as evaluation_date, et.online_p, et.due_date, Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.adp 20 Aug 2004 01:11:17 -0000 1.5 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.adp 10 Sep 2004 19:16:31 -0000 1.6 @@ -3,16 +3,16 @@ -@context;noquote@ - + Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 24 Aug 2004 22:40:32 -0000 1.13 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 10 Sep 2004 19:16:31 -0000 1.14 @@ -18,23 +18,26 @@ } set user_id [ad_conn user_id] -set page_title "[_ evaluation.Student_List_]" -set context [list "[_ evaluation.Student_List_]"] +db_1row get_task_info { *SQL* } +set page_title "[_ evaluation.lt_Students_List_for_tas]" +set context [list "[_ evaluation.lt_Students_List_for_tas]"] + if { [string eq $show_portrait_p "t"] } { set this_url "student-list?[export_vars -entire_form -url { { show_portrait_p f } }]" } else { set this_url "student-list?[export_vars -entire_form -url { { show_portrait_p t } }]" } -db_1row get_task_info { *SQL* } set due_date_pretty [lc_time_fmt $due_date_ansi "%q %r"] +set return_url "[ad_conn url]?[ad_conn query]" if { $number_of_members > 1 } { set groups_admin "[_ evaluation.lt_Groups_administration]" } else { set groups_admin "" } +set task_admin "[_ evaluation.lt_task_name_administrat]" set done_students [list] set evaluation_mode "display" @@ -45,7 +48,11 @@ set actions [list "[_ evaluation.Edit_Evaluations_]" [export_vars -base "evaluations-edit" { task_id }]] -set elements [list party_name \ +set elements [list count \ + [list label "" \ + display_template { @evaluated_students.rownum@. } \ + ] \ + party_name \ [list label "[_ evaluation.Name_]" \ orderby_asc {party_name asc} \ orderby_desc {party_name desc} \ @@ -112,18 +119,18 @@ } set total_evaluated 0 -db_multirow -extend { action action_url submission_date_pretty } evaluated_students evaluated_students { *SQL* } { +db_multirow -extend { action action_url submission_date_pretty count } evaluated_students evaluated_students { *SQL* } { incr total_evaluated lappend done_students $party_id - set grade [format %.2f [lc_numeric $grade]] + set grade [lc_numeric $grade] if { [string eq $online_p "t"] } { if { [db_0or1row get_answer_info { *SQL* }] } { # working with answer stuff (if it has a file/url attached) if { [empty_string_p $answer_data] } { set action "[_ evaluation.No_response_]" - } elseif { [regexp "http://" $answer_data] } { + } elseif { [string eq $answer_title "link"] } { set action_url "[export_vars -base "$answer_data" { }]" set action "[_ evaluation.View_answer_]" } else { @@ -222,21 +229,18 @@ } lappend done_students $party_id - if { [string eq $online_p "t"] } { - set submission_date_pretty "[lc_time_fmt $submission_date_ansi "%q %r"]" - if { [db_string compare_submission_date { *SQL* } -default 0] } { - set submission_date_pretty "[_ evaluation.lt_submission_date_prett_1]" - } else { - } - set answer "[_ evaluation.View_answer_]" - # working with answer stuff (if it has a file/url attached) - if { [regexp "http://" $answer_data] } { - set answer_url [export_vars -base "$answer_data" { }] - } else { - # we assume it's a file - set answer_url [export_vars -base "../../view/$answer_title" { revision_id }] - } + set submission_date_pretty "[lc_time_fmt $submission_date_ansi "%q %r"]" + if { [db_string compare_submission_date { *SQL* } -default 0] } { + set submission_date_pretty "[_ evaluation.lt_submission_date_prett_1]" } + set answer "[_ evaluation.View_answer_]" + # working with answer stuff (if it has a file/url attached) + if { [string eq $answer_title "link"] } { + set answer_url [export_vars -base "$answer_data" { }] + } else { + # we assume it's a file + set answer_url [export_vars -base "../../view/$answer_title" { revision_id }] + } } # @@ -295,9 +299,9 @@ } else { set community_id [dotlrn_community::get_community_id] if { [llength $done_students] > 0 } { - set not_in_clause [db_map not_yet_in_clause] + set not_in_clause [db_map not_yet_in_clause_non_empty] } else { - set not_in_clause [db_map not_yet_in_clause] + set not_in_clause [db_map not_yet_in_clause_empty] } # if this page is called from within a community (dotlrn) we have to show only the students @@ -326,6 +330,8 @@ } } +set total_processed [llength $done_students] + set grades_sheet_item_id [db_nextval acs_object_id_seq] Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql 24 Aug 2004 22:40:32 -0000 1.8 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql 10 Sep 2004 19:16:31 -0000 1.9 @@ -27,13 +27,13 @@ - #evaluation.lt_There_are_no_students_1#
++ #evaluation.lt_task_name_is_in_group#
++ - where p.person_id not in ([join $done_students ","]) + , cc_users cu @@ -68,16 +68,18 @@ + select p.person_id as party_id, p.last_name||', '||p.first_names as party_name from persons p $not_in_clause - $orderby_na + + select app.user_id as party_id, p.last_name||', '||p.first_names as party_name from dotlrn_member_rels_approved app, @@ -86,14 +88,15 @@ and app.community_id = :community_id and app.user_id = p.person_id and app.role = 'student' - $orderby_na + Index: openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl 10 Jun 2004 21:08:54 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl 10 Sep 2004 19:16:32 -0000 1.3 @@ -9,22 +9,29 @@ } { grade_id:integer,notnull return_url - operation + operation } if { [string eq $operation "[_ evaluation.lt_Yes_I_really_want_to__1]"] } { db_transaction { - db_exec_plsql delete_grade { *SQL* } - + # calendar integration (begin) + db_foreach cal_map { *SQL* } { + db_dml delete_mapping { *SQL* } + calendar::item::delete -cal_item_id $cal_item_id + } + # calendar integration (end) + + db_exec_plsql delete_grade { *SQL* } + } on_error { - ad_return_error "[_ evaluation.lt_Error_deleting_the_gr]" "[_ evaluation.lt_We_got_the_following__1]" - ad_script_abort + ad_return_error "[_ evaluation.lt_Error_deleting_the_gr]" "[_ evaluation.lt_We_got_the_following__1]" + ad_script_abort } } else { if { [empty_string_p $return_url] } { - # redirect to the index page by default - set return_url "grades" + # redirect to the index page by default + set return_url "grades" } } Index: openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.xql 10 Sep 2004 19:16:32 -0000 1.1 @@ -0,0 +1,29 @@ + + + $sql_query + $orderby_na + + + Index: openacs-4/packages/evaluation/www/admin/grades/grades-reports-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-reports-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/evaluation/www/admin/grades/grades-reports-postgresql.xql 7 Jul 2004 17:26:45 -0000 1.7 +++ openacs-4/packages/evaluation/www/admin/grades/grades-reports-postgresql.xql 10 Sep 2004 19:16:32 -0000 1.8 @@ -7,9 +7,9 @@+ + ++ + select map.cal_item_id + from evaluation_tasks et, + evaluation_grades eg, + evaluation_cal_task_map map + where eg.grade_id = :grade_id + and et.grade_item_id = eg.grade_item_id + and et.task_item_id = map.task_item_id + + ++ + + ++ + delete from evaluation_cal_task_map where cal_item_id = :cal_item_id + + +select count(eg.grade_id) - from evaluation_gradesx eg, acs_objects ao - where content_revision__is_live(eg.grade_id) = true - 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 = [ad_conn package_id] @@ -21,9 +21,9 @@ select eg.grade_id, eg.grade_plural_name, eg.weight - from evaluation_gradesx eg, acs_objects ao - where content_revision__is_live(eg.grade_id) = true - 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 = :package_id order by grade_plural_name @@ -33,15 +33,67 @@- , [lc_numeric trunc(evaluation__grade_total_grade(cu.user_id,$grade_id),2)] as grade_$grade_id + , round((select coalesce((select sum((ese.grade*et.weight*eg.weight)/10000) + from evaluation_grades eg, evaluation_tasks et, evaluation_student_evals ese + where et.task_item_id = ese.task_item_id + and et.grade_item_id = eg.grade_item_id + and eg.grade_id = $grade_id + and ese.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN cu.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 = cu.user_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 = et.task_id) + and exists (select 1 from cr_items where live_revision = ese.evaluation_id)),0)),2) as grade_${grade_id} + +-- , [lc_numeric trunc(evaluation__grade_total_grade(cu.user_id,$grade_id),2)] as grade_$grade_id @@ -65,10 +117,8 @@ cu.user_id $sql_query from cc_users cu, - registered_users ru, dotlrn_member_rels_approved app where app.community_id = :community_id - and app.user_id = ru.user_id and app.user_id = cu.person_id and app.role = 'student' $orderby 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 -r1.7 -r1.8 --- openacs-4/packages/evaluation/www/admin/grades/grades-type-reports-postgresql.xql 13 Aug 2004 17:09:55 -0000 1.7 +++ openacs-4/packages/evaluation/www/admin/grades/grades-type-reports-postgresql.xql 10 Sep 2004 19:16:32 -0000 1.8 @@ -7,8 +7,8 @@ select et.task_id, et.task_name, et.weight - from evaluation_tasksi et, evaluation_grades eg - where content_revision__is_live(et.task_id) = true + from evaluation_tasksi et, evaluation_grades eg, cr_items cri + where cri.live_revision = et.task_id and eg.grade_id = :grade_id and eg.grade_item_id = et.grade_item_id order by task_name @@ -35,10 +35,8 @@ cu.user_id $sql_query from cc_users cu, - registered_users ru, dotlrn_member_rels_approved app where app.community_id = :community_id - and app.user_id = ru.user_id and app.user_id = cu.person_id and app.role = 'student' $orderby @@ -49,16 +47,67 @@ - , [lc_numeric trunc(evaluation__class_total_grade(cu.user_id,$package_id),2)] as total_grade + , round(coalesce((select sum(ese.grade*et.weight*eg.weight/10000) + from evaluation_grades eg, evaluation_tasks et, evaluation_student_evals ese, acs_objects ao, + cr_items cri1, cr_items cri2, cr_items cri3 + 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 cu.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 = cu.user_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 cri1.live_revision = eg.grade_id + and cri2.live_revision = et.task_id + and cri3.live_revision = ese.evaluation_id),0),2) as total_grade +-- , 1 as total_grade +-- , [lc_numeric trunc(evaluation__class_total_grade(cu.user_id,$package_id),2)] as total_grade - , [lc_numeric trunc(evaluation__task_grade(cu.user_id,$task_id),2)] as task_$task_id + , round((select coalesce((select (ese.grade*et.weight*eg.weight)/10000 + from evaluation_student_evals ese, evaluation_tasks et, evaluation_grades eg, + cr_items cri1, cr_items cri2 + where party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN cu.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 = cu.user_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.task_id = $task_id + and ese.task_item_id = et.task_item_id + and et.grade_item_id = eg.grade_item_id + and cri1.live_revision = ese.evaluation_id + and cri2.live_revision = eg.grade_id),0)),2) as task_${task_id} +-- , [lc_numeric trunc(evaluation__task_grade(cu.user_id,$task_id),2)] as task_$task_id + 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 @@ - , [lc_numeric trunc(evaluation__grade_total_grade(cu.user_id,:grade_id),2)] as total_grade + , round((select coalesce((select sum((ese.grade*et.weight*eg.weight)/10000) + from evaluation_grades eg, evaluation_tasks et, evaluation_student_evals ese + where et.task_item_id = ese.task_item_id + and et.grade_item_id = eg.grade_item_id + and eg.grade_id = $grade_id + and ese.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN cu.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 = cu.user_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 = et.task_id) + and exists (select 1 from cr_items where live_revision = ese.evaluation_id)),0)),2) as total_grade +-- , 1 as total_grade +-- , [lc_numeric trunc(evaluation__grade_total_grade(cu.user_id,:grade_id),2)] as total_grade + Index: openacs-4/packages/evaluation/www/admin/grades/student-grades-report.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/student-grades-report.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/evaluation/www/admin/grades/student-grades-report.adp 15 Jun 2004 23:20:29 -0000 1.1 +++ openacs-4/packages/evaluation/www/admin/grades/student-grades-report.adp 10 Sep 2004 19:16:32 -0000 1.2 @@ -20,7 +20,7 @@ - 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) + #evaluation.lt_TOTAL_GRADE_total_cla#
+#evaluation.lt_TOTAL_GRADE_total_cla# / @max_possible_grade@
Index: openacs-4/packages/evaluation/www/admin/grades/student-grades-report.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/student-grades-report.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/admin/grades/student-grades-report.tcl 24 Aug 2004 22:40:33 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/grades/student-grades-report.tcl 10 Sep 2004 19:16:32 -0000 1.3 @@ -29,5 +29,19 @@ } set total_class_grade [format %.2f [lc_numeric [db_string get_total_grade { *SQL* }]]] +set max_possible_grade [format %.2f [lc_numeric [db_string max_possible_grade { + select sum(et.weight*eg.weight/100) + 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 +}]]] ad_return_template Index: openacs-4/packages/evaluation/www/admin/groups/group-reuse-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-reuse-2-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/evaluation/www/admin/groups/group-reuse-2-postgresql.xql 30 Jul 2004 22:50:11 -0000 1.3 +++ openacs-4/packages/evaluation/www/admin/groups/group-reuse-2-postgresql.xql 10 Sep 2004 19:16:32 -0000 1.4 @@ -6,9 +6,11 @@+ - select count(*) - from evaluation_task_groups etg, evaluation_tasks et - where etg.task_item_id = et.task_item_id + select count(*) + from evaluation_task_groups etg, evaluation_tasks et, acs_rels map + where etg.task_item_id = et.task_item_id + and map.rel_type = 'evaluation_task_group_rel' + and map.object_id_one = etg.group_id and et.task_id = :task_id @@ -44,14 +46,23 @@ null, 'evaluation_task_group_rel', :new_evaluation_group_id, - map.object_id_two, + :new_member_id, :package_id, :creation_user_id, :creation_ip - ) - from acs_rels map where map.object_id_one = :from_evaluation_group_id; + );+ + Index: openacs-4/packages/evaluation/www/admin/groups/group-reuse-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-reuse-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/evaluation/www/admin/groups/group-reuse-2.tcl 30 Jul 2004 22:50:11 -0000 1.3 +++ openacs-4/packages/evaluation/www/admin/groups/group-reuse-2.tcl 10 Sep 2004 19:16:32 -0000 1.4 @@ -31,7 +31,9 @@ evaluation::new_evaluation_group -group_id $new_evaluation_group_id -group_name $group_name -task_item_id $task_item_id -context $package_id - db_exec_plsql evaluation_relationship_new { *SQL* } + db_foreach from_rel { *SQL* } { + db_exec_plsql evaluation_relationship_new { *SQL* } + } } } on_error { Index: openacs-4/packages/evaluation/www/admin/groups/group-reuse-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-reuse-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation/www/admin/groups/group-reuse-postgresql.xql 30 Jul 2004 22:50:11 -0000 1.4 +++ openacs-4/packages/evaluation/www/admin/groups/group-reuse-postgresql.xql 10 Sep 2004 19:16:32 -0000 1.5 @@ -9,12 +9,13 @@ select et.task_name, et.number_of_members, et.task_id as from_task_id, eg.grade_plural_name - from evaluation_tasksi et, evaluation_gradesi eg - where content_revision__is_live(et.task_id) = true - and et.number_of_members > 1 + from evaluation_tasks et, evaluation_grades eg, acs_objects ao, cr_items cri1, cr_items cri2 + where et.number_of_members > 1 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 + and cri1.live_revision = eg.grade_id + and cri2.live_revision = et.task_id + and ao.object_id = eg.grade_item_id + and ao.context_id = :package_id and et.task_id <> :task_id $orderby Index: openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl 10 Jun 2004 21:08:54 -0000 1.5 +++ openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl 10 Sep 2004 19:16:32 -0000 1.6 @@ -11,6 +11,7 @@ {orderby:optional} } +set package_id [ad_conn package_id] set page_title "[_ evaluation.Reuse_Groups_]" set context [list [list "[export_vars -base one-task { task_id }]" "[_ evaluation.Task_Groups_]"] "[_ evaluation.Reuse_Groups_]"] Index: openacs-4/packages/evaluation/www/admin/groups/one-task.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/one-task.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/evaluation/www/admin/groups/one-task.adp 30 Jul 2004 22:50:11 -0000 1.6 +++ openacs-4/packages/evaluation/www/admin/groups/one-task.adp 10 Sep 2004 19:16:32 -0000 1.7 @@ -15,7 +15,7 @@+ + select map.object_id_two as new_member_id + from acs_rels map + where map.object_id_one = :from_evaluation_group_id + + +@reuse_link;noquote@