Search in sources :

Example 21 with Assignment

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

the class AbstractPageListController method doMoveDownAssignment.

private void doMoveDownAssignment(UserRequest ureq, PortfolioElementRow row) {
    Assignment assigment = row.getAssignment();
    Section section = row.getSection();
    section = portfolioService.moveDownAssignment(section, assigment);
    loadModel(ureq, null);
}
Also used : Assignment(org.olat.modules.portfolio.Assignment) AssessmentSection(org.olat.modules.portfolio.AssessmentSection) Section(org.olat.modules.portfolio.Section)

Example 22 with Assignment

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

the class AbstractPageListController method doEditAssignment.

protected void doEditAssignment(UserRequest ureq, PortfolioElementRow row) {
    if (editAssignmentCtrl != null)
        return;
    Assignment assignment = row.getAssignment();
    editAssignmentCtrl = new AssignmentEditController(ureq, getWindowControl(), assignment);
    listenTo(editAssignmentCtrl);
    String title = translate("edit.assignment");
    cmc = new CloseableModalController(getWindowControl(), null, editAssignmentCtrl.getInitialComponent(), true, title, true);
    listenTo(cmc);
    cmc.activate();
}
Also used : Assignment(org.olat.modules.portfolio.Assignment) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 23 with Assignment

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

the class AbstractPageListController method doMoveAssignment.

private void doMoveAssignment(UserRequest ureq, PortfolioElementRow row) {
    if (moveAssignmentCtrl != null)
        return;
    Assignment assignment = row.getAssignment();
    moveAssignmentCtrl = new AssignmentMoveController(ureq, getWindowControl(), assignment, row.getSection());
    listenTo(moveAssignmentCtrl);
    String title = translate("move.assignment");
    cmc = new CloseableModalController(getWindowControl(), null, moveAssignmentCtrl.getInitialComponent(), true, title, true);
    listenTo(cmc);
    cmc.activate();
}
Also used : Assignment(org.olat.modules.portfolio.Assignment) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 24 with Assignment

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

the class AbstractPageListController method doMoveUpAssignment.

private void doMoveUpAssignment(UserRequest ureq, PortfolioElementRow row) {
    Assignment assigment = row.getAssignment();
    Section section = assigment.getSection();
    section = portfolioService.moveUpAssignment(section, assigment);
    loadModel(ureq, null);
}
Also used : Assignment(org.olat.modules.portfolio.Assignment) AssessmentSection(org.olat.modules.portfolio.AssessmentSection) Section(org.olat.modules.portfolio.Section)

Example 25 with Assignment

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

the class PortfolioServiceImpl method startAssignment.

@Override
public Assignment startAssignment(Long assignmentKey, Identity author) {
    Assignment reloadedAssignment = assignmentDao.loadAssignmentByKey(assignmentKey);
    if (reloadedAssignment.getPage() == null) {
        Section section = reloadedAssignment.getSection();
        if (reloadedAssignment.getAssignmentType() == AssignmentType.essay || reloadedAssignment.getAssignmentType() == AssignmentType.document) {
            Page page = appendNewPage(author, reloadedAssignment.getTitle(), reloadedAssignment.getSummary(), null, null, section);
            reloadedAssignment = assignmentDao.startEssayAssignment(reloadedAssignment, page, author);
        } else if (reloadedAssignment.getAssignmentType() == AssignmentType.form) {
            RepositoryEntry formEntry = reloadedAssignment.getFormEntry();
            Page page = appendNewPage(author, reloadedAssignment.getTitle(), reloadedAssignment.getSummary(), null, false, null, section);
            reloadedAssignment = assignmentDao.startFormAssignment(reloadedAssignment, page, author);
            // create the session for the assignee
            evaluationFormSessionDao.createSessionForPortfolio(author, page.getBody(), formEntry);
        }
    }
    dbInstance.commit();
    ThreadLocalUserActivityLogger.log(PortfolioLoggingAction.PORTFOLIO_ASSIGNMENT_STARTED, getClass(), LoggingResourceable.wrap(reloadedAssignment.getSection()), LoggingResourceable.wrap(reloadedAssignment));
    return reloadedAssignment;
}
Also used : Assignment(org.olat.modules.portfolio.Assignment) AssessedPage(org.olat.modules.portfolio.model.AssessedPage) Page(org.olat.modules.portfolio.Page) RepositoryEntry(org.olat.repository.RepositoryEntry) AssessmentSection(org.olat.modules.portfolio.AssessmentSection) Section(org.olat.modules.portfolio.Section)

Aggregations

Assignment (org.olat.modules.portfolio.Assignment)78 Section (org.olat.modules.portfolio.Section)48 Binder (org.olat.modules.portfolio.Binder)30 Identity (org.olat.core.id.Identity)28 Test (org.junit.Test)26 Page (org.olat.modules.portfolio.Page)26 ArrayList (java.util.ArrayList)24 RepositoryEntry (org.olat.repository.RepositoryEntry)20 AssessmentSection (org.olat.modules.portfolio.AssessmentSection)18 SynchedBinder (org.olat.modules.portfolio.model.SynchedBinder)18 SectionRef (org.olat.modules.portfolio.SectionRef)16 File (java.io.File)8 HashMap (java.util.HashMap)8 List (java.util.List)8 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)8 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)8 OLATResourceable (org.olat.core.id.OLATResourceable)8 SectionImpl (org.olat.modules.portfolio.model.SectionImpl)8 PortfolioElementRow (org.olat.modules.portfolio.ui.model.PortfolioElementRow)8 Link (org.olat.core.gui.components.link.Link)6