Search in sources :

Example 1 with QTIMetadataConverter

use of org.olat.ims.qti.qpool.QTIMetadataConverter in project OpenOLAT by OpenOLAT.

the class QTI21ImportProcessor method processItemMetadata.

// additionalInformations, assessmentType
protected void processItemMetadata(QuestionItemImpl poolItem, AssessmentItemMetadata metadata) {
    // non heuristic set of question type
    String typeStr = null;
    QTI21QuestionType questionType = metadata.getQuestionType();
    if (questionType != null && questionType.getPoolQuestionType() != null) {
        typeStr = questionType.getPoolQuestionType().name();
    }
    if (typeStr != null) {
        QItemType type = qItemTypeDao.loadByType(typeStr);
        if (type != null) {
            poolItem.setType(type);
        }
    }
    String coverage = metadata.getCoverage();
    if (StringHelper.containsNonWhitespace(coverage)) {
        poolItem.setCoverage(coverage);
    }
    String language = metadata.getLanguage();
    if (StringHelper.containsNonWhitespace(language)) {
        poolItem.setLanguage(language);
    }
    String keywords = metadata.getKeywords();
    if (StringHelper.containsNonWhitespace(keywords)) {
        poolItem.setKeywords(keywords);
    }
    String taxonomyPath = metadata.getTaxonomyPath();
    if (StringHelper.containsNonWhitespace(taxonomyPath)) {
        QTIMetadataConverter converter = new QTIMetadataConverter(qItemTypeDao, qEduContextDao, qpoolService);
        TaxonomyLevel taxonomyLevel = converter.toTaxonomy(taxonomyPath);
        poolItem.setTaxonomyLevel(taxonomyLevel);
    }
    // educational
    String level = metadata.getLevel();
    if (StringHelper.containsNonWhitespace(level)) {
        QTIMetadataConverter converter = new QTIMetadataConverter(qItemTypeDao, qEduContextDao, qpoolService);
        QEducationalContext educationalContext = converter.toEducationalContext(level);
        poolItem.setEducationalContext(educationalContext);
    }
    String time = metadata.getTypicalLearningTime();
    if (StringHelper.containsNonWhitespace(time)) {
        poolItem.setEducationalLearningTime(time);
    }
    String editor = metadata.getEditor();
    if (StringHelper.containsNonWhitespace(editor)) {
        poolItem.setEditor(editor);
    }
    String editorVersion = metadata.getEditorVersion();
    if (StringHelper.containsNonWhitespace(editorVersion)) {
        poolItem.setEditorVersion(editorVersion);
    }
    // OpenOLAT
    poolItem.setDifficulty(metadata.getDifficulty());
    poolItem.setDifferentiation(metadata.getDifferentiation());
    poolItem.setStdevDifficulty(metadata.getStdevDifficulty());
    int numOfAnswerAlternatives = metadata.getNumOfAnswerAlternatives();
    if (numOfAnswerAlternatives > 0) {
        poolItem.setNumOfAnswerAlternatives(numOfAnswerAlternatives);
    }
    poolItem.setTopic(metadata.getTopic());
    poolItem.setAssessmentType(metadata.getAssessmentType());
    poolItem.setAdditionalInformations(metadata.getAdditionalInformations());
}
Also used : QTIMetadataConverter(org.olat.ims.qti.qpool.QTIMetadataConverter) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel) QTI21QuestionType(org.olat.ims.qti21.model.QTI21QuestionType) QEducationalContext(org.olat.modules.qpool.model.QEducationalContext) QItemType(org.olat.modules.qpool.model.QItemType)

Example 2 with QTIMetadataConverter

use of org.olat.ims.qti.qpool.QTIMetadataConverter in project OpenOLAT by OpenOLAT.

the class QTI21ImportProcessor method createLicense.

private void createLicense(QuestionItemImpl poolItem, AssessmentItemMetadata metadata) {
    String license = metadata.getLicense();
    String licensor = metadata.getCreator();
    QTIMetadataConverter converter = new QTIMetadataConverter(qItemTypeDao, qEduContextDao, qpoolService);
    converter.createLicense(poolItem, license, licensor);
}
Also used : QTIMetadataConverter(org.olat.ims.qti.qpool.QTIMetadataConverter)

Example 3 with QTIMetadataConverter

use of org.olat.ims.qti.qpool.QTIMetadataConverter in project openolat by klemens.

the class QTI21ImportProcessor method createLicense.

private void createLicense(QuestionItemImpl poolItem, AssessmentItemMetadata metadata) {
    String license = metadata.getLicense();
    String licensor = metadata.getCreator();
    QTIMetadataConverter converter = new QTIMetadataConverter(qItemTypeDao, qEduContextDao, qpoolService);
    converter.createLicense(poolItem, license, licensor);
}
Also used : QTIMetadataConverter(org.olat.ims.qti.qpool.QTIMetadataConverter)

Example 4 with QTIMetadataConverter

use of org.olat.ims.qti.qpool.QTIMetadataConverter in project openolat by klemens.

the class QTI21ImportProcessor method processItemMetadata.

// additionalInformations, assessmentType
protected void processItemMetadata(QuestionItemImpl poolItem, AssessmentItemMetadata metadata) {
    // non heuristic set of question type
    String typeStr = null;
    QTI21QuestionType questionType = metadata.getQuestionType();
    if (questionType != null && questionType.getPoolQuestionType() != null) {
        typeStr = questionType.getPoolQuestionType().name();
    }
    if (typeStr != null) {
        QItemType type = qItemTypeDao.loadByType(typeStr);
        if (type != null) {
            poolItem.setType(type);
        }
    }
    String coverage = metadata.getCoverage();
    if (StringHelper.containsNonWhitespace(coverage)) {
        poolItem.setCoverage(coverage);
    }
    String language = metadata.getLanguage();
    if (StringHelper.containsNonWhitespace(language)) {
        poolItem.setLanguage(language);
    }
    String keywords = metadata.getKeywords();
    if (StringHelper.containsNonWhitespace(keywords)) {
        poolItem.setKeywords(keywords);
    }
    String taxonomyPath = metadata.getTaxonomyPath();
    if (StringHelper.containsNonWhitespace(taxonomyPath)) {
        QTIMetadataConverter converter = new QTIMetadataConverter(qItemTypeDao, qEduContextDao, qpoolService);
        TaxonomyLevel taxonomyLevel = converter.toTaxonomy(taxonomyPath);
        poolItem.setTaxonomyLevel(taxonomyLevel);
    }
    // educational
    String level = metadata.getLevel();
    if (StringHelper.containsNonWhitespace(level)) {
        QTIMetadataConverter converter = new QTIMetadataConverter(qItemTypeDao, qEduContextDao, qpoolService);
        QEducationalContext educationalContext = converter.toEducationalContext(level);
        poolItem.setEducationalContext(educationalContext);
    }
    String time = metadata.getTypicalLearningTime();
    if (StringHelper.containsNonWhitespace(time)) {
        poolItem.setEducationalLearningTime(time);
    }
    String editor = metadata.getEditor();
    if (StringHelper.containsNonWhitespace(editor)) {
        poolItem.setEditor(editor);
    }
    String editorVersion = metadata.getEditorVersion();
    if (StringHelper.containsNonWhitespace(editorVersion)) {
        poolItem.setEditorVersion(editorVersion);
    }
    // OpenOLAT
    poolItem.setDifficulty(metadata.getDifficulty());
    poolItem.setDifferentiation(metadata.getDifferentiation());
    poolItem.setStdevDifficulty(metadata.getStdevDifficulty());
    int numOfAnswerAlternatives = metadata.getNumOfAnswerAlternatives();
    if (numOfAnswerAlternatives > 0) {
        poolItem.setNumOfAnswerAlternatives(numOfAnswerAlternatives);
    }
    poolItem.setTopic(metadata.getTopic());
    poolItem.setAssessmentType(metadata.getAssessmentType());
    poolItem.setAdditionalInformations(metadata.getAdditionalInformations());
}
Also used : QTIMetadataConverter(org.olat.ims.qti.qpool.QTIMetadataConverter) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel) QTI21QuestionType(org.olat.ims.qti21.model.QTI21QuestionType) QEducationalContext(org.olat.modules.qpool.model.QEducationalContext) QItemType(org.olat.modules.qpool.model.QItemType)

Aggregations

QTIMetadataConverter (org.olat.ims.qti.qpool.QTIMetadataConverter)4 QTI21QuestionType (org.olat.ims.qti21.model.QTI21QuestionType)2 QEducationalContext (org.olat.modules.qpool.model.QEducationalContext)2 QItemType (org.olat.modules.qpool.model.QItemType)2 TaxonomyLevel (org.olat.modules.taxonomy.TaxonomyLevel)2