Fix according to review IDEA-CR-11509
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Wed, 15 Jun 2016 18:17:37 +0000 (21:17 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Wed, 15 Jun 2016 18:19:27 +0000 (21:19 +0300)
python/educational-core/student/src/com/jetbrains/edu/learning/StudyUtils.java
python/educational-core/student/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java
python/educational-core/student/src/com/jetbrains/edu/learning/stepic/CourseInfo.java
python/educational-core/student/src/com/jetbrains/edu/learning/stepic/EduAdaptiveStepicConnector.java
python/educational-core/student/src/com/jetbrains/edu/learning/stepic/LoginDialog.java
python/educational-core/student/src/com/jetbrains/edu/learning/stepic/StepicUser.java
python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java
python/educational-core/student/src/com/jetbrains/edu/learning/ui/StudyTestResultsToolWindowFactory.kt

index 175007d52afcc5646cd1132f21fe2ec907b1a0d3..ea45745a363b548c3f4b2538ad388326296921bf 100644 (file)
@@ -629,7 +629,7 @@ public class StudyUtils {
     return null;
   }
 
-  // supposd to be called under progress
+  // supposed to be called under progress
   @Nullable
   public static <T> T execCancelable(@NotNull final Callable<T> callable) {
     final Future<T> future = ApplicationManager.getApplication().executeOnPooledThread(callable);
index 2200c7b791cbb989b9808316e0c9c6c079fe7c22..1062a90897f4c2a86c937abc5929b2d7916f3abe 100644 (file)
@@ -334,7 +334,7 @@ public class StudyProjectGenerator {
   }
 
   // Supposed to be called under progress
-  public List<CourseInfo> getCoursesAsynchronouslyIfNeeded(boolean force) {
+  public List<CourseInfo> getCourses(boolean force) {
     if (OUR_COURSES_DIR.exists()) {
       myCourses = getCoursesFromCache();
     }
@@ -355,7 +355,7 @@ public class StudyProjectGenerator {
           @Override
           public List<CourseInfo> compute() throws RuntimeException {
             ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
-            return getCoursesAsynchronouslyIfNeeded(force);
+            return getCourses(force);
           }
         }, progressTitle, true, project);
     }
index c8c0c90aaf0480ad80e835330be523892a816934..b56d7a66485c919d6ae7d29c59df4802983c6a0c 100644 (file)
@@ -1,7 +1,6 @@
 package com.jetbrains.edu.learning.stepic;
 
 import com.google.gson.annotations.SerializedName;
-import com.intellij.openapi.util.text.StringUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -75,27 +74,6 @@ public class CourseInfo {
     this.username = username;
   }
 
-  public static class Author {
-    int id;
-    String first_name = "";
-    String last_name = "";
-
-    public Author() {}
-
-    public Author(String firstName, String lastName) {
-      first_name = firstName;
-      last_name = lastName;
-    }
-
-    public String getName() {
-      return StringUtil.join(new String[]{first_name, last_name}, " ");
-    }
-
-    public int getId() {
-      return id;
-    }
-  }
-
   public void setName(String name) {
     myName = name;
   }
index 3da3bfc16b78983383c8abccec6483429be8e62f..7301a5491c0b852c32f6f7e29f62fb223ce6a7d8 100644 (file)
@@ -195,6 +195,7 @@ public class EduAdaptiveStepicConnector {
             unsolvedTask.setStepicId(task.getStepicId());
             unsolvedTask.setText(task.getText());
             unsolvedTask.getTestsText().clear();
+            unsolvedTask.setStatus(StudyStatus.Unchecked);
             final Map<String, String> testsText = task.getTestsText();
             for (String testName : testsText.keySet()) {
               unsolvedTask.addTestsTexts(testName, testsText.get(testName));
index 09a132765873de2df00f88ab947caa5b0f7c0e25..c4805500fe09d7dc8d0d5634d0c5dcef6f22b8b8 100644 (file)
@@ -14,7 +14,6 @@ public class LoginDialog extends DialogWrapper {
     myLoginPanel = new LoginPanel(this);
     setTitle("Login to Stepic");
     setOKButtonText("Login");
-    setTitle("Login to Stepic");
     init();
   }
 
index ff40e3428d37003c0021b907b152eee17ecdfa6e..9c9f468debc52bdbda094a86acb421ea89cc2a78 100644 (file)
@@ -11,7 +11,7 @@ public class StepicUser {
   private static final Logger LOG = Logger.getInstance(StepicUser.class);
   int id;
   String firstName;
-  String last_name;
+  String lastName;
   String email;
 
   public StepicUser() {
@@ -39,11 +39,11 @@ public class StepicUser {
   }
 
   public String getLastName() {
-    return last_name;
+    return lastName;
   }
 
   public void setLastName(String last_name) {
-    this.last_name = last_name;
+    this.lastName = last_name;
   }
 
   public String getEmail() {
@@ -80,6 +80,6 @@ public class StepicUser {
   }
 
   public String getName() {
-    return StringUtil.join(new String[]{firstName, last_name}, " ");
+    return StringUtil.join(new String[]{firstName, lastName}, " ");
   }
 }
index 8f4475372b8515239d9fab01df651aef0caf4afc..18633c8a7b579c038f047b5cb07c2a290736d4a8 100644 (file)
@@ -20,7 +20,6 @@ import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.ui.AncestorListenerAdapter;
-import com.intellij.util.Consumer;
 import com.jetbrains.edu.learning.StudyUtils;
 import com.jetbrains.edu.learning.courseFormat.Course;
 import com.jetbrains.edu.learning.courseGeneration.StudyProjectGenerator;
@@ -313,7 +312,7 @@ public class StudyNewProjectPanel {
           myGenerator.myUser = stepicUser;
 
 
-          final List<CourseInfo> courses = myGenerator.getCoursesAsynchronouslyIfNeeded(true);
+          final List<CourseInfo> courses = myGenerator.getCourses(true);
           if (courses != null) {
             ApplicationManager.getApplication().invokeLater(() -> refreshCoursesList(courses));
           }
index 652d758ebfc6ccc743cb07b8f1a9a0515e74c0c2..549d4dd288a992d190ab27591b706e4f20fe2f0e 100644 (file)
@@ -6,11 +6,12 @@ import com.intellij.openapi.fileEditor.FileEditorManagerListener
 import com.intellij.openapi.project.Project
 import com.intellij.openapi.vfs.VirtualFile
 import com.intellij.openapi.wm.ToolWindow
+import com.intellij.openapi.wm.ToolWindowFactory
 import com.jetbrains.edu.learning.StudyUtils
 import com.jetbrains.python.console.PythonConsoleView
 
 
-class StudyTestResultsToolWindowFactory: StudyToolWindowFactory() {  
+class StudyTestResultsToolWindowFactory: ToolWindowFactory {  
   override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
     val currentTask = StudyUtils.getCurrentTask(project)
     if (currentTask != null) {