mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed course archive generation
This commit is contained in:
@@ -307,7 +307,7 @@ public class CCUtils {
|
||||
});
|
||||
if (task.getTestsText().isEmpty()) return null;
|
||||
lesson.addTask(task);
|
||||
lesson.setIndex(1);
|
||||
lesson.setIndex(course.getLessons().size());
|
||||
return lesson;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class CCVirtualFileListener implements VirtualFileListener {
|
||||
return;
|
||||
}
|
||||
|
||||
task.addTaskFile(taskRelativePath, 1);
|
||||
task.addTaskFile(taskRelativePath, task.getTaskFiles().size()+1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
@@ -97,6 +97,7 @@ public class CCCreateCourseArchive extends DumbAwareAction {
|
||||
archiveFolder.refresh(false, true);
|
||||
Course courseCopy = course.copy();
|
||||
replaceAnswerFilesWithTaskFiles(courseCopy);
|
||||
courseCopy.sortLessons();
|
||||
additionalFiles(courseCopy);
|
||||
generateJson(archiveFolder, courseCopy);
|
||||
VirtualFileManager.getInstance().refreshWithoutFileWatcher(false);
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -200,6 +201,10 @@ public class Course {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void sortLessons() {
|
||||
Collections.sort(lessons, EduUtils.INDEX_COMPARATOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getName();
|
||||
|
||||
Reference in New Issue
Block a user