Skip to content
Snippets Groups Projects
Commit 9a62d930 authored by srosse's avatar srosse
Browse files

OO-5096: check index if no max score found

parent 6eb2d7da
No related branches found
No related tags found
No related merge requests found
...@@ -148,9 +148,11 @@ public class QtiMaxScoreEstimator { ...@@ -148,9 +148,11 @@ public class QtiMaxScoreEstimator {
/* Selection without replacement */ /* Selection without replacement */
for (int i=0; i<remainingSelections; i++) { for (int i=0; i<remainingSelections; i++) {
int index = maxIndex(childrenMaxScore); int index = maxIndex(childrenMaxScore);
MaxScoreVisitor max = childrenMaxScore.get(index); if(index >= 0 && index < childrenMaxScore.size()) {
childrenMaxScore.set(index, null); MaxScoreVisitor max = childrenMaxScore.get(index);
visitor.add(max); childrenMaxScore.set(index, null);
visitor.add(max);
}
} }
} }
} }
......
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