Search in sources :

Example 6 with OpenOLATMetadataType

use of org.olat.oo.xml.manifest.OpenOLATMetadataType in project openolat by klemens.

the class AssessmentItemMetadata method fromBuilder.

public void fromBuilder(ManifestMetadataBuilder metadata) {
    // general
    keywords = metadata.getGeneralKeywords();
    coverage = metadata.getCoverage();
    // educational
    EducationalType educational = metadata.getEducational(false);
    if (educational != null) {
        level = metadata.getEducationContext();
    }
    typicalLearningTime = metadata.getEducationalLearningTime();
    // taxonomy
    taxonomyPath = metadata.getClassificationTaxonomy();
    // rights
    license = metadata.getLicense();
    // qti metadata
    QTIMetadataType qtiMetadata = metadata.getQtiMetadata(true);
    if (qtiMetadata != null) {
        if (qtiMetadata.getToolName() != null) {
            editor = qtiMetadata.getToolName();
        }
        if (qtiMetadata.getToolVersion() != null) {
            editorVersion = qtiMetadata.getToolVersion();
        }
    }
    // openolat metadata
    OpenOLATMetadataType openolatMetadata = metadata.getOpenOLATMetadata(false);
    if (openolatMetadata != null) {
        if (openolatMetadata.getDiscriminationIndex() != null) {
            differentiation = new BigDecimal(openolatMetadata.getDiscriminationIndex());
        }
        if (openolatMetadata.getDifficulty() != null) {
            difficulty = new BigDecimal(openolatMetadata.getDifficulty());
        }
        if (openolatMetadata.getStandardDeviation() != null) {
            stdevDifficulty = new BigDecimal(openolatMetadata.getStandardDeviation());
        }
        if (openolatMetadata.getDistractors() != null) {
            numOfAnswerAlternatives = openolatMetadata.getDistractors().intValue();
        }
        if (openolatMetadata.getTopic() != null) {
            topic = openolatMetadata.getTopic();
        }
        if (openolatMetadata.getAssessmentType() != null) {
            assessmentType = openolatMetadata.getAssessmentType();
        }
        if (openolatMetadata.getCreator() != null) {
            creator = openolatMetadata.getCreator();
        }
        if (openolatMetadata.getAdditionalInformations() != null) {
            additionalInformations = openolatMetadata.getAdditionalInformations();
        }
    }
}
Also used : EducationalType(org.olat.imsmd.xml.manifest.EducationalType) OpenOLATMetadataType(org.olat.oo.xml.manifest.OpenOLATMetadataType) QTIMetadataType(org.olat.imsqti.xml.manifest.QTIMetadataType) BigDecimal(java.math.BigDecimal)

Aggregations

OpenOLATMetadataType (org.olat.oo.xml.manifest.OpenOLATMetadataType)6 QTIMetadataType (org.olat.imsqti.xml.manifest.QTIMetadataType)4 File (java.io.File)2 BigDecimal (java.math.BigDecimal)2 URL (java.net.URL)2 JAXBElement (javax.xml.bind.JAXBElement)2 Test (org.junit.Test)2 EducationalType (org.olat.imsmd.xml.manifest.EducationalType)2