use correct visible length
authorLiana.Bakradze <liana.bakradze@jetbrains.com>
Mon, 3 Oct 2016 11:01:48 +0000 (14:01 +0300)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Thu, 17 Nov 2016 14:08:27 +0000 (17:08 +0300)
python/educational-core/student/src/com/jetbrains/edu/learning/courseFormat/AnswerPlaceholder.java

index ff6ea8f7b7580838a80d28a40707ab86d7da2f2c..d952d934c793aa2c85d59f783f26a05d6c2c6cb3 100644 (file)
@@ -241,7 +241,7 @@ public class AnswerPlaceholder {
     if (minIndex > subtaskIndex) {
       return minInfo.isNeedInsertText() ? 0 : minInfo.getPlaceholderText().length();
     }
-    int maxIndex = Collections.max(ContainerUtil.filter(mySubtaskInfos.keySet(), i -> i < subtaskIndex));
+    int maxIndex = Collections.max(ContainerUtil.filter(mySubtaskInfos.keySet(), i -> i <= subtaskIndex));
     return getUseLength() ? length : mySubtaskInfos.get(maxIndex).getPossibleAnswer().length();
   }