Index: openacs-4/packages/evaluation/evaluation.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/evaluation.info,v diff -u -r1.18.2.1 -r1.18.2.2 --- openacs-4/packages/evaluation/evaluation.info 17 Nov 2004 23:58:06 -0000 1.18.2.1 +++ openacs-4/packages/evaluation/evaluation.info 8 Jun 2005 22:07:45 -0000 1.18.2.2 @@ -7,21 +7,22 @@ f f - + Jose Pablo Escobedo Del Cid This package allows the users (professors and students) to use the system to submit and grade the tasks. - 2004-10-26 + 2005-04-11 This package allows the professors and TAs to assign tasks to the students and to grade them, and to the students to upload their answers and see their grades. 0 - + - + + @@ -30,6 +31,7 @@ + - + 1 = Individual + Activities + Activities for students + + Activity Add Assignment Add Assignment Type Add assignment type @@ -14,10 +18,14 @@ Add/edit solution again Already answered - Answer + ANSWER + SUBMISSION Answer + Answer OK - Answer Date + How will the task be answered? + Answer Date <br> (24 hr format) + ANSWERS Assignment Group Assignment Groups Assignment Type @@ -78,9 +86,12 @@ <input type=submit value="<# Grade Students Bad input Change Answer + NOT EVALUATED STUDENTS + 'Not Evaluated Students' Click click on this link: - Comments: + Comment + COMMENTS Comments Comments Comments/Edit reason: @@ -89,52 +100,73 @@ Confirm Evaluation Group Create Group + CREATION DATE + Delete Delete Evaluation Delete evaluation Delete Group Delete Task Delete task Description + DESCRIPTION Description - Due Date: + Discussion + Discussions + Download + DUE DATE + Due Date: Due Date - Due date + Due Date Due Date + Leave blank for no due date. Due date: %task_name% Edit Grades + Edit + Edit All Evaluations Edit evaluation - Edit Evaluations + Edit All Evaluations Edit %grade_name% Edit Reason: Edit Reason Edit Task Edit task Email: + Equal value Evaluated - Evaluation Date + Evaluation Date <br>(24 hr format) Evaluation Index Evaluation Modified + Evaluation Parameter Class Material Evaluations Evaluations Evaluations Admin + Gradebook Evaluations List Exam Exams Exams for students File File/url associated + Final Project + Final Project + Associate with Forums + Associate with forums? + You can associate this task to a forum Generate file Back Go Back - Grade: + GRADE Grade - Students + Submit Grades Grade Grade Distribution - Grade in Net value - Grade over - Grade over 100 + Net Value + %max_grade% max. + GRADE OVER + GRADE %<br> +(OF 100%) + The %grade_plural_name% weight is 0% of total grade and will not impact the total grade. Grader Grader Grades @@ -173,7 +205,43 @@ you want to see the group members, click on the name of the group Individual Insert Failed + Instructions + <br><br> + +<ul> +<li><text class="blue"><b>Option 1.</b> If you want each %grade_name% to count the same toward the total +for %grade_plural_name% just click on <b>"Set to Default"</b>.</text> +<br> +<li><text class="blue"><b>Option 2.</b> You can tell the system what percentage each %grade_name% +should be towards the total for %grade_plural_name%. To do this put numbers in +the first column, the total will need to add up to 100%. Then click on +<b>"Submit"</b>.</text> +<br> +</ul> + + <h1 class="blue">How to set up grading:</h1> +<br> +<text class="blue"> +<b>Step 1:</b> Set the percentage you want each assignment type to count towards +the total grade. Currently you have <b>%grade_plural_name% as %grade_weight%%</b> of the +total grade.<a href="%link_1%">Change that here</a>. +</text> +<br> +<br> +<text class="blue"> +<b>Step 2:</b> Add specific tasks to the assignment type. Currently you have +%counter% %grade_plural_name% as shown in the table above.<a href=%link_2%>Click here to add another</a>. +</text> +<br><br> + +<text class="blue"> +<b>Step 3:</b> Determine how much each task contributes to the total grade. This +is referred to as the weight. You have three choices. +%options%</text> Is live? + Journal + Journals + Journals for students Last Modified late (late) @@ -182,7 +250,7 @@ Add a member to a group Add Assignment to Communities Add this %grade_name% to other class(es) - Admin Assignment Types + Modify an Assignment Type Admin my Assignment Types Allow the students <br> to see the grade? Already created groups @@ -195,9 +263,9 @@ Assignment Attachment Assignment Edited (%grade_name% %community_name%) Assignment Groups for %task_name% - Assignment Plural Type Name + Assignment Type Name (Plural) Assignment Type Name - Assignment Type's Comments + Comments Assignment Types Distribution %grade_name%'s Description Associate to this group @@ -213,16 +281,16 @@ Comment/edit reason on party_id %party_id% is larger than 4,000 characters long, which is our max lenght. Please make this comment/edit reason shorter. Confirm Your Evaluation Confirm your evaluation(s) on "%task_name%" - Currently $content is associated to this task solution, but you can associate a different url/file just by adding it here - Currently $content is associated to this task, but you can associate a different url/file just by adding it here - Currently $title is attached to this task solution, but you can attach a different file/url just by adding it here + Currently %content% is associated to this task solution, but you can associate a different url/file just by adding it here + Currently %content% is associated to this task, but you can associate a different url/file just by adding it here + Currently %title% is attached to this task solution, but you can attach a different file/url just by adding it here Currently $title is attached to this task, but you can attach a different file/url just by adding it here Delete Assignment Type Delete assignment type Distribution for grade "%grade_plural_name%" Do NOT change the "party id" field because with this file we associate the grade with the student or group. Due date must be in the future - Due Date of \"%task_name%\" + Due Date of %task_name% <br> (24 hr format) Edit Assignment Type Edit assignment type Edit grades distribution of $grade_plural_name @@ -232,31 +300,34 @@ Error deleting the grade Error deleting the task Error while storing file - Evaluated Students (%total_evaluated%) + GRADED (%total_evaluated%) Evaluation Modified %community_name% + Final Projects for students First unattach the file/url, then submit another one or just upload a new file/url and leave this in blank First, you will see the list of students without group (if there are students without group) and you can create a group by selecting the members of the group and then clicking on the "Create Group" botton. Generate the csv file from the system. This file has the proper structure so the system can parse it and obtain the information about the grades. This file is generated by clicking on the "Generate File" link. Grade %grade% does not seem to be a real number. - Grade over 100 points - %grade_plural_name% represents the %grade_weight%% of the 100% of the class + Grade (%) + %grade_plural_name% represent %grade_weight%% of the course grade + + %grade_plural_name% represents the %grade_weight%% of the 100% of the grade of the class. Grade students using generated file: Grade students using generated file: Grade students with 0 Grades Report for $student_name - Grades report of "%student_name%" + Grade report for "%student_name%" Grades Sheet Explanation Grades sheet for assighment "%task_name%" Group administration Groups administration Groups for task %task_name% If you administer more than one community and you want to upload an assigment in more than one community, you must set the same name for each of the assignment types in each community so the system can identify where to store the assignment. - If you click on the student name, you will see the grades report for that student. + Click on a student's name to see their detailed grade report. If you do not want to grade or edit the grade of a student/group, just leave intact the fields of that row, or you can delete the whole row. if you do not want to see the portraits of the students If you enter the net value, it must be less than %grade_weight%, which is the net value of %grade_plural_name% over the 100 points of the class. <br /> After uploading the %grade_name%, the system will do the convertion and the net value will be represented as a percentage. - if you want to download all the answers in one file + to download all submissions in one file. if you want to see the portraits of the students In order to generate this file there must be some parties assigned to this task. In this page you can administer the groups for the assignment. @@ -283,13 +354,13 @@ Projects for students Reuse groups from another assignment Save the csv file and KEEP THE CSV FORMAT. The CSV file can be edited with any text editor (and MS Excell) but you have to save it keeping the CSV format. If you do not keep the format, the system will not be able to parse the file. - See grades sheets associated with this task + See grade sheets associated with this task Send the file using the "Send file" botton. The system will parse the file and you will be asked for a confirmation (if everything is ok with the file) for the grades. <small>Total points in this category: ${total_grade}/${max_grade} <br /> $grade_plural_name represents the ${grade_weight}% of the 100% of the class</small> - Students List for \"%task_name%\" - Students who have not submitted answers and have not been evaluated (%not_evaluated_with_no_answer%) - Students with answers that have not been evaluated (%not_evaluated_with_answer%) + Student Scores for "%task_name%" + NOT YET SUBMITTED (%not_evaluated_with_no_answer%) + NOT YET GRADED (%not_evaluated_with_answer%) %submission_date_pretty% (late) %submission_date_pretty% <span style=\"color:red;\">(late answer)</span> %task_name% administration @@ -346,14 +417,14 @@ The sum of the weight of all the assignment types is %total_weight% and it should be 100 by the end of the term(supposedly). The system assumes that the grades start at the 7th line of the file. The weight must be grather than 0, and you can not enter Net Value AND Weight. - There are no grades to edit + There are no grades to edit. There are no files associated with this task There are no grades for this group. There are no groups for this task yet. There are no more communities where you can add the task. There are no studens associated with this group. - There are no students to eval that already answered - There are no students to eval with no answer + There are no students to evaluate. + There are no students to evaluate. There are no tasks associated with this assignment type There are no tasks for this package. There are no tasks for this grade type. @@ -381,7 +452,7 @@ These are the students that have already answered but have not been evaluated yet. These are the students that have not answered yet (if the task is online) and have not been evaluated yet. This funcionallity allows you to upload a CSV (Comma Separated Value) file with the grades of the students. This CSV file can be edited with MS Excell and many other text editors. - This is the grades report of the students acording to the assignments/evaluations that you have made. + The following is a summary of student grades for this course. This is the grades report of the students acording to one assignment type and the evaluations that you have made in this assignment type. This task can not be submitted after the due date This task is not in groups @@ -400,7 +471,7 @@ This grade category represents the ${grade_weight}% of the 100% of the class Total points in this category: %total_grade% / %max_grade%<br /> This grade category represents the %grade_weight%% of the 100% of the class - Total points in this category: %total_grade%/%max_grade% + Total points in this category: %total_grade%/%max_grade% Unassociate student for this group Unrecognized value for notif type: $notif_type. Possible values are one_assignment_notif and one_evaluation_notif. Upload a file OR a url, and not both @@ -417,14 +488,15 @@ Weight must be a real number and between 0 and 100 Weight of %grade_plural_name% over 100% of the class Weight of this %grade_name% over %grade_plural_name% - Weight over 100% <br /> of the Course + WEIGHT <br>(out of 100% ) + WEIGHT OVER %grade_weight%% <br /> OF %grade_plural_name_up% Weight over %grade_weight%% <br /> of %grade_plural_name% Weight over %grade_weight%% of %grade_plural_name%"} {html {size 5}} {help_text "<#_ You can enter the weight over %grade_weight%% of %grade_plural_name% or you can enter the net value of it in the field below. Weight over %grade_weight%% of %grade_plural_name% - Weight used in $grade_plural_name: ${category_weight}% (of 100% of $grade_plural_name) <br /> - $grade_plural_name represents ${grade_weight}% of the 100% of the class + <small>Weight used in %low_name%: %category_weight%% (over 100% of %low_name%) <br /> + %low_name% represents %grade_weight%% of the 100% of the class</small> Weight used in %grade_plural_name%: ${category_weight}% (of 100% of $grade_plural_name) <br /> $grade_plural_name represents ${grade_weight}% of the 100% of the class Weight used in %grade_plural_name%: %category_weight%% (of 100% of %grade_plural_name%) <br /> @@ -442,7 +514,8 @@ You can also add a student to an existing group by clicking on the "Associate to group..." link. Here you will be asked to select the group to wich you want to add the user. You can associate a link to this task by entering the absolute url here (also optional) You can enter the weight over %grade_weight%% of %grade_plural_name% or you can enter the net value of it in the field below. - You can order the grade report by the name of the student, by the total grade, or by any of the assignment types, or see the assignment type details by clicking on the view icon at the left of the assignment type name. + To sort by student name, total grade, or any of the assignment types, click on the column headers.<br> +To see the assignment type details, click on the view icon at the left of the assignment type name. You can order the grade report by the name of the student, by the total grade, or by any of the assignments of this assignment type. You can see the csv files associated with the task by clicking on the "See grades sheets associated with this task" botton. You can upload a file associated to this task by using the browse button (optional) @@ -451,56 +524,82 @@ Your total grade in this class is: Max Grade: Maximun Grade: + File Upload Size Members Modifying User n/a Name: + NAME Name Name: %student_name% Net Grade Net Value Net value + Net value over (NEW answer) New Assignment New Group No No + NO No assignments (No data) No group for task + You can't enter more than one relative weight No. of Members No. of members No parties to grade No response - Not answered + Not submitted Not available + The sum of the Weight over %grade_plural_name% should be 100. + The sum of the Weight over Total must be %grade_weight%. Not evaluated + No submission that if you unassociate ALL the members or the group, THE GROUP WILL BE DELETED. Number of Integrants Number of Members One Assignment One Evaluation One Grade Type One Group + SUBMITTED ONLINE? Online Submit + Over %grade_plural_name% + Over total + PERFECT SCORE + Perfect Score: + This is the score used to evaluate the students. y entonces + POINTS + Grade in %base_grade% Project Projects + RELATIVE WEIGHT + Relative Weights Remove Grade Group + REQUIRES GRADE? Requires Grade? Reuse Groups + DISPLAY TO STUDENTS? Send file Solution Attachment + for spreadsheet grading. Studen List Student List Student Name Students List Student's Portrait + "Not Yet Graded" file + "Not Yet Submitted" file + SUBMISSION Submission Date submit answer submit answer again + SUBMITTED Submitted by + Submit online Sumission Date Task Task Groups @@ -514,27 +613,39 @@ Tasks List are the evaluated students. Note that if you evaluated them over a grad different from 100, the system automatically did the conversion so the grade will be shown over 100 points. are no groups for this assignment yet. + %grade_plural_name_up% TOTAL: Total Total current grade: + <div align=right>Total:</div> Total Grade + Total Grade over %base_grade% + <div align=left><text class="blue">(out of a possible 100% of the course)</text></div> Total of Members + Percentage of Total Grade + Unassociate member Unassociate url? Unattach file? Upload Answer Upload Date + Upload graded spreadsheet to Upload Solution Uploaded by (URL) URL pues, esto esta interesante - View answer + View + View submission + View my Answers View comments View Evaluation View evaluation View grades sheet View my answer - View NEW answer + View submission + VIEW STUDENT PORTRAITS? + VIEW STUDENT PORTRAITS: + View Post View Task View task View/Edit Evaluation @@ -546,5 +657,6 @@ upi , pero no yupin Yes Yes - answer has been submited successfully. Click <a href="%return_url;noquote%"> here </a> to continue. + YES + Your answer has been submitted successfully. Click <a href="%return_url%"> here </a> to continue. Index: openacs-4/packages/evaluation/lib/evaluations-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/Attic/evaluations-chunk-postgresql.xql,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/evaluation/lib/evaluations-chunk-postgresql.xql 17 Nov 2004 23:58:15 -0000 1.6.2.1 +++ openacs-4/packages/evaluation/lib/evaluations-chunk-postgresql.xql 8 Jun 2005 22:07:45 -0000 1.6.2.2 @@ -8,15 +8,26 @@ select et.task_name, round(et.weight,2) as task_weight, - et.task_id + et.task_id, (select perfect_score from evaluation_tasks where task_id=et.task_id) as perfect_score, online_p from evaluation_tasksi et, cr_items cri where grade_item_id = :grade_item_id and cri.live_revision = et.task_id $evaluations_orderby + + + select ets.solution_id + from evaluation_tasks_sols ets, cr_items cri + where ets.task_item_id = (select task_item_id from evaluation_tasks where task_id=:task_id) + and cri.live_revision = ets.solution_id + + + + + @@ -25,16 +36,19 @@ et.weight as t_weight, eg.weight as g_weight, round((et.weight*eg.weight)/100,2) as task_weight, - et.number_of_members, - et.task_id + et.number_of_members, + et.online_p, + et.due_date, + et.late_submit_p, + et.task_id, (select perfect_score from evaluation_tasks where task_id=et.task_id) as perfect_score from evaluation_grades eg, evaluation_tasksi et, cr_items cri where eg.grade_id = :grade_id and eg.grade_item_id = et.grade_item_id and cri.live_revision = et.task_id $evaluations_orderby - + @@ -83,7 +97,6 @@ from evaluation_tasks et3 where et3.task_id = :task_id ) - -- evaluation__party_id(:user_id,:task_id) @@ -94,7 +107,7 @@ select ea.data as answer_data, ea.title as answer_title, - ea.answer_id + ea.answer_id,to_char(ea.creation_date,'MM/DD/YYYY HH24:MI') as creation_date from evaluation_answersi ea, cr_items cri where ea.task_item_id = :task_item_id and cri.live_revision = ea.answer_id @@ -119,5 +132,41 @@ + + + select 1 from dual where :due_date > now() + + + + + + + select ea.answer_id + from evaluation_answers ea, cr_items cri + where ea.task_item_id = :task_item_id + and cri.live_revision = ea.answer_id + and 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 + ) + + --evaluation__party_id(:user_id,:task_id) + + + + + Index: openacs-4/packages/evaluation/lib/evaluations-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/evaluations-chunk.adp,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/evaluation/lib/evaluations-chunk.adp 17 Nov 2004 23:58:15 -0000 1.3.2.1 +++ openacs-4/packages/evaluation/lib/evaluations-chunk.adp 8 Jun 2005 22:07:45 -0000 1.3.2.2 @@ -1,4 +1,24 @@ - + + +
+ +
+ + + +
@grade_plural_name@ (@grade_weight@% #evaluation-portlet.total_grade#) + +@actions;noquote@ +
+
+
+
-@bottom_line;noquote@ - + + + #evaluation.lt_Weight_used_in_grade_# + + + #evaluation-portlet.lt_smallTotal_points_in_# + + Index: openacs-4/packages/evaluation/lib/evaluations-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/evaluations-chunk.tcl,v diff -u -r1.14.2.1 -r1.14.2.2 --- openacs-4/packages/evaluation/lib/evaluations-chunk.tcl 17 Nov 2004 23:58:15 -0000 1.14.2.1 +++ openacs-4/packages/evaluation/lib/evaluations-chunk.tcl 8 Jun 2005 22:07:45 -0000 1.14.2.2 @@ -1,114 +1,246 @@ ad_page_contract { - - evaluations chunk to be displayed in the index page - + + evaluations chunk to be displayed in the index page + } set package_id [ad_conn package_id] +set evaluation_id [evaluation_evaluations_portlet::get_package_id_from_key -package_key "evaluation"] set user_id [ad_verify_and_get_user_id] set admin_p [permission::permission_p -party_id $user_id -object_id $package_id -privilege admin] +set simple_p [parameter::get -parameter "SimpleVersion" -package_id $evaluation_id] +set base_url "[ad_conn package_url]/" +set return_url "[ad_conn url]?[ns_conn query]" +set class "list" +set bulk_actions "" +db_1row get_grade_info { *SQL* } -set base_url [ad_conn package_url] +set submitted_label "
[_ evaluation-portlet.lt_smallTotal_points_in__1]
" -db_1row get_grade_info { *SQL* } +if { $admin_p } { + if { $simple_p } { + set bottom_line "[_ evaluation-portlet.lt_smallWeight_used_in_g]" + } else { + set bottom_line "" + + } +} else { + set bottom_line "" +} + +if { $simple_p } { + set class "pbs_list" + set grade_of_label "[_ evaluation-portlet.maximum]" +} else { + set grade_of_label "" +} set elements [list task_name \ [list label "[_ evaluation-portlet.Name_]" \ link_url_col task_url \ orderby_asc {task_name asc} \ - orderby_desc {task_name desc}] \ - ] + aggregate "" \ + aggregate_label "@bottom_line;noquote@"\ + orderby_desc {task_name desc}]] if { $admin_p } { - #admin - lappend elements task_weight \ - [list label "[_ evaluation-portlet.Weight_]" \ - display_template {
@grade_tasks_admin.task_weight@%
} \ - orderby_asc {task_weight asc} \ - orderby_desc {task_weight desc}] + #admin + if { $simple_p } { + lappend elements perfect_score \ + [list label "[_ evaluation-portlet.points_value]" \ + display_template {
@grade_tasks_admin.perfect_score@
} \ + orderby_asc {perfect_score asc} \ + aggregate "" \ + aggregate_label "@max_grade_label;noquote@" \ + orderby_desc {perfect_score desc}] + } + lappend elements task_weight \ + [list label "[_ evaluation-portlet.Weight_]" \ + display_template {
@grade_tasks_admin.task_weight@%
} \ + orderby_asc {task_weight asc} \ + orderby_desc {task_weight desc} \ + aggregate "" \ + aggregate_label "@max_weight_label;noquote@"] + if { $simple_p } { + lappend elements solution \ + [list label "
[_ evaluation-portlet.solution]
" \ + display_template "
@grade_tasks_admin.solution@
" \ + link_url_col solution_url \ + aggregate "" \ + aggregate_label "@solution_label;noquote@"] + lappend elements grade \ + [list label "[_ evaluation-portlet.grade]" \ + link_url_col grade_url \ + display_template {
[_ evaluation-portlet.evaluate]
} ] + lappend elements edit \ + [list label "" \ + sub_class narrow \ + display_template {
[_ evaluation-portlet.edit]
[_ evaluation-portlet.delete]
}] + } else { lappend elements audit_info \ - [list label "" \ - link_url_col audit_info_url \ - link_html { title "[_ evaluation-portlet.Audit_info_]" }] - set multirow_name grade_tasks_admin - set actions [list "[_ evaluation-portlet.lt_Edit_grades_distribut]" [export_vars -base "${base_url}admin/grades/distribution-edit" { grade_id }]] + [list label "" \ + link_url_col audit_info_url \ + link_html { title "[_ evaluation-portlet.Audit_info_]" }] + set bulk_actions [list "[_ evaluation-portlet.lt_Edit_grades_distribut]" [export_vars -base "${base_url}admin/grades/distribution-edit" { grade_id }]] + + } + set multirow_name grade_tasks_admin + set actions "\#evaluation-portlet.Add_grade_name_\#\#evaluation-portlet.edit_grade_scale\#" + } else { - #student - lappend elements grade \ - [list label "[_ evaluation-portlet.Grade_over_100_]" \ - display_template {
@grade_tasks.grade@
}] - lappend elements comments \ - [list label "[_ evaluation-portlet.Comments_]" \ - link_url_col comments_url \ - link_html { title "[_ evaluation-portlet.lt_View_evaluation_comme]" }] + #student + if { $simple_p } { + lappend elements submitted \ + [list label "
[_ evaluation-portlet.Submitted]
" \ + display_template {
@grade_tasks.submitted_date;noquote@
} \ + aggregate "" \ + link_url_col submitted_date_url \ + aggregate_label "@submitted_label;noquote@" ] + + lappend elements task_grade \ + [list label "[_ evaluation-portlet.Points]" \ + display_template {
@grade_tasks.task_grade@
} \ + aggregate "" \ + aggregate_label "@max_grade_label;noquote@" ] lappend elements task_weight \ - [list label "[_ evaluation-portlet.Net_Value_]" \ - display_template {
@grade_tasks.task_weight@
} \ - orderby_asc {task_weight asc} \ - orderby_desc {task_weight desc}] - lappend elements answer \ - [list label "" \ - link_url_col answer_url \ - link_html { title "[_ evaluation-portlet.View_my_answer_]" }] - set multirow_name grade_tasks - set actions "" + [list label "[_ evaluation-portlet.Total_Points]" \ + display_template {
@grade_tasks.perfect_score@
} \ + orderby_asc {task_weight asc} \ + orderby_desc {task_weight desc} \ + aggregate "" \ + aggregate_label "@max_weight_label;noquote@"] + } + lappend elements grade \ + [list label "[_ evaluation-portlet.Grade_over_100_]" \ + display_template {
@grade_tasks.grade@
} \ + aggregate "" \ + aggregate_label "@grade_of_label;noquote@"] + + lappend elements comments \ + [list label "[_ evaluation-portlet.Comments_]" \ + link_url_col comments_url \ + link_html { title "[_ evaluation-portlet.lt_View_evaluation_comme]" }] + + if {!$simple_p} { + lappend elements task_weight \ + [list label "[_ evaluation-portlet.Net_Value_]" \ + display_template {
@grade_tasks.task_weight@
} \ + orderby_asc {task_weight asc} \ + orderby_desc {task_weight desc}] + + } + lappend elements answer \ + [list label "" \ + display_template {@grade_tasks.answer;noquote@} \ + link_html { title "[_ evaluation-portlet.View_my_answer_]" }] + + set multirow_name grade_tasks + set actions "" } set total_grade 0.00 set max_grade 0.00 +set max_weight 0.00 set category_weight 0 +set max_grade_label "" +set max_weight_label "" +set solution_label "" + template::list::create \ -name grade_tasks \ -multirow $multirow_name \ - -actions $actions \ -key task_id \ - -pass_properties { return_url mode base_url } \ - -filters { grade_id } \ + -pass_properties { return_url mode base_url bottom_line max_grade_label max_weight_label solution_label submitted_label grade_of_label} \ + -filters { grade_id {} page_num {} } \ + -actions $bulk_actions \ + -no_data "[_ evaluation-portlet.No_assignments_]" \ -elements $elements \ - -no_data "[_ evaluation.No_assignments_]" \ -orderby_name evaluations_orderby \ + -main_class $class \ + -sub_class narrow \ -orderby { default_value task_name } - + set evaluations_orderby [template::list::orderby_clause -orderby -name grade_tasks] - + if { [string equal $evaluations_orderby ""] } { - set evaluations_orderby " order by task_name asc" + set evaluations_orderby " order by task_name asc" } if { $admin_p } { - #admin - db_multirow -extend { task_url audit_info audit_info_url } grade_tasks_admin get_tasks_admin { *SQL* } { - set task_url [export_vars -base "${base_url}admin/evaluations/student-list" { task_id grade_id }] + #admin + db_multirow -extend { task_url grade_url audit_info audit_info_url task_points solution solution_url} grade_tasks_admin get_tasks_admin { *SQL* } { + if { $simple_p } { + set task_url [export_vars -base "${base_url}task-view" { grade_id task_id return_url }] + } else { + set task_url [export_vars -base "${base_url}admin/evaluations/student-list" { grade_id task_id return_url }] + } set category_weight [expr $category_weight + $task_weight] + set grade_url [export_vars -base "${base_url}admin/evaluations/student-list" { grade_id task_id return_url }] + set max_weight [format %0.2f [expr $max_weight + $task_weight]] set task_weight [lc_numeric $task_weight] - - set audit_info_url "[export_vars -base "${base_url}admin/evaluations/audit-info" { grade_id task_id }]" + set max_grade [expr $max_grade + $perfect_score] + set max_grade_label "
$max_grade pts.
" + set solution_label "[_ evaluation-portlet.weight_possible_of_grade_] $low_name )" + + if { $simple_p } { + set max_weight_label "
$max_weight %
" + } + if { [db_0or1row solution_info { *SQL* }] } { + set solution_mode display + set solution_url "[export_vars -base "${base_url}admin/tasks/solution-add-edit" { grade_id task_id solution_id return_url solution_mode }]" + set solution "[_ evaluation-portlet.ViewEdit_Solution_]" + } else { + set solution_mode edit + set solution_url "[export_vars -base "${base_url}admin/tasks/solution-add-edit" { grade_id task_id return_url solution_mode }]" + if { $online_p } { + set solution "[_ evaluation-portlet.Upload_Solution_]" + } + } + + set task_points [format %0.2f [expr ($task_weight*$grade_weight)/100.0]] + set audit_info_url [export_vars -base "${base_url}admin/evaluations/audit-info" { grade_id task_id }] + set audit_info "[_ evaluation-portlet.Audit_Info_]" + } } else { - - db_multirow -extend { comments comments_url answer answer_url grade } grade_tasks get_grade_tasks { *SQL* } { - + + db_multirow -extend { task_url submitted_date submitted_date_url comments comments_url grade_url answer answer_url grade task_grade} grade_tasks get_grade_tasks { *SQL* } { + if { $simple_p } { + set task_url [export_vars -base "${base_url}task-view" { grade_id task_id return_url }] + } else { + set task_url "" + } + set grade_url [export_vars -base "${base_url}admin/evaluations/student-list" { grade_id task_id return_url }] if { [db_0or1row get_evaluation_info { *SQL* }] } { if { ![empty_string_p $comments] } { set comments "[_ evaluation-portlet.View_comments_]" - set comments_url "[export_vars -base "evaluation-view" { evaluation_id { return_url ${base_url} }}]" + set comments_url "[export_vars -base "${base_url}evaluation-view" { evaluation_id return_url }]" } else { - set comments "[_ evaluation.lt_View_evaluation_detai]" + set comments "[_ evaluation-portlet.lt_View_evaluation_detai]" set comments_url "[export_vars -base "${base_url}evaluation-view" { evaluation_id return_url }]" } - set over_weight "" - if { ![empty_string_p $show_student_p] && $show_student_p } { - set max_grade [expr $task_weight + $max_grade] + + set over_weight "" + if { [string eq $show_student_p "t"] } { if { ![empty_string_p $grade] } { set grade [lc_numeric $grade] set over_weight "[lc_numeric $task_grade]/" + if { $simple_p } { + set task_grade [format %0.2f [expr ($grade*$perfect_score/100.0)]] + } set total_grade [expr $total_grade + $task_grade] + if { $simple_p } { + set max_grade [expr $task_grade + $max_grade] + } else { + set max_grade [expr $task_weight + $max_grade] + } } else { set grade "[_ evaluation-portlet.Not_evaluated_]" + set task_grade "[_ evaluation-portlet.Not_evaluated_]" } set task_weight "${over_weight}[lc_numeric $task_weight]" @@ -118,12 +250,16 @@ } } else { set grade "[_ evaluation-portlet.Not_evaluated_]" - set max_grade [expr $task_weight + $max_grade] - set task_weight [lc_numeric $task_weight] - } + if { $simple_p } { + set task_weight [lc_numeric $task_weight] + } else { + set task_weight "[_ evaluation-portlet.Not_evaluated_]" + } + set task_grade "[_ evaluation-portlet.Not_evaluated_]" + } - if { [db_0or1row get_answer_info { *SQL* }] } { + set submitted_date $creation_date # working with answer stuff (if it has a file/url attached) if { [string eq $answer_title "link"] } { # there is a bug in the template::list, if the url does not has a http://, ftp://, the url is not absolute, @@ -149,12 +285,47 @@ set answer_url "" set answer "" } - - } + set max_weight [expr $max_weight + $perfect_score] + set max_grade_label "
$max_grade pts.
" + set max_weight_label "
$max_weight %
" + if { [empty_string_p $submitted_date]} { + + if { [string eq $online_p "t"] } { + if { [db_string compare_due_date { *SQL* } -default 0] } { + if { ![db_0or1row answer_info { *SQL* }] } { + set submitted_date "[_ evaluation-portlet.submit_answer_]" + set submitted_date_mode edit + set submitted_date_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id return_url answer_mode }]" + } else { + set submitted_date "[_ evaluation-portlet.submit_answer_again_]" + set submitted_date_mode display + set submitted_date_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id answer_id return_url answer_mode }]" + } + } elseif { [string eq $late_submit_p "t"] } { + if { ![db_0or1row answer_info { *SQL* }] } { + set submitted_date "[_ evaluation-portlet.lt_submit_answer_style_f]" + set submitted_date_mode edit + set submitted_date_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id return_url answer_mode }]" + } else { + set submitted_date "[_ evaluation-portlet.lt_submit_answer_style_f_1]" + set submitted_date_mode display + set submitted_date_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id answer_id return_url answer_mode }]" + } + } + if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } { + set submitted_date "[_ evaluation-portlet.No_group_for_task_]" + set submitted_date_url "" + } + } + } else { + set submitted_date_url "[export_vars -base "${base_url}answer-view" { grade_id task_id return_url answer_mode {answer_id}}]" + if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } { + + set submitted_date "[_ evaluation-portlet.No_group_for_task_]" + set submitted_date_url "" + } + + } + } } -if { $admin_p } { - set bottom_line "[_ evaluation-portlet.lt_smallWeight_used_in_g]" -} else { - set bottom_line "[_ evaluation-portlet.lt_smallTotal_points_in__1]" -} Index: openacs-4/packages/evaluation/lib/evaluations-chunk.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/evaluations-chunk.xql,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/evaluation/lib/evaluations-chunk.xql 17 Nov 2004 23:58:15 -0000 1.3.2.1 +++ openacs-4/packages/evaluation/lib/evaluations-chunk.xql 8 Jun 2005 22:07:45 -0000 1.3.2.2 @@ -6,7 +6,7 @@ - select grade_plural_name, weight as grade_weight from evaluation_grades where grade_id = :grade_id + select upper(grade_plural_name) as grade_plural_name, grade_plural_name as low_name,grade_name,weight as grade_weight,weight as category_weight from evaluation_grades where grade_id = :grade_id 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 -r1.16.2.2 -r1.16.2.3 --- openacs-4/packages/evaluation/sql/postgresql/evaluation-create.sql 19 Jan 2005 19:17:17 -0000 1.16.2.2 +++ openacs-4/packages/evaluation/sql/postgresql/evaluation-create.sql 8 Jun 2005 22:07:45 -0000 1.16.2.3 @@ -16,6 +16,7 @@ weight numeric constraint evaluation_grades_w_ck check (weight between 0 and 100) + ); create index evalutaion_grades_giid_index on evaluation_grades(grade_item_id); @@ -66,7 +67,12 @@ constraint evaluations_tasks_rgp_ck check(late_submit_p in ('t','f')), -- estimated time to complete the assigment - estimated_time decimal + estimated_time decimal, + points numeric, + perfect_score numeric, + relative_weight numeric, + forums_related_p char(1) constraint evaluation_tasks_frp_ck + check(forums_related_p in ('t','f')) ); create index evalutaion_tasks_gid_index on evaluation_tasks(grade_item_id); @@ -119,9 +125,10 @@ not null constraint evaluation_sans_pid_fk references parties(party_id), - task_item_id integer + task_item_id integer constraint evaluation_sans_tid_fk - references cr_items(item_id) + references cr_items(item_id), + comment text ); create index evaluation_answers_tid_index on evaluation_answers(party_id,task_item_id); @@ -323,7 +330,7 @@ create function evaluation__new_grade (integer, integer, varchar, varchar, numeric, varchar, timestamptz, integer, varchar, varchar, varchar, timestamptz, varchar, varchar) returns integer as ' declare - p_item_id alias for $1; + p_item_id alias for $1; p_revision_id alias for $2; p_grade_name alias for $3; p_grade_plural_name alias for $4; @@ -601,7 +608,7 @@ --------------------------------------- -create function evaluation__new_answer (integer, integer, integer, integer, varchar, timestamptz, integer, varchar, varchar, timestamptz, varchar, varchar) +create function evaluation__new_answer (integer, integer, integer, integer, varchar, timestamptz, integer, varchar, varchar, timestamptz, varchar, varchar,text) returns integer as ' declare p_item_id alias for $1; @@ -616,6 +623,7 @@ p_publish_date alias for $10; p_nls_language alias for $11; -- default null p_mime_type alias for $12; -- default null + p_comment alias for $13; v_revision_id integer; @@ -640,12 +648,12 @@ (answer_id, answer_item_id, task_item_id, - party_id) + party_id,comment) values (v_revision_id, p_item_id, p_task_item_id, - p_party_id); + p_party_id,p_comment); return v_revision_id; end; @@ -1502,4 +1510,135 @@ select inline_0(); drop function inline_0(); +create function evaluation__clone (integer,integer) +returns integer as ' +declare + p_new_package_id alias for $1; --default null, + p_old_package_id alias for $2; --default null + v_grade_id evaluation_grades.grade_id%TYPE; + v_item_id acs_objects.object_id%TYPE; + v_revision_id acs_objects.object_id%TYPE; + v_task_item_id acs_objects.object_id%TYPE; + v_task_revision_id acs_objects.object_id%TYPE; + previous integer default 0; + one_grade record; + entry record; + +begin + -- get all the grades belonging to the old package, + -- and create new grades for the new package + delete from evaluation_grades where grade_id in (select eg.grade_id from acs_objects o, evaluation_grades eg,cr_items ci,cr_revisions cr where o.object_id = ci.item_id and cr.revision_id=eg.grade_id and ci.item_id=cr.item_id and cr.revision_id=ci.live_revision and o.context_id = p_new_package_id); + + for one_grade in select * + from acs_objects o, evaluation_grades eg,cr_items ci,cr_revisions cr + where o.object_id = ci.item_id + and cr.revision_id=eg.grade_id + and ci.item_id=cr.item_id + and cr.revision_id=ci.live_revision + and o.context_id = p_old_package_id + + loop + + v_item_id := evaluation__new_item (null, + one_grade.name, + null, + one_grade.creation_user, + p_new_package_id, + one_grade.creation_date, + one_grade.creation_ip, + one_grade.title, + one_grade.description, + one_grade.mime_type, + null, + null, + ''text'', + ''content_item'', + ''evaluation_grades'' + ); + + v_revision_id := nextval(''t_acs_object_id_seq''); + v_grade_id := evaluation__new_grade ( v_item_id, + v_revision_id, + one_grade.grade_name, + one_grade.grade_plural_name, + one_grade.weight, + ''evaluation_grades'', + one_grade.creation_date, + one_grade.creation_user, + one_grade.creation_ip, + one_grade.title, + one_grade.description, + one_grade.publish_date, + null, + ''text/plain'' + ); + + for entry in select *, (ci.live_revision = cr.revision_id) as live_p from evaluation_tasks et,cr_revisions cr,cr_items ci, acs_objects o where grade_item_id = one_grade.grade_item_id and cr.revision_id=task_id and cr.item_id=ci.item_id and object_id=ci.item_id order by task_item_id + + loop + if previous != entry.task_item_id then + + v_task_item_id := evaluation__new_item ( + null, + entry.name, + null, + entry.creation_user, + p_new_package_id, + now(), + entry.creation_ip, + entry.task_name, + entry.description, + entry.mime_type, + null, + null, + entry.storage_type, --storage_type + ''content_item'', -- item_subtype + ''evaluation_tasks'' -- content_type + ); + + end if; + + v_task_revision_id := nextval(''t_acs_object_id_seq''); + perform evaluation__new_task ( v_task_item_id, + v_task_revision_id, + entry.task_name, + entry.number_of_members, + v_item_id, + entry.description, + entry.weight, + entry.due_date, + entry.late_submit_p, + entry.online_p, + entry.requires_grade_p, + entry.estimated_time, + entry.object_type, + entry.creation_date, + entry.creation_user, + entry.creation_ip, + entry.title, + entry.publish_date, + entry.nls_language, + entry.mime_type + ); + + update evaluation_tasks set points=entry.points, relative_weight=entry.relative_weight, perfect_score= entry.perfect_score,forums_related_p=entry.forums_related_p where task_id=v_task_revision_id; + + if entry.live_p then + perform content_item__set_live_revision ( + v_task_revision_id + ); + end if; + + previous := entry.task_item_id; + + end loop; + perform content_item__set_live_revision ( + v_revision_id + ); + + end loop; + return 0; + end; +' language 'plpgsql'; + \i evaluation-calendar-create.sql Index: openacs-4/packages/evaluation/sql/postgresql/evaluation-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/sql/postgresql/evaluation-drop.sql,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/evaluation/sql/postgresql/evaluation-drop.sql 17 Nov 2004 23:58:16 -0000 1.9.2.1 +++ openacs-4/packages/evaluation/sql/postgresql/evaluation-drop.sql 8 Jun 2005 22:07:45 -0000 1.9.2.2 @@ -195,7 +195,7 @@ -- STUDENT ANSWERS --------------------------------------- -drop function evaluation__new_answer (integer, integer, integer, integer, varchar, timestamptz, integer, varchar, varchar, timestamptz, varchar, varchar); +drop function evaluation__new_answer (integer, integer, integer, integer, varchar, timestamptz, integer, varchar, varchar, timestamptz, varchar, varchar,text); drop function evaluation__delete_answer (integer); Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/sql/postgresql/upgrade/upgrade-0.4d2-0.4d3.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/sql/postgresql/upgrade/upgrade-0.4d3-0.4d4.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/sql/postgresql/upgrade/upgrade-0.4d4-0.4d5.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/sql/postgresql/upgrade/upgrade-0.4d5-0.4d6.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/sql/postgresql/upgrade/upgrade-0.4d6-0.4d7.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/sql/postgresql/upgrade/upgrade-0.4d7-0.4d8.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/evaluation/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/tcl/apm-callback-procs.tcl,v diff -u -r1.8.2.1 -r1.8.2.2 --- openacs-4/packages/evaluation/tcl/apm-callback-procs.tcl 17 Nov 2004 23:58:17 -0000 1.8.2.1 +++ openacs-4/packages/evaluation/tcl/apm-callback-procs.tcl 8 Jun 2005 22:07:45 -0000 1.8.2.2 @@ -91,3 +91,30 @@ delete_contents -package_id $package_id } +ad_proc -public evaluation::apm::after_upgrade { + {-from_version_name:required} + {-to_version_name:required} +} { + + +} { + apm_upgrade_logic \ + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ + -spec { + 0.4d3 0.4d4 { + evaluation::set_points + } + 0.4d4 0.4d5 { + evaluation::set_perfect_score + } + 0.4d5 0.4d6 { + evaluation::set_relative_weight + } + 0.4d7 0.4d8 { + evaluation::set_forums_related + } + + + } +} 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 -r1.17.2.1 -r1.17.2.2 --- openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql 17 Nov 2004 23:58:17 -0000 1.17.2.1 +++ openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql 8 Jun 2005 22:07:45 -0000 1.17.2.2 @@ -308,7 +308,8 @@ :title, :publish_date, --publish date null, -- nls_language - :mime_type --mime_type + :mime_type, --mime_type + :comment ); @@ -601,6 +602,7 @@ + @@ -634,7 +636,7 @@ :exams_revision_id, :exams_singular_name, :exams_name, - 40, + 20, 'evaluation_grades', now(), --creation date :creation_user, @@ -747,7 +749,7 @@ :tasks_revision_id, :tasks_singular_name, :tasks_name, - 40, + 20, 'evaluation_grades', now(), --creation date :creation_user, @@ -889,5 +891,456 @@ + + + + + select evaluation__new_item ( + :journals_item_id, --item_id + :journals_item_name, + null, + :creation_user, + :package_id, + current_timestamp, + :creation_ip, + :journals_name, + :journals_desc, + 'text/plain', + null, + null, + 'text', + 'content_item', -- item_subtype + 'evaluation_grades' -- content_type + ); + + + + + + + + select evaluation__new_grade ( + :journals_item_id, + :journals_revision_id, + :journals_singular_name, + :journals_name, + 20, + 'evaluation_grades', + now(), --creation date + :creation_user, + :creation_ip, + :journals_revision_name, + :journals_desc, + now(), --publish date + null, --nls_language + 'text/plain' --mime_type + ); + + + + + + + + select content_item__set_live_revision ( + :journals_revision_id + ); + + + + + + + select evaluation__new_item ( + :final_projects_item_id, --item_id + :final_projects_item_name, + null, + :creation_user, + :package_id, + current_timestamp, + :creation_ip, + :final_projects_name, + :final_projects_desc, + 'text/plain', + null, + null, + 'text', + 'content_item', -- item_subtype + 'evaluation_grades' -- content_type + ); + + + + + + + + select evaluation__new_grade ( + :final_projects_item_id, + :final_projects_revision_id, + :final_projects_singular_name, + :final_projects_name, + 10, + 'evaluation_grades', + now(), --creation date + :creation_user, + :creation_ip, + :final_projects_revision_name, + :final_projects_desc, + now(), --publish date + null, --nls_language + 'text/plain' --mime_type + ); + + + + + + + + select content_item__set_live_revision ( + :final_projects_revision_id + ); + + + + + + + + select evaluation__new_item ( + :activities_item_id, --item_id + :activities_item_name, + null, + :creation_user, + :package_id, + current_timestamp, + :creation_ip, + :activities_name, + :activities_desc, + 'text/plain', + null, + null, + 'text', + 'content_item', -- item_subtype + 'evaluation_grades' -- content_type + ); + + + + + + + + select evaluation__new_grade ( + :activities_item_id, + :activities_revision_id, + :activities_singular_name, + :activities_name, + 10, + 'evaluation_grades', + now(), --creation date + :creation_user, + :creation_ip, + :activities_revision_name, + :activities_desc, + now(), --publish date + null, --nls_language + 'text/plain' --mime_type + ); + + + + + + + select content_item__set_live_revision ( + :activities_revision_id + ); + + + + + + + + select evaluation__new_folder ( + 'evaluation_grades_'||:package_id, + 'evaluation_grades_'||:package_id, + 'Evaluation grades folder', + null, + 'evaluation_grades' + ); + + select evaluation__new_folder ( + 'evaluation_tasks_'||:package_id, + 'evaluation_tasks_'||:package_id, + 'Evaluation tasks folder', + null, + 'evaluation_tasks' + ); + + select evaluation__new_folder ( + 'evaluation_tasks_sols_'||:package_id, + 'evaluation_tasks_sols_'||:package_id, + 'Evaluation tasks solutions folder', + null, + 'evaluation_tasks_sols' + ); + + select evaluation__new_folder ( + 'evaluation_answers_'||:package_id, + 'evaluation_answers_'||:package_id, + 'Evaluation answers folder', + null, + 'evaluation_answers' + ); + + select evaluation__new_folder ( + 'evaluation_grades_sheets_'||:package_id, + 'evaluation_grades_sheets_'||:package_id, + 'Grades sheets folder', + null, + 'evaluation_grades_sheets' + ); + + select evaluation__new_folder ( + 'evaluation_student_evals_'||:package_id, + 'evaluation_student_evals_'||:package_id, + 'Evaluation student evaluations folder', + null, + 'evaluation_student_evals' + ); + + + + + + + select evaluation__new_item ( + :journals_item_id, --item_id + :journals_item_name, + null, + :creation_user, + :package_id, + current_timestamp, + :creation_ip, + :journals_name, + :journals_desc, + 'text/plain', + null, + null, + 'text', + 'content_item', -- item_subtype + 'evaluation_grades' -- content_type + ); + + + + + + + + select evaluation__new_grade ( + :journals_item_id, + :journals_revision_id, + :journals_singular_name, + :journals_name, + 0, + 'evaluation_grades', + now(), --creation date + :creation_user, + :creation_ip, + :journals_revision_name, + :journals_desc, + now(), --publish date + null, --nls_language + 'text/plain' --mime_type + ); + + + + + + + + select content_item__set_live_revision ( + :journals_revision_id + ); + + + + + + + select evaluation__new_item ( + :final_projects_item_id, --item_id + :final_projects_item_name, + null, + :creation_user, + :package_id, + current_timestamp, + :creation_ip, + :final_projects_name, + :final_projects_desc, + 'text/plain', + null, + null, + 'text', + 'content_item', -- item_subtype + 'evaluation_grades' -- content_type + ); + + + + + + + + select evaluation__new_grade ( + :final_projects_item_id, + :final_projects_revision_id, + :final_projects_singular_name, + :final_projects_name, + 0, + 'evaluation_grades', + now(), --creation date + :creation_user, + :creation_ip, + :final_projects_revision_name, + :final_projects_desc, + now(), --publish date + null, --nls_language + 'text/plain' --mime_type + ); + + + + + + + + select content_item__set_live_revision ( + :final_projects_revision_id + ); + + + + + + + + select evaluation__new_item ( + :activities_item_id, --item_id + :activities_item_name, + null, + :creation_user, + :package_id, + current_timestamp, + :creation_ip, + :activities_name, + :activities_desc, + 'text/plain', + null, + null, + 'text', + 'content_item', -- item_subtype + 'evaluation_grades' -- content_type + ); + + + + + + + + select evaluation__new_grade ( + :activities_item_id, + :activities_revision_id, + :activities_singular_name, + :activities_name, + 0, + 'evaluation_grades', + now(), --creation date + :creation_user, + :creation_ip, + :activities_revision_name, + :activities_desc, + now(), --publish date + null, --nls_language + 'text/plain' --mime_type + ); + + + + + + + select content_item__set_live_revision ( + :activities_revision_id + ); + + + + + + + select task_id + from evaluation_tasks + where task_id=:task_id and due_date is null + + + + + + + + select evaluation__new_item ( + :item_id, --item_id + :item_name, + null, + :creation_user, + :package_id, + now(), + :creation_ip, + :name, + :description, + 'text/plain', + null, + null, + 'text', + 'content_item', -- item_subtype + 'evaluation_grades' -- content_type + ); + + + + + + + + select evaluation__new_grade ( + :item_id, + :revision_id, + :name, + :plural_name, + :weight, + 'evaluation_grades', + now(), --creation date + :creation_user, + :creation_ip, + :revision_name, + :description, + now(), --publish date + null, --nls_language + 'text/plain' --mime_type + ); + + + + + + + Index: openacs-4/packages/evaluation/tcl/evaluation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/tcl/evaluation-procs.tcl,v diff -u -r1.17.2.2 -r1.17.2.3 --- openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 8 Dec 2004 19:30:18 -0000 1.17.2.2 +++ openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 8 Jun 2005 22:07:45 -0000 1.17.2.3 @@ -288,6 +288,7 @@ {-title ""} {-mime_type "text/plain"} {-item_name ""} + {-package_id ""} } { Build a new content revision of a task. If new_item_p is @@ -309,8 +310,9 @@ @storage_type File or text, depending on what are we going to store } { - - set package_id [ad_conn package_id] + if {[empty_string_p $package_id]} { + set package_id [ad_conn package_id] + } set creation_user [ad_conn user_id] set creation_ip [ad_conn peeraddr] @@ -400,6 +402,7 @@ {-mime_type "text/plain"} {-publish_date ""} {-creation_date ""} + {-comment ""} } { Build a new content revision of an answer. If new_item_p is @@ -776,6 +779,16 @@ set projects_name "[_ evaluation.Projects_]" set projects_singular_name "[_ evaluation.Project]" set projects_desc "[_ evaluation.lt_Projects_for_students]" + set journals_name "[_ evaluation.Journals_]" + set journals_singular_name "[_ evaluation.Journal]" + set journals_desc "[_ evaluation.Journals_for_students_]" + set activities_name "[_ evaluation.Activities_]" + set activities_singular_name "[_ evaluation.Activity]" + set activities_desc "[_ evaluation.Activities_for_students_]" + set final_projects_name "[_ evaluation.Final_Projects_]" + set final_projects_singular_name "[_ evaluation.Final_Project]" + set final_projects_desc "[_ evaluation.lt_Final_Projects_for_students]" + db_exec_plsql create_evaluation_folders { *SQL* } set creation_user [ad_verify_and_get_user_id] @@ -813,10 +826,102 @@ db_exec_plsql tasks_revision_new { *SQL* } db_exec_plsql tasks_live_revision { *SQL* } + + set journals_item_id [db_nextval acs_object_id_seq] + set journals_item_name "evaluation_grades_${journals_item_id}" + set journals_revision_id [db_nextval acs_object_id_seq] + set journals_revision_name "evaluation_grades_${journals_revision_id}" + + db_exec_plsql journals_item_new { *SQL* } + + db_exec_plsql journals_revision_new { *SQL* } + + db_exec_plsql journals_live_revision { *SQL* } + + set final_projects_item_id [db_nextval acs_object_id_seq] + set final_projects_item_name "evaluation_grades_${final_projects_item_id}" + set final_projects_revision_id [db_nextval acs_object_id_seq] + set final_projects_revision_name "evaluation_grades_${final_projects_revision_id}" + + db_exec_plsql final_projects_item_new { *SQL* } + + db_exec_plsql final_projects_revision_new { *SQL* } + db_exec_plsql final_projects_live_revision { *SQL* } + + set activities_item_id [db_nextval acs_object_id_seq] + set activities_item_name "evaluation_grades_${activities_item_id}" + set activities_revision_id [db_nextval acs_object_id_seq] + set activities_revision_name "evaluation_grades_${activities_revision_id}" + + db_exec_plsql activities_item_new { *SQL* } + + db_exec_plsql activities_revision_new { *SQL* } + + db_exec_plsql activities_live_revision { *SQL* } + + } } +ad_proc -public evaluation::apm::create_folders_upgrade { + -package_id:required +} { + Helper for the apm_proc +} { + db_transaction { + set journals_name "[_ evaluation.Journals_]" + set journals_singular_name "[_ evaluation.Journal]" + set journals_desc "[_ evaluation.Journals_for_students_]" + set activities_name "[_ evaluation.Activities_]" + set activities_singular_name "[_ evaluation.Activity]" + set activities_desc "[_ evaluation.Activities_for_students_]" + set final_projects_name "[_ evaluation.Final_Projects_]" + set final_projects_singular_name "[_ evaluation.Final_Project]" + set final_projects_desc "[_ evaluation.lt_Final_Projects_for_students]" + set creation_user [ad_verify_and_get_user_id] + set creation_ip [ad_conn peeraddr] + + + set journals_item_id [db_nextval acs_object_id_seq] + set journals_item_name "evaluation_grades_${journals_item_id}" + set journals_revision_id [db_nextval acs_object_id_seq] + set journals_revision_name "evaluation_grades_${journals_revision_id}" + + db_exec_plsql journals_item_new { *SQL* } + + db_exec_plsql journals_revision_new { *SQL* } + + db_exec_plsql journals_live_revision { *SQL* } + + set final_projects_item_id [db_nextval acs_object_id_seq] + set final_projects_item_name "evaluation_grades_${final_projects_item_id}" + set final_projects_revision_id [db_nextval acs_object_id_seq] + set final_projects_revision_name "evaluation_grades_${final_projects_revision_id}" + + db_exec_plsql final_projects_item_new { *SQL* } + + db_exec_plsql final_projects_revision_new { *SQL* } + + db_exec_plsql final_projects_live_revision { *SQL* } + + set activities_item_id [db_nextval acs_object_id_seq] + set activities_item_name "evaluation_grades_${activities_item_id}" + set activities_revision_id [db_nextval acs_object_id_seq] + set activities_revision_name "evaluation_grades_${activities_revision_id}" + + db_exec_plsql activities_item_new { *SQL* } + + db_exec_plsql activities_revision_new { *SQL* } + + db_exec_plsql activities_live_revision { *SQL* } + + + } + +} + + ad_proc -public evaluation::apm::delete_contents { -package_id:required } { @@ -923,5 +1028,146 @@ return [parameter::get -parameter ArchiveExtension -default "txt"] } +ad_proc -public evaluation::set_points { +} { + Proc called in after upgrade callback from version 0.4d3 to 0.4d4 + Sets points field in table evaluation_tasks + +} { + + set grades [db_list_of_lists get_grades {}] + foreach grade $grades { + set grade_id [lindex $grade 0] + set tasks [db_list_of_lists get_grade_tasks {}] + set grade_weight [lindex $grade 1] + + foreach task $tasks { + set task_id [lindex $task 0] + set task_weight [lindex $task 1] + set points [format %0.2f [expr ($task_weight*$grade_weight)/100.00]] + db_dml update_task {} + } + } +} + + +ad_proc -public evaluation::enable_due_date { + {-task_id} +} { +} { + set enable_p 0 + set enable_p [db_string enable {} -default 1] + + if {$enable_p > 1} { + set enable_p 0 + } + return $enable_p +} + +ad_proc -public evaluation::set_perfect_score { +} { + Proc called in after upgrade callback from version 0.4d4 to 0.4d5 + Sets perfect_score field in table evaluation_tasks + +} { + set tasks [db_list_of_lists get_tasks {}] + set perfect_score 100 + + foreach task_id $tasks { + db_transaction { + db_dml update_task {} + } + } + +} + +ad_proc -public evaluation::clone_grade { + -item_id:required + -content_type:required + -content_table:required + -content_id:required + -new_item_p:required + -description:required + -weight:required + -name:required + -plural_name:required + -package_id:required +} { + + Build a new content revision of a evaluation subtype. If new_item_p is + set true then a new item is first created, otherwise a new revision is created for + the item indicated by item_id. + + @param item_id The item to update or create. + @param content_type The type to make + @param content_table + @param new_item_p If true make a new item using item_id + +} { + + set creation_user [ad_verify_and_get_user_id] + set creation_ip [ad_conn peeraddr] + + set item_name "${content_type}_${item_id}" + + set revision_id [db_nextval acs_object_id_seq] + set revision_name "${content_type}_${revision_id}" + + if { $new_item_p } { + db_exec_plsql content_item_new { *SQL* } + + } + + db_exec_plsql content_revision_new { *SQL* } + + return $revision_id +} + + +ad_proc -public evaluation::set_relative_weight { +} { + Proc called in after upgrade callback from version 0.4d5 to 0.4d6 + Sets relative_weight field in table evaluation_tasks + +} { + set tasks [db_list_of_lists get_tasks {}] + set relative_weight 1 + + foreach task_id $tasks { + db_transaction { + db_dml update_task {} + } + } + +} + +ad_proc -public evaluation::set_forums_related { +} { + Proc called in after upgrade callback from version 0.4d7 to 0.4d8 + Sets forums_related_p field in table evaluation_tasks + +} { + set tasks [db_list_of_lists get_tasks {}] + set forums_related_p "f" + + foreach task_id $tasks { + db_transaction { + db_dml update_task {} + } + } + +} + + + +ad_proc -public evaluation::get_archive_extension {} { + return the archive extension that should be added to the output file of + an archive command +} { + return [parameter::get -parameter ArchiveExtension -default "txt"] +} + + + ad_register_proc GET /grades-sheet-csv* evaluation::generate_grades_sheet ad_register_proc POST /grades-sheet-csv* evaluation::generate_grades_sheet Index: openacs-4/packages/evaluation/tcl/evaluation-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/tcl/evaluation-procs.xql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/evaluation/tcl/evaluation-procs.xql 17 Nov 2004 23:58:17 -0000 1.1.2.1 +++ openacs-4/packages/evaluation/tcl/evaluation-procs.xql 8 Jun 2005 22:07:45 -0000 1.1.2.2 @@ -13,5 +13,81 @@ + + + + + select et.task_id, + et.weight as task_weight + from evaluation_tasksi et + where et.grade_item_id = (select item_id from cr_revisions where revision_id=:grade_id) + and content_revision__is_live(et.task_id) = true + + + + + + + + select grade_id, weight + from evaluation_grades + + + + + + update evaluation_tasks set points=:points + where task_id=:task_id + + + + + + + select task_id from evaluation_tasks + + + + + + + + update evaluation_tasks set perfect_score=:perfect_score + where task_id=:task_id + + + + + + select task_id from evaluation_tasks + + + + + + + + update evaluation_tasks set relative_weight=:relative_weight + where task_id=:task_id + + + + + + select task_id from evaluation_tasks + + + + + + + + update evaluation_tasks set forums_related_p=:forums_related_p + where task_id=:task_id + + + + + Index: openacs-4/packages/evaluation/www/answer-add-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/answer-add-edit.adp,v diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 --- openacs-4/packages/evaluation/www/answer-add-edit.adp 17 Nov 2004 23:58:17 -0000 1.1.1.1.2.1 +++ openacs-4/packages/evaluation/www/answer-add-edit.adp 8 Jun 2005 22:07:45 -0000 1.1.1.1.2.2 @@ -1,5 +1,4 @@ @page_title;noquote@ @context;noquote@ -

Index: openacs-4/packages/evaluation/www/answer-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/answer-add-edit.tcl,v diff -u -r1.12.2.1 -r1.12.2.2 --- openacs-4/packages/evaluation/www/answer-add-edit.tcl 17 Nov 2004 23:58:17 -0000 1.12.2.1 +++ openacs-4/packages/evaluation/www/answer-add-edit.tcl 8 Jun 2005 22:07:45 -0000 1.12.2.2 @@ -14,6 +14,7 @@ upload_file:trim,optional upload_file.tmpfile:tmpfile,optional return_url:notnull + {comment ""} } -validate { late_submit -requires { task_id:integer } { if { [string eq [db_string late_turn_in { *SQL* }] "f"] && [db_string compare_dates { *SQL* } -default 0] } { @@ -26,7 +27,7 @@ set user_id [ad_conn user_id] set party_id [db_string get_party_id { *SQL* }] - +set late_p [db_string compare_dates { *SQL* } -default 0] set package_id [ad_conn package_id] if { [ad_form_new_p -key answer_id] } { @@ -57,94 +58,94 @@ {label "[_ evaluation.URL__1]"} {value "http://"} } -} -ad_form -extend -name answer -form { - -} -edit_request { + {comment:text(textarea),optional + {label "Comment text"} + + } + } -edit_request { + db_1row item_data { *SQL* } - -} -validate { - {url - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || (![string eq $url "http://"] && [util_url_valid_p $url]) } - { [_ evaluation.lt_Upload_a_file_OR_a_va] } - } - {upload_file - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) } - { [_ evaluation.lt_Upload_a_file_OR_a_ur] } - } -} -on_submit { + } -validate { + {url + { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || (![string eq $url "http://"] && [util_url_valid_p $url]) } + { [_ evaluation.lt_Upload_a_file_OR_a_va] } + } + {upload_file + { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) } + { [_ evaluation.lt_Upload_a_file_OR_a_ur] } + } + } -on_submit { db_transaction { - - set mime_type "text/plain" - set title "" - set storage_type text - if { ![empty_string_p $upload_file] } { - - # Get the filename part of the upload file - if { ![regexp {[^//\\]+$} $upload_file filename] } { - # no match - set filename $upload_file - } - - set title [template::util::file::get_property filename $upload_file] - set mime_type [cr_filename_to_mime_type -create $title] - + + set mime_type "text/plain" + set title "" + set storage_type text + if { ![empty_string_p $upload_file] } { + + # Get the filename part of the upload file + if { ![regexp {[^//\\]+$} $upload_file filename] } { + # no match + set filename $upload_file + } + + set title [template::util::file::get_property filename $upload_file] + set mime_type [cr_filename_to_mime_type -create $title] + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { set storage_type file } else { set storage_type lob } - - } elseif { ![string eq $url "http://"] } { - set mime_type "text/plain" - set title "link" - set storage_type text - } - set title [evaluation::safe_url_name -name $title] - if { [ad_form_new_p -key answer_id] } { - set item_id $answer_id - } - - set revision_id [evaluation::new_answer -new_item_p [ad_form_new_p -key answer_id] -item_id $item_id -content_type evaluation_answers \ - -content_table evaluation_answers -content_id answer_id -storage_type $storage_type -task_item_id $task_item_id \ - -title $title -mime_type $mime_type -party_id $party_id] - + } elseif { ![string eq $url "http://"] } { + set mime_type "text/plain" + set title "link" + set storage_type text + } + + set title [evaluation::safe_url_name -name $title] + if { [ad_form_new_p -key answer_id] } { + set item_id $answer_id + } + + set revision_id [evaluation::new_answer -new_item_p [ad_form_new_p -key answer_id] -item_id $item_id -content_type evaluation_answers \ + -content_table evaluation_answers -content_id answer_id -storage_type $storage_type -task_item_id $task_item_id \ + -title $title -mime_type $mime_type -party_id $party_id -comment $comment] + evaluation::set_live -revision_id $revision_id - - if { ![empty_string_p $upload_file] } { - - set tmp_file [template::util::file::get_property tmp_filename $upload_file] - set content_length [file size $tmp_file] - - if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { - # create the new item - - set filename [cr_create_content_file $item_id $revision_id $tmp_file] - db_dml set_file_content { *SQL* } - - } else { - - # create the new item - db_dml lob_content { *SQL* } -blob_files [list $tmp_file] - - # Unfortunately, we can only calculate the file size after the lob is uploaded - db_dml lob_size { *SQL* } - } - - } elseif { ![string eq $url "http://"] } { - - db_dml link_content { *SQL* } - set content_length 0 - db_dml content_size { *SQL* } - + + if { ![empty_string_p $upload_file] } { + + set tmp_file [template::util::file::get_property tmp_filename $upload_file] + set content_length [file size $tmp_file] + + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { + # create the new item + + set filename [cr_create_content_file $item_id $revision_id $tmp_file] + db_dml set_file_content { *SQL* } + + } else { + + # create the new item + db_dml lob_content { *SQL* } -blob_files [list $tmp_file] + + # Unfortunately, we can only calculate the file size after the lob is uploaded + db_dml lob_size { *SQL* } } + + } elseif { ![string eq $url "http://"] } { + + db_dml link_content { *SQL* } + set content_length 0 + db_dml content_size { *SQL* } + + } } - - ad_returnredirect "answer-ok?return_url=\"$return_url\"" + ad_returnredirect "[export_vars -base answer-ok {return_url}]" ad_script_abort } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/answer-view.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/answer-view.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/answer-view.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/evaluation/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/index.adp,v diff -u -r1.10.2.1 -r1.10.2.2 --- openacs-4/packages/evaluation/www/index.adp 17 Nov 2004 23:58:17 -0000 1.10.2.1 +++ openacs-4/packages/evaluation/www/index.adp 8 Jun 2005 22:07:45 -0000 1.10.2.2 @@ -1,7 +1,7 @@ @page_title;noquote@ @context;noquote@ - + #evaluation.Evaluations_Admin# @@ -13,21 +13,37 @@
  • #evaluation.lt_There_are_no_tasks_fo#
  • +
  • @grades.grade_plural_name;noquote@
    +


  • + +

    #evaluation.Evaluations#

    +
    + +

    #evaluation.Evaluations_gradebook#

    +
    • #evaluation.lt_There_are_no_tasks_to#
    • + + + #evaluation.Evaluations_Admin# +
      +
      +
      +
    • @grades.grade_plural_name;noquote@
      +

    • Index: openacs-4/packages/evaluation/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/index.tcl,v diff -u -r1.8.2.1 -r1.8.2.2 --- openacs-4/packages/evaluation/www/index.tcl 17 Nov 2004 23:58:17 -0000 1.8.2.1 +++ openacs-4/packages/evaluation/www/index.tcl 8 Jun 2005 22:07:45 -0000 1.8.2.2 @@ -17,7 +17,7 @@ set context {} set package_id [ad_conn package_id] set user_id [ad_conn user_id] - +set simple_p [parameter::get -parameter "SimpleVersion"] set admin_p [permission::permission_p -party_id $user_id -object_id $package_id -privilege admin] db_multirow grades get_grades { *SQL* } { Index: openacs-4/packages/evaluation/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/index.adp,v diff -u -r1.11.2.1 -r1.11.2.2 --- openacs-4/packages/evaluation/www/admin/index.adp 17 Nov 2004 23:58:18 -0000 1.11.2.1 +++ openacs-4/packages/evaluation/www/admin/index.adp 8 Jun 2005 22:07:45 -0000 1.11.2.2 @@ -1,7 +1,21 @@ @page_title;noquote@ @context;noquote@ - + +

      #evaluation.Evaluations#

      +
      +
        +
      • #evaluation-portlet.lt_Admin_my_Assignment_T#
      • + #evaluation-portlet.admin_help#
        +
      • #evaluation-portlet.view_students_grades#
        + #evaluation-portlet.view_grades_help#

      • +
      • Notifications +
        + @assignments_notification_chunk;noquote@
      • +
        +
        + +

        #evaluation.Assignment_Types#

        • #evaluation.lt_Admin_my_Assignment_T#
        • @@ -28,11 +42,14 @@

          #evaluation.Evaluations#

          @evaluations_notification_chunk;noquote@

            +
          • #evaluation.lt_There_are_no_tasks_to#
          • +
          • @grades.grade_plural_name;noquote@
            +

          • Index: openacs-4/packages/evaluation/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/index.tcl,v diff -u -r1.12.2.1 -r1.12.2.2 --- openacs-4/packages/evaluation/www/admin/index.tcl 17 Nov 2004 23:58:18 -0000 1.12.2.1 +++ openacs-4/packages/evaluation/www/admin/index.tcl 8 Jun 2005 22:07:45 -0000 1.12.2.2 @@ -20,6 +20,7 @@ set package_id [ad_conn package_id] set user_id [ad_conn user_id] set admin_p [permission::permission_p -party_id $user_id -object_id $package_id -privilege admin] +set simple_p [parameter::get -parameter "SimpleVersion"] db_multirow grades get_grades { *SQL* } { Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/admin/version-select.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/admin/version-select.tcl'. Fisheye: No comparison available. Pass `N' to diff? 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 -r1.10.2.2 -r1.10.2.3 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl 23 Nov 2004 23:12:50 -0000 1.10.2.2 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl 8 Jun 2005 22:07:46 -0000 1.10.2.3 @@ -8,7 +8,7 @@ @cvs_id $Id$ } { task_id:integer,notnull - max_grade:integer,notnull,optional + max_grade:notnull,optional item_ids:array,integer,optional item_to_edit_ids:array,optional @@ -157,14 +157,14 @@ } else { set storage_type lob } - + set revision_id [evaluation::new_grades_sheet -new_item_p 1 -item_id $grades_sheet_item_id -content_type evaluation_grades_sheets \ -content_table evaluation_grades_sheets -content_id grades_sheet_id -storage_type $storage_type -task_item_id $task_item_id \ -title $title -mime_type $mime_type] evaluation::set_live -revision_id $revision_id set content_length [file size $tmp_filename] - + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { # create the new item @@ -188,7 +188,7 @@ } if { [info exists grades_gs($party_id)] && ![empty_string_p $grades_gs($party_id)] } { - set grades_gs($party_id) [expr ($grades_gs($party_id)*100)/$max_grade.0] + set grades_gs($party_id) [expr ($grades_gs($party_id)*$perfect_score)/[format %0.3f $max_grade]] set revision_id [evaluation::new_evaluation -new_item_p $new_p_gs($party_id) -item_id $item_ids($party_id) -content_type evaluation_student_evals \ -content_table evaluation_student_evals -content_id evaluation_id -description $comments_gs($party_id) \ -show_student_p $show_student_gs($party_id) -grade $grades_gs($party_id) -task_item_id $task_item_id -party_id $party_id] @@ -220,7 +220,7 @@ } else { set new_item_p 1 } - set grades_wa($party_id) [expr ($grades_wa($party_id)*100)/$max_grade.0] + set grades_wa($party_id) [expr ($grades_wa($party_id)*100)/[format %0.3f $max_grade]] set revision_id [evaluation::new_evaluation -new_item_p $new_item_p -item_id $item_ids($party_id) -content_type evaluation_student_evals \ -content_table evaluation_student_evals -content_id evaluation_id -description $comments_wa($party_id) \ -show_student_p $show_student_wa($party_id) -grade $grades_wa($party_id) -task_item_id $task_item_id -party_id $party_id] @@ -244,7 +244,7 @@ } else { set new_item_p 1 } - set grades_na($party_id) [expr ($grades_na($party_id)*100)/$max_grade.0] + set grades_na($party_id) [expr ($grades_na($party_id)*100)/[format %0.3f $max_grade]] set revision_id [evaluation::new_evaluation -new_item_p $new_item_p -item_id $item_ids($party_id) -content_type evaluation_student_evals \ -content_table evaluation_student_evals -content_id evaluation_id -description $comments_na($party_id) \ -show_student_p $show_student_na($party_id) -grade $grades_na($party_id) -task_item_id $task_item_id -party_id $party_id] @@ -257,7 +257,7 @@ db_transaction { foreach party_id [array names grades_to_edit] { if { [info exists grades_to_edit($party_id)] && ![empty_string_p $grades_to_edit($party_id)] } { - set grades_to_edit($party_id) [expr ($grades_to_edit($party_id)*100)/$max_grade.0] + set grades_to_edit($party_id) [expr ($grades_to_edit($party_id)*100)/[format %0.3f $max_grade]] set revision_id [evaluation::new_evaluation -new_item_p 0 -item_id $item_to_edit_ids($party_id) -content_type evaluation_student_evals \ -content_table evaluation_student_evals -content_id evaluation_id -description $reasons_to_edit($party_id) \ -show_student_p $show_student_to_edit($party_id) -grade $grades_to_edit($party_id) -task_item_id $task_item_id -party_id $party_id] Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.xql,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.xql 17 Nov 2004 23:58:19 -0000 1.3.2.1 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.xql 8 Jun 2005 22:07:46 -0000 1.3.2.2 @@ -37,7 +37,7 @@ - select task_item_id + select task_item_id,perfect_score from evaluation_tasks where task_id = :task_id 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.8.2.1 -r1.8.2.2 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl 17 Nov 2004 23:58:19 -0000 1.8.2.1 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl 8 Jun 2005 22:07:46 -0000 1.8.2.2 @@ -8,7 +8,7 @@ @cvs-id $Id$ } { task_id:integer,notnull - max_grade:integer,notnull + max_grade:notnull item_ids:array,integer,optional item_to_edit_ids:array,integer,optional @@ -127,6 +127,8 @@ } } +#ad_return_complaint 1 "[lc_numeric %.2f $max_grade]" +#ad_script_abort set page_title "[_ evaluation.lt_Confirm_Your_Evaluati]" set context [list [list "[export_vars -base student-list { task_id }]" "[_ evaluation.Studen_List_]"] "[_ evaluation.Confirm_Evaluation_]"] 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.5.2.1 -r1.5.2.2 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit-postgresql.xql 17 Nov 2004 23:58:19 -0000 1.5.2.1 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit-postgresql.xql 8 Jun 2005 22:07:46 -0000 1.5.2.2 @@ -57,5 +57,13 @@ + + + select perfect_score from evaluation_tasks where task_id=:task_id + + + + + Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl 17 Nov 2004 23:58:19 -0000 1.9.2.1 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl 8 Jun 2005 22:07:46 -0000 1.9.2.2 @@ -9,11 +9,15 @@ } { task_id:integer,notnull {return_url "student-list?[export_vars -url { task_id }]"} + grade_id:optional } set page_title "[_ evaluation.Edit_Evaluations_]" set context [list [list "[export_vars -base student-list { task_id }]" "[_ evaluation.Studen_List_]"] "[_ evaluation.Edit_Evaluations_]"] +set simple_p [parameter::get -parameter "SimpleVersion"] +set max_grade [db_string get_task_weight {}] + set elements [list party_name \ [list label "[_ evaluation.Name_]" \ orderby_asc {party_name asc} \ @@ -28,8 +32,9 @@ orderby_asc {submission_date asc} \ orderby_desc {submission_date desc}] \ grade \ - [list label "[_ evaluation.Maximun_Grade_] " \ - display_template { } ] \ + [list label "[_ evaluation.Maximun_Grade_] $max_grade" \ + display_template { + } ] \ edit_reason \ [list label "[_ evaluation.Edit_Reason_]" \ display_template { } \ @@ -54,8 +59,9 @@ } db_multirow -extend { answer answer_url radio_yes_checked radio_no_checked submission_date_pretty } evaluated_students get_evaluated_students { *SQL* } { - - set grade [lc_numeric $grade] + + set grade [format %0.2f [expr $grade*$max_grade/100]] + if { [string eq $online_p "t"] } { if { [db_0or1row get_answer_info { *SQL* }] } { Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list-postgresql.xql,v diff -u -r1.11.2.2 -r1.11.2.3 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list-postgresql.xql 9 Dec 2004 17:24:13 -0000 1.11.2.2 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list-postgresql.xql 8 Jun 2005 22:07:46 -0000 1.11.2.3 @@ -16,7 +16,9 @@ ev.last_modified as evaluation_date, et.online_p, et.due_date, - ev.evaluation_id + ev.evaluation_id, + et.forums_related_p, + (select description from evaluation_student_evalsx where evaluation_id=ev.evaluation_id) as comments from evaluation_tasks et, evaluation_student_evalsi ev, $roles_table @@ -53,7 +55,8 @@ ea.title as answer_title, ea.revision_id, to_char(ea.creation_date, 'YYYY-MM-DD HH24:MI:SS') as submission_date_ansi, - ea.last_modified as submission_date + ea.last_modified as submission_date, + (select comment from evaluation_answers where answer_id=ea.revision_id) as s_comment from evaluation_answersi ea, cr_items cri where ea.party_id = :party_id and ea.task_item_id = :task_item_id @@ -85,7 +88,8 @@ ev.revision_id, to_char(ev.last_modified, 'YYYY-MM-DD HH24:MI:SS') as submission_date_ansi, et.due_date, - ev.last_modified as submission_date + ev.last_modified as submission_date, + et.forums_related_p from evaluation_answersi ev, evaluation_tasks et, $roles_table @@ -112,7 +116,10 @@ et.weight as task_weight, to_char(et.due_date, 'YYYY-MM-DD HH24:MI:SS') as due_date_ansi, et.number_of_members, - et.online_p + et.online_p, + et.points, + et.perfect_score, + et.forums_related_p from evaluation_grades eg, evaluation_tasks et, cr_items cri where et.task_id = :task_id and et.grade_item_id = eg.grade_item_id @@ -139,4 +146,32 @@ + + + + + + + + + select ev.party_id, + case when et.number_of_members = 1 then + (select last_name||', '||first_names from persons where person_id = ev.party_id) + else + (select group_name from groups where group_id = ev.party_id) + end as party_name + from evaluation_answersi ev, + evaluation_tasks et, + $roles_table + cr_items cri + where ev.task_item_id = et.task_item_id + and et.task_id = :task_id + and ev.data is not null + $roles_clause + and cri.live_revision = ev.answer_id + $processed_clause + union $sql_query + + + \ No newline at end of file Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list.adp,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list.adp 17 Nov 2004 23:58:19 -0000 1.9.2.1 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.adp 8 Jun 2005 22:07:46 -0000 1.9.2.2 @@ -1,14 +1,73 @@ @page_title;noquote@ @context;noquote@ + + +

            @page_title;noquote@

            +
            +
            + + + + + + + + + + + + + + + + + + + + + < if @show_portrait_p@ eq "f"> + +< /if> + + < /else > + + + + + + +
            #evaluation.name#:@task_name@ (#evaluation.edit#)
            #evaluation.Due_Date#:@due_date_pretty@
            #evaluation.online#: + + #evaluation.Yes# + + #evaluation.No# + + +
            #evaluation.Perfect_Score#:@perfect_score@
            #evaluation.view_portraits#(#evaluation.yes_#/#evaluation.no_#)#evaluation.view_portraits#(#evaluation.yes_#/#evaluation.no_#)
            @groups_admin;noquote@
            +
            +
            + +
            + + + + + +
            #evaluation.lt_Evaluated_Students_to# +@actions;noquote@ +
            +
            +
            + - + @@ -28,16 +87,31 @@
            #evaluation.Task_Name# @task_name@
            #evaluation.Due_Date##evaluation.due_date# @due_date_pretty@
            @task_admin;noquote@
            - +

            #evaluation.lt_Evaluated_Students_to#

            #evaluation.Theese#

            +

            + + +
            + +
            + + + +
            #evaluation.lt_Students_with_answers#
            +
            +
            +

            #evaluation.lt_Students_with_answers#

            #evaluation.lt_These_are_the_student#

            +
            +

            #evaluation.Click# #evaluation.here# #evaluation.lt_if_you_want_to_downlo#

            @@ -48,15 +122,23 @@

            #evaluation.If#

            +
            + +
            + +
            + +
            +
            @@ -73,17 +155,55 @@
            +
            + + + + +

            #evaluation.lt_There_are_no_students#


            + +
            + +
            + + + +
            #evaluation.lt_Students_who_have_not#
            +
            +
            +

            #evaluation.lt_Students_who_have_not#

            -

            #evaluation.lt_These_are_the_student_1#

            +
            + +

            #evaluation.Click# #evaluation.here# #evaluation.lt_if_you_do_not_want_to#

            @@ -92,20 +212,26 @@

            #evaluation.If#

            - +
            - +
            #evaluation.lt_Grade_students_with_0# + +
            + +
            #evaluation.lt_Grade_students_with_0#

            + +
            @@ -122,13 +248,128 @@
            +
            + + +
            +
            + +
            + + + + + + + + +
            #evaluation.lt_Grade_students_using_#
            +
            +
          • #evaluation.lt_See_grades_sheets_ass# +
          • #evaluation.How_does_this_work# +
          +

          #evaluation.lt_There_are_no_students_1#

          #evaluation.lt_task_name_is_in_group#

          + + + +
          + +
          + + + +
          #evaluation.Class_Students#
          +
          +
          + +
          +

          #evaluation.Class_Students#

          +
          + +< if @number_of_members@ eq "1"> +< /if> +

          #evaluation.If#

          +
          +
          + + +
          + + +
          + + + + +
          + #evaluation.lt_Grade_students_with_0#
          +
          + + + #evaluation.lt_Grade_students_with_0# + +
          +
          + +
          + + + + + + + + + + + + + + +
          #evaluation.lt_Grade_students_using_#
          #evaluation.Generate_file##evaluation.lt_See_grades_sheets_ass##evaluation.How_does_this_work#
          +
          +
          + + + +
          +

          #evaluation.lt_There_are_no_students#

          +
          +
          +
          + + 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] Index: openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.tcl,v diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 --- openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.tcl 17 Nov 2004 23:58:23 -0000 1.1.1.1.2.1 +++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.tcl 8 Jun 2005 22:07:46 -0000 1.1.1.1.2.2 @@ -6,44 +6,75 @@ grade_id:integer,notnull no_grade:array weights:array + {weight_sum "0"} + {points_p "0"} + {info ""} + {relative_p 0} } -validate { valid_weights { - foreach id [array names weights] { - if { ![info exists weights($id)] } { - ad_complain "The task weight can't be null" - } else { - if { ![ad_var_type_check_number_p $weights($id)] } { - ad_complain "The task weight $weights($id) must be a valid number" - } - } + db_1row grade_info { *SQL* } + foreach id [array names weights] { + if { ![info exists weights($id)] } { + ad_complain "The task weight can't be null" + } else { + if { ![ad_var_type_check_number_p $weights($id)] } { + ad_complain "The task weight $weights($id) must be a valid number" } + + + } + } + } + weights_sum { + set count 0 + foreach id [array names weights] { + set count [expr $count+$weights($id)] + } + if { $count > 100} { + ad_complain "[_ evaluation.not_equal_100]" + } + } } - + +if {[string equal $info "[_ evaluation.Over_total_grade]"]} { + set points_p 1 +} + +if {[string equal $info "[_ evaluation.rel_weight]"]} { + set relative_p 1 +} + set without_grade [list] set with_grade [list] +set counter 0 + foreach id [array names weights] { + incr counter +} +foreach id [array names weights] { # create a list of tasks that requieres/not requires grade - if { [string eq $no_grade($id) "t"] } { - lappend with_grade $id + if { [string eq $no_grade($id) "t"] } { + lappend with_grade $id } else { lappend without_grade $id - } - - set aweight $weights($id) + } + set aweight [lc_numeric %.2f $weights($id)] + set apoints [format %0.2f [expr ($weights($id)*$grade_weight)/100.00]] + set rel_weight [format %0.2f [expr ($counter*$aweight/100.00)]] - db_dml update_task { *SQL* } - - if { [llength $with_grade] } { - db_dml update_tasks_with_grade { *SQL* } - } - if { [llength $without_grade] } { - db_dml update_tasks_without_grade { *SQL* } - } + db_dml update_task { *SQL* } + + if { [llength $with_grade] } { + db_dml update_tasks_with_grade { *SQL* } + } + if { [llength $without_grade] } { + db_dml update_tasks_without_grade { *SQL* } + } } -ad_returnredirect "grades" +ad_returnredirect "distribution-edit?grade_id=$grade_id" ad_script_abort Index: openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.xql,v diff -u -r1.2.2.1 -r1.2.2.2 --- openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.xql 17 Nov 2004 23:58:23 -0000 1.2.2.1 +++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit-2.xql 8 Jun 2005 22:07:46 -0000 1.2.2.2 @@ -7,7 +7,7 @@ update evaluation_tasks - set weight = :aweight + set weight = :aweight,points=:apoints,relative_weight=:rel_weight where task_id = :id @@ -29,4 +29,18 @@ + + + + select eg.grade_plural_name, + eg.weight as grade_weight, + eg.grade_item_id, + eg.comments as grade_comments + from evaluation_gradesi eg + where grade_id = :grade_id + + + + + Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/admin/grades/distribution-edit-3-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/admin/grades/distribution-edit-3.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/admin/grades/distribution-edit-3.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/evaluation/www/admin/grades/distribution-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/Attic/distribution-edit-postgresql.xql,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/evaluation/www/admin/grades/distribution-edit-postgresql.xql 17 Nov 2004 23:58:23 -0000 1.3.2.1 +++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit-postgresql.xql 8 Jun 2005 22:07:46 -0000 1.3.2.2 @@ -6,13 +6,15 @@ - select task_name, - weight as task_weight, - requires_grade_p, - task_id - from evaluation_tasksi - where grade_item_id = :grade_item_id - and content_revision__is_live(task_id) = true + select et.task_name, + et.weight as task_weight, + et.requires_grade_p, + et.task_id, + (select points from evaluation_tasks where task_id=et.task_id) as points, + (select relative_weight from evaluation_tasks where task_id=et.task_id) as relative_weight + from evaluation_tasksi et + where et.grade_item_id = :grade_item_id + and content_revision__is_live(et.task_id) = true order by task_name Index: openacs-4/packages/evaluation/www/admin/grades/distribution-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/distribution-edit.adp,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/evaluation/www/admin/grades/distribution-edit.adp 17 Nov 2004 23:58:23 -0000 1.5.2.1 +++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit.adp 8 Jun 2005 22:07:46 -0000 1.5.2.2 @@ -1,23 +1,77 @@ @page_title@ @context@ - + + +

          #evaluation.lt_Distribution_for_grad#

          +
          +
          +
          + +
          + + + +
          @grade_plural_name_up@ (@grade_weight@% #evaluation-portlet.total_grade#)
          +
          +
          +

          #evaluation.lt_Distribution_for_grad#

          @grade_comments@ - + +
          + +

          #evaluation.lt_grade_plural_name_rep_1#

          +
          - + + + + + + + + + + + + +
          + + + + + + +

          #evaluation.lt_There_are_no_tasks_as#

          - + + +
          + #evaluation.grade_weight_zero# +
          +
          +
          + + + + + + +
          + + +
          +
          Index: openacs-4/packages/evaluation/www/admin/grades/distribution-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/distribution-edit.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/evaluation/www/admin/grades/distribution-edit.tcl 17 Nov 2004 23:58:23 -0000 1.7.2.1 +++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit.tcl 8 Jun 2005 22:07:46 -0000 1.7.2.2 @@ -6,37 +6,57 @@ @author jopez@galileo.edu @creation-date Mar 2004 @cvs-id $Id$ + } { grade_id:integer,notnull } set user_id [ad_conn user_id] +set simple_p [parameter::get -parameter "SimpleVersion"] set page_title "[_ evaluation.lt_Assignment_Types_Dist]" set context [list [list "grades" "[_ evaluation.Assignment_Types_]"] "[_ evaluation.lt_Assignment_Types_Dist]"] - +set class "list" +if { $simple_p } { +set class "pbs_list" +} db_1row grade_info { *SQL* } - set elements [list task_name \ - [list label "[_ evaluation.Name_]" \ + [list label "[_ evaluation.name]" \ + display_template {@grades.task_name@}\ orderby_asc {task_name asc} \ orderby_desc {task_name desc}] \ task_weight \ - [list label "[_ evaluation.lt_Weight_over_grade_wei]" \ - display_template { % } \ + [list label "[_ evaluation.lt_Weight_over_grade]" \ + display_template {
          } \ aggregate sum \ - aggregate_label { Total } + aggregate_label { [_ evaluation.total]} ] \ + relative_weight \ + [list label "[_ evaluation.rel_weight]" \ + display_template {
          @grades.relative_weight@
          } \ + aggregate sum \ + ]\ requires_grade \ - [list label "[_ evaluation.Requires_Grade_]" \ + [list label "[_ evaluation.requires_grade]" \ display_template { [_ evaluation.Yes_] [_ evaluation.No_] } \ ] \ - ] - + + ] + + +# points \ + [list label "Weight over Total" \ + display_template { } \ + aggregate sum \ + aggregate_label { Total } ] + template::list::create \ -name grades \ -multirow grades \ -key task_id \ + -main_class $class \ + -sub_class narrow\ -filters { grade_id {} } \ -elements $elements @@ -49,7 +69,8 @@ db_multirow -extend { radio_yes_checked radio_no_checked } grades get_grade_tasks { *SQL* } { - set task_weight [lc_numeric %.2f $task_weight] + set task_weight [format %0.2f $task_weight] + if { [string eq $requires_grade_p "t"] } { set radio_yes_checked "checked" set radio_no_checked "" Index: openacs-4/packages/evaluation/www/admin/grades/distribution-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/distribution-edit.xql,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/evaluation/www/admin/grades/distribution-edit.xql 17 Nov 2004 23:58:23 -0000 1.4.2.1 +++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit.xql 8 Jun 2005 22:07:46 -0000 1.4.2.2 @@ -6,7 +6,7 @@ - select eg.grade_plural_name, + select eg.grade_plural_name,upper(eg.grade_plural_name) as grade_plural_name_up, eg.weight as grade_weight, eg.grade_item_id, eg.comments as grade_comments Index: openacs-4/packages/evaluation/www/admin/grades/grades-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-add-edit.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/evaluation/www/admin/grades/grades-add-edit.tcl 17 Nov 2004 23:58:23 -0000 1.7.2.1 +++ openacs-4/packages/evaluation/www/admin/grades/grades-add-edit.tcl 8 Jun 2005 22:07:46 -0000 1.7.2.2 @@ -27,22 +27,22 @@ grade_id:key {grade_name:text - {label "[_ evaluation.lt_Assignment_Type_Name_]"} + {label "[_ evaluation.lt_Assignment_Type_Name_]:"} {html {size 30}} } {grade_plural_name:text - {label "[_ evaluation.lt_Assignment_Plural_Typ]"} + {label "[_ evaluation.lt_Assignment_Plural_Typ]:"} {html {size 30}} } {weight:float - {label "[_ evaluation.lt_Weight_over_100_br__o]"} + {label "[_ evaluation.total_percentage]:"} {html {size 5}} } {comments:text(textarea),optional - {label "[_ evaluation.lt_Assignment_Types_Comm]"} + {label "[_ evaluation.lt_Assignment_Types_Comm]:"} {html {rows 4 cols 40}} } @@ -61,16 +61,21 @@ } -on_submit { db_transaction { - + set revision_id [evaluation::new_grade -new_item_p [ad_form_new_p -key grade_id] -item_id $grade_id -content_type evaluation_grades \ -content_table evaluation_grades -content_id grade_id -name $grade_name -plural_name $grade_plural_name -description $comments -weight $weight] evaluation::set_live -revision_id $revision_id + db_foreach get_grade_tasks get_grade_tasks { + set task_weight [format %0.2f [expr ($points*100)/$weight]] + db_dml update_tasks {} + } + } ad_returnredirect "grades" ad_script_abort -} + } ad_return_template Index: openacs-4/packages/evaluation/www/admin/grades/grades-add-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-add-edit.xql,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/evaluation/www/admin/grades/grades-add-edit.xql 17 Nov 2004 23:58:23 -0000 1.4.2.1 +++ openacs-4/packages/evaluation/www/admin/grades/grades-add-edit.xql 8 Jun 2005 22:07:46 -0000 1.4.2.2 @@ -14,4 +14,26 @@ + + + + select et.task_id, + (select points from evaluation_tasks where task_id=et.task_id) as points + from evaluation_tasksi et + where et.grade_item_id = :grade_id + and content_revision__is_live(et.task_id) = true + + + + + + + + update evaluation_tasks set weight=:task_weight where task_id=:task_id + + + + + + Index: openacs-4/packages/evaluation/www/admin/grades/grades-reports.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-reports.tcl,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/evaluation/www/admin/grades/grades-reports.tcl 17 Nov 2004 23:58:23 -0000 1.9.2.1 +++ openacs-4/packages/evaluation/www/admin/grades/grades-reports.tcl 8 Jun 2005 22:07:46 -0000 1.9.2.2 @@ -8,6 +8,7 @@ @author jopez@galileo.edu @cvs-id $Id$ + } { {orderby ""} } -validate { @@ -21,11 +22,15 @@ set page_title "[_ evaluation.Grades_Report_]" set context "[_ evaluation.Grades_Report_]" set package_id [ad_conn package_id] - +set simple_p [parameter::get -parameter "SimpleVersion"] # we have to decide if we are going to show all the users in the system # or only the students of a given class (community in dotrln) # in order to create the groups +set class "list" +if { $simple_p } { + set class "pbs_list" +} set community_id [dotlrn_community::get_community_id] if { [empty_string_p $community_id] } { set query_name grades_report @@ -53,18 +58,22 @@ append sql_query [db_map grade_total_grade] } + lappend elements total_grade \ [list label "[_ evaluation.Total_Grade_]" \ orderby_asc {total_grade asc} \ orderby_desc {total_grade desc} \ ] + append sql_query [db_map class_total_grade] template::list::create \ -name grades_report \ -multirow grades_report \ -key grade_id \ + -main_class $class \ + -sub_class narrow \ -elements $elements \ -pass_properties " $pass_grades " \ -orderby { default_value student_name } Index: openacs-4/packages/evaluation/www/admin/grades/grades.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades.adp,v diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2 --- openacs-4/packages/evaluation/www/admin/grades/grades.adp 17 Nov 2004 23:58:23 -0000 1.1.1.1.2.1 +++ openacs-4/packages/evaluation/www/admin/grades/grades.adp 8 Jun 2005 22:07:46 -0000 1.1.1.1.2.2 @@ -1,8 +1,24 @@ @page_title;noquote@ @context;noquote@ + + +

          @page_title;noquote@

          +
          +
          + +
          + + -
          + + +
          ALL ASIGNMENT TYPES + @actions;noquote@ +
          +
          +
          +

          @notice;noquote@

          Index: openacs-4/packages/evaluation/www/admin/grades/grades.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades.tcl,v diff -u -r1.11.2.2 -r1.11.2.3 --- openacs-4/packages/evaluation/www/admin/grades/grades.tcl 23 Apr 2005 11:12:55 -0000 1.11.2.2 +++ openacs-4/packages/evaluation/www/admin/grades/grades.tcl 8 Jun 2005 22:07:46 -0000 1.11.2.3 @@ -1,72 +1,93 @@ # /packages/evaluation/www/admin/grades/grades.tcl ad_page_contract { - + List of grades and options to admin grades - + @author jopez@galileo.edu @creation-date Feb 2004 - @cvs-id $Id$ - + @cvs-id $Id$ } -query { {orderby:optional} } set context [list "[_ evaluation.Grades_]"] set package_id [ad_conn package_id] +set simple_p [parameter::get -parameter "SimpleVersion"] +set class "list" +set aggregate "" +set bulk_actions [list "[_ evaluation.Add_assignment_type_]" [export_vars -base "grades-add-edit" { }]] set page_title "[_ evaluation.lt_Admin_Assignment_Type]" set return_url [ad_conn url] +set total 0 +set a_label [_ evaluation.total_of_course] +set actions "[_ evaluation.Add_assignment_type_]" -set actions [list "[_ evaluation.Add_assignment_type_]" [export_vars -base "grades-add-edit" { }]] +if { [lc_numeric %2.f [db_string sum_grades { *SQL* }]] > 100.00} { + set aggregate_label "[_ evaluation.Total_d]" +} else { + set aggregate_label "[_ evaluation.Total_d]" +} -if { [lc_numeric %.2f [db_string sum_grades { *SQL* }]] > 100.00} { - set aggregate_label "[_ evaluation.Total_]" + +if { !$simple_p } { + set aggregate_label "" + set aggregate "sum" + set total "Total" + set a_label "" } else { - set aggregate_label "[_ evaluation.Total_]" + set class "pbs_list" + set bulk_actions "" } + template::list::create \ -name grades \ -multirow grades \ - -actions $actions \ -key grade_id \ - -pass_properties { return_url aggregate_label } \ + -actions $bulk_actions \ + -main_class $class \ + -sub_class narrow \ + -pass_properties { return_url aggregate_label total a_label aggregate} \ -elements { grade_plural_name { - label "[_ evaluation.Name_]" + label "[_ evaluation.name]" orderby_asc {grade_plural_name asc} orderby_desc {grade_plural_name desc} link_url_eval {[export_vars -base "distribution-edit" { grade_id }]} link_html { title "View assignment type distribution" } + aggregate "" + aggregate_label {@aggregate_label;noquote@} } weight { label "[_ evaluation.lt_Weight_over_100_br__o]" orderby_asc {weight asc} orderby_desc {weight desc} display_template { @grades.weight@% } - aggregate sum - aggregate_label { @aggregate_label;noquote@ } + aggregate "$aggregate" + aggregate_label {@total;noquote@} } comments { - label "[_ evaluation.Description_]" + label "[_ evaluation.description]" orderby_asc {comments asc} orderby_desc {comments desc} + aggregate "" + aggregate_label {@a_label;noquote@} + } edit { label {} sub_class narrow - display_template { - + display_template {[_ evaluation-portlet.edit] } link_url_eval {[export_vars -base "grades-add-edit" { item_id grade_id }]} link_html { title "[_ evaluation.lt_Edit_assignment_type_]" } } delete { label {} sub_class narrow - display_template { - + display_template {[_ evaluation-portlet.delete] } link_url_eval {[export_vars -base "grades-delete" { grade_id return_url }]} link_html { title "[_ evaluation.lt_Delete_assignment_typ]" } @@ -79,19 +100,19 @@ set orderby " order by grade_plural_name asc" } -db_multirow grades get_class_grades { *SQL* } { - if [empty_string_p $weight] { - set weight [lc_numeric %.2f 0] - } else { - set weight [lc_numeric %.2f $weight] + + +db_multirow -extend {} grades get_class_grades { *SQL* } { + if { $simple_p } { + set total [expr $total + $weight] } } db_1row get_total_weight { *SQL* } set total_weight [lc_numeric %.2f $total_weight] -if { ![string eq $total_weight "100.00"] && ![string eq $total_weight "0"] } { +if { ($total_weight < 100 && $total_weight > 0) || $total_weight > 100} { set notice "[_ evaluation.lt_The_sum_of_the_weight]" } else { set notice "" Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/admin/grades/instructions.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/admin/grades/instructions.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.4.1 refers to a dead (removed) revision in file `openacs-4/packages/evaluation/www/admin/grades/instructions.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-postgresql.xql,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-postgresql.xql 17 Nov 2004 23:58:26 -0000 1.9.2.1 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-postgresql.xql 8 Jun 2005 22:07:46 -0000 1.9.2.2 @@ -6,15 +6,29 @@ - select grade_plural_name, - grade_name, - weight as grade_weight, - grade_item_id - from evaluation_grades where grade_id = :grade_id + select eg.grade_plural_name, (select count(et.task_id) from evaluation_tasks et where + et.grade_item_id = eg.grade_item_id and et.task_id=(select live_revision from cr_items where item_id=et.task_item_id)) as tasks_counter , + eg.grade_name, + eg.weight as grade_weight, + eg.grade_item_id + from evaluation_grades eg + where eg.grade_id = :grade_id + + + select * from evaluation_tasks et where + et.grade_item_id = :grade_item_id and et.task_id=(select live_revision from cr_items where item_id=et.task_item_id) + + + + + update evaluation_tasks set relative_weight=:relative_weight where task_id=:task_id + + + @@ -34,7 +48,7 @@ select et.task_name, et.description, to_char(et.due_date,'YYYY-MM-DD HH24:MI:SS') as due_date_ansi, - et.weight, et.number_of_members, et.online_p, et.late_submit_p, et.requires_grade_p + et.weight, et.number_of_members, et.online_p, et.late_submit_p, et.requires_grade_p,(select points from evaluation_tasks where task_id=:task_id) as points,(select perfect_score from evaluation_tasks where task_id=:task_id) as perfect_score,(select forums_related_p from evaluation_tasks where task_id=:task_id) as forums_related_p from evaluation_tasksi et where task_id = :task_id Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.adp,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.adp 17 Nov 2004 23:58:26 -0000 1.4.2.1 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.adp 8 Jun 2005 22:07:46 -0000 1.4.2.2 @@ -1,7 +1,6 @@ @page_title;noquote@ @context;noquote@ -