Search in sources :

Example 1 with TaskMultiUserEvent

use of org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent in project OpenOLAT by OpenOLAT.

the class GTAParticipantController method doSubmitDocuments.

private void doSubmitDocuments(UserRequest ureq, Task task) {
    int numOfDocs = getNumberOfSubmittedDocuments();
    task = gtaManager.submitTask(task, gtaNode, numOfDocs, Role.user);
    showInfo("run.documents.successfully.submitted");
    TaskMultiUserEvent event = new TaskMultiUserEvent(TaskMultiUserEvent.SUMBIT_TASK, assessedIdentity, assessedGroup, getIdentity());
    CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, taskListEventResource);
    gtaManager.log("Submit", "submit documents", task, getIdentity(), assessedIdentity, assessedGroup, courseEnv, gtaNode);
    cleanUpProcess();
    process(ureq);
    doUpdateAttempts();
    // do send e-mail
    if (config.getBooleanSafe(GTACourseNode.GTASK_SUBMISSION_MAIL_CONFIRMATION)) {
        doSubmissionEmail();
    }
}
Also used : TaskMultiUserEvent(org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent)

Example 2 with TaskMultiUserEvent

use of org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent in project openolat by klemens.

the class GTACoachRevisionAndCorrectionsController method doCollect.

private void doCollect() {
    assignedTask = gtaManager.updateTask(assignedTask, TaskProcess.correction, gtaNode, Role.coach);
    gtaManager.log("Collect revision", "revision collected", assignedTask, getIdentity(), assessedIdentity, assessedGroup, courseEnv, gtaNode);
    ICourse course = CourseFactory.loadCourse(courseEnv.getCourseResourceableId());
    if (businessGroupTask) {
        List<Identity> identities = businessGroupService.getMembers(assessedGroup, GroupRoles.participant.name());
        for (Identity identity : identities) {
            UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(identity, course);
            gtaNode.incrementUserAttempts(userCourseEnv, Role.coach);
        }
    } else {
        gtaNode.incrementUserAttempts(assessedUserCourseEnv, Role.coach);
    }
    TaskMultiUserEvent event = new TaskMultiUserEvent(TaskMultiUserEvent.SUBMIT_REVISION, assessedGroup == null ? getIdentity() : null, assessedGroup, getIdentity());
    CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, taskListEventResource);
}
Also used : UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) TaskMultiUserEvent(org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent) ICourse(org.olat.course.ICourse) Identity(org.olat.core.id.Identity)

Example 3 with TaskMultiUserEvent

use of org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent in project openolat by klemens.

the class GTAParticipantController method doSubmitDocuments.

private void doSubmitDocuments(UserRequest ureq, Task task) {
    int numOfDocs = getNumberOfSubmittedDocuments();
    task = gtaManager.submitTask(task, gtaNode, numOfDocs, Role.user);
    showInfo("run.documents.successfully.submitted");
    TaskMultiUserEvent event = new TaskMultiUserEvent(TaskMultiUserEvent.SUMBIT_TASK, assessedIdentity, assessedGroup, getIdentity());
    CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, taskListEventResource);
    gtaManager.log("Submit", "submit documents", task, getIdentity(), assessedIdentity, assessedGroup, courseEnv, gtaNode);
    cleanUpProcess();
    process(ureq);
    doUpdateAttempts();
    // do send e-mail
    if (config.getBooleanSafe(GTACourseNode.GTASK_SUBMISSION_MAIL_CONFIRMATION)) {
        doSubmissionEmail();
    }
}
Also used : TaskMultiUserEvent(org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent)

Example 4 with TaskMultiUserEvent

use of org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent in project OpenOLAT by OpenOLAT.

the class GTACoachController method doCollectTask.

private void doCollectTask(UserRequest ureq, Task task) {
    File[] submittedDocuments;
    if (GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) {
        File documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup);
        submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
    } else {
        File documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedIdentity);
        submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
    }
    int numOfDocs = submittedDocuments == null ? 0 : submittedDocuments.length;
    task = gtaManager.collectTask(task, gtaNode, numOfDocs);
    showInfo("run.documents.successfully.submitted");
    TaskMultiUserEvent event = new TaskMultiUserEvent(TaskMultiUserEvent.SUMBIT_TASK, assessedIdentity, assessedGroup, getIdentity());
    CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, taskListEventResource);
    gtaManager.log("Collect", "collect documents", task, getIdentity(), assessedIdentity, assessedGroup, courseEnv, gtaNode);
    cleanUpProcess();
    process(ureq);
    doUpdateAttempts();
}
Also used : SystemFilenameFilter(org.olat.core.util.io.SystemFilenameFilter) TaskMultiUserEvent(org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent) File(java.io.File)

Example 5 with TaskMultiUserEvent

use of org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent in project OpenOLAT by OpenOLAT.

the class GTACoachRevisionAndCorrectionsController method doCollect.

private void doCollect() {
    assignedTask = gtaManager.updateTask(assignedTask, TaskProcess.correction, gtaNode, Role.coach);
    gtaManager.log("Collect revision", "revision collected", assignedTask, getIdentity(), assessedIdentity, assessedGroup, courseEnv, gtaNode);
    ICourse course = CourseFactory.loadCourse(courseEnv.getCourseResourceableId());
    if (businessGroupTask) {
        List<Identity> identities = businessGroupService.getMembers(assessedGroup, GroupRoles.participant.name());
        for (Identity identity : identities) {
            UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(identity, course);
            gtaNode.incrementUserAttempts(userCourseEnv, Role.coach);
        }
    } else {
        gtaNode.incrementUserAttempts(assessedUserCourseEnv, Role.coach);
    }
    TaskMultiUserEvent event = new TaskMultiUserEvent(TaskMultiUserEvent.SUBMIT_REVISION, assessedGroup == null ? getIdentity() : null, assessedGroup, getIdentity());
    CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, taskListEventResource);
}
Also used : UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) TaskMultiUserEvent(org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent) ICourse(org.olat.course.ICourse) Identity(org.olat.core.id.Identity)

Aggregations

TaskMultiUserEvent (org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent)8 File (java.io.File)4 Identity (org.olat.core.id.Identity)4 SystemFilenameFilter (org.olat.core.util.io.SystemFilenameFilter)4 ICourse (org.olat.course.ICourse)4 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)4