Search in sources :

Example 36 with TaskProcess

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

the class GTAManagerImpl method reviewedTask.

@Override
public Task reviewedTask(Task task, GTACourseNode cNode) {
    TaskProcess solution = nextStep(TaskProcess.correction, cNode);
    TaskImpl taskImpl = (TaskImpl) task;
    taskImpl.setAcceptationDate(new Date());
    return updateTask(taskImpl, solution, cNode, Role.coach);
}
Also used : TaskProcess(org.olat.course.nodes.gta.TaskProcess) TaskImpl(org.olat.course.nodes.gta.model.TaskImpl) Date(java.util.Date) TaskDueDate(org.olat.course.nodes.gta.TaskDueDate) TaskRevisionDate(org.olat.course.nodes.gta.TaskRevisionDate) DueDate(org.olat.course.nodes.gta.model.DueDate)

Example 37 with TaskProcess

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

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)

Example 38 with TaskProcess

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

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

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

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

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

the class GTAAbstractController method process.

protected final void process(UserRequest ureq) {
    Task task;
    if (businessGroupTask) {
        task = gtaManager.getTask(assessedGroup, taskList);
    } else {
        task = gtaManager.getTask(assessedIdentity, taskList);
    }
    if (withSubscription && subsContext != null) {
        contextualSubscriptionCtr = new ContextualSubscriptionController(ureq, getWindowControl(), subsContext, publisherData);
        listenTo(contextualSubscriptionCtr);
        mainVC.put("contextualSubscription", contextualSubscriptionCtr.getInitialComponent());
    }
    boolean assignment = config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT);
    mainVC.contextPut("assignmentEnabled", assignment);
    if (assignment) {
        task = stepAssignment(ureq, task);
    } else if (task == null) {
        TaskProcess firstStep = gtaManager.firstStep(gtaNode);
        task = gtaManager.createTask(null, taskList, firstStep, assessedGroup, assessedIdentity, gtaNode);
    }
    boolean submit = config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT);
    mainVC.contextPut("submitEnabled", submit);
    if (submit) {
        task = stepSubmit(ureq, task);
    } else if (task != null && task.getTaskStatus() == TaskProcess.submit) {
        task = gtaManager.nextStep(task, gtaNode, Role.auto);
    }
    boolean reviewAndCorrection = config.getBooleanSafe(GTACourseNode.GTASK_REVIEW_AND_CORRECTION);
    mainVC.contextPut("reviewAndCorrectionEnabled", reviewAndCorrection);
    if (reviewAndCorrection) {
        task = stepReviewAndCorrection(ureq, task);
    } else if (task != null && task.getTaskStatus() == TaskProcess.review) {
        task = gtaManager.nextStep(task, gtaNode, Role.auto);
    }
    boolean revision = config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD);
    mainVC.contextPut("revisionEnabled", reviewAndCorrection && revision);
    if (reviewAndCorrection && revision) {
        task = stepRevision(ureq, task);
    } else if (task != null && (task.getTaskStatus() == TaskProcess.revision || task.getTaskStatus() == TaskProcess.correction)) {
        task = gtaManager.nextStep(task, gtaNode, Role.auto);
    }
    boolean solution = config.getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION);
    mainVC.contextPut("solutionEnabled", solution);
    if (solution) {
        stepSolution(ureq, task);
    } else if (task != null && task.getTaskStatus() == TaskProcess.solution) {
        task = gtaManager.nextStep(task, gtaNode, Role.auto);
    }
    boolean grading = config.getBooleanSafe(GTACourseNode.GTASK_GRADING);
    mainVC.contextPut("gradingEnabled", grading);
    if (grading) {
        stepGrading(ureq, task);
    } else if (task != null && task.getTaskStatus() == TaskProcess.grading) {
        task = gtaManager.nextStep(task, gtaNode, Role.auto);
    }
    mainVC.contextPut("changelogconfig", courseModule.isDisplayChangeLog());
    resetTask(ureq, task);
    nodeLog();
    collapsedContents(task);
}
Also used : Task(org.olat.course.nodes.gta.Task) ContextualSubscriptionController(org.olat.core.commons.services.notifications.ui.ContextualSubscriptionController) 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