use of org.olat.course.nodes.gta.TaskProcess in project openolat by klemens.
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 klemens.
the class SubmissionDateCellRenderer method render.
@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source, URLBuilder ubu, Translator trans) {
Object object = source.getFlexiTableElement().getTableDataModel().getObject(row);
if (object instanceof CoachedElementRow) {
CoachedElementRow ciRow = (CoachedElementRow) object;
TaskProcess status = ciRow.getTaskStatus();
if (status == null || status == TaskProcess.assignment || status == TaskProcess.submit) {
// do nothing
} else {
Date date = ciRow.getSyntheticSubmissionDate();
if (date != null) {
if (ciRow.getHasSubmittedDocuments()) {
target.append(formatter.formatDate(date));
} else {
target.append(translator.translate("no.submission"));
}
}
}
}
}
use of org.olat.course.nodes.gta.TaskProcess in project openolat by klemens.
the class ConvertToGTACourseNode method setTaskStatus.
private void setTaskStatus(TaskList taskList, Identity assessedIdentity, TaskProcess current, GTACourseNode gtaNode) {
TaskProcess process = gtaManager.nextStep(current, gtaNode);
Task task = gtaManager.getTask(assessedIdentity, taskList);
if (task == null) {
gtaManager.createTask(null, taskList, process, null, assessedIdentity, gtaNode);
} else {
gtaManager.updateTask(task, process, gtaNode, Role.auto);
}
}
use of org.olat.course.nodes.gta.TaskProcess in project OpenOLAT by OpenOLAT.
the class GTAAbstractController method collapsedContents.
protected final void collapsedContents(Task currentTask) {
TaskProcess status = null;
TaskProcess previousStatus = null;
if (currentTask != null) {
status = currentTask.getTaskStatus();
previousStatus = gtaManager.previousStep(status, gtaNode);
}
boolean assignment = Boolean.TRUE.equals(stepPreferences.getAssignement()) || TaskProcess.assignment.equals(status) || TaskProcess.assignment.equals(previousStatus);
mainVC.contextPut("collapse_assignement", new Boolean(assignment));
boolean submit = Boolean.TRUE.equals(stepPreferences.getSubmit()) || TaskProcess.submit.equals(status) || TaskProcess.submit.equals(previousStatus);
mainVC.contextPut("collapse_submit", new Boolean(submit));
boolean reviewAndCorrection = Boolean.TRUE.equals(stepPreferences.getReviewAndCorrection()) || TaskProcess.review.equals(status) || TaskProcess.review.equals(previousStatus);
mainVC.contextPut("collapse_reviewAndCorrection", new Boolean(reviewAndCorrection));
boolean revision = Boolean.TRUE.equals(stepPreferences.getRevision()) || TaskProcess.revision.equals(status) || TaskProcess.revision.equals(previousStatus) || TaskProcess.correction.equals(status) || TaskProcess.correction.equals(previousStatus);
mainVC.contextPut("collapse_revision", new Boolean(revision));
boolean solution = Boolean.TRUE.equals(stepPreferences.getSolution()) || TaskProcess.solution.equals(status) || TaskProcess.solution.equals(previousStatus);
mainVC.contextPut("collapse_solution", new Boolean(solution));
boolean grading = Boolean.TRUE.equals(stepPreferences.getGrading()) || TaskProcess.grading.equals(status) || TaskProcess.grading.equals(previousStatus);
mainVC.contextPut("collapse_grading", new Boolean(grading));
}
use of org.olat.course.nodes.gta.TaskProcess in project OpenOLAT by OpenOLAT.
the class GTACoachController method doBackToSubmission.
private void doBackToSubmission(UserRequest ureq, Task task) {
// only submit allowed
TaskProcess submit = gtaManager.previousStep(TaskProcess.review, gtaNode);
if (submit == TaskProcess.submit) {
task = gtaManager.updateTask(task, submit, gtaNode, Role.coach);
gtaManager.log("Back to submission", "revert status of task back to submission", task, getIdentity(), assessedIdentity, assessedGroup, courseEnv, gtaNode);
cleanUpProcess();
process(ureq);
}
}
Aggregations