Index: openacs-4/packages/evaluation/evaluation.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/evaluation.info,v diff -u -r1.13 -r1.14 --- openacs-4/packages/evaluation/evaluation.info 27 Aug 2004 17:42:33 -0000 1.13 +++ openacs-4/packages/evaluation/evaluation.info 10 Sep 2004 19:16:27 -0000 1.14 @@ -17,8 +17,8 @@ - + @@ -27,8 +27,9 @@ - + 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.11 -r1.12 --- openacs-4/packages/evaluation/catalog/evaluation.en_US.ISO-8859-1.xml 24 Aug 2004 22:40:29 -0000 1.11 +++ openacs-4/packages/evaluation/catalog/evaluation.en_US.ISO-8859-1.xml 10 Sep 2004 19:16:27 -0000 1.12 @@ -1,5 +1,5 @@ - + 1 = Individual Add Assignment @@ -14,7 +14,9 @@ Add/edit solution again Already answered + Answer Answer + Answer Date Assignment Group Assignment Groups Assignment Type @@ -79,6 +81,7 @@ click on this link: Comments: Comments + Comments Comments/Edit reason: Comments/Edit reason Confirm @@ -96,6 +99,7 @@ Due Date Due date Due Date + Due date: %task_name% Edit Grades Edit evaluation Edit Evaluations @@ -106,6 +110,7 @@ Edit task Email: Evaluated + Evaluation Date Evaluation Index Evaluation Modified Class Material @@ -124,10 +129,12 @@ Grade: Grade Students + Grade Grade Distribution Grade in Net value Grade over Grade over 100 + Grader Grader Grades Grades Category @@ -154,6 +161,8 @@ </tr> <tr> <td><input type=submit value="<# Create Group + Group Members + Group Name Group name Group Name Groups Admin. @@ -193,10 +202,12 @@ 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%\" 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 Check this if you want to add the assignment to other class(es) that you administer + Click here to go to the Assignments Page Click on the task that you want the groups to be copy from 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 @@ -210,6 +221,7 @@ 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%\" Edit Assignment Type Edit assignment type Edit grades distribution of $grade_plural_name @@ -234,6 +246,7 @@ Grades Report for $student_name Grades report of "%student_name%" Grades Sheet Explanation + Grades sheet for assighment "%task_name%" Group administration Groups administration Groups for task %task_name% @@ -273,10 +286,13 @@ 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%\" 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) %submission_date_pretty% <span style=\"color:red;\">(late answer)</span> + %task_name% administration + "%task_name%" is in groups, may be there are no groups, click this link if you want to go to the Groups Admin page: %groups_admin;noquote% The assignment "%task_name%" has been uploaded in this community. The comments/edit reason is a string with no more than 4,000 characters. The edit reason must be less than 4000 characteras long @@ -324,6 +340,7 @@ 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 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. The weight must be grather than 0, and you can not enter Net Value AND Weight. @@ -387,12 +404,16 @@ 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 + View evaluation details \ View/Edit Task Solution We got the following error while trying to remove the evaluation: <pre>%errmsg%</pre> We got the following error while trying to remove the grade: <pre>%errmsg%</pre> We got the following error while trying to remove the task: <pre>%errmsg%</pre> Weight must be a real number and between 0 and 100 + Weight of %grade_plural_name% over 100% of the class + 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%"} @@ -433,6 +454,7 @@ Name: Name Name: %student_name% + Net Grade Net Value Net value (NEW answer) @@ -475,6 +497,7 @@ Submission Date submit answer submit answer again + Submitted by Sumission Date Task Task Groups @@ -504,6 +527,7 @@ pues, esto esta interesante View answer View comments + View Evaluation View evaluation View grades sheet View my answer @@ -514,6 +538,7 @@ View/Edit Solution Weight Weight + Weight change Will the studen(s) be upi , pero no yupin Yes Index: openacs-4/packages/evaluation/catalog/evaluation.es_GT.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/catalog/evaluation.es_GT.ISO-8859-1.xml,v diff -u -r1.3 -r1.4 --- openacs-4/packages/evaluation/catalog/evaluation.es_GT.ISO-8859-1.xml 5 Aug 2004 00:32:55 -0000 1.3 +++ openacs-4/packages/evaluation/catalog/evaluation.es_GT.ISO-8859-1.xml 10 Sep 2004 19:16:27 -0000 1.4 @@ -1,11 +1,11 @@ - + Individual = 1 Agregar Asignaci�n Agregar Tipo de Asignaci�n Agregar tipo de asignaci�n - Agregar %grade_name% + Agregar $grade_name Agregar Agregar Miembro al grupo Agregar Tarea @@ -14,7 +14,9 @@ Agregar/Editar soluci�n otra vez Ya respondido + Respuesta Respuesta + Fecha en que se subi&oacute; la respuesta Grupo de Asignaci�n Grupos de Asignaciones Tipo de Asignaci�n @@ -34,8 +36,10 @@ haga click en este link: Comentarios: Comentarios + Commentarios Cometar/Editar raz�n: Cometar/Editar raz�n: + Confirmar Confirmar Evaluaci�n Grupo Crear Grupo @@ -50,6 +54,8 @@ Fecha: Fecha: Fecha: + Entrega de asignaci�n: %task_name% + Editar Notas Editar evaluaci�n Editar Evaluaciones Editar @@ -59,6 +65,7 @@ Editar tarea Correo Electr�nico Evaluado + Fecha de evaluaci&oacute;n Indice de Evaluaciones Evaluaci�n Modificada Material de Clase @@ -77,17 +84,21 @@ Nota: Nota Evaluar Estudiantes + Nota Distribuci�n de Notas Valor Neto de la Nota Nota sobre Nota sobre 100 + Corrector Calificado por Notas Categor�a de Notas Reporte de Notas Reportes de Notas Nombre del Cuadro de Notas Cuadro de Notas + Miembros del grupo + Nombre del Grupo Nombre del grupo Nombre del Grupo Administraci�n de Groupos. @@ -140,20 +151,21 @@ Historial de notas de la tarea "%task_name%" �Podr� entregarse tarde esta tarea? + Re-enviar respuesta para "%task_name%" Verificar el resto de las comunidades donde usted desea subir la asignaci�n tambi�n Haga click aqu� para desadjuntar el archivo Haga click aqu� si desea ir a la pagina de administraci�n de grupos despu�s de subir la tarea Haga click aqu� si desea agregar esta asignaci�n a varias clases o secciones + Haga click aqu� para ir a la p�gina de asignaciones Haga click en la tarea que desea ser copiada por los grupos El numero de caracteres en la raz�n del comentario/edici�n en %party_id% es mayor a 4,000, nuestra longitud m�xima. Por favor haga la raz�n del comentario / edici�n mas corta. Confirmar su Evaluaci�n Confirmar su(s) evaluacion(es) en "%task_name%" - Actualmente este %content% esta asociado a esta soluci�n, pero puede asociarlo a un url/archivo diferente solo con agregarlo aqu� - + Actualmente $content est� asociado a esta soluci�n de la tarea, pero puedes asociar un archivo/url diferente solo agregandolo aqu� Actualmente este $content esta asociado a esta tarea, pero puede asociarlo a un url/archivo diferente solo con agregarlo aqu� Actualmente este $content esta asociado a esta soluci�n, pero puede adjuntar un url/archivo diferente solo con agregarlo aqu� Actualmente este $content esta asociado a esta tarea, pero puede adjuntar un url/archivo diferente solo con agregarlo aqu� @@ -165,6 +177,7 @@ No cambie el campo "id" porque con este archivo se asocia la nota con el estudiante o grupo. La fecha de entrega debe de estar en el futuro + Fecha de entrega de "%task_name%" Editar Tipo de Asignaci�n Editar tipo de asignaci�n @@ -191,14 +204,16 @@ Nota sobre 100 puntos %grade_plural_name% representa el %grade_weight%% del 100% de la clase + %grade_plural_name% representa el %grade_weight%% del 100% de la nota de la clase. Ingresar notas usando el archivo generado: Ingresar notas usando el archivo generado: Calificar con 0 (cero) - Reporte de Notas para $student_name + Reporte de Notas Reporte de notas para "%student_name%" Hoja de Explicaci�n de Notas + Hoja de notas para la asignaci�n "%task_name%" Administraci�n de grupo Administraci�n de grupos Grupos para la tarea %task_name% @@ -246,22 +261,26 @@ Reusar grupos de otra asignaci�n Guarde el archivo csv y MANTENGA EL FORMATO CSV. El archivo CSV puede ser editado con cualquier editor de texto (y MS Excell) pero tiene que mantener el formato CSV. Si usted no mantiene el formato, el sistema no ser� capaz de leer el archivo. - Ver los archivos de notas asociados a esta tarea + Ver los archivos de notas asociados a esta tarea Env�e el archivo utilizando el bot�n "Enviar archivo". El sistema leer� el archivo y preguntara por una confirmaci�n (si todo esta bien con el archivo) para las notas. <small>Total de puntos en esta categoria: ${total_grade}/${max_grade} <br /> $grade_plural_name representan el ${grade_weight}% del 100% de la clase</small> + Lista de Estudiantes para "%task_name%" Estudiantes que NO han respondido: (%not_evaluated_with_no_answer%) Estudiantes No Evaluados: (%not_evaluated_with_answer%) %submission_date_pretty% (tarde) %submission_date_pretty% <span style=\"color:red;\">(entreg&oacute; tarde)</span> + Administraci&oacute;n de "%task_name%" + "%task_name%" es en grupos, progblemente no hay grupos creados para "%task_name%"; haga click en este link si desea ir a la p&aacute;gina de administraci&oacute;n de grupos: %groups_admin;noquote% La asignaci�n "%task_name%" ha sido subida en esta comunidad. La raz�n de comentarios/edici�n es una cadena de caracteres de no mas de 4,000 caracteres. La raz�n de edici�n debe de ser menor a los 4,000 caracteres de largo + La extensi�n del archivo es "%file_extension" y deber�a ser .CSV. Lo siento, pero no podemos procesarlo" } } } set page_title "<#_ Confirm Evaluation La extensi�n del archivo \"$file_extension\" debe de ser .CSV, lo sentimos, no podemos procesarlo El archivo es muy grande. (El tama�o m�ximo es de %pretty_maxnbytes% bytes) El archivo debe de tener un formato predefinido para que el sistema pueda leerlo y obtener la informaci�n. Si usted desea utilizar esta herramienta debe de seguir los siguientes pasos: @@ -270,6 +289,7 @@ La nota debe de ser un NUMERO VALIDO: %wrong_grade% La nota debe de ser un numero valido El valor neto debe de ser mayor a 0 o menor que $grade_weight, y no puede ingresar Valor Neto Y Ponderaci�n. + En n&uacute;mero de miembors debe ser mayor que 0 La suma de todos las asignaciones es %total_weight% y deber�a de ser 100 al final del curso (generalmente). @@ -370,8 +390,10 @@ Subir un archivo O un URL, pero no ambos Subir un archivo O un URL, pero no ambos Subir una soluci�n para esta asignaci�n para que los estudiantes puedan verla y aprender de ella. + Enviar respuesta para "%task_name%" user_name ha modificado el %party_name%. \n La raz�n de edici�n dada por %user_name% fue: %edit_reason% \n La nota actual es: %current_grade% \n\n Haga click en este link para ver los detalles de la evaluaci�n: %url_link% \n + Ver detalles de la evaluaci�n Ver/Editar Soluci�n de la Tarea Hubo un error al tratar de eliminar la evaluaci�n: <pre>%errmsg%</pre> @@ -380,6 +402,8 @@ Hubo un error al tratar de eliminar la tarea: <pre>%errmsg%</pre> La ponderaci�n debe de ser un numero real entre 0 y 100 + Porcentaje de %grade_plural_name% sobre el 100% de la nota de la clase + Porcentaje de este(a) %grade_name% sobre %grade_plural_name% Ponderaci�n sobre el 100% <br /> del Curso Ponderaci�n sobre %grade_weight%% <br /> de %grade_plural_name% Nota sobre el %grade_weight%% de %grade_plural_name% @@ -426,13 +450,15 @@ Nombre: T�tulo Nombre: %student_name% + Nota neta Valor Neto Valor neto (NUEVA respuesta) Nueva Asignaci�n Nuevo Grupo No No + No hay asignaciones (No hay datos) No hay grupo para la tarea Numero de Miembros @@ -467,6 +493,7 @@ Fecha de Entrega entregar re-entregar + Subida por Fecha de Entrega Tarea Lista de Grupos @@ -494,8 +521,10 @@ Subido por (URL) o URL: + pues, esto esta interesante Ver respuesta Ver comentarios + Ver evaluaci&oacute;n Ver evaluaci�n Ver cuadro de notas Ver mi respuesta @@ -506,7 +535,9 @@ Ver/Editar Soluci�n Fracci�n de nota: Fracci�n de nota: + Cambio en ponderaci�n Podr�(n) el estudiante(s) + upi , pero no yupin S� S� Index: openacs-4/packages/evaluation/lib/evaluations-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/Attic/evaluations-chunk-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/evaluation/lib/evaluations-chunk-postgresql.xql 30 Aug 2004 13:04:31 -0000 1.5 +++ openacs-4/packages/evaluation/lib/evaluations-chunk-postgresql.xql 10 Sep 2004 19:16:28 -0000 1.6 @@ -6,7 +6,8 @@ - select et.task_name, et.weight as task_weight, + select et.task_name, + round(et.weight,2) as task_weight, et.task_id from evaluation_tasksi et, cr_items cri where grade_item_id = :grade_item_id @@ -23,7 +24,7 @@ et.task_item_id, et.weight as t_weight, eg.weight as g_weight, - (et.weight*eg.weight)/100 as task_weight, + round((et.weight*eg.weight)/100,2) as task_weight, et.number_of_members, et.task_id from evaluation_grades eg, @@ -40,23 +41,51 @@ - select evaluation__party_id(:user_id,:task_id) + select coalesce((select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id),0) + from evaluation_tasks et3 + where et3.task_id = :task_id + +-- select evaluation__party_id(:user_id,:task_id) - + - select ese.grade, + select round(ese.grade,2) as grade, + ese.evaluation_id, ese.description as comments, ese.show_student_p, - (ese.grade*:t_weight*:g_weight)/10000 as task_grade + round((ese.grade*:t_weight*:g_weight)/10000,2) as task_grade from evaluation_student_evalsi ese, cr_items cri where ese.task_item_id = :task_item_id and cri.live_revision = ese.evaluation_id - and ese.party_id = evaluation__party_id(:user_id,:task_id) + and ese.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = :task_id + ) +-- evaluation__party_id(:user_id,:task_id) + @@ -69,8 +98,25 @@ from evaluation_answersi ea, cr_items cri where ea.task_item_id = :task_item_id and cri.live_revision = ea.answer_id - and ea.party_id = evaluation__party_id(:user_id,:task_id) + and ea.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = :task_id + ) +-- evaluation__party_id(:user_id,:task_id) + Index: openacs-4/packages/evaluation/lib/evaluations-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/evaluations-chunk.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/evaluation/lib/evaluations-chunk.tcl 30 Aug 2004 13:04:32 -0000 1.11 +++ openacs-4/packages/evaluation/lib/evaluations-chunk.tcl 10 Sep 2004 19:16:28 -0000 1.12 @@ -35,22 +35,20 @@ #student lappend elements grade \ [list label "[_ evaluation-portlet.Grade_over_100_]" \ - display_template {
@grade_tasks.grade@
} \ - orderby_asc {grade asc} \ - orderby_desc {grade desc}] + display_template {
@grade_tasks.grade@
}] lappend elements comments \ [list label "[_ evaluation-portlet.Comments_]" \ - link_url_col comments_url \ - link_html { title "[_ evaluation-portlet.lt_View_evaluation_comme]" }] + link_url_col comments_url \ + link_html { title "[_ evaluation-portlet.lt_View_evaluation_comme]" }] lappend elements task_weight \ [list label "[_ evaluation-portlet.Net_Value_]" \ - display_template {
@grade_tasks.task_weight@
} \ - orderby_asc {task_weight asc} \ - orderby_desc {task_weight desc}] + display_template {
@grade_tasks.task_weight@
} \ + orderby_asc {task_weight asc} \ + orderby_desc {task_weight desc}] lappend elements answer \ [list label "" \ - link_url_col answer_url \ - link_html { title "[_ evaluation-portlet.View_my_answer_]" }] + link_url_col answer_url \ + link_html { title "[_ evaluation-portlet.View_my_answer_]" }] set multirow_name grade_tasks set actions "" } @@ -82,7 +80,7 @@ db_multirow -extend { task_url audit_info audit_info_url } grade_tasks_admin get_tasks_admin { *SQL* } { set task_url [export_vars -base "${base_url}admin/evaluations/student-list" { task_id grade_id }] set category_weight [expr $category_weight + $task_weight] - set task_weight [format %.2f [lc_numeric $task_weight]] + set task_weight [lc_numeric $task_weight] set audit_info_url "[export_vars -base "${base_url}admin/evaluations/audit-info" { grade_id task_id }]" set audit_info "[_ evaluation-portlet.Audit_Info_]" @@ -91,26 +89,29 @@ db_multirow -extend { comments comments_url answer answer_url grade } grade_tasks get_grade_tasks { *SQL* } { - if { [db_0or1row get_evaluaiton_info { *SQL* }] } { + if { [db_0or1row get_evaluation_info { *SQL* }] } { if { ![empty_string_p $comments] } { set comments "[_ evaluation-portlet.View_comments_]" - set comments_url evaluation_view + set comments_url "[export_vars -base "evaluation-view" { evaluation_id { return_url ${base_url} }}]" + } else { + set comments "[_ evaluation.lt_View_evaluation_detai]" + set comments_url "[export_vars -base "${base_url}evaluation-view" { evaluation_id return_url }]" } set over_weight "" if { ![empty_string_p $show_student_p] && $show_student_p } { if { ![empty_string_p $grade] } { - set grade [format %.2f [lc_numeric $grade]] - set over_weight "[format %.2f [lc_numeric $task_grade]]/" + set grade [lc_numeric $grade] + set over_weight "[lc_numeric $task_grade]/" set total_grade [expr $total_grade + $task_grade] } else { set grade "[_ evaluation-portlet.Not_evaluated_]" } set max_grade [expr $task_weight + $max_grade] - set task_weight "${over_weight}[format %.2f [lc_numeric $task_weight]]" + set task_weight "${over_weight}[lc_numeric $task_weight]" } else { set grade "[_ evaluation-portlet.Not_available_]" Index: openacs-4/packages/evaluation/lib/student-grades-report-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/student-grades-report-chunk-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/evaluation/lib/student-grades-report-chunk-postgresql.xql 13 Aug 2004 17:09:53 -0000 1.5 +++ openacs-4/packages/evaluation/lib/student-grades-report-chunk-postgresql.xql 10 Sep 2004 19:16:28 -0000 1.6 @@ -6,7 +6,17 @@ - select evaluation__party_id(:student_id,:task_id) + select coalesce((select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :student_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id),0) + from evaluation_tasks et3 + where et3.task_id = :task_id + +-- select evaluation__party_id(:student_id,:task_id) @@ -17,19 +27,19 @@ select et.task_name, et.task_item_id, + eg.weight as g_weight, eg.weight as grade_weight, et.task_id, - et.weight as task_weight, + et.weight as t_weight, (et.weight*eg.weight)/100 as task_weight, et.number_of_members, to_char(et.due_date, 'YYYY-MM-DD HH24:MI:SS') as due_date_ansi, et.online_p from evaluation_grades eg, - evaluation_tasks et + evaluation_tasks et, cr_items cri where eg.grade_id = :grade_id and eg.grade_item_id = et.grade_item_id - and content_revision__is_live(et.task_id) = true - and content_revision__is_live(eg.grade_id) = true + and cri.live_revision = et.task_id @@ -46,12 +56,27 @@ select ea.answer_id - from evaluation_answersi ea, - evaluation_tasks et - where content_revision__is_live(ea.answer_id) = true - and ea.party_id = evaluation__party_id(:student_id,:task_id) - and ea.task_item_id = et.task_item_id - and et.task_id = :task_id + from evaluation_answers ea, + cr_items cri + where cri.live_revision = ea.answer_id + and ea.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :student_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :student_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = :task_id + ) +--evaluation__party_id(:student_id,:task_id) + and ea.task_item_id = :task_item_id @@ -61,15 +86,33 @@ select ese.grade, ese.description as comments, - (ese.grade*:task_weight*:grade_weight)/10000 as net_grade, + (ese.grade*:t_weight*:g_weight)/10000 as net_grade, person__name(ese.creation_user) as grader_name from evaluation_student_evalsi ese, + cr_items cri, evaluation_tasks et where ese.task_item_id = et.task_item_id - and content_revision__is_live(ese.evaluation_id) = true - and ese.party_id = evaluation__party_id(:student_id,:task_id) - and et.task_id = :task_id + and et.task_id = :task_id + and cri.live_revision = ese.evaluation_id + and ese.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :student_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :student_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = :task_id + ) +-- evaluation__party_id(:student_id,:task_id) + Index: openacs-4/packages/evaluation/lib/student-grades-report-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/student-grades-report-chunk.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation/lib/student-grades-report-chunk.tcl 24 Aug 2004 22:40:30 -0000 1.4 +++ openacs-4/packages/evaluation/lib/student-grades-report-chunk.tcl 10 Sep 2004 19:16:28 -0000 1.5 @@ -66,7 +66,6 @@ set assignments_orderby " order by task_name asc" } -set max_weight 0.00 set max_grade 0.00 set total_grade 0.00 @@ -99,13 +98,14 @@ db_0or1row get_grade_info { *SQL* } if { ![empty_string_p $grade] } { + set grade [format %.2f [lc_numeric $grade]] set over_weight "[format %.2f [lc_numeric $net_grade]]/" - set total_grade [expr $total_grade + $net_grade] + set total_grade [expr $total_grade + $net_grade] set net_grade [format %.2f [lc_numeric $net_grade]] set task_status "[_ evaluation.Evaluated_]" } else { - set neg_grade "[_ evaluation.na_]" + set net_grade "[_ evaluation.na_]" set grade "[_ evaluation.na_]" set grader "[_ evaluation.na_]" append task_status " [_ evaluation.Not_evaluated_] " @@ -133,5 +133,6 @@ } +set total_grade [format %.2f [lc_numeric [expr $total_grade]]] set max_grade [format %.2f [lc_numeric $max_grade]] set grade_weight [format %.2f [lc_numeric $grade_weight]] \ No newline at end of file Index: openacs-4/packages/evaluation/lib/tasks-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/Attic/tasks-chunk-postgresql.xql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/evaluation/lib/tasks-chunk-postgresql.xql 30 Aug 2004 13:04:32 -0000 1.11 +++ openacs-4/packages/evaluation/lib/tasks-chunk-postgresql.xql 10 Sep 2004 19:16:28 -0000 1.12 @@ -13,16 +13,19 @@ et.task_item_id, et.item_id, et.requires_grade_p, et.description, et.grade_item_id, - coalesce(cr.content_length,0) as content_length, + coalesce(round(cr.content_length/1024,0),0) as content_length, et.data as task_data, cr.title as task_title, + crmt.label as pretty_mime_type, et.task_id as revision_id from cr_revisions cr, evaluation_tasksi et, - cr_items cri + cr_items cri, + cr_mime_types crmt where cr.revision_id = et.revision_id and et.grade_item_id = :grade_item_id and cri.live_revision = et.task_id + and et.mime_type = crmt.mime_type $assignments_orderby @@ -42,14 +45,17 @@ cr.title as task_title, et.data as task_data, et.task_id as revision_id, - coalesce(cr.content_length,0) as content_length, - et.late_submit_p + coalesce(round(cr.content_length/1024,0),0) as content_length, + et.late_submit_p, + crmt.label as pretty_mime_type from cr_revisions cr, evaluation_tasksi et, - cr_items cri + cr_items cri, + cr_mime_types crmt where cr.revision_id = et.revision_id and grade_item_id = :grade_item_id and cri.live_revision = et.task_id + and et.mime_type = crmt.mime_type $assignments_orderby @@ -66,7 +72,17 @@ - select evaluation__party_id(:user_id,:task_id) + select coalesce((select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id),0) + from evaluation_tasks et3 + where et3.task_id = :task_id + +-- select evaluation__party_id(:user_id,:task_id) @@ -100,7 +116,24 @@ from evaluation_answers ea, cr_items cri where ea.task_item_id = :task_item_id and cri.live_revision = ea.answer_id - and ea.party_id = evaluation__party_id(:user_id,:task_id) + and ea.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = :task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = :task_id + ) + +-- evaluation__party_id(:user_id,:task_id) Index: openacs-4/packages/evaluation/lib/tasks-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/lib/tasks-chunk.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/evaluation/lib/tasks-chunk.tcl 30 Aug 2004 13:04:32 -0000 1.13 +++ openacs-4/packages/evaluation/lib/tasks-chunk.tcl 10 Sep 2004 19:16:28 -0000 1.14 @@ -12,7 +12,7 @@ set base_url [ad_conn package_url] set mode display -set return_url "[ad_conn url]?[ns_conn query]&[export_vars { grade_id }]" +set return_url "[ad_conn url]?[ns_conn query]" set elements [list task_name \ [list label "[_ evaluation-portlet.Name_]" \ @@ -115,7 +115,7 @@ } else { # we assume it's a file set task_url "[export_vars -base "${base_url}view/$task_title" { revision_id }]" - set task_name "$task_name ([format %.0f [lc_numeric [expr ($content_length/1024)]]] Kb)" + set task_name "$task_name ([lc_numeric $content_length] Kb - ${pretty_mime_type})" } if { [db_0or1row solution_info { *SQL* }] } { @@ -157,7 +157,7 @@ } else { # we assume it's a file set task_url "[export_vars -base "${base_url}view/$task_title" { revision_id }]" - set task_name "$task_name ([format %.0f [lc_numeric [expr ($content_length/1024)]]] Kb)" + set task_name "$task_name ([lc_numeric $content_length] Kb - ${pretty_mime_type})" } if { [string eq $online_p "t"] } { Index: openacs-4/packages/evaluation/sql/postgresql/evaluation-calendar-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/sql/postgresql/evaluation-calendar-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/evaluation/sql/postgresql/evaluation-calendar-create.sql 10 Sep 2004 19:16:28 -0000 1.1 @@ -0,0 +1,13 @@ +-- Simple mapping between cal_items and assignments + +create table evaluation_cal_task_map ( + task_item_id integer + constraint evaluation_cal_task_tid_fk + references cr_items(item_id), + cal_item_id integer + constraint evaluation_cal_task_cid_fk + references cal_items(cal_item_id) +); + +create index evaluation_cal_task_map_tcid_index on evaluation_cal_task_map(task_item_id,cal_item_id); + Index: openacs-4/packages/evaluation/sql/postgresql/evaluation-calendar-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/sql/postgresql/evaluation-calendar-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/evaluation/sql/postgresql/evaluation-calendar-drop.sql 10 Sep 2004 19:16:28 -0000 1.1 @@ -0,0 +1,32 @@ + + +-- deleting calendar mappings +create function inline_0 () +returns integer as ' +declare + v_cal_item_cursor RECORD; + +begin + + FOR v_cal_item_cursor IN + select map.cal_item_id + from evaluation_tasks et, + evaluation_cal_task_map map + where et.task_item_id = map.task_item_id + LOOP + delete from evaluation_cal_task_map where cal_item_id = v_cal_item_cursor.cal_item_id; + PERFORM cal_item__delete (v_cal_item_cursor.cal_item_id); + END LOOP; + + return 0; +end; +' language 'plpgsql'; + + +select inline_0 (); +drop function inline_0 (); + +drop index evaluation_cal_task_map_tcid_index; + +drop table evaluation_cal_task_map; + Index: openacs-4/packages/evaluation/sql/postgresql/evaluation-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/sql/postgresql/evaluation-create.sql,v diff -u -r1.15 -r1.16 --- openacs-4/packages/evaluation/sql/postgresql/evaluation-create.sql 25 Aug 2004 18:17:36 -0000 1.15 +++ openacs-4/packages/evaluation/sql/postgresql/evaluation-create.sql 10 Sep 2004 19:16:28 -0000 1.16 @@ -1499,3 +1499,4 @@ select inline_0(); drop function inline_0(); +\i evaluation-calendar-create.sql Index: openacs-4/packages/evaluation/sql/postgresql/evaluation-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/sql/postgresql/evaluation-drop.sql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/evaluation/sql/postgresql/evaluation-drop.sql 14 Jul 2004 17:42:06 -0000 1.8 +++ openacs-4/packages/evaluation/sql/postgresql/evaluation-drop.sql 10 Sep 2004 19:16:29 -0000 1.9 @@ -1,5 +1,6 @@ -- jopez@galileo.edu +\i evaluation-calendar-drop.sql -- Unregister the content template select content_type__unregister_template ( 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.15 -r1.16 --- openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql 25 Aug 2004 18:17:37 -0000 1.15 +++ openacs-4/packages/evaluation/tcl/evaluation-procs-postgresql.xql 10 Sep 2004 19:16:29 -0000 1.16 @@ -444,7 +444,11 @@ - select eg.grade_id from evaluation_tasks est, evaluation_grades eg where est.task_id = :task_id and est.grade_item_id = eg.grade_item_id and content_revision__is_live(est.task_id) = true and content_revision__is_live(eg.grade_id) = true + select eg.grade_id + from evaluation_tasks est, evaluation_grades eg, cr_items cri + where est.task_id = :task_id + and est.grade_item_id = eg.grade_item_id + and cri.live_revision = eg.grade_id @@ -453,7 +457,7 @@ select cu.person_id as party_id, cu.last_name||' - '||cu.first_names as party_name, - ese.grade, + round(ese.grade,2) as grade, ese.description as comments from cc_users cu left outer join evaluation_student_evalsi ese on (ese.party_id = cu.person_id and ese.task_item_id = :task_item_id @@ -522,10 +526,11 @@ select eg.grade_name, et.task_name from evaluation_grades eg, - evaluation_tasks et + evaluation_tasks et, + cr_items cri where et.task_id = :task_id and et.grade_item_id = eg.grade_item_id - and content_revision__is_live(eg.grade_id) = true + and cri.live_revision = eg.grade_id @@ -845,18 +850,23 @@ select evaluation__party_name(ea.party_id, et.task_id) as party_name, - ea.title as answer_title, - ea.revision_id, - cri.storage_type + crr.title as answer_title, + crr.revision_id, + crr.content as cr_file_name, + cri.storage_type, + cri.storage_area_key as cr_path from evaluation_answersi ea, + cr_revisions crr, evaluation_tasks et, - cr_items cri + cr_items cri, + cr_items cri2 where ea.task_item_id = et.task_item_id - and ea.item_id = cri.item_id + and ea.answer_item_id = cri.item_id + and crr.revision_id = ea.answer_id and et.task_id = :task_id and ea.data is not null - and content_revision__is_live(ea.answer_id) = true - and not exists (select 1 from evaluation_student_evals ese where ese.party_id = ea.party_id and ese.task_item_id = et.task_item_id and content_revision__is_live(ese.evaluation_id) = true) + and cri2.live_revision = ea.answer_id + and not exists (select 1 from evaluation_student_evals ese, cr_items cri3 where ese.party_id = ea.party_id and ese.task_item_id = et.task_item_id and cri3.live_revision = ese.evaluation_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.14 -r1.15 --- openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 20 Aug 2004 00:34:23 -0000 1.14 +++ openacs-4/packages/evaluation/tcl/evaluation-procs.tcl 10 Sep 2004 19:16:29 -0000 1.15 @@ -109,6 +109,7 @@ set notif_text "[_ evaluation.lt_An_assignment_was_mod] \n" } append notif_text "[_ evaluation.click_on_this_link_] [evaluation::notification::get_url -task_id $task_id -notif_type one_assignment_notif] \n" + append notif_text $sms_text set response_id $task_id } @@ -134,25 +135,13 @@ -response_id $response_id \ -notif_subject $notif_subject \ -notif_text $notif_text + } ad_proc -public evaluation::package_key {} { return "evaluation" } -ad_proc -public evaluation::make_url { - -file_name_from_db:required -} { - if { [regexp "view" $file_name_from_db] } { - return $file_name_from_db - } elseif { [regexp "http://" $file_name_from_db] } { - return $file_name_from_db - } else { - return $file_name_from_db - } -} - - ad_proc -public evaluation::new_grade { -item_id:required -content_type:required @@ -360,7 +349,7 @@ @param new_item_p If true make a new item using item_id @param task_id Task which "owns" the solution @param title The name of the task solution - @param storage_type lob or text, depending on what are we going to store + @param storage_type lob, file or text, depending on what are we going to store } { @@ -417,7 +406,7 @@ @param new_item_p If true make a new item using item_id @param task_id Task which "owns" the answer @param title The name of the task solution - @param storage_type lob or text, depending on what are we going to store + @param storage_type lob, file or text, depending on what are we going to store @param party_id Group or user_id thaw owns the anser } { @@ -478,7 +467,7 @@ @param party_id Party been evaluated @param grade Grade of the evaluation @param show_student_p If the student(s) will be able to see the grade - @param storage_type lob or text, depending on what are we going to store + @param storage_type lob, file or text, depending on what are we going to store @param description Comments on the evaluation @param mime_type Mime type of the evaluation. } { @@ -578,7 +567,7 @@ @param new_item_p If true make a new item using item_id @param task_id Task which "owns" the grades sheet @param title The name of the grades sheet - @param storage_type lob + @param storage_type lob or file @param mime_type Mime tipe of the grades sheet } { @@ -622,7 +611,7 @@ } set csv_content [list] - lappend csv_content "Grades sheet for assighment \"$task_name\"" + lappend csv_content "[_ evaluation.lt_Grades_sheet_for_assi]" lappend csv_content "\n[_ evaluation.Max_Grade_]" lappend csv_content "100" @@ -652,7 +641,7 @@ db_foreach parties_with_to_grade { *SQL* } { if { ![empty_string_p $grade] } { - set grade [format %.2f [lc_numeric $grade]] + set grade [lc_numeric $grade] } lappend csv_content "\n$party_id" lappend csv_content "$party_name" @@ -763,6 +752,11 @@ notification::type::delivery_method_enable \ -type_id $type_id \ -delivery_method_id [notification::delivery::get_id -short_name email] + + # Enable the delivery methods + notification::type::delivery_method_enable \ + -type_id $type_id \ + -delivery_method_id [notification::delivery::get_id -short_name sms] } ad_proc -public evaluation::apm::create_folders { @@ -886,13 +880,20 @@ file mkdir $dir db_foreach get_answers_for_task { *SQL* } { - if { [string eq $storage_type "lob"] } { + if { [string eq $storage_type "lob"] || [string eq $storage_type "file"] } { # it is a file regsub -all {[<>:\"|/@\\\#%&+\\ ,]} $party_name {_} file_name append file_name [file extension $answer_title] - db_blob_get_file select_object_content { *SQL* } -file [file join ${dir} ${file_name}] + if { [string eq $storage_type "file"] } { + # its a file + + file copy -- "[cr_fs_path $cr_path]${cr_file_name}" [file join ${dir} ${file_name}] + } else { + # its a lob + db_blob_get_file select_object_content { *SQL* } -file [file join ${dir} ${file_name}] + } } else { # it is a url 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.8 -r1.9 --- openacs-4/packages/evaluation/www/answer-add-edit-postgresql.xql 25 Aug 2004 18:17:37 -0000 1.8 +++ openacs-4/packages/evaluation/www/answer-add-edit-postgresql.xql 10 Sep 2004 19:16:30 -0000 1.9 @@ -14,7 +14,7 @@ - select task_item_id + select task_item_id, task_name from evaluation_tasks where task_id = :task_id @@ -61,16 +61,6 @@ - - - - update cr_revisions - set content_length = :content_length - where revision_id = :revision_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.9 -r1.10 --- openacs-4/packages/evaluation/www/answer-add-edit.tcl 24 Aug 2004 22:40:30 -0000 1.9 +++ openacs-4/packages/evaluation/www/answer-add-edit.tcl 10 Sep 2004 19:16:30 -0000 1.10 @@ -15,30 +15,30 @@ upload_file.tmpfile:tmpfile,optional return_url:notnull } -validate { - late_submit { + late_submit -requires { task_id:integer } { if { [string eq [db_string late_turn_in { *SQL* }] "f"] && [db_string compare_dates { *SQL* } -default 0] } { ad_complain "[_ evaluation.lt_This_task_can_not_be_]" } } } +db_1row task_info { *SQL* } + set user_id [ad_conn user_id] set party_id [db_string get_party_id { *SQL* }] set package_id [ad_conn package_id] if { [ad_form_new_p -key answer_id] } { - set page_title "[_ evaluation.Upload_Answer_]" + set page_title "[_ evaluation.lt_Upload_Answer_for_tas]" } else { - set page_title "[_ evaluation.Change_Answer_]" + set page_title "[_ evaluation.lt_Change_Answer_for_tas]" db_1row item_data { *SQL* } } set context [list $page_title] -db_1row task_info { *SQL* } - db_0or1row double_click { *SQL* } ad_form -html { enctype multipart/form-data } -name answer -cancel_url $return_url -export { item_id grade_id task_id return_url } -form { @@ -92,7 +92,12 @@ set title [template::util::file::get_property filename $upload_file] set mime_type [cr_filename_to_mime_type -create $title] - set storage_type lob + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { + set storage_type file + } else { + set storage_type lob + } + } elseif { ![string eq $url "http://"] } { set mime_type "text/plain" set title "link" @@ -113,19 +118,28 @@ 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] - # create the new item - db_dml lob_content { *SQL* } -blob_files [list $tmp_file] + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { + # create the new item + + set filename [cr_create_content_file $item_id $revision_id $tmp_file] + db_dml set_file_content { *SQL* } - set content_length [file size $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 + 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* } + } + } elseif { ![string eq $url "http://"] } { db_dml link_content { *SQL* } set content_length 0 - db_dml lob_size { *SQL* } + db_dml content_size { *SQL* } } } Index: openacs-4/packages/evaluation/www/answer-add-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/answer-add-edit.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/evaluation/www/answer-add-edit.xql 10 Sep 2004 19:16:30 -0000 1.1 @@ -0,0 +1,37 @@ + + + + + + + + update cr_revisions + set content = :filename, + mime_type = :mime_type, + content_length = :content_length + where revision_id = :revision_id + + + + + + + + update cr_revisions + set content_length = :content_length + where revision_id = :revision_id + + + + + + + + update cr_revisions + set content_length = :content_length + where revision_id = :revision_id + + + + + Index: openacs-4/packages/evaluation/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/index-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/evaluation/www/index-postgresql.xql 30 Jul 2004 22:50:09 -0000 1.5 +++ openacs-4/packages/evaluation/www/index-postgresql.xql 10 Sep 2004 19:16:30 -0000 1.6 @@ -9,9 +9,9 @@ select eg.grade_plural_name, eg.grade_id, eg.grade_item_id - from evaluation_gradesx eg, acs_objects ao - where content_revision__is_live(eg.grade_id) = true - and eg.item_id = ao.object_id + from evaluation_grades eg, acs_objects ao, cr_items cri + where cri.live_revision = eg.grade_id + and eg.grade_item_id = ao.object_id and ao.context_id = :package_id order by grade_plural_name desc @@ -21,7 +21,36 @@ - select evaluation__class_total_grade(:user_id,:package_id) + select coalesce(sum((ese.grade*et.weight*eg.weight)/10000),0) as grade + from evaluation_grades eg, evaluation_tasks et, evaluation_student_evals ese, acs_objects ao, cr_items cri1, cr_items cri2, cr_items cri3 + where et.task_item_id = ese.task_item_id + and et.grade_item_id = eg.grade_item_id + and eg.grade_item_id = ao.object_id + and ao.context_id = :package_id + and ese.party_id = + + ( select + CASE + WHEN et3.number_of_members = 1 THEN $user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = $user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = et.task_id) + + END as nom + from evaluation_tasks et3 + where et3.task_id = et.task_id + ) + + and cri1.live_revision = eg.grade_id + and cri2.live_revision = et.task_id + and cri3.live_revision = ese.evaluation_id + +-- select evaluation__class_total_grade(:user_id,:package_id) Index: openacs-4/packages/evaluation/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/index.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/evaluation/www/index.adp 30 Jul 2004 22:50:09 -0000 1.8 +++ openacs-4/packages/evaluation/www/index.adp 10 Sep 2004 19:16:30 -0000 1.9 @@ -13,7 +13,7 @@
  • #evaluation.lt_There_are_no_tasks_fo#
  • -
  • @grades.grade_plural_name@
    +
  • @grades.grade_plural_name;noquote@
  • @@ -26,7 +26,7 @@
  • #evaluation.lt_There_are_no_tasks_to#
  • -
  • @grades.grade_plural_name@
    +
  • @grades.grade_plural_name;noquote@
  • Index: openacs-4/packages/evaluation/www/task-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/task-view.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/evaluation/www/task-view.tcl 24 Aug 2004 22:40:30 -0000 1.8 +++ openacs-4/packages/evaluation/www/task-view.tcl 10 Sep 2004 19:16:30 -0000 1.9 @@ -35,7 +35,7 @@ if { ![empty_string_p $task_data] } { - if { [regexp "http://" $task_data] } { + if { [string eq $task_title "link"] } { set task_url "$task_data" } else { # we assume it's a file Index: openacs-4/packages/evaluation/www/admin/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/index-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation/www/admin/index-postgresql.xql 30 Jul 2004 22:50:09 -0000 1.4 +++ openacs-4/packages/evaluation/www/admin/index-postgresql.xql 10 Sep 2004 19:16:30 -0000 1.5 @@ -9,9 +9,9 @@ select eg.grade_plural_name, eg.grade_id, eg.grade_item_id - from evaluation_gradesx eg, acs_objects ao - where content_revision__is_live(eg.grade_id) = true - and eg.item_id = ao.object_id + from evaluation_grades eg, acs_objects ao, cr_items cri + where cri.live_revision = eg.grade_id + and eg.grade_item_id = ao.object_id and ao.context_id = :package_id order by grade_plural_name desc Index: openacs-4/packages/evaluation/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/index.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/evaluation/www/admin/index.adp 30 Jul 2004 22:50:09 -0000 1.9 +++ openacs-4/packages/evaluation/www/admin/index.adp 10 Sep 2004 19:16:30 -0000 1.10 @@ -17,7 +17,7 @@
  • #evaluation.lt_There_are_no_tasks_fo#
  • -
  • @grades.grade_plural_name@
    +
  • @grades.grade_plural_name;noquote@
  • @@ -31,7 +31,7 @@
  • #evaluation.lt_There_are_no_tasks_to#
  • -
  • @grades.grade_plural_name@
    +
  • @grades.grade_plural_name;noquote@
  • Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl 13 Aug 2004 17:09:55 -0000 1.8 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.tcl 10 Sep 2004 19:16:31 -0000 1.9 @@ -148,19 +148,34 @@ 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 + } else { + set storage_type lob + } + set revision_id [evaluation::new_grades_sheet -new_item_p 1 -item_id $grades_sheet_item_id -content_type evaluation_grades_sheets \ - -content_table evaluation_grades_sheets -content_id grades_sheet_id -storage_type lob -task_item_id $task_item_id \ + -content_table evaluation_grades_sheets -content_id grades_sheet_id -storage_type $storage_type -task_item_id $task_item_id \ -title $title -mime_type $mime_type] evaluation::set_live -revision_id $revision_id - # create the new item - db_dml lob_content { *SQL* } -blob_files [list $tmp_filename] + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { + # create the new item + + set filename [cr_create_content_file $item_id $revision_id $tmp_file] + db_dml set_file_content { *SQL* } + + } else { + + # create the new item + db_dml lob_content { *SQL* } -blob_files [list $tmp_filename] + + set content_length [file size $tmp_filename] + # Unfortunately, we can only calculate the file size after the lob is uploaded + db_dml lob_size { *SQL* } + } - set content_length [file size $tmp_filename] - # Unfortunately, we can only calculate the file size after the lob is uploaded - db_dml lob_size { *SQL* } - foreach party_id [array names grades_gs] { if { ![info exists comments_gs($party_id)] } { set comments_gs($party_id) "" Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.xql 30 Jul 2004 22:50:10 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students-2.xql 10 Sep 2004 19:16:31 -0000 1.3 @@ -22,6 +22,18 @@
    + + + + update cr_revisions + set content = :filename, + mime_type = :mime_type, + content_length = :content_length + where revision_id = :revision_id + + + + Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.adp 12 Aug 2004 17:46:42 -0000 1.6 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.adp 10 Sep 2004 19:16:31 -0000 1.7 @@ -9,6 +9,7 @@ @export_vars;noquote@ +
    @@ -30,6 +31,7 @@ @export_vars;noquote@ +
    @@ -54,6 +56,7 @@ @export_vars;noquote@ +
    Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl 12 Aug 2004 17:46:42 -0000 1.4 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluate-students.tcl 10 Sep 2004 19:16:31 -0000 1.5 @@ -7,118 +7,121 @@ @creation-date Mar 2004 @cvs-id $Id$ } { - task_id:integer,notnull - max_grade:integer,notnull - item_ids:array,integer,optional - item_to_edit_ids:array,integer,optional - - grades:array,optional - reasons:array,optional - show_student:array,optional - evaluation_ids:array,integer,optional + task_id:integer,notnull + max_grade:integer,notnull + item_ids:array,integer,optional + item_to_edit_ids:array,integer,optional + + grades:array,optional + reasons:array,optional + show_student:array,optional + evaluation_ids:array,integer,optional - grades_wa:array,optional - comments_wa:array,optional - show_student_wa:array,optional + grades_wa:array,optional + comments_wa:array,optional + show_student_wa:array,optional - grades_na:array,optional - comments_na:array,optional - show_student_na:array,optional + grades_na:array,optional + comments_na:array,optional + show_student_na:array,optional - {grade_all ""} + {grade_all ""} } -validate { - valid_grades_wa { - set counter 0 - foreach party_id [array names grades_wa] { - if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { - incr counter - if { ![ad_var_type_check_number_p $grades_wa($party_id)] } { - set wrong_grade $grades_wa($party_id) - ad_complain "[_ evaluation.lt_The_grade_must_be_a_v]" - } - } + valid_grades_wa { + set counter 0 + foreach party_id [array names grades_wa] { + if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { + incr counter + if { ![ad_var_type_check_number_p $grades_wa($party_id)] } { + set wrong_grade $grades_wa($party_id) + ad_complain "[_ evaluation.lt_The_grade_must_be_a_v]" } - if { !$counter && ([array size show_student_wa] > 0)} { - ad_complain "[_ evaluation.lt_There_must_be_at_leas]" - } + } } - valid_grades_na { - set counter 0 - foreach party_id [array names grades_na] { - if { [empty_string_p $grade_all] } { - if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { - incr counter - if { ![ad_var_type_check_number_p $grades_na($party_id)] } { - set wrong_grade $grades_na($party_id) - ad_complain "[_ evaluation.lt_The_grade_must_be_a_v]" - } - } - } else { - set grades_na($party_id) 0 - } - } - if { !$counter && ([array size show_student_na] > 0) && [empty_string_p $grade_all] } { - ad_complain "[_ evaluation.lt_There_must_be_at_leas]" - } + if { !$counter && ([array size show_student_wa] > 0) } { + ad_complain "[_ evaluation.lt_There_must_be_at_leas]" } - valid_grades { - set counter 0 - foreach party_id [array names grades] { - if { [info exists grades($party_id)] && ![empty_string_p $grades($party_id)] } { - if { ![ad_var_type_check_number_p $grades($party_id)] } { - set wrong_grade $grades($party_id) - ad_complain "[_ evaluation.lt_The_grade_most_be_a_v]" - } else { - set old_grade [format %.2f [lc_numeric [db_string get_old_grade { *SQL* }]]] - if { ![string eq $old_grade [format %.2f [lc_numeric $grades($party_id)]]] } { - incr counter - if { ![info exists reasons($party_id)] || [empty_string_p $reasons($party_id)] } { - set grade_wo_reason $grades($party_id) - ad_complain "[_ evaluation.lt_You_must_give_an_edit]" - } - set grades_to_edit($party_id) $grades($party_id) - set reasons_to_edit($party_id) $reasons($party_id) - set show_student_to_edit($party_id) $show_student($party_id) - } - } - } + } + valid_grades_na { + set counter 0 + foreach party_id [array names grades_na] { + if { [empty_string_p $grade_all] } { + if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { + incr counter + if { ![ad_var_type_check_number_p $grades_na($party_id)] } { + set wrong_grade $grades_na($party_id) + ad_complain "[_ evaluation.lt_The_grade_must_be_a_v]" + } } - if { !$counter && ([array size show_student] > 0) } { - ad_complain "[_ evaluation.lt_There_must_be_at_leas]" - } + } else { + set grades_na($party_id) 0 + } } - valid_data { - foreach party_id [array names comments_wa] { - if { [info exists comments_wa($party_id)] && ![info exists grades_wa($party_id)] } { - set wrong_comments $comments_wa($party_id) - ad_complain "[_ evaluation.lt_There_is_a_comment_fo]" + if { !$counter && ([array size show_student_na] > 0) && [empty_string_p $grade_all] } { + ad_complain "[_ evaluation.lt_There_must_be_at_leas]" + } + } + valid_grades { + set counter 0 + foreach party_id [array names grades] { + if { [info exists grades($party_id)] && ![empty_string_p $grades($party_id)] } { + if { ![ad_var_type_check_number_p $grades($party_id)] } { + set wrong_grade $grades($party_id) + ad_complain "[_ evaluation.lt_The_grade_most_be_a_v]" + } else { + set old_grade [format %.2f [db_string get_old_grade { *SQL* }]] + if { ![string eq $old_grade [format %.2f [expr $grades($party_id)*100/$max_grade]]] } { + incr counter + if { $max_grade != 100 } { + append reasons($party_id) "[_ evaluation.Weight_change]" } - if { [info exists comments_wa($party_id)] && ([string length $comments_wa($party_id)] > 400) } { - set wrong_comments $comments_wa($party_id) - ad_complain "[_ evaluation.lt_There_is_a_comment_la_1]" + if { ![info exists reasons($party_id)] || [empty_string_p $reasons($party_id)] } { + set grade_wo_reason $grades($party_id) + ad_complain "[_ evaluation.lt_You_must_give_an_edit]" } + set grades_to_edit($party_id) $grades($party_id) + set reasons_to_edit($party_id) $reasons($party_id) + set show_student_to_edit($party_id) $show_student($party_id) + } } - foreach party_id [array names comments_na] { - if { [info exists comments_na($party_id)] && ![info exists grades_na($party_id)] } { - set wrong_comments $comments_na($party_id) - ad_complain "[_ evaluation.lt_There_is_a_comment_fo]" - } - if { [info exists comments_na($party_id)] && ([string length $comments_na($party_id)] > 400) } { - set wrong_comments $comments_na($party_id) - ad_complain "[_ evaluation.lt_There_is_a_comment_la]" - } - } - foreach party_id [array names reasons] { - if { [info exists reasons($party_id)] && ![info exists grades($party_id)] } { - set wrong_comments $reasons($party_id) - ad_complain "[_ evaluation.lt_There_is_an_edit_reas]" - } - if { [info exists reasons($party_id)] && ([string length $reasons($party_id)] > 400) } { - set wrong_comments $reasons($party_id) - ad_complain "[_ evaluation.lt_There_is_an_edit_reas_1]" - } - } + } } + if { !$counter && ([array size show_student] > 0) && ($max_grade == 100) } { + ad_complain "[_ evaluation.lt_There_must_be_at_leas]" + } + } + valid_data { + foreach party_id [array names comments_wa] { + if { [info exists comments_wa($party_id)] && ![info exists grades_wa($party_id)] } { + set wrong_comments $comments_wa($party_id) + ad_complain "[_ evaluation.lt_There_is_a_comment_fo]" + } + if { [info exists comments_wa($party_id)] && ([string length $comments_wa($party_id)] > 400) } { + set wrong_comments $comments_wa($party_id) + ad_complain "[_ evaluation.lt_There_is_a_comment_la_1]" + } + } + foreach party_id [array names comments_na] { + if { [info exists comments_na($party_id)] && ![info exists grades_na($party_id)] } { + set wrong_comments $comments_na($party_id) + ad_complain "[_ evaluation.lt_There_is_a_comment_fo]" + } + if { [info exists comments_na($party_id)] && ([string length $comments_na($party_id)] > 400) } { + set wrong_comments $comments_na($party_id) + ad_complain "[_ evaluation.lt_There_is_a_comment_la]" + } + } + foreach party_id [array names reasons] { + if { [info exists reasons($party_id)] && ![info exists grades($party_id)] } { + set wrong_comments $reasons($party_id) + ad_complain "[_ evaluation.lt_There_is_an_edit_reas]" + } + if { [info exists reasons($party_id)] && ([string length $reasons($party_id)] > 400) } { + set wrong_comments $reasons($party_id) + ad_complain "[_ evaluation.lt_There_is_an_edit_reas_1]" + } + } + } } set page_title "[_ evaluation.lt_Confirm_Your_Evaluati]" @@ -131,20 +134,20 @@ # if the structure of the multirow datasource ever changes, this needs to be rewritten set counter 0 foreach party_id [array names show_student_wa] { - if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { - incr counter - set party_name [db_string get_party_name { *SQL* }] - set evaluations_wa:${counter}(rownum) $counter - set evaluations_wa:${counter}(party_name) $party_name - set evaluations_wa:${counter}(grade) $grades_wa($party_id) - set evaluations_wa:${counter}(comment) $comments_wa($party_id) - if { [string eq $show_student_wa($party_id) "t"] } { - set evaluations_wa:${counter}(show_student) "[_ evaluation.Yes_]" - } else { - set evaluations_wa:${counter}(show_student) "[_ evaluation.No_]" - } - set item_ids($party_id) [db_nextval acs_object_id_seq] + if { [info exists grades_wa($party_id)] && ![empty_string_p $grades_wa($party_id)] } { + incr counter + set party_name [db_string get_party_name { *SQL* }] + set evaluations_wa:${counter}(rownum) $counter + set evaluations_wa:${counter}(party_name) $party_name + set evaluations_wa:${counter}(grade) $grades_wa($party_id) + set evaluations_wa:${counter}(comment) " $comments_wa($party_id)" + if { [string eq $show_student_wa($party_id) "t"] } { + set evaluations_wa:${counter}(show_student) "[_ evaluation.Yes_]" + } else { + set evaluations_wa:${counter}(show_student) "[_ evaluation.No_]" } + set item_ids($party_id) [db_nextval acs_object_id_seq] + } } set evaluations_wa:rowcount $counter @@ -154,20 +157,20 @@ # if the structure of the multirow datasource ever changes, this needs to be rewritten set counter 0 foreach party_id [array names show_student_na] { - if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { - incr counter - set party_name [db_string get_party_name { *SQL* }] - set evaluations_na:${counter}(rownum) $counter - set evaluations_na:${counter}(party_name) $party_name - set evaluations_na:${counter}(grade) $grades_na($party_id) - set evaluations_na:${counter}(comment) $comments_na($party_id) - if { [string eq $show_student_na($party_id) "t"] } { - set evaluations_na:${counter}(show_student) "[_ evaluation.Yes_]" - } else { - set evaluations_na:${counter}(show_student) "[_ evaluation.No_]" - } - set item_ids($party_id) [db_nextval acs_object_id_seq] + if { [info exists grades_na($party_id)] && ![empty_string_p $grades_na($party_id)] } { + incr counter + set party_name [db_string get_party_name { *SQL* }] + set evaluations_na:${counter}(rownum) $counter + set evaluations_na:${counter}(party_name) $party_name + set evaluations_na:${counter}(grade) $grades_na($party_id) + set evaluations_na:${counter}(comment) " $comments_na($party_id)" + if { [string eq $show_student_na($party_id) "t"] } { + set evaluations_na:${counter}(show_student) "[_ evaluation.Yes_]" + } else { + set evaluations_na:${counter}(show_student) "[_ evaluation.No_]" } + set item_ids($party_id) [db_nextval acs_object_id_seq] + } } set evaluations_na:rowcount $counter @@ -177,19 +180,19 @@ # if the structure of the multirow datasource ever changes, this needs to be rewritten set counter 0 foreach party_id [array names show_student] { - if { [info exists grades_to_edit($party_id)] && ![empty_string_p $grades_to_edit($party_id)] } { - incr counter - set party_name [db_string get_party_name { *SQL* }] - set evaluations:${counter}(rownum) $counter - set evaluations:${counter}(party_name) $party_name - set evaluations:${counter}(grade) $grades_to_edit($party_id) - set evaluations:${counter}(reason) $reasons_to_edit($party_id) - if { [string eq $show_student_to_edit($party_id) "t"] } { - set evaluations:${counter}(show_student) "[_ evaluation.Yes_]" - } else { - set evaluations:${counter}(show_student) "[_ evaluation.No_]" - } + if { [info exists grades_to_edit($party_id)] && ![empty_string_p $grades_to_edit($party_id)] } { + incr counter + set party_name [db_string get_party_name { *SQL* }] + set evaluations:${counter}(rownum) $counter + set evaluations:${counter}(party_name) $party_name + set evaluations:${counter}(grade) $grades_to_edit($party_id) + set evaluations:${counter}(reason) $reasons_to_edit($party_id) + if { [string eq $show_student_to_edit($party_id) "t"] } { + set evaluations:${counter}(show_student) "[_ evaluation.Yes_]" + } else { + set evaluations:${counter}(show_student) "[_ evaluation.No_]" } + } } set evaluations:rowcount $counter Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit-postgresql.xql 12 Aug 2004 17:46:42 -0000 1.4 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit-postgresql.xql 10 Sep 2004 19:16:31 -0000 1.5 @@ -8,7 +8,7 @@ select evaluation__party_name(ese.party_id,et.task_id) as party_name, ese.party_id, - ese.grade, + round(ese.grade,2) as grade, ese.last_modified as evaluation_date, et.online_p, et.due_date, Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.adp 20 Aug 2004 01:11:17 -0000 1.5 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.adp 10 Sep 2004 19:16:31 -0000 1.6 @@ -3,16 +3,16 @@ @context;noquote@ -
    - + + + @export_vars;noquote@
    - @export_vars;noquote@
    - - + +
    Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl 24 Aug 2004 22:40:32 -0000 1.8 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl 10 Sep 2004 19:16:31 -0000 1.9 @@ -55,14 +55,14 @@ db_multirow -extend { answer answer_url radio_yes_checked radio_no_checked submission_date_pretty } evaluated_students get_evaluated_students { *SQL* } { - set grade [format %.2f [lc_numeric $grade]] + set grade [lc_numeric $grade] if { [string eq $online_p "t"] } { if { [db_0or1row get_answer_info { *SQL* }] } { # working with answer stuff (if it has a file/url attached) if { [empty_string_p $answer_data] } { set answer "[_ evaluation.No_response_]" - } elseif { [regexp "http://" $answer_data] } { + } elseif { [string eq $answer_title "link"] } { set answer_url "[export_vars -base "$answer_data" { }]" set answer "[_ evaluation.View_answer_]" } else { Index: openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl 30 Jul 2004 22:50:10 -0000 1.4 +++ openacs-4/packages/evaluation/www/admin/evaluations/one-evaluation-edit.tcl 10 Sep 2004 19:16:31 -0000 1.5 @@ -55,7 +55,7 @@ } -edit_request { db_1row evaluation_info { *SQL* } - set grade [format %.2f [lc_numeric $grade]] + set grade [lc_numeric $grade] } -validate { {grade Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list-postgresql.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list-postgresql.xql 24 Aug 2004 22:40:32 -0000 1.9 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list-postgresql.xql 10 Sep 2004 19:16:31 -0000 1.10 @@ -6,18 +6,23 @@ - select evaluation__party_name(ese.party_id,et.task_id) as party_name, - ese.party_id, - ese.grade, + select ese.party_id, + case when et.number_of_members = 1 then + (select last_name||', '||first_names from persons where person_id = ese.party_id) + else + (select group_name from groups where group_id = ese.party_id) + end as party_name, + round(ese.grade,2) as grade, ese.last_modified as evaluation_date, et.online_p, et.due_date, ese.evaluation_id from evaluation_tasks et, - evaluation_student_evalsi ese + evaluation_student_evalsi ese, + cr_items cri where et.task_id = :task_id and et.task_item_id = ese.task_item_id - and content_revision__is_live(ese.evaluation_id) = true + and cri.live_revision = ese.evaluation_id $orderby @@ -26,7 +31,11 @@ - select count(party_id) from evaluation_answers ea where ea.task_item_id = :task_item_id $processed_clause and content_revision__is_live(ea.answer_id) = true + select count(party_id) + from evaluation_answers ea, cri_items cri + where ea.task_item_id = :task_item_id + $processed_clause + and cri.live_revision = ea.answer_id @@ -55,10 +64,10 @@ ea.revision_id, to_char(ea.creation_date, 'YYYY-MM-DD HH24:MI:SS') as submission_date_ansi, ea.last_modified as submission_date - from evaluation_answersi ea + from evaluation_answersi ea, cr_items cri where ea.party_id = :party_id and ea.task_item_id = :task_item_id - and content_revision__is_live(ea.answer_id) = true + and cri.live_revision = ea.answer_id @@ -67,10 +76,10 @@ select count(*) - from evaluation_student_evals ese, evaluation_tasks et + from evaluation_student_evals ese, evaluation_tasks et, cr_items cri where ese.task_item_id = et.task_item_id and et.task_id = :task_id - and content_revision__is_live(ese.evaluation_id) = true + and cri.live_revision = ese.evaluation_id @@ -86,7 +95,12 @@ - select evaluation__party_name(ea.party_id, :task_id) as party_name, + select ea.party_id, + case when et.number_of_members = 1 then + (select last_name||', '||first_names from persons where person_id = ea.party_id) + else + (select group_name from groups where group_id = ea.party_id) + end as party_name, ea.party_id, ea.data as answer_data, ea.title as answer_title, @@ -102,7 +116,8 @@ and ea.data is not null and cri.live_revision = ea.answer_id $processed_clause - + $orderby_wa + @@ -118,24 +133,30 @@ to_char(et.due_date, 'YYYY-MM-DD HH24:MI:SS') as due_date_ansi, et.number_of_members, et.online_p - from evaluation_grades eg, evaluation_tasks et + from evaluation_grades eg, evaluation_tasks et, cr_items cri where et.task_id = :task_id and et.grade_item_id = eg.grade_item_id - and content_revision__is_live(eg.grade_id) = true + and cri.live_revision = eg.grade_id - select acs_group__name(etg.group_id) as party_name, - etg.group_id as party_id - from evaluation_task_groups etg, evaluation_tasks et - where etg.task_item_id = et.task_item_id - and et.task_id = :task_id - $not_in_clause - $orderby_na + + select g.group_name as party_name, + g.group_id as party_id + from groups g, evaluation_task_groups etg, evaluation_tasks et, + acs_rels map + where g.group_id = etg.group_id + and etg.group_id = map.object_id_one + and map.rel_type = 'evaluation_task_group_rel' + and etg.task_item_id = et.task_item_id + and et.task_id = :task_id + $not_in_clause + group by g.group_id, g.group_name + - + \ No newline at end of file Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list.adp 2 Aug 2004 18:06:32 -0000 1.8 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.adp 10 Sep 2004 19:16:31 -0000 1.9 @@ -24,15 +24,16 @@ - - + +
    #evaluation.lt_Grade_students_using_file#
    @groups_admin;noquote@@groups_admin;noquote@@task_admin;noquote@

    #evaluation.lt_Evaluated_Students_to#

    #evaluation.Theese#


    +

    #evaluation.lt_Students_with_answers#

    #evaluation.lt_These_are_the_student#

    @@ -124,6 +125,10 @@

    #evaluation.lt_There_are_no_students_1#

    + +

    #evaluation.lt_task_name_is_in_group#

    +
    + Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 24 Aug 2004 22:40:32 -0000 1.13 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 10 Sep 2004 19:16:31 -0000 1.14 @@ -18,23 +18,26 @@ } set user_id [ad_conn user_id] -set page_title "[_ evaluation.Student_List_]" -set context [list "[_ evaluation.Student_List_]"] +db_1row get_task_info { *SQL* } +set page_title "[_ evaluation.lt_Students_List_for_tas]" +set context [list "[_ evaluation.lt_Students_List_for_tas]"] + if { [string eq $show_portrait_p "t"] } { set this_url "student-list?[export_vars -entire_form -url { { show_portrait_p f } }]" } else { set this_url "student-list?[export_vars -entire_form -url { { show_portrait_p t } }]" } -db_1row get_task_info { *SQL* } set due_date_pretty [lc_time_fmt $due_date_ansi "%q %r"] +set return_url "[ad_conn url]?[ad_conn query]" if { $number_of_members > 1 } { set groups_admin "[_ evaluation.lt_Groups_administration]" } else { set groups_admin "" } +set task_admin "[_ evaluation.lt_task_name_administrat]" set done_students [list] set evaluation_mode "display" @@ -45,7 +48,11 @@ set actions [list "[_ evaluation.Edit_Evaluations_]" [export_vars -base "evaluations-edit" { task_id }]] -set elements [list party_name \ +set elements [list count \ + [list label "" \ + display_template { @evaluated_students.rownum@. } \ + ] \ + party_name \ [list label "[_ evaluation.Name_]" \ orderby_asc {party_name asc} \ orderby_desc {party_name desc} \ @@ -112,18 +119,18 @@ } set total_evaluated 0 -db_multirow -extend { action action_url submission_date_pretty } evaluated_students evaluated_students { *SQL* } { +db_multirow -extend { action action_url submission_date_pretty count } evaluated_students evaluated_students { *SQL* } { incr total_evaluated lappend done_students $party_id - set grade [format %.2f [lc_numeric $grade]] + set grade [lc_numeric $grade] if { [string eq $online_p "t"] } { if { [db_0or1row get_answer_info { *SQL* }] } { # working with answer stuff (if it has a file/url attached) if { [empty_string_p $answer_data] } { set action "[_ evaluation.No_response_]" - } elseif { [regexp "http://" $answer_data] } { + } elseif { [string eq $answer_title "link"] } { set action_url "[export_vars -base "$answer_data" { }]" set action "[_ evaluation.View_answer_]" } else { @@ -222,21 +229,18 @@ } lappend done_students $party_id - if { [string eq $online_p "t"] } { - set submission_date_pretty "[lc_time_fmt $submission_date_ansi "%q %r"]" - if { [db_string compare_submission_date { *SQL* } -default 0] } { - set submission_date_pretty "[_ evaluation.lt_submission_date_prett_1]" - } else { - } - set answer "[_ evaluation.View_answer_]" - # working with answer stuff (if it has a file/url attached) - if { [regexp "http://" $answer_data] } { - set answer_url [export_vars -base "$answer_data" { }] - } else { - # we assume it's a file - set answer_url [export_vars -base "../../view/$answer_title" { revision_id }] - } + set submission_date_pretty "[lc_time_fmt $submission_date_ansi "%q %r"]" + if { [db_string compare_submission_date { *SQL* } -default 0] } { + set submission_date_pretty "[_ evaluation.lt_submission_date_prett_1]" } + set answer "[_ evaluation.View_answer_]" + # working with answer stuff (if it has a file/url attached) + if { [string eq $answer_title "link"] } { + set answer_url [export_vars -base "$answer_data" { }] + } else { + # we assume it's a file + set answer_url [export_vars -base "../../view/$answer_title" { revision_id }] + } } # @@ -295,9 +299,9 @@ } else { set community_id [dotlrn_community::get_community_id] if { [llength $done_students] > 0 } { - set not_in_clause [db_map not_yet_in_clause] + set not_in_clause [db_map not_yet_in_clause_non_empty] } else { - set not_in_clause [db_map not_yet_in_clause] + set not_in_clause [db_map not_yet_in_clause_empty] } # if this page is called from within a community (dotlrn) we have to show only the students @@ -326,6 +330,8 @@ } } +set total_processed [llength $done_students] + set grades_sheet_item_id [db_nextval acs_object_id_seq] Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql 24 Aug 2004 22:40:32 -0000 1.8 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.xql 10 Sep 2004 19:16:31 -0000 1.9 @@ -27,13 +27,13 @@
    - + where p.person_id not in ([join $done_students ","]) - + , cc_users cu @@ -68,16 +68,18 @@ + select p.person_id as party_id, p.last_name||', '||p.first_names as party_name from persons p $not_in_clause - $orderby_na + + select app.user_id as party_id, p.last_name||', '||p.first_names as party_name from dotlrn_member_rels_approved app, @@ -86,14 +88,15 @@ and app.community_id = :community_id and app.user_id = p.person_id and app.role = 'student' - $orderby_na + $sql_query + $orderby_na Index: openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl 10 Jun 2004 21:08:54 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.tcl 10 Sep 2004 19:16:32 -0000 1.3 @@ -9,22 +9,29 @@ } { grade_id:integer,notnull return_url - operation + operation } if { [string eq $operation "[_ evaluation.lt_Yes_I_really_want_to__1]"] } { db_transaction { - db_exec_plsql delete_grade { *SQL* } - + # calendar integration (begin) + db_foreach cal_map { *SQL* } { + db_dml delete_mapping { *SQL* } + calendar::item::delete -cal_item_id $cal_item_id + } + # calendar integration (end) + + db_exec_plsql delete_grade { *SQL* } + } on_error { - ad_return_error "[_ evaluation.lt_Error_deleting_the_gr]" "[_ evaluation.lt_We_got_the_following__1]" - ad_script_abort + ad_return_error "[_ evaluation.lt_Error_deleting_the_gr]" "[_ evaluation.lt_We_got_the_following__1]" + ad_script_abort } } else { if { [empty_string_p $return_url] } { - # redirect to the index page by default - set return_url "grades" + # redirect to the index page by default + set return_url "grades" } } Index: openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/evaluation/www/admin/grades/grades-delete-2.xql 10 Sep 2004 19:16:32 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + + + + + select map.cal_item_id + from evaluation_tasks et, + evaluation_grades eg, + evaluation_cal_task_map map + where eg.grade_id = :grade_id + and et.grade_item_id = eg.grade_item_id + and et.task_item_id = map.task_item_id + + + + + + + + delete from evaluation_cal_task_map where cal_item_id = :cal_item_id + + + + + + Index: openacs-4/packages/evaluation/www/admin/grades/grades-reports-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-reports-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/evaluation/www/admin/grades/grades-reports-postgresql.xql 7 Jul 2004 17:26:45 -0000 1.7 +++ openacs-4/packages/evaluation/www/admin/grades/grades-reports-postgresql.xql 10 Sep 2004 19:16:32 -0000 1.8 @@ -7,9 +7,9 @@ select count(eg.grade_id) - from evaluation_gradesx eg, acs_objects ao - where content_revision__is_live(eg.grade_id) = true - and eg.item_id = ao.object_id + from evaluation_grades eg, acs_objects ao, cr_items cri + where cri.live_revision = eg.grade_id + and eg.grade_item_id = ao.object_id and ao.context_id = [ad_conn package_id] @@ -21,9 +21,9 @@ select eg.grade_id, eg.grade_plural_name, eg.weight - from evaluation_gradesx eg, acs_objects ao - where content_revision__is_live(eg.grade_id) = true - and eg.item_id = ao.object_id + from evaluation_grades eg, acs_objects ao, cr_items cri + where cri.live_revision = eg.grade_id + and eg.grade_item_id = ao.object_id and ao.context_id = :package_id order by grade_plural_name @@ -33,15 +33,67 @@ - , [lc_numeric trunc(evaluation__grade_total_grade(cu.user_id,$grade_id),2)] as grade_$grade_id + , round((select coalesce((select sum((ese.grade*et.weight*eg.weight)/10000) + from evaluation_grades eg, evaluation_tasks et, evaluation_student_evals ese + where et.task_item_id = ese.task_item_id + and et.grade_item_id = eg.grade_item_id + and eg.grade_id = $grade_id + and ese.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN cu.user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = cu.user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = et.task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = et.task_id + ) + and et.requires_grade_p = 't' + and exists (select 1 from cr_items where live_revision = et.task_id) + and exists (select 1 from cr_items where live_revision = ese.evaluation_id)),0)),2) as grade_${grade_id} + +-- , [lc_numeric trunc(evaluation__grade_total_grade(cu.user_id,$grade_id),2)] as grade_$grade_id - , [lc_numeric trunc(evaluation__class_total_grade(cu.user_id,$package_id),2)] as total_grade + , round(coalesce((select sum(ese.grade*et.weight*eg.weight/10000) + from evaluation_grades eg, evaluation_tasks et, evaluation_student_evals ese, acs_objects ao, + cr_items cri1, cr_items cri2, cr_items cri3 + where et.task_item_id = ese.task_item_id + and et.grade_item_id = eg.grade_item_id + and eg.grade_item_id = ao.object_id + and ao.context_id = $package_id + and ese.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN cu.user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = cu.user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = et.task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = et.task_id + ) + and cri1.live_revision = eg.grade_id + and cri2.live_revision = et.task_id + and cri3.live_revision = ese.evaluation_id),0),2) as total_grade +-- , 1 as total_grade +-- , [lc_numeric trunc(evaluation__class_total_grade(cu.user_id,$package_id),2)] as total_grade @@ -65,10 +117,8 @@ cu.user_id $sql_query from cc_users cu, - registered_users ru, dotlrn_member_rels_approved app where app.community_id = :community_id - and app.user_id = ru.user_id and app.user_id = cu.person_id and app.role = 'student' $orderby Index: openacs-4/packages/evaluation/www/admin/grades/grades-type-reports-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/grades-type-reports-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/evaluation/www/admin/grades/grades-type-reports-postgresql.xql 13 Aug 2004 17:09:55 -0000 1.7 +++ openacs-4/packages/evaluation/www/admin/grades/grades-type-reports-postgresql.xql 10 Sep 2004 19:16:32 -0000 1.8 @@ -7,8 +7,8 @@ select et.task_id, et.task_name, et.weight - from evaluation_tasksi et, evaluation_grades eg - where content_revision__is_live(et.task_id) = true + from evaluation_tasksi et, evaluation_grades eg, cr_items cri + where cri.live_revision = et.task_id and eg.grade_id = :grade_id and eg.grade_item_id = et.grade_item_id order by task_name @@ -35,10 +35,8 @@ cu.user_id $sql_query from cc_users cu, - registered_users ru, dotlrn_member_rels_approved app where app.community_id = :community_id - and app.user_id = ru.user_id and app.user_id = cu.person_id and app.role = 'student' $orderby @@ -49,16 +47,67 @@ - , [lc_numeric trunc(evaluation__task_grade(cu.user_id,$task_id),2)] as task_$task_id + , round((select coalesce((select (ese.grade*et.weight*eg.weight)/10000 + from evaluation_student_evals ese, evaluation_tasks et, evaluation_grades eg, + cr_items cri1, cr_items cri2 + where party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN cu.user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = cu.user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = et.task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = et.task_id + ) + and et.task_id = $task_id + and ese.task_item_id = et.task_item_id + and et.grade_item_id = eg.grade_item_id + and cri1.live_revision = ese.evaluation_id + and cri2.live_revision = eg.grade_id),0)),2) as task_${task_id} +-- , [lc_numeric trunc(evaluation__task_grade(cu.user_id,$task_id),2)] as task_$task_id + - , [lc_numeric trunc(evaluation__grade_total_grade(cu.user_id,:grade_id),2)] as total_grade + , round((select coalesce((select sum((ese.grade*et.weight*eg.weight)/10000) + from evaluation_grades eg, evaluation_tasks et, evaluation_student_evals ese + where et.task_item_id = ese.task_item_id + and et.grade_item_id = eg.grade_item_id + and eg.grade_id = $grade_id + and ese.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN cu.user_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = cu.user_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = et.task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = et.task_id + ) + and et.requires_grade_p = 't' + and exists (select 1 from cr_items where live_revision = et.task_id) + and exists (select 1 from cr_items where live_revision = ese.evaluation_id)),0)),2) as total_grade +-- , 1 as total_grade +-- , [lc_numeric trunc(evaluation__grade_total_grade(cu.user_id,:grade_id),2)] as total_grade + Index: openacs-4/packages/evaluation/www/admin/grades/student-grades-report-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/student-grades-report-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/admin/grades/student-grades-report-postgresql.xql 7 Jul 2004 17:26:45 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/grades/student-grades-report-postgresql.xql 10 Sep 2004 19:16:32 -0000 1.3 @@ -8,8 +8,8 @@ select eg.grade_plural_name, eg.grade_id - from evaluation_gradesx eg, acs_objects ao - where content_revision__is_live(eg.grade_id) = true + from evaluation_gradesx eg, acs_objects ao, cr_items cri + where cri.live_revision = eg.grade_id and eg.item_id = ao.object_id and ao.context_id = :package_id order by grade_plural_name desc @@ -32,8 +32,35 @@ - select evaluation__class_total_grade(:student_id,:package_id) + select coalesce(sum((ese.grade*et.weight*eg.weight)/10000),0) as grade + from evaluation_grades eg, evaluation_tasks et, evaluation_student_evals ese, acs_objects ao + where et.task_item_id = ese.task_item_id + and et.grade_item_id = eg.grade_item_id + and eg.grade_item_id = ao.object_id + and ao.context_id = :package_id + and ese.party_id = + ( select + CASE + WHEN et3.number_of_members = 1 THEN :student_id + ELSE + (select etg2.group_id from evaluation_task_groups etg2, + evaluation_tasks et2, + acs_rels map + where map.object_id_one = etg2.group_id + and map.object_id_two = :student_id + and etg2.task_item_id = et2.task_item_id + and et2.task_id = et.task_id) + END as nom + from evaluation_tasks et3 + where et3.task_id = et.task_id + ) + and et.requires_grade_p = 't' + and exists (select 1 from cr_items where live_revision = eg.grade_id) + and exists (select 1 from cr_items where live_revision = et.task_id) + and exists (select 1 from cr_items where live_revision = ese.evaluation_id) +-- select evaluation__class_total_grade(:student_id,:package_id) + Index: openacs-4/packages/evaluation/www/admin/grades/student-grades-report.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/student-grades-report.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/evaluation/www/admin/grades/student-grades-report.adp 15 Jun 2004 23:20:29 -0000 1.1 +++ openacs-4/packages/evaluation/www/admin/grades/student-grades-report.adp 10 Sep 2004 19:16:32 -0000 1.2 @@ -20,7 +20,7 @@ -

    #evaluation.lt_TOTAL_GRADE_total_cla#

    +

    #evaluation.lt_TOTAL_GRADE_total_cla# / @max_possible_grade@

    Index: openacs-4/packages/evaluation/www/admin/grades/student-grades-report.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/grades/student-grades-report.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/admin/grades/student-grades-report.tcl 24 Aug 2004 22:40:33 -0000 1.2 +++ openacs-4/packages/evaluation/www/admin/grades/student-grades-report.tcl 10 Sep 2004 19:16:32 -0000 1.3 @@ -29,5 +29,19 @@ } set total_class_grade [format %.2f [lc_numeric [db_string get_total_grade { *SQL* }]]] +set max_possible_grade [format %.2f [lc_numeric [db_string max_possible_grade { + select sum(et.weight*eg.weight/100) + from evaluation_tasks et, + evaluation_grades eg, + cr_items cri1, + cr_items cri2, + acs_objects ao + where et.grade_item_id = eg.grade_item_id + and cri1.live_revision = eg.grade_id + and cri2.live_revision = et.task_id + and et.requires_grade_p = 't' + and ao.object_id = eg.grade_item_id + and ao.context_id = :package_id +}]]] ad_return_template Index: openacs-4/packages/evaluation/www/admin/groups/group-reuse-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-reuse-2-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/evaluation/www/admin/groups/group-reuse-2-postgresql.xql 30 Jul 2004 22:50:11 -0000 1.3 +++ openacs-4/packages/evaluation/www/admin/groups/group-reuse-2-postgresql.xql 10 Sep 2004 19:16:32 -0000 1.4 @@ -6,9 +6,11 @@ - select count(*) - from evaluation_task_groups etg, evaluation_tasks et - where etg.task_item_id = et.task_item_id + select count(*) + from evaluation_task_groups etg, evaluation_tasks et, acs_rels map + where etg.task_item_id = et.task_item_id + and map.rel_type = 'evaluation_task_group_rel' + and map.object_id_one = etg.group_id and et.task_id = :task_id @@ -44,14 +46,23 @@ null, 'evaluation_task_group_rel', :new_evaluation_group_id, - map.object_id_two, + :new_member_id, :package_id, :creation_user_id, :creation_ip - ) - from acs_rels map where map.object_id_one = :from_evaluation_group_id; + );
    + + + + select map.object_id_two as new_member_id + from acs_rels map + where map.object_id_one = :from_evaluation_group_id + + + + Index: openacs-4/packages/evaluation/www/admin/groups/group-reuse-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-reuse-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/evaluation/www/admin/groups/group-reuse-2.tcl 30 Jul 2004 22:50:11 -0000 1.3 +++ openacs-4/packages/evaluation/www/admin/groups/group-reuse-2.tcl 10 Sep 2004 19:16:32 -0000 1.4 @@ -31,7 +31,9 @@ evaluation::new_evaluation_group -group_id $new_evaluation_group_id -group_name $group_name -task_item_id $task_item_id -context $package_id - db_exec_plsql evaluation_relationship_new { *SQL* } + db_foreach from_rel { *SQL* } { + db_exec_plsql evaluation_relationship_new { *SQL* } + } } } on_error { Index: openacs-4/packages/evaluation/www/admin/groups/group-reuse-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-reuse-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/evaluation/www/admin/groups/group-reuse-postgresql.xql 30 Jul 2004 22:50:11 -0000 1.4 +++ openacs-4/packages/evaluation/www/admin/groups/group-reuse-postgresql.xql 10 Sep 2004 19:16:32 -0000 1.5 @@ -9,12 +9,13 @@ select et.task_name, et.number_of_members, et.task_id as from_task_id, eg.grade_plural_name - from evaluation_tasksi et, evaluation_gradesi eg - where content_revision__is_live(et.task_id) = true - and et.number_of_members > 1 + from evaluation_tasks et, evaluation_grades eg, acs_objects ao, cr_items cri1, cr_items cri2 + where et.number_of_members > 1 and et.grade_item_id = eg.grade_item_id - and content_revision__is_live(eg.grade_id) = true - and content_revision__is_live(et.task_id) = true + and cri1.live_revision = eg.grade_id + and cri2.live_revision = et.task_id + and ao.object_id = eg.grade_item_id + and ao.context_id = :package_id and et.task_id <> :task_id $orderby Index: openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl 10 Jun 2004 21:08:54 -0000 1.5 +++ openacs-4/packages/evaluation/www/admin/groups/group-reuse.tcl 10 Sep 2004 19:16:32 -0000 1.6 @@ -11,6 +11,7 @@ {orderby:optional} } +set package_id [ad_conn package_id] set page_title "[_ evaluation.Reuse_Groups_]" set context [list [list "[export_vars -base one-task { task_id }]" "[_ evaluation.Task_Groups_]"] "[_ evaluation.Reuse_Groups_]"] Index: openacs-4/packages/evaluation/www/admin/groups/one-task.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/one-task.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/evaluation/www/admin/groups/one-task.adp 30 Jul 2004 22:50:11 -0000 1.6 +++ openacs-4/packages/evaluation/www/admin/groups/one-task.adp 10 Sep 2004 19:16:32 -0000 1.7 @@ -15,7 +15,7 @@ @reuse_link;noquote@ -
    Index: openacs-4/packages/evaluation/www/admin/groups/one-task.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/groups/one-task.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/evaluation/www/admin/groups/one-task.xql 30 Aug 2004 11:31:24 -0000 1.6 +++ openacs-4/packages/evaluation/www/admin/groups/one-task.xql 10 Sep 2004 19:16:32 -0000 1.7 @@ -90,115 +90,14 @@ - select count(*) from evaluation_task_groups etg, evaluation_tasks et - where et.task_id = :task_id - and et.task_item_id = etg.task_item_id - and etg.task_item_id = :task_item_id + select count(*) + from evaluation_task_groups etg, evaluation_tasks et, acs_rels map + where etg.task_item_id = et.task_item_id + and map.rel_type = 'evaluation_task_group_rel' + and map.object_id_one = etg.group_id + and et.task_id = :task_id - - - - postgresql7.3 - - - - - select task_name, number_of_members from evaluation_tasks where task_id = :task_id - - - - - - - - select task_name, number_of_members as n_of_members, task_item_id from evaluation_tasks where task_id = :task_id - - - - - - - - select p.last_name ||', '|| p.first_names as student_name, - p.person_id as student_id - from cc_users p - where p.person_id not in (select map.object_id_two from acs_rels map, evaluation_task_groups etg, evaluation_tasks et - where map.object_id_two = p.person_id - and map.object_id_one = etg.group_id - and etg.task_item_id = :task_item_id - and etg.task_item_id = et.task_item_id - and et.task_id = :task_id - and map.rel_type = 'evaluation_task_group_rel') - $orderby - - - - - - - - select p.last_name ||', '|| p.first_names as student_name, - p.person_id as student_id - from cc_users p, - registered_users ru, - dotlrn_member_rels_approved app - where p.person_id not in (select map.object_id_two from acs_rels map, evaluation_task_groups etg, evaluation_tasks et - where map.object_id_two = p.person_id - and map.object_id_one = etg.group_id - and etg.task_item_id = :task_item_id - and etg.task_item_id = et.task_item_id - and et.task_id = :task_id - and map.rel_type = 'evaluation_task_group_rel') - and app.community_id = :community_id - and app.user_id = ru.user_id - and app.user_id = p.person_id - and app.role = 'student' - $orderby - - - - - - - - select g.group_id as evaluation_group_id, g.group_name, - count(map.object_id_two) as number_of_members - from groups g, evaluation_task_groups etg, evaluation_tasks et, - acs_rels map - where g.group_id = etg.group_id - and etg.group_id = map.object_id_one - and map.rel_type = 'evaluation_task_group_rel' - and etg.task_item_id = :task_item_id - and et.task_id = :task_id - group by g.group_id, g.group_name - $orderby_groups - - - - - - - - select p.last_name||', '||p.first_names from cc_users p, acs_rels map - where p.person_id = map.object_id_two - and map.object_id_one = :evaluation_group_id - - - - - - - - select count(*) from evaluation_task_groups etg, evaluation_tasks et - where et.task_id = :task_id - and et.task_item_id = etg.task_item_id - and etg.task_item_id = :task_item_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.9 -r1.10 --- openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl 24 Aug 2004 22:40:33 -0000 1.9 +++ openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.tcl 10 Sep 2004 19:16:33 -0000 1.10 @@ -42,7 +42,7 @@ db_1row get_sol_info { *SQL* } - if { [string eq $storage_type "lob"] } { + if { [string eq $storage_type "lob"] || [string eq $storage_type "file"] } { if { [string eq $solution_mode "edit"] } { set attached_p "t" @@ -184,7 +184,12 @@ set title [template::util::file::get_property filename $upload_file] set mime_type [cr_filename_to_mime_type -create $title] - set storage_type lob + + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { + set storage_type file + } else { + set storage_type lob + } } elseif { ![string eq $url "http://"] } { set mime_type "text/plain" @@ -210,19 +215,28 @@ if { ![empty_string_p $upload_file] } { set tmp_file [template::util::file::get_property tmp_filename $upload_file] - - # create the new item - db_dml lob_content { *SQL* } -blob_files [list $tmp_file] - set content_length [file size $tmp_file] - # Unfortunately, we can only calculate the file size after the lob is uploaded - db_dml lob_size { *SQL* } + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { + # create the new item + + set filename [cr_create_content_file $item_id $revision_id $tmp_file] + db_dml set_file_content { *SQL* } + + } else { + + # 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* } + } + } elseif { ![string eq $url "http://"] } { db_dml link_content { *SQL* } set content_length [string length $url] - db_dml lob_size { *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.4 -r1.5 --- openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.xql 12 Aug 2004 17:46:42 -0000 1.4 +++ openacs-4/packages/evaluation/www/admin/tasks/solution-add-edit.xql 10 Sep 2004 19:16:33 -0000 1.5 @@ -1,7 +1,6 @@ - postgresql7.3 @@ -24,6 +23,28 @@ + + + + update cr_revisions + set content_length = :content_length + where revision_id = :revision_id + + + + + + + + update cr_revisions + set content = :filename, + mime_type = :mime_type, + content_length = :content_length + where revision_id = :revision_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.8 -r1.9 --- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-postgresql.xql 17 Aug 2004 01:10:53 -0000 1.8 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit-postgresql.xql 10 Sep 2004 19:16:33 -0000 1.9 @@ -79,6 +79,16 @@ + + + + update cr_revisions + set content_length = :content_length + where revision_id = :revision_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.16 -r1.17 --- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 17 Aug 2004 01:10:54 -0000 1.16 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 10 Sep 2004 19:16:33 -0000 1.17 @@ -56,7 +56,7 @@ db_1row get_task_info { *SQL* } - if { [string eq $storage_type "lob"] } { + if { [string eq $storage_type "lob"] || [string eq $storage_type "file"] } { if { [string eq $mode "edit"] } { set attached_p "t" @@ -268,6 +268,10 @@ { [string eq [format %.2f $weight] 0.00] || ([empty_string_p $weight] && [string eq $requires_grade_p f]) || (($weight > 0) && ([string eq [format %.2f $net_value] 0.00] || [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]} + } } -new_data { evaluation::notification::do_notification -task_id $revision_id -package_id [ad_conn package_id] -edit_p 0 -notif_type one_assignment_notif @@ -299,7 +303,11 @@ set title [template::util::file::get_property filename $upload_file] set mime_type [cr_filename_to_mime_type -create $title] - set storage_type lob + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { + set storage_type file + } else { + set storage_type lob + } } elseif { ![string eq $url "http://"] } { set mime_type "text/plain" set title "link" @@ -328,25 +336,54 @@ if { ![empty_string_p $upload_file] } { set tmp_file [template::util::file::get_property tmp_filename $upload_file] - - # create the new item - db_dml lob_content { *SQL* } -blob_files [list $tmp_file] - set content_length [file size $tmp_file] - # Unfortunately, we can only calculate the file size after the lob is uploaded - db_dml lob_size { *SQL* } + if { [parameter::get -parameter "StoreFilesInDatabaseP" -package_id [ad_conn package_id]] } { + # create the new item + + set filename [cr_create_content_file $item_id $revision_id $tmp_file] + db_dml set_file_content { *SQL* } + + } else { + # 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* } + } + } elseif { ![string eq $url "http://"] } { db_dml link_content { *SQL* } set content_length [string length $url] - db_dml lob_size { *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 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 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 $due_date -end_date $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 -end_date $due_date -name "[_ evaluation.Due_date_task_name]" -description $desc_url -calendar_id $calendar_id + } + } } -after_submit { set redirect_to_groups_p 0 Index: openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.tcl 30 Jul 2004 22:50:11 -0000 1.3 +++ openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.tcl 10 Sep 2004 19:16:33 -0000 1.4 @@ -8,24 +8,33 @@ @cvs-id $Id$ } { task_id:integer,notnull - grade_id:integer,notnull - operation - return_url + grade_id:integer,notnull + operation + return_url } if { [string eq $operation [_ evaluation.lt_Yes_I_really_want_to__3]] } { + db_transaction { - db_exec_plsql delete_task { *SQL* } - + # calendar integration (begin) + db_1row get_item_id { *SQL* } + db_foreach cal_map { *SQL* } { + db_dml delete_mapping { *SQL* } + calendar::item::delete -cal_item_id $cal_item_id + } + # calendar integration (end) + + db_exec_plsql delete_task { *SQL* } + } on_error { - ad_return_error "[_ evaluation.lt_Error_deleting_the_ta]" "[_ evaluation.lt_We_got_the_following__2]" - ad_script_abort + ad_return_error "[_ evaluation.lt_Error_deleting_the_ta]" "[_ evaluation.lt_We_got_the_following__2]" + ad_script_abort } } else { if { [empty_string_p $return_url] } { - # redirect to the index page by default - set return_url "$return_url" + # redirect to the index page by default + set return_url "$return_url" } } Index: openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/evaluation/www/admin/tasks/task-delete-2.xql 10 Sep 2004 19:16:33 -0000 1.1 @@ -0,0 +1,34 @@ + + + + + + + + + select task_item_id + from evaluation_tasks + where task_id = :task_id + + + + + + + + select cal_item_id + from evaluation_cal_task_map + where task_item_id = :task_item_id + + + + + + + + delete from evaluation_cal_task_map where cal_item_id = :cal_item_id + + + + + Index: openacs-4/packages/evaluation/www/view/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/view/index.vuh,v diff -u -r1.3 -r1.4 --- openacs-4/packages/evaluation/www/view/index.vuh 14 Jul 2004 17:42:07 -0000 1.3 +++ openacs-4/packages/evaluation/www/view/index.vuh 10 Sep 2004 19:16:34 -0000 1.4 @@ -22,7 +22,7 @@ set template_root "" # Serve the page -ns_log Notice "url $the_url the_root $content_root !!\n" + if { [content::init the_url the_root $content_root $template_root public $revision_id $content_type] } { set file "$the_root/$the_url" rp_internal_redirect -absolute_path $file