fix preview for placeholders invisible on prev subtask
[idea/community.git] / 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);