fix migration to detect answer files without extension
authorliana.bakradze <liana.bakradze@jetbrains.com>
Wed, 3 Aug 2016 14:35:46 +0000 (17:35 +0300)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Wed, 3 Aug 2016 14:39:05 +0000 (17:39 +0300)
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/CCProjectService.java

index 59d67e6ca38d95354758d81ea5856f6355ca96ed..b009d097b52a1b10ddca01d563937005a168806e 100644 (file)
@@ -84,7 +84,10 @@ public class CCProjectService implements PersistentStateComponent<Element> {
             String answerName = FileUtil.getNameWithoutExtension(name) + CCUtils.ANSWER_EXTENSION_DOTTED + FileUtilRt.getExtension(name);
             Document document = StudyUtils.getDocument(myProject.getBasePath(), lessonIndex, taskIndex, answerName);
             if (document == null) {
             String answerName = FileUtil.getNameWithoutExtension(name) + CCUtils.ANSWER_EXTENSION_DOTTED + FileUtilRt.getExtension(name);
             Document document = StudyUtils.getDocument(myProject.getBasePath(), lessonIndex, taskIndex, answerName);
             if (document == null) {
-              continue;
+              document = StudyUtils.getDocument(myProject.getBasePath(), lessonIndex, taskIndex, name);
+              if (document == null) {
+                continue;
+              }
             }
             for (Element placeholder : getChildList(taskFileElement, ANSWER_PLACEHOLDERS, true)) {
               Element lineElement = getChildWithName(placeholder, LINE, true);
             }
             for (Element placeholder : getChildList(taskFileElement, ANSWER_PLACEHOLDERS, true)) {
               Element lineElement = getChildWithName(placeholder, LINE, true);