Index: openacs-4/packages/assessment-portlet/www/assessment-portlet-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/www/assessment-portlet-oracle.xql,v
diff -u -r1.4.2.1 -r1.4.2.2
--- openacs-4/packages/assessment-portlet/www/assessment-portlet-oracle.xql 6 Apr 2007 17:56:01 -0000 1.4.2.1
+++ openacs-4/packages/assessment-portlet/www/assessment-portlet-oracle.xql 2 Jul 2007 10:56:18 -0000 1.4.2.2
@@ -5,13 +5,27 @@
- select cr.item_id as assessment_id, cr.title, cr.description, a.password,
+ select * from (select cr.item_id as assessment_id, cr.title, cr.description, a.password,
to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time,
to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time,
to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') as cur_time,
cf.package_id, p.instance_name as community_name,
- sc.node_id as comm_node_id, sa.node_id as as_node_id,
- acs_permission__permission_p(a.assessment_id,:user_id,'admin') as admin_p
+ sc.node_id as comm_node_id, sa.node_id as as_node_id, a.anonymous_p,
+ acs_permission.permission_p(a.assessment_id,:user_id,'admin') as admin_p,
+ (select count(*) from as_sessions s1,
+ cr_revisions cr1 where
+ s1.assessment_id=cr1.revision_id
+ and cr1.item_id=cr.item_id
+ and s1.subject_id=:user_id
+ and completed_datetime is null) as in_progress_p,
+ (select count(*) from as_sessions s1,
+ cr_revisions cr1 where
+ s1.assessment_id=cr1.revision_id
+ and cr1.item_id=cr.item_id
+ and s1.subject_id=:user_id
+ and completed_datetime is not null) as completed_p,
+ a.number_tries
+
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
@@ -31,7 +45,53 @@
and ppm.privilege = 'read'
and ppm.party_id = :user_id)
order by lower(p.instance_name), lower(cr.title)
+) q where (q.completed_p < q.number_tries) or (q.number_tries=0 or q.number_tries is null)
+
+
+select * from (select ass.*, sc.node_id as comm_node_id, sa.node_id as as_node_id, p.instance_name as community_name,
+acs_permission.permission_p(ass.assessment_id,:user_id,'admin') as admin_p,
+ (select count(*) from as_sessions s1,
+ cr_revisions cr1 where
+ s1.assessment_id=cr1.revision_id and
+ cr1.item_id=ass.assessment_id
+ and s1.subject_id=:user_id
+ and completed_datetime is null) as in_progress_p,
+ (select count(*) from as_sessions s1,
+ cr_revisions cr1 where
+ s1.assessment_id=cr1.revision_id
+ and cr1.item_id=ass.assessment_id
+ and s1.subject_id=:user_id
+ and completed_datetime is not null) as completed_p
+
+
+ from
+ (select cr.item_id as assessment_id, cr.title, cr.description, cf.package_id,
+ a1.number_tries, a1.end_time
+ from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf,
+ as_assessments a1,
+ ( select distinct s.assessment_id
+ from as_sessions s
+ where s.subject_id = :user_id
+ and s.completed_datetime is not null) s
+ where a.assessment_id = cr.revision_id --
+ and cf.package_id in ([join $list_of_package_ids ", "])
+ and cr.item_id = ci.item_id
+ and ci.parent_id = cf.folder_id
+ and s.assessment_id = a.assessment_id
+ and a1.assessment_id = ci.latest_revision
+ ) 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)
+) q
+ where (q.number_tries is not null and q.number_tries >0 and q.completed_p >= q.number_tries) or (q.end_time is not null and q.end_time < current_timestamp)
+
+
+
+
Index: openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql,v
diff -u -r1.11.2.1 -r1.11.2.2
--- openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql 4 Apr 2007 02:08:01 -0000 1.11.2.1
+++ openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql 2 Jul 2007 10:56:18 -0000 1.11.2.2
@@ -51,4 +51,48 @@
+
+
+select * from (select ass.*, sc.node_id as comm_node_id, sa.node_id as as_node_id, p.instance_name as community_name,
+acs_permission__permission_p(ass.assessment_id,:user_id,'admin') as admin_p,
+ (select count(*) from as_sessions s1,
+ cr_revisions cr1 where
+ s1.assessment_id=cr1.revision_id and
+ cr1.item_id=ass.assessment_id
+ and s1.subject_id=:user_id
+ and completed_datetime is null) as in_progress_p,
+ (select count(*) from as_sessions s1,
+ cr_revisions cr1 where
+ s1.assessment_id=cr1.revision_id
+ and cr1.item_id=ass.assessment_id
+ and s1.subject_id=:user_id
+ and completed_datetime is not null) as completed_p
+
+
+ from
+ (select cr.item_id as assessment_id, cr.title, cr.description, cf.package_id,
+ a1.number_tries, a1.end_time
+ from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf,
+ as_assessments a1,
+ ( select distinct s.assessment_id
+ from as_sessions s
+ where s.subject_id = :user_id
+ and s.completed_datetime is not null) s
+ where a.assessment_id = cr.revision_id --
+ and cf.package_id in ([join $list_of_package_ids ", "])
+ and cr.item_id = ci.item_id
+ and ci.parent_id = cf.folder_id
+ and s.assessment_id = a.assessment_id
+ and a1.assessment_id = ci.latest_revision
+ ) 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)
+) q
+ where (q.number_tries is not null and q.number_tries >0 and q.completed_p >= q.number_tries) or (q.end_time is not null and q.end_time < current_timestamp)
+
+
+
Fisheye: Tag 1.7.2.2 refers to a dead (removed) revision in file `openacs-4/packages/assessment-portlet/www/assessment-portlet.xql'.
Fisheye: No comparison available. Pass `N' to diff?