Search in sources :

Example 1 with BulkAssessmentDatas

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());
}
Also used : ArrayList(java.util.ArrayList) ICourse(org.olat.course.ICourse) Step(org.olat.core.gui.control.generic.wizard.Step) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) Date(java.util.Date) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) BulkAssessmentDatas(org.olat.course.assessment.model.BulkAssessmentDatas) BulkAssessmentFeedback(org.olat.course.assessment.model.BulkAssessmentFeedback) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest)

Example 2 with BulkAssessmentDatas

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());
}
Also used : BulkAssessmentDatas(org.olat.course.assessment.model.BulkAssessmentDatas) BulkAssessmentFeedback(org.olat.course.assessment.model.BulkAssessmentFeedback) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) Step(org.olat.core.gui.control.generic.wizard.Step) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest) Date(java.util.Date)

Example 3 with BulkAssessmentDatas

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);
}
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 4 with BulkAssessmentDatas

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

Example 5 with BulkAssessmentDatas

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());
}
Also used : BulkAssessmentDatas(org.olat.course.assessment.model.BulkAssessmentDatas) BulkAssessmentFeedback(org.olat.course.assessment.model.BulkAssessmentFeedback) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) Step(org.olat.core.gui.control.generic.wizard.Step) WindowControl(org.olat.core.gui.control.WindowControl) StepsRunContext(org.olat.core.gui.control.generic.wizard.StepsRunContext) StepRunnerCallback(org.olat.core.gui.control.generic.wizard.StepRunnerCallback) UserRequest(org.olat.core.gui.UserRequest) Date(java.util.Date)

Aggregations

BulkAssessmentDatas (org.olat.course.assessment.model.BulkAssessmentDatas)14 ArrayList (java.util.ArrayList)6 Date (java.util.Date)6 UserRequest (org.olat.core.gui.UserRequest)6 WindowControl (org.olat.core.gui.control.WindowControl)6 Step (org.olat.core.gui.control.generic.wizard.Step)6 StepRunnerCallback (org.olat.core.gui.control.generic.wizard.StepRunnerCallback)6 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)6 StepsRunContext (org.olat.core.gui.control.generic.wizard.StepsRunContext)6 BulkAssessmentFeedback (org.olat.course.assessment.model.BulkAssessmentFeedback)6 BulkAssessmentRow (org.olat.course.assessment.model.BulkAssessmentRow)6 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)4 HashMap (java.util.HashMap)2 OlatRootFolderImpl (org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl)2 Task (org.olat.core.commons.services.taskexecutor.Task)2 ICourse (org.olat.course.ICourse)2 BulkAssessmentTask (org.olat.course.assessment.manager.BulkAssessmentTask)2 BulkAssessmentColumnSettings (org.olat.course.assessment.model.BulkAssessmentColumnSettings)2