Search in sources :

Example 11 with CompoundUnitLesson

use of org.stepik.api.objects.lessons.CompoundUnitLesson in project intellij-plugins by StepicOrg.

the class StudyNodeFactory method createTree.

public static StudyNode createTree(@NotNull Project project, @NotNull StepikApiClient stepikApiClient, @NotNull StudyObject data) {
    StudyNode root = null;
    if (data instanceof Course) {
        root = new CourseNode(project, stepikApiClient, (Course) data);
    } else if (data instanceof Section) {
        root = new SectionNode(project, stepikApiClient, (Section) data);
    } else if (data instanceof Lesson) {
        CompoundUnitLesson compoundData = new CompoundUnitLesson(null, (Lesson) data);
        root = new LessonNode(project, stepikApiClient, compoundData);
    } else if (data instanceof CompoundUnitLesson) {
        root = new LessonNode(project, stepikApiClient, (CompoundUnitLesson) data);
    } else if (data instanceof Step) {
        root = new StepNode(project, stepikApiClient, (Step) data);
    }
    return root;
}
Also used : CompoundUnitLesson(org.stepik.api.objects.lessons.CompoundUnitLesson) Step(org.stepik.api.objects.steps.Step) Course(org.stepik.api.objects.courses.Course) Section(org.stepik.api.objects.sections.Section) Lesson(org.stepik.api.objects.lessons.Lesson) CompoundUnitLesson(org.stepik.api.objects.lessons.CompoundUnitLesson)

Aggregations

CompoundUnitLesson (org.stepik.api.objects.lessons.CompoundUnitLesson)11 StepikClientException (org.stepik.api.exceptions.StepikClientException)6 Lesson (org.stepik.api.objects.lessons.Lesson)3 Section (org.stepik.api.objects.sections.Section)3 Unit (org.stepik.api.objects.units.Unit)3 Units (org.stepik.api.objects.units.Units)3 Test (org.junit.Test)2 Lessons (org.stepik.api.objects.lessons.Lessons)2 Step (org.stepik.api.objects.steps.Step)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 NotNull (org.jetbrains.annotations.NotNull)1 StepikApiClient (org.stepik.api.client.StepikApiClient)1 Course (org.stepik.api.objects.courses.Course)1 Sections (org.stepik.api.objects.sections.Sections)1 Steps (org.stepik.api.objects.steps.Steps)1 StepikAuthManager.authAndGetStepikApiClient (org.stepik.core.stepik.StepikAuthManager.authAndGetStepikApiClient)1