add "posted from pycharm" comment for adaptive tasks
authorEkaterina Tuzova <Ekaterina.Tuzova@jetbrains.com>
Fri, 29 Jul 2016 14:01:18 +0000 (17:01 +0300)
committerEkaterina Tuzova <Ekaterina.Tuzova@jetbrains.com>
Fri, 29 Jul 2016 14:02:06 +0000 (17:02 +0300)
python/educational-core/student/src/com/jetbrains/edu/learning/stepic/EduAdaptiveStepicConnector.java

index 787e0ee5c4d1c21312681ab6dca6aca74232907a..ced98a78dd423cc428f2504d1d6a86f8401befad 100644 (file)
@@ -59,6 +59,7 @@ import static com.jetbrains.edu.learning.stepic.EduStepicConnector.*;
 public class EduAdaptiveStepicConnector {
   public static final String PYTHON27 = "python27";
   public static final String PYTHON3 = "python3";
+  public static final String PYCHARM_COMMENT = "# Posted from PyCharm Edu\n";
   private static final Logger LOG = Logger.getInstance(EduAdaptiveStepicConnector.class);
   private static final int CONNECTION_TIMEOUT = 60 * 1000;
 
@@ -437,7 +438,7 @@ public class EduAdaptiveStepicConnector {
     final CloseableHttpResponse response;
     try {
       final StepicWrappers.SubmissionToPostWrapper submissionToPostWrapper =
-        new StepicWrappers.SubmissionToPostWrapper(String.valueOf(attemptId), language, text);
+        new StepicWrappers.SubmissionToPostWrapper(String.valueOf(attemptId), language, PYCHARM_COMMENT + text);
       final HttpPost httpPost = new HttpPost(EduStepicNames.STEPIC_API_URL + EduStepicNames.SUBMISSIONS);
       setHeaders(httpPost, EduStepicNames.CONTENT_TYPE_APPL_JSON);
       setTimeout(httpPost);