Index: openacs-4/packages/assessment/lib/results-edit-oq.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/results-edit-oq.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/lib/results-edit-oq.adp 21 Feb 2005 14:32:55 -0000 1.1 +++ openacs-4/packages/assessment/lib/results-edit-oq.adp 26 Sep 2006 04:08:36 -0000 1.2 @@ -1,8 +1,8 @@ - +
#assessment.User_Answer#  #assessment.oq_Reference_Answer#
#assessment.oq_Reference_Answer#
@answer_text;noquote@  @reference_answer@
-

#assessment.oq_Keywords#: -

@keywords@
+

#assessment.oq_Keywords#: +

@keywords@
Index: openacs-4/packages/assessment/lib/session-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/lib/session-postgresql.xql 12 Jun 2006 03:30:09 -0000 1.1 +++ openacs-4/packages/assessment/lib/session-postgresql.xql 26 Sep 2006 04:08:36 -0000 1.2 @@ -12,4 +12,19 @@ + + + select max(o.creation_date), s.session_id + from as_sessions s, + acs_objects o, + cr_revisions cr + where s.subject_id=:user_id + and s.assessment_id=(select latest_revision from cr_items where item_id=:assessment_id) + and o.object_id = cr.item_id + and s.session_id = cr.revision_id + group by assessment_id, subject_id, session_id + limit 1 + + + Index: openacs-4/packages/assessment/lib/session.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/lib/session.tcl 26 Sep 2006 00:22:44 -0000 1.3 +++ openacs-4/packages/assessment/lib/session.tcl 26 Sep 2006 04:08:36 -0000 1.4 @@ -20,7 +20,9 @@ ad_return_complaint 1 "Session_id or Assessment_id is required" } #find the latest session - db_1row get_latest_session "" -column_array latest_session + if {![db_0or1row get_latest_session "" -column_array latest_session]} { + ad_return_complaint 1 "You have not completed this assessment yet." + } set session_id $latest_session(session_id) } Index: openacs-4/packages/assessment/lib/session.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment/lib/session.xql 26 Sep 2006 00:59:28 -0000 1.3 +++ openacs-4/packages/assessment/lib/session.xql 26 Sep 2006 04:08:36 -0000 1.4 @@ -41,17 +41,4 @@ - - - select max(o.creation_date), s.session_id - from as_sessions s, - acs_objects o, - cr_revisions cr - where s.subject_id=:user_id - and s.assessment_id=(select latest_revision from cr_items where item_id=:assessment_id) - and o.object_id = cr.item_id - and s.session_id = cr.revision_id - group by s.session_id - - Index: openacs-4/packages/assessment/tcl/as-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/assessment/tcl/as-item-procs.tcl 6 Aug 2006 17:27:45 -0000 1.17 +++ openacs-4/packages/assessment/tcl/as-item-procs.tcl 26 Sep 2006 04:08:37 -0000 1.18 @@ -170,7 +170,7 @@ set package_id [ad_conn package_id] } set folder_id [as::assessment::folder_id -package_id $package_id] - + set new_title $title db_transaction { db_1row item_data {} @@ -180,12 +180,12 @@ set field_name $name } - set item_item_id [content::item::new -item_id $item_item_id -parent_id $folder_id -content_type {as_items} -name $name] + set item_item_id [content::item::new -item_id $item_item_id -parent_id $folder_id -content_type {as_items} -name $name -storage_type text] set new_item_id [content::revision::new \ -item_id $item_item_id \ -content_type {as_items} \ - -title $title \ - -content $content \ + -title [string range $new_title 0 999] \ + -content $new_title \ -description $description \ -attributes [list [list subtext $subtext] \ [list field_name $field_name] \