Search in sources :

Example 11 with TaskProcess

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

the class GTACoachedParticipantListController method doEditMultipleDueDates.

private void doEditMultipleDueDates(UserRequest ureq, List<CoachedIdentityRow> rows) {
    if (editMultipleDueDatesCtrl != null)
        return;
    if (rows.isEmpty()) {
        showWarning("error.atleast.task");
    } else {
        List<Task> tasks = new ArrayList<>(rows.size());
        RepositoryEntry entry = coachCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
        for (CoachedIdentityRow row : rows) {
            if (row.getTask() == null) {
                TaskProcess firstStep = gtaManager.firstStep(gtaNode);
                TaskList taskList = gtaManager.getTaskList(entry, gtaNode);
                tasks.add(gtaManager.createAndPersistTask(null, taskList, firstStep, null, securityManager.loadIdentityByKey(row.getIdentity().getIdentityKey()), gtaNode));
            } else {
                tasks.add(gtaManager.getTask(row.getTask()));
            }
        }
        editMultipleDueDatesCtrl = new EditMultipleDueDatesController(ureq, getWindowControl(), tasks, gtaNode, entry, courseEnv);
        listenTo(editMultipleDueDatesCtrl);
        String title = translate("duedates.multiple.user");
        cmc = new CloseableModalController(getWindowControl(), "close", editMultipleDueDatesCtrl.getInitialComponent(), true, title, true);
        listenTo(cmc);
        cmc.activate();
    }
}
Also used : Task(org.olat.course.nodes.gta.Task) TaskProcess(org.olat.course.nodes.gta.TaskProcess) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) TaskList(org.olat.course.nodes.gta.TaskList) ArrayList(java.util.ArrayList) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 12 with TaskProcess

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

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 13 with TaskProcess

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

the class ConvertToGTACourseNode method setTaskStatus.

private void setTaskStatus(TaskList taskList, Identity assessedIdentity, TaskProcess current, GTACourseNode gtaNode) {
    TaskProcess process = gtaManager.nextStep(current, gtaNode);
    Task task = gtaManager.getTask(assessedIdentity, taskList);
    if (task == null) {
        gtaManager.createTask(null, taskList, process, null, assessedIdentity, gtaNode);
    } else {
        gtaManager.updateTask(task, process, gtaNode, Role.auto);
    }
}
Also used : Task(org.olat.course.nodes.gta.Task) TaskProcess(org.olat.course.nodes.gta.TaskProcess)

Example 14 with TaskProcess

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

the class GTAAbstractController method collapsedContents.

protected final void collapsedContents(Task currentTask) {
    TaskProcess status = null;
    TaskProcess previousStatus = null;
    if (currentTask != null) {
        status = currentTask.getTaskStatus();
        previousStatus = gtaManager.previousStep(status, gtaNode);
    }
    boolean assignment = Boolean.TRUE.equals(stepPreferences.getAssignement()) || TaskProcess.assignment.equals(status) || TaskProcess.assignment.equals(previousStatus);
    mainVC.contextPut("collapse_assignement", new Boolean(assignment));
    boolean submit = Boolean.TRUE.equals(stepPreferences.getSubmit()) || TaskProcess.submit.equals(status) || TaskProcess.submit.equals(previousStatus);
    mainVC.contextPut("collapse_submit", new Boolean(submit));
    boolean reviewAndCorrection = Boolean.TRUE.equals(stepPreferences.getReviewAndCorrection()) || TaskProcess.review.equals(status) || TaskProcess.review.equals(previousStatus);
    mainVC.contextPut("collapse_reviewAndCorrection", new Boolean(reviewAndCorrection));
    boolean revision = Boolean.TRUE.equals(stepPreferences.getRevision()) || TaskProcess.revision.equals(status) || TaskProcess.revision.equals(previousStatus) || TaskProcess.correction.equals(status) || TaskProcess.correction.equals(previousStatus);
    mainVC.contextPut("collapse_revision", new Boolean(revision));
    boolean solution = Boolean.TRUE.equals(stepPreferences.getSolution()) || TaskProcess.solution.equals(status) || TaskProcess.solution.equals(previousStatus);
    mainVC.contextPut("collapse_solution", new Boolean(solution));
    boolean grading = Boolean.TRUE.equals(stepPreferences.getGrading()) || TaskProcess.grading.equals(status) || TaskProcess.grading.equals(previousStatus);
    mainVC.contextPut("collapse_grading", new Boolean(grading));
}
Also used : TaskProcess(org.olat.course.nodes.gta.TaskProcess)

Example 15 with TaskProcess

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

the class GTACoachController method doBackToSubmission.

private void doBackToSubmission(UserRequest ureq, Task task) {
    // 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);
        cleanUpProcess();
        process(ureq);
    }
}
Also used : TaskProcess(org.olat.course.nodes.gta.TaskProcess)

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