Index: openacs-4/packages/assessment/www/session.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/session.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/assessment/www/session.xql 21 Sep 2004 08:55:00 -0000 1.1
+++ openacs-4/packages/assessment/www/session.xql 21 Sep 2004 11:52:50 -0000 1.2
@@ -4,24 +4,20 @@
- SELECT as_itemsx.as_item_id, as_itemsx.name, as_itemsx.title, as_item_data.choice_id_answer
- FROM as_itemsx
- WHERE as_item_id = as_item_section_map.as_item_id
- AND as_sectionsx.section_id = as_assessment_section_map.section_id
- AND as_assessment_section_map.assessment_id = as_assessments.assessment_id
- AND as_assessmentsx.assessment_id = as_sessionsx.assessment_id
- AND as_sessionsx.session_id = :session_id
- AND as_item_data.session_id = :session_id
+ SELECT as_itemsx.as_item_id, as_itemsx.name, as_itemsx.title
+ FROM ((as_sectionsx INNER JOIN (as_assessmentsx INNER JOIN as_assessment_section_map ON as_assessmentsx.assessment_id=as_assessment_section_map.assessment_id) ON
+ as_sectionsx.section_id=as_assessment_section_map.section_id) INNER JOIN (as_itemsx INNER JOIN as_item_section_map ON as_itemsx.as_item_id=as_item_section_map.as_item_id) ON as_sectionsx.section_id=as_item_section_map.section_id) INNER JOIN as_sessionsx ON as_assessmentsx.assessment_id = as_sessionsx.assessment_id
+ WHERE as_sessionsx.session_id = :session_id
SELECT
as_item_choicesx.choice_id, as_item_choicesx.title AS choice_title, as_item_choicesx.correct_answer_p, as_item_datax.choice_id_answer
- FROM as_item_choicesx INNER JOIN as_item_datax ON as_item_datax.as_item_id=as_item_choicesx.choice_id
+ FROM as_item_choicesx LEFT JOIN (as_item_datax INNER JOIN as_sessionsx ON as_sessionsx.session_id = as_item_datax.session_id) ON as_item_datax.choice_id_answer=as_item_choicesx.choice_id
WHERE
- as_item_choicesx.mc_id=:mc_id AND as_sessionsx.session_id = as_item_datax.session_id
+ as_item_choicesx.mc_id=:mc_id
ORDER BY
as_item_choicesx.sort_order
Index: openacs-4/packages/assessment/www/sessions.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/Attic/sessions.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/assessment/www/sessions.xql 21 Sep 2004 08:55:00 -0000 1.1
+++ openacs-4/packages/assessment/www/sessions.xql 21 Sep 2004 11:52:50 -0000 1.2
@@ -6,8 +6,8 @@
SELECT as_sessionsx.session_id, as_sessionsx.name, as_sessionsx.title, persons.first_names, persons.last_name
- FROM as_sessions
- WHERE as_sessionsx.assessment_id=:assessment_id AND as_sessions.subject_id = persons.person_id
+ FROM as_sessionsx INNER JOIN persons ON as_sessionsx.subject_id = persons.person_id
+ WHERE as_sessionsx.assessment_id=:assessment_id