Search in sources :

Example 1 with CompareEvaluationsFormController

use of org.olat.modules.forms.ui.CompareEvaluationsFormController in project OpenOLAT by OpenOLAT.

the class MultiEvaluationFormController method doOpenOverview.

private void doOpenOverview(UserRequest ureq) {
    removeAsListenerAndDispose(compareEvaluationCtrl);
    compareEvaluationCtrl = new CompareEvaluationsFormController(ureq, getWindowControl(), evaluators, anchor, formEntry);
    listenTo(compareEvaluationCtrl);
    mainVC.put("segmentCmp", compareEvaluationCtrl.getInitialComponent());
}
Also used : CompareEvaluationsFormController(org.olat.modules.forms.ui.CompareEvaluationsFormController)

Example 2 with CompareEvaluationsFormController

use of org.olat.modules.forms.ui.CompareEvaluationsFormController in project OpenOLAT by OpenOLAT.

the class MultiEvaluationFormController method initOnePageView.

private void initOnePageView(UserRequest ureq, List<Identity> otherEvaluators, boolean anonym) {
    mainVC = createVelocityContainer("multi_evaluation_one_page");
    List<EvaluatorPanel> panels = new ArrayList<>();
    mainVC.contextPut("panels", panels);
    boolean viewOthers = isViewOthers();
    if (owner != null) {
        String ownerFullname = userManager.getUserDisplayName(owner);
        Evaluator evaluator = new Evaluator(owner, ownerFullname);
        evaluators.add(evaluator);
        boolean me = owner.equals(getIdentity());
        if (me || viewOthers) {
            Controller ctrl = createEvalutationForm(ureq, owner);
            String componentName = "panel_" + (++count);
            panels.add(new EvaluatorPanel(evaluator, componentName, ctrl.getInitialComponent()));
            mainVC.put(componentName, ctrl.getInitialComponent());
        }
    }
    if (otherEvaluators != null && otherEvaluators.size() > 0) {
        int countEva = 1;
        for (Identity evaluator : otherEvaluators) {
            boolean me = evaluator.equals(ureq.getIdentity());
            String evaluatorFullname;
            if (!me && anonym) {
                evaluatorFullname = translate("anonym.evaluator", new String[] { Integer.toString(countEva++) });
            } else {
                evaluatorFullname = userManager.getUserDisplayName(evaluator);
            }
            Evaluator eval = new Evaluator(evaluator, evaluatorFullname);
            evaluators.add(eval);
            if (me || viewOthers) {
                Controller ctrl = createEvalutationForm(ureq, evaluator);
                String componentName = "panel_" + (++count);
                panels.add(new EvaluatorPanel(eval, componentName, ctrl.getInitialComponent()));
                mainVC.put(componentName, ctrl.getInitialComponent());
            }
        }
    }
    if (viewOthers && (owner != null && otherEvaluators != null && otherEvaluators.size() > 0) || (otherEvaluators != null && otherEvaluators.size() > 1)) {
        removeAsListenerAndDispose(compareEvaluationCtrl);
        CompareEvaluationsFormController ctrl = new CompareEvaluationsFormController(ureq, getWindowControl(), evaluators, anchor, formEntry);
        listenTo(ctrl);
        Evaluator eval = new Evaluator(null, translate("compare.evaluations"));
        String componentName = "panel_" + (++count);
        panels.add(new EvaluatorPanel(eval, componentName, ctrl.getInitialComponent()));
        mainVC.put(componentName, ctrl.getInitialComponent());
    }
}
Also used : CompareEvaluationsFormController(org.olat.modules.forms.ui.CompareEvaluationsFormController) ArrayList(java.util.ArrayList) Evaluator(org.olat.modules.forms.ui.model.Evaluator) CompareEvaluationsFormController(org.olat.modules.forms.ui.CompareEvaluationsFormController) Controller(org.olat.core.gui.control.Controller) EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController) BasicController(org.olat.core.gui.control.controller.BasicController) Identity(org.olat.core.id.Identity)

Example 3 with CompareEvaluationsFormController

use of org.olat.modules.forms.ui.CompareEvaluationsFormController in project openolat by klemens.

the class MultiEvaluationFormController method initOnePageView.

private void initOnePageView(UserRequest ureq, List<Identity> otherEvaluators, boolean anonym) {
    mainVC = createVelocityContainer("multi_evaluation_one_page");
    List<EvaluatorPanel> panels = new ArrayList<>();
    mainVC.contextPut("panels", panels);
    boolean viewOthers = isViewOthers();
    if (owner != null) {
        String ownerFullname = userManager.getUserDisplayName(owner);
        Evaluator evaluator = new Evaluator(owner, ownerFullname);
        evaluators.add(evaluator);
        boolean me = owner.equals(getIdentity());
        if (me || viewOthers) {
            Controller ctrl = createEvalutationForm(ureq, owner);
            String componentName = "panel_" + (++count);
            panels.add(new EvaluatorPanel(evaluator, componentName, ctrl.getInitialComponent()));
            mainVC.put(componentName, ctrl.getInitialComponent());
        }
    }
    if (otherEvaluators != null && otherEvaluators.size() > 0) {
        int countEva = 1;
        for (Identity evaluator : otherEvaluators) {
            boolean me = evaluator.equals(ureq.getIdentity());
            String evaluatorFullname;
            if (!me && anonym) {
                evaluatorFullname = translate("anonym.evaluator", new String[] { Integer.toString(countEva++) });
            } else {
                evaluatorFullname = userManager.getUserDisplayName(evaluator);
            }
            Evaluator eval = new Evaluator(evaluator, evaluatorFullname);
            evaluators.add(eval);
            if (me || viewOthers) {
                Controller ctrl = createEvalutationForm(ureq, evaluator);
                String componentName = "panel_" + (++count);
                panels.add(new EvaluatorPanel(eval, componentName, ctrl.getInitialComponent()));
                mainVC.put(componentName, ctrl.getInitialComponent());
            }
        }
    }
    if (viewOthers && (owner != null && otherEvaluators != null && otherEvaluators.size() > 0) || (otherEvaluators != null && otherEvaluators.size() > 1)) {
        removeAsListenerAndDispose(compareEvaluationCtrl);
        CompareEvaluationsFormController ctrl = new CompareEvaluationsFormController(ureq, getWindowControl(), evaluators, anchor, formEntry);
        listenTo(ctrl);
        Evaluator eval = new Evaluator(null, translate("compare.evaluations"));
        String componentName = "panel_" + (++count);
        panels.add(new EvaluatorPanel(eval, componentName, ctrl.getInitialComponent()));
        mainVC.put(componentName, ctrl.getInitialComponent());
    }
}
Also used : CompareEvaluationsFormController(org.olat.modules.forms.ui.CompareEvaluationsFormController) ArrayList(java.util.ArrayList) Evaluator(org.olat.modules.forms.ui.model.Evaluator) CompareEvaluationsFormController(org.olat.modules.forms.ui.CompareEvaluationsFormController) Controller(org.olat.core.gui.control.Controller) EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController) BasicController(org.olat.core.gui.control.controller.BasicController) Identity(org.olat.core.id.Identity)

Example 4 with CompareEvaluationsFormController

use of org.olat.modules.forms.ui.CompareEvaluationsFormController in project openolat by klemens.

the class MultiEvaluationFormController method doOpenOverview.

private void doOpenOverview(UserRequest ureq) {
    removeAsListenerAndDispose(compareEvaluationCtrl);
    compareEvaluationCtrl = new CompareEvaluationsFormController(ureq, getWindowControl(), evaluators, anchor, formEntry);
    listenTo(compareEvaluationCtrl);
    mainVC.put("segmentCmp", compareEvaluationCtrl.getInitialComponent());
}
Also used : CompareEvaluationsFormController(org.olat.modules.forms.ui.CompareEvaluationsFormController)

Aggregations

CompareEvaluationsFormController (org.olat.modules.forms.ui.CompareEvaluationsFormController)4 ArrayList (java.util.ArrayList)2 Controller (org.olat.core.gui.control.Controller)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 Identity (org.olat.core.id.Identity)2 EvaluationFormController (org.olat.modules.forms.ui.EvaluationFormController)2 Evaluator (org.olat.modules.forms.ui.model.Evaluator)2