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.47.2.7 -r1.47.2.8 --- openacs-4/packages/assessment/www/assessment.tcl 27 Jan 2006 09:41:09 -0000 1.47.2.7 +++ openacs-4/packages/assessment/www/assessment.tcl 6 Feb 2006 20:08:29 -0000 1.47.2.8 @@ -49,7 +49,13 @@ } set assessment_rev_id $assessment_data(assessment_rev_id) +set number_tries $assessment_data(number_tries) +db_1row total_tries {} +if {![empty_string_p $number_tries] && $number_tries >= $total_tries} { + ad_returnredirect [export_vars -base sessions {assessment_id}] +} set errors [as::assessment::check_session_conditions -assessment_id $assessment_rev_id -subject_id $user_id -password $password] + if {![empty_string_p $errors]} { ad_return_complaint 1 $errors ad_script_abort 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.14.2.1 -r1.14.2.2 --- openacs-4/packages/assessment/www/assessment.xql 27 Jun 2005 14:50:16 -0000 1.14.2.1 +++ openacs-4/packages/assessment/www/assessment.xql 6 Feb 2006 20:08:29 -0000 1.14.2.2 @@ -89,4 +89,18 @@ + + + + select count(*) as total_tries, max(session_id) as last_session_id + from as_sessions s, cr_revisions r, cr_revisions r2 + where s.subject_id = :user_id + and s.completed_datetime is not null + and s.assessment_id = r.revision_id + and r.item_id = r2.item_id + and r2.revision_id = :assessment_id + + + +