Search in sources :

Example 1 with MSCourseNodeRunController

use of org.olat.course.nodes.ms.MSCourseNodeRunController in project OpenOLAT by OpenOLAT.

the class GTAParticipantController method stepGrading.

@Override
protected Task stepGrading(UserRequest ureq, Task assignedTask) {
    assignedTask = super.stepGrading(ureq, assignedTask);
    String infoTextUser = config.getStringValue(MSCourseNode.CONFIG_KEY_INFOTEXT_USER);
    if (StringHelper.containsNonWhitespace(infoTextUser)) {
        mainVC.contextPut("gradingInfoTextUser", StringHelper.xssScan(infoTextUser));
    }
    boolean showGrading = false;
    MSCourseNodeRunController msCtrl = new MSCourseNodeRunController(ureq, getWindowControl(), userCourseEnv, gtaNode, false, false);
    if (msCtrl.hasScore() || msCtrl.hasPassed() || msCtrl.hasComment()) {
        showGrading = true;
    } else if (config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT) || config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT) || config.getBooleanSafe(GTACourseNode.GTASK_REVIEW_AND_CORRECTION) || config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD) || config.getBooleanSafe(GTACourseNode.GTASK_GRADING)) {
        if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.assignment || assignedTask.getTaskStatus() == TaskProcess.submit || assignedTask.getTaskStatus() == TaskProcess.review || assignedTask.getTaskStatus() == TaskProcess.correction || assignedTask.getTaskStatus() == TaskProcess.revision || assignedTask.getTaskStatus() == TaskProcess.solution) {
            mainVC.contextPut("gradingCssClass", "");
        } else if (assignedTask.getTaskStatus() == TaskProcess.graded || assignedTask.getTaskStatus() == TaskProcess.grading) {
            showGrading = true;
        }
    } else if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.graded || assignedTask.getTaskStatus() == TaskProcess.grading) {
        showGrading = true;
    }
    if (showGrading) {
        gradingCtrl = msCtrl;
        listenTo(gradingCtrl);
        if (assignedTask != null && assignedTask.getTaskStatus() == TaskProcess.graded) {
            mainVC.contextPut("gradingCssClass", "o_done");
        } else {
            mainVC.contextPut("gradingCssClass", "o_active");
        }
        mainVC.put("grading", gradingCtrl.getInitialComponent());
        stepPreferences.setGrading(Boolean.TRUE);
    }
    return assignedTask;
}
Also used : MSCourseNodeRunController(org.olat.course.nodes.ms.MSCourseNodeRunController)

Example 2 with MSCourseNodeRunController

use of org.olat.course.nodes.ms.MSCourseNodeRunController in project openolat by klemens.

the class MSCourseNode method createNodeRunConstructionResult.

/**
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation)
 */
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    Controller controller;
    // Do not allow guests to have manual scoring
    Roles roles = ureq.getUserSession().getRoles();
    if (roles.isGuestOnly()) {
        Translator trans = Util.createPackageTranslator(MSCourseNode.class, ureq.getLocale());
        String title = trans.translate("guestnoaccess.title");
        String message = trans.translate("guestnoaccess.message");
        controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
    } else {
        controller = new MSCourseNodeRunController(ureq, wControl, userCourseEnv, this, true, true);
    }
    Controller wrappedCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_ms_icon");
    return new NodeRunConstructionResult(wrappedCtrl);
}
Also used : MSCourseNodeRunController(org.olat.course.nodes.ms.MSCourseNodeRunController) PackageTranslator(org.olat.core.gui.translator.PackageTranslator) Translator(org.olat.core.gui.translator.Translator) Roles(org.olat.core.id.Roles) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) MSEditFormController(org.olat.course.nodes.ms.MSEditFormController) AssessmentCourseNodeController(org.olat.course.assessment.ui.tool.AssessmentCourseNodeController) MSIdentityListCourseNodeController(org.olat.course.nodes.ms.MSIdentityListCourseNodeController) MSCourseNodeRunController(org.olat.course.nodes.ms.MSCourseNodeRunController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) MSCourseNodeEditController(org.olat.course.nodes.ms.MSCourseNodeEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 3 with MSCourseNodeRunController

use of org.olat.course.nodes.ms.MSCourseNodeRunController in project openolat by klemens.

the class GTAParticipantController method stepGrading.

@Override
protected Task stepGrading(UserRequest ureq, Task assignedTask) {
    assignedTask = super.stepGrading(ureq, assignedTask);
    String infoTextUser = config.getStringValue(MSCourseNode.CONFIG_KEY_INFOTEXT_USER);
    if (StringHelper.containsNonWhitespace(infoTextUser)) {
        mainVC.contextPut("gradingInfoTextUser", StringHelper.xssScan(infoTextUser));
    }
    boolean showGrading = false;
    MSCourseNodeRunController msCtrl = new MSCourseNodeRunController(ureq, getWindowControl(), userCourseEnv, gtaNode, false, false);
    if (msCtrl.hasScore() || msCtrl.hasPassed() || msCtrl.hasComment()) {
        showGrading = true;
    } else if (config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT) || config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT) || config.getBooleanSafe(GTACourseNode.GTASK_REVIEW_AND_CORRECTION) || config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD) || config.getBooleanSafe(GTACourseNode.GTASK_GRADING)) {
        if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.assignment || assignedTask.getTaskStatus() == TaskProcess.submit || assignedTask.getTaskStatus() == TaskProcess.review || assignedTask.getTaskStatus() == TaskProcess.correction || assignedTask.getTaskStatus() == TaskProcess.revision || assignedTask.getTaskStatus() == TaskProcess.solution) {
            mainVC.contextPut("gradingCssClass", "");
        } else if (assignedTask.getTaskStatus() == TaskProcess.graded || assignedTask.getTaskStatus() == TaskProcess.grading) {
            showGrading = true;
        }
    } else if (assignedTask == null || assignedTask.getTaskStatus() == TaskProcess.graded || assignedTask.getTaskStatus() == TaskProcess.grading) {
        showGrading = true;
    }
    if (showGrading) {
        gradingCtrl = msCtrl;
        listenTo(gradingCtrl);
        if (assignedTask != null && assignedTask.getTaskStatus() == TaskProcess.graded) {
            mainVC.contextPut("gradingCssClass", "o_done");
        } else {
            mainVC.contextPut("gradingCssClass", "o_active");
        }
        mainVC.put("grading", gradingCtrl.getInitialComponent());
        stepPreferences.setGrading(Boolean.TRUE);
    }
    return assignedTask;
}
Also used : MSCourseNodeRunController(org.olat.course.nodes.ms.MSCourseNodeRunController)

Example 4 with MSCourseNodeRunController

use of org.olat.course.nodes.ms.MSCourseNodeRunController in project openolat by klemens.

the class GTACoachedParticipantGradingController method doGraded.

private void doGraded(UserRequest ureq, UserCourseEnvironment assessedUserCourseEnv) {
    removeAsListenerAndDispose(msCtrl);
    msCtrl = new MSCourseNodeRunController(ureq, getWindowControl(), assessedUserCourseEnv, gtaNode, false, false, true);
    listenTo(msCtrl);
    mainVC.put("msrun", msCtrl.getInitialComponent());
    AssessmentEvaluation scoreEval = gtaNode.getUserScoreEvaluation(assessedUserCourseEnv);
    if (scoreEval.getAssessmentStatus() == AssessmentEntryStatus.done) {
        if (assignedTask == null) {
            RepositoryEntry courseEntry = coachCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
            TaskList taskList = gtaManager.createIfNotExists(courseEntry, gtaNode);
            assignedTask = gtaManager.createTask(null, taskList, TaskProcess.graded, null, assessedIdentity, gtaNode);
        } else {
            assignedTask = gtaManager.updateTask(assignedTask, TaskProcess.graded, gtaNode, Role.coach);
        }
        fireEvent(ureq, Event.CHANGED_EVENT);
    }
}
Also used : MSCourseNodeRunController(org.olat.course.nodes.ms.MSCourseNodeRunController) AssessmentEvaluation(org.olat.course.run.scoring.AssessmentEvaluation) TaskList(org.olat.course.nodes.gta.TaskList) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 5 with MSCourseNodeRunController

use of org.olat.course.nodes.ms.MSCourseNodeRunController in project openolat by klemens.

the class GTACoachedParticipantGradingController method setAssessmentDatas.

private void setAssessmentDatas(UserRequest ureq) {
    removeAsListenerAndDispose(msCtrl);
    ICourse course = CourseFactory.loadCourse(courseOres);
    UserCourseEnvironment uce = AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity, course);
    msCtrl = new MSCourseNodeRunController(ureq, getWindowControl(), uce, gtaNode, false, false, true);
    listenTo(msCtrl);
    mainVC.put("msrun", msCtrl.getInitialComponent());
}
Also used : MSCourseNodeRunController(org.olat.course.nodes.ms.MSCourseNodeRunController) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) ICourse(org.olat.course.ICourse)

Aggregations

MSCourseNodeRunController (org.olat.course.nodes.ms.MSCourseNodeRunController)8 Controller (org.olat.core.gui.control.Controller)2 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)2 PackageTranslator (org.olat.core.gui.translator.PackageTranslator)2 Translator (org.olat.core.gui.translator.Translator)2 Roles (org.olat.core.id.Roles)2 ICourse (org.olat.course.ICourse)2 AssessmentCourseNodeController (org.olat.course.assessment.ui.tool.AssessmentCourseNodeController)2 NodeEditController (org.olat.course.editor.NodeEditController)2 TaskList (org.olat.course.nodes.gta.TaskList)2 MSCourseNodeEditController (org.olat.course.nodes.ms.MSCourseNodeEditController)2 MSEditFormController (org.olat.course.nodes.ms.MSEditFormController)2 MSIdentityListCourseNodeController (org.olat.course.nodes.ms.MSIdentityListCourseNodeController)2 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)2 AssessmentEvaluation (org.olat.course.run.scoring.AssessmentEvaluation)2 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2