Search in sources :

Example 36 with AssignmentResponse

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

the class GTAAvailableTaskController method doSelect.

private void doSelect(UserRequest ureq, AvailableTask row) {
    String taskName = row.getTaskDef().getFilename();
    File tasksFolder = gtaManager.getTasksDirectory(courseEnv, gtaNode);
    File task = new File(tasksFolder, taskName);
    AssignmentResponse response;
    if (businessGroupTask) {
        response = gtaManager.selectTask(assessedGroup, taskList, gtaNode, task);
    } else {
        response = gtaManager.selectTask(assessedIdentity, taskList, gtaNode, task);
    }
    if (response == null || response.getStatus() == AssignmentResponse.Status.error) {
        showError("task.assignment.error");
    } else if (response.getStatus() == AssignmentResponse.Status.alreadyAssigned) {
        showWarning("task.alreadyChosen");
    } else if (response == null || response.getStatus() == AssignmentResponse.Status.ok) {
        showInfo("task.successfully.assigned");
        fireEvent(ureq, Event.DONE_EVENT);
        gtaManager.log("Assignment", "task assigned", response.getTask(), getIdentity(), assessedIdentity, assessedGroup, courseEnv, gtaNode);
        doSendConfirmationEmail(response.getTask());
    }
}
Also used : AssignmentResponse(org.olat.course.nodes.gta.AssignmentResponse) File(java.io.File)

Aggregations

AssignmentResponse (org.olat.course.nodes.gta.AssignmentResponse)36 File (java.io.File)32 TaskList (org.olat.course.nodes.gta.TaskList)32 Test (org.junit.Test)28 Identity (org.olat.core.id.Identity)28 GTACourseNode (org.olat.course.nodes.GTACourseNode)28 RepositoryEntry (org.olat.repository.RepositoryEntry)28 Task (org.olat.course.nodes.gta.Task)20 BusinessGroup (org.olat.group.BusinessGroup)12 ArrayList (java.util.ArrayList)6 Date (java.util.Date)6 List (java.util.List)6 TaskRevisionDate (org.olat.course.nodes.gta.TaskRevisionDate)6 DueDate (org.olat.course.nodes.gta.model.DueDate)6 Calendar (java.util.Calendar)4 TaskDueDate (org.olat.course.nodes.gta.TaskDueDate)4 TaskProcess (org.olat.course.nodes.gta.TaskProcess)4 TaskImpl (org.olat.course.nodes.gta.model.TaskImpl)4 ReminderRuleImpl (org.olat.modules.reminder.model.ReminderRuleImpl)4