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 {
/* Selection without replacement */
for (int i=0; i<remainingSelections; i++) {
int index = maxIndex(childrenMaxScore);
MaxScoreVisitor max = childrenMaxScore.get(index);
childrenMaxScore.set(index, null);
visitor.add(max);
if(index >= 0 && index < childrenMaxScore.size()) {
MaxScoreVisitor max = childrenMaxScore.get(index);
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