Search in sources :

Example 1 with BulkAssessmentColumnSettings

use of org.olat.course.assessment.model.BulkAssessmentColumnSettings 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);
}
Also used : BulkAssessmentDatas(org.olat.course.assessment.model.BulkAssessmentDatas) BulkAssessmentColumnSettings(org.olat.course.assessment.model.BulkAssessmentColumnSettings) HashMap(java.util.HashMap) BulkAssessmentRow(org.olat.course.assessment.model.BulkAssessmentRow)

Example 2 with BulkAssessmentColumnSettings

use of org.olat.course.assessment.model.BulkAssessmentColumnSettings in project openolat by klemens.

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);
}
Also used : BulkAssessmentDatas(org.olat.course.assessment.model.BulkAssessmentDatas) BulkAssessmentColumnSettings(org.olat.course.assessment.model.BulkAssessmentColumnSettings) HashMap(java.util.HashMap) BulkAssessmentRow(org.olat.course.assessment.model.BulkAssessmentRow)

Aggregations

HashMap (java.util.HashMap)2 BulkAssessmentColumnSettings (org.olat.course.assessment.model.BulkAssessmentColumnSettings)2 BulkAssessmentDatas (org.olat.course.assessment.model.BulkAssessmentDatas)2 BulkAssessmentRow (org.olat.course.assessment.model.BulkAssessmentRow)2