Index: openacs-4/packages/survey/sql/oracle/survey-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/sql/oracle/survey-package-create.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/survey/sql/oracle/survey-package-create.sql 30 Sep 2003 12:10:11 -0000 1.3
+++ openacs-4/packages/survey/sql/oracle/survey-package-create.sql 10 Oct 2003 14:41:45 -0000 1.4
@@ -470,14 +470,13 @@
create or replace view survey_responses_latest as
select sr.*, o.creation_date,
- o.creation_user,
- survey_response.initial_user_id(sr.response_id) as initial_user_id
+ o.creation_user as initial_user_id
from survey_responses sr,
acs_objects o,
(select max(response_id) as response_id
from survey_responses
- group by survey_response.initial_response_id(response_id)) latest
- where sr.response_id = o.object_id
+ group by nvl(initial_response_id, response_id)) latest
+ where nvl(sr.inital_response_id,sr.response_id) = o.object_id
and sr.response_id= latest.response_id;
create or replace view survey_ques_responses_latest as
Index: openacs-4/packages/survey/www/respond-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/respond-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/survey/www/respond-oracle.xql 16 Sep 2002 00:00:23 -0000 1.1
+++ openacs-4/packages/survey/www/respond-oracle.xql 10 Oct 2003 14:41:45 -0000 1.2
@@ -6,7 +6,7 @@
- select survey_response.initial_response_id(:response_id) as initial_response_id from dual
+ select nvl(initial_response_id,response_id) as initial_response_id from survey_responses where response_id=:response_id
Index: openacs-4/packages/survey/www/respond-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/respond-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/survey/www/respond-postgresql.xql 16 Sep 2002 19:53:15 -0000 1.1
+++ openacs-4/packages/survey/www/respond-postgresql.xql 10 Oct 2003 14:41:45 -0000 1.2
@@ -6,7 +6,7 @@
- select survey_response__initial_response_id(:response_id) as initial_response_id from dual
+ select coalesce(initial_response_id,response_id) as initial_response_id from survey_responses where reponse_id=:response_id
Index: openacs-4/packages/survey/www/admin/one-respondent-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/one-respondent-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/survey/www/admin/one-respondent-oracle.xql 16 Sep 2002 00:00:24 -0000 1.1
+++ openacs-4/packages/survey/www/admin/one-respondent-oracle.xql 10 Oct 2003 14:41:45 -0000 1.2
@@ -6,7 +6,7 @@
- select response_id, case when initial_response_id is NULL then 'T' else 'F' end as original_p, survey_response.initial_response_id(response_id) as initial_response, creation_date
+ select response_id, case when initial_response_id is NULL then 'T' else 'F' end as original_p, nvl(initial_response_id,response_id) as initial_response, creation_date
from survey_responses, acs_objects
where response_id = object_id
and creation_user = :user_id
Index: openacs-4/packages/survey/www/admin/one-respondent-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/one-respondent-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/survey/www/admin/one-respondent-postgresql.xql 16 Sep 2002 00:00:24 -0000 1.1
+++ openacs-4/packages/survey/www/admin/one-respondent-postgresql.xql 10 Oct 2003 14:41:45 -0000 1.2
@@ -4,7 +4,7 @@
postgresql7.1
- select response_id, case when initial_response_id is NULL then 'T' else 'F' end as original_p, survey_response__initial_response_id(response_id) as initial_response, creation_date
+ select response_id, case when initial_response_id is NULL then 'T' else 'F' end as original_p, coalesce(initial_response_id,response_id) as initial_response, creation_date
from survey_responses, acs_objects
where response_id = object_id
and creation_user = :user_id