Index: openacs-4/packages/evaluation/catalog/evaluation.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/catalog/evaluation.en_US.ISO-8859-1.xml,v
diff -u -r1.17.2.3 -r1.17.2.4
--- openacs-4/packages/evaluation/catalog/evaluation.en_US.ISO-8859-1.xml 14 Jun 2005 15:47:14 -0000 1.17.2.3
+++ openacs-4/packages/evaluation/catalog/evaluation.en_US.ISO-8859-1.xml 16 Jun 2005 09:22:35 -0000 1.17.2.4
@@ -108,6 +108,7 @@
Delete Group
Delete Task
Delete task
+ Deleted
Description
DESCRIPTION
Description
@@ -359,6 +360,7 @@
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>
+ <span style=\"font-style: italic; color: red; font-size: 9pt;\">Deleted</span>
Student Scores for "%task_name%"
NOT YET SUBMITTED (%not_evaluated_with_no_answer%)
NOT YET GRADED (%not_evaluated_with_answer%)
@@ -524,6 +526,7 @@
You can't leave the due date empty if the students have to submit their answers online. due es ($due_date y online es $online_p )
You must give an edit reason (%old_grade% --> %grade_wo_reason%
Your total grade in this class is:
+ (make it live!)
Max Grade:
Maximun Grade:
File Upload Size
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.5.2.1 -r1.5.2.2
--- openacs-4/packages/evaluation/lib/evaluations-chunk.xql 31 May 2005 23:13:09 -0000 1.5.2.1
+++ openacs-4/packages/evaluation/lib/evaluations-chunk.xql 16 Jun 2005 09:22:36 -0000 1.5.2.2
@@ -16,7 +16,7 @@
select et.task_name,
round(et.weight,2) as task_weight,
- et.task_id, (select perfect_score from evaluation_tasks where task_id=et.task_id) as perfect_score, online_p
+ et.task_id, coalesce(perfect_score,0) 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
@@ -48,7 +48,7 @@
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
+ et.task_id, coalesce(perfect_score,0) as perfect_score
from evaluation_grades eg,
evaluation_tasksi et,
cr_items cri
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.31.2.2 -r1.31.2.3
--- openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 8 Jun 2005 18:57:14 -0000 1.31.2.2
+++ openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 16 Jun 2005 09:22:36 -0000 1.31.2.3
@@ -90,7 +90,7 @@
delete all grades
} {
db_1row get_grade_id { select grade_item_id from evaluation_grades where grade_id = :grade_id }
- db_foreach del_rec { select task_item_id from evaluation_tasks where grade_item_id = :grade_item_id } {
+ db_foreach del_rec { select task_item_id, task_id from evaluation_tasks where grade_item_id = :grade_item_id } {
db_foreach evaluation_delete_student_eval { select evaluation_id from evaluation_student_evals where task_item_id = :task_item_id } {
evaluation::revision_delete -revision_id $evaluation_id
}
@@ -103,8 +103,7 @@
db_foreach evaluation_delete_grades_sheet { select grades_sheet_id from evaluation_grades_sheets where task_item_id = :task_item_id } {
evaluation::revision_delete -revision_id $grades_sheet_id
}
- db_foreach evaluation_delete_task { select task_id from evaluation_tasks where task_item_id = :task_item_id } {
- evaluation::revision_delete -revision_id $task_id }
+ evaluation::revision_delete -revision_id $task_id
}
# db_1row get_grade_id { select grade_id as grade_task_id from evaluation_grades where grade_item_id = :grade_item_id}
evaluation::revision_delete -revision_id $grade_id
@@ -118,6 +117,48 @@
content::item::unset_live_revision -item_id [db_string get_revision_item_id {select item_id from cr_revisions where revision_id = :revision_id}]
}
+
+ad_proc -public evaluation::set_live_item {
+ -item_id
+} {
+ wrapper for contet::item::set_live_revision, in case the way items are deleted in the eval package ever change
+} {
+ content::item::set_live_revision -revision_id [content::item::get_best_revision -item_id $item_id]
+}
+
+ad_proc -public evaluation::set_live_grade {
+ -grade_item_id:required
+} {
+
+} {
+ evaluation::set_live_item -item_id $grade_item_id
+}
+
+ad_proc -public evaluation::set_live_task {
+ -task_item_id:required
+} {
+
+} {
+
+ db_foreach evaluation_deleted_student_eval { select evaluation_item_id from evaluation_student_evals, cr_items where task_item_id = :task_item_id and (live_revision = evaluation_id or latest_revision = evaluation_id) and evaluation_item_id = item_id } {
+ evaluation::set_live_item -item_id $evaluation_item_id
+ }
+
+ db_foreach evaluation_deleted_answer { select answer_item_id from evaluation_answers, cr_items where task_item_id = :task_item_id and (live_revision = answer_id or latest_revision = answer_id) and answer_item_id = item_id } {
+ evaluation::set_live_item -item_id $answer_item_id
+ }
+
+ db_foreach evaluation_deleted_task_sol { select solution_item_id from evaluation_tasks_sols, cr_items where task_item_id = :task_item_id and (live_revision = solution_id or latest_revision = solution_id) and solution_item_id = item_id } {
+ evaluation::set_live_item -revision_id $solution_item_id
+ }
+ db_foreach evaluation_deleted_grades_sheet { select grades_sheet_item_id from evaluation_grades_sheets, cr_items where task_item_id = :task_item_id and (live_revision = grades_sheet_id or latest_revision = grades_sheet_id) and grades_sheet_item_id = item_id } {
+ evaluation::set_live_item -revision_id $grades_sheet_item_id
+ }
+
+ evaluation::set_live_item -item_id $task_item_id
+
+}
+
ad_proc -public evaluation::delete_task {
-task_id:required
} {
Index: openacs-4/packages/evaluation/www/admin/grades/distribution-edit-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/Attic/distribution-edit-oracle.xql,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/evaluation/www/admin/grades/distribution-edit-oracle.xql 4 Apr 2005 18:22:36 -0000 1.1
+++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit-oracle.xql 16 Jun 2005 09:22:36 -0000 1.1.2.1
@@ -6,15 +6,18 @@
- 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) = 't'
+ select et.task_item_id,
+ et.task_name,
+ et.weight as task_weight,
+ et.requires_grade_p,
+ et.task_id,
+ cri.live_revision
+ from evaluation_tasksi et, cr_items cri
+ where et.grade_item_id = :grade_item_id
+ and (cri.live_revision = et.task_id or cri.latest_revision = et.task_id)
+ and cri.item_id = et.task_item_id
order by task_name
-
+
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.4.1 -r1.3.4.2
--- openacs-4/packages/evaluation/www/admin/grades/distribution-edit-postgresql.xql 31 May 2005 23:13:11 -0000 1.3.4.1
+++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit-postgresql.xql 16 Jun 2005 09:22:36 -0000 1.3.4.2
@@ -6,15 +6,18 @@
- select et.task_name,
+ select et.task_item_id,
+ 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
+ et.points,
+ coalesce(et.relative_weight,0) as relative_weight,
+ cri.live_revision
+ from evaluation_tasksi et, cr_items cri
where et.grade_item_id = :grade_item_id
- and content_revision__is_live(et.task_id) = true
+ and (cri.live_revision = et.task_id or cri.latest_revision = et.task_id)
+ and cri.item_id = et.task_item_id
order by task_name
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.9.2.1 -r1.9.2.2
--- openacs-4/packages/evaluation/www/admin/grades/distribution-edit.tcl 31 May 2005 23:13:11 -0000 1.9.2.1
+++ openacs-4/packages/evaluation/www/admin/grades/distribution-edit.tcl 16 Jun 2005 09:22:36 -0000 1.9.2.2
@@ -9,6 +9,7 @@
} {
grade_id:integer,notnull
+ {set_task_id_live:optional ""}
}
set user_id [ad_conn user_id]
@@ -18,9 +19,16 @@
set context [list [list "grades" "[_ evaluation.Assignment_Types_]"] "[_ evaluation.lt_Assignment_Types_Dist]"]
set class "list"
if { $simple_p } {
-set class "pbs_list"
+ set class "pbs_list"
}
+
db_1row grade_info { *SQL* }
+
+if { ![empty_string_p $set_task_id_live] } {
+ evaluation::set_live_task -task_item_id $set_task_id_live
+}
+
+ns_log notice "el grade es $grade_item_id !!"
set elements [list task_name \
[list label "[_ evaluation.name]" \
display_template {@grades.task_name@}\
@@ -31,18 +39,23 @@
display_template { center>} \
aggregate sum \
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]" \
display_template { [_ evaluation.Yes_] [_ evaluation.No_] } \
- ] \
-
- ]
+ ] \
+ delete \
+ [list label {} \
+ sub_class narrow \
+ display_template { @grades.delete_template;noquote@ } \
+ link_html { title "[_ evaluation.lt_Delete_assignment_typ]" } \
+ ] \
+ ]
# points \
@@ -67,7 +80,9 @@
set orderby " order by task_name asc"
}
-db_multirow -extend { radio_yes_checked radio_no_checked } grades get_grade_tasks { *SQL* } {
+set return_url "../grades/distribution-edit?[export_vars { grade_id } ]"
+
+db_multirow -extend { radio_yes_checked radio_no_checked delete_template } grades get_grade_tasks { *SQL* } {
set task_weight [format %0.2f $task_weight]
@@ -78,9 +93,19 @@
set radio_yes_checked ""
set radio_no_checked "checked"
}
+
+ if { [empty_string_p $live_revision] } {
+ set delete_template "[_ evaluation.Deleted] [_ evaluation.make_it_live]"
+ } elseif { $simple_p } {
+ set delete_template "[_ evaluation-portlet.Delete]"
+ } else {
+ set delete_template ""
+ }
+
}
+
Index: openacs-4/packages/evaluation/www/admin/grades/grades-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-oracle.xql,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/evaluation/www/admin/grades/grades-oracle.xql 8 Apr 2005 08:19:18 -0000 1.1
+++ openacs-4/packages/evaluation/www/admin/grades/grades-oracle.xql 16 Jun 2005 09:22:36 -0000 1.1.2.1
@@ -10,10 +10,12 @@
eg.item_id,
eg.grade_plural_name,
eg.comments,
- eg.weight
- from evaluation_gradesx eg, acs_objects ao
- where content_revision.is_live(eg.grade_id) = 't'
- and eg.item_id = ao.object_id
+ eg.weight,
+ cri.live_revision
+ from evaluation_gradesx eg, acs_objects ao, cr_items cri
+ where eg.item_id = ao.object_id
+ and eg.grade_item_id = cri.item_id
+ and (cri.live_revision = eg.grade_id or cri.latest_revision = eg.grade_id)
and ao.context_id = :package_id
$orderby
Index: openacs-4/packages/evaluation/www/admin/grades/grades-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-postgresql.xql,v
diff -u -r1.6 -r1.6.4.1
--- openacs-4/packages/evaluation/www/admin/grades/grades-postgresql.xql 18 Aug 2004 17:07:10 -0000 1.6
+++ openacs-4/packages/evaluation/www/admin/grades/grades-postgresql.xql 16 Jun 2005 09:22:36 -0000 1.6.4.1
@@ -10,10 +10,12 @@
eg.item_id,
eg.grade_plural_name,
eg.comments,
- eg.weight
- from evaluation_gradesx eg, acs_objects ao
- where content_revision__is_live(eg.grade_id) = true
- and eg.item_id = ao.object_id
+ eg.weight,
+ cri.live_revision
+ from evaluation_gradesx eg, acs_objects ao, cr_items cri
+ where eg.item_id = ao.object_id
+ and eg.grade_item_id = cri.item_id
+ and (cri.live_revision = eg.grade_id or cri.latest_revision = eg.grade_id)
and ao.context_id = :package_id
$orderby
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.14.2.2 -r1.14.2.3
--- openacs-4/packages/evaluation/www/admin/grades/grades.tcl 8 Jun 2005 18:57:14 -0000 1.14.2.2
+++ openacs-4/packages/evaluation/www/admin/grades/grades.tcl 16 Jun 2005 09:22:36 -0000 1.14.2.3
@@ -9,6 +9,7 @@
@cvs-id $Id$
} -query {
{orderby:optional}
+ {set_grade_id_live:optional ""}
}
set context [list "[_ evaluation.Grades_]"]
@@ -24,6 +25,10 @@
set a_label [_ evaluation.total_of_course]
set actions "[_ evaluation.Add_assignment_type_]"
+if { ![empty_string_p $set_grade_id_live] } {
+ evaluation::set_live_grade -grade_item_id $set_grade_id_live
+}
+
if { [lc_numeric %2.f [db_string sum_grades { *SQL* }]] > 100.00} {
set aggregate_label "[_ evaluation.Total_d]"
} else {
@@ -86,9 +91,7 @@
delete {
label {}
sub_class narrow
- display_template {[_ evaluation-portlet.delete]
- }
- link_url_eval {[export_vars -base "grades-delete" { grade_id return_url }]}
+ display_template {@grades.delete_template;noquote@}
link_html { title "[_ evaluation.lt_Delete_assignment_typ]" }
}
}
@@ -100,10 +103,17 @@
}
-db_multirow -extend {} grades get_class_grades { *SQL* } {
+db_multirow -extend { delete_template } grades get_class_grades { *SQL* } {
if { $simple_p } {
set total [expr $total + $weight]
}
+ if { [empty_string_p $live_revision] } {
+ set delete_template "[_ evaluation.Deleted] [_ evaluation.make_it_live]"
+ } elseif { $simple_p } {
+ set delete_template "[_ evaluation-portlet.Delete]"
+ } else {
+ set delete_template ""
+ }
}
db_1row get_total_weight { *SQL* }
Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.xql,v
diff -u -r1.2.2.2 -r1.2.2.3
--- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.xql 14 Jun 2005 15:47:14 -0000 1.2.2.2
+++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.xql 16 Jun 2005 09:22:36 -0000 1.2.2.3
@@ -5,8 +5,8 @@
- 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 ,
+ select eg.grade_plural_name, (select count(et.task_id) from evaluation_tasks et, cr_items cri where
+ et.grade_item_id = eg.grade_item_id and et.task_id=cri.live_revision) as tasks_counter,
eg.grade_name,
eg.weight as grade_weight,
eg.grade_item_id