use of org.olat.course.assessment.model.BulkAssessmentDatas in project OpenOLAT by OpenOLAT.
the class BulkAssessmentOverviewController method doNewBulkAssessment.
private void doNewBulkAssessment(UserRequest ureq) {
removeAsListenerAndDispose(bulkAssessmentCtrl);
List<AssessableCourseNode> nodes = new ArrayList<>();
ICourse course = CourseFactory.loadCourse(courseEntry);
collectBulkAssessableCourseNode(course.getRunStructure().getRootNode(), nodes);
Step start;
if (nodes.size() > 1) {
start = new BulkAssessment_1_SelectCourseNodeStep(ureq, courseEntry);
} else if (nodes.size() == 1) {
start = new BulkAssessment_2_DatasStep(ureq, nodes.get(0));
} else {
showWarning("bulk.action.no.coursenodes");
return;
}
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
Date scheduledDate = (Date) runContext.get("scheduledDate");
AssessableCourseNode courseNode = (AssessableCourseNode) runContext.get("courseNode");
BulkAssessmentDatas datas = (BulkAssessmentDatas) runContext.get("datas");
Feedback feedback = doBulkAssessment(courseNode, scheduledDate, datas);
runContext.put("feedback", feedback);
return StepsMainRunController.DONE_MODIFIED;
}
};
bulkAssessmentCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("bulk.wizard.title"), "o_sel_bulk_assessment_wizard");
listenTo(bulkAssessmentCtrl);
getWindowControl().pushAsModalDialog(bulkAssessmentCtrl.getInitialComponent());
}
use of org.olat.course.assessment.model.BulkAssessmentDatas in project OpenOLAT by OpenOLAT.
the class BulkAssessmentToolController method doOpen.
private void doOpen(UserRequest ureq) {
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl bwControl, StepsRunContext runContext) {
Date scheduledDate = (Date) runContext.get("scheduledDate");
BulkAssessmentDatas datas = (BulkAssessmentDatas) runContext.get("datas");
Feedback feedback = doBulkAssessment(scheduledDate, datas);
runContext.put("feedback", feedback);
return StepsMainRunController.DONE_MODIFIED;
}
};
Step start = new BulkAssessment_2_DatasStep(ureq, courseNode);
bulkAssessmentCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("bulk.wizard.title"), "o_sel_bulk_assessment_wizard");
listenTo(bulkAssessmentCtrl);
getWindowControl().pushAsModalDialog(bulkAssessmentCtrl.getInitialComponent());
}
use of org.olat.course.assessment.model.BulkAssessmentDatas in project OpenOLAT by OpenOLAT.
the class ChooseColumnsStepForm method formOK.
@Override
protected void formOK(UserRequest ureq) {
BulkAssessmentDatas datas = (BulkAssessmentDatas) getFromRunContext("datas");
List<BulkAssessmentRow> rows = datas.getRows();
Map<String, BulkAssessmentRow> assessedIdToRow = new HashMap<>();
for (BulkAssessmentRow row : rows) {
assessedIdToRow.put(row.getAssessedId(), row);
}
BulkAssessmentColumnSettings settings = datas.getColumnsSettings();
if (settings == null) {
settings = new BulkAssessmentColumnSettings();
datas.setColumnsSettings(settings);
}
settings.setUsernameColumn(getColumnPosition(userNameColumnEl));
settings.setScoreColumn(getColumnPosition(scoreColumnEl));
settings.setPassedColumn(getColumnPosition(passedColumnEl));
settings.setCommentColumn(getColumnPosition(commentColumnEl));
List<String[]> splittedRows = overviewDataModel.getObjects();
for (String[] values : splittedRows) {
createRow(values, settings, rows, assessedIdToRow);
}
fireEvent(ureq, StepsEvent.ACTIVATE_NEXT);
}
use of org.olat.course.assessment.model.BulkAssessmentDatas in project openolat by klemens.
the class ValidationStepForm method doValidate.
private void doValidate() {
BulkAssessmentDatas datas = (BulkAssessmentDatas) getFromRunContext("datas");
if (datas.getRows() != null) {
doValidateRows(datas);
}
flc.contextPut("hasNoItems", Boolean.valueOf(datas.getRows() == null || datas.getRows().size() == 0));
}
use of org.olat.course.assessment.model.BulkAssessmentDatas in project openolat by klemens.
the class BulkAssessmentToolController method doOpen.
private void doOpen(UserRequest ureq) {
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl bwControl, StepsRunContext runContext) {
Date scheduledDate = (Date) runContext.get("scheduledDate");
BulkAssessmentDatas datas = (BulkAssessmentDatas) runContext.get("datas");
Feedback feedback = doBulkAssessment(scheduledDate, datas);
runContext.put("feedback", feedback);
return StepsMainRunController.DONE_MODIFIED;
}
};
Step start = new BulkAssessment_2_DatasStep(ureq, courseNode);
bulkAssessmentCtrl = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("bulk.wizard.title"), "o_sel_bulk_assessment_wizard");
listenTo(bulkAssessmentCtrl);
getWindowControl().pushAsModalDialog(bulkAssessmentCtrl.getInitialComponent());
}
Aggregations