Search in sources :

Example 1 with CorrectionWorkflow

use of org.olat.ims.qti21.QTI21Module.CorrectionWorkflow in project OpenOLAT by OpenOLAT.

the class QTI21AdminController method formOK.

@Override
protected void formOK(UserRequest ureq) {
    qti12Module.setCreateResourcesEnabled(createQTI12resourcesEl.isSelected(0));
    CorrectionWorkflow correctionWf = anonymCorrectionWorkflowEl.isAtLeastSelected(1) ? CorrectionWorkflow.anonymous : CorrectionWorkflow.named;
    qti21Module.setCorrectionWorkflow(correctionWf);
    qti21Module.setMathAssessExtensionEnabled(mathExtensionEl.isSelected(0));
    qti21Module.setDigitalSignatureEnabled(digitalSignatureEl.isSelected(0));
    if (digitalSignatureEl.isSelected(0)) {
        File uploadedCertificate = certificateEl.getUploadFile();
        if (uploadedCertificate != null && uploadedCertificate.exists()) {
            qti21Module.setDigitalSignatureCertificateFile(uploadedCertificate, certificateEl.getUploadFileName());
            File newFile = qti21Module.getDigitalSignatureCertificateFile();
            // make sure the same certificate is not load twice
            certificateEl.reset();
            certificateEl.setInitialFile(newFile);
        }
        String password = certificatePasswordEl.getValue();
        if (!PLACEHOLDER.equals(password)) {
            qti21Module.setDigitalSignatureCertificatePassword(password);
        }
    }
}
Also used : CorrectionWorkflow(org.olat.ims.qti21.QTI21Module.CorrectionWorkflow) File(java.io.File)

Example 2 with CorrectionWorkflow

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

the class QTI21AdminController method formOK.

@Override
protected void formOK(UserRequest ureq) {
    qti12Module.setCreateResourcesEnabled(createQTI12resourcesEl.isSelected(0));
    CorrectionWorkflow correctionWf = anonymCorrectionWorkflowEl.isAtLeastSelected(1) ? CorrectionWorkflow.anonymous : CorrectionWorkflow.named;
    qti21Module.setCorrectionWorkflow(correctionWf);
    qti21Module.setMathAssessExtensionEnabled(mathExtensionEl.isSelected(0));
    qti21Module.setDigitalSignatureEnabled(digitalSignatureEl.isSelected(0));
    if (digitalSignatureEl.isSelected(0)) {
        File uploadedCertificate = certificateEl.getUploadFile();
        if (uploadedCertificate != null && uploadedCertificate.exists()) {
            qti21Module.setDigitalSignatureCertificateFile(uploadedCertificate, certificateEl.getUploadFileName());
            File newFile = qti21Module.getDigitalSignatureCertificateFile();
            // make sure the same certificate is not load twice
            certificateEl.reset();
            certificateEl.setInitialFile(newFile);
        }
        String password = certificatePasswordEl.getValue();
        if (!PLACEHOLDER.equals(password)) {
            qti21Module.setDigitalSignatureCertificatePassword(password);
        }
    }
}
Also used : CorrectionWorkflow(org.olat.ims.qti21.QTI21Module.CorrectionWorkflow) File(java.io.File)

Aggregations

File (java.io.File)2 CorrectionWorkflow (org.olat.ims.qti21.QTI21Module.CorrectionWorkflow)2