Skip to content
Snippets Groups Projects
Commit 3448e251 authored by uhensler's avatar uhensler
Browse files

OO-4207: Count completion of accumulated nodes only once

parent 5e999401
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,9 @@ public class AverageCompletionEvaluator implements CompletionEvaluator {
AssessmentConfig assessmentConfig = courseAssessmentService.getAssessmentConfig(child);
int nodeCount = 0;
double nodeCompletion = 0.0;
if (isFullyAssessed(assessmentEvaluation)) {
if (Mode.evaluated.equals(assessmentConfig.getCompletionMode())) {
continue; // do not count twice
} else if (isFullyAssessed(assessmentEvaluation)) {
nodeCount = 1;
nodeCompletion = 1.0;
} else if (Mode.setByNode.equals(assessmentConfig.getCompletionMode())) {
......
......@@ -92,10 +92,16 @@ public class AverageCompletionEvaluatorTest {
AssessmentEvaluation childCalculatedEvaluation = createAssessmentEvaluation(mandatory, null, Double.valueOf(0.1), null, null);
scoreAccounting.put(childCalculated, childCalculatedEvaluation);
when(courseAssessmentService.getAssessmentConfig(childCalculated)).thenReturn(configEvaluated);
// Child: Calculated, fully assessed
CourseNode childCalculated2 = new STCourseNode();
parent.addChild(childCalculated2);
AssessmentEvaluation childCalculatedEvaluation2 = createAssessmentEvaluation(mandatory, null, Double.valueOf(0.1), null, Boolean.TRUE);
scoreAccounting.put(childCalculated2, childCalculatedEvaluation2);
when(courseAssessmentService.getAssessmentConfig(childCalculated2)).thenReturn(configEvaluated);
// Child level 2: calculated
CourseNode child2Uncalculated = new SPCourseNode();
childCalculated.addChild(child2Uncalculated);
childCalculated2.addChild(child2Uncalculated);
AssessmentEvaluation child2UncalculatedEvaluation = createAssessmentEvaluation(mandatory, null, Double.valueOf(1.0), null, null);
scoreAccounting.put(child2Uncalculated, child2UncalculatedEvaluation);
when(courseAssessmentService.getAssessmentConfig(child2Uncalculated)).thenReturn(configSetByNode);
......
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