Index: openacs-4/packages/evaluation/catalog/evaluation.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/catalog/evaluation.en_US.ISO-8859-1.xml,v diff -u -r1.15 -r1.16 --- openacs-4/packages/evaluation/catalog/evaluation.en_US.ISO-8859-1.xml 27 Oct 2004 01:09:02 -0000 1.15 +++ openacs-4/packages/evaluation/catalog/evaluation.en_US.ISO-8859-1.xml 21 Mar 2005 15:42:00 -0000 1.16 @@ -1,5 +1,5 @@ - + 1 = Individual Add Assignment @@ -31,51 +31,6 @@ Audit info Audit Info Audit info for task - #>" onClick="history.go(-1)"> - </form> -</if> - -<if %evaluations_na:rowcount% gt 0> - <form action="evaluate-students-2" method+"post"> - @export_vars;noquote@ - <input type=hidden name=task_id value="%task_id%"> - <input type=hidden name=max_grade value="%max_grade%"> - <blockquote> - <table> - <multiple name="evaluations_na"> - <if %evaluations_na.rownum% odd><table bgcolor="#EAF2FF"></if><else><table bgcolor="white"></else> - <tr><th align="right">#evaluation.Name#</th><td>%evaluations_na.party_name%</td></tr> - <tr><th align="right">#evaluation.Grade#</th><td>%evaluations_na.grade% / %max_grade%</td></tr> - <tr><th align="right">#evaluation.Comments#</th><td>%evaluations_na.comment%</td></tr> - <tr><th align="right">#evaluation.Will_the_studens_be# <br /> #evaluation.lt_able_to_see_the_grade#</th><td>%evaluations_na.show_student%</td></tr> - </tr> - </table> - </multiple> - </table> - </blockquote> - <input type=submit value="<# Grade Students - #>" onClick="history.go(-1)"> - </form> -</if> -<if %evaluations_na:rowcount% gt 0> - <form action="evaluate-students-2" method+"post"> - @export_vars;noquote@ - <input type=hidden name=task_id value="%task_id%"> - <input type=hidden name=max_grade value="%max_grade%"> - <blockquote> - <table> - <multiple name="evaluations_na"> - <if %evaluations_na.rownum% odd> <table bgcolor="#EAF2FF"> </if> - <else><table bgcolor="white"></else> - <tr><th align="right">#evaluation.Name#</th><td>%evaluations_na.party_name%</td></tr> - <tr><th align="right">#evaluation.Grade#</th><td>%evaluations_na.grade% / %max_grade%</td></tr> - <tr><th align="right">#evaluation.Comments#</th><td>%evaluations_na.comment%</td></tr> - <tr><th align="right">#evaluation.Will_the_studens_be# <br /> #evaluation.lt_able_to_see_the_grade#</th><td>%evaluations_na.show_student%</td></tr> </tr> - </table> - </multiple> - </table> - </blockquote> - <input type=submit value="<# Grade Students Bad input Change Answer Click @@ -87,6 +42,7 @@ Comments/Edit reason Confirm Confirm Evaluation + Continue Group Create Group Delete Evaluation @@ -125,11 +81,11 @@ File File/url associated Generate file - Back + Go Back Go Back Grade: Grade - Students + Grade Students Grade Grade Distribution Grade in Net value @@ -143,25 +99,6 @@ Grades Reports Grades Sheet Name Grades Sheets - #> %current_groups_plus_one%" size=20></td> -</tr> -<tr> - <input type=hidden name=task_id value="%task_id%"> - <input type=hidden name=evaluation_group_id value="%evaluation_group_id%"> - <blockquote> - <td></td> - <td> - <table> - <multiple name="students"> - <if %students.rownum% odd><tr class="list-odd"></if><else><tr class="list-even"></else> - <td>%students.rownum%.</td><td>%students.student_name%</td></tr> - </tr> - </multiple> - </table> - </td> - </tr> - <tr> - <td><input type=submit value="<# Create Group Group Members Group Name Group name @@ -203,7 +140,7 @@ Associate to this group Audit info for task "%task_name%" Can the student submit the answer <br> after the due date? - Change Answer for \"%task_name%\" + Change Answer for "%task_name%" Check the rest of communities where you want to upload the assignment too Check this if you want to unattach the file Check this if you want to go to the groups admin page after submitting the task @@ -213,16 +150,16 @@ Comment/edit reason on party_id %party_id% is larger than 4,000 characters long, which is our max lenght. Please make this comment/edit reason shorter. Confirm Your Evaluation Confirm your evaluation(s) on "%task_name%" - Currently $content is associated to this task solution, but you can associate a different url/file just by adding it here - Currently $content is associated to this task, but you can associate a different url/file just by adding it here - Currently $title is attached to this task solution, but you can attach a different file/url just by adding it here - Currently $title is attached to this task, but you can attach a different file/url just by adding it here + Currently %content% is associated to this task solution, but you can associate a different url/file just by adding it here + Currently %content% is associated to this task, but you can associate a different url/file just by adding it here + Currently %title% is attached to this task solution, but you can attach a different file/url just by adding it here + Currently %title% is attached to this task, but you can attach a different file/url just by adding it here Delete Assignment Type Delete assignment type Distribution for grade "%grade_plural_name%" Do NOT change the "party id" field because with this file we associate the grade with the student or group. Due date must be in the future - Due Date of \"%task_name%\" + Due Date of "%task_name%" Edit Assignment Type Edit assignment type Edit grades distribution of $grade_plural_name @@ -260,7 +197,7 @@ if you want to see the portraits of the students In order to generate this file there must be some parties assigned to this task. In this page you can administer the groups for the assignment. - Input \"Will the student be able to see the grade\" must be 1 (one) for YES or 0 (zero) for NO, please don't leave it blank. + Input "Will the student be able to see the grade" must be 1 (one) for YES or 0 (zero) for NO, please don't leave it blank. Is the task submitted online? Max Grade does not seem to be a real number. Please don't leave it in blank. New Assignment (%grade_name% %community_name%) @@ -285,9 +222,9 @@ Save the csv file and KEEP THE CSV FORMAT. The CSV file can be edited with any text editor (and MS Excell) but you have to save it keeping the CSV format. If you do not keep the format, the system will not be able to parse the file. See grades sheets associated with this task Send the file using the "Send file" botton. The system will parse the file and you will be asked for a confirmation (if everything is ok with the file) for the grades. - <small>Total points in this category: ${total_grade}/${max_grade} <br /> - $grade_plural_name represents the ${grade_weight}% of the 100% of the class</small> - Students List for \"%task_name%\" + <small>Total points in this category: %total_grade%/%max_grade% <br /> + %grade_plural_name% represents the %grade_weight%% of the 100% of the class</small> + Students List for "%task_name%" Students who have not submitted answers and have not been evaluated (%not_evaluated_with_no_answer%) Students with answers that have not been evaluated (%not_evaluated_with_answer%) %submission_date_pretty% (late) @@ -298,50 +235,14 @@ The comments/edit reason is a string with no more than 4,000 characters. The edit reason must be less than 4000 characteras long The estimated time must be grather than 0 - The file extension of the file is "%file_extension" and it should be .CSV. Sorry, we can't process it" - } - } -} - -set page_title "<#_ Confirm Evaluation - The file extension of the file is \"$file_extension\" and it should be .CSV, we can't process it - The file is too large. (The maximun file size is %pretty_maxnbytes% bytes)" - return 0 - } - - set errors 0 - set errors_text "" - set counter 0 - set line_number 0 - - set file_handler [open $tmp_filename {RDWR}] - - while { ![eof $file_handler] } { - incr line_number - set one_line [gets $file_handler] - - # jump first two lines - if { $line_number <= 2 } { - continue - } - - # replace enters (<-|) with semicolons (;) - regsub -all {(,[\r\n])} $one_line "" clean_line - regsub -all {[\r\n]} $clean_line "" clean_line - - set evaluation [split $clean_line ","] - - if { $line_number == 3 } { - set max_grade [string trim [lindex $evaluation 1]] - if { ![ad_var_type_check_number_p $max_grade] } { - ad_return_error "<#_ Invalid Max Grade + The file extension of the file is "%file_extension%" and it should be .CSV, we can't process it The file is too large. (The maximun file size is %pretty_maxnbytes% bytes) The file should have a pre-defined format so the system can parse it and obtain the information. If you want to use this functionallity you must follow the following steps: The grade most be a valid number: %wrong_grade% The grade must be a REAL NUMBER. The grade must be a valid number: %wrong_grade% The grade must be a valid number - The net value must be grather than 0 and less than $grade_weight, and you can not enter Net Value AND Weight. + The net value must be grather than 0 and less than %grade_weight%, and you can not enter Net Value AND Weight. The number of members must be grather than 1. The sum of the weight of all the assignment types is %total_weight% and it should be 100 by the end of the term(supposedly). The system assumes that the grades start at the 7th line of the file. @@ -396,8 +297,8 @@ to submit their answers after due date? To unassociate a member of the group, click on the "Unassociate member" link. TOTAL GRADE: %total_class_grade% - Total points in this category: %total_grade% / $max_grade<br /> - This grade category represents the ${grade_weight}% of the 100% of the class + Total points in this category: %total_grade% / %max_grade%<br /> + This grade category represents the %grade_weight%% of the 100% of the class Total points in this category: %total_grade% / %max_grade%<br /> This grade category represents the %grade_weight%% of the 100% of the class Total points in this category: %total_grade%/%max_grade% @@ -407,8 +308,8 @@ Upload a file OR a url, not both Upload a file OR a valid url, and not both Upload a solution for this assignment so the students can see it and learn from it. - Upload Answer for \"%task_name%\" - $user_name has modified the grade of %party_name%. \n The edit reason given by %user_name% was: %edit_reason% \n The current grade is: %current_grade% \n\n Click on this link to see the evaluation details: %url_link% \n + Upload Answer for "%task_name%" + %user_name% has modified the grade of %party_name%. \n The edit reason given by %user_name% was: %edit_reason% \n The current grade is: %current_grade% \n\n Click on this link to see the evaluation details: %url_link% \n View evaluation details \ View/Edit Task Solution We got the following error while trying to remove the evaluation: <pre>%errmsg%</pre> @@ -419,12 +320,9 @@ Weight of this %grade_name% over %grade_plural_name% Weight over 100% <br /> of the Course Weight over %grade_weight%% <br /> of %grade_plural_name% - Weight over %grade_weight%% of %grade_plural_name%"} - {html {size 5}} - {help_text "<#_ You can enter the weight over %grade_weight%% of %grade_plural_name% or you can enter the net value of it in the field below. Weight over %grade_weight%% of %grade_plural_name% - Weight used in $grade_plural_name: ${category_weight}% (of 100% of $grade_plural_name) <br /> - $grade_plural_name represents ${grade_weight}% of the 100% of the class + Weight used in %grade_plural_name%: %category_weight%% (of 100% of $grade_plural_name) <br /> + %grade_plural_name% represents %grade_weight%% of the 100% of the class Weight used in %grade_plural_name%: ${category_weight}% (of 100% of $grade_plural_name) <br /> $grade_plural_name represents ${grade_weight}% of the 100% of the class Weight used in %grade_plural_name%: %category_weight%% (of 100% of %grade_plural_name%) <br /> @@ -448,6 +346,7 @@ You can upload a file associated to this task by using the browse button (optional) You can upload a file associated to this task by using the browse button and select the file from your computer (optional) You must give an edit reason (%old_grade% --> %grade_wo_reason% + Your answer has been submited successfully. Your total grade in this class is: Max Grade: Maximun Grade: @@ -487,7 +386,7 @@ Project Projects Remove Grade - Group + Rename Group Requires Grade? Reuse Groups Send file 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.18 -r1.19 --- openacs-4/packages/evaluation/tcl/apm-callback-procs.tcl 1 Mar 2005 00:01:35 -0000 1.18 +++ openacs-4/packages/evaluation/tcl/apm-callback-procs.tcl 21 Mar 2005 15:42:00 -0000 1.19 @@ -39,58 +39,65 @@ # Enable the delivery intervals and delivery methods for a specific evaluation enable_intervals_and_methods -type_id $type_id -#Create the conten_type -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 new and register template -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 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 -#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 {HTML display Options} -column_spec {varchar(500)} -content::type::attribute::new -content_type {evaluation_grades} -attribute_name {weight} -datatype {number} -pretty_name { weight} -column_spec {numeric} -#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 {number} -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)} -#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} -#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} -#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)} -#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 and register the 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_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 number -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_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_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 + + } } -} ad_proc -public evaluation::apm_callback::package_uninstall { } { @@ -111,54 +118,55 @@ # Delete the implementation for the notification of an evaluation delete_one_evaluation_impl -#Delete content type template -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 attribute -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 -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 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 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 + } } ad_proc -public evaluation::apm_callback::package_instantiate { @@ -182,35 +190,33 @@ 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 } - ns_log notice "Primer Error" + set exams_item_id [db_nextval acs_object_id_seq] set revision_id [evaluation::new_grade -new_item_p 1 -item_id $exams_item_id -content_type evaluation_grades -content_table evaluation_grades -content_id grade_id -name $exams_singular_name -plural_name $exams_name -description $exams_desc -weight 40 -package_id $package_id] content::item::set_live_revision -revision_id $revision_id - ns_log notice "Segundo Error" set tasks_item_id [db_nextval acs_object_id_seq] set revision_id [evaluation::new_grade -new_item_p 1 -item_id $tasks_item_id -content_type evaluation_grades -content_table evaluation_grades -content_id grade_id -name $tasks_singular_name -plural_name $tasks_name -description $tasks_desc -weight 40 -package_id $package_id] content::item::set_live_revision -revision_id $revision_id - ns_log notice "Tercer Error" set projects_item_id [db_nextval acs_object_id_seq] set revision_id [evaluation::new_grade -new_item_p 1 -item_id $projects_item_id -content_type evaluation_grades -content_table evaluation_grades -content_id grade_id -name $projects_singular_name -plural_name $projects_name -description $projects_desc -weight 20 -package_id $package_id] content::item::set_live_revision -revision_id $revision_id @@ -224,72 +230,133 @@ Delete Evaluation stuff } { -#Delete all content templates -db_foreach v1 { 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 } { -content::revision::delete -revision_id $answer_id -} -db_foreach v2 { 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 } { content::revision::delete -revision_id $solution_id } -db_foreach v3 { 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 } { -content::revision::delete -revision_id $grades_sheet_id } -db_foreach v4 { 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 } { -content::revision::delete -revision_id $evaluation_id } -db_foreach v5 { 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 } { -content::revision::delete -revision_id $task_id } -db_foreach v6 { 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 } { -content::revision::delete -revision_id $grade_id} + #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 + } { + 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 + } { + 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 + } { + content::revision::delete -revision_id $grades_sheet_id + } -#Evaluation_Task_Sols -set v_folder_id [content::item::get_id -item_path "evaluation_tasks_sols_$package_id" -resolve_index {f}] -db_foreach v11 { select item_id from cr_items where parent_id = :v_folder_id } { - evaluation::delete_grade -grade_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_tasks_sols} -include_subtypes {t} -db_dml delete_v11 "delete from cr_folder_type_map where content_type = 'evaluation_tasks_sols'" -content::folder::delete -folder_id $v_folder_id - -#evaluation_answers -set v_folder_id [content::item::get_id -item_path "evaluation_answers_$package_id" -resolve_index {f}] -db_foreach v12 {select item_id from cr_items where parent_id = :v_folder_id } { - evaluation::delete_grade -grade_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} -db_dml delete_v12 "delete from cr_folder_type_map where content_type = 'evaluation_answers'" -content::folder::delete -folder_id $v_folder_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 + } { + 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 + } { + content::revision::delete -revision_id $task_id + } -#evaluation_students_eval -set v_folder_id [content::item::get_id -item_path "evaluation_student_evals_$package_id" -resolve_index {f}] -db_foreach v13 { select item_id from cr_items where parent_id = :v_folder_id } { - evaluation::delete_grade -grade_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_student_evals} -include_subtypes {t} -db_dml delete_v13 "delete from cr_folder_type_map where content_type = 'evaluation_student_evals'" -content::folder::delete -folder_id $v_folder_id - -#evaluation_grades_sheets -set v_folder_id [content::item::get_id -item_path "evaluation_grades_sheets_$package_id" -resolve_index {f}] -db_foreach v14 { select item_id from cr_items where parent_id = :v_folder_id } { - evaluation::delete_grade -grade_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_grades_sheets} -include_subtypes {t} -db_dml delete_v14 "delete from cr_folder_type_map where content_type = 'evaluation_grades_sheets'" -content::folder::delete -folder_id $v_folder_id - -#evaluation_tasks -set v_folder_id [content::item::get_id -item_path "evaluation_tasks_$package_id" -resolve_index {f}] -db_foreach v15 { select etg.group_id from evaluation_tasks et, evaluation_task_groups etg where etg.task_item_id = et.task_item_id } { - evaluation::delete_grade -grade_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_tasks} -include_subtypes {t} -db_dml delete_v15 "delete from cr_folder_type_map where content_type = 'evaluation_tasks'" -content::folder::delete -folder_id $v_folder_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 + } { + content::revision::delete -revision_id $grade_id + } -#evaluation_grades -set v_folder_id [content::item::get_id -item_path "evaluation_grades_$package_id" -resolve_index {f}] -db_foreach v16 { select item_id from cr_items where parent_id = :v_folder_id } { - evaluation::delete_grade -grade_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_grades} -include_subtypes {t} -db_dml delete_v16 "delete from cr_folder_type_map where content_type = 'evaluation_grades'" -content::folder::delete -folder_id $v_folder_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 + + #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 + } { + 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 + db_dml delete_answer_folder_map "delete from cr_folder_type_map where content_type = 'evaluation_answers'" + content::folder::delete -folder_id $folder_id + + #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 + } { + evaluation::delete_student_eval -evaluation_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_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 + + #evaluation_grades_sheets + set folder_id [content::item::get_id -item_path "evaluation_grades_sheets_$package_id" -resolve_index f] + + db_foreach grade_sheet_item { + select item_id from cr_items where parent_id = :folder_id + } { + content::delete::item -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 + + 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 + } { + evaluation::delete_task -task_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_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 + + #evaluation_grades + 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 + } { + 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 + + db_dml delete_grade_folder_map "delete from cr_folder_type_map where content_type = 'evaluation_grades'" + content::folder::delete -folder_id $folder_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.26 -r1.27 --- openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 1 Mar 2005 00:01:35 -0000 1.26 +++ openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 21 Mar 2005 15:42:00 -0000 1.27 @@ -89,55 +89,55 @@ } { delete all grades } { - db_1row get_grade_id { select grade_item_id from evaluation_grades where grade_id = :grade_id} - db_foreach del_rec { select task_item_id from evaluation_tasks where grade_item_id = :grade_item_id } { - db_foreach evaluation_delete_student_eval { select evaluation_id from evaluation_student_evals where task_item_id = :task_item_id } { - content::revision::delete -revision_id $evaluation_id - } - db_foreach evaluation_delete_answer { select answer_id from evaluation_answers where task_item_id = :task_item_id } { - content::revision::delete -revision_id $answer_id - } - db_foreach evaluation_delete_task_sol { select solution_id from evaluation_tasks_sols where task_item_id = :task_item_id } { - content::revision::delete -revision_id $solution_id - } - 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_foreach evaluation_delete_task { select task_id from evaluation_tasks where task_item_id = :task_item_id } { - content::revision::delete -revision_id $task_id } - } -# db_1row get_grade_id { select grade_id as grade_task_id from evaluation_grades where grade_item_id = :grade_item_id} - content::revision::delete -revision_id $grade_id + db_1row get_grade_id { select grade_item_id from evaluation_grades where grade_id = :grade_id } + db_foreach del_rec { select task_item_id from evaluation_tasks where grade_item_id = :grade_item_id } { + db_foreach evaluation_delete_student_eval { select evaluation_id from evaluation_student_evals where task_item_id = :task_item_id } { + content::revision::delete -revision_id $evaluation_id + } + db_foreach evaluation_delete_answer { select answer_id from evaluation_answers where task_item_id = :task_item_id } { + content::revision::delete -revision_id $answer_id + } + db_foreach evaluation_delete_task_sol { select solution_id from evaluation_tasks_sols where task_item_id = :task_item_id } { + content::revision::delete -revision_id $solution_id + } + 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_foreach evaluation_delete_task { select task_id from evaluation_tasks where task_item_id = :task_item_id } { + content::revision::delete -revision_id $task_id } + } + # db_1row get_grade_id { select grade_id as grade_task_id from evaluation_grades where grade_item_id = :grade_item_id} + content::revision::delete -revision_id $grade_id } ad_proc -public evaluation::delete_task { -task_id:required } { delete all tasks } { - db_1row get_grade_id { select task_item_id from evaluation_tasks where task_id = :task_id} - db_foreach evaluation_delete_student_eval { select evaluation_id from evaluation_student_evals where task_item_id = :task_item_id } { - content::revision::delete -revision_id $evaluation_id - } - db_foreach evaluation_delete_answer { select answer_id from evaluation_answers where task_item_id = :task_item_id } { - content::revision::delete -revision_id $answer_id - } - db_foreach evaluation_delete_task_sol { select solution_id from evaluation_tasks_sols where task_item_id = :task_item_id } { - content::revision::delete -revision_id $solution_id - } - 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 + db_1row get_task_id { select task_item_id from evaluation_tasks where task_id = :task_id } + db_foreach evaluation_delete_student_eval { select evaluation_id from evaluation_student_evals where task_item_id = :task_item_id } { + content::revision::delete -revision_id $evaluation_id + } + db_foreach evaluation_delete_answer { select answer_id from evaluation_answers where task_item_id = :task_item_id } { + content::revision::delete -revision_id $answer_id + } + db_foreach evaluation_delete_task_sol { select solution_id from evaluation_tasks_sols where task_item_id = :task_item_id } { + content::revision::delete -revision_id $solution_id + } + 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 } -ad_proc -public evaluation::delete_student_eval1 { +ad_proc -public evaluation::delete_student_eval { -evaluation_id:required } { delete all tasks } { - content::revision::delete -revision_id $evaluation_id + content::revision::delete -revision_id $evaluation_id } ad_proc -public evaluation::notification::do_notification { @@ -219,29 +219,31 @@ @param content_table @param new_item_p If true make a new item using item_id } { + if { [empty_string_p $package_id] } { - set package_id [ad_conn package_id] + set package_id [ad_conn package_id] } + set creation_user [ad_conn user_id] set creation_ip [ad_conn peeraddr] set creation_date [db_string get_date { *SQL* }] set item_name "${content_type}_${item_id}" set revision_id [db_nextval acs_object_id_seq] set revision_name "${content_type}_${revision_id}" - set folder_id [content::item::get_id -item_path "${content_type}_${package_id}" -resolve_index {f}] + set folder_id [content::item::get_id -item_path "${content_type}_${package_id}" -resolve_index f] if { $new_item_p } { - set item_id [content::item::new -item_id $item_id -parent_id $folder_id -content_type $content_type -name $item_name -context_id $package_id -creation_date $creation_date] + set item_id [content::item::new -item_id $item_id -parent_id $folder_id -content_type $content_type -name $item_name -context_id $package_id -creation_date $creation_date] } - set revision_id [content::revision::new \ - -item_id $item_id \ - -content_type $content_type \ - -description $description \ - -creation_date $creation_date \ - -attributes [list [list weight $weight] \ - [list grade_name $name] \ - [list comments $description] \ [list grade_item_id $item_id] \ - [list grade_plural_name $plural_name]] ] + set revision_id [content::revision::new \ + -item_id $item_id \ + -content_type $content_type \ + -description $description \ + -creation_date $creation_date \ + -attributes [list [list weight $weight] \ + [list grade_name $name] \ + [list grade_item_id $item_id] \ + [list grade_plural_name $plural_name]] ] return $revision_id } @@ -370,33 +372,35 @@ if { [empty_string_p $item_name] } { set item_name "${item_id}_${title}" } -#Falta agregarle el title + #Falta agregarle el title if { $new_item_p } { - set item_id [content::item::new -item_id $item_id \ - -parent_id $folder_id \ - -content_type $content_type \ - -name $item_name \ - -context_id $package_id \ - -mime_type $mime_type \ - -title $title \ - -creation_date $creation_date \ - -storage_type $storage_type] + + set item_id [content::item::new -item_id $item_id \ + -parent_id $folder_id \ + -content_type $content_type \ + -name $item_name \ + -context_id $package_id \ + -mime_type $mime_type \ + -creation_date $creation_date \ + -storage_type $storage_type] } + set revision_id [content::revision::new \ - -item_id $item_id \ - -content_type $content_type \ - -mime_type $mime_type \ - -title $title \ - -description $description \ - -creation_date $creation_date \ - -attributes [list [list weight $weight] \ - [list task_name $name] \ - [list task_item_id $item_id] \ \ [list online_p $online_p] \ - [list grade_item_id $grade_item_id] \ - [list due_date $due_date] \ - [list late_submit_p $late_submit_p] \ - [list requires_grade_p $requires_grade_p] \ - [list number_of_members $number_of_members]] ] + -item_id $item_id \ + -content_type $content_type \ + -mime_type $mime_type \ + -title $title \ + -description $description \ + -creation_date $creation_date \ + -attributes [list [list weight $weight] \ + [list task_name $name] \ + [list task_item_id $item_id] \ + [list online_p $online_p] \ + [list grade_item_id $grade_item_id] \ + [list due_date $due_date] \ + [list late_submit_p $late_submit_p] \ + [list requires_grade_p $requires_grade_p] \ + [list number_of_members $number_of_members]]] # in order to find the file we have to set the name in cr_items the same that in cr_revisions @@ -450,14 +454,14 @@ if { $new_item_p } { set item_id [content::item::new -item_id $item_id -parent_id $folder_id -content_type $content_type -name $item_name -context_id $package_id -mime_type $mime_type -storage_type $storage_type -title $title -creation_date $creation_date] } - set revision_id [content::revision::new \ - -item_id $item_id \ - -content_type $content_type \ - -mime_type $mime_type \ - -title $title \ - -creation_date $creation_date \ - -attributes [list [list task_item_id $task_item_id] \ - [list solution_item_id $item_id]] ] + set revision_id [content::revision::new \ + -item_id $item_id \ + -content_type $content_type \ + -mime_type $mime_type \ + -title $title \ + -creation_date $creation_date \ + -attributes [list [list task_item_id $task_item_id] \ + [list solution_item_id $item_id]] ] # in order to find the file we have to set the name in cr_items the same that in cr_revisions db_dml update_item_name { *SQL* } @@ -522,17 +526,17 @@ -creation_date $creation_date] } set revision_id [content::revision::new \ - -item_id $item_id \ - -content_type $content_type \ - -mime_type $mime_type \ - -title $title\ - -creation_date $creation_date \ + -item_id $item_id \ + -content_type $content_type \ + -mime_type $mime_type \ + -title $title\ + -creation_date $creation_date \ -attributes [list [list answer_item_id $item_id] \ [list party_id $party_id] \ [list task_item_id $task_item_id]] ] - + # in order to find the file we have to set the name in cr_items the same that in cr_revisions db_dml update_item_name { *SQL* } return $revision_id @@ -591,19 +595,19 @@ } if { $new_item_p } { - set item_id [content::item::new -item_id $item_id -parent_id $folder_id -content_type $content_type -name $item_name -context_id $package_id -mime_type $mime_type -title $title -storage_type $storage_type -creation_date $creation_date] + set item_id [content::item::new -item_id $item_id -parent_id $folder_id -content_type $content_type -name $item_name -context_id $package_id -mime_type $mime_type -storage_type $storage_type -creation_date $creation_date] } - set revision_id [content::revision::new \ - -item_id $item_id \ - -content_type $content_type \ - -mime_type $mime_type \ - -title $title\ - -creation_date $creation_date \ - -attributes [list [list evaluation_item_id $item_id] \ - [list party_id $party_id] \ - [list grade $grade] \ - [list show_student_p $show_student_p] \ - [list task_item_id $task_item_id]] ] + set revision_id [content::revision::new \ + -item_id $item_id \ + -content_type $content_type \ + -mime_type $mime_type \ + -title $title\ + -creation_date $creation_date \ + -attributes [list [list evaluation_item_id $item_id] \ + [list party_id $party_id] \ + [list grade $grade] \ + [list show_student_p $show_student_p] \ + [list task_item_id $task_item_id]]] } ad_proc -public evaluation::new_evaluation_group { @@ -702,13 +706,13 @@ set item_id [content::item::new -item_id $item_id -parent_id $folder_id -content_type $content_type -name $item_name -context_id $package_id -mime_type $mime_type -title $title -storage_type $storage_type] } - set revision_id [content::revision::new \ - -item_id $item_id \ - -content_type $content_type \ - -title $title \ - -mime_type $mime_type \ - -attributes [list [list grades_sheet_item_id $item_id] \ - [list task_item_id $task_item_id]] ] + set revision_id [content::revision::new \ + -item_id $item_id \ + -content_type $content_type \ + -title $title \ + -mime_type $mime_type \ + -attributes [list [list grades_sheet_item_id $item_id] \ + [list task_item_id $task_item_id]] ] return $revision_id } @@ -937,7 +941,7 @@ } return $dir -db_foreach get_answers_for_task} + db_foreach get_answers_for_task} ad_proc -public evaluation::get_archive_extension {} { return the archive extension that should be added to the output file of Index: openacs-4/packages/evaluation/www/answer-ok.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/answer-ok.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/evaluation/www/answer-ok.adp 8 Oct 2004 23:32:03 -0000 1.1 +++ openacs-4/packages/evaluation/www/answer-ok.adp 21 Mar 2005 15:42:00 -0000 1.2 @@ -2,5 +2,5 @@ #evaluation.Answer_1# #evaluation.Answer_1# +#evaluation.lt_Your_answer_has_been_# #evaluation.Continue#. -#evaluation.Your# \ No newline at end of file Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluation-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluation-delete-2.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluation-delete-2.tcl 22 Dec 2004 22:06:40 -0000 1.7 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluation-delete-2.tcl 21 Mar 2005 15:42:00 -0000 1.8 @@ -14,8 +14,7 @@ if { [string eq $operation [_ evaluation.lt_Yes_I_really_want_to_]] } { db_transaction { -# db_exec_plsql delete_evaluation { *SQL* } - evaluation::delete_student_eval1 -evaluation_id $evaluation_id + evaluation::delete_student_eval -evaluation_id $evaluation_id } on_error { ad_return_error "[_ evaluation.lt_Error_deleting_the_ev]" "[_ evaluation.lt_We_got_the_following_]" ad_script_abort Index: openacs-4/packages/evaluation/www/admin/grades/grades.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/evaluation/www/admin/grades/grades.tcl 22 Dec 2004 22:06:40 -0000 1.13 +++ openacs-4/packages/evaluation/www/admin/grades/grades.tcl 21 Mar 2005 15:42:00 -0000 1.14 @@ -85,10 +85,10 @@ db_1row get_total_weight { *SQL* } -set total_weight [lc_numeric %.2f $total_weight] +set total_weight [format %.2f $total_weight] if { ![string eq $total_weight "100.00"] && ![string eq $total_weight "0"] } { - set notice "[_ evaluation.lt_The_sum_of_the_weight]" + set notice "es $total_weight [_ evaluation.lt_The_sum_of_the_weight]" } else { set notice "" }