diff --git a/python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyAfterCheckAction.java b/python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyAfterCheckAction.java index a112e4330de7..b85df4256cf8 100644 --- a/python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyAfterCheckAction.java +++ b/python/educational-core/student/src/com/jetbrains/edu/learning/actions/StudyAfterCheckAction.java @@ -1,10 +1,10 @@ package com.jetbrains.edu.learning.actions; -import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.project.Project; +import com.jetbrains.edu.courseFormat.StudyStatus; import com.jetbrains.edu.courseFormat.Task; import org.jetbrains.annotations.NotNull; -public abstract class StudyAfterCheckAction extends AnAction { - public abstract void run(@NotNull final Project project, @NotNull final Task solvedTask); +public abstract class StudyAfterCheckAction { + public abstract void run(@NotNull final Project project, @NotNull final Task solvedTask, StudyStatus statusBeforeCheck); } diff --git a/python/educational-core/student/src/com/jetbrains/edu/learning/checker/StudyCheckTask.java b/python/educational-core/student/src/com/jetbrains/edu/learning/checker/StudyCheckTask.java index 5de1e25b6725..bdeb215a89f1 100644 --- a/python/educational-core/student/src/com/jetbrains/edu/learning/checker/StudyCheckTask.java +++ b/python/educational-core/student/src/com/jetbrains/edu/learning/checker/StudyCheckTask.java @@ -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); } } }