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();
}
}
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();
}
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);
}
}
}
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);
}
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;
}
Aggregations