@@ -68,11 +78,12 @@
et.due_date,
ea.last_modified as submission_date
from evaluation_answersi ea,
- evaluation_tasks et
+ evaluation_tasks et,
+ cr_items cri
where ea.task_id = et.task_id
and et.task_id = :task_id
and ea.data is not null
- and content_revision__is_live(ea.answer_id) = true
+ and cri.live_revision = ea.answer_id
$processed_clause
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.6 -r1.7
--- openacs-4/packages/evaluation/www/admin/evaluations/student-list.adp 7 Jul 2004 17:26:44 -0000 1.6
+++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.adp 14 Jul 2004 17:42:07 -0000 1.7
@@ -15,7 +15,7 @@
#evaluation.lt_Is_the_task_submitted# |
-
+
#evaluation.Yes#
#evaluation.No#
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.7 -r1.8
--- openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 7 Jul 2004 17:26:44 -0000 1.7
+++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 14 Jul 2004 17:42:07 -0000 1.8
@@ -45,6 +45,54 @@
set actions [list "[_ evaluation.Edit_Evaluations_]" [export_vars -base "evaluations-edit" { task_id }]]
+set elements [list party_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_html { title "[_ evaluation.View_evaluation_]" } \
+ ] \
+ grade \
+ [list label "[_ evaluation.Grade_over_100_]" \
+ orderby_asc {grade asc} \
+ orderby_desc {grade desc} \
+ ] \
+ action \
+ [list label "" \
+ link_url_col action_url \
+ ] \
+ ]
+
+if { [string eq $online_p "t"] } {
+ lappend elements submission_date_pretty \
+ [list label "[_ evaluation.Submission_Date_]" \
+ orderby_asc {submission_date_ansi asc} \
+ orderby_desc {submission_date_ansi desc}]
+}
+
+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 {} \
+ 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 {} \
+ 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 \
@@ -53,99 +101,54 @@
-pass_properties { return_url task_id evaluation_mode } \
-filters { task_id {} } \
-orderby { default_value party_name } \
- -elements {
- party_name {
- 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_html { title "[_ evaluation.View_evaluation_]" }
- }
- grade {
- label "[_ evaluation.Grade_over_100_]"
- orderby_asc {grade asc}
- orderby_desc {grade desc}
- }
- action {
- label ""
- link_url_col action_url
- }
- submission_date_pretty {
- label "[_ evaluation.Sumission_Date_]"
- orderby_asc {submission_date_ansi asc}
- orderby_desc {submission_date_ansi desc}
- }
- view {
- 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_]" }
- }
- edit {
- label {}
- sub_class narrow
- display_template {
-
- }
- link_url_eval {[export_vars -base "one-evaluation-edit" { evaluation_id task_id }]}
- link_html { title "[_ evaluation.Edit_evaluation_]" }
- }
- delete {
- label {}
- sub_class narrow
- display_template {
-
- }
- link_url_eval {[export_vars -base "evaluation-delete" { evaluation_id return_url task_id }]}
- link_html { title "[_ evaluation.Delete_evaluation_]" }
- }
- }
+ -elements $elements
set orderby [template::list::orderby_clause -orderby -name evaluated_students]
if {[string equal $orderby ""]} {
set orderby " order by party_name asc"
}
+set total_evaluated 0
db_multirow -extend { action action_url submission_date_pretty } evaluated_students evaluated_students { *SQL* } {
+ incr total_evaluated
lappend done_students $party_id
- set submission_date_pretty [lc_time_fmt $submission_date_ansi "%c"]
set grade [format %.2f [lc_numeric $grade]]
- if { [template::util::date::compare $submission_date $due_date] > 0 } {
- set action "[_ evaluation.lt_submission_date_prett]"
- }
if { [string eq $online_p "t"] } {
- # working with answer stuff (if it has a file/url attached)
- if { [empty_string_p $answer_data] } {
- set action "[_ evaluation.No_response_]"
- } elseif { [regexp "http://" $answer_data] } {
- set action_url "[export_vars -base "$answer_data" { }]"
- set action "[_ evaluation.View_answer_]"
+ if { [db_0or1row get_answer_info { *SQL* }] } {
+ # working with answer stuff (if it has a file/url attached)
+ if { [empty_string_p $answer_data] } {
+ set action "[_ evaluation.No_response_]"
+ } elseif { [regexp "http://" $answer_data] } {
+ set action_url "[export_vars -base "$answer_data" { }]"
+ set action "[_ evaluation.View_answer_]"
+ } else {
+ # we assume it's a file
+ set action_url "[export_vars -base "../../view/$answer_title" { revision_id }]"
+ set action "[_ evaluation.View_answer_]"
+ }
+ if { [string eq $action "[_ evaluation.View_answer_]"] && ([template::util::date::compare $submission_date $evaluation_date] > 0) } {
+ set action " [_ evaluation.View_NEW_answer_]"
+ }
+ set submission_date_pretty [lc_time_fmt $submission_date_ansi "%c"]
+ if { [template::util::date::compare $submission_date $due_date] > 0 } {
+ set submission_date_pretty "[_ evaluation.lt_submission_date_prett]"
+ }
} 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.No_response_]"
}
- if { [string eq $action "[_ evaluation.View_answer_]"] && ([template::util::date::compare $submission_date $evaluation_date] > 0) } {
- set action " [_ evaluation.View_NEW_answer_]"
- }
}
}
-set total_evaluated [db_string count_evaluated_students { *SQL* }]
-
if { [llength $done_students] > 0 } {
set processed_clause [db_map processed_clause]
} else {
set processed_clause ""
}
-set not_evaluated_with_answer [db_string get_not_eval_wa { *SQL* }]
+set not_evaluated_with_answer 0
#
# working with students that have answered but have not been yet evaluated
@@ -204,6 +207,7 @@
db_multirow -extend { party_url answer answer_url submission_date_pretty portrait } not_evaluated_wa get_not_evaluated_wa_students { *SQL* } {
+ incr not_evaluated_with_answer
if { $number_of_members == 1 } {
set portrait "[evaluation::get_user_portrait -user_id $party_id { {alt "[_ evaluation.lt_No_portrait_for_party]"} }]"
} else {
@@ -276,12 +280,10 @@
if { $number_of_members > 1 } {
if { [llength $done_students] > 0 } {
- set not_evaluated_with_no_answer [db_string get_not_evaluated_na { *SQL* }]
set not_in_clause [db_map not_in_clause]
} else {
set not_in_clause ""
}
- set not_evaluated_with_no_answer [db_string count_not_eval_na { *SQL* }]
set sql_query [db_map sql_query_groups]
} else {
set community_id [dotlrn_community::get_community_id]
@@ -294,17 +296,18 @@
# if this page is called from within a community (dotlrn) we have to show only the students
if { [empty_string_p $community_id] } {
- set not_evaluated_with_no_answer [db_string get_not_evaluated_left { *SQL* }]
set sql_query [db_map sql_query_individual]
} else {
- set not_evaluated_with_no_answer [db_string get_community_not_evaluated_left { *SQL* }]
set sql_query [db_map sql_query_community_individual]
}
}
+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 portrait "[evaluation::get_user_portrait -user_id $party_id { {alt "[_ evaluation.lt_No_portrait_for_party]"} }]"
} else {
Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql 7 Jul 2004 17:26:44 -0000 1.5
+++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql 14 Jul 2004 17:42:07 -0000 1.6
@@ -53,7 +53,7 @@
- select count(*) from cc_users p
+ select count(*) from persons p
$not_in_clause
@@ -63,7 +63,7 @@
select count(*)
- from cc_users p,
+ from persons p,
registered_users ru,
dotlrn_member_rels_approved app
$not_in_clause
@@ -90,7 +90,7 @@
select p.person_id as party_id,
p.last_name||', '||p.first_names as party_name
- from cc_users p
+ from persons p
$not_in_clause
$orderby_na
@@ -102,7 +102,7 @@
p.last_name||', '||p.first_names as party_name
from registered_users ru,
dotlrn_member_rels_approved app,
- cc_users p
+ persons p
$not_in_clause
and app.community_id = :community_id
and app.user_id = ru.user_id
Index: openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl 15 Jun 2004 23:20:30 -0000 1.5
+++ openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl 14 Jul 2004 17:42:07 -0000 1.6
@@ -188,6 +188,7 @@
set storage_type text
}
+ set title [evaluation::safe_url_name -name $title]
if { [ad_form_new_p -key solution_id] } {
set item_id $solution_id
}
Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 7 Jul 2004 17:26:45 -0000 1.8
+++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 14 Jul 2004 17:42:07 -0000 1.9
@@ -310,6 +310,7 @@
set storage_type lob
}
+ set title [evaluation::safe_url_name -name $title]
set due_date [db_string set_date { *SQL* }]
if { [ad_form_new_p -key task_id] } {
Index: openacs-4/packages/evaluation/www/view/index.vuh
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/view/index.vuh,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/evaluation/www/view/index.vuh 22 May 2004 01:20:26 -0000 1.2
+++ openacs-4/packages/evaluation/www/view/index.vuh 14 Jul 2004 17:42:07 -0000 1.3
@@ -11,18 +11,18 @@
# Get the paths
set the_root [ns_info pageroot]
-set the_url [ad_conn path_info]
set package_id [ad_conn package_id]
# Get the IDs
-set content_type [db_string get_content_type { *SQL* }]
+db_1row revision_info { *SQL* }
+set the_url $name
set content_root [db_string get_folder_id { *SQL* }]
set template_root ""
# Serve the page
-
+ns_log Notice "url $the_url the_root $content_root !!\n"
if { [content::init the_url the_root $content_root $template_root public $revision_id $content_type] } {
set file "$the_root/$the_url"
rp_internal_redirect -absolute_path $file
Index: openacs-4/packages/evaluation/www/view/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/view/index.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/evaluation/www/view/index.xql 7 Jun 2004 16:05:17 -0000 1.1
+++ openacs-4/packages/evaluation/www/view/index.xql 14 Jul 2004 17:42:07 -0000 1.2
@@ -2,9 +2,9 @@
-
+
- select cri.content_type
+ select cri.content_type, cri.name
from cr_items cri, cr_revisions crr
where cri.item_id = crr.item_id
and crr.revision_id = :revision_id
|