Index: openacs-4/packages/assessment-portlet/www/assessment-portlet.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/www/Attic/assessment-portlet.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/assessment-portlet/www/assessment-portlet.xql 27 Apr 2005 10:51:33 -0000 1.3 +++ openacs-4/packages/assessment-portlet/www/assessment-portlet.xql 17 Feb 2006 12:17:58 -0000 1.4 @@ -3,24 +3,25 @@ - select cr.item_id as assessment_id, cr.title, cr.description, - cf.package_id, p.instance_name as community_name, - sc.node_id as comm_node_id, sa.node_id as as_node_id +select ass.*, sc.node_id as comm_node_id, sa.node_id as as_node_id, p.instance_name as community_name from +(select cr.item_id as assessment_id, cr.title, cr.description, + cf.package_id from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf, - site_nodes sa, site_nodes sc, apm_packages p - where a.assessment_id = cr.revision_id - and cr.revision_id = ci.latest_revision - and ci.parent_id = cf.folder_id - and cf.package_id in ([join $list_of_package_ids ", "]) - and sa.object_id = cf.package_id - and sc.node_id = sa.parent_id - and p.package_id = sc.object_id - and exists (select 1 + (select distinct s.assessment_id from as_sessions s - where s.assessment_id = a.assessment_id - and s.subject_id = :user_id - and s.completed_datetime is not null) - order by lower(p.instance_name), lower(cr.title) + where s.subject_id = :user_id + and s.completed_datetime is not null) s + where a.assessment_id = cr.revision_id + and cr.revision_id = ci.latest_revision + and ci.parent_id = cf.folder_id + $package_id_sql + and s.assessment_id = a.assessment_id + ) ass, +site_nodes sa, site_nodes sc, apm_packages p +where sa.object_id = ass.package_id +and sc.node_id = sa.parent_id +and p.package_id = sc.object_id +order by lower(p.instance_name), lower(ass.title)