Search in sources :

Example 1 with EvaluationFormController

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

the class EvaluationFormHandler method getController.

private Controller getController(UserRequest ureq, WindowControl wControl, PageBody body, EvaluationFormPart eva) {
    PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
    Controller ctrl = null;
    Page page = portfolioService.getPageByBody(body);
    List<AccessRights> accessRights = portfolioService.getAccessRights(page);
    if (hasRole(PortfolioRoles.owner, ureq.getIdentity(), accessRights)) {
        ctrl = new EvaluationFormController(ureq, wControl, ureq.getIdentity(), body, eva.getContent(), false);
    } else if (hasRole(PortfolioRoles.coach, ureq.getIdentity(), accessRights)) {
        Identity owner = getOwner(accessRights);
        ctrl = new EvaluationFormController(ureq, wControl, owner, body, eva.getContent(), true);
    } else if (hasRole(PortfolioRoles.reviewer, ureq.getIdentity(), accessRights) || hasRole(PortfolioRoles.invitee, ureq.getIdentity(), accessRights)) {
        Identity owner = getOwner(accessRights);
        ctrl = new EvaluationFormController(ureq, wControl, owner, body, eva.getContent(), true);
    }
    return ctrl;
}
Also used : AccessRights(org.olat.modules.portfolio.model.AccessRights) MultiEvaluationFormController(org.olat.modules.portfolio.ui.MultiEvaluationFormController) EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController) PortfolioService(org.olat.modules.portfolio.PortfolioService) Page(org.olat.modules.portfolio.Page) MultiEvaluationFormController(org.olat.modules.portfolio.ui.MultiEvaluationFormController) Controller(org.olat.core.gui.control.Controller) EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController) PortfolioHomeController(org.olat.modules.portfolio.ui.PortfolioHomeController) Identity(org.olat.core.id.Identity)

Example 2 with EvaluationFormController

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

the class MultiEvaluationFormController method doOpenEvalutationForm.

private void doOpenEvalutationForm(UserRequest ureq, Identity evaluator) {
    boolean ro = readOnly || !evaluator.equals(getIdentity());
    boolean doneButton = !ro && evaluator.equals(getIdentity()) && (owner == null || !owner.equals(evaluator));
    currentEvalutionFormCtrl = new EvaluationFormController(ureq, getWindowControl(), evaluator, anchor, formEntry, ro, doneButton);
    listenTo(currentEvalutionFormCtrl);
    mainVC.put("segmentCmp", currentEvalutionFormCtrl.getInitialComponent());
}
Also used : EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController)

Example 3 with EvaluationFormController

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

the class MultiEvaluationFormController method createEvalutationForm.

private Controller createEvalutationForm(UserRequest ureq, Identity evaluator) {
    boolean ro = readOnly || !evaluator.equals(getIdentity());
    boolean doneButton = !ro && evaluator.equals(getIdentity()) && (owner == null || !owner.equals(evaluator));
    EvaluationFormController evalutionFormCtrl = new EvaluationFormController(ureq, getWindowControl(), evaluator, anchor, formEntry, ro, doneButton);
    listenTo(evalutionFormCtrl);
    return evalutionFormCtrl;
}
Also used : EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController)

Example 4 with EvaluationFormController

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

the class MultiEvaluationFormController method doOpenEvalutationForm.

private void doOpenEvalutationForm(UserRequest ureq, Identity evaluator) {
    boolean ro = readOnly || !evaluator.equals(getIdentity());
    boolean doneButton = !ro && evaluator.equals(getIdentity()) && (owner == null || !owner.equals(evaluator));
    currentEvalutionFormCtrl = new EvaluationFormController(ureq, getWindowControl(), evaluator, anchor, formEntry, ro, doneButton);
    listenTo(currentEvalutionFormCtrl);
    mainVC.put("segmentCmp", currentEvalutionFormCtrl.getInitialComponent());
}
Also used : EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController)

Example 5 with EvaluationFormController

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

the class EvaluationFormHandler method getController.

private Controller getController(UserRequest ureq, WindowControl wControl, PageBody body, EvaluationFormPart eva) {
    PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
    Controller ctrl = null;
    Page page = portfolioService.getPageByBody(body);
    List<AccessRights> accessRights = portfolioService.getAccessRights(page);
    if (hasRole(PortfolioRoles.owner, ureq.getIdentity(), accessRights)) {
        ctrl = new EvaluationFormController(ureq, wControl, ureq.getIdentity(), body, eva.getContent(), false);
    } else if (hasRole(PortfolioRoles.coach, ureq.getIdentity(), accessRights)) {
        Identity owner = getOwner(accessRights);
        ctrl = new EvaluationFormController(ureq, wControl, owner, body, eva.getContent(), true);
    } else if (hasRole(PortfolioRoles.reviewer, ureq.getIdentity(), accessRights) || hasRole(PortfolioRoles.invitee, ureq.getIdentity(), accessRights)) {
        Identity owner = getOwner(accessRights);
        ctrl = new EvaluationFormController(ureq, wControl, owner, body, eva.getContent(), true);
    }
    return ctrl;
}
Also used : AccessRights(org.olat.modules.portfolio.model.AccessRights) MultiEvaluationFormController(org.olat.modules.portfolio.ui.MultiEvaluationFormController) EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController) PortfolioService(org.olat.modules.portfolio.PortfolioService) Page(org.olat.modules.portfolio.Page) MultiEvaluationFormController(org.olat.modules.portfolio.ui.MultiEvaluationFormController) Controller(org.olat.core.gui.control.Controller) EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController) PortfolioHomeController(org.olat.modules.portfolio.ui.PortfolioHomeController) Identity(org.olat.core.id.Identity)

Aggregations

EvaluationFormController (org.olat.modules.forms.ui.EvaluationFormController)10 PortfolioService (org.olat.modules.portfolio.PortfolioService)6 MultiEvaluationFormController (org.olat.modules.portfolio.ui.MultiEvaluationFormController)6 Controller (org.olat.core.gui.control.Controller)4 Identity (org.olat.core.id.Identity)4 Page (org.olat.modules.portfolio.Page)4 AccessRights (org.olat.modules.portfolio.model.AccessRights)4 PortfolioHomeController (org.olat.modules.portfolio.ui.PortfolioHomeController)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 File (java.io.File)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Assignment (org.olat.modules.portfolio.Assignment)2 PageBody (org.olat.modules.portfolio.PageBody)2 PageStatus (org.olat.modules.portfolio.PageStatus)2 EvaluationFormPart (org.olat.modules.portfolio.model.EvaluationFormPart)2