do not show errors when switching to the next subtask
[idea/community.git] / python / educational-core / student / src / com / jetbrains / edu / learning / StudySubtaskUtils.java
index 3debdae673392317fd900abfb0c4b327d997dafd..895acdba3c2c691e93e74a7005104442ca869dc7 100644 (file)
@@ -5,13 +5,11 @@ import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.problems.WolfTheProblemSolver;
 import com.intellij.ui.EditorNotifications;
 import com.intellij.ui.EditorNotifications;
-import com.intellij.util.containers.ContainerUtil;
 import com.jetbrains.edu.learning.checker.StudyCheckUtils;
 import com.jetbrains.edu.learning.core.EduNames;
 import com.jetbrains.edu.learning.checker.StudyCheckUtils;
 import com.jetbrains.edu.learning.core.EduNames;
-import com.jetbrains.edu.learning.core.EduUtils;
 import com.jetbrains.edu.learning.courseFormat.AnswerPlaceholder;
 import com.jetbrains.edu.learning.courseFormat.AnswerPlaceholder;
-import com.jetbrains.edu.learning.courseFormat.AnswerPlaceholderSubtaskInfo;
 import com.jetbrains.edu.learning.courseFormat.Task;
 import com.jetbrains.edu.learning.courseFormat.TaskFile;
 import com.jetbrains.edu.learning.ui.StudyToolWindow;
 import com.jetbrains.edu.learning.courseFormat.Task;
 import com.jetbrains.edu.learning.courseFormat.TaskFile;
 import com.jetbrains.edu.learning.ui.StudyToolWindow;
@@ -52,6 +50,10 @@ public class StudySubtaskUtils {
       }
       updatePlaceholderTexts(project, document, taskFile, fromSubtaskIndex, toSubtaskIndex);
       EditorNotifications.getInstance(project).updateNotifications(virtualFile);
       }
       updatePlaceholderTexts(project, document, taskFile, fromSubtaskIndex, toSubtaskIndex);
       EditorNotifications.getInstance(project).updateNotifications(virtualFile);
+      if (StudyUtils.isStudyProject(project)) {
+        WolfTheProblemSolver.getInstance(project).clearProblems(virtualFile);
+        taskFile.setHighlightErrors(false);
+      }
     }
     task.setActiveSubtaskIndex(toSubtaskIndex);
     update(project, task, taskDir);
     }
     task.setActiveSubtaskIndex(toSubtaskIndex);
     update(project, task, taskDir);
@@ -71,7 +73,7 @@ public class StudySubtaskUtils {
     }
   }
 
     }
   }
 
-  public static void updatePlaceholderTexts(@NotNull Project project,
+  private static void updatePlaceholderTexts(@NotNull Project project,
                                              @NotNull Document document,
                                              @NotNull TaskFile taskFile,
                                              int fromSubtaskIndex,
                                              @NotNull Document document,
                                              @NotNull TaskFile taskFile,
                                              int fromSubtaskIndex,