postgresql7.4 select evaluation__new_item ( :item_id, --item_id :item_name, null, :creation_user, :package_id, :creation_ip, :name, :description, 'text/plain', null, null, 'text', 'content_item', -- item_subtype 'evaluation_grades' -- content_type ); select evaluation__new_grade ( :item_id, :revision_id, :name, :weight, 'evaluation_grades', now(), --creation date :creation_user, :creation_ip, :revision_name, :description, now(), --publish date null, --nls_language 'text/plain' --mime_type ); select content_item__set_live_revision ( :revision_id ); select evaluation__new_item ( :item_id, --item_id :item_name, null, --locale :creation_user, :package_id, :creation_ip, :name, :description, :mime_type, --mime_type null, --nls_language null, --text :storage_type, --storage_type 'content_item', -- item_subtype 'evaluation_tasks' -- content_type ); select evaluation__new_task ( :item_id, :revision_id, :name, :number_of_members, :description, :weight, :due_date, :late_submit_p, :online_p, :requires_grade_p, 'evaluation_tasks', now(), --creation date :creation_user, :creation_ip, :item_name, now(), --publish date null, -- nls_language :mime_type --mime_type ); update cr_items set name = :item_name, storage_type = :storage_type where item_id = :item_id select evaluation__new_item ( :item_id, --item_id :item_name, null, --locale :creation_user, :package_id, :creation_ip, :title, 'task solution', :mime_type, --mime_type null, --nls_language null, --text :storage_type, --storage_type 'content_item', -- item_subtype 'evaluation_tasks_sols' -- content_type ); select evaluation__new_task_sol ( :item_id, :revision_id, :task_id, 'evaluation_tasks_sols', now(), --creation date :creation_user, :creation_ip, :item_name, now(), --publish date null, -- nls_language :mime_type --mime_type ); update cr_items set name = :item_name, storage_type = :storage_type where item_id = :item_id select evaluation__new_item ( :item_id, --item_id :item_name, null, --locale :creation_user, :package_id, :creation_ip, :title, 'evaluation answer', :mime_type, --mime_type null, --nls_language null, --text :storage_type, --storage_type 'content_item', -- item_subtype 'evaluation_answers' -- content_type ); select evaluation__new_answer ( :item_id, :revision_id, :task_id, :party_id, 'evaluation_answers', now(), --creation date :creation_user, :creation_ip, :item_name, now(), --publish date null, -- nls_language :mime_type --mime_type ); update cr_items set name = :item_name, storage_type = :storage_type where item_id = :item_id select evaluation__new_item ( :item_id, --item_id :item_name, null, --locale :creation_user, :package_id, :creation_ip, :title, 'student evaluation', :mime_type, --mime_type null, --nls_language null, --text :storage_type, --storage_type 'content_item', -- item_subtype 'evaluation_student_evals' -- content_type ) where not exists (select 1 from cr_items where item_id = :item_id); select evaluation__new_student_eval ( :item_id, :revision_id, :task_id, :party_id, :grade, :show_student_p, :description, 'evaluation_student_evals', now(), --creation date :creation_user, :creation_ip, :item_name, --title now(), --publish date null, -- nls_language :mime_type --mime_type ); select evaluation__new_evaluation_task_group ( :group_id, :group_name, 'closed', now(), :creation_user, :creation_ip, :context, :task_id ); select acs_group__name(:group_id) as group_name select evaluation__new_item ( :item_id, --item_id :item_name, null, --locale :creation_user, :package_id, :creation_ip, :title, 'grades sheet', :mime_type, --mime_type null, --nls_language null, --text :storage_type, --storage_type 'content_item', -- item_subtype 'evaluation_grades_sheets' -- content_type ); select evaluation__new_grades_sheet ( :item_id, :revision_id, :task_id, 'evaluation_grades_sheets', now(), --creation date :creation_user, :creation_ip, :item_name, now(), --publish date null, -- nls_language :mime_type --mime_type ); select grade_id from evaluation_tasks where task_id = :task_id and content_revision__is_live(task_id) = true select eg.grade_name, et.task_name from evaluation_grades eg, evaluation_tasks et where et.task_id = :task_id and et.grade_id = eg.grade_id select description as edit_reason, grade as current_grade, evaluation__party_name(party_id,task_id) as party_name from evaluation_student_evalsi where evaluation_id = :evaluation_id select evaluation__new_folder ( 'evaluation_grades_'||:package_id, 'evaluation_grades_'||:package_id, 'Evaluation grades folder', null, 'evaluation_grades' ); select evaluation__new_folder ( 'evaluation_tasks_'||:package_id, 'evaluation_tasks_'||:package_id, 'Evaluation tasks folder', null, 'evaluation_tasks' ); select evaluation__new_folder ( 'evaluation_tasks_sols_'||:package_id, 'evaluation_tasks_sols_'||:package_id, 'Evaluation tasks solutions folder', null, 'evaluation_tasks_sols' ); select evaluation__new_folder ( 'evaluation_answers_'||:package_id, 'evaluation_answers_'||:package_id, 'Evaluation answers folder', null, 'evaluation_answers' ); select evaluation__new_folder ( 'evaluation_grades_sheets_'||:package_id, 'evaluation_grades_sheets_'||:package_id, 'Grades sheets folder', null, 'evaluation_grades_sheets' ); select evaluation__new_folder ( 'evaluation_student_evals_'||:package_id, 'evaluation_student_evals_'||:package_id, 'Evaluation student evaluations folder', null, 'evaluation_student_evals' ); select evaluation__new_item ( :exams_item_id, --item_id :exams_item_name, null, :creation_user, :package_id, :creation_ip, 'Exams', 'Exams for students', 'text/plain', null, null, 'text', 'content_item', -- item_subtype 'evaluation_grades' -- content_type ); select evaluation__new_grade ( :exams_item_id, :exams_revision_id, 'Exams', 40, 'evaluation_grades', now(), --creation date :creation_user, :creation_ip, :exams_revision_name, 'Exams for students', now(), --publish date null, --nls_language 'text/plain' --mime_type ); select content_item__set_live_revision ( :exams_revision_id ); select evaluation__new_item ( :projects_item_id, --item_id :projects_item_name, null, :creation_user, :package_id, :creation_ip, 'Projects', 'Projects for students', 'text/plain', null, null, 'text', 'content_item', -- item_subtype 'evaluation_grades' -- content_type ); select evaluation__new_grade ( :projects_item_id, :projects_revision_id, 'Projects', 20, 'evaluation_grades', now(), --creation date :creation_user, :creation_ip, :projects_revision_name, 'Projects for students', now(), --publish date null, --nls_language 'text/plain' --mime_type ); select content_item__set_live_revision ( :projects_revision_id ); select evaluation__new_item ( :tasks_item_id, --item_id :tasks_item_name, null, :creation_user, :package_id, :creation_ip, 'Tasks', 'Tasks for students', 'text/plain', null, null, 'text', 'content_item', -- item_subtype 'evaluation_grades' -- content_type ); select evaluation__new_grade ( :tasks_item_id, :tasks_revision_id, 'Tasks', 40, 'evaluation_grades', now(), --creation date :creation_user, :creation_ip, :tasks_revision_name, 'Tasks for students', now(), --publish date null, --nls_language 'text/plain' --mime_type ); select content_item__set_live_revision ( :tasks_revision_id ); select evaluation__delete_contents ( :package_id ); select evaluation__delete_folder ( :ev_grades_sheets_fid, 'evaluation_grades_sheets' ); select evaluation__delete_folder ( :ev_grades_fid, 'evaluation_grades' ); select evaluation__delete_folder ( :ev_tasks_fid, 'evaluation_tasks' ); select evaluation__delete_folder ( :ev_tasks_sols_fid, 'evaluation_tasks_sols' ); select evaluation__delete_folder ( :ev_answers_fid, 'evaluation_answers' ); select evaluation__delete_folder ( :ev_student_evals_fid, 'evaluation_student_evals' );