Search in sources :

Example 6 with EducationalType

use of org.olat.imsmd.xml.manifest.EducationalType 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 7 with EducationalType

use of org.olat.imsmd.xml.manifest.EducationalType 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 8 with EducationalType

use of org.olat.imsmd.xml.manifest.EducationalType in project openolat by klemens.

the class ManifestMetadataBuilder method getEducational.

public EducationalType getEducational(boolean create) {
    LomType lom = getLom(create);
    if (lom == null)
        return null;
    EducationalType educational = lom.getEducational();
    if (educational == null && create) {
        educational = mdObjectFactory.createEducationalType();
        lom.setEducational(educational);
    }
    return educational;
}
Also used : EducationalType(org.olat.imsmd.xml.manifest.EducationalType) LomType(org.olat.imsmd.xml.manifest.LomType)

Example 9 with EducationalType

use of org.olat.imsmd.xml.manifest.EducationalType in project openolat by klemens.

the class ManifestMetadataBuilder method getEducationContext.

public String getEducationContext() {
    EducationalType educational = getEducational(true);
    StringBuilder sb = new StringBuilder();
    if (educational != null) {
        ContextType type = getFromAny(ContextType.class, educational.getContent());
        if (type != null && type.getSource() != null && type.getSource().getLangstring() != null && type.getValue() != null && type.getValue().getLangstring() != null) {
            String source = type.getSource().getLangstring().getValue();
            String value = type.getValue().getLangstring().getValue();
            if (StringHelper.containsNonWhitespace(source) && StringHelper.containsNonWhitespace(value)) {
                sb.append(value);
            }
        }
    }
    return sb.length() == 0 ? null : sb.toString();
}
Also used : ContextType(org.olat.imsmd.xml.manifest.ContextType) EducationalType(org.olat.imsmd.xml.manifest.EducationalType)

Example 10 with EducationalType

use of org.olat.imsmd.xml.manifest.EducationalType in project openolat by klemens.

the class ManifestMetadataBuilder method setEducationalContext.

public void setEducationalContext(String context, String lang) {
    EducationalType educational = getEducational(true);
    if (educational != null) {
        ContextType type = getFromAny(ContextType.class, educational.getContent());
        if (type == null) {
            type = mdObjectFactory.createContextType();
            educational.getContent().add(mdObjectFactory.createContext(type));
        }
        SourceType sourceType = mdObjectFactory.createSourceType();
        sourceType.setLangstring(createString("https://www.openolat.org", lang));
        ValueType valueType = mdObjectFactory.createValueType();
        valueType.setLangstring(createString(context, lang));
        type.setSource(sourceType);
        type.setValue(valueType);
    }
}
Also used : ContextType(org.olat.imsmd.xml.manifest.ContextType) ValueType(org.olat.imsmd.xml.manifest.ValueType) EducationalType(org.olat.imsmd.xml.manifest.EducationalType) SourceType(org.olat.imsmd.xml.manifest.SourceType)

Aggregations

EducationalType (org.olat.imsmd.xml.manifest.EducationalType)10 ContextType (org.olat.imsmd.xml.manifest.ContextType)4 BigDecimal (java.math.BigDecimal)2 LomType (org.olat.imsmd.xml.manifest.LomType)2 SourceType (org.olat.imsmd.xml.manifest.SourceType)2 TypicallearningtimeType (org.olat.imsmd.xml.manifest.TypicallearningtimeType)2 ValueType (org.olat.imsmd.xml.manifest.ValueType)2 QTIMetadataType (org.olat.imsqti.xml.manifest.QTIMetadataType)2 OpenOLATMetadataType (org.olat.oo.xml.manifest.OpenOLATMetadataType)2