use of org.olat.modules.taxonomy.TaxonomyLevel in project OpenOLAT by OpenOLAT.
the class QPoolTaxonomyTreeBuilder method computeIntendention.
private StringBuilder computeIntendention(TaxonomyLevel level, StringBuilder intendation) {
TaxonomyLevel parent = level.getParent();
if (parent != null && selectableTaxonomyLevels.contains(parent)) {
intendation = intendation.append(INTENDING).append(INTENDING).append(INTENDING).append(INTENDING);
computeIntendention(parent, intendation);
}
return intendation;
}
use of org.olat.modules.taxonomy.TaxonomyLevel in project OpenOLAT by OpenOLAT.
the class QPoolTaxonomyTreeBuilderTest method shouldFindTaxonomyLevel.
@Test
public void shouldFindTaxonomyLevel() {
sut.loadTaxonomyLevelsMy(null);
TaxonomyLevel taxonomyLevel = sut.getTaxonomyLevel(Long.toString(RUSSIAN_KEY));
assertThat(taxonomyLevel.getKey()).isEqualTo(RUSSIAN_KEY);
}
use of org.olat.modules.taxonomy.TaxonomyLevel in project OpenOLAT by OpenOLAT.
the class QPoolTaxonomyTreeBuilderTest method createLevelsOfClassicSchoolTaxonomy.
private List<TaxonomyLevel> createLevelsOfClassicSchoolTaxonomy() {
List<TaxonomyLevel> levels = new ArrayList<>();
TaxonomyLevel math = new TestableTaxonomyLevel(MATH_KEY, MATH, null);
levels.add(math);
TaxonomyLevel geom = new TestableTaxonomyLevel(GEOM_KEY, GEOM, math);
levels.add(geom);
TaxonomyLevel algebra = new TestableTaxonomyLevel(ALGEBRA_KEY, ALGEBRA, math);
levels.add(algebra);
TaxonomyLevel language = new TestableTaxonomyLevel(LANGUAGE_KEY, LANGUAGE, null);
levels.add(language);
TaxonomyLevel english = new TestableTaxonomyLevel(ENGLISH_KEY, ENGLISH, language);
levels.add(english);
TaxonomyLevel hindi = new TestableTaxonomyLevel(HINDI_KEY, HINDI, language);
levels.add(hindi);
TaxonomyLevel russian = new TestableTaxonomyLevel(RUSSIAN_KEY, RUSSIAN, language);
levels.add(russian);
TaxonomyLevel latin = new TestableTaxonomyLevel(LATIN_KEY, LATIN, language);
levels.add(latin);
return levels;
}
use of org.olat.modules.taxonomy.TaxonomyLevel in project OpenOLAT by OpenOLAT.
the class TaxonomyCompetenceAuditLogDAOTest method auditLog.
@Test
public void auditLog() {
Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("competent-1");
Taxonomy taxonomy = taxonomyDao.createTaxonomy("ID-24", "Competence", "", null);
TaxonomyLevel level = taxonomyLevelDao.createTaxonomyLevel("ID-Level-1", "Competence level", "A very difficult competence", null, null, null, null, taxonomy);
TaxonomyCompetence competence = taxonomyCompetenceDao.createTaxonomyCompetence(TaxonomyCompetenceTypes.have, level, id, null);
dbInstance.commit();
String after = taxonomyCompetenceAuditLogDao.toXml(competence);
taxonomyCompetenceAuditLogDao.auditLog(TaxonomyCompetenceAuditLog.Action.addCompetence, "Before", "After", "Message", taxonomy, competence, id, null);
dbInstance.commit();
Assert.assertNotNull(after);
}
use of org.olat.modules.taxonomy.TaxonomyLevel 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());
}
Aggregations