use of org.olat.course.assessment.manager.BulkAssessmentTask in project OpenOLAT by OpenOLAT.
the class BulkAssessmentOverviewController method doEditBulkAssessment.
private void doEditBulkAssessment(UserRequest ureq, TaskData data) {
removeAsListenerAndDispose(bulkAssessmentCtrl);
if (editedTask != null) {
// only for security purpose
taskManager.returnTaskAfterEdition(editedTask, null);
}
AssessableCourseNode courseNode = data.getCourseNode();
final Task editableTask = taskManager.pickTaskForEdition(data.getTask());
editedTask = editableTask;
if (editableTask == null) {
showWarning("task.edited");
} else {
BulkAssessmentTask runnable = taskManager.getPersistedRunnableTask(editableTask, BulkAssessmentTask.class);
BulkAssessmentDatas datas = runnable.getDatas();
Step start = new BulkAssessment_2_DatasStep(ureq, courseNode, datas, editableTask);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
Task task = (Task) runContext.get("task");
Date scheduledDate = (Date) runContext.get("scheduledDate");
AssessableCourseNode assessableCourseNode = (AssessableCourseNode) runContext.get("courseNode");
BulkAssessmentDatas bulkDatas = (BulkAssessmentDatas) runContext.get("datas");
Feedback feedback = doUpdateBulkAssessment(task, assessableCourseNode, scheduledDate, bulkDatas);
runContext.put("feedback", feedback);
editedTask = null;
return StepsMainRunController.DONE_MODIFIED;
}
};
StepRunnerCallback cancel = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
taskManager.returnTaskAfterEdition(editableTask, null);
editedTask = null;
return Step.NOSTEP;
}
};
bulkAssessmentCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, cancel, translate("bulk.wizard.title"), "o_sel_bulk_assessment_wizard");
listenTo(bulkAssessmentCtrl);
getWindowControl().pushAsModalDialog(bulkAssessmentCtrl.getInitialComponent());
}
}
use of org.olat.course.assessment.manager.BulkAssessmentTask in project OpenOLAT by OpenOLAT.
the class BulkAssessmentToolController method doBulkAssessment.
private Feedback doBulkAssessment(Date scheduledDate, BulkAssessmentDatas datas) {
BulkAssessmentTask task = new BulkAssessmentTask(courseOres, courseNode, datas, getIdentity().getKey());
Feedback feedback;
if (scheduledDate == null) {
List<BulkAssessmentFeedback> feedbacks = task.process();
feedback = new Feedback(true, feedbacks);
} else {
taskManager.execute(task, getIdentity(), courseOres, courseNode.getIdent(), scheduledDate);
feedback = new Feedback(false, null);
}
return feedback;
}
use of org.olat.course.assessment.manager.BulkAssessmentTask in project openolat by klemens.
the class BulkAssessmentOverviewController method doUpdateBulkAssessment.
private Feedback doUpdateBulkAssessment(Task task, AssessableCourseNode node, Date scheduledDate, BulkAssessmentDatas datas) {
BulkAssessmentTask runnable = new BulkAssessmentTask(courseEntry.getOlatResource(), node, datas, getIdentity().getKey());
Feedback feedback;
if (scheduledDate == null) {
List<BulkAssessmentFeedback> feedbacks = runnable.process();
feedback = new Feedback(true, feedbacks);
if (task != null) {
taskManager.delete(task);
}
} else {
taskManager.updateAndReturn(task, runnable, getIdentity(), scheduledDate);
feedback = new Feedback(false, null);
}
return feedback;
}
use of org.olat.course.assessment.manager.BulkAssessmentTask in project openolat by klemens.
the class BulkAssessmentOverviewController method doEditBulkAssessment.
private void doEditBulkAssessment(UserRequest ureq, TaskData data) {
removeAsListenerAndDispose(bulkAssessmentCtrl);
if (editedTask != null) {
// only for security purpose
taskManager.returnTaskAfterEdition(editedTask, null);
}
AssessableCourseNode courseNode = data.getCourseNode();
final Task editableTask = taskManager.pickTaskForEdition(data.getTask());
editedTask = editableTask;
if (editableTask == null) {
showWarning("task.edited");
} else {
BulkAssessmentTask runnable = taskManager.getPersistedRunnableTask(editableTask, BulkAssessmentTask.class);
BulkAssessmentDatas datas = runnable.getDatas();
Step start = new BulkAssessment_2_DatasStep(ureq, courseNode, datas, editableTask);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
Task task = (Task) runContext.get("task");
Date scheduledDate = (Date) runContext.get("scheduledDate");
AssessableCourseNode assessableCourseNode = (AssessableCourseNode) runContext.get("courseNode");
BulkAssessmentDatas bulkDatas = (BulkAssessmentDatas) runContext.get("datas");
Feedback feedback = doUpdateBulkAssessment(task, assessableCourseNode, scheduledDate, bulkDatas);
runContext.put("feedback", feedback);
editedTask = null;
return StepsMainRunController.DONE_MODIFIED;
}
};
StepRunnerCallback cancel = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
taskManager.returnTaskAfterEdition(editableTask, null);
editedTask = null;
return Step.NOSTEP;
}
};
bulkAssessmentCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, cancel, translate("bulk.wizard.title"), "o_sel_bulk_assessment_wizard");
listenTo(bulkAssessmentCtrl);
getWindowControl().pushAsModalDialog(bulkAssessmentCtrl.getInitialComponent());
}
}
use of org.olat.course.assessment.manager.BulkAssessmentTask in project openolat by klemens.
the class BulkAssessmentOverviewController method doBulkAssessment.
private Feedback doBulkAssessment(AssessableCourseNode node, Date scheduledDate, BulkAssessmentDatas datas) {
BulkAssessmentTask task = new BulkAssessmentTask(courseEntry.getOlatResource(), node, datas, getIdentity().getKey());
Feedback feedback;
if (scheduledDate == null) {
List<BulkAssessmentFeedback> feedbacks = task.process();
feedback = new Feedback(true, feedbacks);
} else {
taskManager.execute(task, getIdentity(), courseEntry.getOlatResource(), node.getIdent(), scheduledDate);
feedback = new Feedback(false, null);
}
return feedback;
}
Aggregations