Search in sources :

Example 16 with AssignmentImpl

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

the class PortfolioServiceImpl method updateAssignment.

@Override
public Assignment updateAssignment(Assignment assignment, String title, String summary, String content, AssignmentType type, boolean onlyAutoEvaluation, boolean reviewerSeeAutoEvaluation, boolean anonymousExternEvaluation, RepositoryEntry formEntry) {
    if (!StringHelper.containsNonWhitespace(assignment.getStorage())) {
        File newStorage = portfolioFileStorage.generateAssignmentSubDirectory();
        String newRelativeStorage = portfolioFileStorage.getRelativePath(newStorage);
        ((AssignmentImpl) assignment).setStorage(newRelativeStorage);
    }
    AssignmentImpl impl = (AssignmentImpl) assignment;
    impl.setTitle(title);
    impl.setSummary(summary);
    impl.setContent(content);
    impl.setType(type.name());
    impl.setOnlyAutoEvaluation(onlyAutoEvaluation);
    impl.setReviewerSeeAutoEvaluation(reviewerSeeAutoEvaluation);
    impl.setAnonymousExternalEvaluation(anonymousExternEvaluation);
    impl.setFormEntry(formEntry);
    return assignmentDao.updateAssignment(assignment);
}
Also used : AssignmentImpl(org.olat.modules.portfolio.model.AssignmentImpl) File(java.io.File)

Aggregations

AssignmentImpl (org.olat.modules.portfolio.model.AssignmentImpl)16 Date (java.util.Date)8 File (java.io.File)4 Assignment (org.olat.modules.portfolio.Assignment)4 ArrayList (java.util.ArrayList)2 PersistenceHelper.makeFuzzyQueryString (org.olat.core.commons.persistence.PersistenceHelper.makeFuzzyQueryString)2 Page (org.olat.modules.portfolio.Page)2 EvaluationFormPart (org.olat.modules.portfolio.model.EvaluationFormPart)2 PageImpl (org.olat.modules.portfolio.model.PageImpl)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2