Index: openacs-4/packages/assessment/www/assessment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/assessment.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/assessment/www/assessment.tcl 8 Jan 2005 14:51:19 -0000 1.18 +++ openacs-4/packages/assessment/www/assessment.tcl 8 Jan 2005 17:27:22 -0000 1.19 @@ -31,11 +31,13 @@ db_transaction { if {[empty_string_p $session_id]} { - # todo: check if there's an old session that could be continued - set session_id [as::session::new -assessment_id $assessment_rev_id -subject_id $user_id] + if {![db_0or1row unfinished_session_id {}]} { + # todo: check if there's an old session that could be continued + set session_id [as::session::new -assessment_id $assessment_rev_id -subject_id $user_id] - # update the creation_datetime col of as_sessions table to set the time when the subject initiated the Assessment - db_dml session_start {} + # update the creation_datetime col of as_sessions table to set the time when the subject initiated the Assessment + db_dml session_start {} + } } # get all sections of assessment in correct order @@ -86,7 +88,7 @@ set new_section_order [expr $section_order + 1] } - if {$section_order == [llength $section_list]} { + if {$new_section_order == [llength $section_list]} { set new_section_order "" } } Index: openacs-4/packages/assessment/www/assessment.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/assessment.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/assessment/www/assessment.xql 7 Jan 2005 16:10:44 -0000 1.6 +++ openacs-4/packages/assessment/www/assessment.xql 8 Jan 2005 17:27:22 -0000 1.7 @@ -25,6 +25,15 @@ + + + + select max(session_id) as session_id + from as_sessions + where completed_datetime is null + and assessment_id = :assessment_rev_id + + Index: openacs-4/packages/assessment/www/session.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.adp,v diff -u -r1.16 -r1.17 --- openacs-4/packages/assessment/www/session.adp 25 Dec 2004 13:11:55 -0000 1.16 +++ openacs-4/packages/assessment/www/session.adp 8 Jan 2005 17:27:22 -0000 1.17 @@ -6,7 +6,7 @@ #assessment.Review_Asessment# @assessment_data.title@ #assessment.User_ID#: @first_names@ @last_name@ -#assessment.Attempt#: @session_attempt@ / Unlimited +#assessment.Attempt#: @session_attempt@ / Unlimited #assessment.Out_of#: @assessment_score@ #assessment.Started#: @session_start@ Index: openacs-4/packages/assessment/www/sessions-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/sessions-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/sessions-postgresql.xql 28 Dec 2004 19:04:59 -0000 1.5 +++ openacs-4/packages/assessment/www/sessions-postgresql.xql 8 Jan 2005 17:27:22 -0000 1.6 @@ -5,7 +5,7 @@ - SELECT s.session_id, s.completed_datetime, s.percent_score, + SELECT r.item_id as assessment_id,s.session_id, s.completed_datetime, s.percent_score, p.first_names || ' ' || p.last_name AS subject_name, r.title AS assessment_name, s.subject_id FROM as_sessions s, cr_revisions r, persons p @@ -19,7 +19,7 @@ - SELECT s.session_id, s.completed_datetime, s.percent_score, + SELECT r.item_id as assessment_id, s.session_id, s.completed_datetime, s.percent_score, p.first_names || ' ' || p.last_name AS subject_name, r.title AS assessment_name, s.subject_id FROM as_sessions s, cr_revisions r, persons p Index: openacs-4/packages/assessment/www/sessions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/sessions.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/assessment/www/sessions.tcl 22 Dec 2004 20:52:17 -0000 1.11 +++ openacs-4/packages/assessment/www/sessions.tcl 8 Jan 2005 17:27:22 -0000 1.12 @@ -91,7 +91,7 @@ } } -main_class { narrow - } + } } @@ -103,7 +103,7 @@ set query "sessions_of_assessment" } -db_multirow -extend { item_url assessment_id } sessions $query { +db_multirow -extend { item_url } sessions $query { } { set item_url [export_vars -base "session" {session_id}] }