private String myName;
@SerializedName("summary")
private String myDescription;
+ @SerializedName("course_format")
+ //course type in format "pycharm <language>"
+ private String myType;
private String myAuthor;
- public static CourseInfo INVALID_COURSE = new CourseInfo("", "", "");
+ public static CourseInfo INVALID_COURSE = new CourseInfo("", "", "", "");
- public CourseInfo(String name, String author, String description) {
+ public CourseInfo(String name, String author, String description, String type) {
myName = name;
myAuthor = author;
myDescription = description;
+ myType = type;
}
public String getName() {
return myDescription;
}
+ public String getType() {
+ return myType;
+ }
+
@Override
public String toString() {
return myName;
private static final String ourDomain = "stepic.org";
private static String ourSessionId = "524iethiwju2tjywaqmf7tbwx0p0jk1b";
private static String ourCSRFToken = "LJ9n6OyLVA7hxU94dlYWUu65MF51Nx37";
+ //this prefix indicates that course can be opened by educational plugin
+ public static final String PYCHARM_PREFIX = "pycharm ";
private EduStepicConnector() {
}
course.setAuthor(info.getAuthor());
course.setDescription(info.getDescription());
course.setName(info.getName());
- course.setLanguage("Python"); // TODO: get from stepic
+ String courseType = info.getType();
+ course.setLanguage(courseType.substring(PYCHARM_PREFIX.length()));
course.setUpToDate(true); // TODO: get from stepic
try {
for (Integer section : info.sections) {