Search in sources :

Example 1 with BulkAssessmentTask

use of org.olat.course.assessment.manager.BulkAssessmentTask in project OpenOLAT by OpenOLAT.

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

Example 2 with BulkAssessmentTask

use of org.olat.course.assessment.manager.BulkAssessmentTask in project OpenOLAT by OpenOLAT.

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

Example 3 with BulkAssessmentTask

use of org.olat.course.assessment.manager.BulkAssessmentTask in project openolat by klemens.

the class BulkAssessmentOverviewController method reloadTaskModel.

private void reloadTaskModel() {
    List<Task> tasks = taskManager.getTasks(courseEntry.getOlatResource());
    List<TaskData> taskDatas = new ArrayList<TaskData>(tasks.size());
    ICourse course = CourseFactory.loadCourse(courseEntry);
    Structure structure = course.getRunStructure();
    for (Task task : tasks) {
        String fullName = null;
        if (task.getCreator() != null) {
            fullName = userManager.getUserDisplayName(task.getCreator());
        }
        BulkAssessmentTask runnable = taskManager.getPersistedRunnableTask(task, BulkAssessmentTask.class);
        AssessableCourseNode courseNode = (AssessableCourseNode) structure.getNode(runnable.getCourseNodeIdent());
        taskDatas.add(new TaskData(task, runnable, courseNode, fullName));
    }
    taskModel.setObjects(taskDatas);
    taskListEl.reset();
    flc.contextPut("hasScheduledTasks", Boolean.valueOf(taskDatas.size() > 0));
}
Also used : AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) Task(org.olat.core.commons.services.taskexecutor.Task) BulkAssessmentTask(org.olat.course.assessment.manager.BulkAssessmentTask) ArrayList(java.util.ArrayList) ICourse(org.olat.course.ICourse) BulkAssessmentTask(org.olat.course.assessment.manager.BulkAssessmentTask) Structure(org.olat.course.Structure)

Example 4 with BulkAssessmentTask

use of org.olat.course.assessment.manager.BulkAssessmentTask in project openolat by klemens.

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

Example 5 with BulkAssessmentTask

use of org.olat.course.assessment.manager.BulkAssessmentTask in project OpenOLAT by OpenOLAT.

the class BulkAssessmentOverviewController method reloadTaskModel.

private void reloadTaskModel() {
    List<Task> tasks = taskManager.getTasks(courseEntry.getOlatResource());
    List<TaskData> taskDatas = new ArrayList<TaskData>(tasks.size());
    ICourse course = CourseFactory.loadCourse(courseEntry);
    Structure structure = course.getRunStructure();
    for (Task task : tasks) {
        String fullName = null;
        if (task.getCreator() != null) {
            fullName = userManager.getUserDisplayName(task.getCreator());
        }
        BulkAssessmentTask runnable = taskManager.getPersistedRunnableTask(task, BulkAssessmentTask.class);
        AssessableCourseNode courseNode = (AssessableCourseNode) structure.getNode(runnable.getCourseNodeIdent());
        taskDatas.add(new TaskData(task, runnable, courseNode, fullName));
    }
    taskModel.setObjects(taskDatas);
    taskListEl.reset();
    flc.contextPut("hasScheduledTasks", Boolean.valueOf(taskDatas.size() > 0));
}
Also used : AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) Task(org.olat.core.commons.services.taskexecutor.Task) BulkAssessmentTask(org.olat.course.assessment.manager.BulkAssessmentTask) ArrayList(java.util.ArrayList) ICourse(org.olat.course.ICourse) BulkAssessmentTask(org.olat.course.assessment.manager.BulkAssessmentTask) Structure(org.olat.course.Structure)

Aggregations

BulkAssessmentTask (org.olat.course.assessment.manager.BulkAssessmentTask)10 BulkAssessmentFeedback (org.olat.course.assessment.model.BulkAssessmentFeedback)8 Task (org.olat.core.commons.services.taskexecutor.Task)4 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)4 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 UserRequest (org.olat.core.gui.UserRequest)2 WindowControl (org.olat.core.gui.control.WindowControl)2 Step (org.olat.core.gui.control.generic.wizard.Step)2 StepRunnerCallback (org.olat.core.gui.control.generic.wizard.StepRunnerCallback)2 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)2 StepsRunContext (org.olat.core.gui.control.generic.wizard.StepsRunContext)2 ICourse (org.olat.course.ICourse)2 Structure (org.olat.course.Structure)2 BulkAssessmentDatas (org.olat.course.assessment.model.BulkAssessmentDatas)2