From f7c65c3547f29a49bf3cd2925d4fbd52bb257e4d Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Fri, 25 Nov 2016 15:34:52 +0300 Subject: [PATCH] pass correct task file --- .../edu/coursecreator/run/PyCCCommandLineState.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/educational-python/course-creator-python/src/com/jetbrains/edu/coursecreator/run/PyCCCommandLineState.java b/python/educational-python/course-creator-python/src/com/jetbrains/edu/coursecreator/run/PyCCCommandLineState.java index 8185e689834c..1e0e70493241 100644 --- a/python/educational-python/course-creator-python/src/com/jetbrains/edu/coursecreator/run/PyCCCommandLineState.java +++ b/python/educational-python/course-creator-python/src/com/jetbrains/edu/coursecreator/run/PyCCCommandLineState.java @@ -62,14 +62,15 @@ public class PyCCCommandLineState extends PythonCommandLineState { group.addParameter(myRunConfiguration.getPathToTest()); group.addParameter(new File(course.getCourseDirectory()).getPath()); - String path = getFirstTaskFilePath(); + String path = getCurrentTaskFilePath(); if (path != null) { group.addParameter(path); } } @Nullable - private String getFirstTaskFilePath() { + private String getCurrentTaskFilePath() { + String textFile = null; for (Map.Entry entry : myTask.getTaskFiles().entrySet()) { String path = getTaskFilePath(entry.getKey()); if (!entry.getValue().getActivePlaceholders().isEmpty()) { @@ -80,10 +81,10 @@ public class PyCCCommandLineState extends PythonCommandLineState { continue; } if (TextEditorProvider.isTextFile(virtualFile)) { - return path; + textFile = path; } } - return null; + return textFile; }