diff --git a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/table/FlexiTableElementImpl.java b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/table/FlexiTableElementImpl.java
index 4e32d775053a7bbcfab2dd1b9e3dd712cd79d9a3..5b6b5024b9a88c88682e0beff849fd1ff7289116 100644
--- a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/table/FlexiTableElementImpl.java
+++ b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/table/FlexiTableElementImpl.java
@@ -924,6 +924,8 @@ public class FlexiTableElementImpl extends FormItemImpl implements FlexiTableEle
 	
 	@Override
 	public void sort(String sortKey, boolean asc) {
+		collapseAllDetails();
+		
 		SortKey key;
 		if(StringHelper.containsNonWhitespace(sortKey)) {
 			key = new SortKey(sortKey, asc);
diff --git a/src/main/java/org/olat/core/util/StringHelper.java b/src/main/java/org/olat/core/util/StringHelper.java
index a916e70550928bff3ad9765d063d6e020654ac1d..76067fcd217a235daae43774121e45c0e5555c0e 100644
--- a/src/main/java/org/olat/core/util/StringHelper.java
+++ b/src/main/java/org/olat/core/util/StringHelper.java
@@ -478,7 +478,7 @@ public class StringHelper {
 		String lcName = name.toLowerCase();
 
 		int index = 0;
-		while((index = lcExpresion.indexOf(lcName, index)) > 0) {
+		while((index = lcExpresion.indexOf(lcName, index)) >= 0) {
 			int startIndex = index;
 			int stopIndex = index + lcName.length();
 			
diff --git a/src/main/java/org/olat/course/condition/KeyAndNameConverter.java b/src/main/java/org/olat/course/condition/KeyAndNameConverter.java
new file mode 100644
index 0000000000000000000000000000000000000000..aa8586613a1b2ef4e4f1408cf4e189a57d17237d
--- /dev/null
+++ b/src/main/java/org/olat/course/condition/KeyAndNameConverter.java
@@ -0,0 +1,138 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.course.condition;
+
+import org.olat.core.util.StringHelper;
+import org.olat.course.export.CourseEnvironmentMapper;
+import org.olat.group.model.BGAreaReference;
+import org.olat.group.model.BusinessGroupReference;
+
+/**
+ * 
+ * Convert the expert rules:
+ * <ul>
+ * 	<li>Replace the name of group and area to their primary keys.</li>
+ * 	<li>Replace the key of group and area to their new primary keys.</li>
+ * 	<li>Replace the key of group and area to their new names.</li>
+ * </ul>
+ * 
+ * Initial date: 16.08.2016<br>
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
+ *
+ */
+public class KeyAndNameConverter {
+	
+	private static final String[] groupMethods = { "inLearningGroup", "inRightGroup", "isLearningGroupFull" };
+	private static final String areaMethod = "inLearningArea";
+	/**
+	 * isLearningGroupFull, inLearningGroup, inRightGroup, inLearningArea, isLearningGroupFull
+	 */
+	
+	public static String convertExpressionKeyToName(String expression, CourseEnvironmentMapper envMapper) {
+		for(String groupMethod:groupMethods) {
+			for(BusinessGroupReference group:envMapper.getGroups()) {
+				String strToMatch = groupMethod + "(\"" + group.getKey() + "\")";
+				String replacement = groupMethod + "(\"" + group.getName() + "\")";
+				expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+			}
+		}
+
+		for(BGAreaReference area:envMapper.getAreas()) {
+			String strToMatch = areaMethod + "(\"" + area.getKey() + "\")";
+			String replacement = areaMethod + "(\"" + area.getName() + "\")";
+			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+		}
+		
+		for(BusinessGroupReference group:envMapper.getGroups()) {
+			String strToMatch = "\"" + group.getKey() + "\"";
+			String replacement = "\"" + group.getName() + "\"";
+			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+		}
+		
+		for(BGAreaReference area:envMapper.getAreas()) {
+			String strToMatch = "\"" + area.getKey() + "\"";
+			String replacement = "\"" + area.getName() + "\"";
+			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+		}
+		
+		return expression;
+	}
+	
+	public static String convertExpressionNameToKey(String expression, CourseEnvironmentMapper envMapper) {
+		for(String groupMethod:groupMethods) {
+			for(BusinessGroupReference group:envMapper.getGroups()) {
+				String strToMatch = groupMethod + "(\"" + group.getOriginalName() + "\")";
+				String replacement = groupMethod + "(\"" + group.getKey() + "\")";
+				expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+			}
+		}
+		
+		for(BGAreaReference area:envMapper.getAreas()) {
+			String strToMatch = areaMethod + "(\"" + area.getOriginalName() + "\")";
+			String replacement = areaMethod + "(\"" + area.getKey() + "\")";
+			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+		}
+		
+		// fallback for special case where there is blank between the ( and "
+		for(BusinessGroupReference group:envMapper.getGroups()) {
+			String strToMatch = "\"" + group.getOriginalName() + "\"";
+			String replacement = "\"" + group.getKey() + "\"";
+			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+		}
+		for(BGAreaReference area:envMapper.getAreas()) {
+			String strToMatch = "\"" + area.getOriginalName() + "\"";
+			String replacement = "\"" + area.getKey() + "\"";
+			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+		}
+		
+		return expression;
+	}
+	
+	public static String convertExpressionKeyToKey(String expression, CourseEnvironmentMapper envMapper) {
+		for(String groupMethod:groupMethods) {
+			for(BusinessGroupReference group:envMapper.getGroups()) {
+				String strToMatch = groupMethod + "(\"" + group.getOriginalKey() + "\")";
+				String replacement = groupMethod + "(\"" + group.getKey() + "\")";
+				expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+			}
+		}
+		
+		for(BGAreaReference area:envMapper.getAreas()) {
+			String strToMatch = areaMethod + "(\"" + area.getOriginalKey() + "\")";
+			String replacement = areaMethod + "(\"" + area.getKey() + "\")";
+			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+		}
+		
+		for(BusinessGroupReference group:envMapper.getGroups()) {
+			String strToMatch = "\"" + group.getOriginalKey() + "\"";
+			String replacement = "\"" + group.getKey() + "\"";
+			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+		}
+		
+		for(BGAreaReference area:envMapper.getAreas()) {
+			String strToMatch = "\"" + area.getOriginalKey() + "\"";
+			String replacement = "\"" + area.getKey() + "\"";
+			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
+		}
+		
+		return expression;
+	}
+
+}
diff --git a/src/main/java/org/olat/course/nodes/GenericCourseNode.java b/src/main/java/org/olat/course/nodes/GenericCourseNode.java
index 904810de473bbff0cc7ffded276244b4f9c7f531..c0f0ea8e819eb01531936f9cd0359b5b9af0fa52 100644
--- a/src/main/java/org/olat/course/nodes/GenericCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/GenericCourseNode.java
@@ -47,6 +47,7 @@ import org.olat.core.util.nodes.GenericNode;
 import org.olat.core.util.xml.XStreamHelper;
 import org.olat.course.ICourse;
 import org.olat.course.condition.Condition;
+import org.olat.course.condition.KeyAndNameConverter;
 import org.olat.course.condition.additionalconditions.AdditionalCondition;
 import org.olat.course.condition.interpreter.ConditionErrorMessage;
 import org.olat.course.condition.interpreter.ConditionExpression;
@@ -63,8 +64,6 @@ import org.olat.course.run.userview.TreeFilter;
 import org.olat.course.run.userview.UserCourseEnvironment;
 import org.olat.course.statistic.StatisticResourceOption;
 import org.olat.course.statistic.StatisticResourceResult;
-import org.olat.group.model.BGAreaReference;
-import org.olat.group.model.BusinessGroupReference;
 import org.olat.ims.qti.statistics.QTIType;
 import org.olat.modules.ModuleConfiguration;
 
@@ -459,8 +458,8 @@ public abstract class GenericCourseNode extends GenericNode implements CourseNod
 		if(condition.isExpertMode()) {
 			String expression = condition.getConditionExpression();
 			if(StringHelper.containsNonWhitespace(expression)) {
-				String processExpression = convertExpressionNameToKey(expression, envMapper);
-				processExpression = convertExpressionKeyToKey(processExpression, envMapper);
+				String processExpression = KeyAndNameConverter.convertExpressionNameToKey(expression, envMapper);
+				processExpression = KeyAndNameConverter.convertExpressionKeyToKey(processExpression, envMapper);
 				if(!expression.equals(processExpression)) {
 					condition.setConditionExpression(processExpression);
 				}
@@ -512,14 +511,14 @@ public abstract class GenericCourseNode extends GenericNode implements CourseNod
 				condition.setEasyModeGroupAreaAccess(areaNames);
 				String condString = condition.getConditionFromEasyModeConfiguration();
 				if(backwardsCompatible) {
-					condString = convertExpressionKeyToName(condString, envMapper);
+					condString = KeyAndNameConverter.convertExpressionKeyToName(condString, envMapper);
 				}
 				condition.setConditionExpression(condString);
 			}
 		} else if(condition.isExpertMode() && backwardsCompatible) {
 			String expression = condition.getConditionExpression();
 			if(StringHelper.containsNonWhitespace(expression)) {
-				String processExpression = convertExpressionKeyToName(expression, envMapper);
+				String processExpression = KeyAndNameConverter.convertExpressionKeyToName(expression, envMapper);
 				if(!expression.equals(processExpression)) {
 					condition.setConditionExpression(processExpression);
 				}
@@ -533,47 +532,7 @@ public abstract class GenericCourseNode extends GenericNode implements CourseNod
 		}
 	}
 	
-	protected String convertExpressionKeyToName(String expression, CourseEnvironmentMapper envMapper) {
-		for(BusinessGroupReference group:envMapper.getGroups()) {
-			String strToMatch = "\"" + group.getKey() + "\"";
-			String replacement = "\"" + group.getName() + "\"";
-			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
-		}
-		for(BGAreaReference area:envMapper.getAreas()) {
-			String strToMatch = "\"" + area.getKey() + "\"";
-			String replacement = "\"" + area.getName() + "\"";
-			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
-		}
-		return expression;
-	}
-	
-	protected String convertExpressionNameToKey(String expression, CourseEnvironmentMapper envMapper) {
-		for(BusinessGroupReference group:envMapper.getGroups()) {
-			String strToMatch = "\"" + group.getOriginalName() + "\"";
-			String replacement = "\"" + group.getKey() + "\"";
-			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
-		}
-		for(BGAreaReference area:envMapper.getAreas()) {
-			String strToMatch = "\"" + area.getOriginalName() + "\"";
-			String replacement = "\"" + area.getKey() + "\"";
-			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
-		}
-		return expression;
-	}
-	
-	protected String convertExpressionKeyToKey(String expression, CourseEnvironmentMapper envMapper) {
-		for(BusinessGroupReference group:envMapper.getGroups()) {
-			String strToMatch = "\"" + group.getOriginalKey() + "\"";
-			String replacement = "\"" + group.getKey() + "\"";
-			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
-		}
-		for(BGAreaReference area:envMapper.getAreas()) {
-			String strToMatch = "\"" + area.getOriginalKey() + "\"";
-			String replacement = "\"" + area.getKey() + "\"";
-			expression = StringHelper.replaceAllCaseInsensitive(expression, strToMatch, replacement);
-		}
-		return expression;
-	}
+
 
 	/**
 	 * @see org.olat.core.gui.ShortName#getShortName()
diff --git a/src/main/java/org/olat/course/nodes/STCourseNode.java b/src/main/java/org/olat/course/nodes/STCourseNode.java
index e93c8d9dda3b0e7d9f387f4e652e7c4ad592f633..3eecbde67bd5f38cbcd5e7ff5055e60a00f13408 100644
--- a/src/main/java/org/olat/course/nodes/STCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/STCourseNode.java
@@ -56,6 +56,7 @@ import org.olat.course.CourseFactory;
 import org.olat.course.CourseModule;
 import org.olat.course.ICourse;
 import org.olat.course.condition.Condition;
+import org.olat.course.condition.KeyAndNameConverter;
 import org.olat.course.condition.interpreter.ConditionExpression;
 import org.olat.course.condition.interpreter.ConditionInterpreter;
 import org.olat.course.editor.CourseEditorEnv;
@@ -692,8 +693,8 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Calcul
 		boolean changed = false;
 		if(StringHelper.containsNonWhitespace(calculator.getScoreExpression())) {
 			String score = calculator.getScoreExpression();
-			String processedExpression = convertExpressionNameToKey(score, envMapper);
-			processedExpression = convertExpressionKeyToKey(score, envMapper);
+			String processedExpression = KeyAndNameConverter.convertExpressionNameToKey(score, envMapper);
+			processedExpression = KeyAndNameConverter.convertExpressionKeyToKey(score, envMapper);
 			if(!processedExpression.equals(score)) {
 				calculator.setScoreExpression(processedExpression);
 				changed = true;
@@ -702,8 +703,8 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Calcul
 		
 		if(StringHelper.containsNonWhitespace(calculator.getPassedExpression())) {
 			String passed = calculator.getPassedExpression();
-			String processedExpression = convertExpressionNameToKey(passed, envMapper);
-			processedExpression = convertExpressionKeyToKey(passed, envMapper);
+			String processedExpression = KeyAndNameConverter.convertExpressionNameToKey(passed, envMapper);
+			processedExpression = KeyAndNameConverter.convertExpressionKeyToKey(passed, envMapper);
 			if(!processedExpression.equals(passed)) {
 				calculator.setScoreExpression(processedExpression);
 				changed = true;
@@ -725,7 +726,7 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Calcul
 			boolean changed = false;
 			if(StringHelper.containsNonWhitespace(calculator.getScoreExpression())) {
 				String score = calculator.getScoreExpression();
-				String processedExpression = convertExpressionKeyToName(score, envMapper);
+				String processedExpression = KeyAndNameConverter.convertExpressionKeyToName(score, envMapper);
 				if(!processedExpression.equals(score)) {
 					calculator.setScoreExpression(processedExpression);
 					changed = true;
@@ -734,7 +735,7 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Calcul
 			
 			if(StringHelper.containsNonWhitespace(calculator.getPassedExpression())) {
 				String passed = calculator.getPassedExpression();
-				String processedExpression = convertExpressionKeyToName(passed, envMapper);
+				String processedExpression = KeyAndNameConverter.convertExpressionKeyToName(passed, envMapper);
 				if(!processedExpression.equals(passed)) {
 					calculator.setScoreExpression(processedExpression);
 					changed = true;
diff --git a/src/test/java/org/olat/course/condition/KeyAndNameConverterTest.java b/src/test/java/org/olat/course/condition/KeyAndNameConverterTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..757bbe836862df1529a322acc62fc96c7707b950
--- /dev/null
+++ b/src/test/java/org/olat/course/condition/KeyAndNameConverterTest.java
@@ -0,0 +1,254 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.course.condition;
+
+import static org.olat.course.condition.KeyAndNameConverter.convertExpressionKeyToKey;
+import static org.olat.course.condition.KeyAndNameConverter.convertExpressionKeyToName;
+import static org.olat.course.condition.KeyAndNameConverter.convertExpressionNameToKey;
+
+import java.util.Date;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.olat.core.id.Persistable;
+import org.olat.course.export.CourseEnvironmentMapper;
+import org.olat.group.BusinessGroupManagedFlag;
+import org.olat.group.BusinessGroupShort;
+import org.olat.group.area.BGArea;
+import org.olat.group.model.BGAreaReference;
+import org.olat.group.model.BusinessGroupReference;
+import org.olat.resource.OLATResource;
+
+/**
+ * 
+ * Initial date: 16.08.2016<br>
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
+ *
+ */
+public class KeyAndNameConverterTest {
+	
+	@Test
+	public void convertBusinessGroupNameToKey() {
+		CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
+		MockBusinessGroup newGroup = new MockBusinessGroup(567l, "Group 1");
+		BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, 345l, "Group 1");
+		envMapper.getGroups().add(bgRef);
+
+		String convertedExp = convertExpressionNameToKey("inLearningGroup(\"Group 1\")", envMapper);
+		Assert.assertEquals("inLearningGroup(\"567\")", convertedExp);
+	}
+	
+	@Test
+	public void convertBusinessGroupKeyToKey() {
+		CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
+		MockBusinessGroup newGroup = new MockBusinessGroup(567l, "Group 1");
+		BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, 345l, "Group 1");
+		envMapper.getGroups().add(bgRef);
+
+		String convertedExp = convertExpressionKeyToKey("inRightGroup(\"345\")", envMapper);
+		Assert.assertEquals("inRightGroup(\"567\")", convertedExp);
+	}
+	
+	@Test
+	public void convertBusinessGroupKeyToName() {
+		CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
+		MockBusinessGroup newGroup = new MockBusinessGroup(567l, "Group 1");
+		BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, null, null);
+		envMapper.getGroups().add(bgRef);
+
+		String convertedExp = convertExpressionKeyToName("isLearningGroupFull(\"567\")", envMapper);
+		Assert.assertEquals("isLearningGroupFull(\"Group 1\")", convertedExp);
+	}
+	
+	@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);
+	}
+	
+	@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);
+	}
+	
+	@Test
+	public void convertAreaKeyToName() {
+		CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
+		BGArea newArea = new MockArea(567l, "Area 1");
+		BGAreaReference areaRef = new BGAreaReference(newArea, null, null);
+		envMapper.getAreas().add(areaRef);
+
+		String convertedExp = convertExpressionKeyToName("inLearningArea(\"567\")", envMapper);
+		Assert.assertEquals("inLearningArea(\"Area 1\")", convertedExp);
+	}
+	
+	/**
+	 * 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);
+	}
+	
+	@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);
+	}
+	
+	@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);
+	}
+	
+
+	private static class MockArea implements BGArea {
+
+		private static final long serialVersionUID = 4486855369163795150L;
+		private final Long key;
+		private final String name;
+		
+		public MockArea(Long key, String name) {
+			this.key = key;
+			this.name = name;
+		}
+
+		@Override
+		public Long getKey() {
+			return key;
+		}
+
+		@Override
+		public boolean equalsByPersistableKey(Persistable persistable) {
+			return false;
+		}
+
+		@Override
+		public Date getCreationDate() {
+			return null;
+		}
+
+		@Override
+		public String getShortName() {
+			return name;
+		}
+
+		@Override
+		public String getDescription() {
+			return null;
+		}
+
+		@Override
+		public void setDescription(String description) {
+			//
+		}
+
+		@Override
+		public OLATResource getResource() {
+			return null;
+		}
+
+		@Override
+		public String getName() {
+			return name;
+		}
+
+		@Override
+		public void setName(String name) {
+			//
+		}
+	}
+	
+	private static class MockBusinessGroup implements BusinessGroupShort {
+		
+		private final Long key;
+		private final String name;
+		
+		public MockBusinessGroup(Long key, String name) {
+			this.key = key;
+			this.name = name;
+		}
+
+		@Override
+		public Long getKey() {
+			return key;
+		}
+
+		@Override
+		public String getResourceableTypeName() {
+			return null;
+		}
+
+		@Override
+		public Long getResourceableId() {
+			return null;
+		}
+
+		@Override
+		public String getName() {
+			return name;
+		}
+
+		@Override
+		public BusinessGroupManagedFlag[] getManagedFlags() {
+			return new BusinessGroupManagedFlag[0];
+		}
+	}
+}
diff --git a/src/test/java/org/olat/test/AllTestsJunit4.java b/src/test/java/org/olat/test/AllTestsJunit4.java
index 127ec6d9f0a828bde10923f4df76d2a6f21cf147..0f5562e28e72a39f7f94a978a22cbaf7133c1625 100644
--- a/src/test/java/org/olat/test/AllTestsJunit4.java
+++ b/src/test/java/org/olat/test/AllTestsJunit4.java
@@ -129,6 +129,8 @@ import org.junit.runners.Suite;
 	org.olat.instantMessaging.InstantMessagePreferencesDAOTest.class,
 	org.olat.instantMessaging.RosterDAOTest.class,
 	org.olat.instantMessaging.InstantMessageServiceTest.class,
+	org.olat.course.condition.ConditionTest.class,
+	org.olat.course.condition.KeyAndNameConverterTest.class,
 	org.olat.course.nodes.en.EnrollmentManagerSerialTest.class,
 	org.olat.course.nodes.en.EnrollmentManagerConcurrentTest.class,
 	org.olat.course.nodes.gta.manager.GTAManagerTest.class,