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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations