Search in sources :

Example 26 with TaskProcess

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

the class GTAParticipantRevisionAndCorrectionsController method initRevisionProcess.

private void initRevisionProcess(UserRequest ureq) {
    List<String> revisionStepNames = new ArrayList<>();
    mainVC.contextPut("previousRevisions", revisionStepNames);
    if (assignedTask.getRevisionLoop() > 1) {
        for (int i = 1; i < assignedTask.getRevisionLoop(); i++) {
            // revisions
            setRevisionIteration(ureq, i, revisionStepNames);
        }
    }
    TaskProcess status = assignedTask.getTaskStatus();
    if (status == TaskProcess.revision) {
        // assessed user can return some revised documents
        setUploadRevision(ureq, assignedTask);
    } else if (status == TaskProcess.correction) {
        // coach can return some corrections
        setRevision(ureq, "revisions", assignedTask.getRevisionLoop());
        setCorrections(ureq, "corrections", assignedTask.getRevisionLoop());
    } else {
        int lastRevision = assignedTask.getRevisionLoop();
        setRevisionIteration(ureq, lastRevision, revisionStepNames);
    }
}
Also used : TaskProcess(org.olat.course.nodes.gta.TaskProcess) ArrayList(java.util.ArrayList)

Example 27 with TaskProcess

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

the class EditDueDatesController method formOK.

@Override
protected void formOK(UserRequest ureq) {
    TaskDueDate dueDates = gtaManager.getDueDatesTask(task);
    dueDates.setAssignmentDueDate(assignmentDueDateEl.getDate());
    dueDates.setSubmissionDueDate(submissionDueDateEl.getDate());
    dueDates.setRevisionsDueDate(revisionDueDateEl.getDate());
    dueDates.setSolutionDueDate(solutionDueDateEl.getDate());
    dueDates = gtaManager.updateTaskDueDate(dueDates);
    if (task.getTaskStatus().ordinal() > TaskProcess.submit.ordinal() && dueDates.getSubmissionDueDate() != null && dueDates.getSubmissionDueDate().after(ureq.getRequestTimestamp())) {
        // only submit allowed
        TaskProcess submit = gtaManager.previousStep(TaskProcess.review, gtaNode);
        if (submit == TaskProcess.submit) {
            task = gtaManager.updateTask(task, submit, gtaNode, Role.coach);
            gtaManager.log("Back to submission", "revert status of task back to submission", task, getIdentity(), assessedIdentity, assessedGroup, courseEnv, gtaNode);
        }
    }
    fireEvent(ureq, Event.DONE_EVENT);
}
Also used : TaskDueDate(org.olat.course.nodes.gta.TaskDueDate) TaskProcess(org.olat.course.nodes.gta.TaskProcess)

Example 28 with TaskProcess

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

the class SubmissionDateCellRenderer method render.

@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source, URLBuilder ubu, Translator trans) {
    Object object = source.getFlexiTableElement().getTableDataModel().getObject(row);
    if (object instanceof CoachedElementRow) {
        CoachedElementRow ciRow = (CoachedElementRow) object;
        TaskProcess status = ciRow.getTaskStatus();
        if (status == null || status == TaskProcess.assignment || status == TaskProcess.submit) {
        // do nothing
        } else {
            Date date = ciRow.getSyntheticSubmissionDate();
            if (date != null) {
                if (ciRow.getHasSubmittedDocuments()) {
                    target.append(formatter.formatDate(date));
                } else {
                    target.append(translator.translate("no.submission"));
                }
            }
        }
    }
}
Also used : TaskProcess(org.olat.course.nodes.gta.TaskProcess) CoachedElementRow(org.olat.course.nodes.gta.ui.CoachedElementRow) Date(java.util.Date)

Example 29 with TaskProcess

use of org.olat.course.nodes.gta.TaskProcess in project openolat by klemens.

the class GTAParticipantController method setRevisionsAndCorrections.

private void setRevisionsAndCorrections(UserRequest ureq, Task task) {
    if (task.getRevisionLoop() > 0) {
        revisionDocumentsCtrl = new GTAParticipantRevisionAndCorrectionsController(ureq, getWindowControl(), userCourseEnv, task, gtaNode, assessedGroup, taskListEventResource);
        listenTo(revisionDocumentsCtrl);
        mainVC.put("revisionDocs", revisionDocumentsCtrl.getInitialComponent());
        String msg = null;
        if (task.getTaskStatus() == TaskProcess.revision) {
        // message about rejected work is displayed in GTAParticipantRevisionAndCorrectionsController
        } else if (task.getTaskStatus() == TaskProcess.correction) {
            msg = "<i class='o_icon o_icon_info'> </i> " + translate("run.review.waiting");
        } else {
            msg = "<i class='o_icon o_icon_ok'> </i> " + translate("run.review.closed");
        }
        mainVC.contextPut("revisionMessage", msg);
    } else {
        TaskProcess status = task.getTaskStatus();
        if (status == TaskProcess.solution || status == TaskProcess.grading || status == TaskProcess.graded) {
            mainVC.contextPut("skipRevisions", Boolean.TRUE);
        }
    }
}
Also used : TaskProcess(org.olat.course.nodes.gta.TaskProcess)

Example 30 with TaskProcess

use of org.olat.course.nodes.gta.TaskProcess in project openolat by klemens.

the class GTAParticipantRevisionAndCorrectionsController method initRevisionProcess.

private void initRevisionProcess(UserRequest ureq) {
    List<String> revisionStepNames = new ArrayList<>();
    mainVC.contextPut("previousRevisions", revisionStepNames);
    if (assignedTask.getRevisionLoop() > 1) {
        for (int i = 1; i < assignedTask.getRevisionLoop(); i++) {
            // revisions
            setRevisionIteration(ureq, i, revisionStepNames);
        }
    }
    TaskProcess status = assignedTask.getTaskStatus();
    if (status == TaskProcess.revision) {
        // assessed user can return some revised documents
        setUploadRevision(ureq, assignedTask);
    } else if (status == TaskProcess.correction) {
        // coach can return some corrections
        setRevision(ureq, "revisions", assignedTask.getRevisionLoop());
        setCorrections(ureq, "corrections", assignedTask.getRevisionLoop());
    } else {
        int lastRevision = assignedTask.getRevisionLoop();
        setRevisionIteration(ureq, lastRevision, revisionStepNames);
    }
}
Also used : TaskProcess(org.olat.course.nodes.gta.TaskProcess) ArrayList(java.util.ArrayList)

Aggregations

TaskProcess (org.olat.course.nodes.gta.TaskProcess)40 Task (org.olat.course.nodes.gta.Task)16 TaskDueDate (org.olat.course.nodes.gta.TaskDueDate)14 Date (java.util.Date)12 TaskImpl (org.olat.course.nodes.gta.model.TaskImpl)12 TaskList (org.olat.course.nodes.gta.TaskList)10 TaskRevisionDate (org.olat.course.nodes.gta.TaskRevisionDate)10 DueDate (org.olat.course.nodes.gta.model.DueDate)10 ArrayList (java.util.ArrayList)6 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)6 RepositoryEntry (org.olat.repository.RepositoryEntry)6 AssignmentResponse (org.olat.course.nodes.gta.AssignmentResponse)4 File (java.io.File)2 ContextualSubscriptionController (org.olat.core.commons.services.notifications.ui.ContextualSubscriptionController)2 Identity (org.olat.core.id.Identity)2 CoachedElementRow (org.olat.course.nodes.gta.ui.CoachedElementRow)2 BusinessGroup (org.olat.group.BusinessGroup)2 AssessmentEntryStatus (org.olat.modules.assessment.model.AssessmentEntryStatus)2