Skip to content
Snippets Groups Projects
Commit e092e970 authored by srosse's avatar srosse
Browse files

OO-3715: check submit directory and special message

parent 2b2cc890
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
<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
......@@ -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}.
......
......@@ -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}".
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment