Execute study after check action not only for solved tasks
[idea/community.git] / python / educational-core / student / src / com / jetbrains / edu / learning / checker / StudyCheckTask.java
index 5de1e25b6725224e46f9647f552b7cc0716e427f..bdeb215a89f1fbc892d78bed6a5fe8d58393ebfe 100644 (file)
@@ -100,6 +100,7 @@ public class StudyCheckTask extends com.intellij.openapi.progress.Task.Backgroun
     else {
       onTaskFailed(testsOutput);
     }
+    runAfterTaskSolvedActions();
   }
 
   protected void onTaskFailed(StudyTestsOutputParser.TestsOutput testsOutput) {
@@ -112,16 +113,15 @@ public class StudyCheckTask extends com.intellij.openapi.progress.Task.Backgroun
     myTaskManger.setStatus(myTask, StudyStatus.Solved);
     ApplicationManager.getApplication().invokeLater(
       () -> StudyCheckUtils.showTestResultPopUp(testsOutput.getMessage(), MessageType.INFO.getPopupBackground(), myProject));
-    runAfterTaskActions();
   }
 
-  private void runAfterTaskActions() {
+  private void runAfterTaskSolvedActions() {
     StudyPluginConfigurator configurator = StudyUtils.getConfigurator(myProject);
     if (configurator != null) {
       StudyAfterCheckAction[] checkActions = configurator.getAfterCheckActions();
       if (checkActions != null) {
         for (StudyAfterCheckAction action: checkActions) {
-          action.run(myProject, myTask);
+          action.run(myProject, myTask, myStatusBeforeCheck);
         }
       }
     }