From 553549345375b7f5ad260a9c4a197db05b12bbe6 Mon Sep 17 00:00:00 2001 From: srosse <none@none> Date: Wed, 16 Aug 2017 17:14:54 +0200 Subject: [PATCH] OO-2915: wording, prevent double notifications of correction/revisions --- .../nodes/gta/manager/GTANotifications.java | 61 +++++++++++-------- .../gta/ui/_i18n/LocalStrings_en.properties | 4 +- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/src/main/java/org/olat/course/nodes/gta/manager/GTANotifications.java b/src/main/java/org/olat/course/nodes/gta/manager/GTANotifications.java index edfe59d174d..040523079b0 100644 --- a/src/main/java/org/olat/course/nodes/gta/manager/GTANotifications.java +++ b/src/main/java/org/olat/course/nodes/gta/manager/GTANotifications.java @@ -342,7 +342,8 @@ class GTANotifications { } else { name = userManager.getUserDisplayName(assessedIdentity); } - + + boolean sendNotificationDueDate = true; List<TaskRevisionDate> taskRevisions = gtaManager.getTaskRevisions(task); if(!coach && gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_REVIEW_AND_CORRECTION)) { //check task revision 1 @@ -359,19 +360,22 @@ class GTANotifications { } Date correctionDate = getRevisionLoopDate(TaskProcess.revision, 1, taskRevisions); - if(task.getRevisionsDueDate() != null) { - String[] params = new String[] { - task.getTaskName(), - displayName, - formatter.formatDateAndTime(task.getRevisionsDueDate()) - }; - appendSubscriptionItem("notifications.correction.duedate", params, assessedIdentity, correctionDate, coach); - } else { - String[] params = new String[] { - task.getTaskName(), - displayName - }; - appendSubscriptionItem("notifications.correction", params, assessedIdentity, correctionDate, coach); + if(sendNotificationDueDate) { + if(task.getRevisionsDueDate() != null) { + String[] params = new String[] { + task.getTaskName(), + displayName, + formatter.formatDateAndTime(task.getRevisionsDueDate()) + }; + appendSubscriptionItem("notifications.correction.duedate", params, assessedIdentity, correctionDate, coach); + } else { + String[] params = new String[] { + task.getTaskName(), + displayName + }; + appendSubscriptionItem("notifications.correction", params, assessedIdentity, correctionDate, coach); + } + sendNotificationDueDate = false; } File[] corrections = correctionDirectory.listFiles(SystemFileFilter.FILES_ONLY); @@ -454,19 +458,22 @@ class GTANotifications { } Date correctionDate = getRevisionLoopDate(TaskProcess.revision, i, taskRevisions); - if(task.getRevisionsDueDate() != null) { - String[] params = new String[] { - task.getTaskName(), - displayName, - formatter.formatDateAndTime(task.getRevisionsDueDate()) - }; - appendSubscriptionItem("notifications.correction.duedate", params, assessedIdentity, correctionDate, coach); - } else { - String[] params = new String[] { - task.getTaskName(), - displayName - }; - appendSubscriptionItem("notifications.correction", params, assessedIdentity, correctionDate, coach); + if(sendNotificationDueDate) { + if(task.getRevisionsDueDate() != null) { + String[] params = new String[] { + task.getTaskName(), + displayName, + formatter.formatDateAndTime(task.getRevisionsDueDate()) + }; + appendSubscriptionItem("notifications.correction.duedate", params, assessedIdentity, correctionDate, coach); + } else { + String[] params = new String[] { + task.getTaskName(), + displayName + }; + appendSubscriptionItem("notifications.correction", params, assessedIdentity, correctionDate, coach); + } + sendNotificationDueDate = false; } File[] corrections = correctionDirectory.listFiles(SystemFileFilter.FILES_ONLY); diff --git a/src/main/java/org/olat/course/nodes/gta/ui/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/course/nodes/gta/ui/_i18n/LocalStrings_en.properties index 28585b8dede..5d2be75f0ab 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/course/nodes/gta/ui/_i18n/LocalStrings_en.properties @@ -77,7 +77,7 @@ days.after=days after details=Details document=Submitted documents document.date=Date -document.open.editor=Open editor +document.open.editor=Create document download.task=Download task download.task.infos={0} ({1} MB) duedate.standard=Standard date\: {0} @@ -178,7 +178,7 @@ process.correction=Correction process.correction.explanation=The coach is reviewing the revised documents. process.graded=Graded process.grading=Grading -process.grading.explanation=The coach is grading. +process.grading.explanation=The coach is grading the task. process.no=Assignment process.no.explanation=The user choose now a task. process.review=Review -- GitLab