Index: assignment-api/api/src/java/org/sakaiproject/assignment/api/Assignment.java =================================================================== --- assignment-api/api/src/java/org/sakaiproject/assignment/api/Assignment.java (revisi贸n: 89779) +++ assignment-api/api/src/java/org/sakaiproject/assignment/api/Assignment.java (copia de trabajo) @@ -114,7 +114,11 @@ // send student email notification when the grade is released public static final String ASSIGNMENT_RELEASEGRADE_NOTIFICATION_EACH = "assignment_releasegrade_notification_each"; - /** + public static final String ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_VALUE = "assignment_releasereturn_notification_value"; + public static final String ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_NONE = "assignment_releasereturn_notification_none"; + public static final String ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_EACH = "assignment_releasereturn_notification_each"; + + /** * Access the AssignmentContent of this Assignment. * * @return The Assignment's AssignmentContent. Index: assignment-bundles/assignment_es.properties =================================================================== --- assignment-bundles/assignment_es.properties (revisi贸n: 89779) +++ assignment-bundles/assignment_es.properties (copia de trabajo) @@ -759,8 +759,17 @@ send.submission.releasegrade.email.options= Opciones de correo de env\u00EDos de Notas: send.submission.releasegrade.email.none=No enviar una notificaci\u00F3n por correo al alumno cuando se publique la nota send.submission.releasegrade.email=Enviar una notificaci\u00F3n por correo al alumno cuando se publique la nota + noti.releasegrade.subject.content=Notificaci\u00F3n de publicaci\u00F3n de nota de una tarea noti.releasegrade.text=Su env\u00EDo de la tarea "{0}" ha sido corregido. Por favor, vaya a {1} para ver los detalles. +noti.releaseresubmission.subject.content=Notificaci\u00F3n tarea que permite reenv\u00EDo +noti.releaseresubmission.text=Su tarea "{0}" ha sido corregida y permite reenv\u00EDo(s). Por favor, vaya a {1} para ver los detalles. + ## confirm success grading of submission saved_grading=Los comentarios y/o calificaci\u00F3n han sido guardados. + +send.submission.releasereturn.email.options=Opciones de correo de env\u00EDos de Devoluci\u00F3n de tareas: +send.submission.releasereturn.email.none=No enviar una notificaci\u00F3n por correo al alumno cuando se corrija la tarea y el alumno pueda realizar reenv\u00EDos +send.submission.releasereturn.email=Enviar una notificaci\u00F3n por correo al alumno cuando se corrija la tarea y el alumno pueda realizar reenv\u00EDos + Index: assignment-bundles/assignment.properties =================================================================== --- assignment-bundles/assignment.properties (revisi贸n: 89779) +++ assignment-bundles/assignment.properties (copia de trabajo) @@ -867,4 +867,11 @@ send.submission.releasegrade.email=Send notification email to student when the grade is released noti.releasegrade.subject.content=Email notification for assignment released grade -noti.releasegrade.text=Your submission to assignment "{0}" has been returned. Please go to {1} to view details. \ No newline at end of file +noti.releasegrade.text=Your submission to assignment "{0}" has been returned. Please go to {1} to view details. + +noti.releaseresubmission.subject.content=Email notification for assignment with resubmissions allowed +noti.releaseresubmission.text=Your submission to assignment "{0}" has been corrected and it allows resubmissions. Please go to {1} to view details. + +send.submission.releasereturn.email.options=Released Resubmission Notification Email Options: +send.submission.releasereturn.email.none=Do not send notification email to student when the grade is released and resubmission is available +send.submission.releasereturn.email=Send notification email to student when the grade is released and resubmission is available Index: assignment-bundles/assignment_ca.properties =================================================================== --- assignment-bundles/assignment_ca.properties (revisi贸n: 89779) +++ assignment-bundles/assignment_ca.properties (copia de trabajo) @@ -706,3 +706,11 @@ ## confirm success grading of submission saved_grading=Els comentaris i/o qualificaci\u00F3 ha sigut desat. + +noti.releaseresubmission.subject.content=Notificaci\u00F3 de lliurament de tasca que permet tornar a presentar-la +noti.releaseresubmission.text=El seu enviament de la tasca "{0}" ha sigut lliurat i permet tornar a presentar-la. Per favor, fa鏰 clic a {1} per veure els detalls. + +send.submission.releasereturn.email.options=Configuraci\u00F3 de les notificacions per correu per a la tasca que permet tornar a presentar +send.submission.releasereturn.email.none=No enviar cap notificacio a l'alumne +send.submission.releasereturn.email=Enviar una notificacio a l'alumne al corregir la tasca i es permet tornar a presentar-la. + Index: assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java =================================================================== --- assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java (revisi贸n: 89779) +++ assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java (copia de trabajo) @@ -673,7 +673,8 @@ // name for release grade notification private static final String ASSIGNMENT_RELEASEGRADE_NOTIFICATION = "assignment.releasegrade.notification"; - + private static final String ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION = "assignment.releasereturn.notification"; + /****************************** Upload all screen ***************************/ private static final String UPLOAD_ALL_HAS_SUBMISSION_TEXT = "upload_all_has_submission_text"; private static final String UPLOAD_ALL_HAS_SUBMISSION_ATTACHMENT = "upload_all_has_submission_attachment"; @@ -966,7 +967,7 @@ if (s != null) { context.put("submission", s); - ResourceProperties p = s.getProperties(); + ResourceProperties p = s.getProperties(); if (p.getProperty(ResourceProperties.PROP_SUBMISSION_PREVIOUS_FEEDBACK_TEXT) != null) { context.put("prevFeedbackText", p.getProperty(ResourceProperties.PROP_SUBMISSION_PREVIOUS_FEEDBACK_TEXT)); @@ -1704,6 +1705,9 @@ // release grade notification option putReleaseGradeNotificationOptionIntoContext(state, context); + + // release grade notification option + putReleaseResubmissionNotificationOptionIntoContext(state, context); // the supplement information // model answers @@ -1783,6 +1787,7 @@ // set the notification value using site default to be none: no email will be sent to student when the grade is released state.setAttribute(Assignment.ASSIGNMENT_RELEASEGRADE_NOTIFICATION_VALUE, Assignment.ASSIGNMENT_RELEASEGRADE_NOTIFICATION_NONE); } + // input fields context.put("name_assignment_releasegrade_notification", ASSIGNMENT_RELEASEGRADE_NOTIFICATION); context.put("value_assignment_releasegrade_notification", state.getAttribute(Assignment.ASSIGNMENT_RELEASEGRADE_NOTIFICATION_VALUE)); @@ -1790,6 +1795,28 @@ context.put("value_assignment_releasegrade_notification_none", Assignment.ASSIGNMENT_RELEASEGRADE_NOTIFICATION_NONE); context.put("value_assignment_releasegrade_notification_each", Assignment.ASSIGNMENT_RELEASEGRADE_NOTIFICATION_EACH); } + + + /** + * put the release resubmission grade notification options into context + * @param state + * @param context + */ + private void putReleaseResubmissionNotificationOptionIntoContext(SessionState state, Context context) { + + if (state.getAttribute(Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_VALUE) == null) + { + // set the notification value using site default to be none: no email will be sent to student when the grade is released + state.setAttribute(Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_VALUE, Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_EACH); + } + + // input fields + context.put("name_assignment_releasereturn_notification", ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION); + context.put("value_assignment_releasereturn_notification", state.getAttribute(Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_VALUE)); + // the option values + context.put("value_assignment_releasereturn_notification_none", Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_NONE); + context.put("value_assignment_releasereturn_notification_each", Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_EACH); + } /** * build the instructor view of create a new assignment @@ -4421,6 +4448,14 @@ state.setAttribute(Assignment.ASSIGNMENT_RELEASEGRADE_NOTIFICATION_VALUE, releaseGradeOption); } + + // release resubmission notification option + String releaseResubmissionOption = params.getString(ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION); + if (releaseResubmissionOption != null) + { + state.setAttribute(Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_VALUE, releaseResubmissionOption); + } + // read inputs for supplement items setNewAssignmentParametersSupplementItems(validify, state, params); @@ -5055,6 +5090,11 @@ { aPropertiesEdit.addProperty(Assignment.ASSIGNMENT_RELEASEGRADE_NOTIFICATION_VALUE, (String) state.getAttribute(Assignment.ASSIGNMENT_RELEASEGRADE_NOTIFICATION_VALUE)); } + + if (state.getAttribute(Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_VALUE) != null) + { + aPropertiesEdit.addProperty(Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_VALUE, (String) state.getAttribute(Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_VALUE)); + } // comment the changes to Assignment object commitAssignmentEdit(state, post, ac, a, title, openTime, dueTime, closeTime, enableCloseDate, section, range, groups); Index: assignment-tool/tool/src/webapp/vm/assignment/chef_assignments_instructor_new_edit_assignment.vm =================================================================== --- assignment-tool/tool/src/webapp/vm/assignment/chef_assignments_instructor_new_edit_assignment.vm (revisi贸n: 89779) +++ assignment-tool/tool/src/webapp/vm/assignment/chef_assignments_instructor_new_edit_assignment.vm (copia de trabajo) @@ -683,6 +683,17 @@

+ ## whether to notify student about released grade and resubmission is available +

+ $tlang.getString("send.submission.releasereturn.email.options") +

+

+ + +
+ + +

## attachments

$tlang.getString("gen.addres") Index: assignment-impl/impl/src/java/org/sakaiproject/assignment/impl/BaseAssignmentService.java =================================================================== --- assignment-impl/impl/src/java/org/sakaiproject/assignment/impl/BaseAssignmentService.java (revisi贸n: 89779) +++ assignment-impl/impl/src/java/org/sakaiproject/assignment/impl/BaseAssignmentService.java (copia de trabajo) @@ -1957,6 +1957,7 @@ */ public void commitEdit(AssignmentSubmissionEdit submission) { + String submissionRef = submission.getReference(); // check for closed edit @@ -2022,7 +2023,10 @@ boolean notifyUnenrolled = m_serverConfigurationService.getBoolean("assignment.notify.unenrolled",true); if (notifyUnenrolled){ // if this is releasing grade, depending on the release grade notification setting, send email notification to student - sendGradeReleaseNotification(s.getGradeReleased(), a.getProperties().getProperty(Assignment.ASSIGNMENT_RELEASEGRADE_NOTIFICATION_VALUE), s.getSubmitters(), s); + sendGradeReleaseNotification(s.getGradeReleased(), a.getProperties().getProperty(Assignment.ASSIGNMENT_RELEASEGRADE_NOTIFICATION_VALUE), s.getSubmitters(), s); + if(resubmitNumber!=null) + sendGradeReleaseNotification(s.getGradeReleased(), a.getProperties().getProperty(Assignment.ASSIGNMENT_RELEASERESUBMISSION_NOTIFICATION_VALUE), s.getSubmitters(), s); + }else{ try{ //We must filter submitter to remove unrolled students @@ -2043,10 +2047,16 @@ User[] notifyUsers = new User[ful]; for (int i=0; i getHeaders(String receiverEmail, String submissionOrReleaseGrade) { + List rv = new Vector(); rv.add("MIME-Version: 1.0"); @@ -2238,6 +2258,7 @@ protected List getReleaseGradeHeaders(String receiverEmail) { + List rv = new Vector(); rv.add("MIME-Version: 1.0"); @@ -2259,7 +2280,14 @@ protected String getSubject(String submissionOrReleaseGrade) { - String subject = "submission".equals(submissionOrReleaseGrade)?rb.getString("noti.subject.content"):rb.getString("noti.releasegrade.subject.content"); + String subject = ""; + if("submission".equals(submissionOrReleaseGrade)) + subject = rb.getString("noti.subject.content"); + else if ("releasegrade".equals(submissionOrReleaseGrade)) + subject = rb.getString("noti.releasegrade.subject.content"); + else + subject = rb.getString("noti.releaseresubmission.subject.content"); + return "Subject: " + subject ; } @@ -2290,7 +2318,12 @@ message.append(BOUNDARY_LINE); message.append(htmlHeaders()); message.append(htmlPreamble(submissionOrReleaseGrade)); - message.append("submission".equals(submissionOrReleaseGrade) ? htmlContent(s) : htmlContentReleaseGrade(s)); + if("submission".equals(submissionOrReleaseGrade)) + message.append(htmlContent(s)); + else if ("releasegrade".equals(submissionOrReleaseGrade)) + message.append(htmlContentReleaseGrade(s)); + else + message.append(htmlContentReleaseResubmission(s)); message.append(htmlEnd()); message.append(TERMINATION_LINE); return message.toString(); @@ -2301,7 +2334,14 @@ } protected String plainTextContent(AssignmentSubmission s, String submissionOrReleaseGrade) { - return FormattedText.convertFormattedTextToPlaintext("submission".equals(submissionOrReleaseGrade) ? htmlContent(s) : htmlContentReleaseGrade(s)); + if("submission".equals(submissionOrReleaseGrade)) + return FormattedText.convertFormattedTextToPlaintext(htmlContent(s)); + else if ("releasegrade".equals(submissionOrReleaseGrade)) + return FormattedText.convertFormattedTextToPlaintext(htmlContentReleaseGrade(s)); + else + return FormattedText.convertFormattedTextToPlaintext(htmlContentReleaseResubmission(s)); + +// return FormattedText.convertFormattedTextToPlaintext("submission".equals(submissionOrReleaseGrade) ? htmlContent(s) : htmlContentReleaseGrade(s)); } protected String htmlHeaders() { @@ -2429,10 +2469,42 @@ buffer.append(rb.getString("noti.site.id") + " " + siteId +newline + newline); // notification text buffer.append(rb.getFormattedMessage("noti.releasegrade.text", new String[]{a.getTitle(), siteTitle})); + + return buffer.toString(); + } + private String htmlContentReleaseResubmission(AssignmentSubmission s) + { + + String newline = "
\n"; + Assignment a = s.getAssignment(); + + String context = s.getContext(); + + String siteTitle = ""; + String siteId = ""; + try + { + Site site = SiteService.getSite(context); + siteTitle = site.getTitle(); + siteId = site.getId(); + } + catch (Exception ee) + { + M_log.warn(this + " htmlContentReleaseResubmission(), site id =" + context + " " + ee.getMessage()); + } + + StringBuilder buffer = new StringBuilder(); + // site title and id + buffer.append(rb.getString("noti.site.title") + " " + siteTitle + newline); + buffer.append(rb.getString("noti.site.id") + " " + siteId +newline + newline); + // notification text + buffer.append(rb.getFormattedMessage("noti.releaseresubmission.text", new String[]{a.getTitle(), siteTitle})); + return buffer.toString(); } + /** * Cancel the changes made to a AssignmentSubmissionEdit object, and release the lock. *