diff --git a/python/educational-core/resources/META-INF/plugin.xml b/python/educational-core/resources/META-INF/plugin.xml
index 5890a75bf8fd..630f26649fc4 100644
--- a/python/educational-core/resources/META-INF/plugin.xml
+++ b/python/educational-core/resources/META-INF/plugin.xml
@@ -52,6 +52,7 @@
+
diff --git a/python/educational-core/src/com/jetbrains/edu/learning/builtInServer/EduProjectCreator.java b/python/educational-core/src/com/jetbrains/edu/learning/builtInServer/EduProjectCreator.java
new file mode 100644
index 000000000000..b1d5fe692292
--- /dev/null
+++ b/python/educational-core/src/com/jetbrains/edu/learning/builtInServer/EduProjectCreator.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2017 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jetbrains.edu.learning.builtInServer;
+
+import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.extensions.Extensions;
+import com.jetbrains.edu.learning.courseFormat.Course;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author meanmail
+ */
+public class EduProjectCreator {
+ public static final ExtensionPointName EP_NAME = ExtensionPointName.create("Edu.eduProjectCreator");
+
+ public static boolean createProject(@NotNull Course course) {
+ EduProjectCreator[] extensions = Extensions.getExtensions(EP_NAME);
+
+ for (EduProjectCreator projectCreator : extensions) {
+ if (projectCreator.canCreateProject(course)) {
+ return projectCreator.createCourseProject(course);
+ }
+ }
+
+ return false;
+ }
+
+ private boolean createCourseProject(@NotNull Course course) {
+ return false;
+ }
+
+ private boolean canCreateProject(@NotNull Course course) {
+ return false;
+ }
+}
diff --git a/python/educational-core/src/com/jetbrains/edu/learning/builtInServer/StepikRestService.java b/python/educational-core/src/com/jetbrains/edu/learning/builtInServer/StepikRestService.java
index a7dccdb18fe3..1bc202028d9f 100644
--- a/python/educational-core/src/com/jetbrains/edu/learning/builtInServer/StepikRestService.java
+++ b/python/educational-core/src/com/jetbrains/edu/learning/builtInServer/StepikRestService.java
@@ -28,6 +28,7 @@ import com.intellij.openapi.wm.WindowManager;
import com.jetbrains.edu.learning.StudyTaskManager;
import com.jetbrains.edu.learning.courseFormat.Course;
import com.jetbrains.edu.learning.courseFormat.RemoteCourse;
+import com.jetbrains.edu.learning.intellij.generation.EduProjectGenerator;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.HttpMethod;
@@ -44,6 +45,7 @@ import org.jetbrains.ide.RestService;
import java.awt.*;
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -197,6 +199,19 @@ public class StepikRestService extends RestService {
}
private static boolean createProjectAndOpen(int courseId) {
+ EduProjectGenerator generator = new EduProjectGenerator();
+ Project defaultProject = ProjectManager.getInstance().getDefaultProject();
+ String title = "Getting Available Courses";
+ List availableCourses = new ArrayList<>();
+ ApplicationManager.getApplication().invokeAndWait(() -> {
+ List courses = generator.getCoursesUnderProgress(true, title, defaultProject);
+ availableCourses.addAll(courses);
+ });
+ for (Course course : availableCourses) {
+ if (course instanceof RemoteCourse && ((RemoteCourse)course).getId() == courseId) {
+ return EduProjectCreator.createProject(course);
+ }
+ }
return false;
}
}