use of org.olat.modules.portfolio.model.AssignmentImpl in project OpenOLAT by OpenOLAT.
the class AssignmentDAO method startEssayAssignment.
public Assignment startEssayAssignment(Assignment assigment, Page page, Identity assignee) {
((AssignmentImpl) assigment).setPage(page);
((AssignmentImpl) assigment).setAssignee(assignee);
((AssignmentImpl) assigment).setLastModified(new Date());
assigment.setAssignmentStatus(AssignmentStatus.inProgress);
return dbInstance.getCurrentEntityManager().merge(assigment);
}
use of org.olat.modules.portfolio.model.AssignmentImpl in project openolat by klemens.
the class AssignmentDAO method createAssignment.
public Assignment createAssignment(Assignment templateReference, AssignmentStatus status, Section section) {
AssignmentImpl assignment = new AssignmentImpl();
assignment.setCreationDate(new Date());
assignment.setLastModified(assignment.getCreationDate());
assignment.setTitle(templateReference.getTitle());
assignment.setSummary(templateReference.getSummary());
assignment.setContent(templateReference.getContent());
assignment.setSection(section);
assignment.setType(templateReference.getAssignmentType().name());
assignment.setTemplateReference(templateReference);
assignment.setStatus(status.name());
assignment.setOnlyAutoEvaluation(templateReference.isOnlyAutoEvaluation());
assignment.setReviewerSeeAutoEvaluation(templateReference.isReviewerSeeAutoEvaluation());
assignment.setAnonymousExternalEvaluation(templateReference.isAnonymousExternalEvaluation());
assignment.setStorage(templateReference.getStorage());
assignment.setFormEntry(templateReference.getFormEntry());
((SectionImpl) section).getAssignments().size();
((SectionImpl) section).getAssignments().add(assignment);
dbInstance.getCurrentEntityManager().persist(assignment);
dbInstance.getCurrentEntityManager().merge(section);
return assignment;
}
use of org.olat.modules.portfolio.model.AssignmentImpl in project openolat by klemens.
the class AssignmentDAO method startFormAssignment.
public Assignment startFormAssignment(Assignment assignment, Page page, Identity assignee) {
((AssignmentImpl) assignment).setPage(page);
((AssignmentImpl) assignment).setAssignee(assignee);
((AssignmentImpl) assignment).setLastModified(new Date());
assignment.setAssignmentStatus(AssignmentStatus.inProgress);
RepositoryEntry formEntry = assignment.getFormEntry();
if (formEntry.getOlatResource().getResourceableTypeName().equals(formHandler.getSupportedType())) {
File formFile = formHandler.getFormFile(formEntry);
String formXml = FileUtils.load(formFile, "UTF-8");
EvaluationFormPart formPart = new EvaluationFormPart();
formPart.setContent(formXml);
formPart.setFormEntry(formEntry);
pageDao.persistPart(page.getBody(), formPart);
}
return dbInstance.getCurrentEntityManager().merge(assignment);
}
use of org.olat.modules.portfolio.model.AssignmentImpl in project openolat by klemens.
the class AssignmentDAO method startEssayAssignment.
public Assignment startEssayAssignment(Assignment assigment, Page page, Identity assignee) {
((AssignmentImpl) assigment).setPage(page);
((AssignmentImpl) assigment).setAssignee(assignee);
((AssignmentImpl) assigment).setLastModified(new Date());
assigment.setAssignmentStatus(AssignmentStatus.inProgress);
return dbInstance.getCurrentEntityManager().merge(assigment);
}
use of org.olat.modules.portfolio.model.AssignmentImpl in project openolat by klemens.
the class BinderDAO method syncMovedAssignment.
private void syncMovedAssignment(SectionImpl currentSection, SectionImpl newSection, Assignment assignment) {
currentSection.getAssignments().size();
newSection.getAssignments().size();
currentSection.getAssignments().remove(assignment);
((AssignmentImpl) assignment).setSection(newSection);
assignment = dbInstance.getCurrentEntityManager().merge(assignment);
newSection.getAssignments().add(assignment);
Page page = assignment.getPage();
if (page != null) {
currentSection.getPages().remove(page);
newSection.getPages().add(page);
((PageImpl) page).setSection(newSection);
dbInstance.getCurrentEntityManager().merge(page);
}
}
Aggregations