use of org.olat.course.nodes.gta.model.DueDate in project OpenOLAT by OpenOLAT.
the class GTAManagerImpl method getSubmissionDueDate.
@Override
public DueDate getSubmissionDueDate(TaskRef assignedTask, IdentityRef assessedIdentity, BusinessGroup assessedGroup, GTACourseNode cNode, RepositoryEntry courseEntry, boolean withIndividualDueDate) {
DueDate submissionDueDate = null;
Date dueDate = cNode.getModuleConfiguration().getDateValue(GTACourseNode.GTASK_SUBMIT_DEADLINE);
boolean relativeDate = cNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_RELATIVE_DATES);
if ((relativeDate || dueDate != null) && withIndividualDueDate && assignedTask != null && assignedTask.getSubmissionDueDate() != null) {
submissionDueDate = new DueDate(false, assignedTask.getSubmissionDueDate());
} else if (relativeDate) {
int numOfDays = cNode.getModuleConfiguration().getIntegerSafe(GTACourseNode.GTASK_SUBMIT_DEADLINE_RELATIVE, -1);
String relativeTo = cNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_SUBMIT_DEADLINE_RELATIVE_TO);
if (numOfDays >= 0 && StringHelper.containsNonWhitespace(relativeTo)) {
submissionDueDate = getReferenceDate(numOfDays, relativeTo, assignedTask, assessedIdentity, assessedGroup, courseEntry);
}
} else if (dueDate != null) {
submissionDueDate = new DueDate(false, dueDate);
}
return submissionDueDate;
}
use of org.olat.course.nodes.gta.model.DueDate in project OpenOLAT by OpenOLAT.
the class EditMultipleDueDatesController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
ModuleConfiguration config = gtaNode.getModuleConfiguration();
assignmentDueDateEl = uifactory.addDateChooser("assignment.duedate", null, formLayout);
assignmentDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardAssignmentDueDate = gtaManager.getAssignmentDueDate(null, null, null, gtaNode, courseEntry, false);
setDueDateExplanation(assignmentDueDateEl, standardAssignmentDueDate);
assignmentDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT));
submissionDueDateEl = uifactory.addDateChooser("submission.duedate", null, formLayout);
submissionDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardSubmissionDueDate = gtaManager.getSubmissionDueDate(null, null, null, gtaNode, courseEntry, false);
setDueDateExplanation(submissionDueDateEl, standardSubmissionDueDate);
boolean submissionDeadline = config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT);
submissionDueDateEl.setVisible(submissionDeadline);
if (submissionDeadline) {
for (Task task : tasks) {
if (task.getTaskStatus().ordinal() > TaskProcess.submit.ordinal()) {
StaticTextElement warningReopenEl = uifactory.addStaticTextElement("reopen", translate("warning.reopen"), formLayout);
warningReopenEl.setElementCssClass("o_gta_reopen_warning");
warningReopenEl.setLabel(null, null);
break;
}
}
}
revisionDueDateEl = uifactory.addDateChooser("revisions.duedate", null, formLayout);
revisionDueDateEl.setDateChooserTimeEnabled(true);
revisionDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD));
solutionDueDateEl = uifactory.addDateChooser("solution.duedate", null, formLayout);
solutionDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardSolutionDueDate = gtaManager.getSolutionDueDate(null, null, null, gtaNode, courseEntry, false);
setDueDateExplanation(solutionDueDateEl, standardSolutionDueDate);
solutionDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION));
FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
formLayout.add(buttonsCont);
uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
uifactory.addFormSubmitButton("save", buttonsCont);
}
use of org.olat.course.nodes.gta.model.DueDate in project openolat by klemens.
the class GTAParticipantController method setSubmitController.
private void setSubmitController(UserRequest ureq, Task task) {
File documentsDir;
VFSContainer documentsContainer;
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, getIdentity());
documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, getIdentity());
}
DueDate dueDate = getSubmissionDueDate(task);
Date deadline = dueDate == null ? null : dueDate.getDueDate();
int maxDocs = config.getIntegerSafe(GTACourseNode.GTASK_MAX_SUBMITTED_DOCS, -1);
submitDocCtrl = new SubmitDocumentsController(ureq, getWindowControl(), task, documentsDir, documentsContainer, maxDocs, gtaNode, courseEnv, userCourseEnv.isCourseReadOnly(), deadline, "document");
listenTo(submitDocCtrl);
mainVC.put("submitDocs", submitDocCtrl.getInitialComponent());
submitButton = LinkFactory.createCustomLink("run.submit.button", "submit", "run.submit.button", Link.BUTTON, mainVC, this);
submitButton.setElementCssClass("o_sel_course_gta_submit_docs");
submitButton.setCustomEnabledLinkCSS(submitDocCtrl.hasUploadDocuments() ? "btn btn-primary" : "btn btn-default");
submitButton.setIconLeftCSS("o_icon o_icon_submit");
submitButton.setVisible(!userCourseEnv.isCourseReadOnly());
}
use of org.olat.course.nodes.gta.model.DueDate in project openolat by klemens.
the class GTANotifications method checkSubmitStep.
private Task checkSubmitStep(Identity assessedIdentity, BusinessGroup assessedGroup, Task task) {
if (task != null && task.getTaskStatus() == TaskProcess.submit) {
RepositoryEntry re = courseEnv.getCourseGroupManager().getCourseEntry();
DueDate dueDate = gtaManager.getSubmissionDueDate(task, assessedIdentity, assessedGroup, gtaNode, re, true);
if (dueDate != null && dueDate.getDueDate() != null && dueDate.getDueDate().before(new Date())) {
int numOfDocs = getNumberOfSubmittedDocuments(assessedIdentity, assessedGroup);
task = gtaManager.submitTask(task, gtaNode, numOfDocs, Role.auto);
doUpdateAttempts(assessedIdentity, assessedGroup);
}
}
return task;
}
use of org.olat.course.nodes.gta.model.DueDate in project openolat by klemens.
the class EditDueDatesController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
ModuleConfiguration config = gtaNode.getModuleConfiguration();
Date assignmentDueDate = task.getAssignmentDueDate();
assignmentDueDateEl = uifactory.addDateChooser("assignment.duedate", assignmentDueDate, formLayout);
assignmentDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardAssignmentDueDate = gtaManager.getAssignmentDueDate(task, assessedIdentity, assessedGroup, gtaNode, courseEntry, false);
setDueDateExplanation(assignmentDueDateEl, standardAssignmentDueDate);
assignmentDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT));
Date submissionDueDate = task.getSubmissionDueDate();
submissionDueDateEl = uifactory.addDateChooser("submission.duedate", submissionDueDate, formLayout);
submissionDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardSubmissionDueDate = gtaManager.getSubmissionDueDate(task, assessedIdentity, assessedGroup, gtaNode, courseEntry, false);
setDueDateExplanation(submissionDueDateEl, standardSubmissionDueDate);
boolean submissionDeadline = config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT);
submissionDueDateEl.setVisible(submissionDeadline);
if (submissionDeadline && task.getTaskStatus().ordinal() > TaskProcess.submit.ordinal()) {
StaticTextElement warningReopenEl = uifactory.addStaticTextElement("reopen", translate("warning.reopen"), formLayout);
warningReopenEl.setElementCssClass("o_gta_reopen_warning");
warningReopenEl.setLabel(null, null);
}
Date revisionsDueDate = task.getRevisionsDueDate();
revisionDueDateEl = uifactory.addDateChooser("revisions.duedate", revisionsDueDate, formLayout);
revisionDueDateEl.setDateChooserTimeEnabled(true);
revisionDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD));
Date solutionDueDate = task.getSolutionDueDate();
solutionDueDateEl = uifactory.addDateChooser("solution.duedate", solutionDueDate, formLayout);
solutionDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardSolutionDueDate = gtaManager.getSolutionDueDate(task, assessedIdentity, assessedGroup, gtaNode, courseEntry, true);
setDueDateExplanation(solutionDueDateEl, standardSolutionDueDate);
solutionDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION));
FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
formLayout.add(buttonsCont);
uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
uifactory.addFormSubmitButton("save", buttonsCont);
}
Aggregations