Search in sources :

Example 6 with TaskMultiUserEvent

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

the class GTAParticipantRevisionAndCorrectionsController method doSubmitRevisions.

private void doSubmitRevisions() {
    File[] submittedDocuments;
    int iteration = assignedTask.getRevisionLoop();
    if (GTAType.group.name().equals(gtaNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
        File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, assessedGroup);
        submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
    } else {
        File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, getIdentity());
        submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
    }
    int numOfDocs = submittedDocuments == null ? 0 : submittedDocuments.length;
    assignedTask = gtaManager.submitRevisions(assignedTask, gtaNode, numOfDocs, Role.user);
    gtaManager.log("Revision", "revision submitted", assignedTask, getIdentity(), getIdentity(), assessedGroup, courseEnv, gtaNode);
    TaskMultiUserEvent event = new TaskMultiUserEvent(TaskMultiUserEvent.SUBMIT_REVISION, assessedGroup == null ? getIdentity() : null, assessedGroup, getIdentity());
    CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, taskListEventResource);
    if (businessGroupTask) {
        List<Identity> identities = businessGroupService.getMembers(assessedGroup, GroupRoles.participant.name());
        ICourse course = CourseFactory.loadCourse(courseEnv.getCourseResourceableId());
        for (Identity identity : identities) {
            UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(identity, course);
            gtaNode.incrementUserAttempts(userCourseEnv, Role.user);
        }
    } else {
        gtaNode.incrementUserAttempts(assessedUserCourseEnv, Role.user);
    }
}
Also used : UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) SystemFilenameFilter(org.olat.core.util.io.SystemFilenameFilter) TaskMultiUserEvent(org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent) ICourse(org.olat.course.ICourse) Identity(org.olat.core.id.Identity) File(java.io.File)

Example 7 with TaskMultiUserEvent

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

the class GTAParticipantRevisionAndCorrectionsController method doSubmitRevisions.

private void doSubmitRevisions() {
    File[] submittedDocuments;
    int iteration = assignedTask.getRevisionLoop();
    if (GTAType.group.name().equals(gtaNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
        File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, assessedGroup);
        submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
    } else {
        File documentsDir = gtaManager.getRevisedDocumentsDirectory(courseEnv, gtaNode, iteration, getIdentity());
        submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
    }
    int numOfDocs = submittedDocuments == null ? 0 : submittedDocuments.length;
    assignedTask = gtaManager.submitRevisions(assignedTask, gtaNode, numOfDocs, Role.user);
    gtaManager.log("Revision", "revision submitted", assignedTask, getIdentity(), getIdentity(), assessedGroup, courseEnv, gtaNode);
    TaskMultiUserEvent event = new TaskMultiUserEvent(TaskMultiUserEvent.SUBMIT_REVISION, assessedGroup == null ? getIdentity() : null, assessedGroup, getIdentity());
    CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, taskListEventResource);
    if (businessGroupTask) {
        List<Identity> identities = businessGroupService.getMembers(assessedGroup, GroupRoles.participant.name());
        ICourse course = CourseFactory.loadCourse(courseEnv.getCourseResourceableId());
        for (Identity identity : identities) {
            UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(identity, course);
            gtaNode.incrementUserAttempts(userCourseEnv, Role.user);
        }
    } else {
        gtaNode.incrementUserAttempts(assessedUserCourseEnv, Role.user);
    }
}
Also used : UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) SystemFilenameFilter(org.olat.core.util.io.SystemFilenameFilter) TaskMultiUserEvent(org.olat.course.nodes.gta.ui.events.TaskMultiUserEvent) ICourse(org.olat.course.ICourse) Identity(org.olat.core.id.Identity) File(java.io.File)

Example 8 with TaskMultiUserEvent

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

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)

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