use of org.olat.core.util.vfs.VFSContainer in project OpenOLAT by OpenOLAT.
the class GTACoachController method stepSolution.
@Override
protected Task stepSolution(UserRequest ureq, Task assignedTask) {
assignedTask = super.stepSolution(ureq, assignedTask);
if (config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT) || config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT) || config.getBooleanSafe(GTACourseNode.GTASK_REVIEW_AND_CORRECTION) || config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD)) {
if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.assignment || assignedTask.getTaskStatus() == TaskProcess.submit || assignedTask.getTaskStatus() == TaskProcess.review || assignedTask.getTaskStatus() == TaskProcess.correction || assignedTask.getTaskStatus() == TaskProcess.revision) {
mainVC.contextPut("solutionCssClass", "");
} else if (assignedTask.getTaskStatus() == TaskProcess.solution) {
mainVC.contextPut("solutionCssClass", "o_active");
} else {
mainVC.contextPut("solutionCssClass", "o_done");
}
} else if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.solution) {
mainVC.contextPut("solutionCssClass", "o_active");
} else {
mainVC.contextPut("solutionCssClass", "o_done");
}
File documentsDir = gtaManager.getSolutionsDirectory(courseEnv, gtaNode);
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());
return assignedTask;
}
use of org.olat.core.util.vfs.VFSContainer in project OpenOLAT by OpenOLAT.
the class GTACoachController method stepSubmit.
@Override
protected Task stepSubmit(UserRequest ureq, Task assignedTask) {
assignedTask = super.stepSubmit(ureq, assignedTask);
if (collectSubmissionsLink != null) {
// clean up
mainVC.remove(collectSubmissionsLink);
}
if (backToSubmissionLink != null) {
mainVC.remove(backToSubmissionLink);
}
// calculate state
boolean viewSubmittedDocument = false;
if (config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT)) {
if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.assignment) {
mainVC.contextPut("submitCssClass", "");
} else if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.submit) {
mainVC.contextPut("submitCssClass", "o_active");
collect(assignedTask);
} else {
mainVC.contextPut("submitCssClass", "o_done");
viewSubmittedDocument = true;
}
} else if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.submit) {
mainVC.contextPut("submitCssClass", "o_active");
collect(assignedTask);
} else {
mainVC.contextPut("submitCssClass", "o_done");
viewSubmittedDocument = true;
}
if (assignedTask == null || (assignedTask.getTaskStatus() != TaskProcess.submit)) {
backToSubmission(assignedTask);
}
if (viewSubmittedDocument) {
File documentsDir;
VFSContainer documentsContainer = null;
if (GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) {
documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup);
documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, assessedGroup);
} else {
documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedIdentity);
documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, assessedIdentity);
}
boolean hasDocuments = TaskHelper.hasDocuments(documentsDir);
if (hasDocuments) {
submittedDocCtrl = new DirectoryController(ureq, getWindowControl(), documentsDir, documentsContainer, "coach.submitted.documents.description", "bulk.submitted.documents", "submission");
listenTo(submittedDocCtrl);
mainVC.put("submittedDocs", submittedDocCtrl.getInitialComponent());
} else {
TextFactory.createTextComponentFromI18nKey("submittedDocs", "coach.submitted.nofiles", getTranslator(), null, true, mainVC);
}
}
return assignedTask;
}
use of org.olat.core.util.vfs.VFSContainer in project OpenOLAT by OpenOLAT.
the class GTACoachController method setUploadCorrections.
private void setUploadCorrections(UserRequest ureq, Task task) {
File documentsDir;
VFSContainer documentsContainer;
if (GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) {
documentsDir = gtaManager.getCorrectionDirectory(courseEnv, gtaNode, assessedGroup);
documentsContainer = gtaManager.getCorrectionContainer(courseEnv, gtaNode, assessedGroup);
} else {
documentsDir = gtaManager.getCorrectionDirectory(courseEnv, gtaNode, assessedIdentity);
documentsContainer = gtaManager.getCorrectionContainer(courseEnv, gtaNode, assessedIdentity);
}
submitCorrectionsCtrl = new SubmitDocumentsController(ureq, getWindowControl(), task, documentsDir, documentsContainer, -1, gtaNode, courseEnv, coachCourseEnv.isCourseReadOnly(), null, "coach.document");
listenTo(submitCorrectionsCtrl);
mainVC.put("corrections", submitCorrectionsCtrl.getInitialComponent());
reviewedButton.setVisible(!coachCourseEnv.isCourseReadOnly());
if (config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD)) {
needRevisionsButton.setVisible(!coachCourseEnv.isCourseReadOnly());
}
}
use of org.olat.core.util.vfs.VFSContainer in project OpenOLAT by OpenOLAT.
the class GTACoachController method setCorrections.
private void setCorrections(UserRequest ureq, boolean hasRevisions) {
File documentsDir;
VFSContainer documentsContainer;
if (GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) {
documentsDir = gtaManager.getCorrectionDirectory(courseEnv, gtaNode, assessedGroup);
documentsContainer = gtaManager.getCorrectionContainer(courseEnv, gtaNode, assessedGroup);
} else {
documentsDir = gtaManager.getCorrectionDirectory(courseEnv, gtaNode, assessedIdentity);
documentsContainer = gtaManager.getCorrectionContainer(courseEnv, gtaNode, assessedIdentity);
}
boolean hasDocuments = TaskHelper.hasDocuments(documentsDir);
if (hasDocuments) {
correctionsCtrl = new DirectoryController(ureq, getWindowControl(), documentsDir, documentsContainer, "coach.corrections.description", "bulk.review", "review");
listenTo(correctionsCtrl);
mainVC.put("corrections", correctionsCtrl.getInitialComponent());
} else if (hasRevisions) {
String msg = "<i class='o_icon o_icon_warn'> </i> " + translate("coach.corrections.rejected");
TextFactory.createTextComponentFromString("corrections", msg, null, true, mainVC);
} else {
String msg = "<i class='o_icon o_icon_ok'> </i> " + translate("coach.corrections.closed");
TextFactory.createTextComponentFromString("corrections", msg, null, true, mainVC);
}
}
use of org.olat.core.util.vfs.VFSContainer in project OpenOLAT by OpenOLAT.
the class GTACoachRevisionAndCorrectionsController method doConfirmCollect.
private void doConfirmCollect(UserRequest ureq) {
String toName = null;
if (assessedGroup != null) {
toName = assessedGroup.getName();
} else if (assessedIdentity != null) {
toName = userManager.getUserDisplayName(assessedIdentity);
}
File[] submittedDocuments;
VFSContainer documentsContainer;
int iteration = assignedTask.getRevisionLoop();
if (GTAType.group.name().equals(gtaNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
documentsContainer = gtaManager.getRevisedDocumentsContainer(courseEnv, gtaNode, iteration, assessedGroup);
File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, assessedGroup);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
} else {
documentsContainer = gtaManager.getRevisedDocumentsContainer(courseEnv, gtaNode, iteration, getIdentity());
File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, getIdentity());
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
}
FilesLocked lockedBy = TaskHelper.getDocumentsLocked(documentsContainer, submittedDocuments);
if (lockedBy != null) {
showWarning("warning.submit.documents.edited", new String[] { lockedBy.getLockedBy(), lockedBy.getLockedFiles() });
} else {
String title = translate("coach.collect.revisions.confirm.title");
String text = translate("coach.collect.revisions.confirm.text", new String[] { toName });
text = "<div class='o_warning'>" + text + "</div>";
confirmCollectCtrl = activateOkCancelDialog(ureq, title, text, confirmCollectCtrl);
listenTo(confirmCollectCtrl);
}
}
Aggregations