Index: openacs-4/packages/assessment/www/asm-admin/results-users-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/results-users-oracle.xql 6 Dec 2005 14:24:34 -0000 1.1 @@ -0,0 +1,21 @@ + + +oracle8.1.6 + + + + + and s.completed_datetime >= $start_time + + + + + + + + and trunc(s.completed_datetime) <= $end_time + + + + + Index: openacs-4/packages/assessment/www/asm-admin/results-users-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/results-users-postgresql.xql 6 Dec 2005 14:24:34 -0000 1.1 @@ -0,0 +1,21 @@ + + +postgresql7.1 + + + + + and s.completed_datetime >= $start_time + + + + + + + + and date_trunc('day', s.completed_datetime) <= $end_time + + + + + Index: openacs-4/packages/assessment/www/asm-admin/results-users.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/www/asm-admin/results-users.adp 15 Apr 2005 17:26:46 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/results-users.adp 6 Dec 2005 14:24:34 -0000 1.3 @@ -2,6 +2,10 @@ @page_title;noquote@ @context;noquote@ +
+ +
+ Index: openacs-4/packages/assessment/www/asm-admin/results-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/asm-admin/results-users.tcl 18 Apr 2005 07:12:26 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/results-users.tcl 6 Dec 2005 14:24:34 -0000 1.6 @@ -6,6 +6,8 @@ @creation-date 2005-01-24 } { assessment_id + {start_time:optional ""} + {end_time:optional ""} } -properties { context:onevalue page_title:onevalue @@ -24,7 +26,37 @@ set page_title "[_ assessment.Results_by_user]" set context [list [list index [_ assessment.admin]] [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title] set format "[lc_get formbuilder_date_format], [lc_get formbuilder_time_format]" +set form_format [lc_get formbuilder_date_format] +set start_date_sql "" +set end_date_sql "" + +ad_form -name assessment_results -action results-users -form { + {assessment_id:key} + {start_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.csv_Start_Time]"} {format $form_format} {help} {help_text "[_ assessment.csv_Start_Time_help]"}} + {end_time:date,to_sql(sql_date),to_html(display_date),optional {label "[_ assessment.csv_End_Time]"} {format $form_format} {help} {help_text "[_ assessment.csv_End_Time_help]"}} +} -edit_request { +} -on_submit { + if {$start_time == "NULL"} { + set start_time "" + } + if {$end_time == "NULL"} { + set end_time "" + } + if {[db_type] == "postgresql"} { + regsub -all -- {to_date} $start_time {to_timestamp} start_time + regsub -all -- {to_date} $end_time {to_timestamp} end_time + } + + if {![empty_string_p $start_time]} { + set start_date_sql [db_map restrict_start_date] + } + if {![empty_string_p $end_time]} { + set end_date_sql [db_map restrict_end_date] + } + #ad_returnredirect [export_vars -base results-users {assessment_id start_time end_time}] +} + template::list::create \ -name results \ -multirow results \ Index: openacs-4/packages/assessment/www/asm-admin/results-users.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/results-users.xql 1 Feb 2005 22:00:10 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/results-users.xql 6 Dec 2005 14:24:34 -0000 1.2 @@ -5,7 +5,7 @@ select s.session_id, s.subject_id, s.percent_score, to_char(s.completed_datetime, :format) as completed_datetime, - p.first_names || ' ' || p.last_name AS subject_name, + p.last_name || ', ' || p.first_names AS subject_name, :assessment_id as assessment_id from as_sessions s, persons p, (select max(s2.session_id) as session_id, s2.subject_id @@ -16,6 +16,8 @@ group by s2.subject_id) sub where s.session_id = sub.session_id and sub.subject_id = p.person_id + $start_date_sql + $end_date_sql order by s.completed_datetime