Search in sources :

Example 16 with TaskProcess

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

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

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

the class GTACoachedParticipantListController method doEditDueDate.

private void doEditDueDate(UserRequest ureq, CoachedIdentityRow row) {
    if (editDueDatesCtrl != null)
        return;
    Task task;
    Identity assessedIdentity = securityManager.loadIdentityByKey(row.getIdentity().getIdentityKey());
    RepositoryEntry entry = coachCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    if (row.getTask() == null) {
        TaskProcess firstStep = gtaManager.firstStep(gtaNode);
        TaskList taskList = gtaManager.getTaskList(entry, gtaNode);
        task = gtaManager.createAndPersistTask(null, taskList, firstStep, null, assessedIdentity, gtaNode);
    } else {
        task = gtaManager.getTask(row.getTask());
    }
    editDueDatesCtrl = new EditDueDatesController(ureq, getWindowControl(), task, assessedIdentity, null, gtaNode, entry, courseEnv);
    listenTo(editDueDatesCtrl);
    String fullname = userManager.getUserDisplayName(assessedIdentity);
    String title = translate("duedates.user", new String[] { fullname });
    cmc = new CloseableModalController(getWindowControl(), "close", editDueDatesCtrl.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) RepositoryEntry(org.olat.repository.RepositoryEntry) Identity(org.olat.core.id.Identity)

Example 18 with TaskProcess

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

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

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

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

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

the class GTAManagerImpl method convertToAssessmentEntrystatus.

@Override
public AssessmentEntryStatus convertToAssessmentEntrystatus(Task task, GTACourseNode cNode) {
    TaskProcess status = task.getTaskStatus();
    TaskProcess firstStep = firstStep(cNode);
    AssessmentEntryStatus assessmentStatus;
    if (status == firstStep) {
        assessmentStatus = AssessmentEntryStatus.notStarted;
    } else if (status == TaskProcess.review || status == TaskProcess.correction || status == TaskProcess.grading) {
        assessmentStatus = AssessmentEntryStatus.inReview;
    } else if (status == TaskProcess.graded) {
        assessmentStatus = AssessmentEntryStatus.done;
    } else {
        assessmentStatus = AssessmentEntryStatus.inProgress;
    }
    return assessmentStatus;
}
Also used : TaskProcess(org.olat.course.nodes.gta.TaskProcess) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus)

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