Index: openacs-4/packages/evaluation/www/evaluation-view-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/evaluation-view-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/evaluation/www/evaluation-view-postgresql.xql 20 Sep 2004 18:16:49 -0000 1.1 @@ -0,0 +1,88 @@ + + + + postgresql7.3 + + + + + select ese.grade, + ese.party_id, + et.weight as task_weight, + et.task_id, + et.task_item_id, + to_char(et.due_date, 'YYYY-MM-DD HH24:MI:SS') as due_date_ansi, + et.due_date, + et.task_name, + eg.grade_name, + eg.grade_plural_name, + eg.weight as grade_weight, + (et.weight*eg.weight*ese.grade/10000) as net_grade, + et.number_of_members, + coalesce(person__name(ese.modifying_user),person__name(creation_user)) as grader, + to_char(ese.last_modified, 'YYYY-MM-DD HH24:MI:SS') as evaluation_date_ansi, + ese.description as comments + from evaluation_student_evalsi ese, + evaluation_tasks et, + evaluation_grades eg, + cr_items cri1, cr_items cri2 + where ese.evaluation_id = :evaluation_id + and ese.task_item_id = et.task_item_id + and et.grade_item_id = eg.grade_item_id + and cri1.live_revision = et.task_id + and cri2.live_revision = eg.grade_id + + + + + + + + select ea.data as answer_data, + ea.title as answer_title, + ea.revision_id as answer_revision_id, + to_char(ea.creation_date, 'YYYY-MM-DD HH24:MI:SS') as submission_date_ansi, + ea.last_modified as submission_date, + coalesce(person__name(modifying_user),person__name(creation_user)) as answer_owner + from evaluation_answersi ea, cr_items cri + where ea.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :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 = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = :task_id + ) + and ea.task_item_id = :task_item_id + and cri.live_revision = ea.answer_id + + + + + + + + select acs_group__name(:party_id) as group_name + + + + + + + + select person__name(map.object_id_two) as member_name + from acs_rels map + where map.object_id_one = :party_id + + + + + Index: openacs-4/packages/evaluation/www/evaluation-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/evaluation-view.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/evaluation/www/evaluation-view.adp 20 Sep 2004 18:16:49 -0000 1.1 @@ -0,0 +1,11 @@ + +@page_title;noquote@ +@context;noquote@ + +

+ + +

#evaluation.Go_Back#

+
+ + Index: openacs-4/packages/evaluation/www/evaluation-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/evaluation-view.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/evaluation/www/evaluation-view.tcl 20 Sep 2004 18:16:49 -0000 1.1 @@ -0,0 +1,138 @@ +# /packages/evaluation/www/evaluationk-view.tcl + +ad_page_contract { + Page for viewing evaluations. + + @author jopez@galileo.edu + @creation-date Sept 2004 + @cvs-id $Id: evaluation-view.tcl,v 1.1 2004/09/20 18:16:49 josee Exp $ +} { + evaluation_id:integer,notnull + {return_url ""} +} + +set page_title "[_ evaluation.View_Evaluation]" +set context [list $page_title] +set user_id [ad_conn user_id] + +db_1row get_evaluation_info { *SQL* } + +ad_form -name evaluation -has_submit 1 -has_edit 1 -mode display -form { + + evaluation_id:key + + {task_name:text + {label "[_ evaluation.Task_Name_1]"} + {html {size 30}} + {value $task_name} + } + +} + +set answer_data "" +db_0or1row get_answer_info { *SQL* } + +set due_date [template::util::date::from_ansi $due_date_ansi] +set evaluation_date [template::util::date::from_ansi $evaluation_date_ansi] +set task_weight [format %.2f [lc_numeric $task_weight]] +set grade_weight [format %.2f [lc_numeric $grade_weight]] +set net_grade [format %.2f [lc_numeric $net_grade]] + +if { ![empty_string_p $answer_data] } { + + if { [string eq $answer_title "link"] } { + set answer_url "$answer_data" + } else { + # we assume it's a file + set answer_url "$answer_title" + } + set answer_date [template::util::date::from_ansi $submission_date_ansi] + + ad_form -extend -name evaluation -form { + {task_file:text,optional + {label "[_ evaluation.Answer]"} + {html "size 30"} + {after_html "$answer_url"} + } + {answer_owner:text,optional + {label "[_ evaluation.Submitted_by]"} + {value $answer_owner} + } + {answer_date:date,to_sql(linear_date),from_sql(sql_date) + {label "[_ evaluation.Answer_Date]"} + {format "MONTH DD YYYY HH24 MI SS"} + {today} + {help} + {value $answer_date} + } + } +} + +if { $number_of_members > 1 } { + db_1row get_group_info { *SQL* } + ad_form -extend -name evaluation -form { + {group_name:text,optional + {label "[_ evaluation.Group_Name]"} + {value $group_name} + } + } + set members [list] + db_foreach group_members { *SQL* } { + lappend members [list "$member_name" {}] + } + ad_form -extend -name evaluation -form { + {group_members:text(radio),optional + {label "[_ evaluation.Group_Members]"} + {options $members} + } + } + +} + +ad_form -extend -name evaluation -form { + + {grade:text,optional + {label "[_ evaluation.Grade_2]"} + {value $grade} + } + {task_weight:text + {label "[_ evaluation.lt_Weight_of_this_grade_]"} + {value ${task_weight}%} + } + {grade_weight:text + {label "[_ evaluation.lt_Weight_of_grade_plura]"} + {value ${grade_weight}%} + } + {net_grade:text,optional + {label "[_ evaluation.Net_Grade]"} + {value $net_grade} + } + {grader:text,optional + {label "[_ evaluation.Grader]"} + {value $grader} + } + {comments:text(textarea) + {label "[_ evaluation.Comments_1]"} + {html {rows 4 cols 40 wrap soft}} + {value $comments} + } + {evaluation_date:date,to_sql(linear_date),from_sql(sql_date) + {label "[_ evaluation.Evaluation_Date]"} + {format "MONTH DD YYYY HH24 MI SS"} + {today} + {help} + {value $evaluation_date} + } + + {due_date:date,to_sql(linear_date),from_sql(sql_date) + {label "[_ evaluation.lt_Due_Date_of_task_name]"} + {format "MONTH DD YYYY HH24 MI SS"} + {today} + {help} + {value $due_date} + } +} + +ad_return_template + + Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.xql 20 Sep 2004 18:16:49 -0000 1.1 @@ -0,0 +1,53 @@ + + + + + + + + + select calendar_id + from calendars + where private_p = 'f' and package_id = :community_package_id + + + + + + + + select cal_item_id + from evaluation_cal_task_map + where task_item_id = :item_id + + + + + + + + update cr_revisions + set content = :filename, + mime_type = :mime_type, + content_length = :content_length + where revision_id = :revision_id + + + + + + + + insert into evaluation_cal_task_map ( + task_item_id, + cal_item_id + ) values + ( + :item_id, + :cal_item_id + ) + + + + +