use of org.stepik.api.client.StepikApiClient in project intellij-plugins by StepicOrg.
the class StepHelper method solvedLesson.
public boolean solvedLesson() {
try {
StudyNode lesson = stepNode.getParent();
if (lesson == null) {
return false;
}
StudyObject data = lesson.getData();
if (data == null) {
return false;
}
String progressId = data.getProgress();
StepikApiClient stepikApiClient = authAndGetStepikApiClient();
Progresses progresses = stepikApiClient.progresses().get().id(progressId).execute();
return !progresses.isEmpty() && progresses.getFirst().isPassed();
} catch (StepikClientException e) {
logger.warn(e);
}
return false;
}
use of org.stepik.api.client.StepikApiClient in project intellij-plugins by StepicOrg.
the class Utils method getCourseStudyObject.
@NotNull
private static StudyObject getCourseStudyObject(long id) {
StepikApiClient stepikApiClient = authAndGetStepikApiClient();
Course course = getCourse(stepikApiClient, id);
return course != null ? course : EMPTY_STUDY_OBJECT;
}
Aggregations