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.4 -r1.5
--- openacs-4/packages/evaluation/lib/evaluations-chunk-postgresql.xql 30 Jul 2004 22:50:07 -0000 1.4
+++ openacs-4/packages/evaluation/lib/evaluations-chunk-postgresql.xql 30 Aug 2004 13:04:31 -0000 1.5
@@ -8,9 +8,9 @@
select et.task_name, et.weight as task_weight,
et.task_id
- from evaluation_tasksi et
+ from evaluation_tasksi et, cr_items cri
where grade_item_id = :grade_item_id
- and content_revision__is_live(et.task_id) = true
+ and cri.live_revision = et.task_id
$evaluations_orderby
@@ -20,28 +20,20 @@
select et.task_name,
- ese.grade,
- ese.description as comments,
- ese.show_student_p,
+ et.task_item_id,
+ et.weight as t_weight,
+ eg.weight as g_weight,
(et.weight*eg.weight)/100 as task_weight,
- (ese.grade*et.weight*eg.weight)/10000 as task_grade,
et.number_of_members,
- et.task_id,
- ea.data as answer_data,
- ea.title as answer_title,
- ea.answer_id
+ et.task_id
from evaluation_grades eg,
- evaluation_tasks et2 left outer join evaluation_student_evalsi ese on (ese.task_item_id = et2.task_item_id and content_revision__is_live(ese.evaluation_id) = true
- and ese.party_id = evaluation__party_id(:user_id,et2.task_id)),
- evaluation_tasks et left outer join evaluation_answersi ea on (ea.task_item_id = et.task_item_id and content_revision__is_live(ea.answer_id) = true
- and ea.party_id = evaluation__party_id(:user_id,et.task_id))
- where eg.grade_item_id = :grade_item_id
+ evaluation_tasksi et,
+ cr_items cri
+ where eg.grade_id = :grade_id
and eg.grade_item_id = et.grade_item_id
- and et.task_id = et2.task_id
- and content_revision__is_live(et.task_id) = true
- and content_revision__is_live(eg.grade_id) = true
+ and cri.live_revision = et.task_id
$evaluations_orderby
-
+
@@ -53,4 +45,33 @@
+
+
+
+ select ese.grade,
+ ese.description as comments,
+ ese.show_student_p,
+ (ese.grade*:t_weight*:g_weight)/10000 as task_grade
+ from evaluation_student_evalsi ese, cr_items cri
+ where ese.task_item_id = :task_item_id
+ and cri.live_revision = ese.evaluation_id
+ and ese.party_id = evaluation__party_id(:user_id,:task_id)
+
+
+
+
+
+
+
+ select ea.data as answer_data,
+ ea.title as answer_title,
+ ea.answer_id
+ from evaluation_answersi ea, cr_items cri
+ where ea.task_item_id = :task_item_id
+ and cri.live_revision = ea.answer_id
+ and ea.party_id = evaluation__party_id(:user_id,:task_id)
+
+
+
+
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.10 -r1.11
--- openacs-4/packages/evaluation/lib/evaluations-chunk.tcl 24 Aug 2004 22:40:30 -0000 1.10
+++ openacs-4/packages/evaluation/lib/evaluations-chunk.tcl 30 Aug 2004 13:04:32 -0000 1.11
@@ -89,57 +89,67 @@
}
} else {
- db_multirow -extend { comments comments_url answer answer_url } grade_tasks get_grade_tasks { *SQL* } {
+ db_multirow -extend { comments comments_url answer answer_url grade } grade_tasks get_grade_tasks { *SQL* } {
- if { ![empty_string_p $comments] } {
- set comments "[_ evaluation-portlet.View_comments_]"
- set comments_url evaluation_view
- }
-
- set over_weight ""
- if { ![empty_string_p $show_student_p] && $show_student_p } {
+ if { [db_0or1row get_evaluaiton_info { *SQL* }] } {
- if { ![empty_string_p $grade] } {
- set grade [format %.2f [lc_numeric $grade]]
- set over_weight "[format %.2f [lc_numeric $task_grade]]/"
- set total_grade [expr $total_grade + $task_grade]
- } else {
- set grade "[_ evaluation-portlet.Not_evaluated_]"
+ if { ![empty_string_p $comments] } {
+ set comments "[_ evaluation-portlet.View_comments_]"
+ set comments_url evaluation_view
}
- set max_grade [expr $task_weight + $max_grade]
- set task_weight "${over_weight}[format %.2f [lc_numeric $task_weight]]"
+ set over_weight ""
+ if { ![empty_string_p $show_student_p] && $show_student_p } {
+ if { ![empty_string_p $grade] } {
+ set grade [format %.2f [lc_numeric $grade]]
+ set over_weight "[format %.2f [lc_numeric $task_grade]]/"
+ set total_grade [expr $total_grade + $task_grade]
+ } else {
+ set grade "[_ evaluation-portlet.Not_evaluated_]"
+ }
+
+ set max_grade [expr $task_weight + $max_grade]
+ set task_weight "${over_weight}[format %.2f [lc_numeric $task_weight]]"
+
+ } else {
+ set grade "[_ evaluation-portlet.Not_available_]"
+ set task_weight "[_ evaluation-portlet.Not_available_]"
+ }
} else {
+ set grade "[_ evaluation-portlet.Not_evaluated_]"
set grade "[_ evaluation-portlet.Not_available_]"
set task_weight "[_ evaluation-portlet.Not_available_]"
}
- # working with answer stuff (if it has a file/url attached)
- if { [empty_string_p $answer_data] } {
+
+ if { [db_0or1row get_answer_info { *SQL* }] } {
+ # 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,
+ # so we have to deal with this case
+ array set community_info [site_node::get -url "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]][evaluation::package_key]"]
+ if { ![regexp ([join [split [parameter::get -parameter urlProtocols -package_id $community_info(package_id)] ","] "|"]) "$answer_data"] } {
+ set answer_data "http://$answer_data"
+ }
+ set answer_url "[export_vars -base "$answer_data" { }]"
+ set answer "[_ evaluation-portlet.View_my_answer_]"
+ } else {
+ # we assume it's a file
+ set answer_url "[export_vars -base "${base_url}view/$answer_title" { {revision_id $answer_id} }]"
+ set answer "[_ evaluation-portlet.View_my_answer_]"
+ }
+
+ if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } {
+ set answer ""
+ set answer_url ""
+ set grade "[_ evaluation-portlet.No_group_for_task_]"
+ }
+ } else {
set answer_url ""
set answer ""
- } elseif { [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,
- # so we have to deal with this case
- array set community_info [site_node::get -url "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]][evaluation::package_key]"]
- if { ![regexp ([join [split [parameter::get -parameter urlProtocols -package_id $community_info(package_id)] ","] "|"]) "$answer_data"] } {
- set answer_data "http://$answer_data"
- }
- set answer_url "[export_vars -base "$answer_data" { }]"
- set answer "[_ evaluation-portlet.View_my_answer_]"
- } else {
- # we assume it's a file
- set answer_url "[export_vars -base "${base_url}view/$answer_title" { {revision_id $answer_id} }]"
- set answer "[_ evaluation-portlet.View_my_answer_]"
}
- if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } {
- set answer ""
- set answer_url ""
- set grade "[_ evaluation-portlet.No_group_for_task_]"
- }
-
}
}
Index: openacs-4/packages/evaluation/lib/tasks-chunk-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/Attic/tasks-chunk-postgresql.xql,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/evaluation/lib/tasks-chunk-postgresql.xql 12 Aug 2004 17:46:41 -0000 1.10
+++ openacs-4/packages/evaluation/lib/tasks-chunk-postgresql.xql 30 Aug 2004 13:04:32 -0000 1.11
@@ -10,18 +10,19 @@
to_char(et.due_date,'YYYY-MM-DD HH24:MI:SS') as due_date_ansi,
et.online_p,
et.late_submit_p,
+ et.task_item_id,
et.item_id,
et.requires_grade_p, et.description, et.grade_item_id,
coalesce(cr.content_length,0) as content_length,
et.data as task_data,
cr.title as task_title,
- et.task_id as revision_id,
- ets.solution_id as solution_id
+ et.task_id as revision_id
from cr_revisions cr,
- evaluation_tasksi et left outer join evaluation_tasks_solsi ets on (ets.task_item_id = et.task_item_id and content_revision__is_live(ets.solution_id) = true)
+ evaluation_tasksi et,
+ cr_items cri
where cr.revision_id = et.revision_id
and et.grade_item_id = :grade_item_id
- and content_revision__is_live(et.task_id) = true
+ and cri.live_revision = et.task_id
$assignments_orderby
@@ -35,20 +36,20 @@
et.online_p,
et.late_submit_p,
et.item_id,
+ et.task_item_id,
et.due_date,
et.requires_grade_p, et.description, et.grade_item_id,
cr.title as task_title,
et.data as task_data,
et.task_id as revision_id,
coalesce(cr.content_length,0) as content_length,
- et.late_submit_p,
- ea.answer_id as answer_id
+ et.late_submit_p
from cr_revisions cr,
- evaluation_tasksi et left outer join evaluation_answersi ea on (ea.task_item_id = et.task_item_id and content_revision__is_live(ea.answer_id) = true
- and ea.party_id = evaluation__party_id(:user_id,et.task_id))
+ evaluation_tasksi et,
+ cr_items cri
where cr.revision_id = et.revision_id
and grade_item_id = :grade_item_id
- and content_revision__is_live(et.task_id) = true
+ and cri.live_revision = et.task_id
$assignments_orderby
@@ -73,12 +74,36 @@
- select grade_name, grade_plural_name
- from evaluation_grades
- where grade_item_id = :grade_item_id and content_revision__is_live(grade_id) = true
+ select eg.grade_name, eg.grade_plural_name
+ from evaluation_grades eg, cr_items cri
+ where eg.grade_item_id = :grade_item_id
+ and cri.live_revision = eg.grade_id
+
+
+
+ select ets.solution_id
+ from evaluation_tasks_sols ets, cr_items cri
+ where ets.task_item_id = :task_item_id
+ and cri.live_revision = ets.solution_id
+
+
+
+
+
+
+
+ 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 = evaluation__party_id(:user_id,:task_id)
+
+
+
+
Index: openacs-4/packages/evaluation/lib/tasks-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/tasks-chunk.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/evaluation/lib/tasks-chunk.tcl 26 Aug 2004 01:46:38 -0000 1.12
+++ openacs-4/packages/evaluation/lib/tasks-chunk.tcl 30 Aug 2004 13:04:32 -0000 1.13
@@ -96,6 +96,7 @@
db_multirow -extend { solution_url due_date_pretty solution solution_mode task_url groups_admin groups_admin_url } tasks_admin get_tasks_admin { *SQL* } {
set due_date_pretty [lc_time_fmt $due_date_ansi "%q %r"]
+
# working with task stuff (if it has a file/url attached)
if { [empty_string_p $task_data] } {
set task_url "[export_vars -base "${base_url}task-view" { grade_id task_id return_url }]"
@@ -117,7 +118,7 @@
set task_name "$task_name ([format %.0f [lc_numeric [expr ($content_length/1024)]]] Kb)"
}
- if { ![empty_string_p $solution_id] } {
+ 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_]"
@@ -161,7 +162,7 @@
if { [string eq $online_p "t"] } {
if { [db_string compare_due_date { *SQL* } -default 0] } {
- if { [empty_string_p $answer_id] } {
+ if { ![db_0or1row answer_info { *SQL* }] } {
set answer "[_ evaluation-portlet.submit_answer_]"
set answer_mode edit
set answer_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id return_url answer_mode }]"
@@ -171,7 +172,7 @@
set answer_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 { [empty_string_p $answer_id] } {
+ if { ![db_0or1row answer_info { *SQL* }] } {
set answer "[_ evaluation-portlet.lt_submit_answer_style_f]"
set answer_mode edit
set answer_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id return_url answer_mode }]"
@@ -189,3 +190,4 @@
}
}
+
Index: openacs-4/packages/evaluation-portlet/lib/evaluations-chunk-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/lib/evaluations-chunk-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/evaluation-portlet/lib/evaluations-chunk-postgresql.xql 30 Jul 2004 22:51:49 -0000 1.3
+++ openacs-4/packages/evaluation-portlet/lib/evaluations-chunk-postgresql.xql 30 Aug 2004 13:05:00 -0000 1.4
@@ -8,9 +8,9 @@
select et.task_name, et.weight as task_weight,
et.task_id
- from evaluation_tasksi et
+ from evaluation_tasksi et, cr_items cri
where grade_item_id = :grade_item_id
- and content_revision__is_live(et.task_id) = true
+ and cri.live_revision = et.task_id
$evaluations_orderby
@@ -20,26 +20,18 @@
select et.task_name,
- ese.grade,
- ese.description as comments,
- ese.show_student_p,
+ et.task_item_id,
+ et.weight as t_weight,
+ eg.weight as g_weight,
(et.weight*eg.weight)/100 as task_weight,
- (ese.grade*et.weight*eg.weight)/10000 as task_grade,
et.number_of_members,
- et.task_id,
- ea.data as answer_data,
- ea.title as answer_title,
- ea.answer_id
+ et.task_id
from evaluation_grades eg,
- evaluation_tasks et2 left outer join evaluation_student_evalsi ese on (ese.task_item_id = et2.task_item_id and content_revision__is_live(ese.evaluation_id) = true
- and ese.party_id = evaluation__party_id(:user_id,et2.task_id)),
- evaluation_tasks et left outer join evaluation_answersi ea on (ea.task_item_id = et.task_item_id and content_revision__is_live(ea.answer_id) = true
- and ea.party_id = evaluation__party_id(:user_id,et.task_id))
- where eg.grade_item_id = :grade_item_id
+ evaluation_tasksi et,
+ cr_items cri
+ where eg.grade_id = :grade_id
and eg.grade_item_id = et.grade_item_id
- and et.task_id = et2.task_id
- and content_revision__is_live(et.task_id) = true
- and content_revision__is_live(eg.grade_id) = true
+ and cri.live_revision = et.task_id
$evaluations_orderby
@@ -53,4 +45,34 @@
+
+
+
+ select ese.grade,
+ ese.description as comments,
+ ese.show_student_p,
+ (ese.grade*:t_weight*:g_weight)/10000 as task_grade
+ from evaluation_student_evalsi ese, cr_items cri
+ where ese.task_item_id = :task_item_id
+ and cri.live_revision = ese.evaluation_id
+ and ese.party_id = evaluation__party_id(:user_id,:task_id)
+
+
+
+
+
+
+
+ select ea.data as answer_data,
+ ea.title as answer_title,
+ ea.answer_id
+ from evaluation_answersi ea, cr_items cri
+ where ea.task_item_id = :task_item_id
+ and cri.live_revision = ea.answer_id
+ and ea.party_id = evaluation__party_id(:user_id,:task_id)
+
+
+
+
+
Index: openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.tcl 26 Aug 2004 01:47:48 -0000 1.8
+++ openacs-4/packages/evaluation-portlet/lib/evaluations-chunk.tcl 30 Aug 2004 13:05:00 -0000 1.9
@@ -89,57 +89,67 @@
}
} else {
- db_multirow -extend { comments comments_url answer answer_url } grade_tasks get_grade_tasks { *SQL* } {
+ db_multirow -extend { comments comments_url answer answer_url grade } grade_tasks get_grade_tasks { *SQL* } {
- if { ![empty_string_p $comments] } {
- set comments "[_ evaluation-portlet.View_comments_]"
- set comments_url evaluation_view
- }
-
- set over_weight ""
- if { ![empty_string_p $show_student_p] && $show_student_p } {
+ if { [db_0or1row get_evaluaiton_info { *SQL* }] } {
- if { ![empty_string_p $grade] } {
- set grade [format %.2f [lc_numeric $grade]]
- set over_weight "[format %.2f [lc_numeric $task_grade]]/"
- set total_grade [expr $total_grade + $task_grade]
- } else {
- set grade "[_ evaluation-portlet.Not_evaluated_]"
+ if { ![empty_string_p $comments] } {
+ set comments "[_ evaluation-portlet.View_comments_]"
+ set comments_url evaluation_view
}
- set max_grade [expr $task_weight + $max_grade]
- set task_weight "${over_weight}[format %.2f [lc_numeric $task_weight]]"
+ set over_weight ""
+ if { ![empty_string_p $show_student_p] && $show_student_p } {
+ if { ![empty_string_p $grade] } {
+ set grade [format %.2f [lc_numeric $grade]]
+ set over_weight "[format %.2f [lc_numeric $task_grade]]/"
+ set total_grade [expr $total_grade + $task_grade]
+ } else {
+ set grade "[_ evaluation-portlet.Not_evaluated_]"
+ }
+
+ set max_grade [expr $task_weight + $max_grade]
+ set task_weight "${over_weight}[format %.2f [lc_numeric $task_weight]]"
+
+ } else {
+ set grade "[_ evaluation-portlet.Not_available_]"
+ set task_weight "[_ evaluation-portlet.Not_available_]"
+ }
} else {
+ set grade "[_ evaluation-portlet.Not_evaluated_]"
set grade "[_ evaluation-portlet.Not_available_]"
set task_weight "[_ evaluation-portlet.Not_available_]"
}
- # working with answer stuff (if it has a file/url attached)
- if { [empty_string_p $answer_data] } {
+
+ if { [db_0or1row get_answer_info { *SQL* }] } {
+ # 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,
+ # so we have to deal with this case
+ array set community_info [site_node::get -url "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]][evaluation::package_key]"]
+ if { ![regexp ([join [split [parameter::get -parameter urlProtocols -package_id $community_info(package_id)] ","] "|"]) "$answer_data"] } {
+ set answer_data "http://$answer_data"
+ }
+ set answer_url "[export_vars -base "$answer_data" { }]"
+ set answer "[_ evaluation-portlet.View_my_answer_]"
+ } else {
+ # we assume it's a file
+ set answer_url "[export_vars -base "${base_url}view/$answer_title" { {revision_id $answer_id} }]"
+ set answer "[_ evaluation-portlet.View_my_answer_]"
+ }
+
+ if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } {
+ set answer ""
+ set answer_url ""
+ set grade "[_ evaluation-portlet.No_group_for_task_]"
+ }
+ } else {
set answer_url ""
set answer ""
- } elseif { [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,
- # so we have to deal with this case
- array set community_info [site_node::get -url "[dotlrn_community::get_community_url [dotlrn_community::get_community_id]][evaluation::package_key]"]
- if { ![regexp ([join [split [parameter::get -parameter urlProtocols -package_id $community_info(package_id)] ","] "|"]) "$answer_data"] } {
- set answer_data "http://$answer_data"
- }
- set answer_url "[export_vars -base "$answer_data" { }]"
- set answer "[_ evaluation-portlet.View_my_answer_]"
- } else {
- # we assume it's a file
- set answer_url "[export_vars -base "${base_url}view/$answer_title" { {revision_id $answer_id} }]"
- set answer "[_ evaluation-portlet.View_my_answer_]"
}
- if { $number_of_members > 1 && [string eq [db_string get_group_id { *SQL* }] 0] } {
- set answer ""
- set answer_url ""
- set grade "[_ evaluation-portlet.No_group_for_task_]"
- }
-
}
}
Index: openacs-4/packages/evaluation-portlet/lib/tasks-chunk-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/lib/tasks-chunk-postgresql.xql,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/evaluation-portlet/lib/tasks-chunk-postgresql.xql 12 Aug 2004 17:46:42 -0000 1.8
+++ openacs-4/packages/evaluation-portlet/lib/tasks-chunk-postgresql.xql 30 Aug 2004 13:05:00 -0000 1.9
@@ -10,18 +10,19 @@
to_char(et.due_date,'YYYY-MM-DD HH24:MI:SS') as due_date_ansi,
et.online_p,
et.late_submit_p,
+ et.task_item_id,
et.item_id,
et.requires_grade_p, et.description, et.grade_item_id,
coalesce(cr.content_length,0) as content_length,
et.data as task_data,
cr.title as task_title,
- et.task_id as revision_id,
- ets.solution_id as solution_id
+ et.task_id as revision_id
from cr_revisions cr,
- evaluation_tasksi et left outer join evaluation_tasks_solsi ets on (ets.task_item_id = et.task_item_id and content_revision__is_live(ets.solution_id) = true)
+ evaluation_tasksi et,
+ cr_items cri
where cr.revision_id = et.revision_id
and et.grade_item_id = :grade_item_id
- and content_revision__is_live(et.task_id) = true
+ and cri.live_revision = et.task_id
$assignments_orderby
@@ -35,20 +36,20 @@
et.online_p,
et.late_submit_p,
et.item_id,
+ et.task_item_id,
et.due_date,
et.requires_grade_p, et.description, et.grade_item_id,
cr.title as task_title,
et.data as task_data,
et.task_id as revision_id,
coalesce(cr.content_length,0) as content_length,
- et.late_submit_p,
- ea.answer_id as answer_id
+ et.late_submit_p
from cr_revisions cr,
- evaluation_tasksi et left outer join evaluation_answersi ea on (ea.task_item_id = et.task_item_id and content_revision__is_live(ea.answer_id) = true
- and ea.party_id = evaluation__party_id(:user_id,et.task_id))
+ evaluation_tasksi et,
+ cr_items cri
where cr.revision_id = et.revision_id
and grade_item_id = :grade_item_id
- and content_revision__is_live(et.task_id) = true
+ and cri.live_revision = et.task_id
$assignments_orderby
@@ -73,11 +74,35 @@
- select grade_name, grade_plural_name
- from evaluation_grades
- where grade_item_id = :grade_item_id and content_revision__is_live(grade_id) = true
+ select eg.grade_name, eg.grade_plural_name
+ from evaluation_grades eg, cr_items cri
+ where eg.grade_item_id = :grade_item_id
+ and cri.live_revision = eg.grade_id
+
+
+
+ select ets.solution_id
+ from evaluation_tasks_sols ets, cr_items cri
+ where ets.task_item_id = :task_item_id
+ and cri.live_revision = ets.solution_id
+
+
+
+
+
+
+
+ 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 = evaluation__party_id(:user_id,:task_id)
+
+
+
+
Index: openacs-4/packages/evaluation-portlet/lib/tasks-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/lib/tasks-chunk.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/evaluation-portlet/lib/tasks-chunk.tcl 26 Aug 2004 01:47:48 -0000 1.8
+++ openacs-4/packages/evaluation-portlet/lib/tasks-chunk.tcl 30 Aug 2004 13:05:00 -0000 1.9
@@ -96,6 +96,7 @@
db_multirow -extend { solution_url due_date_pretty solution solution_mode task_url groups_admin groups_admin_url } tasks_admin get_tasks_admin { *SQL* } {
set due_date_pretty [lc_time_fmt $due_date_ansi "%q %r"]
+
# working with task stuff (if it has a file/url attached)
if { [empty_string_p $task_data] } {
set task_url "[export_vars -base "${base_url}task-view" { grade_id task_id return_url }]"
@@ -117,7 +118,7 @@
set task_name "$task_name ([format %.0f [lc_numeric [expr ($content_length/1024)]]] Kb)"
}
- if { ![empty_string_p $solution_id] } {
+ 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_]"
@@ -161,7 +162,7 @@
if { [string eq $online_p "t"] } {
if { [db_string compare_due_date { *SQL* } -default 0] } {
- if { [empty_string_p $answer_id] } {
+ if { ![db_0or1row answer_info { *SQL* }] } {
set answer "[_ evaluation-portlet.submit_answer_]"
set answer_mode edit
set answer_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id return_url answer_mode }]"
@@ -171,7 +172,7 @@
set answer_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 { [empty_string_p $answer_id] } {
+ if { ![db_0or1row answer_info { *SQL* }] } {
set answer "[_ evaluation-portlet.lt_submit_answer_style_f]"
set answer_mode edit
set answer_url "[export_vars -base "${base_url}answer-add-edit" { grade_id task_id return_url answer_mode }]"