Skip to content
Snippets Groups Projects
Commit 4d358cfe authored by uhensler's avatar uhensler
Browse files

OO-4582: Fail if participant has to pass all course elements but a course element is failed

parent d513520f
No related branches found
No related tags found
No related merge requests found
...@@ -90,10 +90,11 @@ public class STRootPassedEvaluator implements RootPassedEvaluator { ...@@ -90,10 +90,11 @@ public class STRootPassedEvaluator implements RootPassedEvaluator {
// All passed // All passed
if (config.getBooleanSafe(STCourseNode.CONFIG_PASSED_ALL)) { if (config.getBooleanSafe(STCourseNode.CONFIG_PASSED_ALL)) {
Counts counts = passCounter.getCounts(courseNode, scoreAccounting); Counts counts = passCounter.getCounts(courseNode, scoreAccounting);
if (counts.isAllAssessed() && counts.getPassable() > 0) { if (counts.getPassable() > 0) {
if (counts.getPassable() == counts.getPassed()) { if (counts.isAllAssessed() && counts.getPassable() == counts.getPassed()) {
return Boolean.TRUE; return Boolean.TRUE;
} else if (getActivePassedConfigs(config) == 1) { }
if (counts.getFailed() > 0 && getActivePassedConfigs(config) == 1) {
return Boolean.FALSE; return Boolean.FALSE;
} }
} }
......
...@@ -213,7 +213,7 @@ public class STRootPassedEvaluatorTest { ...@@ -213,7 +213,7 @@ public class STRootPassedEvaluatorTest {
courseNode.getModuleConfiguration().setBooleanEntry(STCourseNode.CONFIG_PASSED_ALL, true); courseNode.getModuleConfiguration().setBooleanEntry(STCourseNode.CONFIG_PASSED_ALL, true);
ScoreAccounting scoreAccounting = new MappedScoreAccounting(); ScoreAccounting scoreAccounting = new MappedScoreAccounting();
Counts counts = new CountsImpl(3, 2, 1); Counts counts = new CountsImpl(3, 1, 1);
PassCounter passCounter = mock(PassCounter.class); PassCounter passCounter = mock(PassCounter.class);
when(passCounter.getCounts(any(), any())).thenReturn(counts); when(passCounter.getCounts(any(), any())).thenReturn(counts);
STRootPassedEvaluator sut = new STRootPassedEvaluator(passCounter); STRootPassedEvaluator sut = new STRootPassedEvaluator(passCounter);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment