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