Search in sources :

Example 26 with QTI21DeliveryOptions

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

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

QTI21DeliveryOptions (org.olat.ims.qti21.QTI21DeliveryOptions)22 RepositoryEntry (org.olat.repository.RepositoryEntry)14 File (java.io.File)6 ModuleConfiguration (org.olat.modules.ModuleConfiguration)6 CourseEnvironment (org.olat.course.run.environment.CourseEnvironment)4 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)4 QTI21Service (org.olat.ims.qti21.QTI21Service)4 DigitalSignatureOptions (org.olat.ims.qti21.model.DigitalSignatureOptions)4 OLATResource (org.olat.resource.OLATResource)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)2 Controller (org.olat.core.gui.control.Controller)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 NodeEditController (org.olat.course.editor.NodeEditController)2 FileResourceManager (org.olat.fileresource.FileResourceManager)2 ImsQTI21Resource (org.olat.fileresource.types.ImsQTI21Resource)2 QTIEditorPackage (org.olat.ims.qti.editor.QTIEditorPackage)2 Assessment (org.olat.ims.qti.editor.beecom.objects.Assessment)2