Index: openacs-4/packages/evaluation/sql/oracle/evaluation-calendar-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/sql/oracle/evaluation-calendar-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/evaluation/sql/oracle/evaluation-calendar-drop.sql 28 Dec 2004 19:50:36 -0000 1.1 +++ openacs-4/packages/evaluation/sql/oracle/evaluation-calendar-drop.sql 7 Apr 2005 18:57:01 -0000 1.2 @@ -12,7 +12,8 @@ END LOOP; end; / -show errors +show errors; + drop index ev_cal_task_map_tcid_index; drop table evaluation_cal_task_map; Index: openacs-4/packages/evaluation/sql/oracle/evaluation-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/sql/oracle/evaluation-drop.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/sql/oracle/evaluation-drop.sql 31 Mar 2005 11:09:27 -0000 1.2 +++ openacs-4/packages/evaluation/sql/oracle/evaluation-drop.sql 7 Apr 2005 18:57:01 -0000 1.3 @@ -3,35 +3,6 @@ @ evaluation-calendar-drop.sql ---create function inline_0 () ---returns integer as' ---declare --- del_rec record; ---begin --- for del_rec in select item_id from cr_items --- where content_type in (''evaluation_grades'', ''evaluation_tasks'', ''evaluation_tasks_sols'', ''evaluation_answers'', ''evaluation_student_evals'', ''evaluation_grades_sheets'') --- loop --- PERFORM content_item__delete(del_rec.item_id); --- end loop; ---return 0; ---end;' language 'plpgsql'; ---select inline_0 (); ---drop function inline_0 (); - ---create function inline_0 () ---returns integer as' ---declare --- del_rec record; ---begin --- for del_rec in select item_id from cr_items --- where content_type in (''evaluation_grades'', ''evaluation_tasks'', ''evaluation_tasks_sols'', ''evaluation_answers'', ''evaluation_student_evals'', ''evaluation_grades_sheets'') --- loop --- PERFORM content_item__delete(del_rec.item_id); --- end loop; ---return 0; ---end;' language 'plpgsql'; ---select inline_0 (); ---drop function inline_0 (); delete from acs_objects where object_type = 'evaluation_grades'; delete from acs_objects where object_type = 'evaluation_tasks'; delete from acs_objects where object_type = 'evaluation_tasks_sols'; @@ -87,85 +58,6 @@ drop view evaluation_gradesx; drop table evaluation_grades; --- Usa Funciones CR ---drop function evaluation__new_item (integer,varchar,varchar,integer,integer,timestamptz,varchar,varchar,text,varchar,varchar,text,varchar,varchar,varchar); - ---------------------------------------- --- GRADES ---------------------------------------- - --- Usa Funciones CR ---drop function evaluation__new_grade (integer, integer, varchar, varchar, numeric, varchar, timestamptz, integer, varchar, varchar, varchar, timestamptz, varchar, varchar); - --- Usa Funciones CR ---drop function evaluation__delete_grade (integer); - - --- Originalmente drop function grade__name(integer); - ---------------------------------------- --- TASKS ---------------------------------------- - --- Usa Funciones CR ---drop function evaluation__new_task (integer, integer, varchar, integer, integer, varchar, numeric, timestamptz, char, char, char, varchar, timestamptz, integer, varchar, varchar, timestamptz, varchar, varchar); - --- Usa Funciones CR ---drop function evaluation__delete_task (integer); - --- Ya fue elimina al eliminar el paquete evaluation; ---drop function task__name(integer); - ---------------------------------------- --- TASKS SOLUTIONS ---------------------------------------- - --- Usa Funciones CR ---drop function evaluation__new_task_sol (integer, integer, integer, varchar, timestamptz, integer, varchar, varchar, timestamptz, varchar, varchar); - --- Usa Funciones CR ---drop function evaluation__delete_task_sol (integer); - ---------------------------------------- --- STUDENT ANSWERS ---------------------------------------- - --- Usa Funciones CR ---drop function evaluation__new_answer (integer, integer, integer, integer, varchar, timestamptz, integer, varchar, varchar, timestamptz, varchar, varchar); - --- Usa Funciones CR ---drop function evaluation__delete_answer (integer); - ---------------------------------------- --- GRADES SHEETS ---------------------------------------- - --- Usa Funciones CR ---drop function evaluation__new_grades_sheet (integer, integer, integer, varchar, timestamptz, integer, varchar, varchar, timestamptz, varchar, varchar); - --- Usa Funciones CR ---drop function evaluation__delete_grades_sheet (integer); - ---------------------------------------- --- STUDENT EVALUATIONS ---------------------------------------- - --- Usa Funciones CR ---drop function evaluation__new_student_eval (integer, integer, integer, integer, numeric, char, text, varchar, timestamptz, integer, varchar, varchar, timestamptz, varchar, varchar); - --- Usa Funciones CR ---drop function evaluation__delete_student_eval (integer); - ---------------------------------------- --- EVALUATION TASK GROUPS ---------------------------------------- - --- Usa Funciones CR pero hay que revisar ---drop function evaluation__new_evaluation_task_group(integer,varchar,varchar,timestamptz,integer,varchar,integer,integer); - --- Usa Funciones CR ---drop function evaluation__delete_evaluation_task_group(integer); - begin delete from acs_rels where rel_type = 'evaluation_task_group_rel'; end; @@ -181,40 +73,5 @@ / show errors; ---------------------------------------- --- GRADE FUNCIONS ---------------------------------------- - --- Usa Funciones CR Hace un Calculo Matematico ---drop function evaluation__task_grade (integer, integer); - --- Usa Funciones CR ---drop function evaluation__grade_total_grade (integer, integer); - --- Usa Funciones CR ---drop function evaluation__class_total_grade (integer, integer); - ---------------------------------------- --- OTHER FUNCIONS ---------------------------------------- - ---Fue eliminado con el paquete evaluation ---drop function evaluation__party_name (integer,integer); - --- Fue eliminado con el paqute evaluation ---drop function evaluation__party_id (integer,integer); - --- Usa Funciones CR ---drop function evaluation__new_folder (varchar,varchar,text,integer,varchar); - --- Usa Funciones CR pero hay que revisar. ---drop function evaluation__delete_contents (integer); - --- Usa Funciones CR ---drop function evaluation__delete_folder (integer,varchar); - --- Usa Funciones CR ---drop function evaluation__delete_all_folders_and_contents (); - @ evaluation-package-drop.sql Index: openacs-4/packages/evaluation/sql/oracle/evaluation-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/sql/oracle/evaluation-package-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/sql/oracle/evaluation-package-create.sql 7 Apr 2005 11:26:58 -0000 1.2 +++ openacs-4/packages/evaluation/sql/oracle/evaluation-package-create.sql 7 Apr 2005 18:57:01 -0000 1.3 @@ -5,7 +5,7 @@ -- Package definition ---------------------- -create or replace package evaluation +create package evaluation as function grade_name ( grade_id in evaluation_grades.grade_id%TYPE @@ -81,7 +81,7 @@ -- Package Body ------------------ -create or replace package body evaluation +create package body evaluation as function grade_name ( Index: openacs-4/packages/evaluation/sql/postgresql/evaluation-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/sql/postgresql/evaluation-package-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/evaluation/sql/postgresql/evaluation-package-create.sql 7 Apr 2005 11:26:58 -0000 1.3 +++ openacs-4/packages/evaluation/sql/postgresql/evaluation-package-create.sql 7 Apr 2005 18:57:01 -0000 1.4 @@ -45,7 +45,7 @@ v_content cr_revisions.content%TYPE; begin select content, - content_legth, + content_length, lob into v_content, @@ -58,7 +58,7 @@ set content = v_content, content_length = v_content_length, lob = v_lob - where revision_id = p_to_revision_id + where revision_id = p_to_revision_id; return p_to_revision_id; end; Index: openacs-4/packages/evaluation/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/tcl/apm-callback-procs.tcl,v diff -u -r1.21 -r1.22 --- openacs-4/packages/evaluation/tcl/apm-callback-procs.tcl 4 Apr 2005 18:22:36 -0000 1.21 +++ openacs-4/packages/evaluation/tcl/apm-callback-procs.tcl 7 Apr 2005 18:57:01 -0000 1.22 @@ -21,80 +21,80 @@ Does the integration whith the notifications package. } { db_transaction { - - # Create the impl and aliases for one assignment - set impl_id [create_one_assignment_impl] - - # Create the notification type for one assignment - set type_id [create_one_assignment_type -impl_id $impl_id] - - # Enable the delivery intervals and delivery methods for a specific assignment - enable_intervals_and_methods -type_id $type_id + + # Create the impl and aliases for one assignment + set impl_id [create_one_assignment_impl] + + # Create the notification type for one assignment + set type_id [create_one_assignment_type -impl_id $impl_id] + + # Enable the delivery intervals and delivery methods for a specific assignment + enable_intervals_and_methods -type_id $type_id - # Create the impl and aliases for one evaluation - set impl_id [create_one_evaluation_impl] - - # Create the notification type for one evaluation - set type_id [create_one_evaluation_type -impl_id $impl_id] - - # Enable the delivery intervals and delivery methods for a specific evaluation - enable_intervals_and_methods -type_id $type_id + # Create the impl and aliases for one evaluation + set impl_id [create_one_evaluation_impl] + + # Create the notification type for one evaluation + set type_id [create_one_evaluation_type -impl_id $impl_id] + + # Enable the delivery intervals and delivery methods for a specific evaluation + enable_intervals_and_methods -type_id $type_id - #Create the conten types - content::type::new -content_type evaluation_grades -supertype content_revision -pretty_name "Evaluation Grade" -pretty_plural "Evaluation Grades" -table_name evaluation_grades -id_column grade_id - content::type::new -content_type evaluation_tasks -supertype content_revision -pretty_name "Evaluation Task" -pretty_plural "Evaluation Tasks" -table_name evaluation_tasks -id_column task_id - content::type::new -content_type evaluation_tasks_sols -supertype content_revision -pretty_name "Evaluation Task Solution" -pretty_plural "Evaluation Tasks Solutions" -table_name evaluation_tasks_sols -id_column solution_id - content::type::new -content_type evaluation_answers -supertype content_revision -pretty_name "Student Answer" -pretty_plural "Student Answers" -table_name evaluation_answers -id_column answer_id - content::type::new -content_type evaluation_student_evals -supertype content_revision -pretty_name "Student Evaluation" -pretty_plural "Student Evaluations" -table_name evaluation_student_evals -id_column evaluation_id - content::type::new -content_type evaluation_grades_sheets -supertype content_revision -pretty_name "Evaluation Grades Sheet" -pretty_plural "Evaluation Grades Sheets" -table_name evaluation_grades_sheets -id_column grades_sheet_id + #Create the conten types + content::type::new -content_type evaluation_grades -supertype content_revision -pretty_name "Evaluation Grade" -pretty_plural "Evaluation Grades" -table_name evaluation_grades -id_column grade_id + content::type::new -content_type evaluation_tasks -supertype content_revision -pretty_name "Evaluation Task" -pretty_plural "Evaluation Tasks" -table_name evaluation_tasks -id_column task_id + content::type::new -content_type evaluation_tasks_sols -supertype content_revision -pretty_name "Evaluation Task Solution" -pretty_plural "Evaluation Tasks Solutions" -table_name evaluation_tasks_sols -id_column solution_id + content::type::new -content_type evaluation_answers -supertype content_revision -pretty_name "Student Answer" -pretty_plural "Student Answers" -table_name evaluation_answers -id_column answer_id + content::type::new -content_type evaluation_student_evals -supertype content_revision -pretty_name "Student Evaluation" -pretty_plural "Student Evaluations" -table_name evaluation_student_evals -id_column evaluation_id + content::type::new -content_type evaluation_grades_sheets -supertype content_revision -pretty_name "Evaluation Grades Sheet" -pretty_plural "Evaluation Grades Sheets" -table_name evaluation_grades_sheets -id_column grades_sheet_id - #Create and register templates - set template_id [content::template::new -name evaluation-tasks-default -text "@text;noquote@" -is_live t] - content::type::register_template -content_type evaluation_tasks -template_id $template_id -use_context public -is_default t - set template_id [content::template::new -name evaluation-tasks-sols-default -text "@text;noquote@" -is_live t] - content::type::register_template -content_type evaluation_tasks_sols -template_id $template_id -use_context public -is_default t - set template_id [content::template::new -name evaluation-answers-default -text "@text;noquote@" -is_live t] - content::type::register_template -content_type evaluation_answers -template_id $template_id -use_context public -is_default t - set template_id [content::template::new -name evaluation-grades-sheets-default -text "@text;noquote@" -is_live t] - content::type::register_template -content_type evaluation_grades_sheets -template_id $template_id -use_context public -is_default t + #Create and register templates + set template_id [content::template::new -name evaluation-tasks-default -text "@text;noquote@" -is_live t] + content::type::register_template -content_type evaluation_tasks -template_id $template_id -use_context public -is_default t + set template_id [content::template::new -name evaluation-tasks-sols-default -text "@text;noquote@" -is_live t] + content::type::register_template -content_type evaluation_tasks_sols -template_id $template_id -use_context public -is_default t + set template_id [content::template::new -name evaluation-answers-default -text "@text;noquote@" -is_live t] + content::type::register_template -content_type evaluation_answers -template_id $template_id -use_context public -is_default t + set template_id [content::template::new -name evaluation-grades-sheets-default -text "@text;noquote@" -is_live t] + content::type::register_template -content_type evaluation_grades_sheets -template_id $template_id -use_context public -is_default t - #Create content type attributes for content type evaluation_grades - content::type::attribute::new -content_type evaluation_grades -attribute_name grade_item_id -datatype number -pretty_name grade_item_id -column_spec integer - content::type::attribute::new -content_type evaluation_grades -attribute_name grade_name -datatype string -pretty_name grade_name -column_spec "varchar(100)" - content::type::attribute::new -content_type evaluation_grades -attribute_name grade_plural_name -datatype string -pretty_name grade_plural_name -column_spec "varchar(100)" - content::type::attribute::new -content_type evaluation_grades -attribute_name comments -datatype string -pretty_name Comments -column_spec "varchar(500)" - content::type::attribute::new -content_type evaluation_grades -attribute_name weight -datatype number -pretty_name Weight -column_spec numeric + #Create content type attributes for content type evaluation_grades + content::type::attribute::new -content_type evaluation_grades -attribute_name grade_item_id -datatype number -pretty_name grade_item_id -column_spec integer + content::type::attribute::new -content_type evaluation_grades -attribute_name grade_name -datatype string -pretty_name grade_name -column_spec "varchar(100)" + content::type::attribute::new -content_type evaluation_grades -attribute_name grade_plural_name -datatype string -pretty_name grade_plural_name -column_spec "varchar(100)" + content::type::attribute::new -content_type evaluation_grades -attribute_name comments -datatype string -pretty_name Comments -column_spec "varchar(500)" + content::type::attribute::new -content_type evaluation_grades -attribute_name weight -datatype number -pretty_name Weight -column_spec numeric - #Create content type attributes for content type evaluation_tasks - content::type::attribute::new -content_type evaluation_tasks -attribute_name task_item_id -datatype number -pretty_name task_item_id -column_spec integer - content::type::attribute::new -content_type evaluation_tasks -attribute_name task_name -datatype number -pretty_name task_name -column_spec integer - content::type::attribute::new -content_type evaluation_tasks -attribute_name number_of_members -datatype string -pretty_name number_of_members -column_spec varchar - content::type::attribute::new -content_type evaluation_tasks -attribute_name due_date -datatype timestamp -pretty_name due_date -column_spec timestamptz - content::type::attribute::new -content_type evaluation_tasks -attribute_name grade_item_id -datatype number -pretty_name grade_item_id -column_spec integer - content::type::attribute::new -content_type evaluation_tasks -attribute_name weight -datatype number -pretty_name weight -column_spec numeric - content::type::attribute::new -content_type evaluation_tasks -attribute_name online_p -datatype string -pretty_name online_p -column_spec "varchar(1)" - content::type::attribute::new -content_type evaluation_tasks -attribute_name late_submit_p -datatype string -pretty_name late_submit_p -column_spec "varchar(1)" - content::type::attribute::new -content_type evaluation_tasks -attribute_name requires_grade_p -datatype string -pretty_name requires_grade_p -column_spec "varchar(1)" + #Create content type attributes for content type evaluation_tasks + content::type::attribute::new -content_type evaluation_tasks -attribute_name task_item_id -datatype number -pretty_name task_item_id -column_spec integer + content::type::attribute::new -content_type evaluation_tasks -attribute_name task_name -datatype number -pretty_name task_name -column_spec integer + content::type::attribute::new -content_type evaluation_tasks -attribute_name number_of_members -datatype string -pretty_name number_of_members -column_spec varchar + content::type::attribute::new -content_type evaluation_tasks -attribute_name due_date -datatype timestamp -pretty_name due_date -column_spec timestamptz + content::type::attribute::new -content_type evaluation_tasks -attribute_name grade_item_id -datatype number -pretty_name grade_item_id -column_spec integer + content::type::attribute::new -content_type evaluation_tasks -attribute_name weight -datatype number -pretty_name weight -column_spec numeric + content::type::attribute::new -content_type evaluation_tasks -attribute_name online_p -datatype string -pretty_name online_p -column_spec "varchar(1)" + content::type::attribute::new -content_type evaluation_tasks -attribute_name late_submit_p -datatype string -pretty_name late_submit_p -column_spec "varchar(1)" + content::type::attribute::new -content_type evaluation_tasks -attribute_name requires_grade_p -datatype string -pretty_name requires_grade_p -column_spec "varchar(1)" - #Create content type attributes for content type evaluation_tasks_sols - content::type::attribute::new -content_type evaluation_tasks_sols -attribute_name solution_item_id -datatype number -pretty_name solution_item_id -column_spec integer - content::type::attribute::new -content_type evaluation_tasks_sols -attribute_name task_item_id -datatype number -pretty_name task_item_id -column_spec integer + #Create content type attributes for content type evaluation_tasks_sols + content::type::attribute::new -content_type evaluation_tasks_sols -attribute_name solution_item_id -datatype number -pretty_name solution_item_id -column_spec integer + content::type::attribute::new -content_type evaluation_tasks_sols -attribute_name task_item_id -datatype number -pretty_name task_item_id -column_spec integer - #Create content type attributes for content type evaluation_answers - content::type::attribute::new -content_type evaluation_answers -attribute_name answer_item_id -datatype number -pretty_name answer_item_id -column_spec integer - content::type::attribute::new -content_type evaluation_answers -attribute_name party_id -datatype number -pretty_name party_id -column_spec integer - content::type::attribute::new -content_type evaluation_answers -attribute_name task_item_id -datatype number -pretty_name task_item_id -column_spec integer + #Create content type attributes for content type evaluation_answers + content::type::attribute::new -content_type evaluation_answers -attribute_name answer_item_id -datatype number -pretty_name answer_item_id -column_spec integer + content::type::attribute::new -content_type evaluation_answers -attribute_name party_id -datatype number -pretty_name party_id -column_spec integer + content::type::attribute::new -content_type evaluation_answers -attribute_name task_item_id -datatype number -pretty_name task_item_id -column_spec integer - #Create content type attributes for content type evaluation_student_evals - content::type::attribute::new -content_type evaluation_student_evals -attribute_name evaluation_item_id -datatype number -pretty_name evaluation_item_id -column_spec integer - content::type::attribute::new -content_type evaluation_student_evals -attribute_name task_item_id -datatype number -pretty_name task_item_id -column_spec integer - content::type::attribute::new -content_type evaluation_student_evals -attribute_name party_id -datatype number -pretty_name party_id -column_spec integer - content::type::attribute::new -content_type evaluation_student_evals -attribute_name grade -datatype number -pretty_name grade -column_spec numeric - content::type::attribute::new -content_type evaluation_student_evals -attribute_name show_student_p -datatype string -pretty_name show_student_p -column_spec "varchar(1)" + #Create content type attributes for content type evaluation_student_evals + content::type::attribute::new -content_type evaluation_student_evals -attribute_name evaluation_item_id -datatype number -pretty_name evaluation_item_id -column_spec integer + content::type::attribute::new -content_type evaluation_student_evals -attribute_name task_item_id -datatype number -pretty_name task_item_id -column_spec integer + content::type::attribute::new -content_type evaluation_student_evals -attribute_name party_id -datatype number -pretty_name party_id -column_spec integer + content::type::attribute::new -content_type evaluation_student_evals -attribute_name grade -datatype number -pretty_name grade -column_spec numeric + content::type::attribute::new -content_type evaluation_student_evals -attribute_name show_student_p -datatype string -pretty_name show_student_p -column_spec "varchar(1)" - #Create content type attributes for content type evaluation_grades_sheets - content::type::attribute::new -content_type evaluation_grades_sheets -attribute_name grades_sheet_item_id -datatype number -pretty_name grades_sheet_item_id -column_spec integer - content::type::attribute::new -content_type evaluation_grades_sheets -attribute_name task_item_id -datatype number -pretty_name task_item_id -column_spec integer + #Create content type attributes for content type evaluation_grades_sheets + content::type::attribute::new -content_type evaluation_grades_sheets -attribute_name grades_sheet_item_id -datatype number -pretty_name grades_sheet_item_id -column_spec integer + content::type::attribute::new -content_type evaluation_grades_sheets -attribute_name task_item_id -datatype number -pretty_name task_item_id -column_spec integer } } @@ -108,64 +108,61 @@ db_transaction { # Delete the type_id for a specific assignment notification::type::delete -short_name one_assignment_notif - + # Delete the implementation for the notification of an assignment delete_one_assignment_impl - + # Delete the type_id for a especific evaluation notification::type::delete -short_name one_evaluation_notif - + # Delete the implementation for the notification of an evaluation - delete_one_evaluation_impl + delete_one_evaluation_impl - #Delete content type templates - set template_id [content::type::get_template -content_type evaluation_tasks -use_context public] - content::type::unregister_template -content_type evaluation_tasks -template_id $template_id -use_context public - content::template::delete -template_id $template_id - set template_id [content::type::get_template -content_type evaluation_tasks_sols -use_context public] - content::type::unregister_template -content_type evaluation_tasks_sols -template_id $template_id -use_context public - content::template::delete -template_id $template_id - set template_id [content::type::get_template -content_type evaluation_answers -use_context public] - content::type::unregister_template -content_type evaluation_answers -template_id $template_id -use_context public - content::template::delete -template_id $template_id - set template_id [content::type::get_template -content_type evaluation_grades_sheets -use_context public] - content::type::unregister_template -content_type evaluation_grades_sheets -template_id $template_id -use_context public - content::template::delete -template_id $template_id + #Delete content type attributes + content::type::attribute::delete -content_type evaluation_grades -attribute_name grade_item_id + content::type::attribute::delete -content_type evaluation_grades -attribute_name grade_name + content::type::attribute::delete -content_type evaluation_grades -attribute_name grade_plural_name + content::type::attribute::delete -content_type evaluation_grades -attribute_name comments + content::type::attribute::delete -content_type evaluation_grades -attribute_name weight + content::type::attribute::delete -content_type evaluation_tasks -attribute_name task_item_id + content::type::attribute::delete -content_type evaluation_tasks -attribute_name task_name + content::type::attribute::delete -content_type evaluation_tasks -attribute_name number_of_members + content::type::attribute::delete -content_type evaluation_tasks -attribute_name due_date + content::type::attribute::delete -content_type evaluation_tasks -attribute_name grade_item_id + content::type::attribute::delete -content_type evaluation_tasks -attribute_name weight + content::type::attribute::delete -content_type evaluation_tasks -attribute_name online_p + content::type::attribute::delete -content_type evaluation_tasks -attribute_name late_submit_p + content::type::attribute::delete -content_type evaluation_tasks -attribute_name requires_grade_p + content::type::attribute::delete -content_type evaluation_tasks_sols -attribute_name solution_item_id + content::type::attribute::delete -content_type evaluation_tasks_sols -attribute_name task_item_id + content::type::attribute::delete -content_type evaluation_answers -attribute_name answer_item_id + content::type::attribute::delete -content_type evaluation_answers -attribute_name party_id + content::type::attribute::delete -content_type evaluation_answers -attribute_name task_item_id + content::type::attribute::delete -content_type evaluation_student_evals -attribute_name evaluation_item_id + content::type::attribute::delete -content_type evaluation_student_evals -attribute_name task_item_id + content::type::attribute::delete -content_type evaluation_student_evals -attribute_name party_id + content::type::attribute::delete -content_type evaluation_student_evals -attribute_name grade + content::type::attribute::delete -content_type evaluation_student_evals -attribute_name show_student_p + content::type::attribute::delete -content_type evaluation_grades_sheets -attribute_name grades_sheet_item_id + content::type::attribute::delete -content_type evaluation_grades_sheets -attribute_name task_item_id + + #Delete content type templates + set template_id [content::type::get_template -content_type evaluation_tasks -use_context public] + content::type::unregister_template -content_type evaluation_tasks -template_id $template_id -use_context public + set template_id [content::type::get_template -content_type evaluation_tasks_sols -use_context public] + content::type::unregister_template -content_type evaluation_tasks_sols -template_id $template_id -use_context public + set template_id [content::type::get_template -content_type evaluation_answers -use_context public] + content::type::unregister_template -content_type evaluation_answers -template_id $template_id -use_context public + set template_id [content::type::get_template -content_type evaluation_grades_sheets -use_context public] + content::type::unregister_template -content_type evaluation_grades_sheets -template_id $template_id -use_context public - #Delete content type attributes - content::type::attribute::delete -content_type evaluation_grades -attribute_name grade_item_id - content::type::attribute::delete -content_type evaluation_grades -attribute_name grade_name - content::type::attribute::delete -content_type evaluation_grades -attribute_name grade_plural_name - content::type::attribute::delete -content_type evaluation_grades -attribute_name comments - content::type::attribute::delete -content_type evaluation_grades -attribute_name weight - content::type::attribute::delete -content_type evaluation_tasks -attribute_name task_item_id - content::type::attribute::delete -content_type evaluation_tasks -attribute_name task_name - content::type::attribute::delete -content_type evaluation_tasks -attribute_name number_of_members - content::type::attribute::delete -content_type evaluation_tasks -attribute_name due_date - content::type::attribute::delete -content_type evaluation_tasks -attribute_name grade_item_id - content::type::attribute::delete -content_type evaluation_tasks -attribute_name weight - content::type::attribute::delete -content_type evaluation_tasks -attribute_name online_p - content::type::attribute::delete -content_type evaluation_tasks -attribute_name late_submit_p - content::type::attribute::delete -content_type evaluation_tasks -attribute_name requires_grade_p - content::type::attribute::delete -content_type evaluation_tasks_sols -attribute_name solution_item_id - content::type::attribute::delete -content_type evaluation_tasks_sols -attribute_name task_item_id - content::type::attribute::delete -content_type evaluation_answers -attribute_name answer_item_id - content::type::attribute::delete -content_type evaluation_answers -attribute_name party_id - content::type::attribute::delete -content_type evaluation_answers -attribute_name task_item_id - content::type::attribute::delete -content_type evaluation_student_evals -attribute_name evaluation_item_id - content::type::attribute::delete -content_type evaluation_student_evals -attribute_name task_item_id - content::type::attribute::delete -content_type evaluation_student_evals -attribute_name party_id - content::type::attribute::delete -content_type evaluation_student_evals -attribute_name grade - content::type::attribute::delete -content_type evaluation_student_evals -attribute_name show_student_p - content::type::attribute::delete -content_type evaluation_grades_sheets -attribute_name grades_sheet_item_id - content::type::attribute::delete -content_type evaluation_grades_sheets -attribute_name task_item_id - #Delete Content types - content::type::delete -content_type evaluation_grades - content::type::delete -content_type evaluation_tasks - content::type::delete -content_type evaluation_tasks_sols - content::type::delete -content_type evaluation_answers - content::type::delete -content_type evaluation_student_evals - content::type::delete -content_type evaluation_grades_sheets + #Delete Content types + content::type::delete -content_type evaluation_grades + content::type::delete -content_type evaluation_tasks + content::type::delete -content_type evaluation_tasks_sols + content::type::delete -content_type evaluation_answers + content::type::delete -content_type evaluation_student_evals + content::type::delete -content_type evaluation_grades_sheets } } @@ -190,23 +187,23 @@ set projects_desc "[_ evaluation.lt_Projects_for_students]" db_transaction { - set folder_id [content::folder::new -name "evaluation_grades_$package_id" -label "evaluation_grades_$package_id" -package_id $package_id ] - content::folder::register_content_type -folder_id $folder_id -content_type evaluation_grades -include_subtypes t + set folder_id [content::folder::new -name "evaluation_grades_$package_id" -label "evaluation_grades_$package_id" -package_id $package_id ] + content::folder::register_content_type -folder_id $folder_id -content_type evaluation_grades -include_subtypes t - set folder_id [content::folder::new -name "evaluation_tasks_$package_id" -label "evaluation_tasks_$package_id" -package_id $package_id ] - content::folder::register_content_type -folder_id $folder_id -content_type evaluation_tasks -include_subtypes t - - set folder_id [content::folder::new -name "evaluation_tasks_sols_$package_id" -label "evaluation_tasks_sols_$package_id" -package_id $package_id ] - content::folder::register_content_type -folder_id $folder_id -content_type evaluation_tasks_sols -include_subtypes t + set folder_id [content::folder::new -name "evaluation_tasks_$package_id" -label "evaluation_tasks_$package_id" -package_id $package_id ] + content::folder::register_content_type -folder_id $folder_id -content_type evaluation_tasks -include_subtypes t + + set folder_id [content::folder::new -name "evaluation_tasks_sols_$package_id" -label "evaluation_tasks_sols_$package_id" -package_id $package_id ] + content::folder::register_content_type -folder_id $folder_id -content_type evaluation_tasks_sols -include_subtypes t - set folder_id [content::folder::new -name "evaluation_answers_$package_id" -label "evaluation_answers_$package_id" -package_id $package_id ] - content::folder::register_content_type -folder_id $folder_id -content_type evaluation_answers -include_subtypes t - - set folder_id [content::folder::new -name "evaluation_grades_sheets_$package_id" -label "evaluation_grades_sheets_$package_id" -package_id $package_id ] - content::folder::register_content_type -folder_id $folder_id -content_type evaluation_grades_sheets -include_subtypes t - - set folder_id [content::folder::new -name "evaluation_student_evals_$package_id" -label "evaluation_student_evals_$package_id" -package_id $package_id ] - content::folder::register_content_type -folder_id $folder_id -content_type evaluation_student_evals -include_subtypes t + set folder_id [content::folder::new -name "evaluation_answers_$package_id" -label "evaluation_answers_$package_id" -package_id $package_id ] + content::folder::register_content_type -folder_id $folder_id -content_type evaluation_answers -include_subtypes t + + set folder_id [content::folder::new -name "evaluation_grades_sheets_$package_id" -label "evaluation_grades_sheets_$package_id" -package_id $package_id ] + content::folder::register_content_type -folder_id $folder_id -content_type evaluation_grades_sheets -include_subtypes t + + set folder_id [content::folder::new -name "evaluation_student_evals_$package_id" -label "evaluation_student_evals_$package_id" -package_id $package_id ] + content::folder::register_content_type -folder_id $folder_id -content_type evaluation_student_evals -include_subtypes t } set exams_item_id [db_nextval acs_object_id_seq] @@ -232,112 +229,136 @@ } { #Delete all content templates db_foreach answer { - select ea.answer_id from evaluation_answersi ea, acs_objects ao where ea.item_id = ao.object_id and ao.context_id = p_package_id + select ea.answer_id from evaluation_answersi ea, acs_objects ao where ea.item_id = ao.object_id and ao.context_id = :package_id } { - content::revision::delete -revision_id $answer_id + content::revision::delete -revision_id $answer_id } db_foreach solution { - select ets.solution_id from evaluation_tasks_solsi ets, acs_objects ao where ets.item_id = ao.object_id and ao.context_id = p_package_id + select ets.solution_id from evaluation_tasks_solsi ets, acs_objects ao where ets.item_id = ao.object_id and ao.context_id = :package_id } { - content::revision::delete -revision_id $solution_id + content::revision::delete -revision_id $solution_id } db_foreach grades_sheet { - select egs.grades_sheet_id from evaluation_grades_sheetsi egs, acs_objects ao where egs.item_id = ao.object_id and ao.context_id = p_package_id + select egs.grades_sheet_id from evaluation_grades_sheetsi egs, acs_objects ao where egs.item_id = ao.object_id and ao.context_id = :package_id } { - content::revision::delete -revision_id $grades_sheet_id + content::revision::delete -revision_id $grades_sheet_id } db_foreach student_eval { - select ese.evaluation_id from evaluation_student_evalsi ese, acs_objects ao where ese.item_id = ao.object_id and ao.context_id = p_package_id + select ese.evaluation_id from evaluation_student_evalsi ese, acs_objects ao where ese.item_id = ao.object_id and ao.context_id = :package_id } { - content::revision::delete -revision_id $evaluation_id + content::revision::delete -revision_id $evaluation_id } db_foreach evaluation_task { - select et.task_id from evaluation_tasksi et, acs_objects ao where et.item_id = ao.object_id and ao.context_id = p_package_id + select et.task_id from evaluation_tasksi et, acs_objects ao where et.item_id = ao.object_id and ao.context_id = :package_id } { - content::revision::delete -revision_id $task_id + content::revision::delete -revision_id $task_id } db_foreach evaluation_grade { - select eg.grade_id from evaluation_gradesi eg, acs_objects ao where eg.item_id = ao.object_id and ao.context_id = p_package_id + select eg.grade_id from evaluation_gradesi eg, acs_objects ao where eg.item_id = ao.object_id and ao.context_id = :package_id } { - content::revision::delete -revision_id $grade_id + content::revision::delete -revision_id $grade_id } #evaluation_task_sols - set folder_id [content::item::get_id -item_path "evaluation_tasks_sols_$package_id" -resolve_index f] - db_foreach task_sol_item { - select item_id from cr_items where parent_id = :folder_id - } { - evaluation::item::delete -item_id $item_id - } - content::folder::unregister_content_type -folder_id $folder_id -content_type content_revision -include_subtypes t - content::folder::unregister_content_type -folder_id $folder_id -content_type evaluation_tasks_sols -include_subtypes t - - db_dml delete_task_sols_folder_map "delete from cr_folder_type_map where content_type = 'evaluation_tasks_sols'" - content::folder::delete -folder_id $folder_id - + set folder_id [content::item::get_id -item_path "evaluation_tasks_sols_$package_id" -resolve_index f] + db_foreach task_sol_item { + select item_id from cr_items where parent_id = :folder_id + } { + content::item::delete -item_id $item_id + } + content::folder::unregister_content_type -folder_id $folder_id -content_type content_revision -include_subtypes t + content::folder::unregister_content_type -folder_id $folder_id -content_type evaluation_tasks_sols -include_subtypes t + db_dml delete_task_sols_folder_map "delete from cr_folder_type_map where content_type = 'evaluation_tasks_sols'" + content::folder::delete -folder_id $folder_id + ns_log notice "checkpoint 1" #evaluation_answers set folder_id [content::item::get_id -item_path "evaluation_answers_$package_id" -resolve_index f] db_foreach answer_item { - select item_id from cr_items where parent_id = :folder_id + select item_id from cr_items where parent_id = :folder_id } { content::item::delete -item_id $item_id } - content::folder::unregister_content_type -folder_id $v_folder_id -content_type content_revision -include_subtypes t - content::folder::unregister_content_type -folder_id $v_folder_id -content_type evaluation_answers -include_subtypes t + content::folder::unregister_content_type -folder_id $folder_id -content_type content_revision -include_subtypes t + content::folder::unregister_content_type -folder_id $folder_id -content_type evaluation_answers -include_subtypes t db_dml delete_answer_folder_map "delete from cr_folder_type_map where content_type = 'evaluation_answers'" content::folder::delete -folder_id $folder_id + ns_log notice "checkpoint 2" #evaluation_students_eval set folder_id [content::item::get_id -item_path "evaluation_student_evals_$package_id" -resolve_index f] db_foreach student_eval_item { - select item_id from cr_items where parent_id = :folder_id + select cri.revision_id as evaluation_id + from cr_revisions cri, cr_items cr + where cr.item_id = cri.item_id + and cr.parent_id = :folder_id } { - evaluation::delete_student_eval -evaluation_id $item_id + evaluation::delete_student_eval -evaluation_id $evaluation_id } + ns_log notice "checkpoint 3" content::folder::unregister_content_type -folder_id $folder_id -content_type content_revision -include_subtypes t content::folder::unregister_content_type -folder_id $folder_id -content_type evaluation_student_evals -include_subtypes t db_dml delete_student_eval_folder_map "delete from cr_folder_type_map where content_type = 'evaluation_student_evals'" content::folder::delete -folder_id $folder_id + + #evalution_task_groups + db_foreach delete_evaluation_groups { + select group_id from groups, acs_objects + where group_id = object_id + and context_id = :package_id + } { + evaluation::delete_evaluation_group -group_id $group_id + } + #evaluation_grades_sheets set folder_id [content::item::get_id -item_path "evaluation_grades_sheets_$package_id" -resolve_index f] + ns_log notice "checkpoint 4" db_foreach grade_sheet_item { - select item_id from cr_items where parent_id = :folder_id + select item_id from cr_items where parent_id = :folder_id } { - content::delete::item -item_id $item_id + content::item::delete -item_id $item_id } content::folder::unregister_content_type -folder_id $folder_id -content_type content_revision -include_subtypes t - content::folder::unregister_content_type -folder_id $folder_ied -content_type evaluation_grades_sheets -include_subtypes t + content::folder::unregister_content_type -folder_id $folder_id -content_type evaluation_grades_sheets -include_subtypes t + ns_log notice "checkpoint 5" db_dml delete_grade_sheet_folder_map "delete from cr_folder_type_map where content_type = 'evaluation_grades_sheets'" content::folder::delete -folder_id $folder_id #evaluation_tasks set folder_id [content::item::get_id -item_path "evaluation_tasks_$package_id" -resolve_index f] - db_foreach task_item { - select cri.revision_id as task_id - from cr_revisions cri, cr_items cr - where cr.item_id = cri.item_id - and cr.parent_id = :folder_id + db_foreach task_revision { + select cri.revision_id as task_id, cri.item_id as task_item_id + from cr_revisions cri, cr_items cr + where cr.item_id = cri.item_id + and cr.parent_id = :folder_id } { - evaluation::delete_task -task_id $item_id + if { [db_0or1row cal_map { select cal_item_id from evaluation_cal_task_map where task_item_id = :task_item_id }] } { + db_dml delete_cal_mappings { + delete from evaluation_cal_task_map where cal_item_id = :cal_item_id + } + calendar::item::delete -cal_item_id $cal_item_id + } + + evaluation::delete_task -task_id $item_id } + ns_log notice "checkpoint 6" - content::folder::unregister_content_type -folder_id $v_folder_id -content_type content_revision -include_subtypes t - content::folder::unregister_content_type -folder_id $v_folder_id -content_type evaluation_tasks -include_subtypes t + content::folder::unregister_content_type -folder_id $folder_id -content_type content_revision -include_subtypes t + content::folder::unregister_content_type -folder_id $folder_id -content_type evaluation_tasks -include_subtypes t db_dml delete_tasks_folder_map "delete from cr_folder_type_map where content_type = 'evaluation_tasks'" content::folder::delete -folder_id $folder_id @@ -346,17 +367,43 @@ set folder_id [content::item::get_id -item_path "evaluation_grades_$package_id" -resolve_index f] db_foreach grade_item { - select cri.revision_id as grade_id - from cr_revisions cri, cr_items cr - where cr.item_id = cri.item_id - and cr.parent_id = :folder_id + select cri.revision_id as grade_id + from cr_revisions cri, cr_items cr + where cr.item_id = cri.item_id + and cr.parent_id = :folder_id } { - evaluation::delete_grade -grade_id $grade_id + evaluation::delete_grade -grade_id $grade_id } - content::folder::unregister_content_type -folder_id $v_folder_id -content_type content_revision -include_subtypes t - content::folder::unregister_content_type -folder_id $v_folder_id -content_type evaluation_grades -include_subtypes t + content::folder::unregister_content_type -folder_id $folder_id -content_type content_revision -include_subtypes t + content::folder::unregister_content_type -folder_id $folder_id -content_type evaluation_grades -include_subtypes t db_dml delete_grade_folder_map "delete from cr_folder_type_map where content_type = 'evaluation_grades'" content::folder::delete -folder_id $folder_id + + # + # delete the rest of the content + # + db_foreach delete_items { + select cri.item_id + from cr_items cri, acs_objects ao + where cri.item_id = ao.object_id + and ao.context_id = :package_id + } { + if { [db_0or1row cal_map { select cal_item_id from evaluation_cal_task_map where task_item_id = :item_id }] } { + db_dml delete_cal_mappings { + delete from evaluation_cal_task_map where cal_item_id = :cal_item_id + } + calendar::item::delete -cal_item_id $cal_item_id + } + content::item::delete -item_id $item_id + } + + db_foreach delete_acs_rels { + select rel_id from acs_rels, acs_objects + where rel_id = object_id + and context_id = :package_id + } { + relation_remove $rel_id + } } Index: openacs-4/packages/evaluation/tcl/evaluation-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/tcl/evaluation-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/evaluation/tcl/evaluation-procs-oracle.xql 7 Apr 2005 11:26:58 -0000 1.3 +++ openacs-4/packages/evaluation/tcl/evaluation-procs-oracle.xql 7 Apr 2005 18:57:01 -0000 1.4 @@ -3,11 +3,11 @@ oracle8.1.6 - + begin - select content_item.set_live_revision ( - revision_id => :revision_id + :1 := evaluation.delete_evaluation_task_group ( + p_task_group_id => :group_id ); end; Index: openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql,v diff -u -r1.23 -r1.24 --- openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql 7 Apr 2005 11:26:58 -0000 1.23 +++ openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql 7 Apr 2005 18:57:01 -0000 1.24 @@ -3,13 +3,11 @@ postgresql7.3 - + - select content_item__set_live_revision ( - :revision_id - ); - + select evaluation__delete_evaluation_task_group (:group_id) + @@ -211,7 +209,7 @@ - select evaluation__clone(:from_task_id,:revision_id) + select evaluation__clone_task(:from_task_id,:revision_id) Index: openacs-4/packages/evaluation/tcl/evaluation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/tcl/evaluation-procs.tcl,v diff -u -r1.30 -r1.31 --- openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 7 Apr 2005 11:26:58 -0000 1.30 +++ openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 7 Apr 2005 18:57:01 -0000 1.31 @@ -128,7 +128,6 @@ db_foreach evaluation_delete_grades_sheet { select grades_sheet_id from evaluation_grades_sheets where task_item_id = :task_item_id } { content::revision::delete -revision_id $grades_sheet_id } - # db_1row get_task_id { select task_id as tasks_task_id from evaluation_tasks where task_item_id = :task_item_id } content::revision::delete -revision_id $task_id } @@ -720,6 +719,18 @@ return $group_id } +ad_proc -public evaluation::delete_evaluation_group { + -group_id:required +} { + + Deletes an evaluation_group + + @param group_id The group_id that will be deleted. + +} { + db_exec_plsql delete_evaluation_group { *SQL* } +} + ad_proc -public evaluation::evaluation_group_name { -group_id:required } { Index: openacs-4/packages/evaluation/www/answer-add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/answer-add-edit-postgresql.xql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/evaluation/www/answer-add-edit-postgresql.xql 7 Apr 2005 11:26:58 -0000 1.10 +++ openacs-4/packages/evaluation/www/answer-add-edit-postgresql.xql 7 Apr 2005 18:57:01 -0000 1.11 @@ -41,6 +41,16 @@ + + + + update cr_items + set storage_type = 'text' + where item_id = :item_id + + + + Index: openacs-4/packages/evaluation/www/answer-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/answer-add-edit.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/evaluation/www/answer-add-edit.tcl 7 Apr 2005 11:26:58 -0000 1.16 +++ openacs-4/packages/evaluation/www/answer-add-edit.tcl 7 Apr 2005 18:57:01 -0000 1.17 @@ -145,6 +145,8 @@ db_dml link_content { *SQL* } set content_length 0 + # in order to support oracle and postgres and still using only the cr_items table to store the task + db_dml set_storage_type { *SQL* } db_dml content_size { *SQL* } } Index: openacs-4/packages/evaluation/www/admin/groups/group-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-delete-2.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/evaluation/www/admin/groups/group-delete-2.tcl 5 Apr 2005 17:19:09 -0000 1.6 +++ openacs-4/packages/evaluation/www/admin/groups/group-delete-2.tcl 7 Apr 2005 18:57:01 -0000 1.7 @@ -16,8 +16,7 @@ if { [string eq $operation "[_ evaluation.lt_Yes_I_really_want_to__2]"] } { db_transaction { - db_exec_plsql delete_group { *SQL* } - + evaluation::delete_evaluation_group -group_id $evaluation_group_id } on_error { ad_return_error "[_ evaluation.lt_Error_deleting_the_ev]" "[_ evaluation.lt_We_got_the_following_]" Index: openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit-oracle.xql 7 Apr 2005 11:27:00 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit-oracle.xql 7 Apr 2005 18:57:01 -0000 1.3 @@ -51,6 +51,16 @@ + + + + update cr_items + set storage_type = 'lob' + where item_id = :item_id + + + + Index: openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit-postgresql.xql 7 Apr 2005 11:27:00 -0000 1.7 +++ openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit-postgresql.xql 7 Apr 2005 18:57:01 -0000 1.8 @@ -50,6 +50,26 @@ + + + + update cr_items + set storage_type = 'text' + where item_id = :item_id + + + + + + + + update cr_revisions + set content = :url + where revision_id = :revision_id + + + + Index: openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl 7 Apr 2005 11:27:00 -0000 1.14 +++ openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl 7 Apr 2005 18:57:01 -0000 1.15 @@ -60,7 +60,7 @@ } {url:text(text),optional {label "[_ evaluation.URL__1]"} - {value "htp://"} + {value "http://"} } } } else { @@ -238,9 +238,11 @@ } elseif { ![string eq $url "http://"] } { - db_dml link_content { *SQL* } - set content_length [string length $url] - db_dml content_size { *SQL* } + db_dml link_content { *SQL* } + set content_length [string length $url] + # in order to support oracle and postgres and still using only the cr_items table to store the task + db_dml set_storage_type { *SQL* } + db_dml content_size { *SQL* } } elseif { [string eq $attached_p "t"] && ![string eq $unattach_p "t"] } { # just copy the old content to the new revision Index: openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.xql 7 Apr 2005 11:27:00 -0000 1.7 +++ openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.xql 7 Apr 2005 18:57:01 -0000 1.8 @@ -43,15 +43,4 @@ - - - - - update cr_revisions - set content = :url - where revision_id = :revision_id - - - - Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-oracle.xql 7 Apr 2005 11:27:00 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-oracle.xql 7 Apr 2005 18:57:01 -0000 1.3 @@ -37,6 +37,16 @@ + + + + update cr_items + set storage_type = 'lob' + where item_id = :item_id + + + + Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-postgresql.xql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-postgresql.xql 7 Apr 2005 11:27:00 -0000 1.11 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-postgresql.xql 7 Apr 2005 18:57:01 -0000 1.12 @@ -10,9 +10,11 @@ et.title, et.item_id, et.mime_type, + crr.content_length, cri.storage_type - from evaluation_tasksi et, cr_items cri + from evaluation_tasksi et, cr_items cri, cr_revisions crr where et.task_id = :task_id + and crr.revision_id = et.task_id and et.item_id = cri.item_id @@ -21,7 +23,7 @@ - select to_timestamp('[template::util::date::get_property linear_date $due_date]','YYYY MM DD HH24 MI SS')l + select to_timestamp('[template::util::date::get_property linear_date $due_date]','YYYY MM DD HH24 MI SS') @@ -46,6 +48,16 @@ + + + + update cr_items + set storage_type = 'text' + where item_id = :item_id + + + + Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 7 Apr 2005 11:27:00 -0000 1.24 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 7 Apr 2005 18:57:01 -0000 1.25 @@ -52,8 +52,8 @@ task_id:key {task_name:text - {label "[_ evaluation.Task_Name_]"} - {html {size 30}} + {label "[_ evaluation.Task_Name_]"} + {html {size 30}} } } @@ -64,189 +64,190 @@ if { ![string eq $title "link"] && $content_length > 0 } { - if { [string eq $mode "edit"] } { - set attached_p "t" - - ad_form -extend -name task -form { - {upload_file:file,optional - {label "[_ evaluation.File_]"} - {html "size 30"} - {help_text "[_ evaluation.lt_Currently_title_is_at_2]"} + if { [string eq $mode "edit"] } { + set attached_p "t" + + ad_form -extend -name task -form { + {upload_file:file,optional + {label "[_ evaluation.File_]"} + {html "size 30"} + {help_text "[_ evaluation.lt_Currently_title_is_at_2]"} + } + {unattach_p:text(checkbox),optional + {label "[_ evaluation.Unattach_file_]"} + {options {{"" "t"}}} + {help_text "[_ evaluation.lt_Check_this_if_you_wan]"} + } + {url:text(text),optional + {label "[_ evaluation.URL__1]"} + {value "http://"} + } + } + } else { + ad_form -extend -name task -form { + {upload_file:text,optional + {label "[_ evaluation.File_]"} + {html "size 30"} + {value "$title"} + } + {unattach_p:text(hidden) + } + {url:text(hidden) + } + } } - {unattach_p:text(checkbox),optional - {label "[_ evaluation.Unattach_file_]"} - {options {{"" "t"}}} - {help_text "[_ evaluation.lt_Check_this_if_you_wan]"} - } - {url:text(text),optional - {label "[_ evaluation.URL__1]"} - {value "http://"} - } - } - } else { - ad_form -extend -name task -form { - {upload_file:text,optional - {label "[_ evaluation.File_]"} - {html "size 30"} - {value "$title"} - } - {unattach_p:text(hidden) - } - {url:text(hidden) - } - } - } } elseif { [string eq $title "link"] } { - if { [string eq $mode "edit"] } { + ns_log notice "si va bien!, content trae -${content}- " + if { [string eq $mode "edit"] } { - set attached_p "t" - - ad_form -extend -name task -form { - - {upload_file:file,optional - {label "[_ evaluation.File_]"} - {html "size 30"} + set attached_p "t" + + ad_form -extend -name task -form { + + {upload_file:file,optional + {label "[_ evaluation.File_]"} + {html "size 30"} + } + {url:text(text),optional + {label "[_ evaluation.URL__1]"} + {value "http://"} + {help_text "[_ evaluation.lt_Currently_content_is__1]"} + } + {unattach_p:text(checkbox),optional + {label "[_ evaluation.Unassociate_url_]"} + {options {{"" "t"}}} + {help_text "[_ evaluation.lt_Check_this_if_you_wan]"} + } + } + } else { + ad_form -extend -name task -form { + + {upload_file:text(hidden) + } + {url:text(text),optional + {label "[_ evaluation.URL__1]"} + {value "$content"} + } + {unattach_p:text(hidden) + } + } } - {url:text(text),optional - {label "[_ evaluation.URL__1]"} - {value "http://"} - {help_text "[_ evaluation.lt_Currently_content_is__1]"} - } - {unattach_p:text(checkbox),optional - {label "[_ evaluation.Unassociate_url_]"} - {options {{"" "t"}}} - {help_text "[_ evaluation.lt_Check_this_if_you_wan]"} + } else { + ad_form -extend -name task -form { + + {upload_file:file,optional + {label "[_ evaluation.File_]"} + {html "size 30"} + {help_text "[_ evaluation.lt_You_can_upload_a_file]"} + } + + {url:text(text),optional + {label "[_ evaluation.URL__1]"} + {value "http://"} + {help_text "You can associate a link to this task by entering the absolute url here (also optional)"} + } + + {unattach_p:text(hidden),optional + {value ""} + } } - } - } else { - ad_form -extend -name task -form { - {upload_file:text(hidden) - } - {url:text(text),optional - {label "[_ evaluation.URL__1]"} - {value "$content"} - } - {unattach_p:text(hidden) - } - } - } - } else { - ad_form -extend -name task -form { - - {upload_file:file,optional - {label "[_ evaluation.File_]"} - {html "size 30"} - {help_text "[_ evaluation.lt_You_can_upload_a_file]"} - } - - {url:text(text),optional - {label "[_ evaluation.URL__1]"} - {value "http://"} - {help_text "You can associate a link to this task by entering the absolute url here (also optional)"} - } - - {unattach_p:text(hidden),optional - {value ""} - } - } - } } else { ad_form -extend -name task -form { - - {upload_file:file,optional - {label "[_ evaluation.File_]"} - {html "size 30"} - {help_text "[_ evaluation.lt_You_can_upload_a_file_1]"} - } + + {upload_file:file,optional + {label "[_ evaluation.File_]"} + {html "size 30"} + {help_text "[_ evaluation.lt_You_can_upload_a_file_1]"} + } } ad_form -extend -name task -form { - - {url:text(text),optional - {label "[_ evaluation.URL__1]"} - {value "http://"} - {help_text "[_ evaluation.lt_You_can_associate_a_l]"} - } - - {unattach_p:text(hidden),optional - {value ""} - } + + {url:text(text),optional + {label "[_ evaluation.URL__1]"} + {value "http://"} + {help_text "[_ evaluation.lt_You_can_associate_a_l]"} + } + + {unattach_p:text(hidden),optional + {value ""} + } } } ad_form -extend -name task -form { {description:richtext,optional - {label "[_ evaluation.lt_Assignments_Descripti]"} - {html {rows 4 cols 40 wrap soft}} + {label "[_ evaluation.lt_Assignments_Descripti]"} + {html {rows 4 cols 40 wrap soft}} } {due_date:date,to_sql(linear_date),from_sql(sql_date),optional - {label "[_ evaluation.Due_Date_]"} - {format "MONTH DD YYYY HH24 MI SS"} - {today} - {help} - {value {[evaluation::now_plus_days -ndays 15]}} + {label "[_ evaluation.Due_Date_]"} + {format "MONTH DD YYYY HH24 MI SS"} + {today} + {help} + {value {[evaluation::now_plus_days -ndays 15]}} } {number_of_members:naturalnum - {label "[_ evaluation.Number_of_Members_]"} - {value "1"} - {html {size 5 onChange TaskInGroups()}} - {help_text "[_ evaluation.1__Individual_]"} - {after_html {
[_ evaluation.lt_Check_this_if_you_wan_1]
}} + {label "[_ evaluation.Number_of_Members_]"} + {value "1"} + {html {size 5 onChange TaskInGroups()}} + {help_text "[_ evaluation.1__Individual_]"} + {after_html {
[_ evaluation.lt_Check_this_if_you_wan_1]
}} } {weight:float,optional - {label "[_ evaluation.lt_Weight_over_grade_wei_2]"} - {html {size 5}} - {help_text "[_ evaluation.lt_You_can_enter_the_wei]"} - {value "0"} + {label "[_ evaluation.lt_Weight_over_grade_wei_2]"} + {html {size 5}} + {help_text "[_ evaluation.lt_You_can_enter_the_wei]"} + {value "0"} } {net_value:float,optional - {label "[_ evaluation.Net_Value_]"} - {html {size 5}} - {help_text "[_ evaluation.lt_If_you_enter_the_net_]"} - {value "0"} + {label "[_ evaluation.Net_Value_]"} + {html {size 5}} + {help_text "[_ evaluation.lt_If_you_enter_the_net_]"} + {value "0"} } {online_p:text(radio) - {label "[_ evaluation.lt_Will_the_task_be_subm]"} - {options {{"[_ evaluation.Yes_]" t} {"[_ evaluation.No_]" f}}} - {value t} + {label "[_ evaluation.lt_Will_the_task_be_subm]"} + {options {{"[_ evaluation.Yes_]" t} {"[_ evaluation.No_]" f}}} + {value t} } {late_submit_p:text(radio) - {label "[_ evaluation.lt_Can_the_student_submi]"} - {options {{"[_ evaluation.Yes_]" t} {"[_ evaluation.No_]" f}}} - {value t} + {label "[_ evaluation.lt_Can_the_student_submi]"} + {options {{"[_ evaluation.Yes_]" t} {"[_ evaluation.No_]" f}}} + {value t} } {requires_grade_p:text(radio) - {label "[_ evaluation.lt_Will_this_task_requir]"} - {options {{"[_ evaluation.Yes_]" t} {"[_ evaluation.No_]" f}}} - {value t} + {label "[_ evaluation.lt_Will_this_task_requir]"} + {options {{"[_ evaluation.Yes_]" t} {"[_ evaluation.No_]" f}}} + {value t} } {estimated_time:float,optional - {label "[_ evaluation.lt_Time_estimated_to_com]"} - {html {size 5}} - {value "0"} + {label "[_ evaluation.lt_Time_estimated_to_com]"} + {html {size 5}} + {value "0"} } } if { $more_communities_option } { ad_form -extend -name task -form { - {add_to_more_classes_p:text(checkbox),optional - {label "[_ evaluation.lt_Add_this_assignment_t]"} - {options {{"" "t"}}} - {help_text "[_ evaluation.lt_Check_this_if_you_wan_2]"} - } + {add_to_more_classes_p:text(checkbox),optional + {label "[_ evaluation.lt_Add_this_assignment_t]"} + {options {{"" "t"}}} + {help_text "[_ evaluation.lt_Check_this_if_you_wan_2]"} + } } } @@ -261,36 +262,36 @@ } -validate { {url - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || ([string eq $url "http://"] && [empty_string_p $upload_file]) || (![string eq $url "http://"] && [util_url_valid_p $url]) } - {[_ evaluation.lt_Upload_a_file_OR_a_ur_1] } + { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || ([string eq $url "http://"] && [empty_string_p $upload_file]) || (![string eq $url "http://"] && [util_url_valid_p $url]) } + {[_ evaluation.lt_Upload_a_file_OR_a_ur_1] } } {upload_file - { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || ([string eq $url "http://"] && [empty_string_p $upload_file]) } - { [_ evaluation.lt_Upload_a_file_OR_a_ur_1] } + { ([string eq $url "http://"] && ![empty_string_p $upload_file]) || (![string eq $url "http://"] && [empty_string_p $upload_file]) || ([string eq $url "http://"] && [empty_string_p $upload_file]) } + { [_ evaluation.lt_Upload_a_file_OR_a_ur_1] } } {unattach_p - { ([string eq $unattach_p "t"] && [empty_string_p $upload_file] && [string eq $url "http://"]) || [empty_string_p $unattach_p] } - { [_ evaluation.lt_First_unattach_the_fi] } + { ([string eq $unattach_p "t"] && [empty_string_p $upload_file] && [string eq $url "http://"]) || [empty_string_p $unattach_p] } + { [_ evaluation.lt_First_unattach_the_fi] } } {net_value - { !$net_value || ([empty_string_p $net_value] && [string eq $requires_grade_p f]) || (($net_value > 0) && ($net_value <= $grade_weight) && (!$weight || [empty_string_p $weight])) } - { [_ evaluation.lt_The_net_value_must_be] } + { !$net_value || ([empty_string_p $net_value] && [string eq $requires_grade_p f]) || (($net_value > 0) && ($net_value <= $grade_weight) && (!$weight || [empty_string_p $weight])) } + { [_ evaluation.lt_The_net_value_must_be] } } {weight - { !$weight || ([empty_string_p $weight] && [string eq $requires_grade_p f]) || (($weight > 0) && (!$net_value || [empty_string_p $net_value])) } - { [_ evaluation.lt_The_weight_must_be_gr] } + { !$weight || ([empty_string_p $weight] && [string eq $requires_grade_p f]) || (($weight > 0) && (!$net_value || [empty_string_p $net_value])) } + { [_ evaluation.lt_The_weight_must_be_gr] } } - {number_of_members - { $number_of_members >= 1 } - { [_ evaluation.lt_The_number_of_members]} + {number_of_members + { $number_of_members >= 1 } + { [_ evaluation.lt_The_number_of_members]} } {online_p - { ([empty_string_p $due_date] && [string eq $online_p "f"]) || (![empty_string_p $due_date] && [string eq $online_p "t"]) } - { "You can't leave the due date empty if the students have to submit their answers online." } + { ([empty_string_p $due_date] && [string eq $online_p "f"]) || (![empty_string_p $due_date] && [string eq $online_p "t"]) } + { "You can't leave the due date empty if the students have to submit their answers online." } } {estimated_time - { $estimated_time >= 0 } - { [_ evaluation.lt_The_estimated_time_mu] } + { $estimated_time >= 0 } + { [_ evaluation.lt_The_estimated_time_mu] } } } -new_data { @@ -303,139 +304,141 @@ } -on_submit { if { [string eq $requires_grade_p t] } { - if { [info exists net_value] && ($net_value > 0) } { - set weight [expr $net_value*100.000/$grade_weight] - } + if { [info exists net_value] && ($net_value > 0) } { + set weight [expr $net_value*100.000/$grade_weight] + } } else { - set weight 0 + set weight 0 } db_transaction { - # set storage_type to its default value according to a db constraint - set storage_type "lob" + # set storage_type to its default value according to a db constraint + set storage_type "lob" - if { ![empty_string_p $upload_file] } { + if { ![empty_string_p $upload_file] } { - # Get the filename part of the upload file - if { ![regexp {[^//\\]+$} $upload_file filename] } { - # no match - set filename $upload_file - } - - set title [template::util::file::get_property filename $upload_file] - set mime_type [cr_filename_to_mime_type -create $title] - - if { ![parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { - set storage_type file - } - } elseif { ![string eq $url "http://"] } { - set mime_type "text/plain" - set title "link" - } elseif { [string eq $attached_p "f"] } { - set mime_type "text/plain" - set title "" - } - - set title [evaluation::safe_url_name -name $title] - set cal_due_date [calendar::to_sql_datetime -date $due_date -time $due_date -time_p 1] - set due_date_ansi [db_string set_date " *SQL* "] + # Get the filename part of the upload file + if { ![regexp {[^//\\]+$} $upload_file filename] } { + # no match + set filename $upload_file + } + + set title [template::util::file::get_property filename $upload_file] + set mime_type [cr_filename_to_mime_type -create $title] + + if { ![parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { + set storage_type file + } + } elseif { ![string eq $url "http://"] } { + set mime_type "text/plain" + set title "link" + } elseif { [string eq $attached_p "f"] } { + set mime_type "text/plain" + set title "" + } + + set title [evaluation::safe_url_name -name $title] + set cal_due_date [calendar::to_sql_datetime -date $due_date -time $due_date -time_p 1] + set due_date_ansi [db_string set_date " *SQL* "] - if { [ad_form_new_p -key task_id] } { - set item_id $task_id - } + if { [ad_form_new_p -key task_id] } { + set item_id $task_id + } - set revision_id [evaluation::new_task -new_item_p [ad_form_new_p -key grade_id] -item_id $item_id \ - -content_type evaluation_tasks \ - -content_table evaluation_tasks \ - -content_id task_id \ - -name $task_name \ - -description $description \ - -weight $weight \ - -grade_item_id $grade_item_id \ - -number_of_members $number_of_members \ - -online_p $online_p \ - -storage_type $storage_type \ - -due_date $due_date_ansi \ - -late_submit_p $late_submit_p \ - -requires_grade_p $requires_grade_p \ - -title $title \ - -mime_type $mime_type \ - -estimated_time $estimated_time] - - content::item::set_live_revision -revision_id $revision_id + set revision_id [evaluation::new_task -new_item_p [ad_form_new_p -key grade_id] -item_id $item_id \ + -content_type evaluation_tasks \ + -content_table evaluation_tasks \ + -content_id task_id \ + -name $task_name \ + -description $description \ + -weight $weight \ + -grade_item_id $grade_item_id \ + -number_of_members $number_of_members \ + -online_p $online_p \ + -storage_type $storage_type \ + -due_date $due_date_ansi \ + -late_submit_p $late_submit_p \ + -requires_grade_p $requires_grade_p \ + -title $title \ + -mime_type $mime_type \ + -estimated_time $estimated_time] + + content::item::set_live_revision -revision_id $revision_id - # by the moment, since I'm having a date problem with oracle10g, I have to do this in order - # to store the entire date + # by the moment, since I'm having a date problem with oracle10g, I have to do this in order + # to store the entire date - db_dml update_date { - update evaluation_tasks set due_date = (select to_date(:due_date,'YYYY-MM-DD HH24:MI:SS') from dual) - where task_id = :revision_id - } + db_dml update_date { + update evaluation_tasks set due_date = (select to_date(:due_date,'YYYY-MM-DD HH24:MI:SS') from dual) + where task_id = :revision_id + } - if { ![empty_string_p $upload_file] } { - - set tmp_file [template::util::file::get_property tmp_filename $upload_file] - set content_length [file size $tmp_file] - - if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { - # create the new item - db_dml lob_content { *SQL* } -blob_files [list $tmp_file] + if { ![empty_string_p $upload_file] } { - # Unfortunately, we can only calculate the file size after the lob is uploaded - db_dml lob_size { *SQL* } - } else { - # create the new item - set file_name [cr_create_content_file $item_id $revision_id $tmp_file] + set tmp_file [template::util::file::get_property tmp_filename $upload_file] + set content_length [file size $tmp_file] + + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { + # create the new item + db_dml lob_content { *SQL* } -blob_files [list $tmp_file] + + # Unfortunately, we can only calculate the file size after the lob is uploaded + db_dml lob_size { *SQL* } + } else { + # create the new item + set file_name [cr_create_content_file $item_id $revision_id $tmp_file] db_dml set_file_content { *SQL* } - } - - } elseif { ![string eq $url "http://"] } { - - db_dml link_content { *SQL* } - set content_length [string length $url] - db_dml content_size { *SQL* } - - } elseif { [string eq $attached_p "t"] && ![string eq $unattach_p "t"] } { + } + + } elseif { ![string eq $url "http://"] } { + + db_dml link_content { *SQL* } + # in order to support oracle and postgres and still using only the cr_items table to store the task + db_dml set_storage_type { *SQL* } + set content_length [string length $url] + db_dml content_size { *SQL* } + + } elseif { [string eq $attached_p "t"] && ![string eq $unattach_p "t"] } { - # just copy the old content to the new revision - db_exec_plsql copy_content { *SQL* } - } - - # integration with calendar - # since there is no service contract defined + # just copy the old content to the new revision + db_exec_plsql copy_content { *SQL* } + } + + # integration with calendar + # since there is no service contract defined - set desc_url "[_ evaluation.lt_Click_here_to_go_to_t]" + set desc_url "[_ evaluation.lt_Click_here_to_go_to_t]" - set url [dotlrn_community::get_community_url $community_id] - - array set community_info [site_node::get -url "${url}calendar"] - set community_package_id $community_info(package_id) - set calendar_id [db_string get_cal_id { *SQL* }] + set url [dotlrn_community::get_community_url $community_id] + + array set community_info [site_node::get -url "${url}calendar"] + set community_package_id $community_info(package_id) + set calendar_id [db_string get_cal_id { *SQL* }] - if { ![db_0or1row calendar_mappings { *SQL* }] } { - # create cal_item - set cal_item_id [calendar::item::new -start_date $cal_due_date -end_date $cal_due_date -name "[_ evaluation.Due_date_task_name]" -description $desc_url -calendar_id $calendar_id] - db_dml insert_cal_mapping { *SQL* } - } else { - # edit previous cal_item - calendar::item::edit -cal_item_id $cal_item_id -start_date $due_date_ansi -end_date $due_date_ansi -name "[_ evaluation.Due_date_task_name]" -description $desc_url -calendar_id $calendar_id - } + if { ![db_0or1row calendar_mappings { *SQL* }] } { + # create cal_item + set cal_item_id [calendar::item::new -start_date $cal_due_date -end_date $cal_due_date -name "[_ evaluation.Due_date_task_name]" -description $desc_url -calendar_id $calendar_id] + db_dml insert_cal_mapping { *SQL* } + } else { + # edit previous cal_item + calendar::item::edit -cal_item_id $cal_item_id -start_date $due_date_ansi -end_date $due_date_ansi -name "[_ evaluation.Due_date_task_name]" -description $desc_url -calendar_id $calendar_id + } } } -after_submit { set redirect_to_groups_p 0 if { [info exists admin_groups_p] && $number_of_members > 1 } { - set redirect_to_groups_p 1 + set redirect_to_groups_p 1 } if { ![empty_string_p $add_to_more_classes_p] } { - ad_returnredirect [export_vars -base "task-add-to-communities" { redirect_to_groups_p {task_id $revision_id} return_url }] + ad_returnredirect [export_vars -base "task-add-to-communities" { redirect_to_groups_p {task_id $revision_id} return_url }] } elseif { $redirect_to_groups_p } { - ad_returnredirect [export_vars -base "../groups/one-task" { {task_id $revision_id} }] - ad_script_abort + ad_returnredirect [export_vars -base "../groups/one-task" { {task_id $revision_id} }] + ad_script_abort } else { - ad_returnredirect "$return_url" - ad_script_abort + ad_returnredirect "$return_url" + ad_script_abort } }