Importing more than one lesson at a time?

That’s right. Will support further inclusions. e.g pics/description/inline images?

The order of upload is actually determined by the sorting options on your pc.

here is the relevant code

async function processFolder(files) {
    let courseTitle = null;
    let lessons = [];

    for (let file of files) {
        const filePath = file.webkitRelativePath.split("/");
        if (!courseTitle) {
            courseTitle = filePath[0];  // Set the course title using the main folder name
        }

        if (filePath.length === 3) {  // Indicates a file inside a lesson folder
            const lessonFolderName = filePath[1];
            const fileName = filePath[2];
            let lesson = lessons.find(l => l.folderName === lessonFolderName);
            if (!lesson) {
                lesson = { folderName: lessonFolderName, text: null, audio: null, title: null };
                lessons.push(lesson);
            }

            if (fileName.endsWith(".txt")) {
                const content = await file.text();
                lesson.title = content.split("\n")[0];
                lesson.text = content;
            } else if (fileName.endsWith(".mp3")) {
                lesson.audio = file;
            }
        }
    }

    // Now you have the course title and an array of lessons with their title, text, and audio.
    // You can proceed to create the course and its lessons on LingQ.
    createCourseOnLingQ(courseTitle, "Course Description")
        .then(courseResponse => {
            // Using the course response (which should contain the course ID), create each lesson
            for (let lesson of lessons) {
                createLessonOnLingQ(
                    lesson.title,
                    "Lesson Description",
                    lesson.text,
                    courseResponse.id,  // Assuming the course response contains the course ID
                    lesson.audio
                );
            }
        });
}