diff --git a/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java b/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java index 2124f15553159c32071ef9abbfdd3cd34e9bb3cf..5fc2b39eb2b76b19079422e6bc116eb801acc61b 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java +++ b/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java @@ -580,14 +580,17 @@ public class GTAParticipantController extends GTAAbstractController implements A DueDate availableDate = getSolutionDueDate(assignedTask); boolean visible = availableDate == null || (availableDate.getDueDate() != null && availableDate.getDueDate().compareTo(new Date()) <= 0); - if(visible) { - boolean show = showSolutions(availableDate); - if(show) { - File documentsDir = gtaManager.getSolutionsDirectory(courseEnv, gtaNode); + + File documentsDir = gtaManager.getSolutionsDirectory(courseEnv, gtaNode); + if(visible && TaskHelper.hasDocuments(documentsDir)) { + if(showSolutions(availableDate)) { VFSContainer documentsContainer = gtaManager.getSolutionsContainer(courseEnv, gtaNode); solutionsCtrl = new DirectoryController(ureq, getWindowControl(), documentsDir, documentsContainer, "run.solutions.description", "bulk.solutions", "solutions"); listenTo(solutionsCtrl); mainVC.put("solutions", solutionsCtrl.getInitialComponent()); + } else { + VelocityContainer waitVC = createVelocityContainer("no_solutions_foryou"); + mainVC.put("solutions", waitVC); } } else { VelocityContainer waitVC = createVelocityContainer("wait_for_solutions"); @@ -605,14 +608,24 @@ public class GTAParticipantController extends GTAAbstractController implements A * @return If the solutions are visible to the user */ private boolean showSolutions(DueDate availableDate) { + boolean optional = gtaNode.isOptional(); - File documentsDir = gtaManager.getSolutionsDirectory(courseEnv, gtaNode); - if(availableDate == null && optional && gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION_VISIBLE_ALL, false) - || TaskHelper.hasDocuments(documentsDir)) { - return true; - } - return ((availableDate != null && (optional || !availableDate.isRelative()) && gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION_VISIBLE_ALL, false)) - || TaskHelper.hasDocuments(documentsDir)); + File submitDirectory; + if(GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) { + submitDirectory = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup); + } else { + submitDirectory = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedIdentity); + } + + boolean show = false; + if(availableDate == null && optional + && (gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION_VISIBLE_ALL, false) || TaskHelper.hasDocuments(submitDirectory))) { + show = true; + } else if((availableDate != null && (optional || !availableDate.isRelative()) + && (gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION_VISIBLE_ALL, false)) || TaskHelper.hasDocuments(submitDirectory))) { + show = true; + } + return show; } @Override diff --git a/src/main/java/org/olat/course/nodes/gta/ui/_content/no_solutions_foryou.html b/src/main/java/org/olat/course/nodes/gta/ui/_content/no_solutions_foryou.html new file mode 100644 index 0000000000000000000000000000000000000000..010618abb24bd562ed5422a06421a6b467b77fa0 --- /dev/null +++ b/src/main/java/org/olat/course/nodes/gta/ui/_content/no_solutions_foryou.html @@ -0,0 +1 @@ +<div class="o_info"><i class="o_icon o_icon-lg o_icon_waiting"> </i> $r.translate("no.solutions.foryou")</div> \ No newline at end of file diff --git a/src/main/java/org/olat/course/nodes/gta/ui/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/course/nodes/gta/ui/_i18n/LocalStrings_de.properties index 2733766e4f739ca4199e48db723dcd2bdf78416d..cf9ac5c6e314e9a52bc0b1310430a8800c89483e 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/course/nodes/gta/ui/_i18n/LocalStrings_de.properties @@ -132,6 +132,7 @@ mailto.group=E-Mail an Gruppe mailto.user=E-Mail an Benutzer max.documents=Max. Anzahl von Dokumenten no.submission=Nicht abgegeben +no.solutions.foryou=Sie d\u00FCrfen keine Musterl\u00F6sung sehen weil Sie kein Dokument abgegeben haben. notifications.accepted=Ihre Aufgabe "{0}" im Kurs "{1}" wurde akzeptiert. notifications.assessment.doc=F\u00FCr die Aufgabe "{0}" im Kurs "{1}" stehen bereit Bewertungsdokumente zum Download\: "{2}". notifications.assessment.passed=F\u00FCr die Aufgabe "{0}" im Kurs "{1}" haben Sie eine Bewertung erhalten. Sie haben {3}. 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 02e36721878db5ba57ab40a31c17e3706ada86c5..bfcb6ac7baa82f57177b565c94a84eb4ff86dc42 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 @@ -131,6 +131,7 @@ mail.confirm.assignment.subject=Assignment mailto.group=Mail to group mailto.user=Mail to user max.documents=Max. number of documents +no.solutions.foryou=You cannot see the sample solutions because you don't upload a document. no.submission=No submission notifications.accepted=Your task "{0}" in the course "{1}" has been accepted. notifications.assessment.doc=You received a grading document for the task "{0}" in the course "{1}"\: "{2}".