fix preview for placeholders invisible on prev subtask
authorLiana.Bakradze <liana.bakradze@jetbrains.com>
Fri, 30 Sep 2016 11:15:44 +0000 (14:15 +0300)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Thu, 17 Nov 2016 14:08:22 +0000 (17:08 +0300)
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCShowPreview.java

index b6e1e806ce41637deb27a2715df7f6a60090c02c..fcf44cf7643444ab2306e9e0b64c70c7e80c7759 100644 (file)
@@ -148,6 +148,9 @@ public class CCShowPreview extends DumbAwareAction {
       }
     });
     for (AnswerPlaceholder answerPlaceholder : taskFile.getActivePlaceholders()) {
+      if (answerPlaceholder.getActiveSubtaskInfo().isNeedInsertText()) {
+        answerPlaceholder.setLength(answerPlaceholder.getTaskText().length());
+      }
       Integer minIndex = Collections.min(answerPlaceholder.getSubtaskInfos().keySet());
       answerPlaceholder.setUseLength(minIndex >= answerPlaceholder.getActiveSubtaskIndex());
       EduAnswerPlaceholderPainter.drawAnswerPlaceholder(createdEditor, answerPlaceholder, JBColor.BLUE);