Search in sources :

Example 6 with EvaluationFormPart

use of org.olat.modules.portfolio.model.EvaluationFormPart 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

EvaluationFormPart (org.olat.modules.portfolio.model.EvaluationFormPart)6 File (java.io.File)4 EvaluationFormController (org.olat.modules.forms.ui.EvaluationFormController)4 Assignment (org.olat.modules.portfolio.Assignment)4 PageBody (org.olat.modules.portfolio.PageBody)4 PortfolioService (org.olat.modules.portfolio.PortfolioService)4 MultiEvaluationFormController (org.olat.modules.portfolio.ui.MultiEvaluationFormController)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 Date (java.util.Date)2 PersistenceHelper.makeFuzzyQueryString (org.olat.core.commons.persistence.PersistenceHelper.makeFuzzyQueryString)2 Controller (org.olat.core.gui.control.Controller)2 Translator (org.olat.core.gui.translator.Translator)2 AssignmentImpl (org.olat.modules.portfolio.model.AssignmentImpl)2 PortfolioHomeController (org.olat.modules.portfolio.ui.PortfolioHomeController)2 PageRunControllerElement (org.olat.modules.portfolio.ui.editor.PageRunControllerElement)2