Search in sources :

Example 1 with FilePersister

use of org.olat.ims.qti.process.FilePersister in project OpenOLAT by OpenOLAT.

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);
        }
    }
}
Also used : FilePersister(org.olat.ims.qti.process.FilePersister) Identity(org.olat.core.id.Identity) TransientIdentity(org.olat.admin.user.imp.TransientIdentity) AssessmentEntryImpl(org.olat.modules.assessment.model.AssessmentEntryImpl)

Example 2 with FilePersister

use of org.olat.ims.qti.process.FilePersister in project openolat by klemens.

the class IQTESTCourseNode method isQTI12TestRunning.

public boolean isQTI12TestRunning(Identity assessedIdentity, CourseEnvironment courseEnv) {
    String resourcePath = courseEnv.getCourseResourceableId() + File.separator + getIdent();
    FilePersister qtiPersister = new FilePersister(assessedIdentity, resourcePath);
    return qtiPersister.exists();
}
Also used : FilePersister(org.olat.ims.qti.process.FilePersister)

Example 3 with FilePersister

use of org.olat.ims.qti.process.FilePersister in project OpenOLAT by OpenOLAT.

the class OLATUpgrade_11_0_0 method iqTestPersisterExists.

private boolean iqTestPersisterExists(Identity assessedIdentity, IQTESTCourseNode cNode, ICourse course) {
    Long courseResourceableId = course.getResourceableId();
    String resourcePath = courseResourceableId + File.separator + cNode.getIdent();
    FilePersister qtiPersister = new FilePersister(assessedIdentity, resourcePath);
    return qtiPersister.exists();
}
Also used : FilePersister(org.olat.ims.qti.process.FilePersister)

Example 4 with FilePersister

use of org.olat.ims.qti.process.FilePersister in project OpenOLAT by OpenOLAT.

the class IQTESTCourseNode method isQTI12TestRunning.

public boolean isQTI12TestRunning(Identity assessedIdentity, CourseEnvironment courseEnv) {
    String resourcePath = courseEnv.getCourseResourceableId() + File.separator + getIdent();
    FilePersister qtiPersister = new FilePersister(assessedIdentity, resourcePath);
    return qtiPersister.exists();
}
Also used : FilePersister(org.olat.ims.qti.process.FilePersister)

Example 5 with FilePersister

use of org.olat.ims.qti.process.FilePersister 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);
        }
    }
}
Also used : FilePersister(org.olat.ims.qti.process.FilePersister) Identity(org.olat.core.id.Identity) TransientIdentity(org.olat.admin.user.imp.TransientIdentity) AssessmentEntryImpl(org.olat.modules.assessment.model.AssessmentEntryImpl)

Aggregations

FilePersister (org.olat.ims.qti.process.FilePersister)6 TransientIdentity (org.olat.admin.user.imp.TransientIdentity)2 Identity (org.olat.core.id.Identity)2 AssessmentEntryImpl (org.olat.modules.assessment.model.AssessmentEntryImpl)2