use of org.olat.course.nodes.gta.model.TaskImpl in project OpenOLAT by OpenOLAT.
the class GTAManagerImpl method createTask.
@Override
public TaskImpl createTask(String taskName, TaskList taskList, TaskProcess status, BusinessGroup assessedGroup, Identity assessedIdentity, GTACourseNode cNode) {
TaskImpl task = new TaskImpl();
Date creationDate = new Date();
task.setCreationDate(creationDate);
task.setLastModified(creationDate);
task.setTaskList(taskList);
task.setTaskName(taskName);
// assignment is ok -> go to submit step
task.setTaskStatus(status);
task.setRevisionLoop(0);
if (status == TaskProcess.graded) {
task.setGraduationDate(new Date());
}
if (GTAType.group.name().equals(cNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
task.setBusinessGroup(assessedGroup);
} else {
task.setIdentity(assessedIdentity);
}
return task;
}
use of org.olat.course.nodes.gta.model.TaskImpl in project OpenOLAT by OpenOLAT.
the class GTAManagerImpl method submitRevisions.
@Override
public Task submitRevisions(Task task, GTACourseNode cNode, int numOfDocs, Role by) {
TaskImpl taskImpl = (TaskImpl) task;
taskImpl.setSubmissionRevisionsDate(new Date());
taskImpl.setSubmissionRevisionsNumOfDocs(numOfDocs);
// log the date
createAndPersistTaskRevisionDate(taskImpl, taskImpl.getRevisionLoop(), TaskProcess.correction);
return updateTask(taskImpl, TaskProcess.correction, cNode, by);
}
use of org.olat.course.nodes.gta.model.TaskImpl in project OpenOLAT by OpenOLAT.
the class GTAManagerImpl method nextStep.
@Override
public Task nextStep(Task task, GTACourseNode cNode, Role by) {
TaskImpl taskImpl = (TaskImpl) task;
TaskProcess currentStep = taskImpl.getTaskStatus();
// cascade through the possible steps
TaskProcess nextStep = nextStep(currentStep, cNode);
taskImpl.setTaskStatus(nextStep);
TaskImpl mergedTask = dbInstance.getCurrentEntityManager().merge(taskImpl);
// make the thing definitiv
dbInstance.commit();
syncAssessmentEntry(mergedTask, cNode, by);
return mergedTask;
}
use of org.olat.course.nodes.gta.model.TaskImpl in project OpenOLAT by OpenOLAT.
the class GTAManagerImpl method resetTask.
@Override
public Task resetTask(Task task, GTACourseNode cNode, CourseEnvironment courseEnv) {
TaskImpl taskImpl = (TaskImpl) task;
taskImpl.setTaskName(null);
taskImpl.setAllowResetDate(null);
Task updatedTask = updateTask(task, TaskProcess.assignment, cNode, Role.user);
File submissionDir = null;
if (updatedTask.getBusinessGroup() != null) {
submissionDir = getSubmitDirectory(courseEnv, cNode, updatedTask.getBusinessGroup());
} else if (updatedTask.getIdentity() != null) {
submissionDir = getSubmitDirectory(courseEnv, cNode, updatedTask.getIdentity());
}
if (submissionDir != null) {
FileUtils.deleteDirsAndFiles(submissionDir, true, false);
}
return updatedTask;
}
use of org.olat.course.nodes.gta.model.TaskImpl in project OpenOLAT by OpenOLAT.
the class GTAManagerImpl method resetTaskRefused.
@Override
public Task resetTaskRefused(Task task, GTACourseNode cNode) {
TaskImpl taskImpl = (TaskImpl) task;
taskImpl.setAllowResetDate(null);
taskImpl.setAllowResetIdentity(null);
return updateTask(task, task.getTaskStatus(), cNode, Role.user);
}
Aggregations