Search in sources :

Example 16 with BGArea

use of org.olat.group.area.BGArea in project OpenOLAT by OpenOLAT.

the class KeyAndNameConverterTest method convertAreaNameToKey.

@Test
public void convertAreaNameToKey() {
    CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
    BGArea newArea = new MockArea(567l, "Area 1");
    BGAreaReference areaRef = new BGAreaReference(newArea, 345l, "Area 1");
    envMapper.getAreas().add(areaRef);
    String convertedExp = convertExpressionNameToKey("inLearningArea(\"Area 1\")", envMapper);
    Assert.assertEquals("inLearningArea(\"567\")", convertedExp);
}
Also used : BGArea(org.olat.group.area.BGArea) BGAreaReference(org.olat.group.model.BGAreaReference) CourseEnvironmentMapper(org.olat.course.export.CourseEnvironmentMapper) Test(org.junit.Test)

Example 17 with BGArea

use of org.olat.group.area.BGArea in project OpenOLAT by OpenOLAT.

the class KeyAndNameConverterTest method convertGroupAndAreaKeyToKey_sameKey.

@Test
public void convertGroupAndAreaKeyToKey_sameKey() {
    CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
    BGArea newArea = new MockArea(567l, "Area 1");
    BGAreaReference areaRef = new BGAreaReference(newArea, 345l, "Area 1");
    envMapper.getAreas().add(areaRef);
    MockBusinessGroup newGroup = new MockBusinessGroup(568l, "Group 1");
    BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, 345l, "Group 1");
    envMapper.getGroups().add(bgRef);
    String convertedExp = convertExpressionKeyToKey("inLearningArea(\"345\") & inRightGroup(\"345\")", envMapper);
    Assert.assertEquals("inLearningArea(\"567\") & inRightGroup(\"568\")", convertedExp);
}
Also used : BGArea(org.olat.group.area.BGArea) BusinessGroupReference(org.olat.group.model.BusinessGroupReference) BGAreaReference(org.olat.group.model.BGAreaReference) CourseEnvironmentMapper(org.olat.course.export.CourseEnvironmentMapper) Test(org.junit.Test)

Example 18 with BGArea

use of org.olat.group.area.BGArea in project OpenOLAT by OpenOLAT.

the class KeyAndNameConverterTest method convertGroupAndAreaNameToKey_sameName.

/**
 * Test with same name for area and group
 */
@Test
public void convertGroupAndAreaNameToKey_sameName() {
    CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
    BGArea newArea = new MockArea(567l, "Test 1");
    BGAreaReference areaRef = new BGAreaReference(newArea, 345l, "Test 1");
    envMapper.getAreas().add(areaRef);
    MockBusinessGroup newGroup = new MockBusinessGroup(568l, "Test 1");
    BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, 346l, "Test 1");
    envMapper.getGroups().add(bgRef);
    String convertedExp = convertExpressionNameToKey("inLearningArea(\"Test 1\") & inLearningGroup(\"Test 1\")", envMapper);
    Assert.assertEquals("inLearningArea(\"567\") & inLearningGroup(\"568\")", convertedExp);
}
Also used : BGArea(org.olat.group.area.BGArea) BusinessGroupReference(org.olat.group.model.BusinessGroupReference) BGAreaReference(org.olat.group.model.BGAreaReference) CourseEnvironmentMapper(org.olat.course.export.CourseEnvironmentMapper) Test(org.junit.Test)

Example 19 with BGArea

use of org.olat.group.area.BGArea in project OpenOLAT by OpenOLAT.

the class KeyAndNameConverterTest method convertAreaKeyToKey.

@Test
public void convertAreaKeyToKey() {
    CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
    BGArea newArea = new MockArea(567l, "Area 1");
    BGAreaReference areaRef = new BGAreaReference(newArea, 345l, "Area 1");
    envMapper.getAreas().add(areaRef);
    String convertedExp = convertExpressionKeyToKey("inLearningArea(\"345\")", envMapper);
    Assert.assertEquals("inLearningArea(\"567\")", convertedExp);
}
Also used : BGArea(org.olat.group.area.BGArea) BGAreaReference(org.olat.group.model.BGAreaReference) CourseEnvironmentMapper(org.olat.course.export.CourseEnvironmentMapper) Test(org.junit.Test)

Example 20 with BGArea

use of org.olat.group.area.BGArea in project OpenOLAT by OpenOLAT.

the class KeyAndNameConverterTest method convertGroupAndAreaKeyToName_sameKey.

@Test
public void convertGroupAndAreaKeyToName_sameKey() {
    CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
    BGArea newArea = new MockArea(567l, "Area 1");
    BGAreaReference areaRef = new BGAreaReference(newArea, null, null);
    envMapper.getAreas().add(areaRef);
    MockBusinessGroup newGroup = new MockBusinessGroup(567l, "Group 1");
    BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, null, null);
    envMapper.getGroups().add(bgRef);
    String convertedExp = convertExpressionKeyToName("inLearningArea(\"567\") & isLearningGroupFull(\"567\")", envMapper);
    Assert.assertEquals("inLearningArea(\"Area 1\") & isLearningGroupFull(\"Group 1\")", convertedExp);
}
Also used : BGArea(org.olat.group.area.BGArea) BusinessGroupReference(org.olat.group.model.BusinessGroupReference) BGAreaReference(org.olat.group.model.BGAreaReference) CourseEnvironmentMapper(org.olat.course.export.CourseEnvironmentMapper) Test(org.junit.Test)

Aggregations

BGArea (org.olat.group.area.BGArea)124 BusinessGroup (org.olat.group.BusinessGroup)70 Test (org.junit.Test)68 RepositoryEntry (org.olat.repository.RepositoryEntry)52 ArrayList (java.util.ArrayList)22 Identity (org.olat.core.id.Identity)22 BGAreaReference (org.olat.group.model.BGAreaReference)18 AssessmentModeToArea (org.olat.course.assessment.AssessmentModeToArea)16 CourseEnvironmentMapper (org.olat.course.export.CourseEnvironmentMapper)16 HashSet (java.util.HashSet)14 AssessmentMode (org.olat.course.assessment.AssessmentMode)12 BusinessGroupReference (org.olat.group.model.BusinessGroupReference)12 OLATResource (org.olat.resource.OLATResource)12 AssessmentModeToGroup (org.olat.course.assessment.AssessmentModeToGroup)10 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)8 CollaborationTools (org.olat.collaboration.CollaborationTools)6 BusinessGroupShort (org.olat.group.BusinessGroupShort)6 File (java.io.File)4 IOException (java.io.IOException)4 Field (java.lang.reflect.Field)4