Index: openacs-4/packages/assessment/assessment.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/assessment.info,v diff -u -r1.42.2.4 -r1.42.2.5 --- openacs-4/packages/assessment/assessment.info 7 Apr 2007 22:51:12 -0000 1.42.2.4 +++ openacs-4/packages/assessment/assessment.info 7 Apr 2007 23:27:13 -0000 1.42.2.5 @@ -23,14 +23,15 @@ + - - + + Index: openacs-4/packages/assessment/sql/oracle/assessment-collected-data-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/oracle/assessment-collected-data-create.sql,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/assessment/sql/oracle/assessment-collected-data-create.sql 7 Apr 2007 21:47:18 -0000 1.5.2.1 +++ openacs-4/packages/assessment/sql/oracle/assessment-collected-data-create.sql 7 Apr 2007 23:27:14 -0000 1.5.2.2 @@ -11,19 +11,23 @@ constraint as_sessions_session_id_pk primary key constraint as_sessions_session_id_fk - references cr_revisions(revision_id), + references cr_revisions(revision_id) + on delete cascade, assessment_id integer constraint as_sessions_assessment_id_fk - references as_assessments(assessment_id), + references as_assessments(assessment_id) + on delete cascade, -- References a Subjects entity that we don't define in this package. -- if subjects can't be "persons" then Assessment will have to define an as_subjects table for its own use. subject_id integer constraint as_sessions_subject_id_fk - references persons(person_id), + references persons(person_id) + on delete cascade, -- references Users if someone is doing the Assessment as a proxy for the real subject staff_id integer constraint as_sessions_staff_id_fk - references users(user_id), + references users(user_id) + on delete cascade, -- when the subject should do the Assessment target_datetime date, -- when the subject initiated the Assessment @@ -51,20 +55,25 @@ constraint as_section_data_id_pk primary key constraint as_section_data_id_fk - references cr_revisions(revision_id), + references cr_revisions(revision_id) + on delete cascade, session_id integer constraint as_section_data_sess_id_fk - references as_sessions(session_id), + references as_sessions(session_id) + on delete cascade, section_id integer constraint as_section_data_sect_id_fk - references as_sections(section_id), + references as_sections(section_id) + on delete cascade, -- if subjects can't be "persons" then Assessment will have to define an as_subjects table for its own use. subject_id integer constraint as_section_data_subj_id_fk - references persons(person_id), + references persons(person_id) + on delete cascade, staff_id integer constraint as_section_data_staff_id_fk - references users(user_id), + references users(user_id) + on delete cascade, points integer, -- when the subject initiated the section creation_datetime date, @@ -82,24 +91,30 @@ constraint as_item_data_id_pk primary key constraint as_item_data_id_fk - references cr_revisions(revision_id), + references cr_revisions(revision_id) + on delete cascade, session_id integer constraint as_item_data_sess_id_fk - references as_sessions(session_id), + references as_sessions(session_id) + on delete cascade, -- if subjects can't be "persons" then Assessment will have to define an as_subjects table for its own use subject_id integer constraint as_item_data_subj_id_fk - references persons(person_id), + references persons(person_id) + on delete cascade, -- missing foreign key staff_id integer constraint as_item_data_staff_id_fk - references users(user_id), + references users(user_id) + on delete cascade, as_item_id integer constraint as_item_data_item_id - references as_items(as_item_id), + references as_items(as_item_id) + on delete cascade, section_id integer constraint as_item_data_section_id - references as_sections(section_id), + references as_sections(section_id) + on delete cascade, is_unknown_p char(1) default 'f' constraint as_item_data_unknown_p_ck check (is_unknown_p in ('t','f')), @@ -115,7 +130,8 @@ -- references cr_revisions content_answer integer constraint as_item_data_content_fk - references cr_revisions, + references cr_revisions + on delete cascade, -- This field stores the signed entered data signed_data varchar(500), points integer @@ -131,10 +147,12 @@ constraint as_sess_res_res_id_pk primary key constraint as_sess_res_res_id_fk - references cr_revisions(revision_id), + references cr_revisions(revision_id) + on delete cascade, target_id integer constraint as_sess_res_tgt_id_fk - references cr_revisions(revision_id), + references cr_revisions(revision_id) + on delete cascade, points integer ); @@ -144,11 +162,13 @@ create table as_item_data_choices ( item_data_id integer constraint as_idata_cho_data_id_fk - references as_item_data, + references as_item_data + on delete cascade, -- references as_item_choices choice_id integer constraint as_idata_cho_choice_id_fk - references as_item_choices, + references as_item_choices + on delete cascade, constraint as_idata_choices_pk primary key (item_data_id, choice_id) ); @@ -159,10 +179,12 @@ create table as_session_sections ( session_id integer constraint as_sess_sect_session_fk - references as_sessions, + references as_sessions + on delete cascade, section_id integer constraint as_sess_sect_section_fk - references as_sections, + references as_sections + on delete cascade, sort_order integer, constraint as_sess_sections_pk primary key (session_id, section_id) @@ -174,13 +196,16 @@ create table as_session_items ( session_id integer constraint as_sess_items_session_fk - references as_sessions, + references as_sessions + on delete cascade, section_id integer constraint as_sess_items_section_fk - references as_sections, + references as_sections + on delete cascade, as_item_id integer constraint as_sess_items_item_fk - references as_items, + references as_items + on delete cascade, sort_order integer, constraint as_sess_items_pk primary key (session_id, section_id, as_item_id) @@ -192,16 +217,20 @@ create table as_session_choices ( session_id integer constraint as_sess_cho_session_fk - references as_sessions, + references as_sessions + on delete cascade, section_id integer constraint as_sess_cho_section_fk - references as_sections, + references as_sections + on delete cascade, as_item_id integer constraint as_sess_cho_item_fk - references as_items, + references as_items + on delete cascade, choice_id integer constraint as_sess_cho_choice_fk - references as_item_choices, + references as_item_choices + on delete cascade, sort_order integer, constraint as_sess_choices_pk primary key (session_id, section_id, as_item_id, choice_id) Index: openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql,v diff -u -r1.11.2.1 -r1.11.2.2 --- openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql 7 Apr 2007 21:47:18 -0000 1.11.2.1 +++ openacs-4/packages/assessment/sql/postgresql/assessment-collected-data-create.sql 7 Apr 2007 23:27:14 -0000 1.11.2.2 @@ -11,19 +11,23 @@ constraint as_sessions_session_id_pk primary key constraint as_sessions_session_id_fk - references cr_revisions(revision_id), + references cr_revisions(revision_id) + on delete cascade, assessment_id integer constraint as_sessions_assessment_id_fk - references as_assessments(assessment_id), + references as_assessments(assessment_id) + on delete cascade, -- References a Subjects entity that we don't define in this package. -- if subjects can't be "persons" then Assessment will have to define an as_subjects table for its own use. subject_id integer constraint as_sessions_subject_id_fk - references persons(person_id), + references persons(person_id) + on delete cascade, -- references Users if someone is doing the Assessment as a proxy for the real subject staff_id integer constraint as_sessions_staff_id_fk - references users(user_id), + references users(user_id) + on delete cascade, -- when the subject should do the Assessment target_datetime timestamptz, -- when the subject initiated the Assessment @@ -51,20 +55,25 @@ constraint as_section_data_section_data_id_pk primary key constraint as_section_data_section_data_id_fk - references cr_revisions(revision_id), + references cr_revisions(revision_id) + on delete cascade, session_id integer constraint as_section_data_session_id_fk - references as_sessions(session_id), + references as_sessions(session_id) + on delete cascade, section_id integer constraint as_section_data_section_id_fk - references as_sections(section_id), + references as_sections(section_id) + on delete cascade, -- if subjects can't be "persons" then Assessment will have to define an as_subjects table for its own use. subject_id integer constraint as_section_data_subject_id_fk - references persons(person_id), + references persons(person_id) + on delete cascade, staff_id integer constraint as_section_data_staff_id_fk - references users(user_id), + references users(user_id) + on delete cascade, points integer, -- when the subject initiated the section creation_datetime timestamptz, @@ -82,24 +91,30 @@ constraint as_item_data_item_data_id_pk primary key constraint as_item_data_item_data_id_fk - references cr_revisions(revision_id), + references cr_revisions(revision_id) + on delete cascade, session_id integer constraint as_item_data_session_id_fk - references as_sessions(session_id), + references as_sessions(session_id) + on delete cascade, -- if subjects can't be "persons" then Assessment will have to define an as_subjects table for its own use subject_id integer constraint as_item_data_subject_id_fk - references persons(person_id), + references persons(person_id) + on delete cascade, -- missing foreign key staff_id integer constraint as_item_data_staff_id_fk - references users(user_id), + references users(user_id) + on delete cascade, as_item_id integer constraint as_item_data_item_id - references as_items(as_item_id), + references as_items(as_item_id) + on delete cascade, section_id integer constraint as_item_data_section_id - references as_sections(section_id), + references as_sections(section_id) + on delete cascade, is_unknown_p char(1) default 'f' constraint as_item_data_is_unknown_p_ck check (is_unknown_p in ('t','f')), @@ -113,13 +128,15 @@ -- references cr_revisions content_answer integer constraint as_item_data_content_answer_fk - references cr_revisions, + references cr_revisions + on delete cascade, -- This field stores the signed entered data signed_data varchar(500), points integer, file_id integer constraint as_item_data_file_id_fk references cr_revisions(revision_id) + on delete cascade, -- to do: figure out how attachment answers should be supported; the Attachment package is still in need of considerable help. Can we rely on it here? ); @@ -133,10 +150,12 @@ constraint as_session_results_result_id_pk primary key constraint as_session_results_result_id_fk - references cr_revisions(revision_id), + references cr_revisions(revision_id) + on delete cascade, target_id integer constraint as_session_results_target_id_fk - references cr_revisions(revision_id), + references cr_revisions(revision_id) + on delete cascade, points integer ); @@ -146,11 +165,13 @@ create table as_item_data_choices ( item_data_id integer constraint as_item_data_choices_data_id_fk - references as_item_data, + references as_item_data + on delete cascade, -- references as_item_choices choice_id integer constraint as_item_data_choices_choice_id_fk - references as_item_choices, + references as_item_choices + on delete cascade, constraint as_item_data_choices_pk primary key (item_data_id, choice_id) ); @@ -161,10 +182,12 @@ create table as_session_sections ( session_id integer constraint as_session_sections_session_fk - references as_sessions, + references as_sessions + on delete cascade, section_id integer constraint as_session_sections_section_fk - references as_sections, + references as_sections + on delete cascade, sort_order integer, constraint as_session_sections_pk primary key (session_id, section_id) Index: openacs-4/packages/assessment/tcl/as-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-install-procs.tcl,v diff -u -r1.35.2.1 -r1.35.2.2 --- openacs-4/packages/assessment/tcl/as-install-procs.tcl 7 Apr 2007 21:22:59 -0000 1.35.2.1 +++ openacs-4/packages/assessment/tcl/as-install-procs.tcl 7 Apr 2007 23:27:14 -0000 1.35.2.2 @@ -444,9 +444,10 @@ } { # reset the RegistrationId parameter as::parameter::reset_parameter -package_id $package_id -node_id $node_id - +ns_log notice "delete assessment package $package_id" # delete actions db_foreach get_package_actions {} { + ns_log notice "delte action $object_id" db_exec_plsql delete_action {} } }