use of org.olat.modules.assessment.model.AssessmentEntryImpl in project openolat by klemens.
the class OLATUpgrade_11_0_0 method processNonPropertiesIQTESTStates.
/**
* Find if someone has started a test without getting a score, passed status...
*
* @param assessableIdentities
* @param iqNode
* @param course
* @param courseEntry
* @param nodeAssessmentMap
*/
private void processNonPropertiesIQTESTStates(List<Identity> assessableIdentities, IQTESTCourseNode iqNode, ICourse course, RepositoryEntry courseEntry, Map<AssessmentDataKey, AssessmentEntryImpl> nodeAssessmentMap, Map<AssessmentDataKey, AssessmentEntryImpl> curentNodeAssessmentMap) {
for (Identity assessedIdentity : assessableIdentities) {
if (iqTestPersisterExists(assessedIdentity, iqNode, course)) {
AssessmentDataKey key = new AssessmentDataKey(assessedIdentity, course.getResourceableId(), iqNode.getIdent());
if (curentNodeAssessmentMap.containsKey(key)) {
continue;
}
AssessmentEntryImpl nodeAssessment;
if (nodeAssessmentMap.containsKey(key)) {
nodeAssessment = nodeAssessmentMap.get(key);
} else {
nodeAssessment = createAssessmentEntry(assessedIdentity, null, course, courseEntry, iqNode.getIdent());
nodeAssessmentMap.put(key, nodeAssessment);
Long courseResourceableId = course.getResourceableId();
String resourcePath = courseResourceableId + File.separator + iqNode.getIdent();
FilePersister qtiPersister = new FilePersister(assessedIdentity, resourcePath);
nodeAssessment.setCreationDate(qtiPersister.getLastModified());
nodeAssessment.setLastModified(qtiPersister.getLastModified());
}
nodeAssessment.setAssessmentStatus(AssessmentEntryStatus.inProgress);
}
}
}
use of org.olat.modules.assessment.model.AssessmentEntryImpl in project openolat by klemens.
the class AssessmentEntryDAO method createAssessmentEntry.
public AssessmentEntry createAssessmentEntry(Identity assessedIdentity, String anonymousIdentifier, RepositoryEntry entry, String subIdent, RepositoryEntry referenceEntry) {
AssessmentEntryImpl data = new AssessmentEntryImpl();
data.setCreationDate(new Date());
data.setLastModified(data.getCreationDate());
data.setIdentity(assessedIdentity);
data.setAnonymousIdentifier(anonymousIdentifier);
data.setRepositoryEntry(entry);
data.setSubIdent(subIdent);
data.setReferenceEntry(referenceEntry);
data.setUserVisibility(Boolean.TRUE);
dbInstance.getCurrentEntityManager().persist(data);
return data;
}
Aggregations