Search in sources :

Example 26 with PageBody

use of org.olat.modules.portfolio.PageBody in project openolat by klemens.

the class EvaluationFormHandler method getEditor.

@Override
public Controller getEditor(UserRequest ureq, WindowControl wControl, PageElement element) {
    if (element instanceof EvaluationFormPart) {
        PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
        // find assignment
        EvaluationFormPart eva = (EvaluationFormPart) element;
        PageBody body = eva.getBody();
        Assignment assignment = portfolioService.getAssignment(body);
        // find the evaluation form
        RepositoryEntry re = assignment.getFormEntry();
        File repositoryDir = new File(FileResourceManager.getInstance().getFileResourceRoot(re.getOlatResource()), FileResourceManager.ZIPDIR);
        File formFile = new File(repositoryDir, FORM_XML_FILE);
        return new EvaluationFormController(ureq, wControl, formFile);
    }
    return null;
}
Also used : Assignment(org.olat.modules.portfolio.Assignment) MultiEvaluationFormController(org.olat.modules.portfolio.ui.MultiEvaluationFormController) EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController) EvaluationFormPart(org.olat.modules.portfolio.model.EvaluationFormPart) PortfolioService(org.olat.modules.portfolio.PortfolioService) RepositoryEntry(org.olat.repository.RepositoryEntry) PageBody(org.olat.modules.portfolio.PageBody) File(java.io.File)

Aggregations

PageBody (org.olat.modules.portfolio.PageBody)26 Test (org.junit.Test)14 Page (org.olat.modules.portfolio.Page)14 Section (org.olat.modules.portfolio.Section)8 HTMLPart (org.olat.modules.portfolio.model.HTMLPart)8 Identity (org.olat.core.id.Identity)6 PagePart (org.olat.modules.portfolio.PagePart)6 BinderImpl (org.olat.modules.portfolio.model.BinderImpl)6 TitlePart (org.olat.modules.portfolio.model.TitlePart)6 RepositoryEntry (org.olat.repository.RepositoryEntry)6 EvaluationFormSession (org.olat.modules.forms.EvaluationFormSession)4 EvaluationFormController (org.olat.modules.forms.ui.EvaluationFormController)4 Assignment (org.olat.modules.portfolio.Assignment)4 PortfolioService (org.olat.modules.portfolio.PortfolioService)4 EvaluationFormPart (org.olat.modules.portfolio.model.EvaluationFormPart)4 MultiEvaluationFormController (org.olat.modules.portfolio.ui.MultiEvaluationFormController)4 File (java.io.File)2 BigDecimal (java.math.BigDecimal)2 Path (java.nio.file.Path)2 PersistenceHelper.makeFuzzyQueryString (org.olat.core.commons.persistence.PersistenceHelper.makeFuzzyQueryString)2