Search in sources :

Example 6 with QTIMetadataType

use of org.olat.imsqti.xml.manifest.QTIMetadataType in project OpenOLAT by OpenOLAT.

the class ManifestMetadataBuilder method setQtiMetadataInteractionTypes.

public void setQtiMetadataInteractionTypes(List<String> interactions) {
    QTIMetadataType qtiMetadata = getQtiMetadata(true);
    qtiMetadata.getInteractionType().clear();
    for (String interaction : interactions) {
        qtiMetadata.getInteractionType().add(interaction);
    }
}
Also used : QTIMetadataType(org.olat.imsqti.xml.manifest.QTIMetadataType)

Example 7 with QTIMetadataType

use of org.olat.imsqti.xml.manifest.QTIMetadataType in project OpenOLAT by OpenOLAT.

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)

Example 8 with QTIMetadataType

use of org.olat.imsqti.xml.manifest.QTIMetadataType 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)

Example 9 with QTIMetadataType

use of org.olat.imsqti.xml.manifest.QTIMetadataType in project openolat by klemens.

the class ManifestMetadataBuilder method setQtiMetadataInteractionTypes.

public void setQtiMetadataInteractionTypes(List<String> interactions) {
    QTIMetadataType qtiMetadata = getQtiMetadata(true);
    qtiMetadata.getInteractionType().clear();
    for (String interaction : interactions) {
        qtiMetadata.getInteractionType().add(interaction);
    }
}
Also used : QTIMetadataType(org.olat.imsqti.xml.manifest.QTIMetadataType)

Example 10 with QTIMetadataType

use of org.olat.imsqti.xml.manifest.QTIMetadataType in project openolat by klemens.

the class ManifestMetadataBuilder method getQtiMetadata.

/**
 * Return the qti metadata if it exists or if specified, create
 * one and append it to the metadata of the resource.
 *
 * @param resource The resource with the metadata
 * @param create True create the qtiMetadata
 * @return
 */
public QTIMetadataType getQtiMetadata(boolean create) {
    List<Object> anyMetadataList = getMetadataList();
    QTIMetadataType qtiMetadata = null;
    for (Object anyMetadata : anyMetadataList) {
        if (anyMetadata instanceof JAXBElement<?> && ((JAXBElement<?>) anyMetadata).getValue() instanceof QTIMetadataType) {
            qtiMetadata = (QTIMetadataType) ((JAXBElement<?>) anyMetadata).getValue();
        }
    }
    if (qtiMetadata == null && create) {
        qtiMetadata = qtiObjectFactory.createQTIMetadataType();
        getMetadataList().add(qtiObjectFactory.createQtiMetadata(qtiMetadata));
    }
    return qtiMetadata;
}
Also used : JAXBElement(javax.xml.bind.JAXBElement) QTIMetadataType(org.olat.imsqti.xml.manifest.QTIMetadataType)

Aggregations

QTIMetadataType (org.olat.imsqti.xml.manifest.QTIMetadataType)10 OpenOLATMetadataType (org.olat.oo.xml.manifest.OpenOLATMetadataType)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