Search in sources :

Example 1 with DigitalSignatureOptions

use of org.olat.ims.qti21.model.DigitalSignatureOptions in project OpenOLAT by OpenOLAT.

the class QTI21AssessmentDetailsController method getSignatureOptions.

private DigitalSignatureOptions getSignatureOptions(AssessmentTestSession session) {
    RepositoryEntry sessionTestEntry = session.getTestEntry();
    QTI21DeliveryOptions deliveryOptions = qtiService.getDeliveryOptions(sessionTestEntry);
    boolean digitalSignature = deliveryOptions.isDigitalSignature();
    boolean sendMail = deliveryOptions.isDigitalSignatureMail();
    if (courseNode != null) {
        ModuleConfiguration config = courseNode.getModuleConfiguration();
        digitalSignature = config.getBooleanSafe(IQEditController.CONFIG_DIGITAL_SIGNATURE, deliveryOptions.isDigitalSignature());
        sendMail = config.getBooleanSafe(IQEditController.CONFIG_DIGITAL_SIGNATURE_SEND_MAIL, deliveryOptions.isDigitalSignatureMail());
    }
    DigitalSignatureOptions options = new DigitalSignatureOptions(digitalSignature, sendMail, entry, testEntry);
    if (digitalSignature) {
        if (courseNode == null) {
            AssessmentEntryOutcomesListener.decorateResourceConfirmation(entry, testEntry, session, options, null, getLocale());
        } else {
            CourseEnvironment courseEnv = CourseFactory.loadCourse(entry).getCourseEnvironment();
            QTI21AssessmentRunController.decorateCourseConfirmation(session, options, courseEnv, courseNode, sessionTestEntry, null, getLocale());
        }
    }
    return options;
}
Also used : QTI21DeliveryOptions(org.olat.ims.qti21.QTI21DeliveryOptions) ModuleConfiguration(org.olat.modules.ModuleConfiguration) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) DigitalSignatureOptions(org.olat.ims.qti21.model.DigitalSignatureOptions) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 2 with DigitalSignatureOptions

use of org.olat.ims.qti21.model.DigitalSignatureOptions in project openolat by klemens.

the class QTI21ServiceImpl method pullSession.

@Override
public AssessmentTestSession pullSession(AssessmentTestSession session, DigitalSignatureOptions signatureOptions, Identity actor) {
    session = getAssessmentTestSession(session.getKey());
    if (session.getFinishTime() == null) {
        if (qtiModule.isDigitalSignatureEnabled()) {
            signAssessmentResult(session, signatureOptions, session.getIdentity());
        }
        session.setFinishTime(new Date());
    }
    session.setTerminationTime(new Date());
    session = updateAssessmentTestSession(session);
    // make sure that the changes committed before sending the event
    dbInstance.commit();
    AssessmentSessionAuditLogger candidateAuditLogger = getAssessmentSessionAuditLogger(session, false);
    candidateAuditLogger.logTestRetrieved(session, actor);
    OLATResourceable sessionOres = OresHelper.createOLATResourceableInstance(AssessmentTestSession.class, session.getKey());
    coordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new RetrieveAssessmentTestSessionEvent(session.getKey()), sessionOres);
    return session;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) AssessmentSessionAuditLogger(org.olat.ims.qti21.AssessmentSessionAuditLogger) RetrieveAssessmentTestSessionEvent(org.olat.ims.qti21.ui.event.RetrieveAssessmentTestSessionEvent) Date(java.util.Date)

Example 3 with DigitalSignatureOptions

use of org.olat.ims.qti21.model.DigitalSignatureOptions in project OpenOLAT by OpenOLAT.

the class QTI21ServiceImpl method pullSession.

@Override
public AssessmentTestSession pullSession(AssessmentTestSession session, DigitalSignatureOptions signatureOptions, Identity actor) {
    session = getAssessmentTestSession(session.getKey());
    if (session.getFinishTime() == null) {
        if (qtiModule.isDigitalSignatureEnabled()) {
            signAssessmentResult(session, signatureOptions, session.getIdentity());
        }
        session.setFinishTime(new Date());
    }
    session.setTerminationTime(new Date());
    session = updateAssessmentTestSession(session);
    // make sure that the changes committed before sending the event
    dbInstance.commit();
    AssessmentSessionAuditLogger candidateAuditLogger = getAssessmentSessionAuditLogger(session, false);
    candidateAuditLogger.logTestRetrieved(session, actor);
    OLATResourceable sessionOres = OresHelper.createOLATResourceableInstance(AssessmentTestSession.class, session.getKey());
    coordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new RetrieveAssessmentTestSessionEvent(session.getKey()), sessionOres);
    return session;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) AssessmentSessionAuditLogger(org.olat.ims.qti21.AssessmentSessionAuditLogger) RetrieveAssessmentTestSessionEvent(org.olat.ims.qti21.ui.event.RetrieveAssessmentTestSessionEvent) Date(java.util.Date)

Example 4 with DigitalSignatureOptions

use of org.olat.ims.qti21.model.DigitalSignatureOptions in project OpenOLAT by OpenOLAT.

the class AssessmentTestDisplayController method getDigitalSignatureOptions.

private DigitalSignatureOptions getDigitalSignatureOptions() {
    boolean sendMail = deliveryOptions.isDigitalSignatureMail();
    boolean digitalSignature = deliveryOptions.isDigitalSignature() && qtiModule.isDigitalSignatureEnabled();
    DigitalSignatureOptions options = new DigitalSignatureOptions(digitalSignature, sendMail, entry, testEntry);
    if (digitalSignature) {
        outcomesListener.decorateConfirmation(candidateSession, options, getCurrentRequestTimestamp(), getLocale());
    }
    return options;
}
Also used : DigitalSignatureOptions(org.olat.ims.qti21.model.DigitalSignatureOptions)

Example 5 with DigitalSignatureOptions

use of org.olat.ims.qti21.model.DigitalSignatureOptions in project OpenOLAT by OpenOLAT.

the class QTI21RetrieveTestsController method getSignatureOptions.

private DigitalSignatureOptions getSignatureOptions(AssessmentTestSession session) {
    if (courseNode == null)
        return null;
    RepositoryEntry testEntry = session.getTestEntry();
    RepositoryEntry courseEntry = session.getRepositoryEntry();
    QTI21DeliveryOptions deliveryOptions = qtiService.getDeliveryOptions(testEntry);
    boolean digitalSignature = deliveryOptions.isDigitalSignature();
    boolean sendMail = deliveryOptions.isDigitalSignatureMail();
    ModuleConfiguration config = courseNode.getModuleConfiguration();
    digitalSignature = config.getBooleanSafe(IQEditController.CONFIG_DIGITAL_SIGNATURE, deliveryOptions.isDigitalSignature());
    sendMail = config.getBooleanSafe(IQEditController.CONFIG_DIGITAL_SIGNATURE_SEND_MAIL, deliveryOptions.isDigitalSignatureMail());
    DigitalSignatureOptions options = new DigitalSignatureOptions(digitalSignature, sendMail, courseEntry, testEntry);
    if (digitalSignature) {
        CourseEnvironment courseEnv = CourseFactory.loadCourse(courseEntry).getCourseEnvironment();
        QTI21AssessmentRunController.decorateCourseConfirmation(session, options, courseEnv, courseNode, testEntry, null, getLocale());
    }
    return options;
}
Also used : QTI21DeliveryOptions(org.olat.ims.qti21.QTI21DeliveryOptions) ModuleConfiguration(org.olat.modules.ModuleConfiguration) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) DigitalSignatureOptions(org.olat.ims.qti21.model.DigitalSignatureOptions) RepositoryEntry(org.olat.repository.RepositoryEntry)

Aggregations

DigitalSignatureOptions (org.olat.ims.qti21.model.DigitalSignatureOptions)6 CourseEnvironment (org.olat.course.run.environment.CourseEnvironment)4 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)4 QTI21DeliveryOptions (org.olat.ims.qti21.QTI21DeliveryOptions)4 ModuleConfiguration (org.olat.modules.ModuleConfiguration)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 Date (java.util.Date)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 AssessmentSessionAuditLogger (org.olat.ims.qti21.AssessmentSessionAuditLogger)2 RetrieveAssessmentTestSessionEvent (org.olat.ims.qti21.ui.event.RetrieveAssessmentTestSessionEvent)2