Search in sources :

Example 26 with DueDate

use of org.olat.course.nodes.gta.model.DueDate in project OpenOLAT by OpenOLAT.

the class GTAAbstractController method stepSolution.

protected Task stepSolution(@SuppressWarnings("unused") UserRequest ureq, Task assignedTask) {
    DueDate availableDate = getSolutionDueDate(assignedTask);
    if (availableDate != null) {
        if (availableDate.getDueDate() != null) {
            String date = formatDueDate(availableDate, false);
            mainVC.contextPut("solutionAvailableDate", date);
            mainVC.contextRemove("solutionAvailableDateMsg");
        } else if (availableDate.getMessageKey() != null) {
            mainVC.contextPut("solutionAvailableDateMsg", translate(availableDate.getMessageKey(), availableDate.getMessageArg()));
            mainVC.contextRemove("solutionAvailableDate");
        }
    }
    return assignedTask;
}
Also used : DueDate(org.olat.course.nodes.gta.model.DueDate)

Example 27 with DueDate

use of org.olat.course.nodes.gta.model.DueDate in project OpenOLAT by OpenOLAT.

the class GTAAbstractController method stepRevision.

protected Task stepRevision(@SuppressWarnings("unused") UserRequest ureq, Task assignedTask) {
    if (assignedTask != null && assignedTask.getRevisionsDueDate() != null) {
        Date date = assignedTask.getRevisionsDueDate();
        String dateAsString = formatDueDate(new DueDate(false, date), false);
        mainVC.contextPut("revisionDueDate", dateAsString);
        if (assignedTask != null && assignedTask.getTaskStatus() == TaskProcess.revision && date.compareTo(new Date()) < 0) {
            // push to the next step
            int numOfDocs = getNumberOfRevisionDocuments(assignedTask);
            assignedTask = gtaManager.submitRevisions(assignedTask, gtaNode, numOfDocs, Role.auto);
            doUpdateAttempts();
        }
    }
    return assignedTask;
}
Also used : DueDate(org.olat.course.nodes.gta.model.DueDate) Date(java.util.Date) DueDate(org.olat.course.nodes.gta.model.DueDate)

Example 28 with DueDate

use of org.olat.course.nodes.gta.model.DueDate in project OpenOLAT by OpenOLAT.

the class GTAAbstractController method stepAssignment.

protected Task stepAssignment(@SuppressWarnings("unused") UserRequest ureq, Task assignedTask) {
    DueDate dueDate = getAssignementDueDate(assignedTask);
    if (dueDate != null) {
        if (dueDate.getDueDate() != null) {
            Date date = dueDate.getDueDate();
            String dateAsString = formatDueDate(dueDate, true);
            mainVC.contextPut("assignmentDueDate", dateAsString);
            mainVC.contextRemove("assignmentDueDateMsg");
            if (assignedTask != null && StringHelper.containsNonWhitespace(assignedTask.getTaskName()) && assignedTask.getTaskStatus() == TaskProcess.assignment && date.compareTo(new Date()) < 0) {
                // push to the next step if the task is blocked in assignment (it's a security)
                assignedTask = gtaManager.nextStep(assignedTask, gtaNode, Role.auto);
            }
        } else if (dueDate.getMessageKey() != null) {
            mainVC.contextPut("assignmentDueDateMsg", translate(dueDate.getMessageKey(), dueDate.getMessageArg()));
            mainVC.contextRemove("assignmentDueDate");
        }
    }
    return assignedTask;
}
Also used : DueDate(org.olat.course.nodes.gta.model.DueDate) Date(java.util.Date) DueDate(org.olat.course.nodes.gta.model.DueDate)

Example 29 with DueDate

use of org.olat.course.nodes.gta.model.DueDate in project OpenOLAT by OpenOLAT.

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;
}
Also used : RepositoryEntry(org.olat.repository.RepositoryEntry) DueDate(org.olat.course.nodes.gta.model.DueDate) Date(java.util.Date) TaskRevisionDate(org.olat.course.nodes.gta.TaskRevisionDate) DueDate(org.olat.course.nodes.gta.model.DueDate)

Example 30 with DueDate

use of org.olat.course.nodes.gta.model.DueDate in project OpenOLAT by OpenOLAT.

the class GTACoachController method collect.

private void collect(Task assignedTask) {
    DueDate dueDate = getSubmissionDueDate(assignedTask);
    if (!coachCourseEnv.isCourseReadOnly() && (dueDate == null || dueDate.getDueDate() == null)) {
        collectSubmissionsLink = LinkFactory.createButton("coach.collect.task", mainVC, this);
        collectSubmissionsLink.setUserObject(assignedTask);
    }
}
Also used : DueDate(org.olat.course.nodes.gta.model.DueDate)

Aggregations

DueDate (org.olat.course.nodes.gta.model.DueDate)44 Date (java.util.Date)38 TaskRevisionDate (org.olat.course.nodes.gta.TaskRevisionDate)14 TaskDueDate (org.olat.course.nodes.gta.TaskDueDate)12 RepositoryEntry (org.olat.repository.RepositoryEntry)10 File (java.io.File)6 VFSContainer (org.olat.core.util.vfs.VFSContainer)6 ArrayList (java.util.ArrayList)4 Calendar (java.util.Calendar)4 HashMap (java.util.HashMap)4 StaticTextElement (org.olat.core.gui.components.form.flexible.elements.StaticTextElement)4 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)4 TaskLight (org.olat.course.nodes.gta.TaskLight)4 ModuleConfiguration (org.olat.modules.ModuleConfiguration)4 BigDecimal (java.math.BigDecimal)2 List (java.util.List)2 IdentityRef (org.olat.basesecurity.IdentityRef)2 IdentityRefImpl (org.olat.basesecurity.model.IdentityRefImpl)2 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)2 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)2