Search in sources :

Example 36 with TaxonomyLevel

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;
}
Also used : TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel)

Example 37 with TaxonomyLevel

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);
}
Also used : TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel) Test(org.junit.Test)

Example 38 with TaxonomyLevel

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;
}
Also used : TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel) ArrayList(java.util.ArrayList)

Example 39 with TaxonomyLevel

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);
}
Also used : Taxonomy(org.olat.modules.taxonomy.Taxonomy) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel) TaxonomyCompetence(org.olat.modules.taxonomy.TaxonomyCompetence) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Example 40 with TaxonomyLevel

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

TaxonomyLevel (org.olat.modules.taxonomy.TaxonomyLevel)238 Taxonomy (org.olat.modules.taxonomy.Taxonomy)122 Test (org.junit.Test)106 Identity (org.olat.core.id.Identity)58 ArrayList (java.util.ArrayList)40 TaxonomyCompetence (org.olat.modules.taxonomy.TaxonomyCompetence)40 TaxonomyLevelType (org.olat.modules.taxonomy.TaxonomyLevelType)34 Date (java.util.Date)24 TaxonomyLevelRefImpl (org.olat.modules.taxonomy.model.TaxonomyLevelRefImpl)24 URI (java.net.URI)22 HttpResponse (org.apache.http.HttpResponse)22 TreeNode (org.olat.core.gui.components.tree.TreeNode)22 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)18 QuestionItemImpl (org.olat.modules.qpool.model.QuestionItemImpl)16 HashMap (java.util.HashMap)14 List (java.util.List)14 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)12 TaxonomyCompetenceTypes (org.olat.modules.taxonomy.TaxonomyCompetenceTypes)12 TaxonomyTreeNode (org.olat.modules.taxonomy.model.TaxonomyTreeNode)12 Path (javax.ws.rs.Path)10