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.16.2.2 -r1.16.2.3 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 6 Dec 2004 16:43:04 -0000 1.16.2.2 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 8 Jun 2005 22:07:46 -0000 1.16.2.3 @@ -8,19 +8,28 @@ @author jopez@galileo.edu @creation-date Mar 2004 @cvs-id $Id$ + } { task_id:integer,notnull {show_portrait_p ""} {return_url "[ad_conn url]?[export_vars -url { task_id }]"} {orderby_wa:optional} {orderby_na:optional} {orderby:optional} + {grade_id ""} + {class "list"} + {bulk_actions ""} } +set simple_p [parameter::get -parameter "SimpleVersion" ] +if { $simple_p } { + set class "pbs_list" +} set user_id [ad_conn user_id] + db_1row get_task_info { *SQL* } set community_id [dotlrn_community::get_community_id] - +set max_grade $perfect_score set page_title "[_ evaluation.lt_Students_List_for_tas]" set context [list "[_ evaluation.lt_Students_List_for_tas]"] @@ -38,6 +47,8 @@ } else { set groups_admin "" } +set task_admin_url "[export_vars -base ../tasks/task-add-edit { task_id grade_id return_url }]" + set task_admin "[_ evaluation.lt_task_name_administrat]" set done_students [list] @@ -54,66 +65,86 @@ # working with already evaluated parties # -set actions [list "[_ evaluation.Edit_Evaluations_]" [export_vars -base "evaluations-edit" { task_id }]] +set actions "[_ evaluation.Edit_Evaluations_]" + +if { !$simple_p } { + set bulk_actions [list "[_ evaluation.Edit_Evaluations_]" [export_vars -base "evaluations-edit" { task_id }]] +} + set elements [list count \ [list label "" \ display_template { @evaluated_students.rownum@. } \ - ] \ + ] \ party_name \ - [list label "[_ evaluation.Name_]" \ + [list label "[_ evaluation.name]" \ orderby_asc {party_name asc} \ orderby_desc {party_name desc} \ - link_url_eval {[export_vars -base "one-evaluation-edit" { evaluation_id task_id evaluation_mode }]} \ + link_url_eval {[export_vars -base "one-evaluation-edit" { evaluation_id task_id grade_id evaluation_mode }]} \ link_html { title "[_ evaluation.View_evaluation_]" } \ ] \ - grade \ - [list label "[_ evaluation.Grade_over_100_]" \ - orderby_asc {grade asc} \ - orderby_desc {grade desc} \ - ] \ - action \ - [list label "" \ - display_template { @evaluated_students.action;noquote@ } \ - link_url_col action_url \ - ] \ ] - if { [string eq $online_p "t"] } { - lappend elements submission_date_pretty \ - [list label "[_ evaluation.Submission_Date_]" \ + lappend elements submitted \ + [list label "[_ evaluation.submitted]" \ display_template { @evaluated_students.submission_date_pretty;noquote@ }] } -lappend elements view \ - [list label "" \ - sub_class narrow \ - display_template {} \ - link_url_eval {[export_vars -base "one-evaluation-edit" { evaluation_id task_id evaluation_mode }]} \ - link_html { title "[_ evaluation.View_evaluation_]" } \ + + + +lappend elements grade \ + [list label "[_ evaluation.Grade_over_100_]" \ + orderby_asc {grade asc} \ + orderby_desc {grade desc} \ + ]\ + points \ + [list label "[_ evaluation.points]" \ + display_template {
@evaluated_students.points@
} \ + orderby_asc {grade asc} \ + orderby_desc {grade desc} \ + ] \ + action \ + [list label "[_ evaluation.Submission] " \ + display_template { @evaluated_students.action;noquote@} \ + ] \ + comments \ + [list label "[_ evaluation.Comments]" \ + display_template {
@evaluated_students.comments@
} \ + ]\ + +if { !$simple_p } { + lappend elements view \ + [list label "" \ + sub_class narrow \ + display_template {} \ + link_url_eval {[export_vars -base "one-evaluation-edit" { evaluation_id task_id evaluation_mode }]} \ + link_html { title "[_ evaluation.View_evaluation_]" } \ ] +} lappend elements edit \ [list label "" \ sub_class narrow \ - display_template {} \ + display_template {#evaluation.edit#} \ link_url_eval {[export_vars -base "one-evaluation-edit" { evaluation_id task_id }]} \ link_html { title "[_ evaluation.Edit_evaluation_]" } \ ] lappend elements delete \ [list label {} \ sub_class narrow \ - display_template {} \ + display_template {#evaluation.delete# } \ link_url_eval {[export_vars -base "evaluation-delete" { evaluation_id return_url task_id }]} \ link_html { title "[_ evaluation.Delete_evaluation_]" } \ ] - template::list::create \ -name evaluated_students \ -multirow evaluated_students \ - -actions $actions \ -key task_id \ - -pass_properties { return_url task_id evaluation_mode } \ + -actions $bulk_actions \ + -main_class $class \ + -sub_class narrow \ + -pass_properties { return_url task_id evaluation_mode simple_p} \ -filters { task_id {} } \ -orderby { default_value party_name } \ -elements $elements @@ -125,12 +156,18 @@ } set total_evaluated 0 -db_multirow -extend { action action_url submission_date_pretty count } evaluated_students evaluated_students { *SQL* } { +db_multirow -extend { action action_url submission_date_pretty count points} evaluated_students evaluated_students { *SQL* } { + incr total_evaluated lappend done_students $party_id - set grade [lc_numeric $grade] + + + set grade [format %0.2f $grade] + set points [format %0.2f [expr ([format %0.2f $grade]*[format %0.2f $perfect_score])/100.00]] + + if { [string eq $online_p "t"] } { if { [db_0or1row get_answer_info { *SQL* }] } { # working with answer stuff (if it has a file/url attached) @@ -142,19 +179,27 @@ } else { # we assume it's a file set action_url "[export_vars -base "../../view/$answer_title" { revision_id }]" - set action "[_ evaluation.View_answer_]" + set action "[_ evaluation.View_answer_]" } + if { [string eq $action "[_ evaluation.View_answer_]"] && ([db_string compare_evaluation_date { *SQL* } -default 0] ) } { - set action " [_ evaluation.View_NEW_answer_]" + set action " [_ evaluation.View_NEW_answer_]" } 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]" } } else { set action "[_ evaluation.No_response_]" + } } + if {[string eq $forums_related_p "t"]} { + + set action_url [export_vars -base "../../../forums/user-history" {{user_id $party_id} {view "forum"}}] + set action "[_ evaluation.view_post]" + } + } if { [llength $done_students] > 0 } { @@ -170,7 +215,7 @@ # set elements [list party_name \ - [list label "[_ evaluation.Name_]" \ + [list label "[_ evaluation.name]" \ orderby_asc {party_name asc} \ orderby_desc {party_name desc} \ link_url_col party_url \ @@ -185,31 +230,33 @@ } lappend elements submission_date_pretty \ - [list label "[_ evaluation.Submission_Date_]" \ + [list label "[_ evaluation.submitted]" \ display_template { @not_evaluated_wa.submission_date_pretty;noquote@ } \ orderby_asc {submission_date_ansi asc} \ orderby_desc {submission_date_ansi desc}] lappend elements answer \ - [list label "[_ evaluation.Answer_]" \ - link_url_col answer_url \ - link_html { title "[_ evaluation.View_answer_]" }] + [list label "[_ evaluation.answer]" \ + display_template {@not_evaluated_wa.answer@} \ + link_html { title "[_ evaluation.View_answer_]"}] lappend elements grade \ - [list label "[_ evaluation.Maximun_Grade_] " \ - display_template { } ] + [list label "[_ evaluation.Grade] <\/if>" \ + display_template {

$max_grade max
} ] lappend elements comments \ - [list label "[_ evaluation.Comments_]" \ + [list label "[_ evaluation.Comments]" \ display_template { } \ ] lappend elements show_answer \ - [list label "[_ evaluation.lt_Allow_the_students_br]" \ + [list label "[_ evaluation.see_grades]" \ display_template {
[_ evaluation.Yes_] [_ evaluation.No_]
} \ ] template::list::create \ -name not_evaluated_wa \ -multirow not_evaluated_wa \ -key party_id \ - -pass_properties { task_id return_url } \ + -main_class $class \ + -sub_class narrow \ + -pass_properties { task_id return_url simple_p} \ -filters { task_id {} } \ -orderby_name orderby_wa \ -elements $elements @@ -239,22 +286,29 @@ if { [db_string compare_submission_date { *SQL* } -default 0] } { set submission_date_pretty "[_ evaluation.lt_submission_date_prett_1]" } + if { $online_p } { 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 }] } + if {[string eq $forums_related_p "t"]} { + set answer "[_ evaluation.view_post]" + set answer_url [export_vars -base "../../../forums/user-history" {{user_id $party_id} {view "forum"}}] + } + } # # working with students that have not answered and have not been yet evaluated and do not have submited their answers # set elements [list party_name \ - [list label "[_ evaluation.Name_]" \ + [list label "[_ evaluation.name]" \ orderby_asc {party_name asc} \ orderby_desc {party_name desc} \ link_url_col party_url \ @@ -267,24 +321,32 @@ display_template { @not_evaluated_na.portrait;noquote@ } ] } +if {[string eq $forums_related_p "t"] && $number_of_members <= 1} { + lappend elements answer \ + [list label "[_ evaluation.answer]" \ + display_template {[_ evaluation.view_post]} + ] +} lappend elements grade \ - [list label "[_ evaluation.Grade_over_] " \ - display_template { } ] + [list label "[_ evaluation.Grade] <\/if>" \ + display_template {

$max_grade max.
}] lappend elements comments \ - [list label "[_ evaluation.Comments_]" \ + [list label "[_ evaluation.Comments]" \ display_template { } \ ] lappend elements show_answer \ - [list label "[_ evaluation.lt_Allow_the_students_br]" \ + [list label "[_ evaluation.see_grades]" \ display_template {
[_ evaluation.Yes_] [_ evaluation.No_]
} \ ] template::list::create \ -name not_evaluated_na \ -multirow not_evaluated_na \ -key party_id \ - -pass_properties { task_id return_url } \ + -main_class $class \ + -sub_class narrow \ + -pass_properties { task_id return_url simple_p} \ -filters { task_id {} } \ -orderby_name orderby_na \ -elements $elements @@ -322,7 +384,8 @@ set not_evaluated_with_no_answer 0 db_multirow -extend { party_url portrait } not_evaluated_na get_not_evaluated_na_students { *SQL* } { - + + incr not_evaluated_with_no_answer if { $number_of_members == 1 } { set tag_attributes [ns_set create] @@ -339,6 +402,102 @@ set grades_sheet_item_id [db_nextval acs_object_id_seq] +# +# Working with all student when forum_related_p eq t +# +set elements [list party_name \ + [list label "[_ evaluation.name]" \ + orderby_asc {party_name asc} \ + orderby_desc {party_name desc} \ + link_url_col party_url \ + ] \ + ] +if { [string eq $show_portrait_p "t"] && [string eq $number_of_members "1"] } { + lappend elements portrait \ + [list label "[_ evaluation.Students_Portrait_]" \ + display_template { @class_students.portrait;noquote@ } + ] +} +if {[string eq $forums_related_p "t"] && $number_of_members <= 1} { + lappend elements answer \ + [list label "[_ evaluation.answer]" \ + display_template {[_ evaluation.view_post]} + ] +} + +lappend elements grade \ + [list label "[_ evaluation.Grade] <\/if>" \ + display_template {

$max_grade max.
}] +lappend elements comments \ + [list label "[_ evaluation.Comments]" \ + display_template { } \ + ] +lappend elements show_answer \ + [list label "[_ evaluation.see_grades]" \ + display_template {
[_ evaluation.Yes_] [_ evaluation.No_]
} \ + ] + +template::list::create \ + -name class_students \ + -multirow class_students \ + -key party_id \ + -main_class $class \ + -sub_class narrow \ + -pass_properties { task_id return_url simple_p} \ + -filters { task_id {} } \ + -orderby_name orderby_cs \ + -elements $elements + +set orderby_cs [template::list::orderby_clause -orderby -name class_students] + +if { [string equal $orderby_cs ""] } { + set orderby_cs " order by party_name asc" +} + +if { $number_of_members > 1 } { + if { [llength $done_students] > 0 } { + set not_in_clause [db_map not_in_clause] + } else { + set not_in_clause "" + } + set sql_query [db_map sql_query_groups] +} else { + if { [llength $done_students] > 0 } { + set not_in_clause [db_map not_yet_in_clause_non_empty] + } else { + 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 + + if { [empty_string_p $community_id] } { + set sql_query [db_map sql_query_individual] + } else { + set sql_query [db_map sql_query_community_individual] + } + +} + +set students 0 + +db_multirow -extend { party_url portrait } class_students class_students { *SQL* } { + + + incr students + if { $number_of_members == 1 } { + set tag_attributes [ns_set create] + ns_set put $tag_attributes alt "[_ evaluation.lt_No_portrait_for_party]" + ns_set put $tag_attributes width 98 + ns_set put $tag_attributes height 104 + set portrait "[evaluation::get_user_portrait -user_id $party_id -tag_attributes $tag_attributes]" + } else { + set party_url "../groups/one-task?[export_vars -url { task_id return_url }]#groups" + } +} + +set total_processed [llength $done_students] + +set grades_sheet_item_id [db_nextval acs_object_id_seq]