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);
}
}
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();
}
}
}
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();
}
}
}
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);
}
}
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;
}
Aggregations